From a44bd34dcfaee61b549571d05780d865abde682f Mon Sep 17 00:00:00 2001 From: gnucash-dev Date: Sun, 2 Feb 2020 13:13:50 -0800 Subject: [PATCH] Correct double-counting of accounts in some cases in US Income Tax Report. --- gnucash/report/locale-specific/us/taxtxf.scm | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/gnucash/report/locale-specific/us/taxtxf.scm b/gnucash/report/locale-specific/us/taxtxf.scm index e09cdf9a6a..86a7aa8e4e 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)