|
@@ -13,6 +13,7 @@ import (
|
|
|
fmsService "hongze/fms_api/services/fms"
|
|
|
"hongze/fms_api/utils"
|
|
|
"net/http"
|
|
|
+ "strconv"
|
|
|
"strings"
|
|
|
"time"
|
|
|
)
|
|
@@ -210,6 +211,8 @@ func (ct *InvoicePaymentController) List(c *gin.Context) {
|
|
|
for i := range amountTotalList {
|
|
|
amountTotalMap[amountTotalList[i].InvoiceType] = amountTotalList[i].TotalAmount
|
|
|
}
|
|
|
+ invoiceTotal, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", amountTotalMap[fms.ContractInvoiceTypeMake]), 64)
|
|
|
+ paymentTotal, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", amountTotalMap[fms.ContractInvoiceTypePay]), 64)
|
|
|
|
|
|
// 分币种金额统计
|
|
|
currencyOB := new(fms.CurrencyUnit)
|
|
@@ -255,15 +258,17 @@ func (ct *InvoicePaymentController) List(c *gin.Context) {
|
|
|
}
|
|
|
}
|
|
|
for i := range invoiceCurrencyTotals {
|
|
|
- invoiceCurrencyTotals[i].Amount = invoiceSumMap[invoiceCurrencyTotals[i].Code]
|
|
|
+ a, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", invoiceSumMap[invoiceCurrencyTotals[i].Code]), 64)
|
|
|
+ invoiceCurrencyTotals[i].Amount = a
|
|
|
}
|
|
|
for i := range paymentCurrencyTotals {
|
|
|
- paymentCurrencyTotals[i].Amount = paymentSumMap[paymentCurrencyTotals[i].Code]
|
|
|
+ a, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", paymentSumMap[paymentCurrencyTotals[i].Code]), 64)
|
|
|
+ paymentCurrencyTotals[i].Amount = a
|
|
|
}
|
|
|
|
|
|
results.DataList = respList
|
|
|
- results.InvoiceTotal = amountTotalMap[fms.ContractInvoiceTypeMake]
|
|
|
- results.PaymentTotal = amountTotalMap[fms.ContractInvoiceTypePay]
|
|
|
+ results.InvoiceTotal = invoiceTotal
|
|
|
+ results.PaymentTotal = paymentTotal
|
|
|
results.InvoiceCurrencyTotal = invoiceCurrencyTotals
|
|
|
results.PaymentCurrencyTotal = paymentCurrencyTotals
|
|
|
}
|