|
@@ -1912,10 +1912,10 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
|
|
|
contractIdSumMap := make(map[int]int)
|
|
|
|
|
|
for _, v := range registerList {
|
|
|
- if v.InvoicedAmountCount >= v.PaymentAmountCount {
|
|
|
- invoiceTotal += v.InvoicedAmountCount
|
|
|
- } else if v.InvoicedAmountCount == 0 {
|
|
|
- invoiceTotal += v.PaymentAmountCount
|
|
|
+ if v.InvoicedAmount >= v.PaymentAmount {
|
|
|
+ invoiceTotal += v.InvoicedAmount
|
|
|
+ } else if v.InvoicedAmount == 0 {
|
|
|
+ invoiceTotal += v.PaymentAmount
|
|
|
}
|
|
|
rate := v.RMBRate
|
|
|
if rate == 0.0 {
|
|
@@ -1974,35 +1974,24 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- invoiceSumMap := make(map[string]map[int]float64)
|
|
|
- contractSumMap := make(map[string]map[int]float64)
|
|
|
- //contractIdSumMap := make(map[int]int)
|
|
|
+ invoiceSumMap := make(map[string]float64)
|
|
|
+ contractSumMap := make(map[string]float64)
|
|
|
+ contractIdSumMap := make(map[int]int)
|
|
|
|
|
|
for _, v := range registerList {
|
|
|
- if _,ok := invoiceSumMap[v.CurrencyUnit]; !ok{
|
|
|
- invoiceSumMap[v.CurrencyUnit] = make(map[int]float64)
|
|
|
- }
|
|
|
if v.InvoiceOrigin >= v.PaymentOrigin {
|
|
|
- invoiceSumMap[v.CurrencyUnit][v.ServiceProductId] += v.InvoicedAmount
|
|
|
+ invoiceSumMap[v.CurrencyUnit] += v.InvoicedAmount
|
|
|
} else {
|
|
|
- invoiceSumMap[v.CurrencyUnit][v.ServiceProductId] += v.PaymentAmount
|
|
|
+ invoiceSumMap[v.CurrencyUnit] += v.PaymentAmount
|
|
|
}
|
|
|
- //if _, ok := contractIdSumMap[v.ContractRegisterId]; !ok {
|
|
|
- // contractIdSumMap[v.ContractRegisterId] = 1
|
|
|
- // contractSumMap[v.CurrencyUnit] += v.ContractAmount
|
|
|
- //}
|
|
|
- }
|
|
|
- for _, v := range serviceAmountList {
|
|
|
- if _,ok := contractSumMap[v.CurrencyUnit]; !ok{
|
|
|
- contractSumMap[v.CurrencyUnit] = make(map[int]float64)
|
|
|
+ if _, ok := contractIdSumMap[v.ContractRegisterId]; !ok {
|
|
|
+ contractIdSumMap[v.ContractRegisterId] = 1
|
|
|
+ contractSumMap[v.CurrencyUnit] += v.ContractAmount
|
|
|
}
|
|
|
- contractSumMap[v.CurrencyUnit][v.ProductId] += v.ServiceAmount
|
|
|
}
|
|
|
|
|
|
for _, v := range contractAmountCurrencyTotals {
|
|
|
- ficcAmuount := contractSumMap[v.Code][1] - invoiceSumMap[v.Code][1]
|
|
|
- raiAmuount := contractSumMap[v.Code][2] - invoiceSumMap[v.Code][2]
|
|
|
- v.Amount = ficcAmuount+raiAmuount
|
|
|
+ v.Amount = contractSumMap[v.Code] - invoiceSumMap[v.Code]
|
|
|
}
|
|
|
|
|
|
}()
|