From 2b5c814b506cf3c9b3816983e255142841c1c2c7 Mon Sep 17 00:00:00 2001 From: Phil Longstaff Date: Thu, 4 Jun 2009 21:16:01 +0000 Subject: [PATCH] Fix bug #584819: Company name is not shown by default on some reports. Patch by Chris Dennis. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18103 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/business/business-utils/business-utils.scm | 13 ++++++++++--- src/report/standard-reports/balance-sheet.scm | 6 ++---- .../standard-reports/budget-balance-sheet.scm | 6 ++---- .../standard-reports/budget-income-statement.scm | 6 ++---- src/report/standard-reports/equity-statement.scm | 6 ++---- src/report/standard-reports/income-statement.scm | 6 ++---- src/report/standard-reports/trial-balance.scm | 4 ++-- 7 files changed, 22 insertions(+), 25 deletions(-) diff --git a/src/business/business-utils/business-utils.scm b/src/business/business-utils/business-utils.scm index f4d258118d..875a67a94b 100644 --- a/src/business/business-utils/business-utils.scm +++ b/src/business/business-utils/business-utils.scm @@ -14,9 +14,16 @@ (define gnc:*company-email* (N_ "Company Email Address")) (define gnc:*company-contact* (N_ "Company Contact Person")) -(export gnc:*business-label* gnc:*company-name* gnc:*company-addy* gnc:*company-id* - gnc:*company-phone* gnc:*company-fax* gnc:*company-url* - gnc:*company-email* gnc:*company-contact*) +(define (gnc:company-info key) + ;; Access company info from key-value pairs for current book + (kvp-frame-get-slot-path-gslist + (gnc-book-get-slots (gnc-get-current-book)) + (append gnc:*kvp-option-path* (list gnc:*business-label* key)))) + +(export gnc:*business-label* gnc:*company-name* gnc:*company-addy* + gnc:*company-id* gnc:*company-phone* gnc:*company-fax* + gnc:*company-url* gnc:*company-email* gnc:*company-contact* + gnc:company-info) (load-from-path "business-options.scm") (load-from-path "business-prefs.scm") diff --git a/src/report/standard-reports/balance-sheet.scm b/src/report/standard-reports/balance-sheet.scm index def488f5aa..6e691ca3e6 100644 --- a/src/report/standard-reports/balance-sheet.scm +++ b/src/report/standard-reports/balance-sheet.scm @@ -66,6 +66,7 @@ (use-modules (gnucash main)) ;; FIXME: delete after we finish modularizing. (use-modules (ice-9 slib)) (use-modules (gnucash gnc-module)) +(use-modules (gnucash business-utils)) (gnc:module-load "gnucash/report/report-system" 0) @@ -158,10 +159,7 @@ (add-option (gnc:make-string-option gnc:pagename-general optname-party-name - "b" opthelp-party-name "")) - ;; this should default to company name in (gnc-get-current-book) - ;; does anyone know the function to get the company name?? - ;; (GnuCash is *so* well documented... sigh) + "b" opthelp-party-name (gnc:company-info gnc:*company-name*))) ;; date at which to report balance (gnc:options-add-report-date! diff --git a/src/report/standard-reports/budget-balance-sheet.scm b/src/report/standard-reports/budget-balance-sheet.scm index 2bab0be4b9..ec555513ac 100644 --- a/src/report/standard-reports/budget-balance-sheet.scm +++ b/src/report/standard-reports/budget-balance-sheet.scm @@ -32,6 +32,7 @@ (use-modules (gnucash main)) ;; FIXME: delete after we finish modularizing. (use-modules (ice-9 slib)) (use-modules (gnucash gnc-module)) +(use-modules (gnucash business-utils)) (gnc:module-load "gnucash/report/report-system" 0) @@ -126,10 +127,7 @@ (add-option (gnc:make-string-option gnc:pagename-general optname-party-name - "b" opthelp-party-name "")) - ;; this should default to company name in (gnc-get-current-book) - ;; does anyone know the function to get the company name?? - ;; (GnuCash is *so* well documented... sigh) + "b" opthelp-party-name (gnc:company-info gnc:*company-name*))) (add-option (gnc:make-simple-boolean-option diff --git a/src/report/standard-reports/budget-income-statement.scm b/src/report/standard-reports/budget-income-statement.scm index 8c5b213b8c..377509daf9 100644 --- a/src/report/standard-reports/budget-income-statement.scm +++ b/src/report/standard-reports/budget-income-statement.scm @@ -44,6 +44,7 @@ (use-modules (gnucash main)) ;; FIXME: delete after we finish modularizing. (use-modules (ice-9 slib)) (use-modules (gnucash gnc-module)) +(use-modules (gnucash business-utils)) (gnc:module-load "gnucash/report/report-system" 0) @@ -133,10 +134,7 @@ (add-option (gnc:make-string-option gnc:pagename-general optname-party-name - "b" opthelp-party-name "")) - ;; this should default to company name in (gnc-get-current-book) - ;; does anyone know the function to get the company name?? - ;; (GnuCash is *so* well documented... sigh) + "b" opthelp-party-name (gnc:company-info gnc:*company-name*))) (add-option (gnc:make-budget-option diff --git a/src/report/standard-reports/equity-statement.scm b/src/report/standard-reports/equity-statement.scm index 6841e31f5b..4787245564 100644 --- a/src/report/standard-reports/equity-statement.scm +++ b/src/report/standard-reports/equity-statement.scm @@ -49,6 +49,7 @@ (use-modules (gnucash main)) ;; FIXME: delete after we finish modularizing. (use-modules (ice-9 slib)) (use-modules (gnucash gnc-module)) +(use-modules (gnucash business-utils)) (require 'printf) @@ -111,10 +112,7 @@ (add-option (gnc:make-string-option (N_ "General") optname-party-name - "b" opthelp-party-name "")) - ;; this should default to company name in (gnc-get-current-book) - ;; does anyone know the function to get the company name?? - ;; (GnuCash is *so* well documented... sigh) + "b" opthelp-party-name (gnc:company-info gnc:*company-name*))) ;; date at which to report balance (gnc:options-add-date-interval! diff --git a/src/report/standard-reports/income-statement.scm b/src/report/standard-reports/income-statement.scm index ccd3fadb8d..6b7c98ab27 100644 --- a/src/report/standard-reports/income-statement.scm +++ b/src/report/standard-reports/income-statement.scm @@ -45,6 +45,7 @@ (use-modules (gnucash main)) ;; FIXME: delete after we finish modularizing. (use-modules (ice-9 slib)) (use-modules (gnucash gnc-module)) +(use-modules (gnucash business-utils)) (gnc:module-load "gnucash/report/report-system" 0) @@ -144,10 +145,7 @@ (add-option (gnc:make-string-option gnc:pagename-general optname-party-name - "b" opthelp-party-name "")) - ;; this should default to company name in (gnc-get-current-book) - ;; does anyone know the function to get the company name?? - ;; (GnuCash is *so* well documented... sigh) + "b" opthelp-party-name (gnc:company-info gnc:*company-name*))) ;; period over which to report income (gnc:options-add-date-interval! diff --git a/src/report/standard-reports/trial-balance.scm b/src/report/standard-reports/trial-balance.scm index 5b31aaa828..9e8968e5b9 100644 --- a/src/report/standard-reports/trial-balance.scm +++ b/src/report/standard-reports/trial-balance.scm @@ -54,6 +54,7 @@ (use-modules (gnucash main)) ;; FIXME: delete after we finish modularizing. (use-modules (ice-9 slib)) (use-modules (gnucash gnc-module)) +(use-modules (gnucash business-utils)) (gnc:module-load "gnucash/report/report-system" 0) @@ -148,8 +149,7 @@ (add-option (gnc:make-string-option (N_ "General") optname-party-name - "b" opthelp-party-name "")) - ;; this should default to company name in (gnc-get-current-book) + "b" opthelp-party-name (gnc:company-info gnc:*company-name*))) ;; the period over which to collect adjusting/closing entries and ;; date at which to report the balance