Why this code doesnt set Voucher and leaves it empty if its type is customer

Hi,

this method creates a general ledger journal line, but if its parmOffsetAccountType is LedgerJournalACType::Cust, it leaves LedgerJournalTrans.Voucher empty, if its Ledger or Vend - it gives a voucher number, why it doesnt work so with Customer ?

private void createGLJournalLine(LedgerJournalACType _vendOrCust, AccountNum _accountNum, JournalId _journalId, InvoiceDate _invoiceDate, DocumentDate _documentDate, DueDate _DueDate, InvoiceId _invoiceId, CurrencyCode _currencyCode, Amount _transactionAmount, DimensionDefault _dimensionDefault)
{
AxLedgerJournalTrans journalTrans;
LedgerJournalTrans ledgerJournalTrans;

journalTrans = new AxLedgerJournalTrans();

journalTrans.ledgerJournalTrans(ledgerJournalTrans);

journalTrans.parmJournalNum(_journalId);
journalTrans.parmAccountType(LedgerJournalACType::Cust);
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.parmOffsetLedgerDimension(DimensionStorage::accountNum2LedgerDimension(_accountNum, _vendOrCust));
journalTrans.parmOffsetAccountType(LedgerJournalACType::Cust);

journalTrans.parmVoucher(ledgerJournalTrans.Voucher);

journalTrans.save();
}

Related
Recommended