mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
bug fix
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9030 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
d522d5c92f
commit
af6fbfd6ca
@ -162,7 +162,8 @@ restart_loop:
|
||||
{
|
||||
/* If the amount is smaller than open balance ... */
|
||||
gnc_numeric baln = gnc_lot_get_balance (lot);
|
||||
int cmp = gnc_numeric_compare (split->amount, baln);
|
||||
int cmp = gnc_numeric_compare (gnc_numeric_abs(split->amount),
|
||||
gnc_numeric_abs(baln));
|
||||
|
||||
PINFO ("found open lot with baln=%s", gnc_numeric_to_string (baln));
|
||||
/* cmp == +1 if amt > baln */
|
||||
@ -180,8 +181,10 @@ restart_loop:
|
||||
amt_tot = split->amount;
|
||||
amt_a = gnc_numeric_neg (baln);
|
||||
amt_b = gnc_numeric_sub_fixed (amt_tot, amt_a);
|
||||
PINFO ("++++++++++++++ splitting split into amt = %s + %s",
|
||||
gnc_numeric_to_string(amt_a),
|
||||
gnc_numeric_to_string(amt_b) );
|
||||
|
||||
PINFO ("XXXXXXXXXXXXXXXX splitting split ");
|
||||
/* Compute the value so that it holds in the same proportion:
|
||||
* i.e. so that (amt_a / amt_tot) = (val_a / val_tot)
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user