First-pass at A/R and A/P accounts. Right now there is nothing

special about them compared the Asset and Liability accounts except
the labels are slightly different.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6062 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Derek Atkins 2001-11-25 21:41:34 +00:00
parent d56d652de8
commit 60dbedd7f4
13 changed files with 75 additions and 16 deletions

View File

@ -134,6 +134,7 @@ gnc_configure_reverse_balance (void)
else if (safe_strcmp (choice, "credit") == 0)
{
reverse_type[LIABILITY] = TRUE;
reverse_type[PAYABLE] = TRUE;
reverse_type[EQUITY] = TRUE;
reverse_type[INCOME] = TRUE;
reverse_type[CREDIT] = TRUE;

View File

@ -111,6 +111,8 @@
(cons 'CURRENCY (N_ "Buy"))
(cons 'INCOME (N_ "Charge"))
(cons 'EXPENSE (N_ "Expense"))
(cons 'PAYABLE (N_ "Payment"))
(cons 'RECEIVABLE (N_ "Invoice"))
(cons 'EQUITY (N_ "Decrease"))))
(define gnc:*credit-strings*
@ -125,6 +127,8 @@
(cons 'CURRENCY (N_ "Sell"))
(cons 'INCOME (N_ "Income"))
(cons 'EXPENSE (N_ "Rebate"))
(cons 'PAYABLE (N_ "Invoice"))
(cons 'RECEIVABLE (N_ "Receipt"))
(cons 'EQUITY (N_ "Increase"))))
(define (gnc:get-debit-string type)
@ -331,7 +335,7 @@ not each row")
(N_ "Reconcile") (N_ "Automatic interest transfer")
"a" (N_ "Prior to reconciling an account which charges or pays interest, \
prompt the user to enter a transaction for the interest charge or payment.
Currently only enabled for Bank, Credit, Mutual, Asset, and Liability accounts.")
Currently only enabled for Bank, Credit, Mutual, Asset, Receivable, Payable, and Liability accounts.")
#f))
(gnc:register-configuration-option
@ -450,7 +454,7 @@ Control Center"))))))
(list->vector
(list 'credit
(N_ "Credit Accounts")
(N_ "Reverse Credit Card, Liability, Equity, and Income \
(N_ "Reverse Credit Card, Payable, Liability, Equity, and Income \
Accounts")))
(list->vector
(list 'none

View File

@ -1192,11 +1192,11 @@ xaccTransFixSplitDateOrder (Transaction *trans)
* order for report generation */
static int typeorder[NUM_ACCOUNT_TYPES] = {
BANK, STOCK, MUTUAL, CURRENCY, CASH, ASSET,
CREDIT, LIABILITY, INCOME, EXPENSE, EQUITY };
BANK, STOCK, MUTUAL, CURRENCY, CASH, ASSET, RECEIVABLE,
CREDIT, LIABILITY, PAYABLE, INCOME, EXPENSE, EQUITY };
static int revorder[NUM_ACCOUNT_TYPES] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
int
@ -1919,6 +1919,8 @@ xaccAccountTypeEnumAsString(GNCAccountType type) {
GNC_RETURN_ENUM_AS_STRING(INCOME);
GNC_RETURN_ENUM_AS_STRING(EXPENSE);
GNC_RETURN_ENUM_AS_STRING(EQUITY);
GNC_RETURN_ENUM_AS_STRING(RECEIVABLE);
GNC_RETURN_ENUM_AS_STRING(PAYABLE);
GNC_RETURN_ENUM_AS_STRING(CHECKING);
GNC_RETURN_ENUM_AS_STRING(SAVINGS);
GNC_RETURN_ENUM_AS_STRING(MONEYMRKT);
@ -1950,6 +1952,8 @@ xaccAccountStringToType(const char* str, GNCAccountType *type) {
GNC_RETURN_ON_MATCH(INCOME);
GNC_RETURN_ON_MATCH(EXPENSE);
GNC_RETURN_ON_MATCH(EQUITY);
GNC_RETURN_ON_MATCH(RECEIVABLE);
GNC_RETURN_ON_MATCH(PAYABLE);
GNC_RETURN_ON_MATCH(CHECKING);
GNC_RETURN_ON_MATCH(SAVINGS);
GNC_RETURN_ON_MATCH(MONEYMRKT);
@ -1989,7 +1993,9 @@ account_type_name[NUM_ACCOUNT_TYPES] = {
N_("Currency"),
N_("Income"),
N_("Expense"),
N_("Equity")
N_("Equity"),
N_("A/Receivable"),
N_("A/Payable")
/*
N_("Checking"),
N_("Savings"),
@ -2024,6 +2030,8 @@ xaccAccountTypesCompatible (GNCAccountType parent_type,
case CURRENCY:
case CREDIT:
case LIABILITY:
case RECEIVABLE:
case PAYABLE:
compatible = ((child_type == BANK) ||
(child_type == CASH) ||
(child_type == ASSET) ||
@ -2031,7 +2039,9 @@ xaccAccountTypesCompatible (GNCAccountType parent_type,
(child_type == MUTUAL) ||
(child_type == CURRENCY) ||
(child_type == CREDIT) ||
(child_type == LIABILITY));
(child_type == LIABILITY)||
(child_type == RECEIVABLE)||
(child_type == PAYABLE));
break;
case INCOME:
case EXPENSE:

View File

@ -91,14 +91,18 @@ typedef enum
EQUITY = 10,
/* Equity account is used to balance the balance sheet. */
NUM_ACCOUNT_TYPES = 11,
RECEIVABLE = 11,
PAYABLE = 12,
/* A/R and A/P account types */
NUM_ACCOUNT_TYPES = 13,
/* stop here; the following types just aren't ready for prime time */
/* bank account types */
CHECKING = 11,
SAVINGS = 12,
MONEYMRKT = 13,
CREDITLINE = 14, /* line of credit */
CHECKING = 13,
SAVINGS = 14,
MONEYMRKT = 15,
CREDITLINE = 16, /* line of credit */
} GNCAccountType;
/* ------------------ */

View File

@ -503,6 +503,8 @@
(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 "NUM_ACCOUNT_TYPES" 'num-account-types)
(gw:enum-add-value! we "CHECKING" 'checking)
(gw:enum-add-value! we "SAVINGS" 'savings)

View File

@ -644,6 +644,12 @@ gnc_acct_tree_window_configure (GNCAcctTreeWin * info) {
else if (safe_strcmp(node->data, "equity") == 0)
new_avi.include_type[EQUITY] = TRUE;
else if (safe_strcmp(node->data, "payable") == 0)
new_avi.include_type[PAYABLE] = TRUE;
else if (safe_strcmp(node->data, "receivable") == 0)
new_avi.include_type[RECEIVABLE] = TRUE;
}
gnc_free_list_option_value (list);

View File

@ -290,6 +290,8 @@ gnc_ui_accounts_recurse (AccountGroup *group, GList **currency_list,
case MUTUAL:
case CREDIT:
case LIABILITY:
case PAYABLE:
case RECEIVABLE:
amount = gnc_ui_account_get_balance (account, FALSE);
/* unreverse sign */
if (gnc_reverse_balance (account))

View File

@ -137,11 +137,13 @@ typedef struct _startRecnWindowData
* 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) == LIABILITY) ||\
((type) == PAYABLE))
#define account_type_has_auto_interest_payment(type) (((type) == BANK) || \
((type) == ASSET) || \
((type) == MUTUAL))
((type) == MUTUAL) || \
((type) == RECEIVABLE))
#define account_type_has_auto_interest_xfer(type) \
( account_type_has_auto_interest_charge(type) || \

View File

@ -259,6 +259,12 @@ gnc_get_reg_type (Account *leader, GNCLedgerDisplayType ld_type)
case LIABILITY:
return LIABILITY_REGISTER;
case PAYABLE:
return PAYABLE_REGISTER;
case RECEIVABLE:
return RECEIVABLE_REGISTER;
case STOCK:
case MUTUAL:
return STOCK_REGISTER;
@ -296,6 +302,8 @@ gnc_get_reg_type (Account *leader, GNCLedgerDisplayType ld_type)
case ASSET:
case CREDIT:
case LIABILITY:
case RECEIVABLE:
case 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. */

View File

@ -88,6 +88,8 @@ gnc_split_register_set_cells (SplitRegister *reg, TableLayout *layout)
case ASSET_REGISTER:
case CREDIT_REGISTER:
case LIABILITY_REGISTER:
case PAYABLE_REGISTER:
case RECEIVABLE_REGISTER:
case INCOME_REGISTER:
case EXPENSE_REGISTER:
case EQUITY_REGISTER:
@ -371,6 +373,8 @@ gnc_split_register_layout_add_cursors (SplitRegister *reg,
case ASSET_REGISTER:
case CREDIT_REGISTER:
case LIABILITY_REGISTER:
case PAYABLE_REGISTER:
case RECEIVABLE_REGISTER:
case INCOME_REGISTER:
case EXPENSE_REGISTER:
case EQUITY_REGISTER:

View File

@ -1822,6 +1822,10 @@ gnc_split_register_type_to_account_type (SplitRegisterType sr_type)
return CREDIT;
case LIABILITY_REGISTER:
return LIABILITY;
case PAYABLE_REGISTER:
return PAYABLE;
case RECEIVABLE_REGISTER:
return RECEIVABLE;
case INCOME_LEDGER:
case INCOME_REGISTER:
return INCOME;
@ -1988,6 +1992,14 @@ gnc_split_register_config_action (SplitRegister *reg)
gnc_combo_cell_add_menu_item (cell, _("Int"));
gnc_combo_cell_add_menu_item (cell, _("Payment"));
break;
case RECEIVABLE_REGISTER:
gnc_combo_cell_add_menu_item (cell, _("Invoice"));
gnc_combo_cell_add_menu_item (cell, _("Receipt"));
break;
case PAYABLE_REGISTER:
gnc_combo_cell_add_menu_item (cell, _("Invoice"));
gnc_combo_cell_add_menu_item (cell, _("Payment"));
break;
case INCOME_LEDGER:
case INCOME_REGISTER:
gnc_combo_cell_add_menu_item (cell, _("Buy"));

View File

@ -48,6 +48,8 @@ typedef enum
EQUITY_REGISTER,
STOCK_REGISTER,
CURRENCY_REGISTER,
RECEIVABLE_REGISTER,
PAYABLE_REGISTER,
NUM_SINGLE_REGISTER_TYPES,
GENERAL_LEDGER = NUM_SINGLE_REGISTER_TYPES,

View File

@ -56,7 +56,7 @@ the account instead of opening a register.") #f))
(N_ "Account Tree") (N_ "Account types to display")
"b" ""
(list 'bank 'cash 'credit 'asset 'liability 'stock
'mutual 'currency 'income 'expense 'equity)
'mutual 'currency 'income 'expense 'equity 'payable 'receivable)
(list (list->vector (list 'bank (N_ "Bank") ""))
(list->vector (list 'cash (N_ "Cash") ""))
(list->vector (list 'credit (N_ "Credit") ""))
@ -67,7 +67,9 @@ the account instead of opening a register.") #f))
(list->vector (list 'currency (N_ "Currency") ""))
(list->vector (list 'income (N_ "Income") ""))
(list->vector (list 'expense (N_ "Expense") ""))
(list->vector (list 'equity (N_ "Equity") "")))))
(list->vector (list 'equity (N_ "Equity") ""))
(list->vector (list 'payable (N_ "Accounts Payable") ""))
(list->vector (list 'receivable (N_ "Accounts Receivable") "")))))
(add-option
(gnc:make-list-option