|
@@ -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")
|