gnucash maint: Multiple changes pushed
Christopher Lam
clam at code.gnucash.org
Fri Mar 13 05:23:17 EDT 2020
Updated via https://github.com/Gnucash/gnucash/commit/74e66acd (commit)
via https://github.com/Gnucash/gnucash/commit/9e06345f (commit)
from https://github.com/Gnucash/gnucash/commit/8fccde36 (commit)
commit 74e66acd50e7594921e294b65fb0a9c277410d3f
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Wed Mar 11 21:58:46 2020 +0800
[job-report] remove dead code
diff --git a/gnucash/report/business-reports/job-report.scm b/gnucash/report/business-reports/job-report.scm
index c8fc66cfd..bed3443a4 100644
--- a/gnucash/report/business-reports/job-report.scm
+++ b/gnucash/report/business-reports/job-report.scm
@@ -399,23 +399,11 @@
(gnc:options-set-default-section gnc:*report-options* "General")
gnc:*report-options*)
-
+
(define (job-options-generator)
(options-generator (list ACCT-TYPE-RECEIVABLE) GNC-OWNER-JOB
(_ "Invoice") #f))
-(define (customer-options-generator)
- (options-generator (list ACCT-TYPE-RECEIVABLE) GNC-OWNER-CUSTOMER
- (_ "Invoice") #f))
-
-(define (vendor-options-generator)
- (options-generator (list ACCT-TYPE-PAYABLE) GNC-OWNER-VENDOR
- (_ "Bill") #t))
-
-(define (employee-options-generator)
- (options-generator (list ACCT-TYPE-PAYABLE) GNC-OWNER-EMPLOYEE
- (_ "Expense Report") #t))
-
(define (setup-query q owner account end-date)
(let* ((guid (gncOwnerReturnGUID owner)))
@@ -460,24 +448,6 @@
'attribute (list "valign" "top"))
table))
-(define (make-date-row! table label date)
- (gnc:html-table-append-row!
- table
- (list
- (string-append label " ")
- (qof-print-date date))))
-
-(define (make-date-table)
- (let ((table (gnc:make-html-table)))
- (gnc:html-table-set-style!
- table "table"
- 'attribute (list "border" 0)
- 'attribute (list "cellpadding" 0))
- (gnc:html-table-set-last-row-style!
- table "td"
- 'attribute (list "valign" "top"))
- table))
-
(define (make-myname-table book date-format)
(let* ((table (gnc:make-html-table))
(name (gnc:company-info book gnc:*company-name*))
@@ -619,40 +589,6 @@
(qof-query-destroy query)
document))
-(define (find-first-account type)
- (define (find-first account num index)
- (if (>= index num)
- '()
- (let* ((this-child (gnc-account-nth-child account index))
- (account-type (xaccAccountGetType this-child)))
- (if (eq? account-type type)
- this-child
- (find-first account num (+ index 1))))))
-
- (let* ((current-root (gnc-get-current-root-account))
- (num-accounts (gnc-account-n-children current-root)))
- (if (> num-accounts 0)
- (find-first current-root num-accounts 0)
- '())))
-
-(define (find-first-account-for-owner owner)
- (let ((type (gncOwnerGetType (gncOwnerGetEndOwner owner))))
- (cond
- ((eqv? type GNC-OWNER-CUSTOMER)
- (find-first-account ACCT-TYPE-RECEIVABLE))
-
- ((eqv? type GNC-OWNER-VENDOR)
- (find-first-account ACCT-TYPE-PAYABLE))
-
- ((eqv? type GNC-OWNER-EMPLOYEE)
- (find-first-account ACCT-TYPE-PAYABLE))
-
- ((eqv? type GNC-OWNER-JOB)
- (find-first-account-for-owner (gncOwnerGetEndOwner owner)))
-
- (else
- '()))))
-
(gnc:define-report
'version 1
'name (N_ "Job Report")
commit 9e06345f2e66199eaf540edfb9617a1708fe409a
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Sun Mar 1 23:16:48 2020 +0800
[trep-engine] subtotals when cells have monetary only
Instead of accumulating subtotals from any non-#f value, ensure value
is a gnc-monetary before accumulating subtotals.
This paves the way to allow non-monetary in RHS custom-calculated-cells.
diff --git a/gnucash/report/report-system/trep-engine.scm b/gnucash/report/report-system/trep-engine.scm
index 8e12fca7c..4bd243390 100644
--- a/gnucash/report/report-system/trep-engine.scm
+++ b/gnucash/report/report-system/trep-engine.scm
@@ -1738,7 +1738,7 @@ be excluded from periodic reporting.")
(for-each
(lambda (prime-collector sec-collector tot-collector value)
- (when value
+ (when (gnc:gnc-monetary? value)
(let ((comm (gnc:gnc-monetary-commodity value))
(val (gnc:gnc-monetary-amount value)))
(prime-collector 'add comm val)
Summary of changes:
gnucash/report/business-reports/job-report.scm | 66 +-------------------------
gnucash/report/report-system/trep-engine.scm | 2 +-
2 files changed, 2 insertions(+), 66 deletions(-)
More information about the gnucash-changes
mailing list