hsun 2 năm trước cách đây
mục cha
commit
0cdded3cc4
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      models/fms/invoice_payment_summary.go

+ 1 - 1
models/fms/invoice_payment_summary.go

@@ -125,7 +125,7 @@ func GetContractSummaryInvoicePaymentAmountTotal(condition string, pars []interf
 		joinCond = `a.payment_id = b.contract_invoice_id`
 	}
 	query := global.DEFAULT_MYSQL.Table("invoice_payment_summary AS a").
-		Select("SUM(b.amount)").
+		Select("IFNULL(SUM(b.amount),0)").
 		Joins(fmt.Sprintf("JOIN contract_invoice AS b ON %s AND b.is_deleted = 0", joinCond)).
 		Where(condition, pars...)
 	err = query.Find(&amountTotal).Error