|
|
@ -203,7 +203,7 @@
|
|
|
|
org.type AS org_type,
|
|
|
|
org.type AS org_type,
|
|
|
|
org.name AS org_name,
|
|
|
|
org.name AS org_name,
|
|
|
|
if(org.org_id=1,1,0) AS isOrg,
|
|
|
|
if(org.org_id=1,1,0) AS isOrg,
|
|
|
|
SUM( IF ( temp.transaction_type = 'Credit', temp.clearing_amount, -t.clearing_amount )) clearing_amount,
|
|
|
|
SUM( IF ( temp.transaction_type = 'Credit', temp.clearing_amount, -temp.clearing_amount )) clearing_amount,
|
|
|
|
SUM(if(temp.transaction_type = 'Credit',temp.clearing_amount * clinetBD.proportion, -temp.clearing_amount * clinetBD.proportion)) pay_amount,
|
|
|
|
SUM(if(temp.transaction_type = 'Credit',temp.clearing_amount * clinetBD.proportion, -temp.clearing_amount * clinetBD.proportion)) pay_amount,
|
|
|
|
ifnull(SUM(if(temp.refund_id IS NOT NULL, if(temp.transaction_type='Debit', temp.clearing_amount, -temp.clearing_amount) * clinetBD.proportion, 0)), 0) refund_amount,
|
|
|
|
ifnull(SUM(if(temp.refund_id IS NOT NULL, if(temp.transaction_type='Debit', temp.clearing_amount, -temp.clearing_amount) * clinetBD.proportion, 0)), 0) refund_amount,
|
|
|
|
(SUM(if(temp.transaction_type = 'Credit', temp.clearing_amount * clinetBD.proportion, -temp.clearing_amount * clinetBD.proportion))) - (ifnull(SUM(if(temp.refund_id IS NOT NULL, if(temp.transaction_type='Debit', temp.clearing_amount, -temp.clearing_amount) * clinetBD.proportion, 0)), 0)) AS net_amount
|
|
|
|
(SUM(if(temp.transaction_type = 'Credit', temp.clearing_amount * clinetBD.proportion, -temp.clearing_amount * clinetBD.proportion))) - (ifnull(SUM(if(temp.refund_id IS NOT NULL, if(temp.transaction_type='Debit', temp.clearing_amount, -temp.clearing_amount) * clinetBD.proportion, 0)), 0)) AS net_amount
|
|
|
|