mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[assistant-stock-transaction] show stock acct when capitalizing fees
...in final page summary table. The ignore_account bool is thus not used anymore, and can be removed.
This commit is contained in:
parent
ff4c656bac
commit
2c5a5a0485
@ -633,8 +633,7 @@ add_error_str (StringVec& errors, const char* str)
|
|||||||
static void
|
static void
|
||||||
check_page (GtkListStore *list, gnc_numeric& debit, gnc_numeric& credit,
|
check_page (GtkListStore *list, gnc_numeric& debit, gnc_numeric& credit,
|
||||||
FieldMask splitfield, Account *acct, GtkWidget *memo, GtkWidget *gae,
|
FieldMask splitfield, Account *acct, GtkWidget *memo, GtkWidget *gae,
|
||||||
gnc_commodity *comm, bool ignore_account,
|
gnc_commodity *comm, const char* page, StringVec& errors)
|
||||||
const char* page, StringVec& errors)
|
|
||||||
{
|
{
|
||||||
if (splitfield == FieldMask::DISABLED)
|
if (splitfield == FieldMask::DISABLED)
|
||||||
return;
|
return;
|
||||||
@ -678,9 +677,7 @@ check_page (GtkListStore *list, gnc_numeric& debit, gnc_numeric& credit,
|
|||||||
auto memostr_escaped = g_markup_escape_text (memostr, -1);
|
auto memostr_escaped = g_markup_escape_text (memostr, -1);
|
||||||
const gchar *acctstr;
|
const gchar *acctstr;
|
||||||
|
|
||||||
if (ignore_account)
|
if (acct)
|
||||||
acctstr = "";
|
|
||||||
else if (acct)
|
|
||||||
acctstr = xaccAccountGetName (acct);
|
acctstr = xaccAccountGetName (acct);
|
||||||
else if ((splitfield & FieldMask::ALLOW_ZERO) && gnc_numeric_zero_p (amount))
|
else if ((splitfield & FieldMask::ALLOW_ZERO) && gnc_numeric_zero_p (amount))
|
||||||
acctstr = "";
|
acctstr = "";
|
||||||
@ -768,24 +765,24 @@ to ensure proper recording."), new_date_str, last_split_date_str);
|
|||||||
|
|
||||||
check_page (list, debit, credit, info->txn_type->stock_value, info->acct,
|
check_page (list, debit, credit, info->txn_type->stock_value, info->acct,
|
||||||
info->stock_memo_edit, info->stock_value_edit, info->currency,
|
info->stock_memo_edit, info->stock_value_edit, info->currency,
|
||||||
false, NC_ ("Stock Assistant: Page name", "stock value"), errors);
|
NC_ ("Stock Assistant: Page name", "stock value"), errors);
|
||||||
|
|
||||||
check_page (list, debit, credit, info->txn_type->cash_value,
|
check_page (list, debit, credit, info->txn_type->cash_value,
|
||||||
gas_account (info->cash_account), info->cash_memo_edit,
|
gas_account (info->cash_account), info->cash_memo_edit,
|
||||||
info->cash_value, info->currency, false,
|
info->cash_value, info->currency,
|
||||||
NC_ ("Stock Assistant: Page name", "cash"), errors);
|
NC_ ("Stock Assistant: Page name", "cash"), errors);
|
||||||
|
|
||||||
|
auto capitalize_fees = gtk_toggle_button_get_active
|
||||||
|
(GTK_TOGGLE_BUTTON (info->capitalize_fees_checkbox));
|
||||||
check_page (list, debit, credit, info->txn_type->fees_value,
|
check_page (list, debit, credit, info->txn_type->fees_value,
|
||||||
gas_account (info->fees_account), info->fees_memo_edit,
|
capitalize_fees ? info->acct : gas_account (info->fees_account),
|
||||||
info->fees_value, info->currency,
|
info->fees_memo_edit, info->fees_value, info->currency,
|
||||||
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON
|
|
||||||
(info->capitalize_fees_checkbox)),
|
|
||||||
NC_ ("Stock Assistant: Page name", "fees"), errors);
|
NC_ ("Stock Assistant: Page name", "fees"), errors);
|
||||||
|
|
||||||
check_page (list, debit, credit, info->txn_type->dividend_value,
|
check_page (list, debit, credit, info->txn_type->dividend_value,
|
||||||
gas_account (info->dividend_account),
|
gas_account (info->dividend_account),
|
||||||
info->dividend_memo_edit, info->dividend_value, info->currency,
|
info->dividend_memo_edit, info->dividend_value, info->currency,
|
||||||
false, NC_ ("Stock Assistant: Page name", "dividend"), errors);
|
NC_ ("Stock Assistant: Page name", "dividend"), errors);
|
||||||
|
|
||||||
// the next two checks will involve the two capgains splits:
|
// the next two checks will involve the two capgains splits:
|
||||||
// income side and stock side. The capgains_value ^
|
// income side and stock side. The capgains_value ^
|
||||||
@ -796,12 +793,12 @@ to ensure proper recording."), new_date_str, last_split_date_str);
|
|||||||
check_page (list, debit, credit, info->txn_type->capgains_value,
|
check_page (list, debit, credit, info->txn_type->capgains_value,
|
||||||
gas_account (info->capgains_account),
|
gas_account (info->capgains_account),
|
||||||
info->capgains_memo_edit, info->capgains_value, info->currency,
|
info->capgains_memo_edit, info->capgains_value, info->currency,
|
||||||
false, NC_ ("Stock Assistant: Page name", "capital gains"), errors);
|
NC_ ("Stock Assistant: Page name", "capital gains"), errors);
|
||||||
|
|
||||||
check_page (list, debit, credit,
|
check_page (list, debit, credit,
|
||||||
info->txn_type->capgains_value ^ (FieldMask::ENABLED_CREDIT | FieldMask::ENABLED_DEBIT),
|
info->txn_type->capgains_value ^ (FieldMask::ENABLED_CREDIT | FieldMask::ENABLED_DEBIT),
|
||||||
info->acct, info->capgains_memo_edit, info->capgains_value,
|
info->acct, info->capgains_memo_edit, info->capgains_value,
|
||||||
info->currency, false,
|
info->currency,
|
||||||
NC_ ("Stock Assistant: Page name", "capital gains"), errors);
|
NC_ ("Stock Assistant: Page name", "capital gains"), errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user