mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[register] simplify splits-leader
They were using complicated algorithm to get the split account. Also change leader output from account/null to account/#f. It is simpler to return #f if there is no 'leader'
This commit is contained in:
parent
27c0ab490a
commit
a23b945a11
@ -511,7 +511,7 @@
|
|||||||
|
|
||||||
(define (display-subtotal monetary)
|
(define (display-subtotal monetary)
|
||||||
(if single-col
|
(if single-col
|
||||||
(if (and (not (null? leader)) (gnc-reverse-balance leader))
|
(if (and leader (gnc-reverse-balance leader))
|
||||||
(gnc:monetary-neg monetary)
|
(gnc:monetary-neg monetary)
|
||||||
monetary)
|
monetary)
|
||||||
(if (gnc-numeric-negative-p (gnc:gnc-monetary-amount monetary))
|
(if (gnc-numeric-negative-p (gnc:gnc-monetary-amount monetary))
|
||||||
@ -573,12 +573,10 @@
|
|||||||
|
|
||||||
(define (splits-leader splits)
|
(define (splits-leader splits)
|
||||||
(let ((accounts (map xaccSplitGetAccount splits)))
|
(let ((accounts (map xaccSplitGetAccount splits)))
|
||||||
(if (null? accounts) '()
|
(and (pair? accounts)
|
||||||
(begin
|
(apply equal? accounts)
|
||||||
(set! accounts (cons (car accounts)
|
(car accounts))))
|
||||||
(delete (car accounts) (cdr accounts))))
|
|
||||||
(if (not (null? (cdr accounts))) '()
|
|
||||||
(car accounts))))))
|
|
||||||
;; ----------------------------------
|
;; ----------------------------------
|
||||||
;; make the split table
|
;; make the split table
|
||||||
;; ----------------------------------
|
;; ----------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user