GnuCash 7574033+
Loading...
Searching...
No Matches
PageCash Class Reference

The Cash page collects the cash account (usually corresponds the broker's cash management account), the amount of cash, and the memo for the cash split. More...

Public Member Functions

 PageCash (GtkBuilder *builder, Account *account)
void connect (StockTransactionEntry *entry)
void prepare (StockTransactionEntry *entry)
const char * get_memo ()

Detailed Description

The Cash page collects the cash account (usually corresponds the broker's cash management account), the amount of cash, and the memo for the cash split.

Accounts are restricted to types ASSET and BANK.

Definition at line 2032 of file assistant-stock-transaction.cpp.

Constructor & Destructor Documentation

◆ PageCash()

PageCash::PageCash ( GtkBuilder * builder,
Account * account )

Definition at line 2046 of file assistant-stock-transaction.cpp.

2047 : m_page(get_widget(builder, "cash_details_page")),
2048 m_account(builder, {ACCT_TYPE_ASSET, ACCT_TYPE_BANK},
2050 xaccAccountGetAssociatedAccount (account, PROCEEDS_KVP_TAG)),
2051 m_memo(get_widget(builder, "cash_memo_entry")),
2052 m_value(builder, gnc_account_get_currency_or_parent(account))
2053{
2054 m_account.attach (builder, "cash_table", "cash_account_label", 0);
2055 m_value.attach (builder, "cash_table", "cash_label", 1);
2056}
gnc_commodity * gnc_account_get_currency_or_parent(const Account *account)
Returns a gnc_commodity that is a currency, suitable for being a Transaction's currency.
Definition Account.cpp:3396
Account * xaccAccountGetAssociatedAccount(const Account *acc, const char *tag)
Get the account's associated account e.g.
Definition Account.cpp:3368
@ ACCT_TYPE_BANK
The bank account type denotes a savings or checking account held at a bank.
Definition Account.h:107
@ ACCT_TYPE_ASSET
asset (and liability) accounts indicate generic, generalized accounts that are none of the above.
Definition Account.h:116

Member Function Documentation

◆ connect()

void PageCash::connect ( StockTransactionEntry * entry)

Definition at line 2059 of file assistant-stock-transaction.cpp.

2060{
2061 m_account.connect(entry);
2062 g_signal_connect(m_memo, "changed", G_CALLBACK(text_entry_changed_cb), entry);
2063 m_value.connect(G_CALLBACK(value_changed_cb), entry);
2064}

◆ get_memo()

const char * PageCash::get_memo ( )

Definition at line 2077 of file assistant-stock-transaction.cpp.

2078{
2079 return gtk_entry_get_text(GTK_ENTRY (m_memo));
2080}

◆ prepare()

void PageCash::prepare ( StockTransactionEntry * entry)

Definition at line 2067 of file assistant-stock-transaction.cpp.

2068{
2069 entry->set_memo(get_memo());
2070 if (!gnc_numeric_check(m_value.get()))
2071 entry->set_value(m_value.get());
2072 entry->set_account(m_account.get());
2073 g_signal_connect(m_page, "focus", G_CALLBACK(assistant_page_set_focus), m_value.widget());
2074}
GNCNumericErrorCode gnc_numeric_check(gnc_numeric in)
Check for error signal in value.

The documentation for this class was generated from the following file: