GnuCash c935c2f+
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 2031 of file assistant-stock-transaction.cpp.

Constructor & Destructor Documentation

◆ PageCash()

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

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

2046 : m_page(get_widget(builder, "cash_details_page")),
2047 m_account(builder, {ACCT_TYPE_ASSET, ACCT_TYPE_BANK},
2049 xaccAccountGetAssociatedAccount (account, PROCEEDS_KVP_TAG)),
2050 m_memo(get_widget(builder, "cash_memo_entry")),
2051 m_value(builder, gnc_account_get_currency_or_parent(account))
2052{
2053 m_account.attach (builder, "cash_table", "cash_account_label", 0);
2054 m_value.attach (builder, "cash_table", "cash_label", 1);
2055}
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 2058 of file assistant-stock-transaction.cpp.

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

◆ get_memo()

const char * PageCash::get_memo ( )

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

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

◆ prepare()

void PageCash::prepare ( StockTransactionEntry entry)

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

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

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