mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-25 18:30:23 -06:00
Fix bug #564380 additionally for easy invoice and fancy invoice.
Patch by Mike Evans. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18686 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
2ff0d7507d
commit
3bac2105e8
@ -422,14 +422,29 @@
|
||||
(define (add-payment-row table used-columns split total-collector)
|
||||
(let* ((t (xaccSplitGetParent split))
|
||||
(currency (xaccTransGetCurrency t))
|
||||
(invoice (opt-val invoice-page invoice-name))
|
||||
(owner '())
|
||||
;; XXX Need to know when to reverse the value
|
||||
(amt (gnc:make-gnc-monetary currency (xaccSplitGetValue split)))
|
||||
(payment-style "grand-total")
|
||||
(row '()))
|
||||
|
||||
(total-collector 'add
|
||||
(gnc:gnc-monetary-commodity amt)
|
||||
(gnc:gnc-monetary-amount amt))
|
||||
; Update to fix bug 564380, payment on bill doubles bill. Mike Evans <mikee@saxicola.co.uk>
|
||||
(if (not (null? invoice))
|
||||
(begin
|
||||
(set! owner (gncInvoiceGetOwner invoice))
|
||||
(let ((type (gncOwnerGetType
|
||||
(gncOwnerGetEndOwner owner))))
|
||||
(cond
|
||||
((eqv? type GNC-OWNER-CUSTOMER)
|
||||
(total-collector 'add
|
||||
(gnc:gnc-monetary-commodity amt)
|
||||
(gnc:gnc-monetary-amount amt)))
|
||||
((eqv? type GNC-OWNER-VENDOR)
|
||||
(total-collector 'add
|
||||
(gnc:gnc-monetary-commodity amt)
|
||||
(gnc:gnc-monetary-amount (gnc:monetary-neg amt))))
|
||||
))))
|
||||
|
||||
(if (date-col used-columns)
|
||||
(addto! row
|
||||
|
@ -439,14 +439,30 @@
|
||||
(define (add-payment-row table used-columns split total-collector)
|
||||
(let* ((t (xaccSplitGetParent split))
|
||||
(currency (xaccTransGetCurrency t))
|
||||
(invoice (opt-val invoice-page invoice-name))
|
||||
(owner '())
|
||||
;; XXX Need to know when to reverse the value
|
||||
(amt (gnc:make-gnc-monetary currency (xaccSplitGetValue split)))
|
||||
(payment-style "grand-total")
|
||||
(row '()))
|
||||
|
||||
(total-collector 'add
|
||||
(gnc:gnc-monetary-commodity amt)
|
||||
(gnc:gnc-monetary-amount amt))
|
||||
|
||||
; Update to fix bug 564380, payment on bill doubles bill. Mike Evans <mikee@saxicola.co.uk>
|
||||
(if (not (null? invoice))
|
||||
(begin
|
||||
(set! owner (gncInvoiceGetOwner invoice))
|
||||
(let ((type (gncOwnerGetType
|
||||
(gncOwnerGetEndOwner owner))))
|
||||
(cond
|
||||
((eqv? type GNC-OWNER-CUSTOMER)
|
||||
(total-collector 'add
|
||||
(gnc:gnc-monetary-commodity amt)
|
||||
(gnc:gnc-monetary-amount amt)))
|
||||
((eqv? type GNC-OWNER-VENDOR)
|
||||
(total-collector 'add
|
||||
(gnc:gnc-monetary-commodity amt)
|
||||
(gnc:gnc-monetary-amount (gnc:monetary-neg amt))))
|
||||
))))
|
||||
|
||||
|
||||
(if (date-col used-columns)
|
||||
(addto! row
|
||||
|
Loading…
Reference in New Issue
Block a user