|
@@ -497,6 +497,7 @@ func (rg *RegisterController) Add(c *gin.Context) {
|
|
|
TeamName: ppItem.SellerTeamName,
|
|
|
}
|
|
|
j++
|
|
|
+ ob.InvoicedAmount += ppItem.Amount
|
|
|
} else if ppItem.InvoiceType == 4 {
|
|
|
v.InvoiceType = 2
|
|
|
if sellerItem, ok := sellerItemMap[k]; ok {
|
|
@@ -508,6 +509,7 @@ func (rg *RegisterController) Add(c *gin.Context) {
|
|
|
v.SellerTeamName = sellerItem.TeamName
|
|
|
}
|
|
|
k++
|
|
|
+ ob.PaymentAmount += ppItem.Amount
|
|
|
}
|
|
|
v.Set()
|
|
|
// 到款登记-付款方式
|
|
@@ -577,6 +579,7 @@ func (rg *RegisterController) Add(c *gin.Context) {
|
|
|
}
|
|
|
if ppItem.InvoiceType == 3 {
|
|
|
v.InvoiceType = 1
|
|
|
+ ob.InvoicedAmount += ppItem.Amount
|
|
|
} else if ppItem.InvoiceType == 4 {
|
|
|
v.InvoiceType = 2
|
|
|
if sellerItem, ok := sellerItemMap[j]; ok {
|
|
@@ -588,6 +591,7 @@ func (rg *RegisterController) Add(c *gin.Context) {
|
|
|
v.SellerTeamName = sellerItem.TeamName
|
|
|
}
|
|
|
j++
|
|
|
+ ob.PaymentAmount += ppItem.Amount
|
|
|
}
|
|
|
v.Set()
|
|
|
// 到款登记-付款方式
|
|
@@ -760,6 +764,7 @@ func (rg *RegisterController) Add(c *gin.Context) {
|
|
|
}
|
|
|
if ppItem.InvoiceType == 3 {
|
|
|
v.InvoiceType = 1
|
|
|
+ ob.InvoicedAmount += ppItem.Amount
|
|
|
} else if ppItem.InvoiceType == 4 {
|
|
|
v.InvoiceType = 2
|
|
|
if sellerItem, ok := sellerItemMap[j]; ok {
|
|
@@ -772,6 +777,7 @@ func (rg *RegisterController) Add(c *gin.Context) {
|
|
|
|
|
|
j++
|
|
|
}
|
|
|
+ ob.PaymentAmount += ppItem.Amount
|
|
|
}
|
|
|
v.Set()
|
|
|
// 到款登记-付款方式
|
|
@@ -833,6 +839,11 @@ func (rg *RegisterController) Add(c *gin.Context) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ updateCols := []string{"InvoicedAmount", "PaymentAmount"}
|
|
|
+ if e = ob.Update(updateCols); e != nil {
|
|
|
+ resp.FailMsg("操作失败", "更新合同登记失败, Err:"+e.Error(), c)
|
|
|
+ return
|
|
|
+ }
|
|
|
// 开票到款汇总
|
|
|
go fmsService.SummaryInvoicePaymentByContractRegisterId(ob.ContractRegisterId)
|
|
|
// 自动分配套餐金额
|
|
@@ -3561,6 +3572,7 @@ func (rg *RegisterController) Import(c *gin.Context) {
|
|
|
resp.Fail(fmt.Sprintf("第%d行开票信息必填项不完整", i+1), c)
|
|
|
return
|
|
|
}
|
|
|
+ rowRegister.InvoicedAmount += rowInvoices[l].Amount
|
|
|
rowInvoiceList = append(rowInvoiceList, rowInvoices[l])
|
|
|
}
|
|
|
}
|
|
@@ -3570,6 +3582,7 @@ func (rg *RegisterController) Import(c *gin.Context) {
|
|
|
resp.Fail(fmt.Sprintf("第%d行到款信息必填项不完整", i+1), c)
|
|
|
return
|
|
|
}
|
|
|
+ rowRegister.PaymentAmount += rowPayments[l].Amount
|
|
|
rowInvoiceList = append(rowInvoiceList, rowPayments[l])
|
|
|
}
|
|
|
}
|
|
@@ -3652,6 +3665,7 @@ func (rg *RegisterController) Import(c *gin.Context) {
|
|
|
}
|
|
|
if ppItem.InvoiceType == 3 {
|
|
|
v.InvoiceType = 1
|
|
|
+ rowRegister.InvoicedAmount += ppItem.Amount
|
|
|
} else if ppItem.InvoiceType == 4 {
|
|
|
v.InvoiceType = 2
|
|
|
if sellerItem, ok := sellerItemMap[j]; ok {
|
|
@@ -3664,6 +3678,7 @@ func (rg *RegisterController) Import(c *gin.Context) {
|
|
|
|
|
|
j++
|
|
|
}
|
|
|
+ rowRegister.PaymentAmount += ppItem.Amount
|
|
|
}
|
|
|
v.Set()
|
|
|
// 到款登记-付款方式
|
|
@@ -3699,6 +3714,11 @@ func (rg *RegisterController) Import(c *gin.Context) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ updateCols := []string{"PaymentAmount", "InvoicedAmount"}
|
|
|
+ if e = rowRegister.Update(updateCols); e != nil {
|
|
|
+ resp.FailMsg("操作失败", "更新合同登记失败, Err:"+e.Error(), c)
|
|
|
+ return
|
|
|
+ }
|
|
|
//最后删除预到款记录
|
|
|
e = ppItem.Delete()
|
|
|
if e != nil {
|