ziwen 1 year ago
parent
commit
e77762109f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      models/fms/invoice_payment_summary.go

+ 1 - 1
models/fms/invoice_payment_summary.go

@@ -148,7 +148,7 @@ func GetSummaryListCurrencySum(condition string, pars []interface{}, amountType
 		joinCond = `a.payment_id = b.contract_invoice_id`
 	}
 	query := global.DEFAULT_MYSQL.Table("invoice_payment_summary AS a").
-		Select("b.currency_unit, b.invoice_type, SUM(b.amount) AS amount_total, SUM(b.origin_amount) AS origin_amount_total").
+		Select("b.currency_unit, b.invoice_type, IFNULL(SUM(b.amount),0) AS amount_total, IFNULL(SUM(b.origin_amount),0) AS origin_amount_total").
 		Joins(fmt.Sprintf("JOIN contract_invoice AS b ON %s AND b.is_deleted = 0", joinCond)).
 		Where(condition, pars...).
 		Group("b.currency_unit")