Prechádzať zdrojové kódy

商品到款统计展示换算前金额

hsun 2 rokov pred
rodič
commit
435a5d460f

+ 3 - 1
controller/contract/register.go

@@ -416,6 +416,7 @@ func (rg *RegisterController) Edit(c *gin.Context) {
 	invoiceUpdateCols := make([]string, 0)
 
 	// 开票到款操作类型: 0-无; 1-更新; 2-删除;
+	logRemark := req.Remark
 	invoiceHandleType := 0
 	if originHasPayment == 0 && req.HasPayment == 1 {
 		// 若从无代付修改为有代付, 则删除无代付期间新增的所有开票到款登记
@@ -451,6 +452,7 @@ func (rg *RegisterController) Edit(c *gin.Context) {
 			}
 			invoiceUpdateCols = append(invoiceUpdateCols, "CurrencyUnit", "Amount")
 			invoiceHandleType = 1
+			logRemark = fmt.Sprintf("金额单位由%s修改为%s\n%s", item.CurrencyUnit, req.CurrencyUnit, logRemark)
 		}
 	}
 
@@ -486,7 +488,7 @@ func (rg *RegisterController) Edit(c *gin.Context) {
 		logItem.OpData = opData
 		logItem.OpType = fms.ContractRegisterOpTypeEdit
 		logItem.CreateTime = nowTime
-		logItem.Remark = req.Remark
+		logItem.Remark = logRemark
 		if e = logItem.Create(); e != nil {
 			return
 		}

+ 4 - 4
services/fms/invoice_payment.go

@@ -105,7 +105,7 @@ func MergeInvoiceList2InvoicePaymentCensusInfo(invoiceList []*fms.ContractInvoic
 			v := new(fms.InvoicePaymentCensusInfo)
 			v.InvoiceId = invoiceList[i].ContractInvoiceId
 			v.InvoiceDate = invoiceList[i].InvoiceDate.Format(utils.FormatDate)
-			v.InvoiceAmount = invoiceList[i].Amount
+			v.InvoiceAmount = invoiceList[i].OriginAmount
 			v.SellerId = invoiceList[i].SellerId
 			v.SellerName = invoiceList[i].SellerName
 			v.SellerGroupId = invoiceList[i].SellerGroupId
@@ -116,7 +116,7 @@ func MergeInvoiceList2InvoicePaymentCensusInfo(invoiceList []*fms.ContractInvoic
 				if payItem != nil {
 					v.PaymentId = payItem.ContractInvoiceId
 					v.PaymentDate = payItem.InvoiceDate.Format(utils.FormatDate)
-					v.PaymentAmount = payItem.Amount
+					v.PaymentAmount = payItem.OriginAmount
 					v.PayType = payItem.PayType
 					v.ServiceAmountList = serviceAmountMap[payItem.ContractInvoiceId]
 				}
@@ -132,7 +132,7 @@ func MergeInvoiceList2InvoicePaymentCensusInfo(invoiceList []*fms.ContractInvoic
 			v := new(fms.InvoicePaymentCensusInfo)
 			v.PaymentId = paymentList[i].ContractInvoiceId
 			v.PaymentDate = paymentList[i].InvoiceDate.Format(utils.FormatDate)
-			v.PaymentAmount = paymentList[i].Amount
+			v.PaymentAmount = paymentList[i].OriginAmount
 			v.PayType = paymentList[i].PayType
 			v.ServiceAmountList = serviceAmountMap[paymentList[i].ContractInvoiceId]
 			// 直接取对应键的开票
@@ -141,7 +141,7 @@ func MergeInvoiceList2InvoicePaymentCensusInfo(invoiceList []*fms.ContractInvoic
 				if invoiceItem != nil {
 					v.InvoiceId = invoiceItem.ContractInvoiceId
 					v.InvoiceDate = invoiceItem.InvoiceDate.Format(utils.FormatDate)
-					v.InvoiceAmount = invoiceItem.Amount
+					v.InvoiceAmount = invoiceItem.OriginAmount
 					v.SellerId = invoiceItem.SellerId
 					v.SellerName = invoiceItem.SellerName
 					v.SellerGroupId = invoiceList[i].SellerGroupId