forked from EvergreenCrypto/docker-finance
Merge pull request #132 into master
7f413d5 hledger-flow: capital-one: bank: fix direction (Aaron Fiore)
This commit is contained in:
@@ -22,6 +22,9 @@ account1 assets:capital-one:%subaccount
|
||||
amount %amount_ USD
|
||||
comment card:%card, type:%type, direction:%direction
|
||||
|
||||
if %direction ^OUT$
|
||||
amount -%amount_ USD
|
||||
|
||||
# Default as equity
|
||||
if %direction ^IN$
|
||||
account2 equity:capital-one:%subaccount:withdrawal
|
||||
|
||||
@@ -79,6 +79,10 @@ function parse_bank()
|
||||
if (yy != global_yy)
|
||||
next
|
||||
|
||||
# Remain consistent w/ pre-2024 format
|
||||
# (will be added in rules)
|
||||
sub(/^-/, "", $5)
|
||||
|
||||
printf $1 OFS # Account Number
|
||||
printf $2 OFS # Transaction Description
|
||||
printf $3 OFS # Transaction Date
|
||||
@@ -86,9 +90,9 @@ function parse_bank()
|
||||
printf $5 OFS # Transaction Amount
|
||||
printf $6 OFS # Balance
|
||||
|
||||
direction=($5 ~ /^-/ ? "OUT" : "IN")
|
||||
|
||||
direction=($4 ~ /^Debit$/ ? "OUT" : "IN")
|
||||
printf direction OFS
|
||||
|
||||
printf global_subaccount
|
||||
|
||||
printf "\n"
|
||||
|
||||
Reference in New Issue
Block a user