gnucash maint: Multiple changes pushed

Christopher Lam clam at code.gnucash.org
Fri Jan 24 09:59:18 EST 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/a9d51dd9 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/d91a9512 (commit)
	from  https://github.com/Gnucash/gnucash/commit/a01bfa68 (commit)



commit a9d51dd9e305a581d5c193a31a3336c213b97ea0
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Fri Jan 24 22:58:06 2020 +0800

    [new-owner-report] RHS invoice amount links APAR instead of transfer
    
    because invoices can have more than 1 non-APAR split.

diff --git a/gnucash/report/business-reports/new-owner-report.scm b/gnucash/report/business-reports/new-owner-report.scm
index 0d4c177b9..ebe76f470 100644
--- a/gnucash/report/business-reports/new-owner-report.scm
+++ b/gnucash/report/business-reports/new-owner-report.scm
@@ -637,8 +637,7 @@
                        (gnc:make-gnc-monetary currency overpayment))
                       result)))))
         (((inv . APAR-split) . rest)
-         (let* ((tfr-txn (gncInvoiceGetPostedTxn inv))
-                (tfr-split (txn->transfer-split tfr-txn)))
+         (let* ((tfr-txn (gncInvoiceGetPostedTxn inv)))
            (lp rest
                (cons (make-link-data
                       (qof-print-date (gncInvoiceGetDatePosted inv))
@@ -655,7 +654,7 @@
                          currency (AP-negate (- (xaccSplitGetAmount APAR-split))))))
                       (gnc:make-html-text
                        (gnc:html-markup-anchor
-                        (gnc:split-anchor-text tfr-split)
+                        (gnc:split-anchor-text APAR-split)
                         (gnc:make-gnc-monetary
                          currency (invoice->total inv)))))
                      result)))))))

commit d91a9512a48306c399a9eb8b41ebb0e87b3fcac2
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Fri Jan 24 22:34:34 2020 +0800

    [new-owner-report] RHS payments with >1 non-APAR splits all shown
    
    Payments by default have 1 non-APAR split. But UI allows modification
    to multiple non-APAR splits. Render each in different line.

diff --git a/gnucash/report/business-reports/new-owner-report.scm b/gnucash/report/business-reports/new-owner-report.scm
index 5504dcc73..0d4c177b9 100644
--- a/gnucash/report/business-reports/new-owner-report.scm
+++ b/gnucash/report/business-reports/new-owner-report.scm
@@ -534,23 +534,27 @@
               link-splits-seen
               (cons (let* ((lot-split (car lot-splits))
                            (lot-txn (xaccSplitGetParent lot-split))
-                           (lot-amt (AP-negate (- (xaccSplitGetAmount lot-split))))
-                           (tfr-split (txn->transfer-split lot-txn)))
+                           (pmt-splits (xaccTransGetPaymentAcctSplitList lot-txn)))
+                      (define (split->anchor split negate?)
+                        (gnc:html-markup-anchor
+                         (gnc:split-anchor-text split)
+                         (gnc:make-gnc-monetary
+                          (xaccAccountGetCommodity (xaccSplitGetAccount split))
+                          ((if negate? - +)
+                           (AP-negate (xaccSplitGetAmount split))))))
                       (make-link-data
                        (qof-print-date (xaccTransGetDate lot-txn))
                        (split->reference lot-split)
                        (split->type-str lot-split)
                        (splits->desc (list lot-split))
-                       (gnc:make-html-text
-                        (gnc:html-markup-anchor
-                         (gnc:split-anchor-text lot-split)
-                         (gnc:make-gnc-monetary currency lot-amt)))
-                       (gnc:make-html-text
-                        (gnc:html-markup-anchor
-                         (gnc:split-anchor-text tfr-split)
-                         (gnc:make-gnc-monetary
-                          (xaccAccountGetCommodity (xaccSplitGetAccount tfr-split))
-                          (AP-negate (xaccSplitGetAmount tfr-split)))))))
+                       (gnc:make-html-text (split->anchor lot-split #t))
+                       (let lp1 ((pmt-splits pmt-splits) (acc '()))
+                         (match pmt-splits
+                           (() (apply gnc:make-html-text acc))
+                           ((pmt-split . rest)
+                            (lp1 rest (cons* (split->anchor pmt-split #f)
+                                             (gnc:html-markup-br)
+                                             acc)))))))
                     result)))
 
          ;; This is a lot link split. Find corresponding documents,



Summary of changes:
 .../report/business-reports/new-owner-report.scm   | 33 ++++++++++++----------
 1 file changed, 18 insertions(+), 15 deletions(-)



More information about the gnucash-changes mailing list