mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Break circular dependency between owner-report.scm and reports.scm
That is: * move the account lookup from report.scm to owner-report.scm so there's no need any more to call into reports.scm from within owner-report.scm * fix the cmake dependency tree to reflect the new changes: only customer-overview depends directly on code in reports.scm All other reports don't. reports.scm however does depend on three standard reports. So: standard-reports <- reports <- customer-overview
This commit is contained in:
parent
1fc831002d
commit
d7e66f9649
@ -6,10 +6,6 @@ set (reports_common_SCHEME
|
|||||||
aging.scm
|
aging.scm
|
||||||
)
|
)
|
||||||
|
|
||||||
set (reports_SCHEME
|
|
||||||
reports.scm
|
|
||||||
)
|
|
||||||
|
|
||||||
set (reports_standard_SCHEME
|
set (reports_standard_SCHEME
|
||||||
standard/account-piecharts.scm
|
standard/account-piecharts.scm
|
||||||
standard/account-summary.scm
|
standard/account-summary.scm
|
||||||
@ -40,7 +36,6 @@ set (reports_standard_SCHEME
|
|||||||
standard/transaction.scm
|
standard/transaction.scm
|
||||||
standard/trial-balance.scm
|
standard/trial-balance.scm
|
||||||
standard/view-column.scm
|
standard/view-column.scm
|
||||||
standard/customer-summary.scm
|
|
||||||
standard/taxinvoice.scm
|
standard/taxinvoice.scm
|
||||||
standard/receipt.scm
|
standard/receipt.scm
|
||||||
standard/invoice.scm
|
standard/invoice.scm
|
||||||
@ -49,7 +44,11 @@ set (reports_standard_SCHEME
|
|||||||
standard/payables.scm
|
standard/payables.scm
|
||||||
standard/receivables.scm
|
standard/receivables.scm
|
||||||
standard/balsheet-eg.scm
|
standard/balsheet-eg.scm
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set (reports_standard_SCHEME_2
|
||||||
|
standard/customer-summary.scm # Depends on owner-report
|
||||||
|
)
|
||||||
|
|
||||||
set(reports_example_SCHEME
|
set(reports_example_SCHEME
|
||||||
example/average-balance.scm
|
example/average-balance.scm
|
||||||
@ -67,6 +66,10 @@ set(reports_de_DE_SCHEME
|
|||||||
locale-specific/de_DE/taxtxf.scm
|
locale-specific/de_DE/taxtxf.scm
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set (reports_SCHEME
|
||||||
|
reports.scm
|
||||||
|
)
|
||||||
|
|
||||||
set(scm_rpts_GUILE_DEPENDS
|
set(scm_rpts_GUILE_DEPENDS
|
||||||
gncmod-html
|
gncmod-html
|
||||||
scm-core-utils
|
scm-core-utils
|
||||||
@ -109,24 +112,17 @@ set(scm_rpt_std_GUILE_DEPENDS
|
|||||||
scm-reports-standard-links
|
scm-reports-standard-links
|
||||||
)
|
)
|
||||||
|
|
||||||
gnc_add_scheme_targets(scm-rpt-reports
|
|
||||||
"${reports_SCHEME}"
|
|
||||||
"gnucash"
|
|
||||||
"${scm_rpts_GUILE_DEPENDS}"
|
|
||||||
TRUE
|
|
||||||
)
|
|
||||||
|
|
||||||
gnc_add_scheme_targets(scm-reports-common
|
gnc_add_scheme_targets(scm-reports-common
|
||||||
"${reports_common_SCHEME}"
|
"${reports_common_SCHEME}"
|
||||||
"gnucash/reports"
|
"gnucash/reports"
|
||||||
"scm-reports-common-links;scm-rpt-reports;${scm_rpt_std_GUILE_DEPENDS}"
|
"scm-reports-common-links;${scm_rpt_std_GUILE_DEPENDS}"
|
||||||
TRUE
|
TRUE
|
||||||
)
|
)
|
||||||
|
|
||||||
gnc_add_scheme_targets(scm-reports-standard
|
gnc_add_scheme_targets(scm-reports-standard
|
||||||
"${reports_standard_SCHEME}"
|
"${reports_standard_SCHEME}"
|
||||||
"gnucash/reports/standard"
|
"gnucash/reports/standard"
|
||||||
"scm-rpt-reports;${scm_rpt_std_GUILE_DEPENDS}"
|
"scm-reports-common;${scm_rpt_std_GUILE_DEPENDS}"
|
||||||
TRUE
|
TRUE
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -151,8 +147,23 @@ gnc_add_scheme_targets(scm-reports-de_DE
|
|||||||
TRUE
|
TRUE
|
||||||
)
|
)
|
||||||
|
|
||||||
|
gnc_add_scheme_targets(scm-rpt-reports
|
||||||
|
"${reports_SCHEME}"
|
||||||
|
"gnucash"
|
||||||
|
"scm-reports-standard;scm-reports-example;scm-reports-us;scm-reports-de_DE;${scm_rpts_GUILE_DEPENDS};"
|
||||||
|
TRUE
|
||||||
|
)
|
||||||
|
|
||||||
|
gnc_add_scheme_targets(scm-reports-standard-2
|
||||||
|
"${reports_standard_SCHEME_2}"
|
||||||
|
"gnucash/reports/standard"
|
||||||
|
"scm-rpt-reports"
|
||||||
|
TRUE
|
||||||
|
)
|
||||||
|
|
||||||
add_custom_target(scm-reports ALL DEPENDS
|
add_custom_target(scm-reports ALL DEPENDS
|
||||||
scm-reports-standard
|
scm-reports-standard
|
||||||
|
scm-reports-standard-2
|
||||||
scm-reports-example
|
scm-reports-example
|
||||||
scm-reports-common
|
scm-reports-common
|
||||||
scm-rpt-reports
|
scm-rpt-reports
|
||||||
@ -210,7 +221,7 @@ gnc_add_scheme_deprecated_module ("gnucash report standard-reports trial-balance
|
|||||||
gnc_add_scheme_deprecated_module ("gnucash report view-column" "gnucash reports standard view-column" "scm-reports-standard" "")
|
gnc_add_scheme_deprecated_module ("gnucash report view-column" "gnucash reports standard view-column" "scm-reports-standard" "")
|
||||||
|
|
||||||
set_local_dist(reports_DIST_local CMakeLists.txt ${reports_SCHEME}
|
set_local_dist(reports_DIST_local CMakeLists.txt ${reports_SCHEME}
|
||||||
${reports_common_SCHEME} ${reports_standard_SCHEME} ${reports_example_SCHEME}
|
${reports_common_SCHEME} ${reports_standard_SCHEME} ${reports_standard_SCHEME_2}
|
||||||
${reports_us_SCHEME} ${reports_de_DE_SCHEME})
|
${reports_example_SCHEME} ${reports_us_SCHEME} ${reports_de_DE_SCHEME})
|
||||||
set(reports_DIST ${reports_DIST_local} ${reports_support_DIST}
|
set(reports_DIST ${reports_DIST_local} ${reports_support_DIST}
|
||||||
${test_reports_standard_DIST} PARENT_SCOPE)
|
${test_reports_standard_DIST} PARENT_SCOPE)
|
||||||
|
@ -90,7 +90,4 @@
|
|||||||
|
|
||||||
(use-modules (gnucash reports standard owner-report))
|
(use-modules (gnucash reports standard owner-report))
|
||||||
(define* (gnc:owner-report-create owner account #:key currency)
|
(define* (gnc:owner-report-create owner account #:key currency)
|
||||||
; Figure out an account to use if nothing exists here.
|
(owner-report-create owner account #:currency currency))
|
||||||
(if (null? account)
|
|
||||||
(set! account (find-first-account-for-owner owner #:currency currency)))
|
|
||||||
(owner-report-create owner account))
|
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
(use-modules (gnucash gnc-module))
|
(use-modules (gnucash gnc-module))
|
||||||
(use-modules (gnucash utilities)) ; for gnc:debug
|
(use-modules (gnucash utilities)) ; for gnc:debug
|
||||||
(use-modules (gnucash gettext))
|
(use-modules (gnucash gettext))
|
||||||
(use-modules (gnucash reports))
|
|
||||||
|
|
||||||
(gnc:module-load "gnucash/report" 0)
|
(gnc:module-load "gnucash/report" 0)
|
||||||
|
|
||||||
@ -881,8 +880,11 @@
|
|||||||
(gnc:option-set-value account-op account)
|
(gnc:option-set-value account-op account)
|
||||||
(gnc:make-report report-guid options)))
|
(gnc:make-report report-guid options)))
|
||||||
|
|
||||||
(define (owner-report-create owner account)
|
(define* (owner-report-create owner account #:key currency)
|
||||||
(let ((type (gncOwnerGetType (gncOwnerGetEndOwner owner))))
|
(let ((type (gncOwnerGetType (gncOwnerGetEndOwner owner))))
|
||||||
|
; Figure out an account to use if nothing exists here.
|
||||||
|
(if (null? account)
|
||||||
|
(set! account (find-first-account-for-owner owner #:currency currency)))
|
||||||
(cond
|
(cond
|
||||||
((eqv? type GNC-OWNER-CUSTOMER)
|
((eqv? type GNC-OWNER-CUSTOMER)
|
||||||
(owner-report-create-internal customer-report-guid owner account type)) ;; Not sure whether to pass type, or to use the guid in the report function
|
(owner-report-create-internal customer-report-guid owner account type)) ;; Not sure whether to pass type, or to use the guid in the report function
|
||||||
@ -904,7 +906,7 @@
|
|||||||
(res -1)) ;; XXX -- in this case we should create an error report
|
(res -1)) ;; XXX -- in this case we should create an error report
|
||||||
|
|
||||||
(if (not (null? owner))
|
(if (not (null? owner))
|
||||||
(set! res (gnc:owner-report-create owner account)))
|
(set! res (owner-report-create owner account)))
|
||||||
|
|
||||||
(gncOwnerFree temp-owner)
|
(gncOwnerFree temp-owner)
|
||||||
res))
|
res))
|
||||||
@ -915,4 +917,4 @@
|
|||||||
(gnc:register-report-hook ACCT-TYPE-PAYABLE #t
|
(gnc:register-report-hook ACCT-TYPE-PAYABLE #t
|
||||||
gnc:owner-report-create-internal)
|
gnc:owner-report-create-internal)
|
||||||
|
|
||||||
(export find-first-account-for-owner owner-report-create)
|
(export owner-report-create)
|
||||||
|
Loading…
Reference in New Issue
Block a user