mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
David Montenegro's General Ledger patch (bug #155268).
* src/report/standard-reports/general-ledger.scm: src/report/standard-reports/standard-reports.scm: src/report/standard-reports/Makefile.am: Added General Ledger report, a Transaction Report with a pre-set set of options. * src/report/standard-reports/transaction.scm: FIXME - All accounts now selected by default, avoids confusing error message. Error message also clarified. Fixed "Totals" option so that it works. * src/report/standard-reports/balance-sheet.scm: * src/report/standard-reports/equity-statement.scm: * src/report/standard-reports/trial-balance.scm: Updated comments * Fixes #144268 git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10198 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
a107a9af22
commit
6f2540506d
20
ChangeLog
20
ChangeLog
@ -1,3 +1,23 @@
|
||||
2004-07-13 David Montenegro <sunrise2000@comcast.net>
|
||||
|
||||
* src/report/standard-reports/general-ledger.scm:
|
||||
src/report/standard-reports/standard-reports.scm:
|
||||
src/report/standard-reports/Makefile.am:
|
||||
Added General Ledger report, a Transaction Report
|
||||
with a pre-set set of options.
|
||||
|
||||
* src/report/standard-reports/transaction.scm:
|
||||
FIXME - All accounts now selected by default, avoids
|
||||
confusing error message. Error message also clarified.
|
||||
Fixed "Totals" option so that it works.
|
||||
|
||||
* src/report/standard-reports/balance-sheet.scm:
|
||||
* src/report/standard-reports/equity-statement.scm:
|
||||
* src/report/standard-reports/trial-balance.scm:
|
||||
Updated comments
|
||||
|
||||
* Fixes #144268
|
||||
|
||||
2004-07-13 David Montenegro <sunrise2000@comcast.net>
|
||||
|
||||
* src/report/standard-reports/trial-balance.scm:
|
||||
|
@ -38,6 +38,7 @@ gncscmmod_DATA = \
|
||||
register.scm \
|
||||
standard-reports.scm \
|
||||
trial-balance.scm \
|
||||
general-ledger.scm \
|
||||
transaction.scm
|
||||
|
||||
EXTRA_DIST = ${gncscmmod_DATA}
|
||||
|
@ -18,12 +18,8 @@
|
||||
;; default) accounts representative of current & fixed assets &
|
||||
;; liabilities.
|
||||
;;
|
||||
;; There are some gnc:html-acct-table options which remain unused,
|
||||
;; mostly because I don't know how to make drop-down option
|
||||
;; controls.
|
||||
;;
|
||||
;; This code makes the assumption that you want your equity
|
||||
;; statement to no more than daily resolution.
|
||||
;; This code makes the assumption that you want your balance
|
||||
;; sheet to no more than daily resolution.
|
||||
;;
|
||||
;; The Company Name field does not currently default to the name
|
||||
;; in (gnc:get-current-book).
|
||||
@ -347,7 +343,7 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; balance-sheet-renderer
|
||||
;; set up the document and add the table
|
||||
;; then then return the document or, if
|
||||
;; then return the document or, if
|
||||
;; requested, export it to a file
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
|
@ -203,7 +203,7 @@
|
||||
gnc:pagename-display optname-use-rules
|
||||
"f" opthelp-use-rules #f))
|
||||
|
||||
;; adjusting/closing entry match criteria
|
||||
;; closing entry match criteria
|
||||
;;
|
||||
;; N.B.: transactions really should have a field where we can put
|
||||
;; transaction types like "Adjusting/Closing/Correcting Entries"
|
||||
|
138
src/report/standard-reports/general-ledger.scm
Normal file
138
src/report/standard-reports/general-ledger.scm
Normal file
@ -0,0 +1,138 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; general-ledger.scm: general ledger report
|
||||
;;
|
||||
;; By David Montenegro <sunrise2000@comcast.net> 2004.07.13
|
||||
;;
|
||||
;; * BUGS:
|
||||
;;
|
||||
;; See any "FIXME"s in the code.
|
||||
;;
|
||||
;; Largely borrowed from welcome-to-gnucash.scm by
|
||||
;; Bill Gribble <grib@gnumatic.com>
|
||||
;;
|
||||
;; This program is free software; you can redistribute it and/or
|
||||
;; modify it under the terms of the GNU General Public License as
|
||||
;; published by the Free Software Foundation; either version 2 of
|
||||
;; the License, or (at your option) any later version.
|
||||
;;
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
;;
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program; if not, contact:
|
||||
;;
|
||||
;; Free Software Foundation Voice: +1-617-542-5942
|
||||
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
|
||||
;; Boston, MA 02111-1307, USA gnu@gnu.org
|
||||
;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(define-module (gnucash report general-ledger))
|
||||
(export gnc:make-general-ledger-report)
|
||||
(use-modules (gnucash main)) ;; FIXME: delete after we finish modularizing.
|
||||
(use-modules (ice-9 slib))
|
||||
(use-modules (gnucash gnc-module))
|
||||
|
||||
(gnc:module-load "gnucash/report/report-system" 0)
|
||||
|
||||
(define reportname (N_ "General Ledger"))
|
||||
(define xactrptname "Transaction Report")
|
||||
|
||||
;; report constructor
|
||||
|
||||
(define (gnc:make-general-ledger-report)
|
||||
(let* ((xactrpt (gnc:make-report xactrptname)))
|
||||
xactrpt))
|
||||
|
||||
;; options generator
|
||||
|
||||
(define (general-ledger-options-generator)
|
||||
|
||||
(let* ((options (gnc:report-template-new-options/name xactrptname))
|
||||
)
|
||||
|
||||
(define pagename-sorting (N_ "Sorting"))
|
||||
(define (set-option! section name value)
|
||||
(gnc:option-set-value
|
||||
(gnc:lookup-option options section name) value))
|
||||
|
||||
;; set options in the accounts tab...
|
||||
(set-option!
|
||||
gnc:pagename-accounts (N_ "Filter Type") 'none)
|
||||
(set-option!
|
||||
gnc:pagename-accounts (N_ "Void Transactions?") 'non-void-only)
|
||||
|
||||
;; set options in the display tab...
|
||||
(for-each
|
||||
(lambda (l)
|
||||
(set-option! gnc:pagename-display (car l) (cadr l)))
|
||||
;; One list per option here with: option-name, default-value
|
||||
(list
|
||||
(list (N_ "Date") #t)
|
||||
(list (N_ "Reconciled Date") #f)
|
||||
(list (N_ "Num") #f)
|
||||
(list (N_ "Description") #t)
|
||||
(list (N_ "Memo") #f)
|
||||
(list (N_ "Account Name") #f)
|
||||
(list (N_ "Use Full Account Name?") #f)
|
||||
(list (N_ "Account Code") #f)
|
||||
(list (N_ "Other Account Name") #f)
|
||||
(list (N_ "Use Full Other Account Name?") #f)
|
||||
(list (N_ "Other Account Code") #f)
|
||||
(list (N_ "Shares") #f)
|
||||
(list (N_ "Price") #f)
|
||||
;; note the "Amount" multichoice option here
|
||||
(list (N_ "Amount") 'double)
|
||||
(list (N_ "Running Balance") #t)
|
||||
(list (N_ "Totals") #f)
|
||||
(list (N_ "Sign Reverses?") 'credit-accounts)
|
||||
)
|
||||
)
|
||||
|
||||
;; set options in the general tab...
|
||||
(set-option!
|
||||
gnc:pagename-general (N_ "Style") 'single)
|
||||
;; we can't (currently) set the Report name here
|
||||
;; because it is automatically set to the template
|
||||
;; name... :(
|
||||
|
||||
;; set options in the sorting tab...
|
||||
(for-each
|
||||
(lambda (l)
|
||||
(set-option! pagename-sorting (car l) (cadr l)))
|
||||
;; One list per option here with: option-name, default-value
|
||||
(list
|
||||
(list (N_ "Primary Key") 'account-code)
|
||||
(list (N_ "Show Full Account Name?") #f)
|
||||
(list (N_ "Show Account Code?") #t)
|
||||
(list (N_ "Primary Subtotal") #t)
|
||||
(list (N_ "Primary Subtotal for Date Key") 'none)
|
||||
(list (N_ "Primary Sort Order") 'ascend)
|
||||
(list (N_ "Secondary Key") 'register-order)
|
||||
(list (N_ "Secondary Subtotal") #t)
|
||||
(list (N_ "Secondary Subtotal for Date Key") 'none)
|
||||
(list (N_ "Secondary Sort Order") 'ascend)
|
||||
)
|
||||
)
|
||||
|
||||
options)
|
||||
)
|
||||
|
||||
;; report renderer
|
||||
|
||||
(define (general-ledger-renderer report-obj)
|
||||
;; just delegate rendering to the Transaction Report renderer...
|
||||
((gnc:report-template-renderer/name xactrptname) report-obj))
|
||||
|
||||
(gnc:define-report
|
||||
'version 1
|
||||
'name reportname
|
||||
'menu-path (list gnc:menuname-asset-liability)
|
||||
'options-generator general-ledger-options-generator
|
||||
'renderer general-ledger-renderer
|
||||
)
|
||||
|
||||
;; END
|
||||
|
@ -72,6 +72,7 @@
|
||||
(use-modules (gnucash report average-balance))
|
||||
(use-modules (gnucash report balance-sheet))
|
||||
(use-modules (gnucash report equity-statement))
|
||||
(use-modules (gnucash report general-ledger))
|
||||
(use-modules (gnucash report cash-flow))
|
||||
(use-modules (gnucash report category-barchart))
|
||||
(use-modules (gnucash report daily-reports))
|
||||
|
@ -508,18 +508,13 @@
|
||||
(gnc:make-account-list-option
|
||||
gnc:pagename-accounts (N_ "Report Accounts")
|
||||
"a" (N_ "Report on these accounts")
|
||||
(lambda ()
|
||||
;; FIXME : gnc:get-current-accounts disappeared.
|
||||
(let ((current-accounts '())
|
||||
(num-accounts (gnc:group-get-num-accounts
|
||||
(gnc:get-current-group)))
|
||||
(first-account (gnc:group-get-account
|
||||
(gnc:get-current-group) 0)))
|
||||
(cond ((not (null? current-accounts))
|
||||
(list (car current-accounts)))
|
||||
((> num-accounts 0) (list first-account))
|
||||
(else ()))))
|
||||
#f #t))
|
||||
;; select, by default, all accounts...
|
||||
(lambda ()
|
||||
(gnc:filter-accountlist-type
|
||||
'(bank cash credit asset liability stock mutual-fund currency
|
||||
payable receivable equity income expense)
|
||||
(gnc:group-get-subaccounts (gnc:get-current-group))))
|
||||
#f #t))
|
||||
|
||||
(gnc:register-trep-option
|
||||
(gnc:make-account-list-option
|
||||
@ -908,9 +903,9 @@ Credit Card, and Income accounts")))))
|
||||
(list
|
||||
(gnc:make-html-table-cell/size
|
||||
1 width (gnc:make-html-text (gnc:html-markup-hr)))))
|
||||
|
||||
(render-grand-total table width total-collector export?))
|
||||
|
||||
(if (gnc:option-value (gnc:lookup-option options "Display" "Totals"))
|
||||
(render-grand-total table width total-collector export?)))
|
||||
|
||||
(let* ((current (car splits))
|
||||
(current-row-style (if multi-rows? def:normal-row-style
|
||||
(if odd-row? def:normal-row-style
|
||||
@ -1315,7 +1310,8 @@ Credit Card, and Income accounts")))))
|
||||
(_ "No matching transactions found"))
|
||||
(gnc:html-markup-p
|
||||
(_ "No transactions were found that \
|
||||
match the given time interval and account selection.")))
|
||||
match the time interval and account selection specified \
|
||||
in the Options panel.")))
|
||||
(gnc:html-document-add-object! document p))))
|
||||
|
||||
;; error condition: no accounts specified
|
||||
|
@ -1,6 +1,6 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; trial-balance.scm: trial balance and work sheet
|
||||
;; By David Montenegro
|
||||
;; By David Montenegro <sunrise2000@comcast.net>
|
||||
;;
|
||||
;; Prepares a trial balance of your books.
|
||||
;; Optionally prepares a complete work sheet.
|
||||
|
Loading…
Reference in New Issue
Block a user