|
@@ -1974,24 +1974,35 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- invoiceSumMap := make(map[string]float64)
|
|
|
- contractSumMap := make(map[string]float64)
|
|
|
- contractIdSumMap := make(map[int]int)
|
|
|
+ invoiceSumMap := make(map[string]map[int]float64)
|
|
|
+ contractSumMap := make(map[string]map[int]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.InvoicedAmount
|
|
|
+ invoiceSumMap[v.CurrencyUnit][v.ServiceProductId] += v.InvoicedAmount
|
|
|
} else {
|
|
|
- invoiceSumMap[v.CurrencyUnit] += v.PaymentAmount
|
|
|
+ invoiceSumMap[v.CurrencyUnit][v.ServiceProductId] += v.PaymentAmount
|
|
|
}
|
|
|
- if _, ok := contractIdSumMap[v.ContractRegisterId]; !ok {
|
|
|
- contractIdSumMap[v.ContractRegisterId] = 1
|
|
|
- contractSumMap[v.CurrencyUnit] += v.ContractAmount
|
|
|
+ //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)
|
|
|
}
|
|
|
+ contractSumMap[v.CurrencyUnit][v.ProductId] += v.ServiceAmount
|
|
|
}
|
|
|
|
|
|
for _, v := range contractAmountCurrencyTotals {
|
|
|
- v.Amount = contractSumMap[v.Code] - invoiceSumMap[v.Code]
|
|
|
+ ficcAmuount := contractSumMap[v.Code][1] - invoiceSumMap[v.Code][1]
|
|
|
+ raiAmuount := contractSumMap[v.Code][2] - invoiceSumMap[v.Code][2]
|
|
|
+ v.Amount = ficcAmuount+raiAmuount
|
|
|
}
|
|
|
|
|
|
}()
|