gnucash maint: Multiple changes pushed
Christopher Lam
clam at code.gnucash.org
Sat Oct 26 11:05:11 EDT 2019
Updated via https://github.com/Gnucash/gnucash/commit/77855a7e (commit)
via https://github.com/Gnucash/gnucash/commit/0aad7778 (commit)
from https://github.com/Gnucash/gnucash/commit/2dd2f0dc (commit)
commit 77855a7ed641cd4fb94e0803c09e5eada546a99c
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Sat Oct 26 23:04:06 2019 +0800
[report-utilities] add owner printers
diff --git a/gnucash/report/report-system/report-utilities.scm b/gnucash/report/report-system/report-utilities.scm
index c7f506f27..6daee5c9e 100644
--- a/gnucash/report/report-system/report-utilities.scm
+++ b/gnucash/report/report-system/report-utilities.scm
@@ -1137,6 +1137,17 @@ flawed. see report-utilities.scm. please update reports.")
(define (monetary->string mon)
(format #f "[~a]"
(gnc:monetary->string mon)))
+ (define (owner->str owner)
+ (define (fn s . rest) (format #f "[~a:~a]" s ((apply compose rest) owner)))
+ (let ((t (gncOwnerGetType owner)))
+ (cond
+ ((eqv? t GNC-OWNER-NONE) "[None]")
+ ((eqv? t GNC-OWNER-UNDEFINED) "[Undefined]")
+ ((eqv? t GNC-OWNER-JOB) (fn "Job" owner->str gncOwnerGetEndOwner))
+ ((eqv? t GNC-OWNER-CUSTOMER) (fn "Cust" gncCustomerGetName gncOwnerGetCustomer))
+ ((eqv? t GNC-OWNER-VENDOR) (fn "Vend" gncVendorGetName gncOwnerGetVendor))
+ ((eqv? t GNC-OWNER-EMPLOYEE) (fn "Emp" gncEmployeeGetName gncOwnerGetEmployee))
+ (else (format #f "[unknown:~a]" owner)))))
(define (try proc)
;; Try proc with d as a parameter, catching exceptions to return
;; #f to the (or) evaluator below.
@@ -1165,6 +1176,7 @@ flawed. see report-utilities.scm. please update reports.")
(try trans->str)
(try monetary->string)
(try gnc-budget-get-name)
+ (try owner->str)
(object->string d)))
(define (pair->num pair)
commit 0aad77787044d010e5bdefec3d5e2663aadc8179
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Fri Oct 25 23:27:57 2019 +0800
[stylesheets] homogenize easy/fancy/footer
* with these reordering of functions, easy == fancy
* also footer = easy|fancy + footer
diff --git a/gnucash/report/stylesheets/stylesheet-easy.scm b/gnucash/report/stylesheets/stylesheet-easy.scm
index d4f89476d..5731310a1 100644
--- a/gnucash/report/stylesheets/stylesheet-easy.scm
+++ b/gnucash/report/stylesheets/stylesheet-easy.scm
@@ -211,7 +211,6 @@
(border (opt-val "Tables" "Table border width"))
(headcolumn 0))
-
(gnc:html-document-set-style!
ssdoc "body"
'attribute (list "bgcolor" bgcolor)
@@ -323,6 +322,8 @@
(gnc:html-document-set-style!
ssdoc "a" 'tag ""))
+ (add-css-information-to-doc options ssdoc doc)
+
(let ((t (gnc:make-html-table)))
;; we don't want a bevel for this table, but we don't want
;; that to propagate
@@ -338,11 +339,8 @@
(if (and logopixmap (> (string-length logopixmap) 0))
(set! headcolumn 1))
- (add-css-information-to-doc options ssdoc doc)
-
- (let* ((title (gnc:html-document-title doc))
- (doc-headline (gnc:html-document-headline doc))
- (headline (if (eq? doc-headline #f) title doc-headline)))
+ (let* ((headline (or (gnc:html-document-headline doc)
+ (gnc:html-document-title doc))))
(gnc:html-table-set-cell!
t 1 headcolumn
@@ -368,11 +366,10 @@
;; only setup an image if we specified one
(if (and logopixmap (> (string-length logopixmap) 0))
- (begin
- (gnc:html-table-set-cell!
- t 0 0
- (gnc:make-html-text
- (gnc:html-markup-img (make-file-url logopixmap))))))
+ (gnc:html-table-set-cell!
+ t 0 0
+ (gnc:make-html-text
+ (gnc:html-markup-img (make-file-url logopixmap)))))
(if (and headpixmap (> (string-length headpixmap) 0))
(let* ((div (gnc:html-markup-img (make-file-url headpixmap)))
diff --git a/gnucash/report/stylesheets/stylesheet-fancy.scm b/gnucash/report/stylesheets/stylesheet-fancy.scm
index 13da065c8..8d2f72ead 100644
--- a/gnucash/report/stylesheets/stylesheet-fancy.scm
+++ b/gnucash/report/stylesheets/stylesheet-fancy.scm
@@ -210,7 +210,6 @@
'attribute (list "bgcolor" bgcolor)
'attribute (list "text" textcolor)
'attribute (list "link" linkcolor))
-
;;;;
;;;;
;;;;
@@ -328,15 +327,14 @@
'attribute (list "style" "margin-left:auto; margin-right:auto")
'inheritable? #f)
- (let* ((title (gnc:html-document-title doc))
- (doc-headline (gnc:html-document-headline doc))
- (headline (if (eq? doc-headline #f) title doc-headline)))
+ ;; set the header column to be the 2nd when we have a logo
+ ;; do this so that when logo is not present, the document
+ ;; is perfectly centered
+ (if (and logopixmap (> (string-length logopixmap) 0))
+ (set! headcolumn 1))
- ;; set the header column to be the 2nd when we have a logo
- ;; do this so that when logo is not present, the document
- ;; is perfectly centered
- (if (and logopixmap (> (string-length logopixmap) 0))
- (set! headcolumn 1))
+ (let* ((headline (or (gnc:html-document-headline doc)
+ (gnc:html-document-title doc))))
(gnc:html-table-set-cell!
t 1 headcolumn
@@ -360,13 +358,12 @@
(gnc:html-markup-h3 headline))))
)
- (if (and logopixmap
- (not (string=? logopixmap "")))
- ;; check for logo image file name non blank
+ ;; only setup an image if we specified one
+ (if (and logopixmap (> (string-length logopixmap) 0))
(gnc:html-table-set-cell!
t 0 0
(gnc:make-html-text
- (gnc:html-markup-img (make-file-url logopixmap)))) )
+ (gnc:html-markup-img (make-file-url logopixmap)))))
(if (and headpixmap (> (string-length headpixmap) 0))
(let* ((div (gnc:html-markup-img (make-file-url headpixmap)))
@@ -379,7 +376,6 @@
gnc:html-table-set-cell!
t 2 headcolumn
(gnc:html-document-objects doc))
-
(gnc:html-document-add-object! ssdoc t))
ssdoc))
diff --git a/gnucash/report/stylesheets/stylesheet-footer.scm b/gnucash/report/stylesheets/stylesheet-footer.scm
index 86649b4b9..abe4eaee8 100644
--- a/gnucash/report/stylesheets/stylesheet-footer.scm
+++ b/gnucash/report/stylesheets/stylesheet-footer.scm
@@ -219,7 +219,7 @@
(bgpixmap (opt-val "Images" "Background Tile"))
(headpixmap (opt-val "Images" "Heading Banner"))
(logopixmap (opt-val "Images" "Logo"))
- (align (gnc:value->string(opt-val "Images" "Heading Alignment")))
+ (align (gnc:value->string (opt-val "Images" "Heading Alignment")))
(spacing (opt-val "Tables" "Table cell spacing"))
(padding (opt-val "Tables" "Table cell padding"))
(border (opt-val "Tables" "Table border width"))
@@ -333,7 +333,8 @@
;; don't surround marked-up links with <a> </a>
(if (not links?)
- (gnc:html-document-set-style! ssdoc "a" 'tag ""))
+ (gnc:html-document-set-style!
+ ssdoc "a" 'tag ""))
(add-css-information-to-doc options ssdoc doc)
@@ -352,9 +353,8 @@
(if (and logopixmap (> (string-length logopixmap) 0))
(set! headcolumn 1))
- (let* ((title (gnc:html-document-title doc))
- (doc-headline (gnc:html-document-headline doc))
- (headline (if (eq? doc-headline #f) title doc-headline)))
+ (let* ((headline (or (gnc:html-document-headline doc)
+ (gnc:html-document-title doc))))
(gnc:html-table-set-cell!
t 1 headcolumn
@@ -380,11 +380,10 @@
;; only setup an image if we specified one
(if (and logopixmap (> (string-length logopixmap) 0))
- (begin
- (gnc:html-table-set-cell!
- t 0 0
- (gnc:make-html-text
- (gnc:html-markup-img (make-file-url logopixmap))))))
+ (gnc:html-table-set-cell!
+ t 0 0
+ (gnc:make-html-text
+ (gnc:html-markup-img (make-file-url logopixmap)))))
(if (and headpixmap (> (string-length headpixmap) 0))
(let* ((div (gnc:html-markup-img (make-file-url headpixmap)))
diff --git a/gnucash/report/stylesheets/stylesheet-head-or-tail.scm b/gnucash/report/stylesheets/stylesheet-head-or-tail.scm
index f3cfe664c..ee439d045 100644
--- a/gnucash/report/stylesheets/stylesheet-head-or-tail.scm
+++ b/gnucash/report/stylesheets/stylesheet-head-or-tail.scm
@@ -285,7 +285,7 @@
(bgpixmap (opt-val "Images" "Background Tile"))
(headpixmap (opt-val "Images" "Heading Banner"))
(logopixmap (opt-val "Images" "Logo"))
- (align (gnc:value->string(opt-val "Images" "Heading Alignment")))
+ (align (gnc:value->string (opt-val "Images" "Heading Alignment")))
(spacing (opt-val "Tables" "Table cell spacing"))
(padding (opt-val "Tables" "Table cell padding"))
(border (opt-val "Tables" "Table border width"))
@@ -418,9 +418,8 @@
(if (and logopixmap (> (string-length logopixmap) 0))
(set! headcolumn 1))
- (let* ((title (gnc:html-document-title doc))
- (doc-headline (gnc:html-document-headline doc))
- (headline (if (eq? doc-headline #f) title doc-headline)))
+ (let* ((headline (or (gnc:html-document-headline doc)
+ (gnc:html-document-title doc))))
(gnc:html-table-set-cell!
t 1 headcolumn
Summary of changes:
gnucash/report/report-system/report-utilities.scm | 12 +++++++++++
gnucash/report/stylesheets/stylesheet-easy.scm | 19 ++++++++---------
gnucash/report/stylesheets/stylesheet-fancy.scm | 24 +++++++++-------------
gnucash/report/stylesheets/stylesheet-footer.scm | 19 ++++++++---------
.../report/stylesheets/stylesheet-head-or-tail.scm | 7 +++----
5 files changed, 42 insertions(+), 39 deletions(-)
More information about the gnucash-changes
mailing list