From 3040fb9e6062e6ce9d73f99cebb2097401340c7a Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Thu, 6 Jun 2024 18:32:22 -0700 Subject: [PATCH 1/5] hledger-flow: ally: fix Description Descriptions with leading space were falsely included as `Type` tag --- container/src/hledger-flow/accounts/ally/ally-shared.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/container/src/hledger-flow/accounts/ally/ally-shared.bash b/container/src/hledger-flow/accounts/ally/ally-shared.bash index 20fbeae..f9c98fd 100755 --- a/container/src/hledger-flow/accounts/ally/ally-shared.bash +++ b/container/src/hledger-flow/accounts/ally/ally-shared.bash @@ -43,9 +43,9 @@ 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 printf $1 OFS # date printf $2 OFS # time From f12754c98acec57e8dd9c48d9bc48ed1ea07409f Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Thu, 6 Jun 2024 18:33:42 -0700 Subject: [PATCH 2/5] hledger-flow: ally: remove quotes in Description --- container/src/hledger-flow/accounts/ally/ally-shared.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/container/src/hledger-flow/accounts/ally/ally-shared.bash b/container/src/hledger-flow/accounts/ally/ally-shared.bash index f9c98fd..59cf70c 100755 --- a/container/src/hledger-flow/accounts/ally/ally-shared.bash +++ b/container/src/hledger-flow/accounts/ally/ally-shared.bash @@ -46,6 +46,7 @@ function parse() # `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 From 36d99e1da368c62a554179f2c5b35b7709dfd185 Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Thu, 6 Jun 2024 18:34:36 -0700 Subject: [PATCH 3/5] hledger-flow: ally: regex anchor for Direction --- container/src/hledger-flow/accounts/ally/ally-shared.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container/src/hledger-flow/accounts/ally/ally-shared.bash b/container/src/hledger-flow/accounts/ally/ally-shared.bash index 59cf70c..971fa47 100755 --- a/container/src/hledger-flow/accounts/ally/ally-shared.bash +++ b/container/src/hledger-flow/accounts/ally/ally-shared.bash @@ -57,7 +57,7 @@ function parse() 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" From 290aa7c93372c662d6a67a34c4188ef0c3bfcc3d Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Thu, 6 Jun 2024 18:37:16 -0700 Subject: [PATCH 4/5] hledger-flow: ally: comment cleanup Case-sensitive representation of header columns --- .../src/hledger-flow/accounts/ally/ally-shared.bash | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/container/src/hledger-flow/accounts/ally/ally-shared.bash b/container/src/hledger-flow/accounts/ally/ally-shared.bash index 971fa47..4270d68 100755 --- a/container/src/hledger-flow/accounts/ally/ally-shared.bash +++ b/container/src/hledger-flow/accounts/ally/ally-shared.bash @@ -48,14 +48,14 @@ function parse() 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 global_subaccount From a08ae2098e5d2dae207ed53f5f9a22e9fc64376b Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Fri, 7 Jun 2024 13:33:01 -0700 Subject: [PATCH 5/5] hledger-flow: ally: add eCheck deposit rule --- container/src/hledger-flow/accounts/ally/ally-shared.rules | 5 +++++ 1 file changed, 5 insertions(+) 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