Skip to content

Commit

Permalink
[modularise] (gnucash reports)
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherlam committed Dec 9, 2020
1 parent ffbd090 commit 7256e0d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
1 change: 1 addition & 0 deletions gnucash/report/reports/aging.scm
Expand Up @@ -31,6 +31,7 @@
(use-modules (gnucash core-utils))
(use-modules (gnucash app-utils))
(use-modules (gnucash report))
(use-modules (gnucash gnome-utils))
(use-modules (srfi srfi-9))

(define optname-to-date (N_ "To"))
Expand Down
22 changes: 7 additions & 15 deletions gnucash/report/reports/reports.scm
Expand Up @@ -33,6 +33,9 @@
(use-modules (gnucash engine))
(use-modules (gnucash report))
(use-modules (gnucash utilities))
(use-modules (gnucash reports standard register))
(use-modules (gnucash reports standard new-aging))
(use-modules (gnucash reports standard new-owner-report))

(export gnc:register-report-create)
(export gnc:invoice-report-create)
Expand All @@ -41,20 +44,12 @@
(export gnc:owner-report-create)
(export gnc:owner-report-create-with-enddate)

(define report-dirs (list
(let ((loc-spec (if (string-prefix? "de_DE" (gnc-locale-name)) 'de_DE 'us)))
(report-module-loader
(list
'(gnucash reports standard) ; prefix for standard reports included in gnucash
'(gnucash reports example) ; rexample for example reports included in gnucash
))

; Determine which locale-specific prefix to add to the list above
; and then load all reports found in the given prefixes
(let* ((loc (gnc-locale-name))
(loc-spec (if (string-prefix? "de_DE" loc) 'de_DE 'us))
(all-dirs (append report-dirs
`((gnucash reports locale-specific ,loc-spec)))))
(report-module-loader all-dirs))

(use-modules (gnucash engine))
`(gnucash reports locale-specific ,loc-spec))))

(define (gnc:register-report-create account split query journal? ledger-type?
double? title debit-string credit-string)
Expand Down Expand Up @@ -83,10 +78,7 @@
0
))

(use-modules (gnucash reports standard new-aging))
(define gnc:payables-report-create payables-report-create-internal)
(define gnc:receivables-report-create receivables-report-create-internal)

(use-modules (gnucash reports standard new-owner-report))
(define gnc:owner-report-create owner-report-create)
(define gnc:owner-report-create-with-enddate owner-report-create-with-enddate)
2 changes: 1 addition & 1 deletion gnucash/report/reports/standard/test/CMakeLists.txt
Expand Up @@ -34,7 +34,7 @@ set(GUILE_DEPENDS
scm-core-utils
scm-test-report
scm-reports
scm-reports-standard-with-exposed-generator-links
scm-reports-standard-with-exposed-generator
scm-report-stylesheets
)

Expand Down

0 comments on commit 7256e0d

Please sign in to comment.