Skip to content

Commit

Permalink
[reports] use new module names
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherlam committed May 3, 2020
1 parent 5fb8d3d commit 6405c60
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions gnucash/report/reports/reports.scm
Expand Up @@ -80,14 +80,9 @@
0
))

(use-modules (gnucash reports standard payables))
(define (gnc:payables-report-create account title show-zeros?)
(payables-report-create-internal account title show-zeros?))
(use-modules (gnucash reports standard new-aging))

This comment has been minimized.

Copy link
@christopherlam

christopherlam Jun 9, 2020

Author Contributor

@jralls tagging this one (away from console right now)

This comment has been minimized.

Copy link
@jralls

jralls Jun 9, 2020

Member

@christopherlam yes, new-aging is one of the exposed-generator reports for which report.scm exports a create function. It's hard to imagine that the create function can be defined independently of the report's guts, so reports.scm needs to use-modules them.

There may well be a better way to do this, but let's put off worrying about it until after we release 4.0.

This comment has been minimized.

Copy link
@christopherlam

christopherlam Jun 9, 2020

Author Contributor

Ok. The following is still a viable patch; it makes gnc:payables-report-create and friends become dummy functions in report.scm, and later new-aging.scm will redefine them to call internal functions.

This is exactly the strategy I've adopted for gnc:gui-error -- https://github.com/Gnucash/gnucash/blob/master/bindings/guile/utilities.scm#L70 defines them to be a simple logger, and https://github.com/Gnucash/gnucash/blob/master/gnucash/gnome-utils/gnome-utils.scm#L47 redefines them to be more capable - logger & show dialog. There may be better approaches, but I don't think this is a particularly bad hack.

modified   gnucash/report/reports/reports.scm
@@ -80,9 +80,6 @@
         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:payables-report-create . args) #f)
+(define (gnc:receivables-report-create . args) #f)
+(define (gnc:owner-report-create . args) #f)
modified   gnucash/report/reports/standard/new-aging.scm
@@ -474,5 +474,5 @@ exist but have no suitable transactions."))
 (gnc:register-report-hook ACCT-TYPE-RECEIVABLE #f gnc:receivables-create-internal)
 (gnc:register-report-hook ACCT-TYPE-PAYABLE #f gnc:payables-create-internal)
 
-(export payables-report-create-internal)
-(export receivables-report-create-internal)
+(set! gnc:payables-report-create payables-report-create-internal)
+(set! gnc:receivables-report-create receivables-report-create-internal)
modified   gnucash/report/reports/standard/new-owner-report.scm
@@ -1228,4 +1228,5 @@ invoices and amounts.")))))
 
 (gnc:register-report-hook ACCT-TYPE-RECEIVABLE #t gnc:owner-report-create-internal)
 (gnc:register-report-hook ACCT-TYPE-PAYABLE #t gnc:owner-report-create-internal)
-(export owner-report-create)
+
+(set! gnc:owner-report-create owner-report-create)
(define gnc:payables-report-create payables-report-create-internal)
(define gnc:receivables-report-create receivables-report-create-internal)

(use-modules (gnucash reports standard receivables))
(define (gnc:receivables-report-create account title show-zeros?)
(receivables-report-create-internal account title show-zeros?))

(use-modules (gnucash reports standard owner-report))
(define* (gnc:owner-report-create owner account #:key currency)
(owner-report-create owner account #:currency currency))
(use-modules (gnucash reports standard new-owner-report))
(define gnc:owner-report-create owner-report-create)

0 comments on commit 6405c60

Please sign in to comment.