mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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:
parent
d56d652de8
commit
60dbedd7f4
@ -134,6 +134,7 @@ gnc_configure_reverse_balance (void)
|
|||||||
else if (safe_strcmp (choice, "credit") == 0)
|
else if (safe_strcmp (choice, "credit") == 0)
|
||||||
{
|
{
|
||||||
reverse_type[LIABILITY] = TRUE;
|
reverse_type[LIABILITY] = TRUE;
|
||||||
|
reverse_type[PAYABLE] = TRUE;
|
||||||
reverse_type[EQUITY] = TRUE;
|
reverse_type[EQUITY] = TRUE;
|
||||||
reverse_type[INCOME] = TRUE;
|
reverse_type[INCOME] = TRUE;
|
||||||
reverse_type[CREDIT] = TRUE;
|
reverse_type[CREDIT] = TRUE;
|
||||||
|
@ -111,6 +111,8 @@
|
|||||||
(cons 'CURRENCY (N_ "Buy"))
|
(cons 'CURRENCY (N_ "Buy"))
|
||||||
(cons 'INCOME (N_ "Charge"))
|
(cons 'INCOME (N_ "Charge"))
|
||||||
(cons 'EXPENSE (N_ "Expense"))
|
(cons 'EXPENSE (N_ "Expense"))
|
||||||
|
(cons 'PAYABLE (N_ "Payment"))
|
||||||
|
(cons 'RECEIVABLE (N_ "Invoice"))
|
||||||
(cons 'EQUITY (N_ "Decrease"))))
|
(cons 'EQUITY (N_ "Decrease"))))
|
||||||
|
|
||||||
(define gnc:*credit-strings*
|
(define gnc:*credit-strings*
|
||||||
@ -125,6 +127,8 @@
|
|||||||
(cons 'CURRENCY (N_ "Sell"))
|
(cons 'CURRENCY (N_ "Sell"))
|
||||||
(cons 'INCOME (N_ "Income"))
|
(cons 'INCOME (N_ "Income"))
|
||||||
(cons 'EXPENSE (N_ "Rebate"))
|
(cons 'EXPENSE (N_ "Rebate"))
|
||||||
|
(cons 'PAYABLE (N_ "Invoice"))
|
||||||
|
(cons 'RECEIVABLE (N_ "Receipt"))
|
||||||
(cons 'EQUITY (N_ "Increase"))))
|
(cons 'EQUITY (N_ "Increase"))))
|
||||||
|
|
||||||
(define (gnc:get-debit-string type)
|
(define (gnc:get-debit-string type)
|
||||||
@ -331,7 +335,7 @@ not each row")
|
|||||||
(N_ "Reconcile") (N_ "Automatic interest transfer")
|
(N_ "Reconcile") (N_ "Automatic interest transfer")
|
||||||
"a" (N_ "Prior to reconciling an account which charges or pays interest, \
|
"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.
|
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))
|
#f))
|
||||||
|
|
||||||
(gnc:register-configuration-option
|
(gnc:register-configuration-option
|
||||||
@ -450,7 +454,7 @@ Control Center"))))))
|
|||||||
(list->vector
|
(list->vector
|
||||||
(list 'credit
|
(list 'credit
|
||||||
(N_ "Credit Accounts")
|
(N_ "Credit Accounts")
|
||||||
(N_ "Reverse Credit Card, Liability, Equity, and Income \
|
(N_ "Reverse Credit Card, Payable, Liability, Equity, and Income \
|
||||||
Accounts")))
|
Accounts")))
|
||||||
(list->vector
|
(list->vector
|
||||||
(list 'none
|
(list 'none
|
||||||
|
@ -1192,11 +1192,11 @@ xaccTransFixSplitDateOrder (Transaction *trans)
|
|||||||
* order for report generation */
|
* order for report generation */
|
||||||
|
|
||||||
static int typeorder[NUM_ACCOUNT_TYPES] = {
|
static int typeorder[NUM_ACCOUNT_TYPES] = {
|
||||||
BANK, STOCK, MUTUAL, CURRENCY, CASH, ASSET,
|
BANK, STOCK, MUTUAL, CURRENCY, CASH, ASSET, RECEIVABLE,
|
||||||
CREDIT, LIABILITY, INCOME, EXPENSE, EQUITY };
|
CREDIT, LIABILITY, PAYABLE, INCOME, EXPENSE, EQUITY };
|
||||||
|
|
||||||
static int revorder[NUM_ACCOUNT_TYPES] = {
|
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
|
int
|
||||||
@ -1919,6 +1919,8 @@ xaccAccountTypeEnumAsString(GNCAccountType type) {
|
|||||||
GNC_RETURN_ENUM_AS_STRING(INCOME);
|
GNC_RETURN_ENUM_AS_STRING(INCOME);
|
||||||
GNC_RETURN_ENUM_AS_STRING(EXPENSE);
|
GNC_RETURN_ENUM_AS_STRING(EXPENSE);
|
||||||
GNC_RETURN_ENUM_AS_STRING(EQUITY);
|
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(CHECKING);
|
||||||
GNC_RETURN_ENUM_AS_STRING(SAVINGS);
|
GNC_RETURN_ENUM_AS_STRING(SAVINGS);
|
||||||
GNC_RETURN_ENUM_AS_STRING(MONEYMRKT);
|
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(INCOME);
|
||||||
GNC_RETURN_ON_MATCH(EXPENSE);
|
GNC_RETURN_ON_MATCH(EXPENSE);
|
||||||
GNC_RETURN_ON_MATCH(EQUITY);
|
GNC_RETURN_ON_MATCH(EQUITY);
|
||||||
|
GNC_RETURN_ON_MATCH(RECEIVABLE);
|
||||||
|
GNC_RETURN_ON_MATCH(PAYABLE);
|
||||||
GNC_RETURN_ON_MATCH(CHECKING);
|
GNC_RETURN_ON_MATCH(CHECKING);
|
||||||
GNC_RETURN_ON_MATCH(SAVINGS);
|
GNC_RETURN_ON_MATCH(SAVINGS);
|
||||||
GNC_RETURN_ON_MATCH(MONEYMRKT);
|
GNC_RETURN_ON_MATCH(MONEYMRKT);
|
||||||
@ -1989,7 +1993,9 @@ account_type_name[NUM_ACCOUNT_TYPES] = {
|
|||||||
N_("Currency"),
|
N_("Currency"),
|
||||||
N_("Income"),
|
N_("Income"),
|
||||||
N_("Expense"),
|
N_("Expense"),
|
||||||
N_("Equity")
|
N_("Equity"),
|
||||||
|
N_("A/Receivable"),
|
||||||
|
N_("A/Payable")
|
||||||
/*
|
/*
|
||||||
N_("Checking"),
|
N_("Checking"),
|
||||||
N_("Savings"),
|
N_("Savings"),
|
||||||
@ -2024,6 +2030,8 @@ xaccAccountTypesCompatible (GNCAccountType parent_type,
|
|||||||
case CURRENCY:
|
case CURRENCY:
|
||||||
case CREDIT:
|
case CREDIT:
|
||||||
case LIABILITY:
|
case LIABILITY:
|
||||||
|
case RECEIVABLE:
|
||||||
|
case PAYABLE:
|
||||||
compatible = ((child_type == BANK) ||
|
compatible = ((child_type == BANK) ||
|
||||||
(child_type == CASH) ||
|
(child_type == CASH) ||
|
||||||
(child_type == ASSET) ||
|
(child_type == ASSET) ||
|
||||||
@ -2031,7 +2039,9 @@ xaccAccountTypesCompatible (GNCAccountType parent_type,
|
|||||||
(child_type == MUTUAL) ||
|
(child_type == MUTUAL) ||
|
||||||
(child_type == CURRENCY) ||
|
(child_type == CURRENCY) ||
|
||||||
(child_type == CREDIT) ||
|
(child_type == CREDIT) ||
|
||||||
(child_type == LIABILITY));
|
(child_type == LIABILITY)||
|
||||||
|
(child_type == RECEIVABLE)||
|
||||||
|
(child_type == PAYABLE));
|
||||||
break;
|
break;
|
||||||
case INCOME:
|
case INCOME:
|
||||||
case EXPENSE:
|
case EXPENSE:
|
||||||
|
@ -91,14 +91,18 @@ typedef enum
|
|||||||
EQUITY = 10,
|
EQUITY = 10,
|
||||||
/* Equity account is used to balance the balance sheet. */
|
/* 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 */
|
/* stop here; the following types just aren't ready for prime time */
|
||||||
|
|
||||||
/* bank account types */
|
/* bank account types */
|
||||||
CHECKING = 11,
|
CHECKING = 13,
|
||||||
SAVINGS = 12,
|
SAVINGS = 14,
|
||||||
MONEYMRKT = 13,
|
MONEYMRKT = 15,
|
||||||
CREDITLINE = 14, /* line of credit */
|
CREDITLINE = 16, /* line of credit */
|
||||||
} GNCAccountType;
|
} GNCAccountType;
|
||||||
|
|
||||||
/* ------------------ */
|
/* ------------------ */
|
||||||
|
@ -503,6 +503,8 @@
|
|||||||
(gw:enum-add-value! we "INCOME" 'income)
|
(gw:enum-add-value! we "INCOME" 'income)
|
||||||
(gw:enum-add-value! we "EXPENSE" 'expense)
|
(gw:enum-add-value! we "EXPENSE" 'expense)
|
||||||
(gw:enum-add-value! we "EQUITY" 'equity)
|
(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 "NUM_ACCOUNT_TYPES" 'num-account-types)
|
||||||
(gw:enum-add-value! we "CHECKING" 'checking)
|
(gw:enum-add-value! we "CHECKING" 'checking)
|
||||||
(gw:enum-add-value! we "SAVINGS" 'savings)
|
(gw:enum-add-value! we "SAVINGS" 'savings)
|
||||||
|
@ -644,6 +644,12 @@ gnc_acct_tree_window_configure (GNCAcctTreeWin * info) {
|
|||||||
|
|
||||||
else if (safe_strcmp(node->data, "equity") == 0)
|
else if (safe_strcmp(node->data, "equity") == 0)
|
||||||
new_avi.include_type[EQUITY] = TRUE;
|
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);
|
gnc_free_list_option_value (list);
|
||||||
|
@ -290,6 +290,8 @@ gnc_ui_accounts_recurse (AccountGroup *group, GList **currency_list,
|
|||||||
case MUTUAL:
|
case MUTUAL:
|
||||||
case CREDIT:
|
case CREDIT:
|
||||||
case LIABILITY:
|
case LIABILITY:
|
||||||
|
case PAYABLE:
|
||||||
|
case RECEIVABLE:
|
||||||
amount = gnc_ui_account_get_balance (account, FALSE);
|
amount = gnc_ui_account_get_balance (account, FALSE);
|
||||||
/* unreverse sign */
|
/* unreverse sign */
|
||||||
if (gnc_reverse_balance (account))
|
if (gnc_reverse_balance (account))
|
||||||
|
@ -137,11 +137,13 @@ typedef struct _startRecnWindowData
|
|||||||
* xfer dialog could pop up, if the user's preferences allow it.
|
* xfer dialog could pop up, if the user's preferences allow it.
|
||||||
*/
|
*/
|
||||||
#define account_type_has_auto_interest_charge(type) (((type) == CREDIT) || \
|
#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) || \
|
#define account_type_has_auto_interest_payment(type) (((type) == BANK) || \
|
||||||
((type) == ASSET) || \
|
((type) == ASSET) || \
|
||||||
((type) == MUTUAL))
|
((type) == MUTUAL) || \
|
||||||
|
((type) == RECEIVABLE))
|
||||||
|
|
||||||
#define account_type_has_auto_interest_xfer(type) \
|
#define account_type_has_auto_interest_xfer(type) \
|
||||||
( account_type_has_auto_interest_charge(type) || \
|
( account_type_has_auto_interest_charge(type) || \
|
||||||
|
@ -259,6 +259,12 @@ gnc_get_reg_type (Account *leader, GNCLedgerDisplayType ld_type)
|
|||||||
case LIABILITY:
|
case LIABILITY:
|
||||||
return LIABILITY_REGISTER;
|
return LIABILITY_REGISTER;
|
||||||
|
|
||||||
|
case PAYABLE:
|
||||||
|
return PAYABLE_REGISTER;
|
||||||
|
|
||||||
|
case RECEIVABLE:
|
||||||
|
return RECEIVABLE_REGISTER;
|
||||||
|
|
||||||
case STOCK:
|
case STOCK:
|
||||||
case MUTUAL:
|
case MUTUAL:
|
||||||
return STOCK_REGISTER;
|
return STOCK_REGISTER;
|
||||||
@ -296,6 +302,8 @@ gnc_get_reg_type (Account *leader, GNCLedgerDisplayType ld_type)
|
|||||||
case ASSET:
|
case ASSET:
|
||||||
case CREDIT:
|
case CREDIT:
|
||||||
case LIABILITY:
|
case LIABILITY:
|
||||||
|
case RECEIVABLE:
|
||||||
|
case PAYABLE:
|
||||||
/* if any of the sub-accounts have STOCK or MUTUAL types,
|
/* if any of the sub-accounts have STOCK or MUTUAL types,
|
||||||
* then we must use the PORTFOLIO_LEDGER ledger. Otherwise,
|
* then we must use the PORTFOLIO_LEDGER ledger. Otherwise,
|
||||||
* a plain old GENERAL_LEDGER will do. */
|
* a plain old GENERAL_LEDGER will do. */
|
||||||
|
@ -88,6 +88,8 @@ gnc_split_register_set_cells (SplitRegister *reg, TableLayout *layout)
|
|||||||
case ASSET_REGISTER:
|
case ASSET_REGISTER:
|
||||||
case CREDIT_REGISTER:
|
case CREDIT_REGISTER:
|
||||||
case LIABILITY_REGISTER:
|
case LIABILITY_REGISTER:
|
||||||
|
case PAYABLE_REGISTER:
|
||||||
|
case RECEIVABLE_REGISTER:
|
||||||
case INCOME_REGISTER:
|
case INCOME_REGISTER:
|
||||||
case EXPENSE_REGISTER:
|
case EXPENSE_REGISTER:
|
||||||
case EQUITY_REGISTER:
|
case EQUITY_REGISTER:
|
||||||
@ -371,6 +373,8 @@ gnc_split_register_layout_add_cursors (SplitRegister *reg,
|
|||||||
case ASSET_REGISTER:
|
case ASSET_REGISTER:
|
||||||
case CREDIT_REGISTER:
|
case CREDIT_REGISTER:
|
||||||
case LIABILITY_REGISTER:
|
case LIABILITY_REGISTER:
|
||||||
|
case PAYABLE_REGISTER:
|
||||||
|
case RECEIVABLE_REGISTER:
|
||||||
case INCOME_REGISTER:
|
case INCOME_REGISTER:
|
||||||
case EXPENSE_REGISTER:
|
case EXPENSE_REGISTER:
|
||||||
case EQUITY_REGISTER:
|
case EQUITY_REGISTER:
|
||||||
|
@ -1822,6 +1822,10 @@ gnc_split_register_type_to_account_type (SplitRegisterType sr_type)
|
|||||||
return CREDIT;
|
return CREDIT;
|
||||||
case LIABILITY_REGISTER:
|
case LIABILITY_REGISTER:
|
||||||
return LIABILITY;
|
return LIABILITY;
|
||||||
|
case PAYABLE_REGISTER:
|
||||||
|
return PAYABLE;
|
||||||
|
case RECEIVABLE_REGISTER:
|
||||||
|
return RECEIVABLE;
|
||||||
case INCOME_LEDGER:
|
case INCOME_LEDGER:
|
||||||
case INCOME_REGISTER:
|
case INCOME_REGISTER:
|
||||||
return INCOME;
|
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, _("Int"));
|
||||||
gnc_combo_cell_add_menu_item (cell, _("Payment"));
|
gnc_combo_cell_add_menu_item (cell, _("Payment"));
|
||||||
break;
|
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_LEDGER:
|
||||||
case INCOME_REGISTER:
|
case INCOME_REGISTER:
|
||||||
gnc_combo_cell_add_menu_item (cell, _("Buy"));
|
gnc_combo_cell_add_menu_item (cell, _("Buy"));
|
||||||
|
@ -48,6 +48,8 @@ typedef enum
|
|||||||
EQUITY_REGISTER,
|
EQUITY_REGISTER,
|
||||||
STOCK_REGISTER,
|
STOCK_REGISTER,
|
||||||
CURRENCY_REGISTER,
|
CURRENCY_REGISTER,
|
||||||
|
RECEIVABLE_REGISTER,
|
||||||
|
PAYABLE_REGISTER,
|
||||||
NUM_SINGLE_REGISTER_TYPES,
|
NUM_SINGLE_REGISTER_TYPES,
|
||||||
|
|
||||||
GENERAL_LEDGER = NUM_SINGLE_REGISTER_TYPES,
|
GENERAL_LEDGER = NUM_SINGLE_REGISTER_TYPES,
|
||||||
|
@ -56,7 +56,7 @@ the account instead of opening a register.") #f))
|
|||||||
(N_ "Account Tree") (N_ "Account types to display")
|
(N_ "Account Tree") (N_ "Account types to display")
|
||||||
"b" ""
|
"b" ""
|
||||||
(list 'bank 'cash 'credit 'asset 'liability 'stock
|
(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 (list->vector (list 'bank (N_ "Bank") ""))
|
||||||
(list->vector (list 'cash (N_ "Cash") ""))
|
(list->vector (list 'cash (N_ "Cash") ""))
|
||||||
(list->vector (list 'credit (N_ "Credit") ""))
|
(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 'currency (N_ "Currency") ""))
|
||||||
(list->vector (list 'income (N_ "Income") ""))
|
(list->vector (list 'income (N_ "Income") ""))
|
||||||
(list->vector (list 'expense (N_ "Expense") ""))
|
(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
|
(add-option
|
||||||
(gnc:make-list-option
|
(gnc:make-list-option
|
||||||
|
Loading…
Reference in New Issue
Block a user