When juggling business splits while scrubbing set both value and amount

With only value there were several warnings in the log file during scrubbing
This commit is contained in:
Geert Janssens 2016-11-06 17:11:30 +01:00
parent 0bcd30301e
commit d52f44a8c7

View File

@ -971,10 +971,12 @@ gncOwnerReduceSplitTo (Split *split, gnc_numeric target_value)
rem_val = gnc_numeric_sub (split_val, target_value, GNC_DENOM_AUTO, GNC_HOW_DENOM_LCD); // note: values are of opposite sign
rem_split = xaccMallocSplit (xaccSplitGetBook (split));
xaccSplitCopyOnto (split, rem_split);
xaccSplitSetAmount (rem_split, rem_val);
xaccSplitSetValue (rem_split, rem_val);
txn = xaccSplitGetParent (split);
xaccTransBeginEdit (txn);
xaccSplitSetAmount (split, target_value);
xaccSplitSetValue (split, target_value);
xaccSplitSetParent (rem_split, txn);
xaccTransCommitEdit (txn);