mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-07-29 23:58:03 -05:00
Christian Stimming's report patch.
* src/scm/report-utilities.scm: Added function (gnc:account-get-type-string-plural). Changed gnc:decompose-accountlist to return AccountType symbols. * src/scm/html-utilities.scm, src/scm/report/net-worth-timeseries.scm, balance-sheet.scm: Adapted to changed gnc:decompose-accountlist. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3925 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -1,3 +1,13 @@
|
||||
2001-04-10 Christian Stimming <stimming@tuhh.de>
|
||||
|
||||
* src/scm/report-utilities.scm: Added function
|
||||
(gnc:account-get-type-string-plural). Changed
|
||||
gnc:decompose-accountlist to return AccountType symbols.
|
||||
|
||||
* src/scm/html-utilities.scm,
|
||||
src/scm/report/net-worth-timeseries.scm, balance-sheet.scm:
|
||||
Adapted to changed gnc:decompose-accountlist.
|
||||
|
||||
2001-04-10 Dave Peticolas <dave@krondo.com>
|
||||
|
||||
* src/engine/date.c (__EXTENSIONS__): add a define for solaris
|
||||
|
||||
@@ -480,7 +480,9 @@
|
||||
(for-each
|
||||
(lambda (accts)
|
||||
(if (and (not (null? accts)) (not (null? (cdr accts))))
|
||||
(add-group! 1 (car accts) (cdr accts) #f #t)))
|
||||
(add-group! 1
|
||||
(gnc:account-get-type-string-plural (car accts))
|
||||
(cdr accts) #f #t)))
|
||||
(gnc:decompose-accountlist (lset-intersection
|
||||
equal? accounts topl-accounts)))
|
||||
;; No extra grouping.
|
||||
|
||||
@@ -73,21 +73,46 @@
|
||||
typelist) )
|
||||
accounts))
|
||||
|
||||
;; Decompose a given list of accounts accts into different lists
|
||||
;; according to their types, each with the name of that category as
|
||||
;; first element.
|
||||
;; Decompose a given list of accounts 'accounts' into an alist
|
||||
;; according to their types. Each element of alist is a list, whose
|
||||
;; first element is the type-symbol, e.g. 'assets, and the rest (cdr)
|
||||
;; of the element is the list of accounts which belong to that
|
||||
;; category.
|
||||
(define (gnc:decompose-accountlist accounts)
|
||||
(map (lambda (x) (cons
|
||||
(car x)
|
||||
(gnc:filter-accountlist-type (cdr x) accounts)))
|
||||
(list
|
||||
(cons (_ "Assets")
|
||||
(cons 'asset
|
||||
'(asset bank cash checking savings money-market
|
||||
stock mutual-fund currency))
|
||||
(cons (_ "Liabilities") '(liability credit credit-line))
|
||||
(cons (_ "Equity") '(equity))
|
||||
(cons (_ "Income") '(income))
|
||||
(cons (_ "Expense") '(expense)))))
|
||||
(cons 'liability '(liability credit credit-line))
|
||||
(cons 'equity '(equity))
|
||||
(cons 'income '(income))
|
||||
(cons 'expense '(expense)))))
|
||||
|
||||
;; Returns the name of the account type as a string, and in its plural
|
||||
;; form (as opposed to gnc:account-get-type-string which gives the
|
||||
;; singular form of the word).
|
||||
(define (gnc:account-get-type-string-plural type)
|
||||
(assoc-ref
|
||||
(list
|
||||
(cons 'bank (_ "Bank"))
|
||||
(cons 'cash (_ "Cash"))
|
||||
(cons 'credit (_ "Credits"))
|
||||
(cons 'asset (_ "Assets"))
|
||||
(cons 'liability (_ "Liabilities"))
|
||||
(cons 'stock (_ "Stocks"))
|
||||
(cons 'mutual-fund (_ "Mutual-Funds"))
|
||||
(cons 'currency (_ "Currencies"))
|
||||
(cons 'income (_ "Income"))
|
||||
(cons 'expense (_ "Expenses"))
|
||||
(cons 'equity (_ "Equities"))
|
||||
(cons 'checking (_ "Checkings"))
|
||||
(cons 'savings (_ "Savings"))
|
||||
(cons 'money-market (_ "Money-Market"))
|
||||
(cons 'credit-line (_ "Credit-Lines")))
|
||||
type))
|
||||
|
||||
;; Returns the depth of the current account heirarchy, that is, the
|
||||
;; maximum level of subaccounts in the current-group.
|
||||
|
||||
@@ -166,20 +166,20 @@
|
||||
|
||||
;; decompose the account list
|
||||
(split-up-accounts (gnc:decompose-accountlist accounts))
|
||||
(dummy (gnc:warn "split-up-accounts" split-up-accounts))
|
||||
;;(dummy (gnc:warn "split-up-accounts" split-up-accounts))
|
||||
(asset-accounts
|
||||
(assoc-ref split-up-accounts (_ "Assets")))
|
||||
(assoc-ref split-up-accounts 'asset))
|
||||
(liability-accounts
|
||||
(assoc-ref split-up-accounts (_ "Liabilities")))
|
||||
(assoc-ref split-up-accounts 'liability))
|
||||
; (liability-account-names
|
||||
; (map gnc:account-get-name liability-accounts))
|
||||
; (dummy2
|
||||
; (gnc:warn "liability-account-names" liability-account-names))
|
||||
(equity-accounts
|
||||
(assoc-ref split-up-accounts (_"Equity")))
|
||||
(assoc-ref split-up-accounts 'equity))
|
||||
(income-expense-accounts
|
||||
(append (assoc-ref split-up-accounts (_ "Income"))
|
||||
(assoc-ref split-up-accounts (_ "Expense"))))
|
||||
(append (assoc-ref split-up-accounts 'income)
|
||||
(assoc-ref split-up-accounts 'expense)))
|
||||
|
||||
|
||||
(doc (gnc:make-html-document))
|
||||
@@ -231,7 +231,7 @@
|
||||
|
||||
;;(gnc:warn "account names" liability-account-names)
|
||||
(gnc:html-document-set-title!
|
||||
;; FIXME: Use magic sprintf code.
|
||||
;; FIXME: Use magic sprintf code (which one?).
|
||||
doc (sprintf #f (_ "Balance sheet at %s")
|
||||
(gnc:timepair-to-datestring to-date-tp)))
|
||||
|
||||
|
||||
@@ -130,11 +130,11 @@
|
||||
(accounts (op-value pagename-general optname-accounts))
|
||||
(classified-accounts (gnc:decompose-accountlist accounts))
|
||||
(asset-accounts
|
||||
(assoc-ref classified-accounts (_"Assets")))
|
||||
(assoc-ref classified-accounts 'asset))
|
||||
(liability-equity-accounts
|
||||
(append
|
||||
(assoc-ref classified-accounts (_ "Liabilities"))
|
||||
(assoc-ref classified-accounts (_ "Equity"))))
|
||||
(assoc-ref classified-accounts 'liability)
|
||||
(assoc-ref classified-accounts 'equity)))
|
||||
(report-currency (op-value pagename-general
|
||||
optname-report-currency))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user