r14975 - gnucash/branches/swig-redo/src - Convert AccountType from gwrap to swig.

Chris Shoemaker chris at cvs.gnucash.org
Mon Oct 9 20:07:03 EDT 2006


Author: chris
Date: 2006-10-09 20:07:02 -0400 (Mon, 09 Oct 2006)
New Revision: 14975
Trac: http://svn.gnucash.org/trac/changeset/14975

Modified:
   gnucash/branches/swig-redo/src/app-utils/guile-util.c
   gnucash/branches/swig-redo/src/app-utils/option-util.c
   gnucash/branches/swig-redo/src/app-utils/options.scm
   gnucash/branches/swig-redo/src/app-utils/prefs.scm
   gnucash/branches/swig-redo/src/business/business-reports/owner-report.scm
   gnucash/branches/swig-redo/src/business/business-reports/payables.scm
   gnucash/branches/swig-redo/src/business/business-reports/receivables.scm
   gnucash/branches/swig-redo/src/report/locale-specific/us/taxtxf-de_DE.scm
   gnucash/branches/swig-redo/src/report/locale-specific/us/taxtxf.scm
   gnucash/branches/swig-redo/src/report/report-system/report-utilities.scm
   gnucash/branches/swig-redo/src/report/standard-reports/account-piecharts.scm
   gnucash/branches/swig-redo/src/report/standard-reports/account-summary.scm
   gnucash/branches/swig-redo/src/report/standard-reports/advanced-portfolio.scm
   gnucash/branches/swig-redo/src/report/standard-reports/average-balance.scm
   gnucash/branches/swig-redo/src/report/standard-reports/balance-sheet.scm
   gnucash/branches/swig-redo/src/report/standard-reports/budget.scm
   gnucash/branches/swig-redo/src/report/standard-reports/cash-flow.scm
   gnucash/branches/swig-redo/src/report/standard-reports/category-barchart.scm
   gnucash/branches/swig-redo/src/report/standard-reports/daily-reports.scm
   gnucash/branches/swig-redo/src/report/standard-reports/equity-statement.scm
   gnucash/branches/swig-redo/src/report/standard-reports/income-statement.scm
   gnucash/branches/swig-redo/src/report/standard-reports/net-barchart.scm
   gnucash/branches/swig-redo/src/report/standard-reports/standard-reports.scm
   gnucash/branches/swig-redo/src/report/standard-reports/transaction.scm
   gnucash/branches/swig-redo/src/report/standard-reports/trial-balance.scm
Log:
Convert AccountType from gwrap to swig.

This type had to be done by hand for several reasons, most obviously
because the same guile symbols that are used for account-types are
sometimes used with other meanings. This conversion was tedious and
error-prone.  This is a potentially risky source of bugs.

 - Use '() instead of #f for the empty object.
 - Convert the runtime code that uses AccountType to use the swig api.
 - Incidentally this fixes an existing bug where the AccountType
   C<->guile mapping was broken, with the effect of no longer showing
   Account-type specific debit/credit column headers in the register.




