Share via


LedgerVoucher Class [AX 2012]

The LedgerVoucher class collects all transactions to be posted in one action.

Syntax

class LedgerVoucher

Run On

Server

Methods

  Method Description
Gg802434.pubmethod(en-us,AX.60).gif addAccountingDateToCache Adds a valid accounting date and fiscal calendar period combination to the cache.
Gg802434.pubmethod(en-us,AX.60).gif addBalanceDemand
Gg802434.pubmethod(en-us,AX.60).gif addLedgerAccountToCache Adds the ledger account for a ledger dimension to the cache.
Gg802434.pubmethod(en-us,AX.60).gif addMainAccountToCache Adds the main account for a valid ledger dimension, accounting date, and posting type combination to the cache.
Gg802434.pubmethod(en-us,AX.60).gif addToGeneralJournal Adds the specified information to the general journal.
Gg802434.pubmethod(en-us,AX.60).gif addToGeneralJournalEntry Adds the specified information to the general journal.
Gg802434.pubmethod(en-us,AX.60).gif addToSubledgerJournalEntry Adds the specified information to the subledger journal.
Gg802434.pubmethod(en-us,AX.60).gif addTrans Adds an instance of the LedgerVoucherTransObject class to the collection of transactions.
Gg802434.pubmethod(en-us,AX.60).gif addVoucher
Gg802434.pubmethod(en-us,AX.60).gif bankAccountTransSum Creates summarized bank account transactions.
Gg802434.pubmethod(en-us,AX.60).gif bankAccountTransSum_BR Creates summarized bank account transactions.
Gg802434.protmethod(en-us,AX.60).gif bond_incProgress_RU Increments the progress bar during an operation.
Gg802434.pubmethod(en-us,AX.60).gif bondLast2_RU Bonds last 2 transactions.
Gg802434.pubmethod(en-us,AX.60).gif cancelTimeOut Cancels a previous method call to the setTimeOut method. (Inherited from Object.)
Gg802434.pubmethod(en-us,AX.60).gif check Performs validation for all the LedgerVoucherObject objects and LedgerVoucherTransObject objects held by the LedgerVoucher object.
Gg802434.protmethod(en-us,AX.60).gif checkAmountMSTAmountMSTSecundary
Gg802434.protmethod(en-us,AX.60).gif checkBalanceDemand
Gg802434.pubmethod(en-us,AX.60).gif checkPostingType Checks the posting type.
Gg802434.pubmethod(en-us,AX.60).gif checkVoucher Validates an instance of the LedgerVoucherObject class passed in as a parameter.
Gg802434.pubmethod(en-us,AX.60).gif createVoucherLinks Creates links in the LedgerTransVoucherLink table between the supplied parent information and the vouchers in the current instance of the LedgerVoucher class.
Gg802434.pubmethod(en-us,AX.60).gif deleteFromPool Deletes records from the ledger transaction pool for a specified journal batch number and voucher.
Gg802434.pubmethod(en-us,AX.60).gif end Invokes the posting process.
Gg802434.pubmethod(en-us,AX.60).gif equal Determines whether the specified object is equal to the current one. (Inherited from Object.)
Gg802434.pubmethod(en-us,AX.60).gif findLedgerVoucherObject Finds and returns the instance of the LedgerVoucherObject class passed in as a parameter.
Gg802434.pubmethod(en-us,AX.60).gif findOrCreateReferenceSecCur_RU Finds or creates and returns the instance of the LedgerVoucherObject class for dual warehousing posting layer.
Gg802434.pubmethod(en-us,AX.60).gif findReference Finds and returns the LedgerVoucherObject object that matches the specified parameters.
Gg802434.pubmethod(en-us,AX.60).gif flushAllWHTInvoiceCompany_IN Used to reset the container value.
Gg802434.pubmethod(en-us,AX.60).gif getInternalCollection Gets the internal collection of general journal entries.
Gg802434.pubmethod(en-us,AX.60).gif getLedgerAccountFromCache Gets the ledger account of the ledger dimension from the cache.
Gg802434.pubmethod(en-us,AX.60).gif getMainAccountFromCache Gets the main account for the ledger dimension, accounting date, and posting type combination from the cache.
Gg802434.pubmethod(en-us,AX.60).gif getNextTemporaryRecId Gets a temporary record ID.
Gg802434.pubmethod(en-us,AX.60).gif getTimeOutTimerHandle Returns the timer handle for the object. (Inherited from Object.)
Gg802434.pubmethod(en-us,AX.60).gif getTransferLevel Gets the transfer level.
Gg802434.pubmethod(en-us,AX.60).gif getWHTInvoiceCompanyFromCache_IN Get tax withhold amount from cache due to invoice company
Gg802434.pubmethod(en-us,AX.60).gif handle Retrieves the handle of the class of the object. (Inherited from Object.)
Gg802434.protmethod(en-us,AX.60).gif initBankAccountTransList
Gg802434.privmethod(en-us,AX.60).gif initTaxParameters_IN
Gg802434.pubmethod(en-us,AX.60).gif isAccountingDateValid Gets a value that indicates whether the accounting date and fiscal calendar period combination is valid.
Gg802434.pubmethod(en-us,AX.60).gif lastAmountCur Gets the last known transaction currency amount from a specified instance of the LedgerVoucherObject class.
Gg802434.pubmethod(en-us,AX.60).gif lastAmountMST Gets the last known accounting currency amount from a specified instance of the LedgerVoucherObject class.
Gg802434.pubmethod(en-us,AX.60).gif lastPostingLayer
Gg802434.pubmethod(en-us,AX.60).gif lastTransDate Sets or retrieves the last known transaction date.
Gg802434.pubmethod(en-us,AX.60).gif lastVoucher Sets or retrieves the last known voucher number.
Gg802434.protmethod(en-us,AX.60).gif new Initializes a new instance of the LedgerVoucher class.
Gg802434.pubmethod(en-us,AX.60).gif notify Releases the hold on an object that has called the wait method on this object. (Inherited from Object.)
Gg802434.pubmethod(en-us,AX.60).gif notifyAll Releases a lock on the object that was issued by the wait method on this object. (Inherited from Object.)
Gg802434.pubmethod(en-us,AX.60).gif numOfVouchers Returns the number of LedgerVoucherObject objects added to the LedgerVoucher.
Gg802434.pubmethod(en-us,AX.60).gif objectOnServer Determines whether the object is on a server. (Inherited from Object.)
Gg802434.pubmethod(en-us,AX.60).gif owner Returns the instance that owns the object. (Inherited from Object.)
Gg802434.pubmethod(en-us,AX.60).gif parmAdvancePaymentWHT_IN Used to set the parm method for advance payment for withholding tax.
Gg802434.pubmethod(en-us,AX.60).gif parmAllWHTInvoiceCompany_IN Container used to hold company id for invoice and payment company.
Gg802434.pubmethod(en-us,AX.60).gif parmBackWardAmountWHT_IN Gets or sets the BackWardAmountWHT_IN parameter.
Gg802434.protmethod(en-us,AX.60).gif parmcheckAuto Gets or sets whether the posting process should automatically call the check method to make a validation before it starts the posting process.
Gg802434.pubmethod(en-us,AX.60).gif parmCheckBank_IN Set Bank flag for banks transaction type.
Gg802434.pubmethod(en-us,AX.60).gif parmCheckBlockedDimensions Gets or sets the CheckBlockedDimensions parameter.
Gg802434.pubmethod(en-us,AX.60).gif parmCheckTransOnInsert Gets or sets the CheckTransOnInsert parameter.
Gg802434.pubmethod(en-us,AX.60).gif parmCompanyId Gets or sets the CompanyId parameter.
Gg802434.pubmethod(en-us,AX.60).gif parmCurrentCompany_IN Gets or sets the CurrentCompany_IN parameter.
Gg802434.pubmethod(en-us,AX.60).gif parmCustomDetailLevel Gets or sets the CustomDetailLevel parameter.
Gg802434.pubmethod(en-us,AX.60).gif parmDetailSummary Sets or retrieves the detailSummary variable.
Gg802434.pubmethod(en-us,AX.60).gif parmInterCompanyTransForST_IN Used to set the value for intercompany transaction.
Gg802434.pubmethod(en-us,AX.60).gif parmIsVATDeferment_IN Gets or sets the IsVATDeferment_IN parameter.
Gg802434.protmethod(en-us,AX.60).gif parmJournalCheckPost Gets or sets the JournalCheckPost parameter.
Gg802434.pubmethod(en-us,AX.60).gif parmJournalNumber Gets or sets the journal number.
Gg802434.protmethod(en-us,AX.60).gif parmJournalTableData Gets or sets the JournalTableData parameter.
Gg802434.pubmethod(en-us,AX.60).gif parmLedgerJournalId Gets or sets the LedgerJournalId parameter.
Gg802434.pubmethod(en-us,AX.60).gif parmLedgerPostingMessageLog Gets or sets the LedgerPostingMessageLog parameter.
Gg802434.pubmethod(en-us,AX.60).gif parmLedgerVoucherType_CN Gets or sets the LedgerVoucherType_CN parameter.
Gg802434.pubmethod(en-us,AX.60).gif parmOpeningSheet_ES Gets or sets the openingSheet_ES variable.
Gg802434.pubmethod(en-us,AX.60).gif parmPostedInterCompanyWHT_IN Gets or sets the PostedInterCompanyWHT_IN parameter.
Gg802434.pubmethod(en-us,AX.60).gif parmReversal Gets or sets the Reversal parameter.
Gg802434.pubmethod(en-us,AX.60).gif parmSkipBlockedForManualEntryCheck Gets or sets the SkipBlockedForManualEntryCheck parameter.
Gg802434.pubmethod(en-us,AX.60).gif parmSysModuleDefault Gets or sets the SysModuleDefault parameter.
Gg802434.pubmethod(en-us,AX.60).gif parmTaxWithholdTrans_IN Used to set TmpTaxWithholdTransInterCompany_IN buffer.
Gg802434.pubmethod(en-us,AX.60).gif parmTmpVoucherMap Gets or sets the TmpVoucherMap parameter.
Gg802434.protmethod(en-us,AX.60).gif parmTransactionLog Sets the type and the text for the entry made to the transaction log upon posting.
Gg802434.pubmethod(en-us,AX.60).gif parmVoucher_CN Gets or sets the Voucher_CN parameter.
Gg802434.pubmethod(en-us,AX.60).gif parmVoucherBeingReversed Gets or sets the voucher number being reversed.
Gg802434.pubmethod(en-us,AX.60).gif parmVoucherSeriesCode Gets or sets the VoucherSeriesCode parameter.
Gg802434.protmethod(en-us,AX.60).gif post Performs posting of the vouchers in an instance of the LedgerVoucher class.
Gg802434.pubmethod(en-us,AX.60).gif postBankAccountTrans Posts the list of bank account transactions.
Gg802434.protmethod(en-us,AX.60).gif releaseCNLedgerVoucher Releases the CN ledger voucher.
Gg802434.pubmethod(en-us,AX.60).gif restoreReferenceSecCur_RU Restores values which were updated in the method findOrCreateReferenceSecCur_RU
Gg802434.pubmethod(en-us,AX.60).gif setTimeOut Sets up the scheduled execution of a specified method. (Inherited from Object.)
Gg802434.pubmethod(en-us,AX.60).gif toString Returns a string that represents the current object. (Inherited from Object.)
Gg802434.pubmethod(en-us,AX.60).gif updateWHTInvoiceCompanyToCache_IN Updates withhold tax amount into cache for invoice company
Gg802434.pubmethod(en-us,AX.60).gif usageCount Returns the current number of references, that is, the value of the reference counter, that the object has. (Inherited from Object.)
Gg802434.pubmethod(en-us,AX.60).gif wait Pauses a process. (Inherited from Object.)
Gg802434.pubmethod(en-us,AX.60).gif xml Returns an XML string that represents the current object. (Inherited from Object.)
Gg802434.pubmethod(en-us,AX.60).gif Gg802434.static(en-us,AX.60).gif ::literalOperationsTax Gets the posting layer that will include the same records as the specified current posting layer.
Gg802434.pubmethod(en-us,AX.60).gif Gg802434.static(en-us,AX.60).gif ::newLedgerCheck
Gg802434.pubmethod(en-us,AX.60).gif Gg802434.static(en-us,AX.60).gif ::newLedgerPost
Gg802434.pubmethod(en-us,AX.60).gif Gg802434.static(en-us,AX.60).gif ::newLedgerPostDiff Creates a ledger posting object configured for one-sided postings.
Gg802434.pubmethod(en-us,AX.60).gif Gg802434.static(en-us,AX.60).gif ::newLedgerPostProforma_CN Creates new ledger post proforma.
Gg802434.pubmethod(en-us,AX.60).gif Gg802434.static(en-us,AX.60).gif ::operationsTax Converts a CurrentOperationsTax enumeration value to an OperationsTax enumeration value.

