gnucash maint: Correct double-counting of accounts in some cases in US Income Tax Report.
J.Alex Aycinena
alex.aycinena at code.gnucash.org
Sun Feb 2 16:14:25 EST 2020
Updated via https://github.com/Gnucash/gnucash/commit/a44bd34d (commit)
from https://github.com/Gnucash/gnucash/commit/1e0983d0 (commit)
commit a44bd34dcfaee61b549571d05780d865abde682f
Author: gnucash-dev <gnucash-dev at LenovoFedora30VM.home>
Date: Sun Feb 2 13:13:50 2020 -0800
Correct double-counting of accounts in some cases in US Income Tax Report.
diff --git a/gnucash/report/locale-specific/us/taxtxf.scm b/gnucash/report/locale-specific/us/taxtxf.scm
index e09cdf9a6..86a7aa8e4 100644
--- a/gnucash/report/locale-specific/us/taxtxf.scm
+++ b/gnucash/report/locale-specific/us/taxtxf.scm
@@ -1651,17 +1651,12 @@
) ;;end of let*
)
-;; Recursively validate children if parent is not a tax account.
-;; Don't check children if parent is valid.
-;; Returns the Parent if a child or grandchild is valid.
+;; Returns #t if account is tax related.
(define (validate accounts)
(filter (lambda (a)
(if (xaccAccountGetTaxRelated a)
#t
- ;; check children
- (if (null? (validate (gnc-account-get-descendants a)))
- #f
- #t)))
+ #f))
accounts))
(define (generate-tax-schedule report-name
@@ -1829,10 +1824,6 @@
)
selected-accounts-sorted-by-form-line-acct)
);; end of if
- (if (not (null? children))
- (make-form-line-acct-list children tax-year)
- selected-accounts-sorted-by-form-line-acct
- )
);; end let*
);; end lambda
accounts)
@@ -2005,7 +1996,7 @@
(selected-accounts (if (not (null? user-sel-accnts))
valid-user-sel-accnts
(validate (reverse
- (gnc-account-get-children-sorted
+ (gnc-account-get-descendants-sorted
(gnc-get-current-root-account))))))
(work-to-do 0)
Summary of changes:
gnucash/report/locale-specific/us/taxtxf.scm | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
More information about the gnucash-changes
mailing list