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
pull/1/head
Mike Evans 14 years ago
parent 3b3ad7c05a
commit be43cb7cda

@ -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

Loading…
Cancel
Save