gnucash maint: Multiple changes pushed
Christopher Lam
clam at code.gnucash.org
Fri Sep 20 02:58:43 EDT 2019
Updated via https://github.com/Gnucash/gnucash/commit/7a662272 (commit)
via https://github.com/Gnucash/gnucash/commit/2da59445 (commit)
via https://github.com/Gnucash/gnucash/commit/3208879e (commit)
via https://github.com/Gnucash/gnucash/commit/49372e76 (commit)
from https://github.com/Gnucash/gnucash/commit/0ab0d23b (commit)
commit 7a662272b31555d010df32f2d4553fec07f3fa5f
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Fri Sep 20 10:39:33 2019 +0800
[invoice] render tax/tax number into 'our-details' section
diff --git a/gnucash/report/business-reports/invoice.scm b/gnucash/report/business-reports/invoice.scm
index 3bfe1a21b..af4e29fb4 100644
--- a/gnucash/report/business-reports/invoice.scm
+++ b/gnucash/report/business-reports/invoice.scm
@@ -729,6 +729,7 @@ for styling the invoice. Please see the exported report for the CSS class names.
(fax (gnc:company-info book gnc:*company-fax*))
(email (gnc:company-info book gnc:*company-email*))
(url (gnc:company-info book gnc:*company-url*))
+ (taxnr (gnc:option-get-value book gnc:*tax-label* gnc:*tax-nr-label*))
(taxid (gnc:company-info book gnc:*company-id*)))
(if (and name (not (string-null? name)))
@@ -766,6 +767,11 @@ for styling the invoice. Please see the exported report for the CSS class names.
(gnc:make-html-div/markup
"maybe-align-right company-tax-id" taxid))))
+ (if (and taxnr (not (string-null? taxnr)))
+ (gnc:html-table-append-row!
+ table (list (gnc:make-html-div/markup
+ "maybe-align-right company-tax-nr" taxnr))))
+
table))
(define (reg-renderer report-obj)
commit 2da5944596f5fdee08293839eada5c2e3e1eda30
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Fri Sep 20 10:17:08 2019 +0800
[taxtxf-de_DE] fix invalid code
(unless book ...) is equivalent to (if (not book) ...) therefore this
snippet was incorrect.
previous commit ensures book always returns a non-#f object therefore
there's no need to handle #f anymore.
diff --git a/gnucash/report/locale-specific/us/taxtxf-de_DE.scm b/gnucash/report/locale-specific/us/taxtxf-de_DE.scm
index 6557dd0f1..651785b4f 100644
--- a/gnucash/report/locale-specific/us/taxtxf-de_DE.scm
+++ b/gnucash/report/locale-specific/us/taxtxf-de_DE.scm
@@ -768,12 +768,7 @@
(to-year (gnc-print-time64 to-value "%Y"))
(today-date (gnc-print-time64 (time64CanonicalDayTime (current-time))
"%d.%m.%Y"))
- (tax-nr (unless book
- (or
- (gnc:option-get-value book gnc:*tax-label* gnc:*tax-nr-label*)
- "")
- ""))
- )
+ (tax-nr (gnc:option-get-value book gnc:*tax-label* gnc:*tax-nr-label*)))
;; Now, the main body
;; Reset all the balance collectors
commit 3208879e64ea0d692d626cbc9052e6ea590f3ad3
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Fri Sep 20 10:16:17 2019 +0800
[app-utils] upgrade Tax/Tax Number option to all locales
Previously de_DE locale will add a *global* 'Tax/Tax Number'
option. This is immediately translated.
This change will upgrade it to be present in all locales, and can be
queried by any report.
diff --git a/libgnucash/app-utils/app-utils.scm b/libgnucash/app-utils/app-utils.scm
index ca789412e..fd3f8ef4c 100644
--- a/libgnucash/app-utils/app-utils.scm
+++ b/libgnucash/app-utils/app-utils.scm
@@ -300,6 +300,8 @@
(define gnc:*company-contact* (N_ "Company Contact Person"))
(define gnc:*fancy-date-label* (N_ "Fancy Date Format"))
(define gnc:*fancy-date-format* (N_ "custom"))
+(define gnc:*tax-label* (N_ "Tax"))
+(define gnc:*tax-nr-label* (N_ "Tax Number"))
(define (gnc:company-info book key)
;; Access company info from key-value pairs for current book
@@ -328,6 +330,7 @@
gnc:*option-name-currency-accounting* gnc:*option-name-book-currency*
gnc:*option-name-default-gains-policy*
gnc:*option-name-default-gain-loss-account*
+ gnc:*tax-label* gnc:*tax-nr-label*
gnc:*option-name-auto-readonly-days* gnc:*option-name-num-field-source*)
(define gnc:*option-section-budgeting* OPTION-SECTION-BUDGETING)
diff --git a/libgnucash/app-utils/business-prefs.scm b/libgnucash/app-utils/business-prefs.scm
index 60f7bf623..5ec94dbe1 100644
--- a/libgnucash/app-utils/business-prefs.scm
+++ b/libgnucash/app-utils/business-prefs.scm
@@ -157,6 +157,12 @@
gnc:*option-section-budgeting* gnc:*option-name-default-budget*
"a" (N_ "Budget to be used when none has been otherwise specified.")))
+ ;; Tax Tab
+ (reg-option
+ (gnc:make-string-option
+ gnc:*tax-label* gnc:*tax-nr-label*
+ "a" (N_ "The electronic tax number of your business") ""))
+
;; Counters Tab
(for-each
(lambda (vals)
diff --git a/libgnucash/tax/us/de_DE.scm b/libgnucash/tax/us/de_DE.scm
index 54bb9f74a..6388943f2 100644
--- a/libgnucash/tax/us/de_DE.scm
+++ b/libgnucash/tax/us/de_DE.scm
@@ -49,10 +49,5 @@
(export txf-asset-categories)
(export txf-liab-eq-categories)
-(define gnc:*tax-label* (N_ "Tax"))
-(define gnc:*tax-nr-label* (N_ "Tax Number"))
-
-(export gnc:*tax-label* gnc:*tax-nr-label*)
-
(load-from-path "txf-de_DE")
(load-from-path "txf-help-de_DE")
diff --git a/libgnucash/tax/us/txf-de_DE.scm b/libgnucash/tax/us/txf-de_DE.scm
index c93cdc3f6..92b3d89b7 100644
--- a/libgnucash/tax/us/txf-de_DE.scm
+++ b/libgnucash/tax/us/txf-de_DE.scm
@@ -312,16 +312,3 @@ Fehlermeldungen + Dankschreiben an: stoll at bomhardt.de"))
)
)
))
-
-;;; Register global options in this book
-(define (book-options-generator options)
- (define (reg-option new-option)
- (gnc:register-option options new-option))
-
- (reg-option
- (gnc:make-string-option
- gnc:*tax-label* gnc:*tax-nr-label*
- "a" (N_ "The electronic tax number of your business") ""))
- )
-
-(gnc-register-kvp-option-generator QOF-ID-BOOK-SCM book-options-generator)
commit 49372e76be61ac4eae479fee645b183a834ad43e
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Fri Sep 20 09:04:34 2019 +0800
Ensure book returns current-book
fixes https://lists.gnucash.org/pipermail/gnucash-user/2019-September/086967.html
because occasionally account will be null or #f, causing error when
passed to gnc-account-get-book.
diff --git a/gnucash/report/business-reports/owner-report.scm b/gnucash/report/business-reports/owner-report.scm
index d71664229..6c956d5df 100644
--- a/gnucash/report/business-reports/owner-report.scm
+++ b/gnucash/report/business-reports/owner-report.scm
@@ -748,8 +748,8 @@
(end-date (gnc:time64-end-day-time
(gnc:date-option-absolute-time
(opt-val gnc:pagename-general optname-to-date))))
- (book (gnc-account-get-book account))
- (date-format (if (not (null? book)) (gnc:options-fancy-date book)))
+ (book (gnc-get-current-book))
+ (date-format (gnc:options-fancy-date book))
(type (opt-val "__reg" "owner-type"))
(owner-descr (owner-string type))
(date-type (opt-val gnc:pagename-general optname-date-driver))
diff --git a/gnucash/report/locale-specific/us/taxtxf-de_DE.scm b/gnucash/report/locale-specific/us/taxtxf-de_DE.scm
index f0a0ab85c..6557dd0f1 100644
--- a/gnucash/report/locale-specific/us/taxtxf-de_DE.scm
+++ b/gnucash/report/locale-specific/us/taxtxf-de_DE.scm
@@ -505,11 +505,7 @@
(validate (reverse
(gnc-account-get-children-sorted
(gnc-get-current-root-account))))))
- (book (if selected-accounts
- (gnc-account-get-book (if (pair? selected-accounts)
- (car selected-accounts)
- selected-accounts))
- #f))
+ (book (gnc-get-current-book))
(generations (if (pair? selected-accounts)
(apply max (map (lambda (x) (num-generations x 1))
selected-accounts))
Summary of changes:
gnucash/report/business-reports/invoice.scm | 6 ++++++
gnucash/report/business-reports/owner-report.scm | 4 ++--
gnucash/report/locale-specific/us/taxtxf-de_DE.scm | 13 ++-----------
libgnucash/app-utils/app-utils.scm | 3 +++
libgnucash/app-utils/business-prefs.scm | 6 ++++++
libgnucash/tax/us/de_DE.scm | 5 -----
libgnucash/tax/us/txf-de_DE.scm | 13 -------------
7 files changed, 19 insertions(+), 31 deletions(-)
More information about the gnucash-changes
mailing list