Created update script for ledger-cli using simplefin

This commit is contained in:
Random936
2025-12-01 16:28:02 -05:00
parent 434c84caf6
commit b0d8421b70
3 changed files with 61 additions and 0 deletions

23
ledger/update.jq Normal file
View 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[]