From 5e8fff8103b41976838207234f111e33ef60fec3 Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Tue, 27 Jan 2026 15:24:24 -0800 Subject: [PATCH] container: lib_taxes: fix for generating `all` years (`year=all`) - The expected `hledger` output format appears to have changed, likely from a recent `hledger` release (confirmed to be unrelated to `xan`). - This bug does *not* affect individual year tax report generation, when given a specific (or default) year. --- container/src/finance/lib/internal/lib_taxes.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/container/src/finance/lib/internal/lib_taxes.bash b/container/src/finance/lib/internal/lib_taxes.bash index db01876..f399e41 100644 --- a/container/src/finance/lib/internal/lib_taxes.bash +++ b/container/src/finance/lib/internal/lib_taxes.bash @@ -2,7 +2,7 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2026 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 @@ -1003,7 +1003,7 @@ function lib_taxes::__taxes_write() if [ -z "$global_arg_year" ]; then lib_utils::print_info "Capturing the year of the oldest tagged record ...\n" - local -r _oldest_year="$("${_base_hledger[@]}" | head -n2 | xan select \"date\" | tail -n1 | cut -d'-' -f1)" + local -r _oldest_year="$("${_base_hledger[@]}" | head -n2 | xan select \"date\" | gawk 'END {gsub(/"/, ""); printf $1}' FS=- OFS=-)" [ -z "$_oldest_year" ] && lib_utils::die_fatal "No records available to write" elif [[ "$global_arg_year" -gt "$_current_year" ]]; then