Merge pull request #53 into master

a08ae20 hledger-flow: ally: add eCheck deposit rule (Aaron Fiore)
290aa7c hledger-flow: ally: comment cleanup (Aaron Fiore)
36d99e1 hledger-flow: ally: regex anchor for Direction (Aaron Fiore)
f12754c hledger-flow: ally: remove quotes in Description (Aaron Fiore)
3040fb9 hledger-flow: ally: fix Description (Aaron Fiore)
This commit was merged in pull request #53.
This commit is contained in:
2024-06-07 13:53:51 -07:00
2 changed files with 15 additions and 9 deletions

View File

@@ -43,20 +43,21 @@ function parse()
if (NR<2 || $1 !~ global_year)
next
# Description may have comma followed by space
# TODO: what about description ending in comma?...
gsub(/, /, " - ");
# `Description` cleanup
sub(/^ /, "", $5) # may have an empty space in front of line
gsub(/, /, " - ") # may have (multiple) commas followed by space
gsub(/"/, "", $5) # may have (multiple) quotes
printf $1 OFS # date
printf $2 OFS # time
printf $1 OFS # Date
printf $2 OFS # Time
sub(/^-/, "", $3)
printf $3 OFS # amount
printf $3 OFS # Amount
printf $4 OFS # type
printf $5 OFS # description
printf $4 OFS # Type
printf $5 OFS # Description
printf ($4 ~ /Withdrawal/ ? "OUT" : "IN") OFS # Direction
printf ($4 ~ /^Withdrawal$/ ? "OUT" : "IN") OFS # Direction
printf global_subaccount
printf "\n"

View File

@@ -53,4 +53,9 @@ if %direction ^IN$
& %description ^Interest Paid$
account2 income:ally:%subaccount:interest
# eCheck deposits
if %direction ^IN$
& %description ^eCheck Deposit$
account2 income:ally:%subaccount:echeck
# vim: sw=2 sts=2 si ai et