Merge pull request #53 into master
a08ae20hledger-flow: ally: add eCheck deposit rule (Aaron Fiore)290aa7chledger-flow: ally: comment cleanup (Aaron Fiore)36d99e1hledger-flow: ally: regex anchor for Direction (Aaron Fiore)f12754chledger-flow: ally: remove quotes in Description (Aaron Fiore)3040fb9hledger-flow: ally: fix Description (Aaron Fiore)
This commit was merged in pull request #53.
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user