From ef3157db19e5ebee4c669da03757ed5ec8fe8321 Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Fri, 30 Aug 2019 18:26:22 +0800 Subject: [PATCH] [budget] rename envelope option to 'Use accumulated amounts' Because envelope budgeting means something else. This means release 3.7 (the first release with this feature) will use the better name. --- gnucash/report/standard-reports/budget.scm | 24 +++++++++++-------- .../standard-reports/test/test-budget.scm | 6 ++--- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/gnucash/report/standard-reports/budget.scm b/gnucash/report/standard-reports/budget.scm index 0c74ec7dca..e09c3124ff 100644 --- a/gnucash/report/standard-reports/budget.scm +++ b/gnucash/report/standard-reports/budget.scm @@ -55,8 +55,8 @@ (define opthelp-show-actual (N_ "Display a column for the actual values.")) (define optname-show-difference (N_ "Show Difference")) (define opthelp-show-difference (N_ "Display the difference as budget - actual.")) -(define optname-use-envelope (N_ "Use envelope budgeting")) -(define opthelp-use-envelope (N_ "Values are accumulated across periods.")) +(define optname-accumulate (N_ "Use accumulated amounts")) +(define opthelp-accumulate (N_ "Values are accumulated across periods.")) (define optname-show-totalcol (N_ "Show Column with Totals")) (define opthelp-show-totalcol (N_ "Display a column with the row totals.")) (define optname-show-zb-accounts (N_ "Include accounts with zero total balances and budget values")) @@ -139,8 +139,8 @@ (add-option (gnc:make-simple-boolean-option - gnc:pagename-general optname-use-envelope - "b" opthelp-use-envelope #f)) + gnc:pagename-general optname-accumulate + "b" opthelp-accumulate #f)) (add-option (gnc:make-complex-boolean-option @@ -269,7 +269,7 @@ (show-actual? (get-val params 'show-actual)) (show-budget? (get-val params 'show-budget)) (show-diff? (get-val params 'show-difference)) - (use-envelope? (get-val params 'use-envelope)) + (accumulate? (get-val params 'use-envelope)) (show-totalcol? (get-val params 'show-totalcol)) (use-ranges? (get-val params 'use-ranges)) (num-rows (gnc:html-acct-table-num-rows acct-table)) @@ -343,7 +343,7 @@ (let* ((comm (xaccAccountGetCommodity acct)) (reverse-balance? (gnc-reverse-balance acct)) (allperiods (filter number? (flatten column-list))) - (total-periods (if use-envelope? + (total-periods (if accumulate? (iota (1+ (apply max allperiods))) allperiods)) (income-acct? (eqv? (xaccAccountGetType acct) ACCT-TYPE-INCOME))) @@ -406,7 +406,7 @@ (else (let* ((period-list (cond ((list? (car column-list)) (car column-list)) - (use-envelope? (iota (1+ (car column-list)))) + (accumulate? (iota (1+ (car column-list)))) (else (list (car column-list))))) (bgt-val (gnc:get-account-periodlist-budget-value budget acct period-list)) @@ -675,7 +675,7 @@ (if show-zb-accts? 'show-leaf-acct 'omit-leaf-acct)) (list 'report-budget budget))) (accounts (sort accounts account-full-nametable-row-col sxml 1 5 #f))) - (set-option options "General" "Use envelope budgeting" #t) - (let ((sxml (options->sxml options "envelope budgeting"))) - (test-equal "envelope budgeting" + (set-option options "General" "Use accumulated amounts" #t) + (let ((sxml (options->sxml options "Use accumulated amounts"))) + (test-equal "use accumulated amounts" '("Bank" "$60.00" "$15.00" "$45.00" "$60.00" "$82.00" "-$22.00" "$120.00" "$159.00" "-$39.00" "$120.00" "$159.00" "-$39.00") (sxml->table-row-col sxml 1 5 #f)))