Better fix for the code that updates the buy/sell action based on the

number of shares entered in a transaction.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13173 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
David Hampton
2006-02-09 07:26:40 +00:00
parent cbf71e72ef
commit 604cba4f4d
2 changed files with 18 additions and 6 deletions

View File

@@ -1,3 +1,9 @@
2006-02-09 David Hampton <hampton@employees.org>
* src/register/ledger-core/split-register-control.c: Better fix
for the code that updates the buy/sell action based on the number
of shares entered in a transaction.
2006-02-08 David Hampton <hampton@employees.org>
* src/register/ledger-core/split-register-control.c: Fix the code

View File

@@ -968,12 +968,18 @@ gnc_split_register_traverse_check_stock_shares (SplitRegister *reg, const char *
return;
name = ((ComboCell *)cell)->cell.value;
if (buy && (safe_strcmp (name, ACTION_SELL_STR) == 0)) {
gnc_combo_cell_set_value((ComboCell *)cell, ACTION_BUY_STR);
gnc_basic_cell_set_changed (cell, TRUE);
} else if (!buy && safe_strcmp (name, ACTION_BUY_STR) == 0) {
gnc_combo_cell_set_value((ComboCell *)cell, ACTION_SELL_STR);
gnc_basic_cell_set_changed (cell, TRUE);
if (buy) {
if ((safe_strcmp (name, "") == 0) ||
(safe_strcmp (name, ACTION_SELL_STR) == 0)) {
gnc_combo_cell_set_value((ComboCell *)cell, ACTION_BUY_STR);
gnc_basic_cell_set_changed (cell, TRUE);
}
} else {
if ((safe_strcmp (name, "") == 0) ||
(safe_strcmp (name, ACTION_BUY_STR) == 0)) {
gnc_combo_cell_set_value((ComboCell *)cell, ACTION_SELL_STR);
gnc_basic_cell_set_changed (cell, TRUE);
}
}
}