forked from EvergreenCrypto/docker-finance
container: hledger-flow: remove potential % interpretation (printf)
Removes potential interpretation of percent signs in various types of descriptions/notes/labels (otherwise, import may break). Resolves "fatal: not enough arguments to satisfy format string" under certain conditions.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
# docker-finance | modern accounting for the power-user
|
||||
#
|
||||
# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||
# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -47,6 +47,8 @@ function parse_credit()
|
||||
|
||||
printf $1 OFS # Trans. Date
|
||||
printf $2 OFS # Post Date
|
||||
|
||||
sub(/%/, "%%", $3)
|
||||
printf $3 OFS # Description
|
||||
|
||||
# Flip the amount signs for proper liabilities accounting
|
||||
@@ -74,7 +76,10 @@ function parse_bank()
|
||||
next
|
||||
|
||||
printf $1 OFS # Transaction Date
|
||||
|
||||
sub(/%/, "%%", $2)
|
||||
printf $2 OFS # Transaction Description
|
||||
|
||||
printf $3 OFS # Transaction Type
|
||||
|
||||
sub(/\$/,"",$4);
|
||||
|
||||
Reference in New Issue
Block a user