r14599 - gnucash/trunk - Regularize the account type names into the form ACCT_TYPE_xxx.
David Hampton
hampton at cvs.gnucash.org
Sun Aug 6 18:07:15 EDT 2006
Author: hampton
Date: 2006-08-06 18:07:12 -0400 (Sun, 06 Aug 2006)
New Revision: 14599
Trac: http://svn.gnucash.org/trac/changeset/14599
Modified:
gnucash/trunk/ChangeLog
gnucash/trunk/src/app-utils/gnc-ui-util.c
gnucash/trunk/src/app-utils/guile-util.c
gnucash/trunk/src/app-utils/prefs.scm
gnucash/trunk/src/backend/file/gnc-account-xml-v2.c
gnucash/trunk/src/backend/file/io-gncbin-r.c
gnucash/trunk/src/business/business-gnome/business-gnome-utils.c
gnucash/trunk/src/business/business-gnome/dialog-employee.c
gnucash/trunk/src/business/business-gnome/dialog-payment.c
gnucash/trunk/src/business/business-gnome/gnc-plugin-business.c
gnucash/trunk/src/business/business-ledger/gncEntryLedgerLoad.c
gnucash/trunk/src/engine/Account.c
gnucash/trunk/src/engine/Account.h
gnucash/trunk/src/engine/AccountP.h
gnucash/trunk/src/engine/Period.c
gnucash/trunk/src/engine/Period.h
gnucash/trunk/src/engine/SchedXaction.c
gnucash/trunk/src/engine/Scrub.c
gnucash/trunk/src/engine/cap-gains.c
gnucash/trunk/src/engine/gnc-associate-account.c
gnucash/trunk/src/engine/gw-engine-spec.scm
gnucash/trunk/src/engine/test-core/test-engine-stuff.c
gnucash/trunk/src/gnome-utils/dialog-account.c
gnucash/trunk/src/gnome-utils/dialog-transfer.c
gnucash/trunk/src/gnome-utils/gnc-tree-model-account-types.c
gnucash/trunk/src/gnome-utils/gnc-tree-model-account-types.h
gnucash/trunk/src/gnome-utils/gnc-tree-view-account.c
gnucash/trunk/src/gnome-utils/window-main-summarybar.c
gnucash/trunk/src/gnome/dialog-chart-export.c
gnucash/trunk/src/gnome/dialog-tax-info.c
gnucash/trunk/src/gnome/druid-hierarchy.c
gnucash/trunk/src/gnome/druid-loan.c
gnucash/trunk/src/gnome/druid-stock-split.c
gnucash/trunk/src/gnome/window-reconcile.c
gnucash/trunk/src/import-export/hbci/druid-hbci-initial.c
gnucash/trunk/src/import-export/import-account-matcher.c
gnucash/trunk/src/import-export/import-account-matcher.h
gnucash/trunk/src/import-export/import-main-matcher.c
gnucash/trunk/src/import-export/mt940/gnc-mt940-import.c
gnucash/trunk/src/import-export/ofx/gnc-ofx-import.c
gnucash/trunk/src/import-export/qif/qif-parse.c
gnucash/trunk/src/register/ledger-core/gnc-ledger-display.c
gnucash/trunk/src/register/ledger-core/split-register-model.c
gnucash/trunk/src/register/ledger-core/split-register.c
Log:
Regularize the account type names into the form ACCT_TYPE_xxx.
Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/ChangeLog 2006-08-06 22:07:12 UTC (rev 14599)
@@ -1,3 +1,8 @@
+2006-08-06 David Hampton <hampton at employees.org>
+
+ * various: Regularize the account type names into the form
+ ACCT_TYPE_xxx.
+
2006-08-05 David Hampton <hampton at employees.org>
* import-backend.c: gnc_import_process_trans_item() should return
Modified: gnucash/trunk/src/app-utils/gnc-ui-util.c
===================================================================
--- gnucash/trunk/src/app-utils/gnc-ui-util.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/app-utils/gnc-ui-util.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -117,18 +117,18 @@
}
else if (safe_strcmp (choice, "income_expense") == 0)
{
- reverse_type[INCOME] = TRUE;
- reverse_type[EXPENSE] = TRUE;
+ reverse_type[ACCT_TYPE_INCOME] = TRUE;
+ reverse_type[ACCT_TYPE_EXPENSE] = TRUE;
}
else
{
if (safe_strcmp (choice, "credit") != 0)
PERR("bad value '%s'", choice);
- reverse_type[LIABILITY] = TRUE;
- reverse_type[PAYABLE] = TRUE;
- reverse_type[EQUITY] = TRUE;
- reverse_type[INCOME] = TRUE;
- reverse_type[CREDIT] = TRUE;
+ reverse_type[ACCT_TYPE_LIABILITY] = TRUE;
+ reverse_type[ACCT_TYPE_PAYABLE] = TRUE;
+ reverse_type[ACCT_TYPE_EQUITY] = TRUE;
+ reverse_type[ACCT_TYPE_INCOME] = TRUE;
+ reverse_type[ACCT_TYPE_CREDIT] = TRUE;
}
if (choice != NULL)
@@ -450,14 +450,14 @@
return NULL;
atype = xaccAccountGetType (account);
- if (atype != INCOME && atype != EXPENSE)
+ if (atype != ACCT_TYPE_INCOME && atype != ACCT_TYPE_EXPENSE)
return NULL;
code = xaccAccountGetTaxUSCode (account);
if (!code)
return NULL;
- category = scm_c_eval_string (atype == INCOME ?
+ category = scm_c_eval_string (atype == ACCT_TYPE_INCOME ?
"txf-income-categories" :
"txf-expense-categories");
@@ -592,7 +592,7 @@
base_name = equity_base_name (equity_type);
account = xaccGetAccountFromName (group, base_name);
- if (account && xaccAccountGetType (account) != EQUITY)
+ if (account && xaccAccountGetType (account) != ACCT_TYPE_EQUITY)
account = NULL;
if (!account)
@@ -600,7 +600,7 @@
base_name = base_name && *base_name ? _(base_name) : "";
account = xaccGetAccountFromName (group, base_name);
- if (account && xaccAccountGetType (account) != EQUITY)
+ if (account && xaccAccountGetType (account) != ACCT_TYPE_EQUITY)
account = NULL;
}
@@ -613,7 +613,7 @@
name = g_strconcat (base_name, " - ",
gnc_commodity_get_mnemonic (currency), NULL);
account = xaccGetAccountFromName (group, name);
- if (account && xaccAccountGetType (account) != EQUITY)
+ if (account && xaccAccountGetType (account) != ACCT_TYPE_EQUITY)
account = NULL;
name_exists = (account != NULL);
@@ -638,7 +638,7 @@
}
parent = xaccGetAccountFromName (group, _("Equity"));
- if (parent && xaccAccountGetType (parent) != EQUITY)
+ if (parent && xaccAccountGetType (parent) != ACCT_TYPE_EQUITY)
parent = NULL;
account = xaccMallocAccount (book);
@@ -646,7 +646,7 @@
xaccAccountBeginEdit (account);
xaccAccountSetName (account, name);
- xaccAccountSetType (account, EQUITY);
+ xaccAccountSetType (account, ACCT_TYPE_EQUITY);
xaccAccountSetCommodity (account, currency);
if (parent)
Modified: gnucash/trunk/src/app-utils/guile-util.c
===================================================================
--- gnucash/trunk/src/app-utils/guile-util.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/app-utils/guile-util.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -1098,8 +1098,8 @@
if (gnc_gconf_get_bool(GCONF_GENERAL, KEY_ACCOUNTING_LABELS, NULL))
return g_strdup(_("Debit"));
- if ((account_type < NO_TYPE) || (account_type >= NUM_ACCOUNT_TYPES))
- account_type = NO_TYPE;
+ if ((account_type < ACCT_TYPE_NONE) || (account_type >= NUM_ACCOUNT_TYPES))
+ account_type = ACCT_TYPE_NONE;
type_string = xaccAccountTypeEnumAsString(account_type);
@@ -1136,8 +1136,8 @@
if (gnc_gconf_get_bool(GCONF_GENERAL, KEY_ACCOUNTING_LABELS, NULL))
return g_strdup(_("Credit"));
- if ((account_type < NO_TYPE) || (account_type >= NUM_ACCOUNT_TYPES))
- account_type = NO_TYPE;
+ if ((account_type < ACCT_TYPE_NONE) || (account_type >= NUM_ACCOUNT_TYPES))
+ account_type = ACCT_TYPE_NONE;
type_string = xaccAccountTypeEnumAsString(account_type);
Modified: gnucash/trunk/src/app-utils/prefs.scm
===================================================================
--- gnucash/trunk/src/app-utils/prefs.scm 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/app-utils/prefs.scm 2006-08-06 22:07:12 UTC (rev 14599)
@@ -64,36 +64,36 @@
;;;;;; Create config vars
(define gnc:*debit-strings*
- (list (cons 'NO_TYPE (N_ "Funds In"))
- (cons 'BANK (N_ "Deposit"))
- (cons 'CASH (N_ "Receive"))
- (cons 'CREDIT (N_ "Payment"))
- (cons 'ASSET (N_ "Increase"))
- (cons 'LIABILITY (N_ "Decrease"))
- (cons 'STOCK (N_ "Buy"))
- (cons 'MUTUAL (N_ "Buy"))
- (cons 'CURRENCY (N_ "Buy"))
- (cons 'INCOME (N_ "Charge"))
- (cons 'EXPENSE (N_ "Expense"))
- (cons 'PAYABLE (N_ "Payment"))
- (cons 'RECEIVABLE (N_ "Invoice"))
- (cons '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 'NO_TYPE (N_ "Funds Out"))
- (cons 'BANK (N_ "Withdrawal"))
- (cons 'CASH (N_ "Spend"))
- (cons 'CREDIT (N_ "Charge"))
- (cons 'ASSET (N_ "Decrease"))
- (cons 'LIABILITY (N_ "Increase"))
- (cons 'STOCK (N_ "Sell"))
- (cons 'MUTUAL (N_ "Sell"))
- (cons 'CURRENCY (N_ "Sell"))
- (cons 'INCOME (N_ "Income"))
- (cons 'EXPENSE (N_ "Rebate"))
- (cons 'PAYABLE (N_ "Bill"))
- (cons 'RECEIVABLE (N_ "Payment"))
- (cons '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/trunk/src/backend/file/gnc-account-xml-v2.c
===================================================================
--- gnucash/trunk/src/backend/file/gnc-account-xml-v2.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/backend/file/gnc-account-xml-v2.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -129,7 +129,8 @@
com = xaccAccountGetCommodity(act);
if (com &&
- (!gnc_commodity_is_iso(com) || xaccAccountGetType(act) == CURRENCY) &&
+ (!gnc_commodity_is_iso(com) ||
+ xaccAccountGetType(act) == ACCT_TYPE_CURRENCY) &&
gnc_commodity_get_quote_flag(com)) {
if (!kvpnode)
kvpnode= xmlNewNode(NULL, BAD_CAST act_slots_string);
Modified: gnucash/trunk/src/backend/file/io-gncbin-r.c
===================================================================
--- gnucash/trunk/src/backend/file/io-gncbin-r.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/backend/file/io-gncbin-r.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -675,21 +675,21 @@
err = read( fd, &(ff_acctype), sizeof(char) );
if( err != sizeof(char) ) { return NULL; }
switch (ff_acctype) {
- case FF_BANK: { acctype = BANK; break; }
- case FF_CASH: { acctype = CASH; break; }
- case FF_ASSET: { acctype = ASSET; break; }
- case FF_CREDIT: { acctype = CREDIT; break; }
- case FF_LIABILITY: { acctype = LIABILITY; break; }
- case FF_STOCK: { acctype = STOCK; break; }
- case FF_MUTUAL: { acctype = MUTUAL; break; }
- case FF_INCOME: { acctype = INCOME; break; }
- case FF_EXPENSE: { acctype = EXPENSE; break; }
- case FF_EQUITY: { acctype = EQUITY; break; }
- case FF_CHECKING: { acctype = CHECKING; break; }
- case FF_SAVINGS: { acctype = SAVINGS; break; }
- case FF_MONEYMRKT: { acctype = MONEYMRKT; break; }
- case FF_CREDITLINE: { acctype = CREDITLINE; break; }
- case FF_CURRENCY: { acctype = CURRENCY; break; }
+ case FF_BANK: { acctype = ACCT_TYPE_BANK; break; }
+ case FF_CASH: { acctype = ACCT_TYPE_CASH; break; }
+ case FF_ASSET: { acctype = ACCT_TYPE_ASSET; break; }
+ case FF_CREDIT: { acctype = ACCT_TYPE_CREDIT; break; }
+ case FF_LIABILITY: { acctype = ACCT_TYPE_LIABILITY; break; }
+ case FF_STOCK: { acctype = ACCT_TYPE_STOCK; break; }
+ case FF_MUTUAL: { acctype = ACCT_TYPE_MUTUAL; break; }
+ case FF_INCOME: { acctype = ACCT_TYPE_INCOME; break; }
+ case FF_EXPENSE: { acctype = ACCT_TYPE_EXPENSE; break; }
+ case FF_EQUITY: { acctype = ACCT_TYPE_EQUITY; break; }
+ case FF_CHECKING: { acctype = ACCT_TYPE_CHECKING; break; }
+ case FF_SAVINGS: { acctype = ACCT_TYPE_SAVINGS; break; }
+ case FF_MONEYMRKT: { acctype = ACCT_TYPE_MONEYMRKT; break; }
+ case FF_CREDITLINE: { acctype = ACCT_TYPE_CREDITLINE; break; }
+ case FF_CURRENCY: { acctype = ACCT_TYPE_CURRENCY; break; }
default: return NULL;
}
xaccAccountSetType (acc, acctype);
@@ -872,7 +872,7 @@
if(!acc) return(FALSE);
acc_type = xaccAccountGetType(acc);
- if ((acc_type == STOCK) || (acc_type == MUTUAL)) {
+ if ((acc_type == ACCT_TYPE_STOCK) || (acc_type == ACCT_TYPE_MUTUAL)) {
const char *tmp = readString( fd, token );
if(NULL == tmp) return(FALSE);
if(strlen(tmp) > 0) dxaccAccountSetPriceSrc(acc, tmp);
Modified: gnucash/trunk/src/business/business-gnome/business-gnome-utils.c
===================================================================
--- gnucash/trunk/src/business/business-gnome/business-gnome-utils.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/business/business-gnome/business-gnome-utils.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -357,13 +357,13 @@
switch (gncOwnerGetType (owner)) {
case GNC_OWNER_CUSTOMER:
- return (g_list_prepend (NULL, (gpointer)RECEIVABLE));
+ return (g_list_prepend (NULL, (gpointer)ACCT_TYPE_RECEIVABLE));
case GNC_OWNER_VENDOR:
case GNC_OWNER_EMPLOYEE:
- return (g_list_prepend (NULL, (gpointer)PAYABLE));
+ return (g_list_prepend (NULL, (gpointer)ACCT_TYPE_PAYABLE));
break;
default:
- return (g_list_prepend (NULL, (gpointer)NO_TYPE));
+ return (g_list_prepend (NULL, (gpointer)ACCT_TYPE_NONE));
}
}
Modified: gnucash/trunk/src/business/business-gnome/dialog-employee.c
===================================================================
--- gnucash/trunk/src/business/business-gnome/dialog-employee.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/business/business-gnome/dialog-employee.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -473,7 +473,7 @@
ew->ccard_acct_check = glade_xml_get_widget (xml, "ccard_check");
edit = gnc_account_sel_new();
- acct_types = g_list_prepend(NULL, (gpointer)CREDIT);
+ acct_types = g_list_prepend(NULL, (gpointer)ACCT_TYPE_CREDIT);
gnc_account_sel_set_acct_filters (GNC_ACCOUNT_SEL(edit), acct_types);
g_list_free (acct_types);
Modified: gnucash/trunk/src/business/business-gnome/dialog-payment.c
===================================================================
--- gnucash/trunk/src/business/business-gnome/dialog-payment.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/business/business-gnome/dialog-payment.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -320,11 +320,11 @@
for (i = 0; i < NUM_ACCOUNT_TYPES; i++)
switch (i) {
- case BANK:
- case CASH:
- case CREDIT:
- case ASSET:
- case LIABILITY:
+ case ACCT_TYPE_BANK:
+ case ACCT_TYPE_CASH:
+ case ACCT_TYPE_CREDIT:
+ case ACCT_TYPE_ASSET:
+ case ACCT_TYPE_LIABILITY:
avi.include_type[i] = TRUE;
break;
default:
Modified: gnucash/trunk/src/business/business-gnome/gnc-plugin-business.c
===================================================================
--- gnucash/trunk/src/business/business-gnome/gnc-plugin-business.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/business/business-gnome/gnc-plugin-business.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -922,25 +922,25 @@
gncOwnerInitJob(owner, job);
// Create the A/R account
- xaccAccountSetType(ar_acct, RECEIVABLE);
+ xaccAccountSetType(ar_acct, ACCT_TYPE_RECEIVABLE);
xaccAccountSetName(ar_acct, "A/R");
xaccAccountSetCommodity(ar_acct, gnc_default_currency());
xaccGroupInsertAccount(group, ar_acct);
// Create the Income account
- xaccAccountSetType(inc_acct, INCOME);
+ xaccAccountSetType(inc_acct, ACCT_TYPE_INCOME);
xaccAccountSetName(inc_acct, "Income");
xaccAccountSetCommodity(inc_acct, gnc_default_currency());
xaccGroupInsertAccount(group, inc_acct);
// Create the Bank account
- xaccAccountSetType(bank_acct, BANK);
+ xaccAccountSetType(bank_acct, ACCT_TYPE_BANK);
xaccAccountSetName(bank_acct, "Bank");
xaccAccountSetCommodity(bank_acct, gnc_default_currency());
xaccGroupInsertAccount(group, bank_acct);
// Create the Tax account
- xaccAccountSetType(tax_acct, LIABILITY);
+ xaccAccountSetType(tax_acct, ACCT_TYPE_LIABILITY);
xaccAccountSetName(tax_acct, "Tax-Holding");
xaccAccountSetCommodity(tax_acct, gnc_default_currency());
xaccGroupInsertAccount(group, tax_acct);
Modified: gnucash/trunk/src/business/business-ledger/gncEntryLedgerLoad.c
===================================================================
--- gnucash/trunk/src/business/business-ledger/gncEntryLedgerLoad.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/business/business-ledger/gncEntryLedgerLoad.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -132,14 +132,15 @@
/* Don't add A/R, A/P, Bank, Cash, or Equity accounts */
type = xaccAccountGetType (account);
- if (type == PAYABLE || type == RECEIVABLE ||
- type == CASH || type == BANK || type == EQUITY)
+ if (type == ACCT_TYPE_PAYABLE || type == ACCT_TYPE_RECEIVABLE ||
+ type == ACCT_TYPE_CASH || type == ACCT_TYPE_BANK ||
+ type == ACCT_TYPE_EQUITY)
{
return TRUE;
}
/* If this is an ORDER or INVOICE, then leave out the expenses. */
- if (type == EXPENSE) return TRUE;
+ if (type == ACCT_TYPE_EXPENSE) return TRUE;
/* Don't add placeholder accounts */
if (xaccAccountGetPlaceholder (account)) return TRUE;
@@ -154,14 +155,15 @@
/* Don't add A/R, A/P, Bank, Cash, or Equity accounts */
type = xaccAccountGetType (account);
- if (type == PAYABLE || type == RECEIVABLE ||
- type == CASH || type == BANK || type == EQUITY)
+ if (type == ACCT_TYPE_PAYABLE || type == ACCT_TYPE_RECEIVABLE ||
+ type == ACCT_TYPE_CASH || type == ACCT_TYPE_BANK ||
+ type == ACCT_TYPE_EQUITY)
{
return TRUE;
}
/* If this is a BILL, then leave out the incomes */
- if (type == INCOME) return TRUE;
+ if (type == ACCT_TYPE_INCOME) return TRUE;
/* Don't add placeholder accounts */
if (xaccAccountGetPlaceholder (account)) return TRUE;
Modified: gnucash/trunk/src/engine/Account.c
===================================================================
--- gnucash/trunk/src/engine/Account.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/engine/Account.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -124,7 +124,7 @@
acc->starting_cleared_balance = gnc_numeric_zero();
acc->starting_reconciled_balance = gnc_numeric_zero();
- acc->type = NO_TYPE;
+ acc->type = ACCT_TYPE_NONE;
acc->accountName = CACHE_INSERT("");
acc->accountCode = CACHE_INSERT("");
@@ -293,7 +293,7 @@
acc->cleared_balance = gnc_numeric_zero();
acc->reconciled_balance = gnc_numeric_zero();
- acc->type = NO_TYPE;
+ acc->type = ACCT_TYPE_NONE;
acc->commodity = NULL;
acc->version = 0;
@@ -986,8 +986,10 @@
* order for report generation */
static int typeorder[NUM_ACCOUNT_TYPES] = {
- BANK, STOCK, MUTUAL, CURRENCY, CASH, ASSET, RECEIVABLE,
- CREDIT, LIABILITY, PAYABLE, INCOME, EXPENSE, EQUITY };
+ ACCT_TYPE_BANK, ACCT_TYPE_STOCK, ACCT_TYPE_MUTUAL, ACCT_TYPE_CURRENCY,
+ ACCT_TYPE_CASH, ACCT_TYPE_ASSET, ACCT_TYPE_RECEIVABLE,
+ ACCT_TYPE_CREDIT, ACCT_TYPE_LIABILITY, ACCT_TYPE_PAYABLE,
+ ACCT_TYPE_INCOME, ACCT_TYPE_EXPENSE, ACCT_TYPE_EQUITY };
static int revorder[NUM_ACCOUNT_TYPES] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
@@ -1283,7 +1285,7 @@
GNCAccountType
xaccAccountGetType (const Account *acc)
{
- return acc ? acc->type : NO_TYPE;
+ return acc ? acc->type : ACCT_TYPE_NONE;
}
static const char*
@@ -2044,14 +2046,14 @@
/* You must edit the functions in this block in tandem. KEEP THEM IN
SYNC! */
-#define GNC_RETURN_ENUM_AS_STRING(x) case (x): return #x;
+#define GNC_RETURN_ENUM_AS_STRING(x) case (ACCT_TYPE_ ## x): return #x;
const char *
xaccAccountTypeEnumAsString(GNCAccountType type)
{
switch(type)
{
- GNC_RETURN_ENUM_AS_STRING(NO_TYPE);
+ GNC_RETURN_ENUM_AS_STRING(NONE);
GNC_RETURN_ENUM_AS_STRING(BANK);
GNC_RETURN_ENUM_AS_STRING(CASH);
GNC_RETURN_ENUM_AS_STRING(CREDIT);
@@ -2079,13 +2081,13 @@
#undef GNC_RETURN_ENUM_AS_STRING
#define GNC_RETURN_ON_MATCH(x) \
- if(safe_strcmp(#x, (str)) == 0) { *type = x; return(TRUE); }
+ if(safe_strcmp(#x, (str)) == 0) { *type = ACCT_TYPE_ ## x; return(TRUE); }
gboolean
xaccAccountStringToType(const char* str, GNCAccountType *type)
{
- GNC_RETURN_ON_MATCH(NO_TYPE);
+ GNC_RETURN_ON_MATCH(NONE);
GNC_RETURN_ON_MATCH(BANK);
GNC_RETURN_ON_MATCH(CASH);
GNC_RETURN_ON_MATCH(CREDIT);
@@ -2119,7 +2121,7 @@
GNCAccountType type;
gboolean rc;
rc = xaccAccountStringToType(str, &type);
- if (FALSE == rc) return BAD_TYPE;
+ if (FALSE == rc) return ACCT_TYPE_INVALID;
return type;
}
@@ -2169,7 +2171,7 @@
PERR("asked to translate unknown account type string %s.\n",
str ? str : "(null)");
- return BAD_TYPE;
+ return ACCT_TYPE_INVALID;
}
@@ -2184,34 +2186,34 @@
switch(parent_type)
{
- case BANK:
- case CASH:
- case ASSET:
- case STOCK:
- case MUTUAL:
- case CURRENCY:
- case CREDIT:
- case LIABILITY:
- case RECEIVABLE:
- case PAYABLE:
- compatible = ((child_type == BANK) ||
- (child_type == CASH) ||
- (child_type == ASSET) ||
- (child_type == STOCK) ||
- (child_type == MUTUAL) ||
- (child_type == CURRENCY) ||
- (child_type == CREDIT) ||
- (child_type == LIABILITY)||
- (child_type == RECEIVABLE)||
- (child_type == PAYABLE));
+ case ACCT_TYPE_BANK:
+ case ACCT_TYPE_CASH:
+ case ACCT_TYPE_ASSET:
+ case ACCT_TYPE_STOCK:
+ case ACCT_TYPE_MUTUAL:
+ case ACCT_TYPE_CURRENCY:
+ case ACCT_TYPE_CREDIT:
+ case ACCT_TYPE_LIABILITY:
+ case ACCT_TYPE_RECEIVABLE:
+ case ACCT_TYPE_PAYABLE:
+ compatible = ((child_type == ACCT_TYPE_BANK) ||
+ (child_type == ACCT_TYPE_CASH) ||
+ (child_type == ACCT_TYPE_ASSET) ||
+ (child_type == ACCT_TYPE_STOCK) ||
+ (child_type == ACCT_TYPE_MUTUAL) ||
+ (child_type == ACCT_TYPE_CURRENCY) ||
+ (child_type == ACCT_TYPE_CREDIT) ||
+ (child_type == ACCT_TYPE_LIABILITY)||
+ (child_type == ACCT_TYPE_RECEIVABLE)||
+ (child_type == ACCT_TYPE_PAYABLE));
break;
- case INCOME:
- case EXPENSE:
- compatible = ((child_type == INCOME) ||
- (child_type == EXPENSE));
+ case ACCT_TYPE_INCOME:
+ case ACCT_TYPE_EXPENSE:
+ compatible = ((child_type == ACCT_TYPE_INCOME) ||
+ (child_type == ACCT_TYPE_EXPENSE));
break;
- case EQUITY:
- compatible = (child_type == EQUITY);
+ case ACCT_TYPE_EQUITY:
+ compatible = (child_type == ACCT_TYPE_EQUITY);
break;
default:
PERR("bad account type: %d", parent_type);
@@ -2225,7 +2227,7 @@
xaccAccountTypesValid(void)
{
guint32 mask = (1 << NUM_ACCOUNT_TYPES) - 1;
- mask &= ~(1 << CURRENCY); /* DEPRECATED */
+ mask &= ~(1 << ACCT_TYPE_CURRENCY); /* DEPRECATED */
return mask;
}
@@ -2235,8 +2237,8 @@
{
if (!acc) return FALSE;
- return (acc->type == STOCK || acc->type == MUTUAL ||
- acc->type == CURRENCY);
+ return (acc->type == ACCT_TYPE_STOCK || acc->type == ACCT_TYPE_MUTUAL ||
+ acc->type == ACCT_TYPE_CURRENCY);
}
/********************************************************************\
Modified: gnucash/trunk/src/engine/Account.h
===================================================================
--- gnucash/trunk/src/engine/Account.h 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/engine/Account.h 2006-08-06 22:07:12 UTC (rev 14599)
@@ -72,49 +72,67 @@
typedef enum
{
- BAD_TYPE = -1, /**< Not a type */
- NO_TYPE = -1,/**< Not a type */
+ ACCT_TYPE_INVALID = -1, /**< Not a type */
+ ACCT_TYPE_NONE = -1,/**< Not a type */
- BANK = 0, /**< The bank account type denotes a savings or checking account
- * held at a bank. Often interest bearing. */
- CASH = 1,/**< The cash account type is used to denote a shoe-box or pillowcase
- * stuffed with cash. */
- CREDIT = 3, /**< The Credit card account is used to denote credit (e.g. amex)
- * and debit (e.g. visa, mastercard) card accounts */
- ASSET = 2, /**< asset (and liability) accounts indicate generic, generalized accounts
- * that are none of the above. */
- LIABILITY = 4, /**< liability (and asset) accounts indicate generic, generalized accounts
- * that are none of the above. */
- STOCK = 5, /**< Stock accounts will typically be shown in registers
- * which show three columns: price, number of shares, and value. */
- MUTUAL= 6, /**< Mutual Fund accounts will typically be shown in registers
- * which show three columns: price, number of shares, and value. */
- CURRENCY = 7, /**< The currency account type indicates that the
- * account is a currency trading account. In many
- * ways, a currency trading account is like a stock
- * trading account. It is shown in the register with
- * three columns: price, number of shares, and
- * value. Note: Since version 1.7.0, this account is
- * no longer needed to exchange currencies between
- * accounts, so this type is DEPRECATED. */
- INCOME = 8, /**< Income accounts are used to denote income */
+ ACCT_TYPE_BANK = 0, /**< The bank account type denotes a savings
+ * or checking account held at a bank.
+ * Often * interest * bearing. */
+ ACCT_TYPE_CASH = 1, /**< The cash account type is used to denote a
+ * shoe-box or pillowcase stuffed with *
+ * cash. */
+ ACCT_TYPE_CREDIT = 3, /**< The Credit card account is used to denote
+ * credit (e.g. amex) and debit (e.g. visa,
+ * mastercard) * card accounts */
+ ACCT_TYPE_ASSET = 2, /**< asset (and liability) accounts indicate
+ * generic, generalized accounts that are
+ * none of the * above. */
+ ACCT_TYPE_LIABILITY = 4,/**< liability (and asset) accounts indicate
+ * generic, generalized accounts that are
+ * none of the * above. */
+ ACCT_TYPE_STOCK = 5, /**< Stock accounts will typically be shown in
+ * registers which show three columns:
+ * price, number of * shares, and value. */
+ ACCT_TYPE_MUTUAL= 6, /**< Mutual Fund accounts will typically be
+ * shown in registers which show three
+ * columns: price, * number of shares, and
+ * value. */
+ ACCT_TYPE_CURRENCY = 7,/**< The currency account type indicates that
+ * the account is a currency trading
+ * account. In many * ways, a currency
+ * trading account is like a stock *
+ * trading account. It is shown in the
+ * register with * three columns: price,
+ * number of shares, and * value. Note:
+ * Since version 1.7.0, this account is *
+ * no longer needed to exchange currencies
+ * between * accounts, so this type is
+ * DEPRECATED. */
+ ACCT_TYPE_INCOME = 8, /**< Income accounts are used to denote
+ * income */
- EXPENSE = 9,/**< Expense accounts are used to denote expenses. */
+ ACCT_TYPE_EXPENSE = 9,/**< Expense accounts are used to denote
+ * expenses. */
- EQUITY = 10,/**< Equity account is used to balance the balance sheet. */
+ ACCT_TYPE_EQUITY = 10,/**< Equity account is used to balance the
+ * balance sheet. */
- RECEIVABLE = 11, /**< A/R account type */
+ ACCT_TYPE_RECEIVABLE = 11,/**< A/R account type */
- PAYABLE = 12, /**< A/P account type */
+ ACCT_TYPE_PAYABLE = 12, /**< A/P account type */
NUM_ACCOUNT_TYPES = 13, /**< stop here; the following types
* just aren't ready for prime time */
/* bank account types */
- CHECKING = 13, /**< bank account type -- don't use this for now, see NUM_ACCOUNT_TYPES */
- SAVINGS = 14, /**< bank account type -- don't use this for now, see NUM_ACCOUNT_TYPES */
- MONEYMRKT = 15, /**< bank account type -- don't use this for now, see NUM_ACCOUNT_TYPES */
- CREDITLINE = 16, /**< line of credit -- don't use this for now, see NUM_ACCOUNT_TYPES */
+ ACCT_TYPE_CHECKING = 13, /**< bank account type -- don't use this
+ * for now, see NUM_ACCOUNT_TYPES */
+ ACCT_TYPE_SAVINGS = 14, /**< bank account type -- don't use this for
+ * now, see NUM_ACCOUNT_TYPES */
+ ACCT_TYPE_MONEYMRKT = 15, /**< bank account type -- don't use this
+ * for now, see NUM_ACCOUNT_TYPES */
+ ACCT_TYPE_CREDITLINE = 16, /**< line of credit -- don't use this for
+ * now, see NUM_ACCOUNT_TYPES */
} GNCAccountType;
@@ -481,19 +499,19 @@
* Conversion routines for the account types to/from strings
* that are used in persistant storage, communications. These
* strings should *not* be translated to the local language.
- * Typical converstion is INCOME -> "INCOME". */
+ * Typical converstion is ACCT_TYPE_INCOME -> "INCOME". */
const char * xaccAccountTypeEnumAsString (GNCAccountType type);
/**
* Conversion routines for the account types to/from strings
* that are used in persistant storage, communications. These
* strings should *not* be translated to the local language.
- * Typical converstion is INCOME -> "INCOME". */
+ * Typical converstion is "INCOME" -> ACCT_TYPE_INCOME. */
gboolean xaccAccountStringToType (const char* str, GNCAccountType *type);
/**
* Conversion routines for the account types to/from strings
* that are used in persistant storage, communications. These
* strings should *not* be translated to the local language.
- * Typical converstion is INCOME -> "INCOME". */
+ * Typical converstion is "INCOME" -> ACCT_TYPE_INCOME. */
GNCAccountType xaccAccountStringToEnum (const char* str);
/** The xaccAccountGetTypeStr() routine returns a string suitable for
Modified: gnucash/trunk/src/engine/AccountP.h
===================================================================
--- gnucash/trunk/src/engine/AccountP.h 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/engine/AccountP.h 2006-08-06 22:07:12 UTC (rev 14599)
@@ -78,10 +78,11 @@
*/
char *description;
- /* The type field is the account type, picked from the enumerated
- * list that includes BANK, STOCK, CREDIT, INCOME, etc. Its
- * intended use is to be a hint to the GUI as to how to display
- * and format the transaction data.
+ /* The type field is the account type, picked from the enumerated
+ * list that includes ACCT_TYPE_BANK, ACCT_TYPE_STOCK,
+ * ACCT_TYPE_CREDIT, ACCT_TYPE_INCOME, etc. Its intended use is to
+ * be a hint to the GUI as to how to display and format the
+ * transaction data.
*/
GNCAccountType type;
Modified: gnucash/trunk/src/engine/Period.c
===================================================================
--- gnucash/trunk/src/engine/Period.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/engine/Period.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -624,7 +624,7 @@
for (node=acc_list; node; node=node->next)
{
candidate = (Account *) node->data;
- if ((EQUITY == xaccAccountGetType (candidate)) &&
+ if ((ACCT_TYPE_EQUITY == xaccAccountGetType (candidate)) &&
gnc_commodity_equiv(xaccAccountGetCommodity(acc),
xaccAccountGetCommodity(candidate)))
{
@@ -647,8 +647,8 @@
candidate = xaccMallocAccount (xaccGroupGetBook(parent));
xaccAccountBeginEdit (candidate);
xaccGroupInsertAccount (parent, candidate);
- xaccAccountSetType (candidate, EQUITY);
- xaccAccountSetName (candidate, xaccAccountGetTypeStr(EQUITY));
+ xaccAccountSetType (candidate, ACCT_TYPE_EQUITY);
+ xaccAccountSetName (candidate, xaccAccountGetTypeStr(ACCT_TYPE_EQUITY));
xaccAccountSetCommodity (candidate, xaccAccountGetCommodity(acc));
xaccAccountCommitEdit (candidate);
@@ -710,7 +710,8 @@
/* -------------------------------- */
/* We need to carry a balance on any account that is not
* and income or expense or equity account */
- if ((INCOME != tip) && (EXPENSE != tip) && (EQUITY != tip))
+ if ((ACCT_TYPE_INCOME != tip) && (ACCT_TYPE_EXPENSE != tip) &&
+ (ACCT_TYPE_EQUITY != tip))
{
gnc_numeric baln;
baln = xaccAccountGetBalance (candidate);
Modified: gnucash/trunk/src/engine/Period.h
===================================================================
--- gnucash/trunk/src/engine/Period.h 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/engine/Period.h 2006-08-06 22:07:12 UTC (rev 14599)
@@ -62,7 +62,7 @@
* balances will be placed. This argument may be NULL,
* if it is NULL, then a search algorithm will be used to
* find a suitable equity account. If NULL, this routine
- * searches for the 'nearest' account of GNCAccountType EQUITY
+ * searches for the 'nearest' account of GNCAccountType ACCT_TYPE_EQUITY
* among its siblings, or the siblings of its parents. It
* does not search downwards. If it does not find such an
* account, it will create one, hanging off the top-most group.
Modified: gnucash/trunk/src/engine/SchedXaction.c
===================================================================
--- gnucash/trunk/src/engine/SchedXaction.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/engine/SchedXaction.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -78,7 +78,7 @@
gnc_commodity_new( book,
"template", "template",
"template", "template", 1 ) );
- xaccAccountSetType( sx->template_acct, BANK );
+ xaccAccountSetType( sx->template_acct, ACCT_TYPE_BANK );
ag = gnc_book_get_template_group( book );
xaccGroupInsertAccount( ag, sx->template_acct );
}
Modified: gnucash/trunk/src/engine/Scrub.c
===================================================================
--- gnucash/trunk/src/engine/Scrub.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/engine/Scrub.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -902,7 +902,7 @@
xaccAccountBeginEdit (acc);
xaccAccountSetName (acc, accname);
xaccAccountSetCommodity (acc, currency);
- xaccAccountSetType (acc, BANK);
+ xaccAccountSetType (acc, ACCT_TYPE_BANK);
/* Hang the account off the root. */
xaccGroupInsertAccount (root, acc);
Modified: gnucash/trunk/src/engine/cap-gains.c
===================================================================
--- gnucash/trunk/src/engine/cap-gains.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/engine/cap-gains.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -247,7 +247,7 @@
xaccAccountBeginEdit (acc);
xaccAccountSetName (acc, accname);
xaccAccountSetCommodity (acc, currency);
- xaccAccountSetType (acc, INCOME);
+ xaccAccountSetType (acc, ACCT_TYPE_INCOME);
xaccAccountSetDescription (acc, _("Realized Gain/Loss"));
xaccAccountSetNotes (acc,
_("Realized Gains or Losses from "
Modified: gnucash/trunk/src/engine/gnc-associate-account.c
===================================================================
--- gnucash/trunk/src/engine/gnc-associate-account.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/engine/gnc-associate-account.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -150,7 +150,8 @@
current_account = iter->data;
type = xaccAccountGetType(current_account);
- g_return_val_if_fail(type == INCOME || type == EXPENSE, NULL);
+ g_return_val_if_fail(type == ACCT_TYPE_INCOME || type == ACCT_TYPE_EXPENSE,
+ NULL);
acc_id = xaccAccountGetGUID(current_account);
guid_kvp = kvp_value_new_guid(acc_id);
@@ -423,7 +424,7 @@
type = xaccAccountGetType(inc_or_expense_account);
- g_return_if_fail(type == INCOME || type == EXPENSE);
+ g_return_if_fail(type == ACCT_TYPE_INCOME || type == ACCT_TYPE_EXPENSE);
current_account_kvpframe = xaccAccountGetSlots(inc_or_expense_account);
Modified: gnucash/trunk/src/engine/gw-engine-spec.scm
===================================================================
--- gnucash/trunk/src/engine/gw-engine-spec.scm 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/engine/gw-engine-spec.scm 2006-08-06 22:07:12 UTC (rev 14599)
@@ -191,26 +191,26 @@
(let ((we (gw:wrap-enumeration ws '<gnc:AccountType> "GNCAccountType")))
;; From Account.h
- (gw:enum-add-value! we "BAD_TYPE" 'bad-type)
- (gw:enum-add-value! we "NO_TYPE" 'no-type)
- (gw:enum-add-value! we "BANK" 'bank)
- (gw:enum-add-value! we "CASH" 'cash)
- (gw:enum-add-value! we "CREDIT" 'credit)
- (gw:enum-add-value! we "ASSET" 'asset)
- (gw:enum-add-value! we "LIABILITY" 'liability)
- (gw:enum-add-value! we "STOCK" 'stock)
- (gw:enum-add-value! we "MUTUAL" 'mutual-fund)
- (gw:enum-add-value! we "CURRENCY" 'currency)
- (gw:enum-add-value! we "INCOME" 'income)
- (gw:enum-add-value! we "EXPENSE" 'expense)
- (gw:enum-add-value! we "EQUITY" 'equity)
- (gw:enum-add-value! we "RECEIVABLE" 'receivable)
- (gw:enum-add-value! we "PAYABLE" 'payable)
+ (gw:enum-add-value! we "ACCT_TYPE_INVALID" 'bad-type)
+ (gw:enum-add-value! we "ACCT_TYPE_NONE" 'no-type)
+ (gw:enum-add-value! we "ACCT_TYPE_BANK" 'bank)
+ (gw:enum-add-value! we "ACCT_TYPE_CASH" 'cash)
+ (gw:enum-add-value! we "ACCT_TYPE_CREDIT" 'credit)
+ (gw:enum-add-value! we "ACCT_TYPE_ASSET" 'asset)
+ (gw:enum-add-value! we "ACCT_TYPE_LIABILITY" 'liability)
+ (gw:enum-add-value! we "ACCT_TYPE_STOCK" 'stock)
+ (gw:enum-add-value! we "ACCT_TYPE_MUTUAL" 'mutual-fund)
+ (gw:enum-add-value! we "ACCT_TYPE_CURRENCY" 'currency)
+ (gw:enum-add-value! we "ACCT_TYPE_INCOME" 'income)
+ (gw:enum-add-value! we "ACCT_TYPE_EXPENSE" 'expense)
+ (gw:enum-add-value! we "ACCT_TYPE_EQUITY" 'equity)
+ (gw:enum-add-value! we "ACCT_TYPE_RECEIVABLE" 'receivable)
+ (gw:enum-add-value! we "ACCT_TYPE_PAYABLE" 'payable)
(gw:enum-add-value! we "NUM_ACCOUNT_TYPES" 'num-account-types)
- (gw:enum-add-value! we "CHECKING" 'checking)
- (gw:enum-add-value! we "SAVINGS" 'savings)
- (gw:enum-add-value! we "MONEYMRKT" 'money-market)
- (gw:enum-add-value! we "CREDITLINE" 'credit-line)
+ (gw:enum-add-value! we "ACCT_TYPE_CHECKING" 'checking)
+ (gw:enum-add-value! we "ACCT_TYPE_SAVINGS" 'savings)
+ (gw:enum-add-value! we "ACCT_TYPE_MONEYMRKT" 'money-market)
+ (gw:enum-add-value! we "ACCT_TYPE_CREDITLINE" 'credit-line)
#t)
(let ((we (gw:wrap-enumeration ws '<gnc:BackendError> "QofBackendError")))
Modified: gnucash/trunk/src/engine/test-core/test-engine-stuff.c
===================================================================
--- gnucash/trunk/src/engine/test-core/test-engine-stuff.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/engine/test-core/test-engine-stuff.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -1214,7 +1214,7 @@
set_account_random_string_from_array(ret, xaccAccountSetName,
sane_account_names);
- tmp_int = get_random_int_in_range(BANK, NUM_ACCOUNT_TYPES - 1);
+ tmp_int = get_random_int_in_range(ACCT_TYPE_BANK, NUM_ACCOUNT_TYPES - 1);
xaccAccountSetType(ret, tmp_int);
set_account_random_string(ret, xaccAccountSetCode);
@@ -1247,7 +1247,7 @@
set_account_random_string (account, xaccAccountSetName);
- tmp_int = get_random_int_in_range (BANK, CREDITLINE);
+ tmp_int = get_random_int_in_range (ACCT_TYPE_BANK, ACCT_TYPE_CREDITLINE);
xaccAccountSetType (account, tmp_int);
set_account_random_string (account, xaccAccountSetCode);
Modified: gnucash/trunk/src/gnome/dialog-chart-export.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-chart-export.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/gnome/dialog-chart-export.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -71,7 +71,7 @@
data = (chart_data*)user_data;
acc = (Account*)ent;
if(0 == safe_strcmp(EQUITY_ACCOUNT_NAME, xaccAccountGetName(acc))
- && (xaccAccountGetType(acc) == EQUITY))
+ && (xaccAccountGetType(acc) == ACCT_TYPE_EQUITY))
{
success = qof_entity_copy_to_session(data->chart_session, ent);
if(!success) { return; }
@@ -248,7 +248,7 @@
xaccAccountBeginEdit (data->equity_account);
xaccAccountSetName (data->equity_account, EQUITY_ACCOUNT_NAME);
xaccAccountSetDescription(data->equity_account, EQUITY_ACCOUNT_NAME);
- xaccAccountSetType (data->equity_account, EQUITY);
+ xaccAccountSetType (data->equity_account, ACCT_TYPE_EQUITY);
xaccAccountSetCommodity (data->equity_account, gnc_default_currency());
}
qof_object_foreach(GNC_ID_ACCOUNT, book, chart_entity_cb, data);
Modified: gnucash/trunk/src/gnome/dialog-tax-info.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-tax-info.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/gnome/dialog-tax-info.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -474,7 +474,7 @@
ti_dialog->income = show_income;
tree = GNC_TREE_VIEW_ACCOUNT (ti_dialog->account_treeview);
- show_type = show_income ? INCOME : EXPENSE;
+ show_type = show_income ? ACCT_TYPE_INCOME : ACCT_TYPE_EXPENSE;
gnc_tree_view_account_get_view_info (tree, &info);
@@ -523,7 +523,7 @@
tax_info_show_income_accounts (ti_dialog, show_income);
- ti_dialog->account_type = show_income ? INCOME : EXPENSE;
+ ti_dialog->account_type = show_income ? ACCT_TYPE_INCOME : ACCT_TYPE_EXPENSE;
gnc_tree_view_account_refilter (GNC_TREE_VIEW_ACCOUNT (ti_dialog->account_treeview));
gnc_tax_info_update_accounts (ti_dialog);
@@ -670,7 +670,7 @@
ti_dialog->dialog = dialog;
tido = GTK_OBJECT (dialog);
- ti_dialog->account_type = EXPENSE;
+ ti_dialog->account_type = ACCT_TYPE_EXPENSE;
ti_dialog->income_txf_infos = load_txf_info (TRUE);
ti_dialog->expense_txf_infos = load_txf_info (FALSE);
Modified: gnucash/trunk/src/gnome/druid-hierarchy.c
===================================================================
--- gnucash/trunk/src/gnome/druid-hierarchy.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/gnome/druid-hierarchy.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -698,7 +698,7 @@
string = xaccPrintAmount (balance, print_info);
}
- if (xaccAccountGetType(account) == EQUITY) {
+ if (xaccAccountGetType(account) == ACCT_TYPE_EQUITY) {
allow_value = FALSE;
string=_("zero");
} else {
Modified: gnucash/trunk/src/gnome/druid-loan.c
===================================================================
--- gnucash/trunk/src/gnome/druid-loan.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/gnome/druid-loan.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -425,23 +425,26 @@
/* non-gladeable widget setup */
{
int i;
- // LIABILITY
+ // ACCT_TYPE_LIABILITY
GList *liabilityAcct;
- // BANK, CASH, CREDIT, ASSET + LIABILITY
+ // ACCT_TYPE_BANK, ACCT_TYPE_CASH, ACCT_TYPE_CREDIT,
+ // ACCT_TYPE_ASSET + ACCT_TYPE_LIABILITY
GList *paymentFromAccts;
- // EXPENSE, LIABILITY, + payment-froms.
+ // ACCT_TYPE_EXPENSE, ACCT_TYPE_LIABILITY, + payment-froms.
GList *paymentToAccts;
int fromLen = 5;
- GNCAccountType paymentFroms[] = { BANK, CASH, CREDIT, ASSET, LIABILITY };
+ GNCAccountType paymentFroms[] = { ACCT_TYPE_BANK, ACCT_TYPE_CASH,
+ ACCT_TYPE_CREDIT, ACCT_TYPE_ASSET,
+ ACCT_TYPE_LIABILITY };
int toLen = 2;
- GNCAccountType paymentTos[] = { EXPENSE };
+ GNCAccountType paymentTos[] = { ACCT_TYPE_EXPENSE };
liabilityAcct = NULL;
paymentFromAccts = NULL;
paymentToAccts = NULL;
liabilityAcct = g_list_append( liabilityAcct,
- GINT_TO_POINTER( LIABILITY ) );
+ GINT_TO_POINTER( ACCT_TYPE_LIABILITY ) );
for ( i = 0; i < fromLen; i++ )
{
paymentFromAccts
Modified: gnucash/trunk/src/gnome/druid-stock-split.c
===================================================================
--- gnucash/trunk/src/gnome/druid-stock-split.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/gnome/druid-stock-split.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -557,7 +557,7 @@
GNCAccountType type;
type = xaccAccountGetType(account);
- return (type == INCOME);
+ return (type == ACCT_TYPE_INCOME);
}
static gboolean
@@ -567,7 +567,8 @@
GNCAccountType type;
type = xaccAccountGetType(account);
- return ((type == BANK) || (type == CASH) || (type == ASSET));
+ return ((type == ACCT_TYPE_BANK) || (type == ACCT_TYPE_CASH) ||
+ (type == ACCT_TYPE_ASSET));
}
static void
Modified: gnucash/trunk/src/gnome/window-reconcile.c
===================================================================
--- gnucash/trunk/src/gnome/window-reconcile.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/gnome/window-reconcile.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -117,14 +117,14 @@
* change! These macros define the account types for which an auto interest
* xfer dialog could pop up, if the user's preferences allow it.
*/
-#define account_type_has_auto_interest_charge(type) (((type) == CREDIT) || \
- ((type) == LIABILITY) ||\
- ((type) == PAYABLE))
+#define account_type_has_auto_interest_charge(type) (((type) == ACCT_TYPE_CREDIT) || \
+ ((type) == ACCT_TYPE_LIABILITY) ||\
+ ((type) == ACCT_TYPE_PAYABLE))
-#define account_type_has_auto_interest_payment(type) (((type) == BANK) || \
- ((type) == ASSET) || \
- ((type) == MUTUAL) || \
- ((type) == RECEIVABLE))
+#define account_type_has_auto_interest_payment(type) (((type) == ACCT_TYPE_BANK) || \
+ ((type) == ACCT_TYPE_ASSET) || \
+ ((type) == ACCT_TYPE_MUTUAL) || \
+ ((type) == ACCT_TYPE_RECEIVABLE))
#define account_type_has_auto_interest_xfer(type) \
( account_type_has_auto_interest_charge(type) || \
@@ -980,7 +980,7 @@
if (formal)
title = _("Debits");
else
- title = gnc_get_debit_string(NO_TYPE);
+ title = gnc_get_debit_string(ACCT_TYPE_NONE);
gtk_frame_set_label(GTK_FRAME(recnData->debit_frame), title);
@@ -990,7 +990,7 @@
if (formal)
title = _("Credits");
else
- title = gnc_get_credit_string(NO_TYPE);
+ title = gnc_get_credit_string(ACCT_TYPE_NONE);
gtk_frame_set_label(GTK_FRAME(recnData->credit_frame), title);
@@ -1847,7 +1847,8 @@
continue;
type = xaccAccountGetType(a);
- if ((type == BANK) || (type == CASH) || (type == ASSET))
+ if ((type == ACCT_TYPE_BANK) || (type == ACCT_TYPE_CASH) ||
+ (type == ACCT_TYPE_ASSET))
return a;
}
}
@@ -1897,7 +1898,7 @@
xaccAccountSetReconcileLastDate (account, date);
if (auto_payment &&
- (xaccAccountGetType (account) == CREDIT) &&
+ (xaccAccountGetType (account) == ACCT_TYPE_CREDIT) &&
(gnc_numeric_negative_p (recnData->new_ending)))
{
Account *payment_account;
Modified: gnucash/trunk/src/gnome-utils/dialog-account.c
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-account.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/gnome-utils/dialog-account.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -129,7 +129,7 @@
/** Static Globals *******************************************************/
static QofLogModule log_module = GNC_MOD_GUI;
-static int last_used_account_type = BANK;
+static int last_used_account_type = ACCT_TYPE_BANK;
static GList *ac_destroy_cb_list = NULL;
@@ -169,7 +169,7 @@
{
dialog_commodity_mode new_mode;
- if ((aw->type == STOCK) || (aw->type == MUTUAL))
+ if ((aw->type == ACCT_TYPE_STOCK) || (aw->type == ACCT_TYPE_MUTUAL))
new_mode = DIAG_COMM_NON_CURRENCY;
else
new_mode = DIAG_COMM_CURRENCY;
@@ -803,7 +803,7 @@
}
/* check for valid type */
- if (aw->type == BAD_TYPE) {
+ if (aw->type == ACCT_TYPE_INVALID) {
const char *message = _("You must select an account type.");
gnc_error_dialog(aw->dialog, message);
LEAVE("invalid type");
@@ -1121,18 +1121,18 @@
sensitive = FALSE;
type_id = gnc_tree_model_account_types_get_selection_single(selection);
- if (type_id == NO_TYPE) {
- aw->type = BAD_TYPE;
+ if (type_id == ACCT_TYPE_NONE) {
+ aw->type = ACCT_TYPE_INVALID;
} else {
aw->type = type_id;
last_used_account_type = type_id;
gnc_account_commodity_from_type (aw, TRUE);
- sensitive = (aw->type != EQUITY &&
- aw->type != CURRENCY &&
- aw->type != STOCK &&
- aw->type != MUTUAL);
+ sensitive = (aw->type != ACCT_TYPE_EQUITY &&
+ aw->type != ACCT_TYPE_CURRENCY &&
+ aw->type != ACCT_TYPE_STOCK &&
+ aw->type != ACCT_TYPE_MUTUAL);
}
gtk_widget_set_sensitive (aw->opening_balance_page, sensitive);
@@ -1557,7 +1557,7 @@
if (default_commodity != NULL) {
commodity = default_commodity;
- } else if ((aw->type != STOCK) && (aw->type != MUTUAL)) {
+ } else if ((aw->type != ACCT_TYPE_STOCK) && (aw->type != ACCT_TYPE_MUTUAL)) {
commodity = parent_commodity;
} else {
commodity = NULL;
Modified: gnucash/trunk/src/gnome-utils/dialog-transfer.c
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-transfer.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/gnome-utils/dialog-transfer.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -437,7 +437,7 @@
}
type = xaccAccountGetType(account);
- return ((type != INCOME) && (type != EXPENSE));
+ return ((type != ACCT_TYPE_INCOME) && (type != ACCT_TYPE_EXPENSE));
}
static void
@@ -638,7 +638,7 @@
/* Don't want to deactivate the button just because this
* isn't an income or expense account
*/
- if( (other_type == EXPENSE) || (other_type == INCOME) )
+ if( (other_type == ACCT_TYPE_EXPENSE) || (other_type == ACCT_TYPE_INCOME) )
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(other_button), TRUE);
gnc_transfer_dialog_set_selected_account (xferData, other_acct, xferData->quickfill);
@@ -2138,7 +2138,8 @@
type = xaccAccountGetType (account);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (show_button),
- (type == EXPENSE) || (type == INCOME));
+ (type == ACCT_TYPE_EXPENSE) ||
+ (type == ACCT_TYPE_INCOME));
gnc_tree_view_account_set_selected_account (GNC_TREE_VIEW_ACCOUNT (tree_view),
account);
Modified: gnucash/trunk/src/gnome-utils/gnc-tree-model-account-types.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-model-account-types.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-model-account-types.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -252,7 +252,7 @@
for (i = 0; i < NUM_ACCOUNT_TYPES; i++)
if (selected & (1 << i))
return i;
- return NO_TYPE;
+ return ACCT_TYPE_NONE;
}
void
@@ -334,7 +334,7 @@
i = gtk_tree_path_get_indices (path)[0];
- if (i > NO_TYPE && i < NUM_ACCOUNT_TYPES) {
+ if (i > ACCT_TYPE_NONE && i < NUM_ACCOUNT_TYPES) {
iter->stamp = model->stamp;
iter->user_data = GINT_TO_POINTER (i);
return TRUE;
@@ -468,7 +468,7 @@
model = GNC_TREE_MODEL_ACCOUNT_TYPES (tree_model);
- if (n > NO_TYPE && n < NUM_ACCOUNT_TYPES) {
+ if (n > ACCT_TYPE_NONE && n < NUM_ACCOUNT_TYPES) {
iter->stamp = model->stamp;
iter->user_data = GINT_TO_POINTER (n);
return TRUE;
Modified: gnucash/trunk/src/gnome-utils/gnc-tree-model-account-types.h
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-model-account-types.h 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-model-account-types.h 2006-08-06 22:07:12 UTC (rev 14599)
@@ -121,8 +121,8 @@
/* Gets the selected account type. Use the function if your view
allows the selection of only one account type. If no types are
- selected, returns NO_TYPE. If more than one type is selected,
- arbitrarily returns one of the selected types. */
+ selected, returns ACCT_TYPE_NONE. If more than one type is
+ selected, arbitrarily returns one of the selected types. */
GNCAccountType
gnc_tree_model_account_types_get_selection_single(GtkTreeSelection *sel);
Modified: gnucash/trunk/src/gnome-utils/gnc-tree-view-account.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-view-account.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-view-account.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -507,7 +507,7 @@
/* Set default visibilities */
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(view), FALSE);
- sample_type = xaccAccountGetTypeStr(CREDIT);
+ sample_type = xaccAccountGetTypeStr(ACCT_TYPE_CREDIT);
sample_commodity = gnc_commodity_get_fullname(gnc_default_currency());
priv->name_column
Modified: gnucash/trunk/src/gnome-utils/window-main-summarybar.c
===================================================================
--- gnucash/trunk/src/gnome-utils/window-main-summarybar.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/gnome-utils/window-main-summarybar.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -181,15 +181,15 @@
switch (account_type)
{
- case BANK:
- case CASH:
- case ASSET:
- case STOCK:
- case MUTUAL:
- case CREDIT:
- case LIABILITY:
- case PAYABLE:
- case RECEIVABLE:
+ case ACCT_TYPE_BANK:
+ case ACCT_TYPE_CASH:
+ case ACCT_TYPE_ASSET:
+ case ACCT_TYPE_STOCK:
+ case ACCT_TYPE_MUTUAL:
+ case ACCT_TYPE_CREDIT:
+ case ACCT_TYPE_LIABILITY:
+ case ACCT_TYPE_PAYABLE:
+ case ACCT_TYPE_RECEIVABLE:
end_amount = xaccAccountGetBalanceAsOfDate(account, options.end_date);
timespecFromTime_t(&end_timespec, options.end_date);
end_amount_default_currency =
@@ -229,8 +229,8 @@
if (children != NULL)
gnc_ui_accounts_recurse(children, currency_list, options);
break;
- case INCOME:
- case EXPENSE:
+ case ACCT_TYPE_INCOME:
+ case ACCT_TYPE_EXPENSE:
start_amount = xaccAccountGetBalanceAsOfDate(account, options.start_date);
timespecFromTime_t(&start_timespec, options.start_date);
start_amount_default_currency =
@@ -295,10 +295,10 @@
if (children != NULL)
gnc_ui_accounts_recurse(children, currency_list, options);
break;
- case EQUITY:
+ case ACCT_TYPE_EQUITY:
/* no-op, see comments at top about summing assets */
break;
- case CURRENCY:
+ case ACCT_TYPE_CURRENCY:
default:
break;
}
Modified: gnucash/trunk/src/import-export/hbci/druid-hbci-initial.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/druid-hbci-initial.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/import-export/hbci/druid-hbci-initial.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -365,8 +365,8 @@
}
gnc_acc = gnc_import_select_account(info->window,
- NULL, TRUE, longname, currency, BANK,
- old_value, NULL);
+ NULL, TRUE, longname, currency,
+ ACCT_TYPE_BANK, old_value, NULL);
g_free(longname);
if (gnc_acc) {
Modified: gnucash/trunk/src/import-export/import-account-matcher.c
===================================================================
--- gnucash/trunk/src/import-export/import-account-matcher.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/import-export/import-account-matcher.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -99,7 +99,7 @@
GList * valid_types = NULL;
/*DEBUG("Begin"); */
- if(picker->new_account_default_type!=NO_TYPE)
+ if(picker->new_account_default_type!=ACCT_TYPE_NONE)
{
/*Yes, this is weird, but we really DO want to pass the value instead of the pointer...*/
valid_types = g_list_prepend(valid_types, (gpointer)picker->new_account_default_type);
Modified: gnucash/trunk/src/import-export/import-account-matcher.h
===================================================================
--- gnucash/trunk/src/import-export/import-account-matcher.h 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/import-export/import-account-matcher.h 2006-08-06 22:07:12 UTC (rev 14599)
@@ -65,10 +65,10 @@
@param new_account_default_type
Default account type of a
- new account. Can be NULL. If not NO_TYPE, it will be the
- account's type if a new account is created. If not NO_TYPE, the
- function will also warn the user if the found or created account's
- commodity doesn't match.
+ new account. Can be NULL. If not ACCT_TYPE_NONE, it will be the
+ account's type if a new account is created. If not
+ ACCT_TYPE_NONE, the function will also warn the user if the found
+ or created account's commodity doesn't match.
@param auto_create
Only active if no account with the
Modified: gnucash/trunk/src/import-export/import-main-matcher.c
===================================================================
--- gnucash/trunk/src/import-export/import-main-matcher.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/import-export/import-main-matcher.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -207,7 +207,7 @@
TRUE,
_("Destination account for the auto-balance split."),
xaccTransGetCurrency(gnc_import_TransInfo_get_trans(trans_info)),
- NO_TYPE,
+ ACCT_TYPE_NONE,
old_acc,
&ok_pressed);
if(ok_pressed)
Modified: gnucash/trunk/src/import-export/mt940/gnc-mt940-import.c
===================================================================
--- gnucash/trunk/src/import-export/mt940/gnc-mt940-import.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/import-export/mt940/gnc-mt940-import.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -276,7 +276,7 @@
gnc_acc = gnc_import_select_account(NULL,
online_id, 1, account_name, NULL,
- NO_TYPE, NULL, NULL);
+ ACCT_TYPE_NONE, NULL, NULL);
g_free(online_id);
if (gnc_acc) {
/* Store chosen gnucash account in callback data */
Modified: gnucash/trunk/src/import-export/ofx/gnc-ofx-import.c
===================================================================
--- gnucash/trunk/src/import-export/ofx/gnc-ofx-import.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/import-export/ofx/gnc-ofx-import.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -121,8 +121,8 @@
g_assert(gnc_ofx_importer_gui);
if(data.account_id_valid==true){
- account = gnc_import_select_account(NULL,
- data.account_id, 0, NULL, NULL, NO_TYPE, NULL, NULL);
+ account = gnc_import_select_account(NULL, data.account_id, 0, NULL, NULL,
+ ACCT_TYPE_NONE, NULL, NULL);
if(account!=NULL)
{
/********** Validate the input strings to ensure utf8 ********************/
@@ -340,7 +340,8 @@
else if(data.unique_id_valid==true&&data.security_data_ptr->secname_valid==true)
{
/************************ Process an investment transaction ******************************/
- /* Note that the STOCK account type should be replaced with something derived from data.invtranstype*/
+ /* Note that the ACCT_TYPE_STOCK account type should be replaced with something
+ derived from data.invtranstype*/
investment_commodity = gnc_import_select_commodity(data.unique_id,
0,
NULL,
@@ -358,7 +359,7 @@
1,
investment_account_text,
investment_commodity,
- STOCK,
+ ACCT_TYPE_STOCK,
NULL,
NULL);
g_free (investment_account_text);
@@ -424,7 +425,7 @@
1,
investment_account_text,
currency,
- INCOME,
+ ACCT_TYPE_INCOME,
NULL,
NULL);
income_acc_guid = xaccAccountGetGUID(income_account);
@@ -548,7 +549,7 @@
Account *selected_account;
gnc_commodity_table * commodity_table;
gnc_commodity * default_commodity;
- GNCAccountType default_type=NO_TYPE;
+ GNCAccountType default_type=ACCT_TYPE_NONE;
gchar * account_description;
gchar * account_type_name = NULL;
@@ -571,31 +572,31 @@
if(data.account_type_valid==true){
switch(data.account_type){
case OFX_CHECKING :
- default_type=BANK;
+ default_type=ACCT_TYPE_BANK;
account_type_name = g_strdup_printf(_("Unknown OFX checking account"));
break;
case OFX_SAVINGS :
- default_type=BANK;
+ default_type=ACCT_TYPE_BANK;
account_type_name = g_strdup_printf(_("Unknown OFX savings account"));
break;
case OFX_MONEYMRKT :
- default_type=MONEYMRKT;
+ default_type=ACCT_TYPE_MONEYMRKT;
account_type_name = g_strdup_printf(_("Unknown OFX money market account"));
break;
case OFX_CREDITLINE :
- default_type=CREDITLINE;
+ default_type=ACCT_TYPE_CREDITLINE;
account_type_name = g_strdup_printf(_("Unknown OFX credit line account"));
break;
case OFX_CMA :
- default_type=NO_TYPE;
+ default_type=ACCT_TYPE_NONE;
account_type_name = g_strdup_printf(_("Unknown OFX CMA account"));
break;
case OFX_CREDITCARD :
- default_type=CREDIT;
+ default_type=ACCT_TYPE_CREDIT;
account_type_name = g_strdup_printf(_("Unknown OFX credit card account"));
break;
case OFX_INVESTMENT :
- default_type=BANK;
+ default_type=ACCT_TYPE_BANK;
account_type_name = g_strdup_printf(_("Unknown OFX investment account"));
break;
default: PERR("WRITEME: ofx_proc_account() This is an unknown account type!");
Modified: gnucash/trunk/src/import-export/qif/qif-parse.c
===================================================================
--- gnucash/trunk/src/import-export/qif/qif-parse.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/import-export/qif/qif-parse.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -213,24 +213,30 @@
qif_atype_map = g_hash_table_new(g_str_hash, g_str_equal);
g_assert(qif_atype_map);
- QIF_ADD_ATYPE("bank", make_list(1, BANK));
- QIF_ADD_ATYPE("port", make_list(1, BANK));
- QIF_ADD_ATYPE("cash", make_list(1, CASH));
- QIF_ADD_ATYPE("ccard", make_list(1, CREDIT));
- QIF_ADD_ATYPE("invst", make_list(3, BANK, STOCK, MUTUAL));
- QIF_ADD_ATYPE("oth a", make_list(3, ASSET, BANK, CASH));
- QIF_ADD_ATYPE("oth l", make_list(2, LIABILITY, CREDIT));
- QIF_ADD_ATYPE("mutual", make_list(3, BANK, MUTUAL, STOCK));
+ QIF_ADD_ATYPE("bank", make_list(1, ACCT_TYPE_BANK));
+ QIF_ADD_ATYPE("port", make_list(1, ACCT_TYPE_BANK));
+ QIF_ADD_ATYPE("cash", make_list(1, ACCT_TYPE_CASH));
+ QIF_ADD_ATYPE("ccard", make_list(1, ACCT_TYPE_CREDIT));
+ QIF_ADD_ATYPE("invst", make_list(3, ACCT_TYPE_BANK, ACCT_TYPE_STOCK,
+ ACCT_TYPE_MUTUAL));
+ QIF_ADD_ATYPE("oth a", make_list(3, ACCT_TYPE_ASSET, ACCT_TYPE_BANK,
+ ACCT_TYPE_CASH));
+ QIF_ADD_ATYPE("oth l", make_list(2, ACCT_TYPE_LIABILITY, ACCT_TYPE_CREDIT));
+ QIF_ADD_ATYPE("mutual", make_list(3, ACCT_TYPE_BANK, ACCT_TYPE_MUTUAL,
+ ACCT_TYPE_STOCK));
/* Internal types */
- QIF_ADD_ATYPE("__any_bank__", make_list(5, BANK, CREDIT, CASH, ASSET,
- LIABILITY));
- QIF_ADD_ATYPE("__all__", make_list(7, BANK, CREDIT, CASH, ASSET, LIABILITY,
- STOCK, MUTUAL));
- QIF_ADD_ATYPE("__stock__", make_list(2, STOCK, MUTUAL));
- QIF_ADD_ATYPE("__income__", make_list(1, INCOME));
- QIF_ADD_ATYPE("__expense__", make_list(1, EXPENSE));
- QIF_ADD_ATYPE("__equity__", make_list(1, EQUITY));
+ QIF_ADD_ATYPE("__any_bank__", make_list(5, ACCT_TYPE_BANK, ACCT_TYPE_CREDIT,
+ ACCT_TYPE_CASH, ACCT_TYPE_ASSET,
+ ACCT_TYPE_LIABILITY));
+ QIF_ADD_ATYPE("__all__", make_list(7, ACCT_TYPE_BANK, ACCT_TYPE_CREDIT,
+ ACCT_TYPE_CASH, ACCT_TYPE_ASSET,
+ ACCT_TYPE_LIABILITY, ACCT_TYPE_STOCK,
+ ACCT_TYPE_MUTUAL));
+ QIF_ADD_ATYPE("__stock__", make_list(2, ACCT_TYPE_STOCK, ACCT_TYPE_MUTUAL));
+ QIF_ADD_ATYPE("__income__", make_list(1, ACCT_TYPE_INCOME));
+ QIF_ADD_ATYPE("__expense__", make_list(1, ACCT_TYPE_EXPENSE));
+ QIF_ADD_ATYPE("__equity__", make_list(1, ACCT_TYPE_EQUITY));
}
#undef QIF_ADD_ATYPE
Modified: gnucash/trunk/src/register/ledger-core/gnc-ledger-display.c
===================================================================
--- gnucash/trunk/src/register/ledger-core/gnc-ledger-display.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/register/ledger-core/gnc-ledger-display.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -200,8 +200,8 @@
switch (type) {
#if 0
- case PAYABLE:
- case RECEIVABLE:
+ case ACCT_TYPE_PAYABLE:
+ case ACCT_TYPE_RECEIVABLE:
new_style = REG_STYLE_LEDGER;
break;
#endif
@@ -246,41 +246,41 @@
{
switch (account_type)
{
- case BANK:
+ case ACCT_TYPE_BANK:
return BANK_REGISTER;
- case CASH:
+ case ACCT_TYPE_CASH:
return CASH_REGISTER;
- case ASSET:
+ case ACCT_TYPE_ASSET:
return ASSET_REGISTER;
- case CREDIT:
+ case ACCT_TYPE_CREDIT:
return CREDIT_REGISTER;
- case LIABILITY:
+ case ACCT_TYPE_LIABILITY:
return LIABILITY_REGISTER;
- case PAYABLE:
+ case ACCT_TYPE_PAYABLE:
return PAYABLE_REGISTER;
- case RECEIVABLE:
+ case ACCT_TYPE_RECEIVABLE:
return RECEIVABLE_REGISTER;
- case STOCK:
- case MUTUAL:
+ case ACCT_TYPE_STOCK:
+ case ACCT_TYPE_MUTUAL:
return STOCK_REGISTER;
- case INCOME:
+ case ACCT_TYPE_INCOME:
return INCOME_REGISTER;
- case EXPENSE:
+ case ACCT_TYPE_EXPENSE:
return EXPENSE_REGISTER;
- case EQUITY:
+ case ACCT_TYPE_EQUITY:
return EQUITY_REGISTER;
- case CURRENCY:
+ case ACCT_TYPE_CURRENCY:
return CURRENCY_REGISTER;
default:
@@ -297,17 +297,17 @@
switch (account_type)
{
- case BANK:
- case CASH:
- case ASSET:
- case CREDIT:
- case LIABILITY:
- case RECEIVABLE:
- case PAYABLE:
+ case ACCT_TYPE_BANK:
+ case ACCT_TYPE_CASH:
+ case ACCT_TYPE_ASSET:
+ case ACCT_TYPE_CREDIT:
+ case ACCT_TYPE_LIABILITY:
+ case ACCT_TYPE_RECEIVABLE:
+ case ACCT_TYPE_PAYABLE:
{
- /* If any of the sub-accounts have STOCK or MUTUAL types,
- * then we must use the PORTFOLIO_LEDGER ledger. Otherwise,
- * a plain old GENERAL_LEDGER will do. */
+ /* If any of the sub-accounts have ACCT_TYPE_STOCK or
+ * ACCT_TYPE_MUTUAL types, then we must use the PORTFOLIO_LEDGER
+ * ledger. Otherwise, a plain old GENERAL_LEDGER will do. */
gpointer ret;
reg_type = GENERAL_LEDGER;
@@ -318,18 +318,18 @@
break;
}
- case STOCK:
- case MUTUAL:
- case CURRENCY:
+ case ACCT_TYPE_STOCK:
+ case ACCT_TYPE_MUTUAL:
+ case ACCT_TYPE_CURRENCY:
reg_type = PORTFOLIO_LEDGER;
break;
- case INCOME:
- case EXPENSE:
+ case ACCT_TYPE_INCOME:
+ case ACCT_TYPE_EXPENSE:
reg_type = INCOME_LEDGER;
break;
- case EQUITY:
+ case ACCT_TYPE_EQUITY:
reg_type = GENERAL_LEDGER;
break;
@@ -360,8 +360,8 @@
gboolean use_double_line;
switch (acc_type) {
- case PAYABLE:
- case RECEIVABLE:
+ case ACCT_TYPE_PAYABLE:
+ case ACCT_TYPE_RECEIVABLE:
use_double_line = TRUE;
break;
default:
Modified: gnucash/trunk/src/register/ledger-core/split-register-model.c
===================================================================
--- gnucash/trunk/src/register/ledger-core/split-register-model.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/register/ledger-core/split-register-model.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -2161,8 +2161,8 @@
/* FIXME: We really only need a due date for 'invoices', not for
* 'payments' or 'receipts'. This implies we really only need the
- * due-date for transactions that credit the RECEIVABLE or debit
- * the PAYABLE account type.
+ * due-date for transactions that credit the ACCT_TYPE_RECEIVABLE or
+ * debit the ACCT_TYPE_PAYABLE account type.
*/
gnc_table_model_set_io_flags_handler(
model, gnc_split_register_get_rate_io_flags, RATE_CELL);
Modified: gnucash/trunk/src/register/ledger-core/split-register.c
===================================================================
--- gnucash/trunk/src/register/ledger-core/split-register.c 2006-08-06 10:38:12 UTC (rev 14598)
+++ gnucash/trunk/src/register/ledger-core/split-register.c 2006-08-06 22:07:12 UTC (rev 14599)
@@ -1839,37 +1839,37 @@
switch (sr_type)
{
case BANK_REGISTER:
- return BANK;
+ return ACCT_TYPE_BANK;
case CASH_REGISTER:
- return CASH;
+ return ACCT_TYPE_CASH;
case ASSET_REGISTER:
- return ASSET;
+ return ACCT_TYPE_ASSET;
case CREDIT_REGISTER:
- return CREDIT;
+ return ACCT_TYPE_CREDIT;
case LIABILITY_REGISTER:
- return LIABILITY;
+ return ACCT_TYPE_LIABILITY;
case PAYABLE_REGISTER:
- return PAYABLE;
+ return ACCT_TYPE_PAYABLE;
case RECEIVABLE_REGISTER:
- return RECEIVABLE;
+ return ACCT_TYPE_RECEIVABLE;
case INCOME_LEDGER:
case INCOME_REGISTER:
- return INCOME;
+ return ACCT_TYPE_INCOME;
case EXPENSE_REGISTER:
- return EXPENSE;
+ return ACCT_TYPE_EXPENSE;
case STOCK_REGISTER:
case PORTFOLIO_LEDGER:
- return STOCK;
+ return ACCT_TYPE_STOCK;
case CURRENCY_REGISTER:
- return CURRENCY;
+ return ACCT_TYPE_CURRENCY;
case GENERAL_LEDGER:
- return NO_TYPE;
+ return ACCT_TYPE_NONE;
case EQUITY_REGISTER:
- return EQUITY;
+ return ACCT_TYPE_EQUITY;
case SEARCH_LEDGER:
- return NO_TYPE;
+ return ACCT_TYPE_NONE;
default:
- return NO_TYPE;
+ return ACCT_TYPE_NONE;
}
}
More information about the gnucash-changes
mailing list