Bug 798060 - Invoices are missing on Customer report after upgrade

This commit is contained in:
Christopher Lam 2021-01-01 10:28:25 +08:00
parent 3ba93a1943
commit 8c21e89565

View File

@ -739,6 +739,8 @@
(gnc:split-anchor-text split)
(gnc:make-gnc-monetary currency amount))))
(define seen-txns (make-hash-table))
(let lp ((printed? #f)
(odd-row? #t)
(splits splits)
@ -764,6 +766,9 @@
'attribute (list "cellpadding" 4))
table)
((hash-ref seen-txns (xaccSplitGetParent (car splits)))
(lp printed? odd-row? (cdr splits) invalid-splits total debit credit tax sale))
;; not an invoice/payment. skip transaction.
((not (or (txn-is-invoice? (xaccSplitGetParent (car splits)))
(txn-is-payment? (xaccSplitGetParent (car splits)))))
@ -797,6 +802,7 @@
;; start printing txns.
((txn-is-invoice? (xaccSplitGetParent (car splits)))
(hash-set! seen-txns (xaccSplitGetParent (car splits)) #t)
(let* ((split (car splits))
(txn (xaccSplitGetParent split))
(date (xaccTransGetDate txn))
@ -831,6 +837,7 @@
(+ sale (CN-negate gncInvoiceGetTotalSubtotal)))))
((txn-is-payment? (xaccSplitGetParent (car splits)))
(hash-set! seen-txns (xaccSplitGetParent (car splits)) #t)
(let* ((split (car splits))
(txn (xaccSplitGetParent split))
(date (xaccTransGetDate txn))
@ -1083,7 +1090,7 @@ invoices and amounts.")))))
(else
(setup-query query owner accounts end-date (eqv? GNC-OWNER-JOB type))
(let ((splits (xaccQueryGetSplitsUniqueTrans query)))
(let ((splits (qof-query-run query)))
(qof-query-destroy query)
(gnc:html-document-set-headline!