From 97798f9fd1b5c7864b359e84b9f76f2d8915c2c9 Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Sun, 10 Nov 2019 04:07:08 +0800 Subject: [PATCH] [new-aging] step 2 - reduce indentation level by 1 merge two let* together --- gnucash/report/business-reports/new-aging.scm | 79 +++++++++---------- 1 file changed, 37 insertions(+), 42 deletions(-) diff --git a/gnucash/report/business-reports/new-aging.scm b/gnucash/report/business-reports/new-aging.scm index e4a0a6b07d..1e451b8f08 100644 --- a/gnucash/report/business-reports/new-aging.scm +++ b/gnucash/report/business-reports/new-aging.scm @@ -325,50 +325,45 @@ exist but have no suitable transactions.")) (let* ((account (car accounts)) (splits-acc-others (list-split splits split-from-acct? account)) (acc-splits (car splits-acc-others)) - (other-acc-splits (cdr splits-acc-others))) + (other-acc-splits (cdr splits-acc-others)) + (split-owners (map split->owner acc-splits)) + (acc-owners (sort (sort-and-delete-duplicates + split-owners ownerGUIDowner acc-splits)) - (acc-owners (sort (sort-and-delete-duplicates - split-owners ownerGUIDaging-list - owner-splits num-buckets report-date - date-type receivable)) - (aging-total (apply + aging))) - (lp (cdr acc-owners) - other-owner-splits - (map + acc-totals - (reverse (cons aging-total aging))) - (if (or show-zeros (not (every zero? aging))) - (cons (list owner aging aging-total) - owners-and-aging) - owners-and-aging)))))))))))))) + (else + (let* ((owner (car acc-owners)) + (splits-own-others (list-split acc-splits split-has-owner? + owner)) + (owner-splits (car splits-own-others)) + (other-owner-splits (cdr splits-own-others)) + (aging (gnc:owner-splits->aging-list + owner-splits num-buckets report-date + date-type receivable)) + (aging-total (apply + aging))) + (lp (cdr acc-owners) + other-owner-splits + (map + acc-totals + (reverse (cons aging-total aging))) + (if (or show-zeros (not (every zero? aging))) + (cons (list owner aging aging-total) + owners-and-aging) + owners-and-aging))))))))))))) (gnc:report-finished) document))