gnucash maint: Multiple changes pushed
Geert Janssens
gjanssens at code.gnucash.org
Sat Apr 26 12:28:35 EDT 2014
Updated via https://github.com/Gnucash/gnucash/commit/fb8018b3 (commit)
via https://github.com/Gnucash/gnucash/commit/65e8e3b1 (commit)
from https://github.com/Gnucash/gnucash/commit/95e12216 (commit)
commit fb8018b374d7699f28ebc8a422e28f44ff55e357
Author: Geert Janssens <janssens-geert at telenet.be>
Date: Sat Apr 26 18:27:45 2014 +0200
Additional changes to column calculations
- Add some comments to remember why this was done
- Fix one error in the code
diff --git a/src/report/standard-reports/transaction.scm b/src/report/standard-reports/transaction.scm
index 74e69d6..84345eb 100644
--- a/src/report/standard-reports/transaction.scm
+++ b/src/report/standard-reports/transaction.scm
@@ -355,11 +355,20 @@
(do ((i 0 (+ i 1))
(col-req 0 col-req))
((>= i columns-used-size) col-req)
- (if (and (not (= i 12)) (not (= i 16)) (not (= i 18)) (not (= i 19)) (vector-ref columns-used i))
+ ; If column toggle is true, increase column count. But attention:
+ ; some toggles only change the meaning of another toggle. Don't count these modifier toggles
+ (if (and (not (= i 12)) ; Skip Account Full Name toggle - modifies Account Name column
+ (not (= i 16)) ; Skip Other Account Full Name toggle - modifies Other Account Name column
+ (not (= i 17)) ; Skip Sort Account Code - modifies Account Name subheading
+ (not (= i 18)) ; Skip Sort Account Full Name - modifies Account Name subheading
+ (not (= i 19)) ; Skip Note toggle - modifies Memo column
+ (vector-ref columns-used i))
(set! col-req (+ col-req 1)))
- (if (or (and (= i 14) (vector-ref columns-used 14) (vector-ref columns-used 4))
- (and (= i 15) (vector-ref columns-used 15) (vector-ref columns-used 5))
- (and (= i 18) (vector-ref columns-used 18) (vector-ref columns-used 17)))
+ ; Account Code and Account Name share one column so if both were ticked the
+ ; the check above would have set up one column too much. The check below
+ ; will compensate these again.
+ (if (or (and (= i 14) (vector-ref columns-used 14) (vector-ref columns-used 4)) ; Account Code and Name
+ (and (= i 15) (vector-ref columns-used 15) (vector-ref columns-used 5))) ; Other Account Code and Name
(set! col-req (- col-req 1)))))
(define (build-column-used options)
commit 65e8e3b11d9f381899f4477eb1beffef1b6ad147
Author: Amish <ammdispose-squid at yahoo.com>
Date: Fri Apr 25 12:36:54 2014 +0530
calculate num-columns-required correctly
This fix, calculates num-columns-required correctly based on which columns are used/not-used/merged. Earlier code did not consider merged columns.
Effectively with this fix, when you print report, on average it saves 2-3 pages per 12-15 pages.
diff --git a/src/report/standard-reports/transaction.scm b/src/report/standard-reports/transaction.scm
index 210722b..74e69d6 100644
--- a/src/report/standard-reports/transaction.scm
+++ b/src/report/standard-reports/transaction.scm
@@ -355,7 +355,12 @@
(do ((i 0 (+ i 1))
(col-req 0 col-req))
((>= i columns-used-size) col-req)
- (if (vector-ref columns-used i) (set! col-req (+ col-req 1)))))
+ (if (and (not (= i 12)) (not (= i 16)) (not (= i 18)) (not (= i 19)) (vector-ref columns-used i))
+ (set! col-req (+ col-req 1)))
+ (if (or (and (= i 14) (vector-ref columns-used 14) (vector-ref columns-used 4))
+ (and (= i 15) (vector-ref columns-used 15) (vector-ref columns-used 5))
+ (and (= i 18) (vector-ref columns-used 18) (vector-ref columns-used 17)))
+ (set! col-req (- col-req 1)))))
(define (build-column-used options)
(define (opt-val section name)
Summary of changes:
src/report/standard-reports/transaction.scm | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
More information about the gnucash-changes
mailing list