|
|
|
@ -689,8 +689,8 @@
|
|
|
|
|
COUNT(DISTINCT o.customer_id) AS customers,
|
|
|
|
|
o.channel AS channel,
|
|
|
|
|
ifnull(SUM(if(t.transaction_type = 'Credit', t.clearing_amount, 0)), 0) AS total,
|
|
|
|
|
ifnull(SUM(if(t.refund_id>0, t.clearing_amount, 0)), 0) AS refund_amount,
|
|
|
|
|
SUM(if(t.refund_id>0, 1, 0)) AS refund_orders,
|
|
|
|
|
ifnull(SUM(if(t.transaction_type = 'Debit', t.clearing_amount, 0)), 0) AS refund_amount,
|
|
|
|
|
SUM(if(t.transaction_type = 'Debit', 1, 0)) AS refund_orders,
|
|
|
|
|
round(SUM(if(t.transaction_type='Credit',t.clearing_amount,0))/COUNT(DISTINCT o.customer_id),2) single_amount
|
|
|
|
|
FROM pmt_transactions t
|
|
|
|
|
INNER JOIN pmt_orders o ON o.order_id = t.order_id
|
|
|
|
|