r22383 - gnucash/trunk/src/gnome-utils - [Bug 683222] Display the "to amount" in the exchange rate dialog

Mike Alexander mta at code.gnucash.org
Mon Sep 10 23:29:47 EDT 2012


Author: mta
Date: 2012-09-10 23:29:46 -0400 (Mon, 10 Sep 2012)
New Revision: 22383
Trac: http://svn.gnucash.org/trac/changeset/22383

Modified:
   gnucash/trunk/src/gnome-utils/dialog-transfer.c
Log:
[Bug 683222] Display the "to amount" in the exchange rate dialog
when it is first shown.  Also updated some comments to be more
accurate.

Modified: gnucash/trunk/src/gnome-utils/dialog-transfer.c
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-transfer.c	2012-09-11 03:29:39 UTC (rev 22382)
+++ gnucash/trunk/src/gnome-utils/dialog-transfer.c	2012-09-11 03:29:46 UTC (rev 22383)
@@ -2240,9 +2240,9 @@
     if (xaccTransUseTradingAccounts (txn))
     {
         /* If we're using commodity trading accounts then "amount" is
-           really the split's amount and it's in xfer_com.  We need an
-           exchange rate that will convert this amount into a value in
-           the transaction currency.  */
+           really the split's amount and it's in xfer_com commodity.  
+           We need an exchange rate that will convert this amount 
+           into a value in the transaction currency.  */
         if (gnc_commodity_equal(xfer_com, txn_cur))
         {
             /* Transaction is in the same currency as the split, exchange
@@ -2251,15 +2251,15 @@
             return FALSE;
         }
         swap_amounts = expanded;
+    }
 
-        /* We know that "amount" is always in the reg_com currency.
-         * Unfortunately it is possible that neither xfer_com or txn_cur are
-         * the same as reg_com, in which case we need to convert to the txn
-         * currency...  Or, if the register commodity is the xfer_com, then we
-         * need to flip-flop the commodities and the exchange rates.
-         */
+    /* We know that "amount" is always in the reg_com currency.
+     * Unfortunately it is possible that neither xfer_com or txn_cur are
+     * the same as reg_com, in which case we need to convert to the txn
+     * currency...  Or, if the register commodity is the xfer_com, then we
+     * need to flip-flop the commodities and the exchange rates.
+     */
 
-    }
     else if (gnc_commodity_equal(reg_com, txn_cur))
     {
         /* we're working in the txn currency.  Great.  Nothing to do! */
@@ -2311,6 +2311,8 @@
     gnc_xfer_dialog_hide_from_account_tree(xfer);
 
     gnc_xfer_dialog_set_amount(xfer, amount);
+    /* Now that from amount is set, set the to amount. */
+    gnc_xfer_update_to_amount(xfer);
 
     /*
      * When we flip, we should tell the dialog so it can deal with the



More information about the gnucash-changes mailing list