mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
2001-07-17 Dave Peticolas <dave@krondo.com>
* src/engine/Transaction.c (xaccTransAppendSplit): make sure split's value conforms to the transaction common currency. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4955 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
98e2c02866
commit
74a258393c
@ -1,3 +1,8 @@
|
||||
2001-07-17 Dave Peticolas <dave@krondo.com>
|
||||
|
||||
* src/engine/Transaction.c (xaccTransAppendSplit): make sure
|
||||
split's value conforms to the transaction common currency.
|
||||
|
||||
2001-07-12 Dave Peticolas <dave@krondo.com>
|
||||
|
||||
* src/gnome/window-register.c: same as below
|
||||
|
@ -1720,6 +1720,18 @@ xaccTransAppendSplit (Transaction *trans, Split *split)
|
||||
/* now, insert the split into the array */
|
||||
split->parent = trans;
|
||||
trans->splits = g_list_append (trans->splits, split);
|
||||
|
||||
/* convert the split to the new transaction's commodity denominator */
|
||||
/* if the denominator can't be exactly converted, it's an error */
|
||||
if (trans->common_currency)
|
||||
{
|
||||
int fraction = gnc_commodity_get_fraction (trans->common_currency);
|
||||
gnc_numeric new_value;
|
||||
|
||||
new_value = gnc_numeric_convert(split->value, fraction, GNC_RND_ROUND);
|
||||
if (gnc_numeric_check (new_value) == GNC_ERROR_OK)
|
||||
split->value = new_value;
|
||||
}
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
|
Loading…
Reference in New Issue
Block a user