gnucash maint: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Thu Mar 17 17:47:22 EDT 2016


Updated	 via  https://github.com/Gnucash/gnucash/commit/3109b6f6 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/d0e103be (commit)
	from  https://github.com/Gnucash/gnucash/commit/c2ce2044 (commit)



commit 3109b6f6c3bbfa939bce0e97177f8d654d06c0ce
Author: John Ralls <jralls at ceridwen.us>
Date:   Thu Mar 17 15:41:51 2016 -0700

    Set the transaction currency during auto-completion.
    
    When auto-completing a transaction that was originally created in another
    account with a different currency the balancing code will try to apply
    conversions in the wrong direction if one edits the transaction. Explicitly
    setting the transaction currency to the current register's currency
    prevents the conversions being applied and allows the transaction to
    balance correctly.

commit d0e103be086f65db04a006cefc09e6acf48f977a
Author: John Ralls <jralls at ceridwen.us>
Date:   Thu Mar 17 15:37:19 2016 -0700

    Correctly re-value splits when the transaction currency is changed.
    
    When a transaction with existing splits had its currency changed, the
    function would change the values to use the new currency's denominator
    without changing the actual value. The balancing code would then apply
    the price of the the new "other" split to the amount, changing it as
    well. Changing the transaction currency back would convert the value in
    the other split correctly so that it would equal the amount that the
    balancing code wouldn't change anything. I actually detected this bug
    when I wrote the test but didn't recognize it as a bug.
    
    The new code first calculates a new price and then applies it to each
    split so that the transaction balances correctly in the new transaction
    currency. This also round-trips correctly



Summary of changes:
 src/engine/Transaction.c                          | 74 ++++++++++++++++++++---
 src/engine/test/utest-Transaction.c               |  6 +-
 src/register/ledger-core/split-register-control.c | 10 ++-
 3 files changed, 75 insertions(+), 15 deletions(-)



More information about the gnucash-patches mailing list