diff --git a/container/src/hledger-flow/accounts/ally/ally-shared.bash b/container/src/hledger-flow/accounts/ally/ally-shared.bash index 20fbeae..4270d68 100755 --- a/container/src/hledger-flow/accounts/ally/ally-shared.bash +++ b/container/src/hledger-flow/accounts/ally/ally-shared.bash @@ -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" diff --git a/container/src/hledger-flow/accounts/ally/ally-shared.rules b/container/src/hledger-flow/accounts/ally/ally-shared.rules index f9d8684..289f844 100644 --- a/container/src/hledger-flow/accounts/ally/ally-shared.rules +++ b/container/src/hledger-flow/accounts/ally/ally-shared.rules @@ -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