r22141 - gnucash/trunk/src/report/business-reports - Fix the annoying case where an invoice item has mistakenly(?) had a tax table applied,

Mike Evans mikee at code.gnucash.org
Mon Apr 9 11:23:41 EDT 2012


Author: mikee
Date: 2012-04-09 11:23:40 -0400 (Mon, 09 Apr 2012)
New Revision: 22141
Trac: http://svn.gnucash.org/trac/changeset/22141

Modified:
   gnucash/trunk/src/report/business-reports/taxinvoice.eguile.scm
Log:
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.

Modified: gnucash/trunk/src/report/business-reports/taxinvoice.eguile.scm
===================================================================
--- gnucash/trunk/src/report/business-reports/taxinvoice.eguile.scm	2012-04-09 11:41:02 UTC (rev 22140)
+++ gnucash/trunk/src/report/business-reports/taxinvoice.eguile.scm	2012-04-09 15:23:40 UTC (rev 22141)
@@ -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? "#<swig-pointer PriceList" (object->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



More information about the gnucash-changes mailing list