* src/gnome-utils/dialog-transfer.c: if we've got the 'exch rate'

button set, then make sure we update the to-amount before we use
	  it.  Also be sure to use the values we just obtained.
	  Fixes #115991.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8729 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Derek Atkins 2003-06-26 04:22:24 +00:00
parent bd501675e2
commit f6747379e5
2 changed files with 12 additions and 1 deletions

View File

@ -4,6 +4,11 @@
earnings" item under equity, and change the title to include earnings" item under equity, and change the title to include
the start date. Fixes (finally!) bug #113196 the start date. Fixes (finally!) bug #113196
* src/gnome-utils/dialog-transfer.c: if we've got the 'exch rate'
button set, then make sure we update the to-amount before we use
it. Also be sure to use the values we just obtained.
Fixes #115991.
2003-06-25 Christian Stimming <stimming@tuhh.de> 2003-06-25 Christian Stimming <stimming@tuhh.de>
* src/gnome-utils/dialog-transfer.h: Add callback handler that is * src/gnome-utils/dialog-transfer.h: Add callback handler that is

View File

@ -1424,11 +1424,17 @@ gnc_xfer_dialog_ok_cb(GtkWidget * widget, gpointer data)
{ {
gnc_numeric to_amt, from_amt; gnc_numeric to_amt, from_amt;
/* If we've got the price-button set, then make sure we update the
* to-amount before we use it.
*/
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(xferData->price_radio)))
gnc_xfer_update_to_amount(xferData);
from_amt = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT(xferData->amount_edit)); from_amt = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT(xferData->amount_edit));
to_amt = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT(xferData->to_amount_edit)); to_amt = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT(xferData->to_amount_edit));
*(xferData->exch_rate) = *(xferData->exch_rate) =
gnc_numeric_abs (gnc_numeric_div (to_amount, amount, GNC_DENOM_AUTO, gnc_numeric_abs (gnc_numeric_div (to_amt, from_amt, GNC_DENOM_AUTO,
GNC_DENOM_REDUCE)); GNC_DENOM_REDUCE));
} }
else else