2001-07-04 Dave Peticolas <dave@krondo.com>

* AUTHORS: credits

	* doc/sgml/C/xacc-about.sgml: credits

	* src/scm/report/transaction.scm: Michael T. Garrison Stuber's
	transaction report patch.

	* doc/sgml/C/xacc-common-report-options.sgml: fix warning


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4898 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2001-07-05 06:53:14 +00:00
parent 4e4ca69c5f
commit 5eb7ddb4e9
5 changed files with 94 additions and 8 deletions

View File

@ -172,6 +172,7 @@ Henning Spruth <spruth@bigfoot.com> for German text & euro date rework
Ben Stanley <bds02@uow.edu.au> test infrastructure
Robby Stephenson <robby.stephenson@usa.net> register & file history patches
Christian Stimming <stimming@tuhh.de> report patch
Michael T. Garrison Stuber <garrisonstuber@bellsouth.net> report patch
Bartek Szady <bszx@bszxdomain.edu.eu.org> engine and build system patches
Herbert Thoma <tma@iis.fhg.de> gnome register & euro support patches
Arnold Troeger <troeger@samart.co.th> Mandrake packager

View File

@ -1,3 +1,14 @@
2001-07-04 Dave Peticolas <dave@krondo.com>
* AUTHORS: credits
* doc/sgml/C/xacc-about.sgml: credits
* src/scm/report/transaction.scm: Michael T. Garrison Stuber's
transaction report patch.
* doc/sgml/C/xacc-common-report-options.sgml: fix warning
2001-07-05 Robert Graham Merkel <rgmerk@mira.net>
* src/gnome/druid-qif-import.c: fix syntax bug.

View File

@ -959,6 +959,14 @@ Nielsen</glossterm>
</glossdef>
</glossentry>
<glossentry>
<glossterm><email>garrisonstuber@bellsouth.net</email> Michael
T. Garrison Stuber</glossterm>
<glossdef>
<para>report patch</para>
</glossdef>
</glossentry>
<glossentry>
<glossterm><email>bszx@bszxdomain.edu.eu.org</email> Bartek
Szady</glossterm>

View File

@ -106,5 +106,6 @@ prices at current values, or prices at the time of the report date.</para>
will be placed in a slice marked "other".
</para>
</listitem></itemizedlist>
</para>
</sect1>
</article>

View File

@ -5,6 +5,8 @@
;; Contributions by Bryan Larsen <blarsen@ada-works.com>
;; More contributions for new report generation code by Robert Merkel
;; More contributions by Christian Stimming <stimming@tuhh.de>
;; Modified to support the intersection of two account lists by
;; Michael T. Garrison Stuber
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
@ -31,6 +33,7 @@
(define-module (gnucash report transaction))
(use-modules (srfi srfi-1))
(use-modules (ice-9 slib))
(require 'printf)
(require 'record)
@ -435,8 +438,8 @@
;; account to do report on
(gnc:register-trep-option
(gnc:make-account-list-option
gnc:pagename-accounts (N_ "Accounts")
"c" (N_ "Do transaction report on these accounts")
gnc:pagename-accounts (N_ "Report Accounts")
"a" (N_ "Report on these accounts")
(lambda ()
;; FIXME : gnc:get-current-accounts disappeared.
(let ((current-accounts '())
@ -450,6 +453,39 @@
(else ()))))
#f #t))
(gnc:register-trep-option
(gnc:make-account-list-option
gnc:pagename-accounts (N_ "Filter Accounts")
"b" (N_ "Filter 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))
(gnc:register-trep-option
(gnc:make-multichoice-option
gnc:pagename-accounts (N_ "Filter Type")
"c" (N_ "Filter account")
'none
(list (vector 'none
(N_ "None")
(N_ "Do not do any filtering"))
(vector 'include
(N_ "Include Transactions to/from Filter Accounts")
(N_ "Include transactions to/from filter accounts only"))
(vector 'exclude
(N_ "Exclude Transactions to/from Filter Accounts")
(N_ "Exclude transactions to/from all filter accounts"))
)))
;; Sorting options
(let ((options gnc:*transaction-report-options*)
@ -973,8 +1009,13 @@ and Income accounts")))))
name-sortkey name-subtotal name-date-subtotal
3 2))
(define (get-other-account-names account-list)
( map (lambda (acct) (gnc:account-get-full-name acct)) account-list))
(let ((document (gnc:make-html-document))
(c_accounts (opt-val gnc:pagename-accounts "Accounts"))
(c_account_1 (opt-val gnc:pagename-accounts "Report Accounts"))
(c_account_2 (opt-val gnc:pagename-accounts "Filter Accounts"))
(filter-mode (opt-val gnc:pagename-accounts "Filter Type"))
(begindate (gnc:timepair-start-day-time
(gnc:date-option-absolute-time
(opt-val gnc:pagename-general "From"))))
@ -991,14 +1032,15 @@ and Income accounts")))))
(splits '())
(query (gnc:malloc-query)))
;;(warn "accts in trep-renderer:" c_accounts)
(if (not (or (null? c_accounts) (and-map not c_accounts)))
;;(gnc:warn "accts in trep-renderer:" c_account_1)
;;(gnc:warn "Report Account names:" (get-other-account-names c_account_1))
(if (not (or (null? c_account_1) (and-map not c_account_1)))
(begin
(gnc:query-set-group query (gnc:get-current-group))
;;(gnc:warn "query is:" query)
(gnc:query-add-account-match query
(gnc:list->glist c_accounts)
(gnc:list->glist c_account_1)
'acct-match-any 'query-and)
(gnc:query-add-date-match-timepair
query #t begindate #t enddate 'query-and)
@ -1014,6 +1056,29 @@ and Income accounts")))))
(set! splits (gnc:glist->list (gnc:query-get-splits query)
<gnc:Split*>))
;;(gnc:warn "Splits in trep-renderer:" splits)
;;(gnc:warn "Filter account names:" (get-other-account-names c_account_2))
;;This should probably a cond or a case to allow for different filter types.
;;(gnc:warn "Filter Mode: " filter-mode)
(if (string=? filter-mode "include")
(begin
;;(gnc:warn "Including Filter Accounts")
(set! splits (filter (lambda (split)
(member (gnc:split-get-corr-account-full-name split) (get-other-account-names c_account_2)))
splits))
)
)
(if (string=? filter-mode "exclude")
(begin
;;(gnc:warn "Excluding Filter Accounts")
(set! splits (filter (lambda (split)
(not (member (gnc:split-get-corr-account-full-name split) (get-other-account-names c_account_2))))
splits))
)
)
(if (not (null? splits))
(let ((table
(make-split-table