Hello everyone, i am trying to add the tax rate to my sales invoice report. so i need to map the value to show on my report.
so here i will show u my extension in the data provider class, i have created a field Ex_TaxRate to map the field TaxValue from the taxTrans table. but for some reasons, the field is coming blank on the report
i used the same logic, and my became like that:
select taxTrans where taxTrans.InventTransId == custInvoiceTrans.InventTransId;
if (taxTrans.TaxAmount == 0.0)
{
salesInvoiceTmp.Ex_TaxRate = '0.00';
}
else
{
salesInvoiceTmp.Ex_TaxRate = num2str(taxTrans.TaxAmount, 10, 2, 0, 1);
}
but the output was wrong, instead of showing 15%, its showing 3000
Right, There is TaxValue field as well, can you please try that. If doesn't work then you can try Coc on populateSalesInvoiceTmp method and use _custInvoiceTrans parameter. If taxTrans buffer is not empty, then you can use it in your while select code. salesInvoiceTmp_Ex = taxTrans.TaxValue;
select taxTrans where taxTrans.InventTransId == _custInvoiceTrans.InventTransId;
Hi MounirDev,
Yes. Can you create a runnable class to find the solution?
Thanks,
i have shared above a screenshot of my eventhandler, is it possible u provide with the correct code based on my field and table?
the taxamount field doesnt give the % rate
Hi Mounir, I asked you this question 'There is a standard field for TaxAmount in SalesInvoiceTmp, if you comment your code, isn't the standard logic working?'
Anyways, I might be wrong but I can see the logic for this field should work and you don't need to create custom fields like TaxRate_Ex, please try TaxAmount field first.
Hi MounirDev,
Please take the ref.
-----------------------------------------------------------------------------------------------------------------------------
taxDocument = TaxBusinessService::getTaxDocumentBySource(Custinvoicejour.TableId, Custinvoicejour.RecId);
ITaxDocumentComponentLineEnumerator componentLineEnumerator = taxDocument.componentLines();
while(componentLineEnumerator.moveNext())
{
componentLineObject = componentLineEnumerator.current();
taxComponent = componentLineObject.metaData().taxComponent();
taxValue = componentLineObject.getMeasure("Rate").value().value() * 100;
taxAmount = componentLineObject.getMeasure("Tax Amount").value().value();
info(strFmt("Component %1 ,Rate %2, Amount%3",taxComponent,taxValue,taxAmount));
}
-----------------------------------------------------------------------------------------------------------------------------
Please VERIFY answers to support.
Thanks,
okay, can u please provide me with the code in order to have the tax rate showing on the report.?
Hi MounirDev,
In above figure, custinvoiceJour is in relation with salesinvoicetmp, not with custinvoicetrans table.
Thanks,
Please check this thread
community.dynamics.com/.../741651
In SalesInvoiceTmp, JournalRecId field is linked with custinvoicejour table, not custInvoiceTrans.
There is a standard field for TaxAmount in SalesInvoiceTmp, if you comment your code, isn't the standard logic working?
André Arnaud de Cal...
292,111
Super User 2025 Season 1
Martin Dráb
230,934
Most Valuable Professional
nmaenpaa
101,156