From 8f2776dabda54e82f9ff592d78ffa9380a14b757 Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Sun, 20 Jan 2019 08:25:59 +0800 Subject: [PATCH] [transaction] bugfix: subtotal-table + subtotals-only = hide table It is intuitive that if the user wishes to show the subtotal-table, and hide the transactions, then both the main (hidden) transactions and subtotals must be hidden as well. https://gnucash.uservoice.com/forums/101223-feature-request/suggestions/36565759-add-a-transaction-report-option-to-show-subtotal --- gnucash/report/standard-reports/transaction.scm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/gnucash/report/standard-reports/transaction.scm b/gnucash/report/standard-reports/transaction.scm index f6e949270d..07defc380f 100644 --- a/gnucash/report/standard-reports/transaction.scm +++ b/gnucash/report/standard-reports/transaction.scm @@ -1888,6 +1888,11 @@ be excluded from periodic reporting.") (not (eq? secondary-date-subtotal 'none))) (or (CUSTOM-SORTING? primary-key BOOK-SPLIT-ACTION) (CUSTOM-SORTING? secondary-key BOOK-SPLIT-ACTION)))) + (subtotal-table? (and (opt-val gnc:pagename-display optname-grid) + (if (memq primary-key DATE-SORTING-TYPES) + (keylist-get-info date-subtotal-list primary-date-subtotal 'renderer-fn) + (opt-val pagename-sorting optname-prime-subtotal)) + (eq? (opt-val gnc:pagename-display (N_ "Amount")) 'single))) (infobox-display (opt-val gnc:pagename-general optname-infobox-display)) (query (qof-query-create-for-splits))) @@ -2049,11 +2054,7 @@ be excluded from periodic reporting.") document (gnc:html-render-options-changed options))) - (if (and (opt-val gnc:pagename-display optname-grid) - (if (memq primary-key DATE-SORTING-TYPES) - (keylist-get-info date-subtotal-list primary-date-subtotal 'renderer-fn) - (opt-val pagename-sorting optname-prime-subtotal)) - (eq? (opt-val gnc:pagename-display (N_ "Amount")) 'single)) + (if subtotal-table? (let* ((generichtml-table grid list-of-rows list-of-cols)))) - (gnc:html-document-add-object! document table))))) + (unless (and subtotal-table? + (opt-val pagename-sorting optname-show-subtotals-only)) + (gnc:html-document-add-object! document table)))))) (gnc:report-finished)