Try Microsoft Edge
A fast and secure browser that's designed for Windows 10
I am using the code mentioned in the below link to override sakes tax amount and it work very well with invoice register and it is not working for invoice approval journal;
Can you please guide me on this.
Thanks & Regards,
You probably are not using the correct LedgerJournalEngine** class, or not directly using the LedgerJournalEngine class at all.
For invoice Register, you have to use LedgerJournalEngine_VendInvoiceRegister
and for invoice approval, use LedgerJournalEngine_VendApprove
You can verify this at the construct, if you are using the correct LedgerJournalType
Hi Crispin John Augustine,
Thanks for your reply!
Even tough code is working fine, taxes are not getting updated, so from the front end I tried to do manually, it allows us to over ride from the form but soon after you close the sales tax form and re-open you will see the old values again, Any guess is it bug or setup needs to be done?
Tried in AX 2012 R2 and AX 2012 R3 same behaviour.
However, when the sales tax are already overridden at invoice register even at Invoice approval journal when fetched it displays correctly as overridden.
Can you share the exact Code that you used? Maybe there is something that I can spot immediately. Besides, the example you referred to is for 2009.
I have tried with following codes:
ledgerJournalTable = LedgerJournalTable::find("JBN-025560");
while select _ledgerJournalTrans
where _ledgerJournalTrans.JournalNum == "JBN-025560"
ledgerjournalEngine = ledgerjournalEngine::construct(LedgerJournalType::Approval);
ledgerJournalEngine.correctTaxAmount(_ledgerJournalTrans, 20, true, true);
LedgerJournalEngine_Server::calcCashDisc(_ledgerJournalTrans, 0, false);
Looking forward for your Reply!
Try this once. ledgerJournalEngine.correctTaxAmount(_ledgerJournalTrans, 20, true, false); (your last Parameter is true, Change it to false)
If this doesn't work, can you try Debugging into ledgerJournalEngine.correctTaxAmount() from the lines:
LedgerJournalEngine_Server::correctTaxAmount() and go further into taxRegulation.saveTaxRegulation();
This is quite a big Code, but you have to check what's Happening here with your data.
Tried with code suggested changes still no clue why it tax is getting vanished off soon after we re-open the sales tax form, still debugging the issue not able to get the exact issue.
Found the issue; when we fetch the voucher from invoice pool sales tax code will be blank until we select the value it wont actually over rides.
Business Applications communities