Hello,
I am having issues with conditional sales tax posting.
The scenario is next:
I have invoice (ISV table, not standard) which has lines with conditional sates tax code.
I post the invoice.
Then I have a function which I use to create a credit note and it gets automatically settled.
It works fine, everything gets posted and settled.
Then, when I run standard Settle and post sales tax and go to Trial balance, I see disbalance, an extra posting has been created for conditional sales tax that shouldn't be created.
When I do the same process with standard invoice and credit note it is ok. So I assumed that something is wrong with our function for auto settlement, so when I remove that code, transactions are not settled but when I manually settle, postings are ok.
My code for auto settle is:
CustTable custTable;
CustTransOpen custOpen;
CustTrans settleTrans;
CustTransOpen settleOpen;
SpecTransExecutionContext context;
SpecTransManager specTransManager;
CustVendOpenTransManager manager;
CustVendTransData custVendTransData;
if (invoiceTable.SettleVoucher)
{
custOpen = null;
settleOpen = null;
select firstonly settleTrans
where settleTrans.AccountNum == _custTrans.AccountNum
&& settleTrans.Voucher == invoiceTable.SettleVoucher
&& settleTrans.AmountMST == -_custTrans.AmountMST;
if (settleTrans)
{
custOpen = CustTransOpen::findRefId(_custTrans.RecId);
settleOpen = CustTransOpen::findRefId(settleTrans.RecId);
custTable = CustTable::find(_custTrans.AccountNum);
manager = CustVendOpenTransManager::construct(custTable);
}
if (custOpen && settleOpen && custOpen.AmountMST == -settleOpen.AmountMST)
{
manager.updateTransMarked(custOpen,NoYes::Yes);
manager.updateTransMarked(settleOpen,NoYes::Yes);
manager.updateSpecTransWithSelectedDate();
manager.settleMarkedTrans();
}
And it works fine, the transactions are getting settled, the only issue appears when we use Settle and post sales tax, in the end.
But when I was debugging our solution and standard also, I couldn't see the difference in call stack.
Any help?
Thanks
André Arnaud de Cal...
291,979
Super User 2025 Season 1
Martin Dráb
230,848
Most Valuable Professional
nmaenpaa
101,156