diff --git a/usercoloredtransactions/description.txt b/usercoloredtransactions/description.txt new file mode 100644 index 0000000..e09d1b6 --- /dev/null +++ b/usercoloredtransactions/description.txt @@ -0,0 +1,4 @@ +List all user colored transactions. + +Use CTRL 1 through CTRL 7 to set color. Use CTRL 0 to clear color. +Map specific colors used in MMEX View Options. \ No newline at end of file diff --git a/usercoloredtransactions/luacontent.lua b/usercoloredtransactions/luacontent.lua new file mode 100644 index 0000000..53a7594 --- /dev/null +++ b/usercoloredtransactions/luacontent.lua @@ -0,0 +1,13 @@ +local base_total = 0; + +function handle_record(record) + local prefix = record:get("PFX_SYMBOL"); + local suffix = record:get("SFX_SYMBOL"); + local amount = record:get("TRANSAMOUNT"); + record:set("TRANSAMOUNT", prefix .. string.format("%.2f", amount) .. suffix); + base_total = base_total + record:get("BaseAmount"); +end + +function complete(result) + result:set("BaseTotal", base_total); +end \ No newline at end of file diff --git a/usercoloredtransactions/sqlcontent.sql b/usercoloredtransactions/sqlcontent.sql new file mode 100644 index 0000000..e5ec20b --- /dev/null +++ b/usercoloredtransactions/sqlcontent.sql @@ -0,0 +1,18 @@ +select t.FOLLOWUPID, t.PAYEENAME, t.TRANSDATE, t.TRANSAMOUNT + , t.TRANSAMOUNT*c.BASECONVRATE as BaseAmount + , c.PFX_SYMBOL, c.SFX_SYMBOL +from + (select p.PAYEENAME as PAYEENAME, c1.TRANSDATE as TRANSDATE, c1.FOLLOWUPID as FOLLOWUPID, + (case when c1.TRANSCODE = 'Deposit' then c1.TRANSAMOUNT else -c1.TRANSAMOUNT end) as TRANSAMOUNT, + a1.CURRENCYID as CURRENCYID + from CHECKINGACCOUNT_V1 as c1 + inner join PAYEE_V1 as p on p.PAYEEID = c1.PAYEEID + inner join ACCOUNTLIST_V1 as a1 on a1.ACCOUNTID = c1.ACCOUNTID + union all + select a2.ACCOUNTNAME, c2.TRANSDATE, c2.FOLLOWUPID, c2.TOTRANSAMOUNT, a2.CURRENCYID + from CHECKINGACCOUNT_V1 as c2 + inner join ACCOUNTLIST_V1 as a2 on a2.ACCOUNTID = c2.TOACCOUNTID + where TRANSCODE = 'Transfer') as t +inner join CURRENCYFORMATS_V1 as c on t.CURRENCYID=c.CURRENCYID +where t.FOLLOWUPID > 0 and t.FOLLOWUPID <= 7 +order by t.FOLLOWUPID asc, t.PAYEENAME asc, t.TRANSDATE asc; \ No newline at end of file diff --git a/usercoloredtransactions/template.htt b/usercoloredtransactions/template.htt new file mode 100644 index 0000000..78f613c --- /dev/null +++ b/usercoloredtransactions/template.htt @@ -0,0 +1,62 @@ + + +
+ + +Color | +Payee Name | +Date | +Amount | +Base Amount | +
---|---|---|---|---|
Total | ++ | + | + |