web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

Create Journal Line (AX2012)

Pedro Tornich Profile Picture Pedro Tornich 955
protected LedgerJournalTrans createJournalLine(CustTransOpen _custTransOpen)
{
    CustTable custTable;
    LedgerJournalTrans journalTrans;
    AxLedgerJournalTrans_CustPaymJour axJournalTrans;

    custTable = this.getCustTable(_custTransOpen.AccountNum);
    axJournalTrans = AxLedgerJournalTrans_CustPaymJour::newLedgerJournalTable(journalTable);

    journalTrans = axJournalTrans.ledgerJournalTrans();

    journalTrans.TransDate = systemDateGet();
    journalTrans.parmAccount(custTable.AccountNum, LedgerJournalACType::Cust);
    journalTrans.initFromCustTable(custTable);
    journalTrans.initForCurrency(journalTable);
    journalTrans.parmOffsetLedgerDimension(journalTable.OffsetLedgerDimension);
    
    if(_custTransOpen.AmountCur < 0)
    {
        journalTrans.AmountCurDebit = abs(_custTransOpen.AmountCur);
    }
    else
    {
        journalTrans.AmountCurCredit = _custTransOpen.AmountCur;
    }

    axJournalTrans.save();

    return journalTrans;
}

This was originally posted here.

Comments

*This post is locked for comments