|
@@ -214,10 +214,12 @@ func GetContractSummaryIncomeAmount(condition string, pars []interface{}) (resul
|
|
|
" c.contract_type,c.company_name,"+
|
|
|
"IF(a.invoice_id=0,d.seller_name, b.seller_name) AS seller_name,"+
|
|
|
"IF(a.invoice_id=0,d.seller_id, b.seller_id) AS final_seller_id,"+
|
|
|
- "IF(a.invoice_id=0,d.seller_group_id, b.seller_group_id) AS seller_group_id").
|
|
|
+ "IF(a.invoice_id=0,d.seller_group_id, b.seller_group_id) AS seller_group_id,"+
|
|
|
+ "GROUP_CONCAT(s.title) AS services_name ").
|
|
|
Joins("LEFT JOIN contract_invoice AS b ON a.invoice_id = b.contract_invoice_id AND b.is_deleted = 0 ").
|
|
|
Joins("LEFT JOIN contract_invoice AS d ON a.payment_id = d.contract_invoice_id AND d.is_deleted = 0").
|
|
|
Joins("JOIN contract_register AS c ON a.register_id = c.contract_register_id AND c.is_deleted = 0").
|
|
|
+ Joins("LEFT JOIN contract_service AS s ON s.contract_register_id = c.contract_register_id").
|
|
|
Where(condition, pars...).Group("id").Order("invoice_date ")
|
|
|
//nq := global.DEFAULT_MYSQL.Table("(?) AS e", query).
|
|
|
// Select(" IFNULL( SUM( e.amount ), 0 ) ")
|