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
|
;; GnuCash account. Each member of the list is itself a list with
|
||||||
;; the form: (shortname fullname Account*)
|
;; the form: (shortname fullname Account*)
|
||||||
(define (extract-all-account-info an-account root-name)
|
(define (extract-all-account-info an-account root-name)
|
||||||
(if (null? an-account)
|
(map
|
||||||
'()
|
(lambda (acct)
|
||||||
(let ((children-list (gnc-account-get-children-sorted an-account))
|
(list (xaccAccountGetName acct) (gnc-account-get-full-name acct) acct))
|
||||||
(names '()))
|
(gnc-account-get-descendants-sorted an-account)))
|
||||||
|
|
||||||
;; 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)))
|
|
||||||
|
|
||||||
(define (safe-read)
|
(define (safe-read)
|
||||||
(false-if-exception
|
(false-if-exception
|
||||||
|
Loading…
Reference in New Issue
Block a user