gnucash maint: Multiple changes pushed

Christopher Lam clam at code.gnucash.org
Fri Aug 7 23:42:57 EDT 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/883705fd (commit)
	 via  https://github.com/Gnucash/gnucash/commit/0a64081b (commit)
	from  https://github.com/Gnucash/gnucash/commit/f9286ac8 (commit)



commit 883705fdf87565a1139106cc04fba120720aa426
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sat Aug 8 11:40:42 2020 +0800

    [report-core] handle export properly
    
    export code was tested using a custom saved-report, needing to call
    the parent template export code. this could not work when a parent
    template export code was called. enable path to call parent or custom
    export-code.

diff --git a/gnucash/report/report-core.scm b/gnucash/report/report-core.scm
index 1bc800fbc..54ba4a2c2 100644
--- a/gnucash/report/report-core.scm
+++ b/gnucash/report/report-core.scm
@@ -732,7 +732,9 @@ not found.")))
 (define (template-export report template export-type output-file dry-run?)
   (let* ((report-guid (gnc:report-template-report-guid template))
          (parent-template-guid (gnc:report-template-parent-type template))
-         (parent-template (hash-ref *gnc:_report-templates_* parent-template-guid))
+         (parent-template (if parent-template-guid
+                              (hash-ref *gnc:_report-templates_* parent-template-guid)
+                              template))
          (parent-export-thunk (gnc:report-template-export-thunk parent-template))
          (parent-export-types (gnc:report-template-export-types parent-template)))
 

commit 0a64081b98730821db5f4593f3ee9af824f0ae46
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sat Aug 8 11:39:55 2020 +0800

    [taxtxf.scm] compact, allow error to console
    
    taxtxf error handling is designed for gui. add code to call
    gnc:gui-error which can also dump error to console if gui is not available.

diff --git a/gnucash/report/reports/locale-specific/us/taxtxf.scm b/gnucash/report/reports/locale-specific/us/taxtxf.scm
index cce8e174d..3a8181157 100644
--- a/gnucash/report/reports/locale-specific/us/taxtxf.scm
+++ b/gnucash/report/reports/locale-specific/us/taxtxf.scm
@@ -2902,21 +2902,12 @@
           (if tax-entity-type-valid?
               (if file-name		; cancel TXF if no file selected
                   (let ((port (catch #t ;;e.g., system-error
-                                 (lambda () (open-output-file file-name))
-                                 (lambda (key . args)
-                                    (gnc-error-dialog
-                                          '()
-                                          (string-append
-                                              "Could not open the file: "
-                                              file-name
-                                              ". The error is: "
-                                              (symbol->string key)
-                                              " - "
-                                              (car (caddr args))
-                                              "."
-                                          ))
-                                     #f)))
-                       )
+                                (lambda () (open-output-file file-name))
+                                (lambda (key . args)
+                                  (let ((msg (format #f "Could not open the file: ~a. The error is: ~a - ~a"
+                                                     file-name key (caaddr args))))
+                                    (gnc:gui-error msg msg)
+                                    #f)))))
                        (if port ;; port opened successfully
                            (let* ((output (map (lambda (form-line-acct)
                                                (handle-tax-code form-line-acct))



Summary of changes:
 gnucash/report/report-core.scm                      |  4 +++-
 .../report/reports/locale-specific/us/taxtxf.scm    | 21 ++++++---------------
 2 files changed, 9 insertions(+), 16 deletions(-)



More information about the gnucash-changes mailing list