mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[qif-guess-map] simplify extract-all-account-info
This commit is contained in:
parent
0b258e35de
commit
a809058e10
@ -102,27 +102,10 @@
|
||||
;; GnuCash account. Each member of the list is itself a list with
|
||||
;; the form: (shortname fullname Account*)
|
||||
(define (extract-all-account-info an-account root-name)
|
||||
(if (null? an-account)
|
||||
'()
|
||||
(let ((children-list (gnc-account-get-children-sorted an-account))
|
||||
(names '()))
|
||||
|
||||
;; Recursively walk the account tree.
|
||||
(for-each
|
||||
(lambda (child-acct)
|
||||
(let* ((name (xaccAccountGetName child-acct))
|
||||
(fullname
|
||||
(if (string? root-name)
|
||||
(string-append root-name
|
||||
(gnc-get-account-separator-string)
|
||||
name)
|
||||
name)))
|
||||
(set! names
|
||||
(append (cons (list name fullname child-acct)
|
||||
(extract-all-account-info child-acct fullname))
|
||||
names))))
|
||||
children-list)
|
||||
names)))
|
||||
(map
|
||||
(lambda (acct)
|
||||
(list (xaccAccountGetName acct) (gnc-account-get-full-name acct) acct))
|
||||
(gnc-account-get-descendants-sorted an-account)))
|
||||
|
||||
(define (safe-read)
|
||||
(false-if-exception
|
||||
|
Loading…
Reference in New Issue
Block a user