gnucash maint: Multiple changes pushed
Christopher Lam
clam at code.gnucash.org
Thu Jul 1 03:59:30 EDT 2021
Updated via https://github.com/Gnucash/gnucash/commit/074d5837 (commit)
via https://github.com/Gnucash/gnucash/commit/e8189382 (commit)
from https://github.com/Gnucash/gnucash/commit/2e6ff097 (commit)
commit 074d5837b2fb88351dc084c1aea678743a546b04
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Thu Jul 1 12:55:50 2021 +0800
[lot-viewer] add more empty cells
otherwise table borders don't get drawn
diff --git a/gnucash/report/reports/standard/lot-viewer.scm b/gnucash/report/reports/standard/lot-viewer.scm
index 1975e4ee7..4ffe9c040 100644
--- a/gnucash/report/reports/standard/lot-viewer.scm
+++ b/gnucash/report/reports/standard/lot-viewer.scm
@@ -169,7 +169,7 @@
(#f #f #f ,@(map lot->guid lots) #f)))
(gnc:html-table-append-row!
- table `(#f "Document" #f ,@(map lot->document lots)))
+ table `(#f "Document" #f ,@(map lot->document lots) #f))
(for-each
(lambda (txn)
@@ -192,7 +192,7 @@
(sort transactions (lambda (a b) (< (xaccTransOrder a b) 0))))
(gnc:html-table-append-row!
- table `(#f "Balance" #f ,@(map lot->balance lots)))
+ table `(#f "Balance" #f ,@(map lot->balance lots) #f))
(gnc:html-document-add-object! document table))))
commit e8189382c1f69092552d55a86edf702937727368
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Thu Jul 1 11:35:30 2021 +0800
[new-owner-report] Refactor paymnent txn handling
359cc5cad contained inefficiency -- the remaining APAR splits were
scanned >1 times - first to identify and sum the txn-split amounts,
second to look for the next non-txn split. This commit will
simultaneously sum the txn split amounts, and collect the non-txn
splits for processing by the next lp iteration.
diff --git a/gnucash/report/reports/standard/new-owner-report.scm b/gnucash/report/reports/standard/new-owner-report.scm
index ed6e811ed..efdfa45e7 100644
--- a/gnucash/report/reports/standard/new-owner-report.scm
+++ b/gnucash/report/reports/standard/new-owner-report.scm
@@ -844,10 +844,14 @@
(let* ((split (car splits))
(txn (xaccSplitGetParent split))
(date (xaccTransGetDate txn))
- (orig-value
- (fold (lambda (a b)
- (if (equal? txn (xaccSplitGetParent a))
- (+ b (xaccSplitGetAmount a)) b)) 0 splits))
+ (amt/next-pair
+ (let lp1 ((splits splits) (acc 0) (non-txn '()))
+ (match splits
+ (() (cons acc (reverse non-txn)))
+ (((? (lambda (s) (equal? (xaccSplitGetParent s) txn)) head) . tail)
+ (lp1 tail (+ (xaccSplitGetAmount head) acc) non-txn))
+ ((head . tail) (lp1 tail acc (cons head non-txn))))))
+ (orig-value (car amt/next-pair))
(value (AP-negate orig-value)))
(add-row
@@ -866,7 +870,7 @@
((detailed) (make-payment->payee-table txn))
(else '(()))))
- (lp printed? (not odd-row?) (cdr splits) invalid-splits (+ total value)
+ (lp printed? (not odd-row?) (cdr amt/next-pair) invalid-splits (+ total value)
(if (< 0 orig-value) (+ debit orig-value) debit)
(if (< 0 orig-value) credit (- credit orig-value))
tax
Summary of changes:
gnucash/report/reports/standard/lot-viewer.scm | 4 ++--
gnucash/report/reports/standard/new-owner-report.scm | 14 +++++++++-----
2 files changed, 11 insertions(+), 7 deletions(-)
More information about the gnucash-changes
mailing list