r18103 - gnucash/trunk/src - Fix bug #584819: Company name is not shown by default on some reports. Patch by Chris Dennis.

Phil Longstaff plongstaff at code.gnucash.org
Thu Jun 4 17:16:01 EDT 2009


Author: plongstaff
Date: 2009-06-04 17:16:01 -0400 (Thu, 04 Jun 2009)
New Revision: 18103
Trac: http://svn.gnucash.org/trac/changeset/18103

Modified:
   gnucash/trunk/src/business/business-utils/business-utils.scm
   gnucash/trunk/src/report/standard-reports/balance-sheet.scm
   gnucash/trunk/src/report/standard-reports/budget-balance-sheet.scm
   gnucash/trunk/src/report/standard-reports/budget-income-statement.scm
   gnucash/trunk/src/report/standard-reports/equity-statement.scm
   gnucash/trunk/src/report/standard-reports/income-statement.scm
   gnucash/trunk/src/report/standard-reports/trial-balance.scm
Log:
Fix bug #584819: Company name is not shown by default on some reports.  Patch by Chris Dennis.


Modified: gnucash/trunk/src/business/business-utils/business-utils.scm
===================================================================
--- gnucash/trunk/src/business/business-utils/business-utils.scm	2009-06-02 22:28:48 UTC (rev 18102)
+++ gnucash/trunk/src/business/business-utils/business-utils.scm	2009-06-04 21:16:01 UTC (rev 18103)
@@ -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")

Modified: gnucash/trunk/src/report/standard-reports/balance-sheet.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/balance-sheet.scm	2009-06-02 22:28:48 UTC (rev 18102)
+++ gnucash/trunk/src/report/standard-reports/balance-sheet.scm	2009-06-04 21:16:01 UTC (rev 18103)
@@ -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!

Modified: gnucash/trunk/src/report/standard-reports/budget-balance-sheet.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/budget-balance-sheet.scm	2009-06-02 22:28:48 UTC (rev 18102)
+++ gnucash/trunk/src/report/standard-reports/budget-balance-sheet.scm	2009-06-04 21:16:01 UTC (rev 18103)
@@ -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

Modified: gnucash/trunk/src/report/standard-reports/budget-income-statement.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/budget-income-statement.scm	2009-06-02 22:28:48 UTC (rev 18102)
+++ gnucash/trunk/src/report/standard-reports/budget-income-statement.scm	2009-06-04 21:16:01 UTC (rev 18103)
@@ -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

Modified: gnucash/trunk/src/report/standard-reports/equity-statement.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/equity-statement.scm	2009-06-02 22:28:48 UTC (rev 18102)
+++ gnucash/trunk/src/report/standard-reports/equity-statement.scm	2009-06-04 21:16:01 UTC (rev 18103)
@@ -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!

Modified: gnucash/trunk/src/report/standard-reports/income-statement.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/income-statement.scm	2009-06-02 22:28:48 UTC (rev 18102)
+++ gnucash/trunk/src/report/standard-reports/income-statement.scm	2009-06-04 21:16:01 UTC (rev 18103)
@@ -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!

Modified: gnucash/trunk/src/report/standard-reports/trial-balance.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/trial-balance.scm	2009-06-02 22:28:48 UTC (rev 18102)
+++ gnucash/trunk/src/report/standard-reports/trial-balance.scm	2009-06-04 21:16:01 UTC (rev 18103)
@@ -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



More information about the gnucash-changes mailing list