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