couple of bug fixes

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@941 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1998-08-07 06:39:07 +00:00
parent 36987199d7
commit 367c596ebf

View File

@ -172,7 +172,7 @@ printf ("save split is %p \n", split);
if (MOD_AMNT & changed) { if (MOD_AMNT & changed) {
double new_amount; double new_amount;
new_amount = (reg->creditCell->amount) - (reg->debitCell->amount); new_amount = (reg->creditCell->amount) - (reg->debitCell->amount);
xaccSplitSetValue (split, new_amount); xaccSplitSetValue (split, -new_amount);
} }
if (MOD_SHRS & changed) { if (MOD_SHRS & changed) {
@ -190,9 +190,15 @@ printf ("save split is %p \n", split);
xaccSplitSetAction (split, reg->actionCell->cell.value); xaccSplitSetAction (split, reg->actionCell->cell.value);
if (MOD_XFRM & changed) { if (MOD_XFRM & changed) {
xaccMoveFarEndByName (split, reg->xfrmCell->cell.value); Account *old_acc, *new_acc;
/* do some reparenting */
old_acc = xaccSplitGetAccount (split);
new_acc = xaccGetPeerAccountFromName (old_acc, reg->xfrmCell->cell.value);
xaccAccountInsertSplit (new_acc, split);
} }
if (MOD_XTO & changed) { if (MOD_XTO & changed) {
/* hack alert -- implement this */ /* hack alert -- implement this */
} }
@ -261,7 +267,7 @@ xaccSRLoadRegEntry (SplitRegister *reg, Split *split)
xaccSetComboCellValue (reg->xfrmCell, accname); xaccSetComboCellValue (reg->xfrmCell, accname);
xaccSetDebCredCellValue (reg->debitCell, xaccSetDebCredCellValue (reg->debitCell,
reg->creditCell, xaccSplitGetValue (split)); reg->creditCell, -xaccSplitGetValue (split));
/* For income and expense acounts, we have to reverse /* For income and expense acounts, we have to reverse
* the meaning of balance, since, in a dual entry * the meaning of balance, since, in a dual entry
@ -277,7 +283,7 @@ xaccSRLoadRegEntry (SplitRegister *reg, Split *split)
xaccSetAmountCellValue (reg->priceCell, xaccSplitGetSharePrice (split)); xaccSetAmountCellValue (reg->priceCell, xaccSplitGetSharePrice (split));
xaccSetPriceCellValue (reg->shrsCell, xaccSplitGetShareBalance (split)); xaccSetPriceCellValue (reg->shrsCell, xaccSplitGetShareBalance (split));
xaccSetAmountCellValue (reg->valueCell, xaccSplitGetValue (split)); xaccSetAmountCellValue (reg->valueCell, -xaccSplitGetValue (split));
} }
reg->table->current_cursor->user_data = (void *) split; reg->table->current_cursor->user_data = (void *) split;