From 21465c050b70f8649334276607aa4d96a37c4381 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Tue, 2 Jul 2024 01:07:54 +0100 Subject: [PATCH] ;examples:csv: tiller.csv.rules --- examples/csv/tiller.csv.rules | 77 +++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 examples/csv/tiller.csv.rules diff --git a/examples/csv/tiller.csv.rules b/examples/csv/tiller.csv.rules new file mode 100644 index 000000000..6cfc46ff6 --- /dev/null +++ b/examples/csv/tiller.csv.rules @@ -0,0 +1,77 @@ +# hledger rules for CSV from Tiller's "raw data" spreadsheet, circa 2022, +# with columns rearranged as follows: +# Date,"Short Description",Description,"Full Description",Amount,"Category Hint",Institution,Account,"Account #","Check Number",Month,Week,"Transaction ID","Date Added","Dup Score","Dup Match" + +skip 1 +fields Date,Short_Description,Description,Full_Description,Amount,Category_Hint,Institution,Account,Account_No,Check_Number,Month,Week,Transaction_ID,Date_Added,Dup_Score,Dup_Match +date-format %-m/%-d/%Y +newest-first +# status * +# code %Check_Number +description %Description +if ,Not Available, + description %Description +comment %Full_Description + + +## account1 + +# generic +account1 sm:assets:%Institution:%Account:%Account_No + +# more specific +if ,Wells Fargo - Bank,Business Checking, + account1 JS:assets:bank:wf:bchecking +if ,Wells Fargo - Bank,Business Savings, + account1 JS:assets:bank:wf:bsavings:capital +if ,Wells Fargo - Bank,Checking, + account1 sm:assets:bank:wf:pchecking +if ,Wells Fargo - Bank,Savings, + account1 sm:assets:bank:wf:psavings +if ,PayPal Balance,, + account1 sm:assets:online:paypal +if ,Bank of Ireland.*,Current Account, + account1 sm:assets:bank:bi:ichecking + +## account2, etc. + +# use Tiller's category hint as default +account2 sm:expenses:unknown:%Category_Hint? + +# Try to recognise and categorise transfers between accounts. +# The descriptions here will not always be right. +# We don't deduplicate; one imported txn will need to be removed manually. + +if +TRANSFER FROM BUSINESS CHECKING + account2 JS:assets:bank:wf:bchecking + +if +TRANSFER TO CHECKING + account2 sm:assets:bank:wf:pchecking +# description personal savings + +if ATM WITHDRAWAL + account2 sm:assets:cash:wallet + +## generic paypal cleanups +# not using Tiller for paypal, it's too lossy (missing important fields, not currency aware) +# +# if ,Paypal, +# description paypal transfer +# +# if ,Paypal,.*,Checking, +# account2 sm:assets:online:paypal +# +# if PAYPAL INST XFER +# account2 sm:assets:online:paypal +# +# # the bank will generate this same txn, but this paypal one shows up quicker +# if Transfer from Bank Account.*,PayPal +# account2 sm:assets:bank:wf:pchecking + +# + +# common categorising rules +include common.rules +