mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
handle transfer types
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@475 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
a7897cbffe
commit
cbad81edeb
23
src/Ledger.c
23
src/Ledger.c
@ -63,10 +63,29 @@ xaccSaveRegEntry (BasicRegister *reg)
|
|||||||
|
|
||||||
/* ======================================================== */
|
/* ======================================================== */
|
||||||
|
|
||||||
|
static Account *
|
||||||
|
GetPeerAcc (Split *split)
|
||||||
|
{
|
||||||
|
Account *acc;
|
||||||
|
Transaction *trans;
|
||||||
|
trans = (Transaction *) (split->parent);
|
||||||
|
|
||||||
|
/* hack alert -- this is incorrect for splits in general */
|
||||||
|
if (split != &(trans->credit_split)) {
|
||||||
|
acc = (Account *) trans->credit_split.acc;
|
||||||
|
} else {
|
||||||
|
acc = (Account *) trans->debit_splits[0]->acc;
|
||||||
|
}
|
||||||
|
return acc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ======================================================== */
|
||||||
|
|
||||||
void
|
void
|
||||||
xaccLoadRegEntry (BasicRegister *reg, Split *split)
|
xaccLoadRegEntry (BasicRegister *reg, Split *split)
|
||||||
{
|
{
|
||||||
Transaction *trans;
|
Transaction *trans;
|
||||||
|
Account *acc;
|
||||||
char buff[2];
|
char buff[2];
|
||||||
|
|
||||||
if (!split) return;
|
if (!split) return;
|
||||||
@ -85,6 +104,10 @@ xaccLoadRegEntry (BasicRegister *reg, Split *split)
|
|||||||
buff[1] = 0x0;
|
buff[1] = 0x0;
|
||||||
xaccSetBasicCellValue (reg->recnCell, buff);
|
xaccSetBasicCellValue (reg->recnCell, buff);
|
||||||
|
|
||||||
|
/* the transfer account */
|
||||||
|
acc = GetPeerAcc (split);
|
||||||
|
xaccSetBasicCellValue (&(reg->xfrmCell->cell), acc->accountName);
|
||||||
|
|
||||||
xaccSetDebCredCellValue (reg->debitCell,
|
xaccSetDebCredCellValue (reg->debitCell,
|
||||||
reg->creditCell, split->damount);
|
reg->creditCell, split->damount);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user