From be43cb7cda1e0fb78246d11225781f5a146ff059 Mon Sep 17 00:00:00 2001 From: Mike Evans Date: Mon, 9 Apr 2012 15:23:40 +0000 Subject: [PATCH] Fix the annoying case where an invoice item has mistakenly(?) had a tax table applied, unchecking the taxable flag for that item didn't remove the tax related columns from the invoice where there are no other taxable items. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22141 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/report/business-reports/taxinvoice.eguile.scm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/report/business-reports/taxinvoice.eguile.scm b/src/report/business-reports/taxinvoice.eguile.scm index 260864fe1b..889acf2841 100644 --- a/src/report/business-reports/taxinvoice.eguile.scm +++ b/src/report/business-reports/taxinvoice.eguile.scm @@ -85,6 +85,7 @@ (let ((action (gncEntryGetAction entry)) (qty (gncEntryGetDocQuantity entry credit-note?)) (discount (gncEntryGetInvDiscount entry)) + (taxable? (gncEntryGetInvTaxable entry)) (taxtable (gncEntryGetInvTaxTable entry))) (if (not (string=? action "")) (set! units? #t)) @@ -92,14 +93,15 @@ (set! qty? #t)) (if (not (gnc-numeric-zero-p discount)) (set! discount? #t)) ;(if taxable - no, this flag is redundant - (if (not (eq? taxtable '())) - (begin ; presence of a tax table means it's taxed + (if taxable? ; Also check if the taxable flag is set + (if (not (eq? taxtable '())) + (begin ; presence of a tax table AND taxable flag means it's taxed (set! tax? #t) (let ((ttentries (gncTaxTableGetEntries taxtable))) (if (string-prefix? "#string ttentries)) ; error in SWIG binding -- disable display of tax details ; (see http://bugzilla.gnome.org/show_bug.cgi?id=573645) - (set! taxtables? #f))))))) ; hack required until Swig is fixed + (set! taxtables? #f)))))))) ; hack required until Swig is fixed (fixed in r18056, hack still here) ; pre-scan invoice splits to see if any payments have been made (for split in splits do