Created update script for ledger-cli using simplefin
This commit is contained in:
23
ledger/update.jq
Normal file
23
ledger/update.jq
Normal file
@@ -0,0 +1,23 @@
|
||||
def format_transactions:
|
||||
map(
|
||||
.name as $name |
|
||||
.transactions |
|
||||
map(.account = $name)[]
|
||||
) |
|
||||
sort_by(.transacted_at) |
|
||||
map(
|
||||
(.transacted_at | strftime("%Y/%m/%d")) + " " +
|
||||
(.description | gsub("\\s+"; " ")) + "\n UNKNOWN $" +
|
||||
(-(.amount | tonumber) | tostring) + " ; Payee: " +
|
||||
.payee + "\n " +
|
||||
.account + "\n"
|
||||
);
|
||||
|
||||
def rename_accounts:
|
||||
map(.name |= (
|
||||
if (.| startswith("Adv Plus Banking")) then "Checking"
|
||||
elif (.| startswith("Unlimited Cash Rewards Visa Signature")) then "Credit"
|
||||
elif (.| startswith("Amazon Prime Rewards Visa Signature")) then "Amazon"
|
||||
end));
|
||||
|
||||
.accounts | rename_accounts | format_transactions[]
|
||||
Reference in New Issue
Block a user