diff --git a/ChangeLog b/ChangeLog index 75258eac2b..0d74be0b6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-05-03 Robert Graham Merkel + + * src/scm/report/transaction-report.scm: fix bug with secondary + subheadings. + 2001-05-03 Dave Peticolas * many files: fix spelling errors diff --git a/src/scm/report/transaction-report.scm b/src/scm/report/transaction-report.scm index 279db71444..1ab7b1b08e 100644 --- a/src/scm/report/transaction-report.scm +++ b/src/scm/report/transaction-report.scm @@ -696,28 +696,48 @@ and Income accounts"))))) (total-collector 'add (gnc:gnc-monetary-commodity split-value) (gnc:gnc-monetary-amount split-value)) - (if (and secondary-subtotal-pred + + (if (and primary-subtotal-pred + (or (not next) + (and next + (not (primary-subtotal-pred current next))))) + (begin + (if secondary-subtotal-pred + + (begin + (add-subtotal-row table width + secondary-subtotal-collector + def:secondary-subtotal-style) + (secondary-subtotal-collector 'reset #f #f))) + + (add-subtotal-row table width + primary-subtotal-collector + def:primary-subtotal-style) + + (primary-subtotal-collector 'reset #f #f) + + (if next + (begin + (primary-subheading-renderer + next table width def:primary-subtotal-style) + + (if secondary-subtotal-pred + (secondary-subheading-renderer + next + table + width def:secondary-subtotal-style))))) + + (if (and secondary-subtotal-pred (or (not next) (and next (not (secondary-subtotal-pred current next))))) - (begin (add-subtotal-row table width + (begin (add-subtotal-row table width secondary-subtotal-collector def:secondary-subtotal-style) (secondary-subtotal-collector 'reset #f #f) (if next (secondary-subheading-renderer - next table width def:secondary-subtotal-style)))) - (if (and primary-subtotal-pred - (or (not next) - (and next - (not (primary-subtotal-pred current next))))) - (begin (add-subtotal-row table width - primary-subtotal-collector - def:primary-subtotal-style) - (primary-subtotal-collector 'reset #f #f) - (if next - (primary-subheading-renderer - next table width def:primary-subtotal-style)))) + next table width def:secondary-subtotal-style))))) (do-rows-with-subtotals rest table used-columns