r17527 - gnucash/trunk/src/gnome-utils - Negate amount in exchange rate dialog when swapping accounts.

Andreas Köhler andi5 at cvs.gnucash.org
Mon Sep 15 13:37:00 EDT 2008


Author: andi5
Date: 2008-09-15 13:36:59 -0400 (Mon, 15 Sep 2008)
New Revision: 17527
Trac: http://svn.gnucash.org/trac/changeset/17527

Modified:
   gnucash/trunk/src/gnome-utils/dialog-transfer.c
Log:
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.

Modified: gnucash/trunk/src/gnome-utils/dialog-transfer.c
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-transfer.c	2008-09-15 13:13:57 UTC (rev 17526)
+++ gnucash/trunk/src/gnome-utils/dialog-transfer.c	2008-09-15 17:36:59 UTC (rev 17527)
@@ -2113,6 +2113,7 @@
         if (!gnc_numeric_zero_p(*exch_rate))
             *exch_rate = gnc_numeric_div(gnc_numeric_create(1, 1), *exch_rate,
                                          GNC_DENOM_AUTO, GNC_DENOM_REDUCE);
+        amount = gnc_numeric_neg(amount);
     } else {
         gnc_xfer_dialog_select_to_currency(xfer, xfer_com);
         gnc_xfer_dialog_select_from_currency(xfer, txn_cur);



More information about the gnucash-changes mailing list