Why this code sets offsetAccountType to Ledger instead of Vendor

Hello,

Why this code sets offsetAccountType to Ledger instead of Vendor ? i set to Supplier (Vendor) but i get Ledger without any account i set, leaves it empty 

LedgerJournalTrans ledgerJournalTrans;
AxLedgerJournalTrans journalTrans;

ledgerJournalTrans.clear();

ledgerJournalTrans.initValue();

ledgerJournalTrans.OffsetAccountType = LedgerJournalACType::Vend;

ledgerJournalTrans.OffsetLedgerDimension = DimensionStorage::accountNum2LedgerDimension(_accountNum, LedgerJournalACType::Vend);

journalTrans = new AxLedgerJournalTrans();

journalTrans.ledgerJournalTrans(ledgerJournalTrans);
journalTrans.parmJournalNum(_journalId);
journalTrans.parmAccountType(LedgerJournalACType::Vend);
journalTrans.parmTransDate(_invoiceDate);
journalTrans.parmDocumentDate(_documentDate);
journalTrans.parmDue(_DueDate);
journalTrans.parmInvoice(_invoiceId);
journalTrans.parmCurrencyCode(_currencyCode);
journalTrans.parmDefaultDimension(_dimensionDefault);

if(_transactionAmount > 0)
{
journalTrans.parmAmountCurDebit(_transactionAmount);
}
else
{
journalTrans.parmAmountCurCredit(_transactionAmount);
}

journalTrans.save();

Related
Recommended