[Gnucash-changes] More German tax work.

Christian Stimming cstim at cvs.gnucash.org
Sun Jan 16 11:41:41 EST 2005


Log Message:
-----------
More German tax work.

2005-01-16  Christian Stimming  <stimming at tuhh.de>

	* src/app-utils/gnc-ui-util.c: Modify tax option code to load
	tax-de_DE module in the appropriate locale.
	
	* src/report/locale-specific/us/gncmod-locale-reports-us.c,
	de_DE.scm: Add scheme module for locale-report/us
	resp. locale-report/de_DE again because it seems to be required.

Modified Files:
--------------
    gnucash:
        ChangeLog
    gnucash/src/app-utils:
        gnc-ui-util.c
    gnucash/src/report/locale-specific/us:
        Makefile.am
        gncmod-locale-reports-us.c
        taxtxf-de_DE.scm

Added Files:
-----------
    gnucash/src/report/locale-specific/us:
        de_DE.scm

Revision Data
-------------
Index: ChangeLog
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/ChangeLog,v
retrieving revision 1.1878
retrieving revision 1.1879
diff -LChangeLog -LChangeLog -u -r1.1878 -r1.1879
--- ChangeLog
+++ ChangeLog
@@ -1,3 +1,12 @@
+2005-01-16  Christian Stimming  <stimming at tuhh.de>
+
+	* src/app-utils/gnc-ui-util.c: Modify tax option code to load
+	tax-de_DE module in the appropriate locale.
+	
+	* src/report/locale-specific/us/gncmod-locale-reports-us.c,
+	de_DE.scm: Add scheme module for locale-report/us
+	resp. locale-report/de_DE again because it seems to be required.
+
 2005-01-15  Derek Atkins  <derek at ihtfp.com>
 
 	* Neil William's patch to remove static mergeData context.
Index: gnc-ui-util.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/app-utils/gnc-ui-util.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -Lsrc/app-utils/gnc-ui-util.c -Lsrc/app-utils/gnc-ui-util.c -u -r1.48 -r1.49
--- src/app-utils/gnc-ui-util.c
+++ src/app-utils/gnc-ui-util.c
@@ -447,8 +447,17 @@
   if (get_form == SCM_UNDEFINED)
   {
     GNCModule module;
+    /* load the tax info */
+    const char *thislocale = setlocale(LC_ALL, NULL);
+    /* This is a very simple hack that loads the (new, special) German
+       tax definition file in a German locale, or (default) loads the
+       previous US tax file. */
+    gboolean is_de_DE = (strncmp(thislocale, "de_DE", 5) == 0);
+    const char *tax_module = is_de_DE ? 
+      "gnucash/tax/de_DE" : 
+      "gnucash/tax/us";
 
-    module = gnc_module_load ("gnucash/tax/us", 0);
+    module = gnc_module_load ((char *)tax_module, 0);
 
     g_return_val_if_fail (module, NULL);
 
--- /dev/null
+++ src/report/locale-specific/us/de_DE.scm
@@ -0,0 +1,3 @@
+; This is unused and therefore no longer installed and/or loaded
+(define-module (gnucash report locale-specific de_DE))
+(use-modules (gnucash report taxtxf-de_DE))  
Index: gncmod-locale-reports-us.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/report/locale-specific/us/gncmod-locale-reports-us.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -Lsrc/report/locale-specific/us/gncmod-locale-reports-us.c -Lsrc/report/locale-specific/us/gncmod-locale-reports-us.c -u -r1.10 -r1.11
--- src/report/locale-specific/us/gncmod-locale-reports-us.c
+++ src/report/locale-specific/us/gncmod-locale-reports-us.c
@@ -33,11 +33,11 @@
 
 char *
 libgncmod_locale_reports_us_LTX_gnc_module_path(void) {
-  const char *thislocale = setlocale(LC_ALL, NULL);
+  /* const char *thislocale = setlocale(LC_ALL, NULL);
   if (strncmp(thislocale, "de_DE", 5) == 0)
     return g_strdup("gnucash/report/locale-specific/de_DE");
-  else
-    return g_strdup("gnucash/report/locale-specific/us");
+    else */
+  return g_strdup("gnucash/report/locale-specific/us");
 }
 
 char * 
@@ -59,6 +59,9 @@
   const char *report_taxtxf = is_de_DE ? 
     "(use-modules (gnucash report taxtxf-de_DE))" :
     "(use-modules (gnucash report taxtxf))";
+  const char *report_locale = is_de_DE ?
+    "(use-modules (gnucash report locale-specific de_DE))" :
+    "(use-modules (gnucash report locale-specific us))";
 
   /* The gchar* cast is only because the function declaration expects
      a non-const string -- probably an api error. */
@@ -78,12 +81,11 @@
     return FALSE;
   }
 
-  /* This is unused and therefore no longer installed and/or loaded */
-  /*
-  if(scm_c_eval_string("(use-modules (gnucash report locale-specific us))") 
+  /* Load the module scheme code */
+  if(gh_eval_str(report_locale) 
      == SCM_BOOL_F) {
     return FALSE;
-    }*/
+  }
 
   return TRUE;
 }
Index: taxtxf-de_DE.scm
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/report/locale-specific/us/taxtxf-de_DE.scm,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lsrc/report/locale-specific/us/taxtxf-de_DE.scm -Lsrc/report/locale-specific/us/taxtxf-de_DE.scm -u -r1.1 -r1.2
--- src/report/locale-specific/us/taxtxf-de_DE.scm
+++ src/report/locale-specific/us/taxtxf-de_DE.scm
@@ -51,7 +51,7 @@
 (require 'printf)
 
 (use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/tax/us" 0)
+(gnc:module-load "gnucash/tax/de_DE" 0)
 (gnc:module-load "gnucash/report/report-system" 0)
 
 
Index: Makefile.am
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/report/locale-specific/us/Makefile.am,v
retrieving revision 1.13
retrieving revision 1.14
diff -Lsrc/report/locale-specific/us/Makefile.am -Lsrc/report/locale-specific/us/Makefile.am -u -r1.13 -r1.14
--- src/report/locale-specific/us/Makefile.am
+++ src/report/locale-specific/us/Makefile.am
@@ -38,8 +38,8 @@
 noinst_DATA = .scm-links
 
 ## This is unused and therefore no longer installed and/or loaded
-# gncscmmoddir = ${GNC_SHAREDIR}/guile-modules/gnucash/report/locale-specific
-# gncscmmod_DATA = us.scm
+gncscmmoddir = ${GNC_SHAREDIR}/guile-modules/gnucash/report/locale-specific
+gncscmmod_DATA = us.scm de_DE.scm
 
 gncscmothermoddir = ${GNC_SHAREDIR}/guile-modules/gnucash/report/
 gncscmothermod_DATA = taxtxf.scm taxtxf-de_DE.scm


More information about the gnucash-changes mailing list