Top

Remarks

This class is the main class of the general ledger posting API. An action can be the total posting of a journal or some postings from an invoice.

This class holds a list of voucher objects (through an object list class).

The API offers three services: "Check vouchers", "Post vouchers" and "Make a draft of the posting", and all postings into the general ledger must use this API.

The logical flow for using the API is:

  1. Begin using the API.

  2. Open a check, post, or draft ledger.

  3. Loop over every transaction.

  4. Open a voucher; optional.

  5. Create a transaction.

  6. Check the voucher; optional.

  7. End the loop.

  8. End the ledger.

  9. End the API.

  10. Postings that spawn allocations and accruals are fully supported.

  11. The posting verifications made by the API include the following:

    • A voucher number.

    • A voucher balance.

    • The periods for which to check.

    • Any account or dimension restrictions.

    • The user credentials.

  12. Intercompany transactions must be handled by the client calling the API.

  13. The API can handle * vouchers in one run.

  14. The API is backward compatible with the API from version 2.5.

Examples

static void LedgerVoucherExample(Args _args) 
{ 
    LedgerVoucher   lv; 
    NumberSeq       numberSeq; 
    ; 
 
    numberSeq = NumberSeq::newGetVoucher( 
        LedgerParameters::numRefLedgerExchAdjVoucher()); 
    lv = LedgerVoucher::newLedgerPost( 
        DetailSummary::Detail, 
        SysModule::Ledger, 
        numberSeq.parmNumberSequenceCode()); 
    lv.addTrans(        LedgerVoucherTransObject::newTransactionAmountDefault(            LedgerVoucherObject::newVoucher(numberSeq.voucher()),            LedgerPostingType::ExchRateGain,            11005,           // Ledger account            Ledger::find(11005).AccountingCurrency,            2004,              // Amount            currencyExchangeHelper));    lv.addTrans(        LedgerVoucherTransObject::newTransactionAmountDefault(            lv.findLedgerVoucherObject(),            LedgerPostingType::ExchRateGain,            11010,           // Ledger account            Ledger::find(11010).AccountingCurrency,            -2004,              // Amount            currencyExchangeHelper));
    lv.end(); 
}

Inheritance Hierarchy

Object Class
  LedgerVoucher Class
    LedgerVoucherCheck Class
    LedgerVoucherPost Class
    LedgerVoucherPostProforma_CN Class

See Also

LedgerVoucherPost Class

LedgerVoucherCheck Class

LedgerVoucherObject Class

LedgerVoucherTransObject Class