gnucash maint: Bug 798060 - Invoices are missing on Customer report after upgrade
Christopher Lam
clam at code.gnucash.org
Mon Jan 4 06:37:18 EST 2021
Updated via https://github.com/Gnucash/gnucash/commit/8c21e895 (commit)
from https://github.com/Gnucash/gnucash/commit/3ba93a19 (commit)
commit 8c21e89565d93c49b5a19e1141f5b7a57faa704e
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Fri Jan 1 10:28:25 2021 +0800
Bug 798060 - Invoices are missing on Customer report after upgrade
diff --git a/gnucash/report/reports/standard/new-owner-report.scm b/gnucash/report/reports/standard/new-owner-report.scm
index b3e165b5d..bb616d10c 100644
--- a/gnucash/report/reports/standard/new-owner-report.scm
+++ b/gnucash/report/reports/standard/new-owner-report.scm
@@ -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!
Summary of changes:
gnucash/report/reports/standard/new-owner-report.scm | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
More information about the gnucash-changes
mailing list