Modified: gnucash/branches/swig-redo/src/app-utils/guile-util.c
===================================================================
--- gnucash/branches/swig-redo/src/app-utils/guile-util.c	2006-10-10 00:06:26 UTC (rev 14974)
+++ gnucash/branches/swig-redo/src/app-utils/guile-util.c	2006-10-10 00:07:02 UTC (rev 14975)
@@ -1088,7 +1088,6 @@
 char *
 gnc_get_debit_string(GNCAccountType account_type)
 {
-  const char *type_string;
   const gchar *string;
   SCM result;
   SCM arg;
@@ -1101,10 +1100,8 @@
   if ((account_type < ACCT_TYPE_NONE) || (account_type >= NUM_ACCOUNT_TYPES))
     account_type = ACCT_TYPE_NONE;
 
-  type_string = xaccAccountTypeEnumAsString(account_type);
+  arg = scm_long2num(account_type);
 
-  arg = scm_str2symbol(type_string);
-
   result = scm_call_1(getters.debit_string, arg);
   if (!SCM_STRINGP(result))
     return NULL;
@@ -1126,7 +1123,6 @@
 char *
 gnc_get_credit_string(GNCAccountType account_type)
 {
-  const char *type_string;
   const gchar *string;
   SCM result;
   SCM arg;
@@ -1139,10 +1135,8 @@
   if ((account_type < ACCT_TYPE_NONE) || (account_type >= NUM_ACCOUNT_TYPES))
     account_type = ACCT_TYPE_NONE;
 
-  type_string = xaccAccountTypeEnumAsString(account_type);
+  arg = scm_long2num(account_type);
 
-  arg = scm_str2symbol(type_string);
-
   result = scm_call_1(getters.credit_string, arg);
   if (!SCM_STRINGP(result))
     return NULL;

Modified: gnucash/branches/swig-redo/src/app-utils/option-util.c
===================================================================
--- gnucash/branches/swig-redo/src/app-utils/option-util.c	2006-10-10 00:06:26 UTC (rev 14974)
+++ gnucash/branches/swig-redo/src/app-utils/option-util.c	2006-10-10 00:07:02 UTC (rev 14975)
@@ -1024,7 +1024,6 @@
 {
   SCM pair;
   SCM lst;
-  SCM conv_func;
   GList *type_list = NULL;
 
   initialize_getters();
@@ -1032,12 +1031,6 @@
   pair = scm_call_1(getters.option_data, option->guile_option);
   lst = SCM_CDR(pair);
 
-  conv_func = scm_c_eval_string ("gw:enum-<gnc:AccountType>-val->int");
-  if (!SCM_PROCEDUREP (conv_func)) {
-    PERR ("Cannot obtain conv_func");
-    return NULL;
-  }
-
   while (!SCM_NULLP (lst)) {
     GNCAccountType type;
     SCM item;
@@ -1046,8 +1039,6 @@
     item = SCM_CAR (lst);
     lst = SCM_CDR (lst);
 
-    item = scm_call_1(conv_func, item);
-
     if (SCM_FALSEP (scm_integer_p (item))) {
       PERR ("Invalid type");
     } else {

Modified: gnucash/branches/swig-redo/src/app-utils/options.scm
===================================================================
--- gnucash/branches/swig-redo/src/app-utils/options.scm	2006-10-10 00:06:26 UTC (rev 14974)
+++ gnucash/branches/swig-redo/src/app-utils/options.scm	2006-10-10 00:07:02 UTC (rev 14975)
@@ -725,11 +725,12 @@
   (define (find-first-account)
     (define (find-first account-list)
       (if (null? account-list)
-	  #f
+	  '()
 	  (let* ((this-account (car account-list))
-		 (account-type (gw:enum-<gnc:AccountType>-val->sym
-				(gnc:account-get-type this-account) #f)))
-	    (if (if (null? acct-type-list) #t (member account-type acct-type-list))
+		 (account-type (gnc:account-get-type this-account)))
+	    (if (if (null? acct-type-list)
+                    #t
+                    (member account-type acct-type-list))
 		this-account
 		(find-first (cdr account-list))))))
 

Modified: gnucash/branches/swig-redo/src/app-utils/prefs.scm
===================================================================
--- gnucash/branches/swig-redo/src/app-utils/prefs.scm	2006-10-10 00:06:26 UTC (rev 14974)
+++ gnucash/branches/swig-redo/src/app-utils/prefs.scm	2006-10-10 00:07:02 UTC (rev 14975)
@@ -64,36 +64,36 @@
 ;;;;;; Create config vars
 
 (define gnc:*debit-strings*
-  (list (cons 'ACCT_TYPE_NONE       (N_ "Funds In"))
-        (cons 'ACCT_TYPE_BANK       (N_ "Deposit"))
-        (cons 'ACCT_TYPE_CASH       (N_ "Receive"))
-        (cons 'ACCT_TYPE_CREDIT     (N_ "Payment"))
-        (cons 'ACCT_TYPE_ASSET      (N_ "Increase"))
-        (cons 'ACCT_TYPE_LIABILITY  (N_ "Decrease"))
-        (cons 'ACCT_TYPE_STOCK      (N_ "Buy"))
-        (cons 'ACCT_TYPE_MUTUAL     (N_ "Buy"))
-        (cons 'ACCT_TYPE_CURRENCY   (N_ "Buy"))
-        (cons 'ACCT_TYPE_INCOME     (N_ "Charge"))
-        (cons 'ACCT_TYPE_EXPENSE    (N_ "Expense"))
-        (cons 'ACCT_TYPE_PAYABLE    (N_ "Payment"))
-        (cons 'ACCT_TYPE_RECEIVABLE (N_ "Invoice"))
-        (cons 'ACCT_TYPE_EQUITY     (N_ "Decrease"))))
+  (list (cons ACCT-TYPE-NONE       (N_ "Funds In"))
+        (cons ACCT-TYPE-BANK       (N_ "Deposit"))
+        (cons ACCT-TYPE-CASH       (N_ "Receive"))
+        (cons ACCT-TYPE-CREDIT     (N_ "Payment"))
+        (cons ACCT-TYPE-ASSET      (N_ "Increase"))
+        (cons ACCT-TYPE-LIABILITY  (N_ "Decrease"))
+        (cons ACCT-TYPE-STOCK      (N_ "Buy"))
+        (cons ACCT-TYPE-MUTUAL     (N_ "Buy"))
+        (cons ACCT-TYPE-CURRENCY   (N_ "Buy"))
+        (cons ACCT-TYPE-INCOME     (N_ "Charge"))
+        (cons ACCT-TYPE-EXPENSE    (N_ "Expense"))
+        (cons ACCT-TYPE-PAYABLE    (N_ "Payment"))
+        (cons ACCT-TYPE-RECEIVABLE (N_ "Invoice"))
+        (cons ACCT-TYPE-EQUITY     (N_ "Decrease"))))
 
 (define gnc:*credit-strings*
-  (list (cons 'ACCT_TYPE_NONE       (N_ "Funds Out"))
-        (cons 'ACCT_TYPE_BANK       (N_ "Withdrawal"))
-        (cons 'ACCT_TYPE_CASH       (N_ "Spend"))
-        (cons 'ACCT_TYPE_CREDIT     (N_ "Charge"))
-        (cons 'ACCT_TYPE_ASSET      (N_ "Decrease"))
-        (cons 'ACCT_TYPE_LIABILITY  (N_ "Increase"))
-        (cons 'ACCT_TYPE_STOCK      (N_ "Sell"))
-        (cons 'ACCT_TYPE_MUTUAL     (N_ "Sell"))
-        (cons 'ACCT_TYPE_CURRENCY   (N_ "Sell"))
-        (cons 'ACCT_TYPE_INCOME     (N_ "Income"))
-        (cons 'ACCT_TYPE_EXPENSE    (N_ "Rebate"))
-        (cons 'ACCT_TYPE_PAYABLE    (N_ "Bill"))
-        (cons 'ACCT_TYPE_RECEIVABLE (N_ "Payment"))
-        (cons 'ACCT_TYPE_EQUITY     (N_ "Increase"))))
+  (list (cons ACCT-TYPE-NONE       (N_ "Funds Out"))
+        (cons ACCT-TYPE-BANK       (N_ "Withdrawal"))
+        (cons ACCT-TYPE-CASH       (N_ "Spend"))
+        (cons ACCT-TYPE-CREDIT     (N_ "Charge"))
+        (cons ACCT-TYPE-ASSET      (N_ "Decrease"))
+        (cons ACCT-TYPE-LIABILITY  (N_ "Increase"))
+        (cons ACCT-TYPE-STOCK      (N_ "Sell"))
+        (cons ACCT-TYPE-MUTUAL     (N_ "Sell"))
+        (cons ACCT-TYPE-CURRENCY   (N_ "Sell"))
+        (cons ACCT-TYPE-INCOME     (N_ "Income"))
+        (cons ACCT-TYPE-EXPENSE    (N_ "Rebate"))
+        (cons ACCT-TYPE-PAYABLE    (N_ "Bill"))
+        (cons ACCT-TYPE-RECEIVABLE (N_ "Payment"))
+        (cons ACCT-TYPE-EQUITY     (N_ "Increase"))))
 
 (define (gnc:get-debit-string type)
   (_ (assoc-ref gnc:*debit-strings* type)))

Modified: gnucash/branches/swig-redo/src/business/business-reports/owner-report.scm
===================================================================
--- gnucash/branches/swig-redo/src/business/business-reports/owner-report.scm	2006-10-10 00:06:26 UTC (rev 14974)
+++ gnucash/branches/swig-redo/src/business/business-reports/owner-report.scm	2006-10-10 00:07:02 UTC (rev 14975)
@@ -403,13 +403,16 @@
   gnc:*report-options*)
 	     
 (define (customer-options-generator)
-  (options-generator '(receivable) GNC-OWNER-CUSTOMER (_ "Invoice") #f))
+  (options-generator (list ACCT-TYPE-RECEIVABLE) GNC-OWNER-CUSTOMER
+                     (_ "Invoice") #f))
 
 (define (vendor-options-generator)
-  (options-generator '(payable) GNC-OWNER-VENDOR (_ "Bill") #t))
+  (options-generator (list ACCT-TYPE-PAYABLE) GNC-OWNER-VENDOR
+                     (_ "Bill") #t))
 
 (define (employee-options-generator)
-  (options-generator '(payable) GNC-OWNER-EMPLOYEE (_ "Expense Report") #t))
+  (options-generator (list ACCT-TYPE-PAYABLE) GNC-OWNER-EMPLOYEE
+                     (_ "Expense Report") #t))
 
 (define (string-expand string character replace-string)
   (define (car-line chars)
@@ -625,7 +628,7 @@
 (define (find-first-account type)
   (define (find-first group num index)
     (if (>= index num)
-	#f ;; FIXME
+	'()
 	(let* ((this-account (gnc:group-get-account group index))
 	       (account-type (gnc:account-get-type this-account)))
 	  (if (eq? account-type type)
@@ -637,25 +640,25 @@
 			current-group)))
     (if (> num-accounts 0)
 	(find-first current-group num-accounts 0)
-	#f))) ;; FIXME
+	'())))
 
 (define (find-first-account-for-owner owner)
   (let ((type (gncOwnerGetType (gncOwnerGetEndOwner owner))))
     (cond
       ((eqv? type GNC-OWNER-CUSTOMER)
-       (find-first-account 'receivable))
+       (find-first-account ACCT-TYPE-RECEIVABLE))
 
       ((eqv? type GNC-OWNER-VENDOR)
-       (find-first-account 'payable))
+       (find-first-account ACCT-TYPE-PAYABLE))
 
       ((eqv? type GNC-OWNER-EMPLOYEE)
-       (find-first-account 'payable))
+       (find-first-account ACCT-TYPE-PAYABLE))
 
       ((eqv? type GNC-OWNER-JOB)
        (find-first-account-for-owner (gncOwnerGetEndOwner owner)))
 
       (else
-       #f))))  ;;FIXME: remember to convert
+       '()))))
 
 (gnc:define-report
  'version 1
@@ -725,10 +728,10 @@
     (gncOwnerDestroy temp-owner)
     res))
 
-(gnc:register-report-hook 'receivable #t
+(gnc:register-report-hook ACCT-TYPE-RECEIVABLE #t
 			  gnc:owner-report-create-internal)
 
-(gnc:register-report-hook 'payable #t
+(gnc:register-report-hook ACCT-TYPE-PAYABLE #t
 			  gnc:owner-report-create-internal)
 
 (export gnc:owner-report-create)

Modified: gnucash/branches/swig-redo/src/business/business-reports/payables.scm
===================================================================
--- gnucash/branches/swig-redo/src/business/business-reports/payables.scm	2006-10-10 00:06:26 UTC (rev 14974)
+++ gnucash/branches/swig-redo/src/business/business-reports/payables.scm	2006-10-10 00:07:02 UTC (rev 14975)
@@ -49,7 +49,7 @@
      (gnc:make-account-sel-limited-option
       acc-page this-acc
       (N_ "The payable account you wish to examine") "zz"
-      #f #f '(payable)))
+      #f #f (list ACCT-TYPE-PAYABLE)))
 
     (aging-options-generator options)))
 
@@ -83,5 +83,5 @@
 	 debit-string credit-string)
   (payables-report-create-internal account))
 
-(gnc:register-report-hook 'payable #f
+(gnc:register-report-hook ACCT-TYPE-PAYABLE #f
 			  gnc:payables-report-create-internal)

Modified: gnucash/branches/swig-redo/src/business/business-reports/receivables.scm
===================================================================
--- gnucash/branches/swig-redo/src/business/business-reports/receivables.scm	2006-10-10 00:06:26 UTC (rev 14974)
+++ gnucash/branches/swig-redo/src/business/business-reports/receivables.scm	2006-10-10 00:07:02 UTC (rev 14975)
@@ -49,7 +49,7 @@
      (gnc:make-account-sel-limited-option
       acc-page this-acc
       (N_ "The receivables account you wish to examine") "w"
-      #f #f '(receivable)))
+      #f #f (list ACCT-TYPE-RECEIVABLE)))
 
     (aging-options-generator options)))
 
@@ -84,5 +84,5 @@
 	 debit-string credit-string)
   (receivables-report-create-internal account))
 
-(gnc:register-report-hook 'receivable #f
+(gnc:register-report-hook ACCT-TYPE-RECEIVABLE #f
 			  gnc:receivables-report-create-internal)

Modified: gnucash/branches/swig-redo/src/report/locale-specific/us/taxtxf-de_DE.scm
===================================================================
--- gnucash/branches/swig-redo/src/report/locale-specific/us/taxtxf-de_DE.scm	2006-10-10 00:06:26 UTC (rev 14974)
+++ gnucash/branches/swig-redo/src/report/locale-specific/us/taxtxf-de_DE.scm	2006-10-10 00:07:02 UTC (rev 14975)
@@ -292,8 +292,7 @@
          (txf? (gnc:account-get-txf account)))
     (if (and txf?
              (not (gnc:numeric-zero-p account-value)))
-        (let* ((type (gw:enum-<gnc:AccountType>-val->sym
-                      (gnc:account-get-type account) #f))
+        (let* ((type (gnc:account-get-type account))
                (code (gnc:account-get-txf-code account))
                (date-str (if date
                              (strftime "%d.%m.%Y" (localtime (car date)))
@@ -302,9 +301,9 @@
                                (strftime "%d.%m.%Y" (localtime (car x-date)))
                                #f))
                ;; Only formats 1,3 implemented now! Others are treated as 1.
-               (format (gnc:get-txf-format code (eq? type 'income)))
+               (format (gnc:get-txf-format code (eq? type ACCT-TYPE-INCOME)))
 	       (value (string-append 
-		       (if (eq? type 'income) ;; negate expenses. FIXME: Necessary?
+		       (if (eq? type ACCT-TYPE-INCOME) ;; negate expenses. FIXME: Necessary?
 			   ""
 			   "-")
 		       (number->string 
@@ -333,12 +332,12 @@
 					    (gnc:account-get-guid account)))
 				       "\n"))
 				     "<NONE> -- See the Terminal Output"))))
-               (action (if (eq? type 'income)
+               (action (if (eq? type ACCT-TYPE-INCOME)
                            (case code
                              ((N286 N488) "ReinvD")
                              (else "Ertraege"))
                            "Aufwendungen"))
-               (category-key (if (eq? type 'income)
+               (category-key (if (eq? type ACCT-TYPE-INCOME)
                                  (gnc:txf-get-category-key 
                                   txf-income-categories code)
                                  (gnc:txf-get-category-key
@@ -651,8 +650,7 @@
 	  (length accounts)))
 
     (define (handle-level-x-account level account)
-      (let ((type (gw:enum-<gnc:AccountType>-val->sym
-                   (gnc:account-get-type account) #f)))
+      (let ((type (gnc:account-get-type account)))
 	(set! work-done (+ 1 work-done))
 	(gnc:report-percent-done (* 100 (if (> work-to-do 0)
 					    (/ work-done work-to-do)
@@ -703,7 +701,7 @@
                                         #f))
                          (gnc:numeric-zero))
                        ;; make positive
-                       (if (eq? type 'income)
+                       (if (eq? type ACCT-TYPE-INCOME)
                            (gnc:numeric-neg account-balance)
                            account-balance)))
 

Modified: gnucash/branches/swig-redo/src/report/locale-specific/us/taxtxf.scm
===================================================================
--- gnucash/branches/swig-redo/src/report/locale-specific/us/taxtxf.scm	2006-10-10 00:06:26 UTC (rev 14974)
+++ gnucash/branches/swig-redo/src/report/locale-specific/us/taxtxf.scm	2006-10-10 00:07:02 UTC (rev 14975)
@@ -277,8 +277,7 @@
          (txf? (gnc:account-get-txf account)))
     (if (and txf?
              (not (gnc:numeric-zero-p account-value)))
-        (let* ((type (gw:enum-<gnc:AccountType>-val->sym
-                      (gnc:account-get-type account) #f))
+        (let* ((type (gnc:account-get-type account))
                (code (gnc:account-get-txf-code account))
                (date-str (if date
                              (strftime "%m/%d/%Y" (localtime (car date)))
@@ -287,7 +286,7 @@
                                (strftime "%m/%d/%Y" (localtime (car x-date)))
                                #f))
                ;; Only formats 1,3 implemented now! Others are treated as 1.
-               (format (gnc:get-txf-format code (eq? type 'income)))
+               (format (gnc:get-txf-format code (eq? type ACCT-TYPE-INCOME)))
                (payer-src (gnc:account-get-txf-payer-source account))
                (account-name (let* ((named-acct
 				    (if (eq? payer-src 'parent)
@@ -308,12 +307,12 @@
 					    (gnc:account-get-guid account)))
 				       "\n"))
 				     "<NONE> -- See the Terminal Output"))))
-               (action (if (eq? type 'income)
+               (action (if (eq? type ACCT-TYPE-INCOME)
                            (case code
                              ((N286 N488) "ReinvD")
                              (else "Income"))
                            "Expense"))
-               (category-key (if (eq? type 'income)
+               (category-key (if (eq? type ACCT-TYPE-INCOME)
                                  (gnc:txf-get-category-key 
                                   txf-income-categories code)
                                  (gnc:txf-get-category-key
@@ -323,7 +322,7 @@
                                 (substring value 1 (string-length value))
                                 " " account-name)
                                account-name))
-               (value (if (eq? type 'income) ; negate expenses
+               (value (if (eq? type ACCT-TYPE-INCOME) ; negate expenses
                           value
                           (string-append 
                            "$-" (substring value 1 (string-length value)))))
@@ -628,9 +627,7 @@
 	  (length accounts)))
 
     (define (handle-level-x-account level account)
-      (let ((type (gw:enum-<gnc:AccountType>-val->sym
-                   (gnc:account-get-type account) #f)))
-
+      (let ((type (gnc:account-get-type account)))
 	(set! work-done (+ 1 work-done))
 	(gnc:report-percent-done (* 100 (if (> work-to-do 0)
 					    (/ work-done work-to-do)
@@ -681,7 +678,7 @@
                                         #f))
                          (gnc:numeric-zero))
                        ;; make positive
-                       (if (eq? type 'income)
+                       (if (eq? type ACCT-TYPE-INCOME)
                            (gnc:numeric-neg account-balance)
                            account-balance)))
 

Modified: gnucash/branches/swig-redo/src/report/report-system/report-utilities.scm
===================================================================
--- gnucash/branches/swig-redo/src/report/report-system/report-utilities.scm	2006-10-10 00:06:26 UTC (rev 14974)
+++ gnucash/branches/swig-redo/src/report/report-system/report-utilities.scm	2006-10-10 00:07:02 UTC (rev 14975)
@@ -52,40 +52,30 @@
 
 ;; True if the account is of type currency, stock, or mutual-fund
 (define (gnc:account-has-shares? account)
-  ;; FYI: The val->sym function used to be called 
-  ;; gw:enum-GNCAccountType-val->sym
-  (let ((type (gw:enum-<gnc:AccountType>-val->sym
-               (gnc:account-get-type account)
-               #f)))
-    (member type '(stock mutual-fund currency))))
+  (let ((type (gnc:account-get-type account)))
+    (member type (list ACCT-TYPE-STOCK ACCT-TYPE-MUTUAL ACCT-TYPE-CURRENCY))))
 
 ;; True if the account is of type stock or mutual-fund
 (define (gnc:account-is-stock? account)
-  (let ((type (gw:enum-<gnc:AccountType>-val->sym
-               (gnc:account-get-type account)
-               #f)))
-    (member type '(stock mutual-fund))))
+  (let ((type (gnc:account-get-type account)))
+    (member type (list ACCT-TYPE-STOCK ACCT-TYPE-MUTUAL))))
 
 ;; True if the account is of type income or expense
 
 (define (gnc:account-is-inc-exp? account)
-  (let ((type (gw:enum-<gnc:AccountType>-val->sym
-               (gnc:account-get-type account)
-               #f)))
-    (member type '(income expense))))
+  (let ((type (gnc:account-get-type account)))
+    (member type (list ACCT-TYPE-INCOME ACCT-TYPE-EXPENSE))))
 
 ;; Returns only those accounts out of the list <accounts> which have
 ;; one of the type identifiers in typelist.
 (define (gnc:filter-accountlist-type typelist accounts)
   (filter (lambda (a) 
-	    (member (gw:enum-<gnc:AccountType>-val->sym
-		     (gnc:account-get-type a) #f)
-		    typelist) )
+	    (member (gnc:account-get-type a) typelist))
 	  accounts))
 
 ;; Decompose a given list of accounts 'accounts' into an alist
 ;; according to their types. Each element of alist is a list, whose
-;; first element is the type-symbol, e.g. 'assets, and the rest (cdr)
+;; first element is the type, e.g. ACCT-TYPE-ASSET, and the rest (cdr)
 ;; of the element is the list of accounts which belong to that
 ;; category.
 (define (gnc:decompose-accountlist accounts)
@@ -93,13 +83,18 @@
 		    (car x)
 		    (gnc:filter-accountlist-type (cdr x) accounts)))
        (list
-	(cons 'asset
-	      '(asset bank cash checking savings money-market receivable
-		      stock mutual-fund currency))
-	(cons 'liability '(liability payable credit credit-line))
-	(cons 'equity '(equity))
-	(cons 'income '(income))
-	(cons 'expense '(expense)))))
+	(cons ACCT-TYPE-ASSET
+	      (list ACCT-TYPE-ASSET ACCT-TYPE-BANK ACCT-TYPE-CASH
+                    ACCT-TYPE-CHECKING ACCT-TYPE-SAVINGS
+                    ACCT-TYPE-MONEYMRKT ACCT-TYPE-RECEIVABLE
+                    ACCT-TYPE-STOCK ACCT-TYPE-MUTUAL
+                    ACCT-TYPE-CURRENCY))
+	(cons ACCT-TYPE-LIABILITY
+              (list ACCT-TYPE-LIABILITY ACCT-TYPE-PAYABLE ACCT-TYPE-CREDIT
+                    ACCT-TYPE-CREDITLINE))
+	(cons ACCT-TYPE-EQUITY (list ACCT-TYPE-EQUITY))
+	(cons ACCT-TYPE-INCOME (list ACCT-TYPE-INCOME))
+	(cons ACCT-TYPE-EXPENSE (list ACCT-TYPE-EXPENSE)))))
 
 ;; Returns the name of the account type as a string, and in its plural
 ;; form (as opposed to gnc:account-get-type-string which gives the
@@ -107,23 +102,23 @@
 (define (gnc:account-get-type-string-plural type)
   (assoc-ref
    (list 
-    (cons 'bank (_ "Bank"))
-    (cons 'cash (_ "Cash"))
-    (cons 'credit (_ "Credits"))
-    (cons 'asset (_ "Assets"))
-    (cons 'liability (_ "Liabilities"))
-    (cons 'stock (_ "Stocks"))
-    (cons 'mutual-fund (_ "Mutual Funds"))
-    (cons 'currency (_ "Currencies"))
-    (cons 'income (_ "Income"))
-    (cons 'expense (_ "Expenses"))
-    (cons 'equity (_ "Equities"))
-    (cons 'checking (_ "Checking"))
-    (cons 'savings (_ "Savings"))
-    (cons 'money-market (_ "Money Market"))
-    (cons 'receivable (_ "Accounts Receivable"))
-    (cons 'payable (_ "Accounts Payable"))
-    (cons 'credit-line (_ "Credit Lines")))
+    (cons ACCT-TYPE-BANK (_ "Bank"))
+    (cons ACCT-TYPE-CASH (_ "Cash"))
+    (cons ACCT-TYPE-CREDIT (_ "Credits"))
+    (cons ACCT-TYPE-ASSET (_ "Assets"))
+    (cons ACCT-TYPE-LIABILITY (_ "Liabilities"))
+    (cons ACCT-TYPE-STOCK (_ "Stocks"))
+    (cons ACCT-TYPE-MUTUAL (_ "Mutual Funds"))
+    (cons ACCT-TYPE-CURRENCY (_ "Currencies"))
+    (cons ACCT-TYPE-INCOME (_ "Income"))
+    (cons ACCT-TYPE-EXPENSE (_ "Expenses"))
+    (cons ACCT-TYPE-EQUITY (_ "Equities"))
+    (cons ACCT-TYPE-CHECKING (_ "Checking"))
+    (cons ACCT-TYPE-SAVINGS (_ "Savings"))
+    (cons ACCT-TYPE-MONEYMRKT (_ "Money Market"))
+    (cons ACCT-TYPE-RECEIVABLE (_ "Accounts Receivable"))
+    (cons ACCT-TYPE-PAYABLE (_ "Accounts Payable"))
+    (cons ACCT-TYPE-CREDITLINE (_ "Credit Lines")))
    type))
 
 ;; Get the list of all different commodities that are used within the
@@ -549,7 +544,7 @@
 (define (gnc:accounts-get-comm-total-profit accounts 
 					    get-balance-fn)
   (gnc:accounts-get-balance-helper
-   (gnc:filter-accountlist-type '(income expense) accounts)
+   (gnc:filter-accountlist-type (list ACCT-TYPE-INCOME ACCT-TYPE-EXPENSE) accounts)
    get-balance-fn
    (lambda(x) #t)))
 
@@ -559,7 +554,7 @@
 (define (gnc:accounts-get-comm-total-income accounts 
 					    get-balance-fn)
   (gnc:accounts-get-balance-helper
-   (gnc:filter-accountlist-type '(income) accounts)
+   (gnc:filter-accountlist-type (list ACCT-TYPE-INCOME) accounts)
    get-balance-fn
    (lambda(x) #t)))
 
@@ -569,7 +564,7 @@
 (define (gnc:accounts-get-comm-total-expense accounts 
                                              get-balance-fn)
   (gnc:accounts-get-balance-helper
-   (gnc:filter-accountlist-type '(expense) accounts)
+   (gnc:filter-accountlist-type (list ACCT-TYPE-EXPENSE) accounts)
    get-balance-fn
    (lambda(x) #t)))
 

Modified: gnucash/branches/swig-redo/src/report/standard-reports/account-piecharts.scm
===================================================================
--- gnucash/branches/swig-redo/src/report/standard-reports/account-piecharts.scm	2006-10-10 00:06:26 UTC (rev 14974)
+++ gnucash/branches/swig-redo/src/report/standard-reports/account-piecharts.scm	2006-10-10 00:07:02 UTC (rev 14975)
@@ -479,12 +479,15 @@
  (list 
   ;; reportname, account-types, do-intervals?, 
   ;; menu-reportname, menu-tip
-  (list reportname-income '(income) #t menuname-income menutip-income (lambda (x) #t))
-  (list reportname-expense '(expense) #t menuname-expense menutip-expense (lambda (x) #f))
-  (list reportname-assets 
-        '(asset bank cash checking savings money-market receivable
-                stock mutual-fund currency)
+  (list reportname-income (list ACCT-TYPE-INCOME) #t menuname-income menutip-income (lambda (x) #t))
+  (list reportname-expense (list ACCT-TYPE-EXPENSE) #t menuname-expense menutip-expense (lambda (x) #f))
+  (list reportname-assets
+        (list ACCT-TYPE-ASSET ACCT-TYPE-BANK ACCT-TYPE-CASH ACCT-TYPE-CHECKING
+              ACCT-TYPE-SAVINGS ACCT-TYPE-MONEYMRKT
+              ACCT-TYPE-RECEIVABLE ACCT-TYPE-STOCK ACCT-TYPE-MUTUAL
+              ACCT-TYPE-CURRENCY)
         #f menuname-assets menutip-assets (lambda (x) #f))
   (list reportname-liabilities 
-        '(liability payable credit credit-line)
+        (list ACCT-TYPE-LIABILITY ACCT-TYPE-PAYABLE ACCT-TYPE-CREDIT
+              ACCT-TYPE-CREDITLINE)
         #f menuname-liabilities menutip-liabilities (lambda (x) #t))))

Modified: gnucash/branches/swig-redo/src/report/standard-reports/account-summary.scm
===================================================================
--- gnucash/branches/swig-redo/src/report/standard-reports/account-summary.scm	2006-10-10 00:06:26 UTC (rev 14974)
+++ gnucash/branches/swig-redo/src/report/standard-reports/account-summary.scm	2006-10-10 00:07:02 UTC (rev 14975)
@@ -153,8 +153,11 @@
       opthelp-accounts
       (lambda ()
 	(gnc:filter-accountlist-type 
-	 '(bank cash credit asset liability stock mutual-fund currency
-		payable receivable equity income expense)
+         (list ACCT-TYPE-BANK ACCT-TYPE-CASH ACCT-TYPE-CREDIT
+               ACCT-TYPE-ASSET ACCT-TYPE-LIABILITY
+               ACCT-TYPE-STOCK ACCT-TYPE-MUTUAL ACCT-TYPE-CURRENCY
+               ACCT-TYPE-PAYABLE ACCT-TYPE-RECEIVABLE
+               ACCT-TYPE-EQUITY ACCT-TYPE-INCOME ACCT-TYPE-EXPENSE)
 	 (gnc:group-get-subaccounts (gnc-get-current-group))))
       #f #t))
     (gnc:options-add-account-levels!
@@ -376,11 +379,11 @@
 	  ;; accounts)...
 	  (split-up-accounts (gnc:decompose-accountlist accounts))
 	  (all-accounts
-	   (append (assoc-ref split-up-accounts 'income)
-		   (assoc-ref split-up-accounts 'expense)
-		   (assoc-ref split-up-accounts 'asset)
-		   (assoc-ref split-up-accounts 'liability)
-		   (assoc-ref split-up-accounts 'equity)
+	   (append (assoc-ref split-up-accounts ACCT-TYPE-INCOME)
+		   (assoc-ref split-up-accounts ACCT-TYPE-EXPENSE)
+		   (assoc-ref split-up-accounts ACCT-TYPE-ASSET)
+		   (assoc-ref split-up-accounts ACCT-TYPE-LIABILITY)
+		   (assoc-ref split-up-accounts ACCT-TYPE-EQUITY)
 		   ))
 	  ;; (all-accounts (map (lambda (X) (cadr X)) split-up-accounts))
 	  ;; ^ will not do what we want

Modified: gnucash/branches/swig-redo/src/report/standard-reports/advanced-portfolio.scm
===================================================================
--- gnucash/branches/swig-redo/src/report/standard-reports/advanced-portfolio.scm	2006-10-10 00:06:26 UTC (rev 14974)
+++ gnucash/branches/swig-redo/src/report/standard-reports/advanced-portfolio.scm	2006-10-10 00:07:02 UTC (rev 14975)
@@ -188,8 +188,7 @@
     (gnc:option-value (get-op section name)))
   
   (define (split-account-type? split type)
-    (eq? type 
-         (gw:enum-<gnc:AccountType>-val->sym (gnc:account-get-type (gnc:split-get-account split)) #f)))
+    (eq? type (gnc:account-get-type (gnc:split-get-account split))))
 
   (define (same-split? s1 s2)
     (string=? (gnc:split-get-guid s1) (gnc:split-get-guid s2)))
@@ -345,8 +344,10 @@
 			  ;; currency and a txn-value for later computation
 			  (cond
 			   ((and (not (same-account? current (gnc:split-get-account s))) 
-				 (not (or(split-account-type? s 'expense)
-					 (split-account-type? s 'income))))
+				 (not (or (split-account-type?
+                                           s ACCT-TYPE-EXPENSE)
+					  (split-account-type?
+                                           s ACCT-TYPE-INCOME))))
 
 			    ;;only change the commod-currency if price failed
 			    (if (not price) (set! commod-currency (gnc:account-get-commodity (gnc:split-get-account s))))
@@ -409,10 +410,10 @@
 				      'add commod-currency
 				      (gnc:numeric-neg (gnc:split-get-value s))))))))
 			 
-			   ((split-account-type? s 'expense)
+			   ((split-account-type? s ACCT-TYPE-EXPENSE)
 			     (brokeragecoll 'add commod-currency (gnc:split-get-value s)))
 			   
-			   ((split-account-type? s 'income)
+			   ((split-account-type? s ACCT-TYPE-INCOME)
 			     (dividendcoll 'add commod-currency (gnc:split-get-value s)))
 			   )
 			  )

Modified: gnucash/branches/swig-redo/src/report/standard-reports/average-balance.scm
===================================================================
--- gnucash/branches/swig-redo/src/report/standard-reports/average-balance.scm	2006-10-10 00:06:26 UTC (rev 14974)
+++ gnucash/branches/swig-redo/src/report/standard-reports/average-balance.scm	2006-10-10 00:07:02 UTC (rev 14975)
@@ -71,9 +71,12 @@
                  ;; otherwise get some accounts -- here as an
                  ;; example we get the asset and liability stuff
                  (gnc:filter-accountlist-type
-                  '(bank cash credit asset liability payable receivable) 
-                  ;; or: '(bank cash checking savings stock
-                  ;; mutual-fund money-market)
+                  (list ACCT-TYPE-BANK ACCT-TYPE-CASH ACCT-TYPE-CREDIT
+                        ACCT-TYPE-ASSET ACCT-TYPE-LIABILITY
+                        ACCT-TYPE-PAYABLE ACCT-TYPE-RECEIVABLE)
+                  ;; or: (list ACCT-TYPE-BANK ACCT-TYPE-CASH
+                  ;; ACCT-TYPE-CHECKING ACCT-TYPE-SAVINGS ACCT-TYPE-STOCK
+                  ;; ACCT-TYPE-MUTUAL ACCT-TYPE-MONEYMRKT)
                   (gnc:group-get-account-list (gnc-get-current-group)))))))
       #f #t))
 

Modified: gnucash/branches/swig-redo/src/report/standard-reports/balance-sheet.scm
===================================================================
--- gnucash/branches/swig-redo/src/report/standard-reports/balance-sheet.scm	2006-10-10 00:06:26 UTC (rev 14974)
+++ gnucash/branches/swig-redo/src/report/standard-reports/balance-sheet.scm	2006-10-10 00:07:02 UTC (rev 14975)
@@ -177,8 +177,11 @@
       opthelp-accounts
       (lambda ()
 	(gnc:filter-accountlist-type 
-	 '(bank cash credit asset liability stock mutual-fund currency
-		payable receivable equity income expense)
+         (list ACCT-TYPE-BANK ACCT-TYPE-CASH ACCT-TYPE-CREDIT
+               ACCT-TYPE-ASSET ACCT-TYPE-LIABILITY
+               ACCT-TYPE-STOCK ACCT-TYPE-MUTUAL ACCT-TYPE-CURRENCY
+               ACCT-TYPE-PAYABLE ACCT-TYPE-RECEIVABLE
+               ACCT-TYPE-EQUITY ACCT-TYPE-INCOME ACCT-TYPE-EXPENSE)
 	 (gnc:group-get-subaccounts (gnc-get-current-group))))
       #f #t))
     (gnc:options-add-account-levels!
@@ -337,14 +340,14 @@
          ;; decompose the account list
          (split-up-accounts (gnc:decompose-accountlist accounts))
          (asset-accounts
-	  (assoc-ref split-up-accounts 'asset))
+	  (assoc-ref split-up-accounts ACCT-TYPE-ASSET))
          (liability-accounts
-	  (assoc-ref split-up-accounts 'liability))
+	  (assoc-ref split-up-accounts ACCT-TYPE-LIABILITY))
+         (income-expense-accounts
+          (append (assoc-ref split-up-accounts ACCT-TYPE-INCOME)
+                  (assoc-ref split-up-accounts ACCT-TYPE-EXPENSE)))
          (equity-accounts
-          (assoc-ref split-up-accounts 'equity))
-         (income-expense-accounts
-          (append (assoc-ref split-up-accounts 'income)
-                  (assoc-ref split-up-accounts 'expense)))
+          (assoc-ref split-up-accounts ACCT-TYPE-EQUITY))
 	 
          (doc (gnc:make-html-document))
 	 ;; this can occasionally put extra (blank) columns in our

Modified: gnucash/branches/swig-redo/src/report/standard-reports/budget.scm
===================================================================
--- gnucash/branches/swig-redo/src/report/standard-reports/budget.scm	2006-10-10 00:06:26 UTC (rev 14974)
+++ gnucash/branches/swig-redo/src/report/standard-reports/budget.scm	2006-10-10 00:07:02 UTC (rev 14975)
@@ -90,7 +90,8 @@
      optname-accounts "a" 2
      (lambda ()
        (gnc:filter-accountlist-type
-        '(asset liability income expense)
+        (list ACCT-TYPE-ASSET ACCT-TYPE-LIABILITY ACCT-TYPE-INCOME
+                          ACCT-TYPE-EXPENSE)
         (gnc:group-get-subaccounts (gnc-get-current-group))))
      #f)
 

Modified: gnucash/branches/swig-redo/src/report/standard-reports/cash-flow.scm
===================================================================
--- gnucash/branches/swig-redo/src/report/standard-reports/cash-flow.scm	2006-10-10 00:06:26 UTC (rev 14974)
+++ gnucash/branches/swig-redo/src/report/standard-reports/cash-flow.scm	2006-10-10 00:07:02 UTC (rev 14975)
@@ -91,7 +91,8 @@
      optname-accounts "a" 2
      (lambda ()
        (gnc:filter-accountlist-type 
-        '(bank cash asset stock mutual-fund)
+        (ACCT-TYPE-BANK ACCT-TYPE-CASH ACCT-TYPE-ASSET
+                        ACCT-TYPE-STOCK ACCT-TYPE-MUTUAL)
         (gnc:group-get-subaccounts (gnc-get-current-group))))
      #f)
     

Modified: gnucash/branches/swig-redo/src/report/standard-reports/category-barchart.scm
===================================================================
--- gnucash/branches/swig-redo/src/report/standard-reports/category-barchart.scm	2006-10-10 00:06:26 UTC (rev 14974)
+++ gnucash/branches/swig-redo/src/report/standard-reports/category-barchart.scm	2006-10-10 00:07:02 UTC (rev 14975)
@@ -554,12 +554,15 @@
  (list 
   ;; reportname, account-types, do-intervals?, 
   ;; menu-reportname, menu-tip
-  (list reportname-income '(income) #t menuname-income menutip-income (lambda (x) #t))
-  (list reportname-expense '(expense) #t menuname-expense menutip-expense (lambda (x) #f))
+  (list reportname-income (list ACCT-TYPE-INCOME) #t menuname-income menutip-income (lambda (x) #t))
+  (list reportname-expense (list ACCT-TYPE-EXPENSE) #t menuname-expense menutip-expense (lambda (x) #f))
   (list reportname-assets 
-        '(asset bank cash checking savings money-market receivable
-                stock mutual-fund currency)
+        (list ACCT-TYPE-ASSET ACCT-TYPE-BANK ACCT-TYPE-CASH ACCT-TYPE-CHECKING
+              ACCT-TYPE-SAVINGS ACCT-TYPE-MONEYMRKT
+              ACCT-TYPE-RECEIVABLE ACCT-TYPE-STOCK ACCT-TYPE-MUTUAL
+              ACCT-TYPE-CURRENCY)
         #f menuname-assets menutip-assets (lambda (x) #f))
   (list reportname-liabilities 
-        '(liability payable credit credit-line)
+        (list ACCT-TYPE-LIABILITY ACCT-TYPE-PAYABLE ACCT-TYPE-CREDIT
+              ACCT-TYPE-CREDITLINE)
         #f menuname-liabilities menutip-liabilities (lambda (x) #t))))

Modified: gnucash/branches/swig-redo/src/report/standard-reports/daily-reports.scm
===================================================================
--- gnucash/branches/swig-redo/src/report/standard-reports/daily-reports.scm	2006-10-10 00:06:26 UTC (rev 14974)
+++ gnucash/branches/swig-redo/src/report/standard-reports/daily-reports.scm	2006-10-10 00:07:02 UTC (rev 14975)
@@ -531,5 +531,5 @@
 
  (list 
   ;; reportname, account-types, menu-reportname, menu-tip
-  (list reportname-income '(income) menuname-income menutip-income)
-  (list reportname-expense '(expense) menuname-expense menutip-expense)))
+  (list reportname-income (list ACCT-TYPE-INCOME) menuname-income menutip-income)
+  (list reportname-expense (list ACCT-TYPE-EXPENSE) menuname-expense menutip-expense)))

Modified: gnucash/branches/swig-redo/src/report/standard-reports/equity-statement.scm
===================================================================
--- gnucash/branches/swig-redo/src/report/standard-reports/equity-statement.scm	2006-10-10 00:06:26 UTC (rev 14974)
+++ gnucash/branches/swig-redo/src/report/standard-reports/equity-statement.scm	2006-10-10 00:07:02 UTC (rev 14975)
@@ -129,9 +129,12 @@
       opthelp-accounts
       (lambda ()
 	(gnc:filter-accountlist-type 
-	 '(bank cash credit asset liability stock mutual-fund currency
-		payable receivable equity income expense)
-	 (gnc:group-get-subaccounts (gnc-get-current-group))))
+         (list ACCT-TYPE-BANK ACCT-TYPE-CASH ACCT-TYPE-CREDIT
+               ACCT-TYPE-ASSET ACCT-TYPE-LIABILITY
+               ACCT-TYPE-STOCK ACCT-TYPE-MUTUAL ACCT-TYPE-CURRENCY
+               ACCT-TYPE-PAYABLE ACCT-TYPE-RECEIVABLE
+               ACCT-TYPE-EQUITY ACCT-TYPE-INCOME ACCT-TYPE-EXPENSE)
+         (gnc:group-get-subaccounts (gnc-get-current-group))))
       #f #t))
     
     ;; all about currencies
@@ -237,14 +240,15 @@
          ;; decompose the account list
          (split-up-accounts (gnc:decompose-accountlist accounts))
          (asset-accounts
-          (assoc-ref split-up-accounts 'asset))
+          (assoc-ref split-up-accounts ACCT-TYPE-ASSET))
          (liability-accounts
-          (assoc-ref split-up-accounts 'liability))
+          (assoc-ref split-up-accounts ACCT-TYPE-LIABILITY))
          (income-expense-accounts
-          (append (assoc-ref split-up-accounts 'income)
-                  (assoc-ref split-up-accounts 'expense)))
+          (append (assoc-ref split-up-accounts ACCT-TYPE-INCOME)
+                  (assoc-ref split-up-accounts ACCT-TYPE-EXPENSE)))
          (equity-accounts
-          (assoc-ref split-up-accounts 'equity))
+          (assoc-ref split-up-accounts ACCT-TYPE-EQUITY))
+
 	 ;; N.B.: equity-accounts will also contain drawing accounts
 	 ;; these must still be split-out and itemized separately
 	 (capital-accounts #f)

Modified: gnucash/branches/swig-redo/src/report/standard-reports/income-statement.scm
===================================================================
--- gnucash/branches/swig-redo/src/report/standard-reports/income-statement.scm	2006-10-10 00:06:26 UTC (rev 14974)
+++ gnucash/branches/swig-redo/src/report/standard-reports/income-statement.scm	2006-10-10 00:07:02 UTC (rev 14975)
@@ -157,7 +157,7 @@
       (lambda ()
 	(gnc:filter-accountlist-type
 	 ;; select, by default, only income and expense accounts
-	 '(income expense)
+	 (list ACCT-TYPE-INCOME ACCT-TYPE-EXPENSE)
 	 (gnc:group-get-subaccounts (gnc-get-current-group))))
       #f #t))
     (gnc:options-add-account-levels!
@@ -334,11 +334,11 @@
 	 
          ;; decompose the account list
          (split-up-accounts (gnc:decompose-accountlist accounts))
-	 (revenue-accounts (assoc-ref split-up-accounts 'income))
-	 (expense-accounts (assoc-ref split-up-accounts 'expense))
+	 (revenue-accounts (assoc-ref split-up-accounts ACCT-TYPE-INCOME))
+	 (expense-accounts (assoc-ref split-up-accounts ACCT-TYPE-EXPENSE))
          (income-expense-accounts
-          (append (assoc-ref split-up-accounts 'income)
-                  (assoc-ref split-up-accounts 'expense)))
+          (append (assoc-ref split-up-accounts ACCT-TYPE-INCOME)
+                  (assoc-ref split-up-accounts ACCT-TYPE-EXPENSE)))
 	 
          (doc (gnc:make-html-document))
 	 ;; this can occasionally put extra (blank) columns in our

Modified: gnucash/branches/swig-redo/src/report/standard-reports/net-barchart.scm
===================================================================
--- gnucash/branches/swig-redo/src/report/standard-reports/net-barchart.scm	2006-10-10 00:06:26 UTC (rev 14974)
+++ gnucash/branches/swig-redo/src/report/standard-reports/net-barchart.scm	2006-10-10 00:07:02 UTC (rev 14975)
@@ -255,14 +255,14 @@
              (process-datelist
               (if inc-exp? 
                   accounts
-                  (assoc-ref classified-accounts 'asset))
+                  (assoc-ref classified-accounts ACCT-TYPE-ASSET))
               dates-list #t))
        (gnc:report-percent-done 70)
        (set! liability-list
              (process-datelist
               (if inc-exp?
                   accounts
-                  (assoc-ref classified-accounts 'liability))
+                  (assoc-ref classified-accounts ACCT-TYPE-LIABILITY))
               dates-list #f))
        (gnc:report-percent-done 80)
        (set! net-list

Modified: gnucash/branches/swig-redo/src/report/standard-reports/standard-reports.scm
===================================================================
--- gnucash/branches/swig-redo/src/report/standard-reports/standard-reports.scm	2006-10-10 00:06:26 UTC (rev 14974)
+++ gnucash/branches/swig-redo/src/report/standard-reports/standard-reports.scm	2006-10-10 00:07:02 UTC (rev 14975)
@@ -91,8 +91,7 @@
 
 (define (gnc:register-report-create account split query journal? double?
 				    title debit-string credit-string)
-  (let* ((acct-type-code (gnc:account-get-type account))
-	 (acct-type (gw:enum-<gnc:AccountType>-val->sym acct-type-code #f))
+  (let* ((acct-type (gnc:account-get-type account))
 	 (create-fcn (lookup-register-report acct-type split)))
     (gnc:debug "create-fcn: " create-fcn)
     (if create-fcn

Modified: gnucash/branches/swig-redo/src/report/standard-reports/transaction.scm
===================================================================
--- gnucash/branches/swig-redo/src/report/standard-reports/transaction.scm	2006-10-10 00:06:26 UTC (rev 14974)
+++ gnucash/branches/swig-redo/src/report/standard-reports/transaction.scm	2006-10-10 00:07:02 UTC (rev 14975)
@@ -277,8 +277,11 @@
 
 (define account-types-to-reverse-assoc-list
   (list (cons 'none '())
-        (cons 'income-expense '(income expense))
-        (cons 'credit-accounts '(liability payable equity credit income))))
+        (cons 'income-expense
+              (list ACCT-TYPE-INCOME ACCT-TYPE-EXPENSE))
+        (cons 'credit-accounts
+              (list ACCT-TYPE-LIABILITY ACCT-TYPE-PAYABLE ACCT-TYPE-EQUITY
+                    ACCT-TYPE-CREDIT ACCT-TYPE-INCOME))))
 
 (define (used-date columns-used)
   (vector-ref columns-used 0))
@@ -414,8 +417,7 @@
 	 (dummy  (gnc:debug "split is originally" split))
          (parent (gnc:split-get-parent split))
          (account (gnc:split-get-account split))
-         (account-type (gw:enum-<gnc:AccountType>-val->sym
-                        (gnc:account-get-type account) #f))
+         (account-type (gnc:account-get-type account))
          (currency (if account
                        (gnc:account-get-commodity account)
                        (gnc-default-currency)))
@@ -570,8 +572,11 @@
     ;; select, by default, all accounts...
     (lambda ()
       (gnc:filter-accountlist-type 
-       '(bank cash credit asset liability stock mutual-fund currency
-	      payable receivable equity income expense)
+       (list ACCT-TYPE-BANK ACCT-TYPE-CASH ACCT-TYPE-CREDIT
+             ACCT-TYPE-ASSET ACCT-TYPE-LIABILITY
+             ACCT-TYPE-STOCK ACCT-TYPE-MUTUAL ACCT-TYPE-CURRENCY
+             ACCT-TYPE-PAYABLE ACCT-TYPE-RECEIVABLE
+             ACCT-TYPE-EQUITY ACCT-TYPE-INCOME ACCT-TYPE-EXPENSE)
        (gnc:group-get-subaccounts (gnc-get-current-group))))
     #f #t))
 

Modified: gnucash/branches/swig-redo/src/report/standard-reports/trial-balance.scm
===================================================================
--- gnucash/branches/swig-redo/src/report/standard-reports/trial-balance.scm	2006-10-10 00:06:26 UTC (rev 14974)
+++ gnucash/branches/swig-redo/src/report/standard-reports/trial-balance.scm	2006-10-10 00:07:02 UTC (rev 14975)
@@ -180,8 +180,11 @@
       opthelp-accounts
       (lambda ()
 	(gnc:filter-accountlist-type 
-	 '(bank cash credit asset liability stock mutual-fund currency
-		payable receivable equity income expense)
+         (list ACCT-TYPE-BANK ACCT-TYPE-CASH ACCT-TYPE-CREDIT
+               ACCT-TYPE-ASSET ACCT-TYPE-LIABILITY
+               ACCT-TYPE-STOCK ACCT-TYPE-MUTUAL ACCT-TYPE-CURRENCY
+               ACCT-TYPE-PAYABLE ACCT-TYPE-RECEIVABLE
+               ACCT-TYPE-EQUITY ACCT-TYPE-INCOME ACCT-TYPE-EXPENSE)
 	 (gnc:group-get-subaccounts (gnc-get-current-group))))
       #f #t))
     (gnc:options-add-account-levels!
@@ -343,14 +346,15 @@
          ;; decompose the account list
          (split-up-accounts (gnc:decompose-accountlist accounts))
          (asset-accounts
-	  (assoc-ref split-up-accounts 'asset))
+          (assoc-ref split-up-accounts ACCT-TYPE-ASSET))
          (liability-accounts
-	  (assoc-ref split-up-accounts 'liability))
+          (assoc-ref split-up-accounts ACCT-TYPE-LIABILITY))
+         (income-expense-accounts
+          (append (assoc-ref split-up-accounts ACCT-TYPE-INCOME)
+                  (assoc-ref split-up-accounts ACCT-TYPE-EXPENSE)))
          (equity-accounts
-          (assoc-ref split-up-accounts 'equity))
-         (income-expense-accounts
-          (append (assoc-ref split-up-accounts 'income)
-                  (assoc-ref split-up-accounts 'expense)))
+          (assoc-ref split-up-accounts ACCT-TYPE-EQUITY))
+
 	 ;; (all-accounts (map (lambda (X) (cadr X)) split-up-accounts))
 	 ;; ^ will not do what we want
 	 (all-accounts
@@ -360,20 +364,20 @@
 	 ;; same for gross adjustment accounts...
 	 (split-up-ga-accounts (gnc:decompose-accountlist ga-accounts))
 	 (all-ga-accounts
-          (append (assoc-ref split-up-ga-accounts 'asset)
-                  (assoc-ref split-up-ga-accounts 'liability)
-                  (assoc-ref split-up-ga-accounts 'equity)
-                  (assoc-ref split-up-ga-accounts 'income)
-                  (assoc-ref split-up-ga-accounts 'expense)))
+          (append (assoc-ref split-up-ga-accounts ACCT-TYPE-ASSET)
+                  (assoc-ref split-up-ga-accounts ACCT-TYPE-LIABILITY)
+                  (assoc-ref split-up-ga-accounts ACCT-TYPE-EQUITY)
+                  (assoc-ref split-up-ga-accounts ACCT-TYPE-INCOME)
+                  (assoc-ref split-up-ga-accounts ACCT-TYPE-EXPENSE)))
 	 (split-up-is-accounts (gnc:decompose-accountlist is-accounts))
 	 
 	 ;; same for income statement accounts...
 	 (all-is-accounts
-          (append (assoc-ref split-up-is-accounts 'asset)
-                  (assoc-ref split-up-is-accounts 'liability)
-                  (assoc-ref split-up-is-accounts 'equity)
-                  (assoc-ref split-up-is-accounts 'income)
-                  (assoc-ref split-up-is-accounts 'expense)))
+          (append (assoc-ref split-up-is-accounts ACCT-TYPE-ASSET)
+                  (assoc-ref split-up-is-accounts ACCT-TYPE-LIABILITY)
+                  (assoc-ref split-up-is-accounts ACCT-TYPE-EQUITY)
+                  (assoc-ref split-up-is-accounts ACCT-TYPE-INCOME)
+                  (assoc-ref split-up-is-accounts ACCT-TYPE-EXPENSE)))
 	 
 	 (doc (gnc:make-html-document))
          ;; exchange rates calculation parameters



More information about the gnucash-changes mailing list