Revenue Report by Checkout Plugin Overview SELECT A.name, sum(B.billed_amt) as amt, count(B.id) as quan from %%AGILE_DB_PREFIX%%checkout A join %%AGILE_DB_PREFIX%%invoice B on(A.id=B.checkout_plugin_id and B.billing_status=1 and (B.refund_status='' OR B.refund_status is null)) A.site_id=%%DEFAULT_SITE%% and B.site_id=%%DEFAULT_SITE%% GROUP BY name ORDER BY amt DESC 30 Checkout Option name Invoices quan true Amount amt dol,2 true dol,2 SELECT A.name, sum(B.billed_amt) as amt from %%AGILE_DB_PREFIX%%checkout A join %%AGILE_DB_PREFIX%%invoice B on(A.id=B.checkout_plugin_id and B.billing_status=1 and (B.refund_status='' OR B.refund_status is null)) A.site_id=%%DEFAULT_SITE%% and B.site_id=%%DEFAULT_SITE%% GROUP BY name ORDER BY amt DESC SELECT B.name, sum(A.billed_amt) as amt, count(B.id) as quan from %%AGILE_DB_PREFIX%%invoice A join %%AGILE_DB_PREFIX%%checkout B on (A.checkout_plugin_id=B.id) A.site_id = %%DEFAULT_SITE%% and A.billing_status=1 and (A.refund_status IS NULL or A.refund_status!='') GROUP BY name ORDER BY amt DESC 0 Checkout Option: name true true true false false Invoices quan true Amount amt dol,2 SELECT from_unixtime(A.date_orig,"%Y-%U") as yearmonth, sum(A.billed_amt) as amt, B.name from %%AGILE_DB_PREFIX%%invoice A join %%AGILE_DB_PREFIX%%checkout B on (A.checkout_plugin_id=B.id) A.site_id=%%DEFAULT_SITE%% and B.site_id=%%DEFAULT_SITE%% and (A.refund_status IS NULL or A.refund_status!='') GROUP BY yearmonth, name ORDER BY yearmonth ASC