[Gnucash-changes] Guile-1.6 doesn't allow string->symbol on a symbol (bug #131201).

Derek Atkins warlord at cvs.gnucash.org
Mon May 17 14:55:19 EDT 2004


Log Message:
-----------
Guile-1.6 doesn't allow string->symbol on a symbol (bug #131201).

	* src/report/locale-specific/us/taxtxf.scm: guile-1.6 complains
	  about string->symbol when passed a symbol.  Fixes #131201
	  Also add some code to handle accounts that are expected to
	  have parents but do not (also described in #131201).

Modified Files:
--------------
    gnucash:
        ChangeLog
    gnucash/src/report/locale-specific/us:
        taxtxf.scm

Revision Data
-------------
Index: ChangeLog
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/ChangeLog,v
retrieving revision 1.1811
retrieving revision 1.1812
diff -LChangeLog -LChangeLog -u -r1.1811 -r1.1812
--- ChangeLog
+++ ChangeLog
@@ -1,3 +1,10 @@
+2004-05-17  Derek Atkins  <derek at ihtfp.com>
+
+	* src/report/locale-specific/us/taxtxf.scm: guile-1.6 complains
+	  about string->symbol when passed a symbol.  Fixes #131201
+	  Also add some code to handle accounts that are expected to
+	  have parents but do not (also described in #131201).
+
 2004-05-15  Derek Atkins  <derek at ihtfp.com>
 
 	* Luigi Ballabio's automake patch to gnucash.m4
Index: taxtxf.scm
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/report/locale-specific/us/taxtxf.scm,v
retrieving revision 1.16
retrieving revision 1.17
diff -Lsrc/report/locale-specific/us/taxtxf.scm -Lsrc/report/locale-specific/us/taxtxf.scm -u -r1.16 -r1.17
--- src/report/locale-specific/us/taxtxf.scm
+++ src/report/locale-specific/us/taxtxf.scm
@@ -289,13 +289,27 @@
                ;; Only formats 1,3 implemented now! Others are treated as 1.
                (format (gnc:get-txf-format code (eq? type 'income)))
                (payer-src (gnc:account-get-txf-payer-source account))
-               (account-name (if (eq? payer-src 'parent)
-                                 (gnc:account-get-name
-                                  (gnc:group-get-parent
-                                   (gnc:account-get-parent account)))
-                                 (gnc:account-get-name account))) 
+               (account-name (let* ((named-acct
+				    (if (eq? payer-src 'parent)
+					(gnc:group-get-parent
+					 (gnc:account-get-parent account))
+					account))
+				    (name (gnc:account-get-name named-acct)))
+			       (if name
+				   name
+				   (begin
+				     (display
+				      (string-append
+				       "Failed to get name for account: "
+				       (gnc:account-get-guid named-acct)
+				       (if (not (eq? account named-acct))
+					   (string-append
+					    " which is the parent of "
+					    (gnc:account-get-guid account)))
+				       "\n"))
+				     "<NONE> -- See the Terminal Output"))))
                (action (if (eq? type 'income)
-                           (case (string->symbol code)
+                           (case code
                              ((N286 N488) "ReinvD")
                              (else "Income"))
                            "Expense"))


More information about the gnucash-changes mailing list