gnucash maint: Bug 798060 - Invoices are missing on Customer report after upgrade

Christopher Lam clam at code.gnucash.org
Mon Jan 4 17:16:22 EST 2021


Updated	 via  https://github.com/Gnucash/gnucash/commit/f2c4f80d (commit)
	from  https://github.com/Gnucash/gnucash/commit/8c21e895 (commit)



commit f2c4f80d3905ad7e04a72077fc6e6b65ba2eef89
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Mon Jan 4 23:28:36 2021 +0800

    Bug 798060 - Invoices are missing on Customer report after upgrade
    
    Additional restriction - search either AP or AR accounts according to
    owner type.

diff --git a/gnucash/report/reports/standard/new-owner-report.scm b/gnucash/report/reports/standard/new-owner-report.scm
index bb616d10c..e5be21bfa 100644
--- a/gnucash/report/reports/standard/new-owner-report.scm
+++ b/gnucash/report/reports/standard/new-owner-report.scm
@@ -1039,10 +1039,7 @@ invoices and amounts.")))))
     (gnc:option-value
      (gnc:lookup-option options section name)))
 
-  (let* ((accounts (filter (compose xaccAccountIsAPARType xaccAccountGetType)
-                           (gnc-account-get-descendants-sorted
-                            (gnc-get-current-root-account))))
-         (start-date (gnc:time64-start-day-time
+  (let* ((start-date (gnc:time64-start-day-time
                       (gnc:date-option-absolute-time
                        (opt-val gnc:pagename-general optname-from-date))))
          (end-date (gnc:time64-end-day-time
@@ -1057,18 +1054,18 @@ invoices and amounts.")))))
          (owner-descr (owner-string type))
          (date-type (opt-val gnc:pagename-general optname-date-driver))
          (owner (opt-val owner-page owner-descr))
-         (payable? (memv (gncOwnerGetType (gncOwnerGetEndOwner owner))
-                         (list GNC-OWNER-VENDOR GNC-OWNER-EMPLOYEE)))
+         (acct-type (if (eqv? (gncOwnerGetType (gncOwnerGetEndOwner owner))
+                              GNC-OWNER-CUSTOMER)
+                        ACCT-TYPE-RECEIVABLE ACCT-TYPE-PAYABLE))
+         (accounts (filter (lambda (a) (eqv? (xaccAccountGetType a) acct-type))
+                           (gnc-account-get-descendants-sorted
+                            (gnc-get-current-root-account))))
+         (payable? (eqv? ACCT-TYPE-PAYABLE acct-type))
          (query (qof-query-create-for-splits))
          (document (gnc:make-html-document))
          (table (gnc:make-html-table))
          (section-headings (make-section-heading-list used-columns owner-descr))
-         (headings (make-heading-list
-                    used-columns link-option
-                    (if (eqv? (gncOwnerGetType (gncOwnerGetEndOwner owner))
-                              GNC-OWNER-CUSTOMER)
-                        ACCT-TYPE-RECEIVABLE
-                        ACCT-TYPE-PAYABLE)))
+         (headings (make-heading-list used-columns link-option acct-type))
          (report-title (string-append (G_ owner-descr) " " (G_ "Report"))))
 
     (cond



Summary of changes:
 .../report/reports/standard/new-owner-report.scm    | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)



More information about the gnucash-changes mailing list