The code below will work for voucher transactions that were created automatically.
[ExtensionOf(classStr(LedgerVoucherTransObject))]
internal final class Dax_LedgerVoucherObject_Extension
{
public void initFromLedgerPostingTransaction(
LedgerPostingTransactionTmp _ledgerPostingTransaction,
LedgerPostingTransactionProjectTmp _projectPostingTransaction)
{
next initFromLedgerPostingTransaction(_ledgerPostingTransaction,_projectPostingTransaction);
generalJournalAccountEntry.Dax_CosnsolidateAccount = "testloc"; //Custom field
}
}
The code below will work for voucher transactions that are transferred manually or through a batch.
[ExtensionOf(classStr(SubledgerJournalTransferCommand))]
internal final class Dax_SubledgerJournalTransferCommand_Extension
{
public void executeTransfer(SubledgerJournalTransferRequest subledgerJournalTransferRequest)
{
GeneralJournalAccountEntry accountEntry;
GeneralJournalEntry generalJournalEntryloc;
SubledgerJournalEntry subledgerJournalEntry;
next executeTransfer(subledgerJournalTransferRequest);
select subledgerJournalEntry
where subledgerJournalEntry.RecId == transferidVal;
if(subledgerJournalEntry.Status == SubledgerJournalEntryStatus::Transferred)
{
select generalJournalEntryloc
where generalJournalEntryloc.TransferId ==subledgerJournalEntry.TransferId;
while select forupdate accountEntry
where accountEntry.GeneralJournalEntry == generalJournalEntryloc.RecId
{
ttsbegin;
accountEntry.Dax_CosnsolidateAccount = "test"; //Custom field
accountEntry.update();
ttscommit;
}
}
}
}
...............
Output :
The above code works for voucher transactions that were created in the following ways :
1.Scenario - Product receipt voucher transactions. Manually transfer
No comments:
Post a Comment