2001-04-23 Christian Stimming <stimming@tuhh.de>

* src/scm/report/transaction-report.scm: Make more sanity
	checks. Fix bugs.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4023 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2001-04-23 21:09:24 +00:00
parent 28adf6a459
commit e4a5099dab
2 changed files with 76 additions and 47 deletions

View File

@ -1,3 +1,8 @@
2001-04-23 Christian Stimming <stimming@tuhh.de>
* src/scm/report/transaction-report.scm: Make more sanity
checks. Fix bugs.
2001-04-23 Dave Peticolas <dave@krondo.com> 2001-04-23 Dave Peticolas <dave@krondo.com>
* src/engine/Query.c (xaccQueryGetSplitsUniqueTrans): fix bug * src/engine/Query.c (xaccQueryGetSplitsUniqueTrans): fix bug

View File

@ -437,7 +437,7 @@
(gnc:make-multichoice-option (gnc:make-multichoice-option
pagename-sorting optname-prime-date-subtotal pagename-sorting optname-prime-date-subtotal
"d" (N_ "Do a date subtotal") "d" (N_ "Do a date subtotal")
'none 'monthly
subtotal-choice-list)) subtotal-choice-list))
(gnc:register-trep-option (gnc:register-trep-option
@ -474,7 +474,7 @@
(gnc:make-multichoice-option (gnc:make-multichoice-option
pagename-sorting optname-sec-date-subtotal pagename-sorting optname-sec-date-subtotal
"h" (N_ "Do a date subtotal") "h" (N_ "Do a date subtotal")
'none 'monthly
subtotal-choice-list)) subtotal-choice-list))
(gnc:register-trep-option (gnc:register-trep-option
@ -797,7 +797,7 @@ and Income accounts")))))
(car splits) table width primary-subtotal-style)) (car splits) table width primary-subtotal-style))
(if secondary-subheading-renderer (if secondary-subheading-renderer
(secondary-subheading-renderer (secondary-subheading-renderer
(car splits) table widthsecondary-subtotal-style))) (car splits) table width secondary-subtotal-style)))
(do-rows-with-subtotals splits table used-columns width (do-rows-with-subtotals splits table used-columns width
multi-rows? #t multi-rows? #t
@ -916,9 +916,11 @@ and Income accounts")))))
(secondary-key (opt-val pagename-sorting optname-sec-sortkey)) (secondary-key (opt-val pagename-sorting optname-sec-sortkey))
(secondary-order (opt-val pagename-sorting "Secondary Sort Order")) (secondary-order (opt-val pagename-sorting "Secondary Sort Order"))
(splits '()) (splits '())
(table '())
(query (gnc:malloc-query))) (query (gnc:malloc-query)))
;;(warn "accts in trep-renderer:" c_accounts)
(if (not (or (null? c_accounts) (and-map not c_accounts)))
(begin
(gnc:query-set-group query (gnc:get-current-group)) (gnc:query-set-group query (gnc:get-current-group))
(gnc:query-add-account-match query (gnc:query-add-account-match query
(gnc:list->glist c_accounts) (gnc:list->glist c_accounts)
@ -936,8 +938,9 @@ and Income accounts")))))
(set! splits (gnc:glist->list (gnc:query-get-splits query) (set! splits (gnc:glist->list (gnc:query-get-splits query)
<gnc:Split*>)) <gnc:Split*>))
;; (gnc:warn "Splits in trep-renderer:" splits) ;;(gnc:warn "Splits in trep-renderer:" splits)
(set! table (if (not (null? splits))
(let ((table
(make-split-table (make-split-table
splits splits
options options
@ -952,17 +955,38 @@ and Income accounts")))))
optname-prime-date-subtotal) optname-prime-date-subtotal)
(get-subheading-renderer optname-sec-sortkey (get-subheading-renderer optname-sec-sortkey
optname-sec-subtotal optname-sec-subtotal
optname-sec-date-subtotal))) optname-sec-date-subtotal))))
(gnc:html-document-set-title! document (_ "Transaction Report")) (gnc:html-document-set-title! document
(_ "Transaction Report"))
(gnc:html-document-add-object! (gnc:html-document-add-object!
document document
(gnc:make-html-text (gnc:make-html-text
(gnc:html-markup-h3 (display-date-interval begindate enddate)))) (gnc:html-markup-h3
(display-date-interval begindate enddate))))
(gnc:html-document-add-object! (gnc:html-document-add-object!
document document
table) table)
(gnc:free-query query) (gnc:free-query query))
;; error condition: no splits found
(let ((p (gnc:make-html-text)))
(gnc:html-text-append!
p
(gnc:html-markup-h2
(_ "No matching transactions found"))
(gnc:html-markup-p
(_ "No transactions were found that \
match the given time interval and account selection.")))
(gnc:html-document-add-object! document p))))
;; error condition: no accounts specified
(let ((p (gnc:make-html-text)))
(gnc:html-text-append!
p
(gnc:html-markup-h2 (_ "No accounts selected"))
(gnc:html-markup-p
(_ "This report requires accounts to be selected.")))
(gnc:html-document-add-object! document p)))
document)) document))