Negate amount in exchange rate dialog when swapping accounts.

This is the case when entering an amount for a split with an account whose base
commodity equals the register's one, but differs from the transaction currency.
Then, debit and credit accounts in the transfer dialog are swapped, so the
amount should be negated as well.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17527 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Andreas Köhler 2008-09-15 17:36:59 +00:00
parent afdb73a911
commit d7cad46659

View File

@ -2113,6 +2113,7 @@ gboolean gnc_xfer_dialog_run_exchange_dialog(
if (!gnc_numeric_zero_p(*exch_rate)) if (!gnc_numeric_zero_p(*exch_rate))
*exch_rate = gnc_numeric_div(gnc_numeric_create(1, 1), *exch_rate, *exch_rate = gnc_numeric_div(gnc_numeric_create(1, 1), *exch_rate,
GNC_DENOM_AUTO, GNC_DENOM_REDUCE); GNC_DENOM_AUTO, GNC_DENOM_REDUCE);
amount = gnc_numeric_neg(amount);
} else { } else {
gnc_xfer_dialog_select_to_currency(xfer, xfer_com); gnc_xfer_dialog_select_to_currency(xfer, xfer_com);
gnc_xfer_dialog_select_from_currency(xfer, txn_cur); gnc_xfer_dialog_select_from_currency(xfer, txn_cur);