|
|
@@ -839,7 +839,11 @@
|
|
|
MAX( a.company_name ) AS "companyName",
|
|
|
MAX( a.company_id ) AS "companyId",
|
|
|
MAX( a.partner_companies_name ) AS "partnerCompaniesName",
|
|
|
- IFNULL ( max(d.settleMentAmount),0.00)-IFNULL(max(f.settleMentAmount) , 0.00) + IFNULL ( max(d.settleMentAmount),0.00) as "allInvoicCommissionFeevalue",
|
|
|
+ CASE
|
|
|
+ WHEN (IFNULL(MAX(d.settleMentAmount), 0.00) - IFNULL(MAX(f.settleMentAmount), 0.00)) = 0.00
|
|
|
+ THEN IFNULL ( MAX(d.settleMentAmount) ,0.00)
|
|
|
+ ELSE (IFNULL(MAX(d.settleMentAmount), 0.00) - IFNULL(MAX(f.settleMentAmount), 0.00))
|
|
|
+ END AS "allInvoicCommissionFeevalue",
|
|
|
IFNULL(max(f.settleMentAmount) , 0.00) as "readyCommissionFeevalue",
|
|
|
IFNULL ( max(d.settleMentAmount),0.00)-IFNULL(max(f.settleMentAmount) , 0.00) as "invoicCommissionFeevalue",
|
|
|
sum(COALESCE( a.other_feevalue,0.00) )-IFNULL ( max(d.settleMentAmount),0.00) as "noInvoicCommissionFeevalue",
|