diff --git a/gnucash/report/standard-reports/daily-reports.scm b/gnucash/report/standard-reports/daily-reports.scm index c87eccf51c..5339ff2037 100644 --- a/gnucash/report/standard-reports/daily-reports.scm +++ b/gnucash/report/standard-reports/daily-reports.scm @@ -2,7 +2,6 @@ ;; daily-reports.scm: reports based on the day of the week ;; ;; Copyright (C) 2003, Andy Wingo -;; Christopher Lam upgrade to time64 (2017) ;; ;; based on account-piecharts.scm by Robert Merkel (rgmerk@mira.net) ;; and Christian Stimming with diff --git a/gnucash/report/standard-reports/sx-summary.scm b/gnucash/report/standard-reports/sx-summary.scm index 550ae99099..2891ad7257 100644 --- a/gnucash/report/standard-reports/sx-summary.scm +++ b/gnucash/report/standard-reports/sx-summary.scm @@ -5,7 +5,6 @@ ;; Copyright 2004 David Montenegro ;; Copyright 2001 Christian Stimming ;; Copyright 2000-2001 Bill Gribble -;; Copyright 2017 Christopher Lam upgrade to time64 ;; ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License as diff --git a/gnucash/report/standard-reports/transaction.scm b/gnucash/report/standard-reports/transaction.scm index 9227cb7ae1..249b01c55e 100644 --- a/gnucash/report/standard-reports/transaction.scm +++ b/gnucash/report/standard-reports/transaction.scm @@ -318,25 +318,30 @@ in the Options panel.")) (cons 'tip (_ "Show both (and include void transactions in totals).")))))) (define reconcile-status-list - ;; value will be either #f to disable reconciled-status filter - ;; or a list of xaccSplitGetReconcile values. e.g. value can - ;; be '(#\c #\y) to retrieve list of cleared and reconciled splits. (list - (cons #f (list - (cons 'text (_ "All")) - (cons 'tip (_ "Show All Transactions")))) + (cons 'all + (list + (cons 'text (_ "All")) + (cons 'tip (_ "Show All Transactions")) + (cons 'filter-types #f))) - (cons '(#\n) (list - (cons 'text (_ "Unreconciled")) - (cons 'tip (_ "Unreconciled only")))) + (cons 'unreconciled + (list + (cons 'text (_ "Unreconciled")) + (cons 'tip (_ "Unreconciled only")) + (cons 'filter-types (list #\n)))) - (cons '(#\c) (list - (cons 'text (_ "Cleared")) - (cons 'tip (_ "Cleared only")))) + (cons 'cleared + (list + (cons 'text (_ "Cleared")) + (cons 'tip (_ "Cleared only")) + (cons 'filter-types (list #\c)))) - (cons '(#\y) (list - (cons 'text (_ "Reconciled")) - (cons 'tip (_ "Reconciled only")))))) + (cons 'reconciled + (list + (cons 'text (_ "Reconciled")) + (cons 'tip (_ "Reconciled only")) + (cons 'filter-types (list #\y)))))) (define ascending-list @@ -460,17 +465,17 @@ Credit Card, and Income accounts.")) (gnc:make-multichoice-option gnc:pagename-general optname-infobox-display "h" (_ "Add summary of options.") - '(no-match) + 'no-match ;; This is an alist of conditions for displaying the infobox ;; 'no-match for empty-report ;; 'match for generated report - (list (vector '(no-match) + (list (vector 'no-match (_ "If no transactions matched") (_ "Display summary if no transactions were matched.")) - (vector '(no-match match) + (vector 'always (_ "Always") (_ "Always display summary.")) - (vector '() + (vector 'never (_ "Never") (_ "Disable report summary."))))) @@ -515,7 +520,7 @@ tags within description, notes or memo. ") (gnc:make-multichoice-option pagename-filter optname-reconcile-status "j1" (_ "Filter by reconcile status.") - #f + 'all (keylist->vectorlist reconcile-status-list))) (gnc:register-trep-option @@ -1669,7 +1674,9 @@ tags within description, notes or memo. ") (transaction-matcher (opt-val pagename-filter optname-transaction-matcher)) (transaction-matcher-regexp (and (opt-val pagename-filter optname-transaction-matcher-regex) (make-regexp transaction-matcher))) - (reconcile-status-filter (opt-val pagename-filter optname-reconcile-status)) + (reconcile-status-filter (keylist-get-info reconcile-status-list + (opt-val pagename-filter optname-reconcile-status) + 'filter-types)) (report-title (opt-val gnc:pagename-general gnc:optname-reportname)) (primary-key (opt-val pagename-sorting optname-prime-sortkey)) (primary-order (opt-val pagename-sorting optname-prime-sortorder)) @@ -1744,21 +1751,19 @@ tags within description, notes or memo. ") ;; error condition: no accounts specified or obtained after filtering (begin - ;; error condition: no accounts specified - (begin + (gnc:html-document-add-object! + document + (gnc:html-make-no-account-warning + report-title (gnc:report-id report-obj))) + ;; if an empty-report-message is passed by a derived report to + ;; the renderer, display it here. + (if empty-report-message (gnc:html-document-add-object! document - (gnc:html-make-no-account-warning report-title (gnc:report-id report-obj))) + empty-report-message)) - ;; if an empty-report-message is passed by a derived report to - ;; the renderer, display it here. - (if empty-report-message - (gnc:html-document-add-object! - document - empty-report-message))) - - (if (member 'no-match infobox-display) + (if (memq infobox-display '(always no-match)) (gnc:html-document-add-object! document (gnc:render-options-changed options)))) @@ -1817,21 +1822,23 @@ tags within description, notes or memo. ") (match? (xaccSplitGetMemo split))) (or (not custom-split-filter) ; #f = ignore custom-split-filter (custom-split-filter split)) - (or (not reconcile-status-filter) ; #f = ignore next filter - (member (xaccSplitGetReconcile split) reconcile-status-filter))))) + (or (not reconcile-status-filter) ; #f = ignore reconcile-status-filter + (memv (xaccSplitGetReconcile split) + reconcile-status-filter))))) splits)) (if (null? splits) ;; error condition: no splits found (begin + (gnc:html-document-add-object! document - (gnc:make-html-text - (gnc:html-markup-h2 NO-MATCHING-TRANS-HEADER) - (gnc:html-markup-p NO-MATCHING-TRANS-TEXT))) + (gnc:html-make-generic-warning + report-title (gnc:report-id report-obj) + NO-MATCHING-TRANS-HEADER NO-MATCHING-TRANS-TEXT)) - (if (member 'no-match infobox-display) + (if (memq infobox-display '(always no-match)) (gnc:html-document-add-object! document (gnc:render-options-changed options)))) @@ -1849,7 +1856,7 @@ tags within description, notes or memo. ") (qof-print-date begindate) (qof-print-date enddate))))) - (if (member 'match infobox-display) + (if (eq? infobox-display 'always) (gnc:html-document-add-object! document (gnc:render-options-changed options))) diff --git a/libgnucash/app-utils/date-utilities.scm b/libgnucash/app-utils/date-utilities.scm index ffad895572..1729d0869a 100644 --- a/libgnucash/app-utils/date-utilities.scm +++ b/libgnucash/app-utils/date-utilities.scm @@ -91,19 +91,7 @@ 604800)) (begin-string (qof-print-date (+ beginweekt64 345600))) (end-string (qof-print-date (+ beginweekt64 864000)))) - (format #f (_ "~s to ~s") begin-string end-string))) - -; (let ((begin-string (qof-print-date -; (+ (* (gnc:date-get-week -; (gnc:time64-start-day-time -; (gnc-mktime datevec))) -; 604800) 345600))) -; (end-string (qof-print-date -; (+ (* (gnc:date-get-week -; (gnc:time64-start-day-time -; (gnc-mktime datevec))) -; 604800) 864000)))) -; (format #f (_ "~s to ~s") begin-string end-string))) + (format #f (_ "~a to ~a") begin-string end-string))) ;; is leap year? (define (gnc:leap-year? year) diff --git a/libgnucash/app-utils/options.scm b/libgnucash/app-utils/options.scm index 9d8f109208..fd82e219fe 100644 --- a/libgnucash/app-utils/options.scm +++ b/libgnucash/app-utils/options.scm @@ -2056,8 +2056,8 @@ (set! row-contents (cons return-string row-contents))))) (gnc:options-for-each disp-option-if-changed options) (string-append (string-join (reverse row-contents) - (if plaintext? "\n" "
")) - (if plaintext? "\n\n" "

")))) + (if plaintext? "\n" "
\n")) + (if plaintext? "\n\n" "
\n
\n")))) (define (gnc:send-options db_handle options) (gnc:options-for-each