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