|
@@ -800,10 +800,14 @@
|
|
|
MAX( a.company_name ) AS "companyName",
|
|
MAX( a.company_name ) AS "companyName",
|
|
|
MAX( a.company_id ) AS "companyId",
|
|
MAX( a.company_id ) AS "companyId",
|
|
|
MAX( a.partner_companies_name ) AS "partnerCompaniesName",
|
|
MAX( a.partner_companies_name ) AS "partnerCompaniesName",
|
|
|
- IFNULL ( max(c.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(f.settleMentAmount) , 0.00) as "readyCommissionFeevalue",
|
|
|
IFNULL ( max(d.settleMentAmount),0.00) as "invoicCommissionFeevalue",
|
|
IFNULL ( max(d.settleMentAmount),0.00) as "invoicCommissionFeevalue",
|
|
|
- sum(COALESCE( a.commission_feevalue,0.00) )-COALESCE(max(c.settleMentAmount),0.00) as "noInvoicCommissionFeevalue",
|
|
|
|
|
|
|
+ sum(COALESCE( a.commission_feevalue,0.00) )-IFNULL ( max(d.settleMentAmount),0.00) as "noInvoicCommissionFeevalue",
|
|
|
sum(COALESCE( a.commission_feevalue,0.00) )-COALESCE(max(c.settleMentAmount),0.00)+IFNULL ( max(d.settleMentAmount),0.00) AS "unSettledAmount",
|
|
sum(COALESCE( a.commission_feevalue,0.00) )-COALESCE(max(c.settleMentAmount),0.00)+IFNULL ( max(d.settleMentAmount),0.00) AS "unSettledAmount",
|
|
|
sum( a.commission_feevalue ) AS "commissionFeevalue"
|
|
sum( a.commission_feevalue ) AS "commissionFeevalue"
|
|
|
FROM
|
|
FROM
|