GnuCash 038f90a+
Loading...
Searching...
No Matches
Public Member Functions
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 2034 of file assistant-stock-transaction.cpp.

Constructor & Destructor Documentation

◆ PageCash()

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

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

2049 : m_page(get_widget(builder, "cash_details_page")),
2050 m_account(builder, {ACCT_TYPE_ASSET, ACCT_TYPE_BANK},
2052 xaccAccountGetAssociatedAccount (account, PROCEEDS_KVP_TAG)),
2053 m_memo(get_widget(builder, "cash_memo_entry")),
2054 m_value(builder, gnc_account_get_currency_or_parent(account))
2055{
2056 m_account.attach (builder, "cash_table", "cash_account_label", 0);
2057 m_value.attach (builder, "cash_table", "cash_label", 1);
2058}
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:3415
Account * xaccAccountGetAssociatedAccount(const Account *acc, const char *tag)
Get the account's associated account e.g.
Definition Account.cpp:3387
@ 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 2061 of file assistant-stock-transaction.cpp.

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

◆ get_memo()

const char * PageCash::get_memo ( )

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

2080{
2081 return gtk_entry_get_text(GTK_ENTRY (m_memo));
2082}

◆ prepare()

void PageCash::prepare ( StockTransactionEntry entry)

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

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

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