|
@@ -846,7 +846,7 @@ func (ct *InvoicePaymentController) List(c *gin.Context) {
|
|
|
|
|
|
amountCond := `a.id IN ? AND (a.invoice_id <> 0 OR (a.payment_id <> 0 AND a.invoice_id =0))`
|
|
|
amountPars := make([]interface{}, 0)
|
|
|
- amountPars = append(amountTotalPars, summaryIds)
|
|
|
+ amountPars = append(amountPars, summaryIds)
|
|
|
amountSum, e := fms.GetContractSummaryInvoicePaymentAmount(amountCond, amountPars)
|
|
|
if e != nil {
|
|
|
totalErr = fmt.Errorf("获取汇总金额合计失败, Err: %s", e.Error())
|
|
@@ -1166,10 +1166,11 @@ func getCensusIncomeListV2(ch chan models.CensusIncomeChartResp, req fms.IncomeL
|
|
|
var amountTotal float64
|
|
|
|
|
|
if len(summaryIds) > 0 {
|
|
|
- amountCond := `a.id IN ? AND (a.invoice_id <> 0 OR (a.payment_id <> 0 AND a.invoice_id =0))`
|
|
|
+ amountCond := `a.id IN ? `
|
|
|
amountPars := make([]interface{}, 0)
|
|
|
amountPars = append(amountPars, summaryIds)
|
|
|
- amountCond += ` AND (b.invoice_time BETWEEN ? AND ?) OR (d.invoice_time BETWEEN ? AND ?)`
|
|
|
+ amountCond += ` AND ((a.invoice_id <> 0 AND b.invoice_time BETWEEN ? AND ?)`
|
|
|
+ amountCond += `OR (a.payment_id <> 0 AND a.invoice_id = 0 AND d.invoice_time BETWEEN ? AND ?))`
|
|
|
amountPars = append(amountPars, st, ed, st, ed)
|
|
|
results, e := fms.GetContractSummaryIncomeAmount(amountCond, amountPars)
|
|
|
if e != nil {
|
|
@@ -1181,6 +1182,7 @@ func getCensusIncomeListV2(ch chan models.CensusIncomeChartResp, req fms.IncomeL
|
|
|
for _, result := range results {
|
|
|
incomeChart.DataList = append(incomeChart.DataList, result)
|
|
|
amountSum += result.Amount
|
|
|
+ fmt.Println("result.Amount:",result.Amount)
|
|
|
}
|
|
|
amountTotal, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", amountSum), 64)
|
|
|
accumulate += amountTotal
|
|
@@ -1257,10 +1259,11 @@ func getCensusIncomeListV2(ch chan models.CensusIncomeChartResp, req fms.IncomeL
|
|
|
var prevAmountTotal float64
|
|
|
|
|
|
if len(prevSummaryIds) > 0 {
|
|
|
- amountCond := `a.id IN ? AND (a.invoice_id <> 0 OR (a.payment_id <> 0 AND a.invoice_id =0))`
|
|
|
+ amountCond := `a.id IN ? `
|
|
|
amountPars := make([]interface{}, 0)
|
|
|
amountPars = append(amountPars, prevSummaryIds)
|
|
|
- amountCond += ` AND (b.invoice_time BETWEEN ? AND ?) OR (d.invoice_time BETWEEN ? AND ?)`
|
|
|
+ amountCond += ` AND ((a.invoice_id <> 0 AND b.invoice_time BETWEEN ? AND ?)`
|
|
|
+ amountCond += `OR (a.payment_id <> 0 AND a.invoice_id = 0 AND d.invoice_time BETWEEN ? AND ?))`
|
|
|
amountPars = append(amountPars, prevSt, prevEd)
|
|
|
results, e := fms.GetContractSummaryIncomeAmount(amountCond, amountPars)
|
|
|
if e != nil {
|