When creating a accounts payable invoice register entry it will create a record in the table LedgerJournalTrans. Whenever you post this journal it will create a record for the journal in the VendTrans table.
final class APInvoiceModsVendVoucher_Extension
{
/// <summary>
/// COC of initCustVendTrans which sets the initial values of vendTrans from ledgerjournaltrans
/// </summary>
/// <param name = "_custVendTrans">VendTrans</param>
/// <param name = "_ledgerPostingJournal">LedgerVoucher</param>
/// <param name = "_useSubLedger">Use sub ledger default is false</param>
protected void initCustVendTrans(
CustVendTrans _custVendTrans,
LedgerVoucher _ledgerPostingJournal,
boolean _useSubLedger)
{
//execute the base functionality
next initCustVendTrans(_custVendTrans, _ledgerPostingJournal, false);
//get vendTrans table buffer form CustVendTrans map instance
VendTrans vendTrans = _custVendTrans as VendTrans;
//if the common instance is being initialized via the ledgerjournaltrans table we need to copy the custom field
if (common && common.TableId == tableNum(LedgerJournalTrans))
{
LedgerJournalTrans ledgerJournalTrans = common;
//copy internal invoice notes and the description from the ledgerjournal trans to the vendtrans
vendTrans.CustomField = ledgerJournalTrans.CustomField;
//this is not a custom field but the values do not get transfered
vendTrans.Txt = ledgerJournalTrans.Txt;
}
}
}
No comments:
Post a Comment