Showing posts with label Amount. Show all posts
Showing posts with label Amount. Show all posts
Tuesday, March 15, 2022
X++ to get GST Amount in D365F&O
To Get GST Amount in Dynamics 365 F&O through X++ Code
public Amount GetGSTAmount(str type)
{
TaxDocumentRowTransaction TaxDocumentRowTransaction;
TaxDocumentComponentTransaction TaxDocumentComponentTransaction;
TaxComponentTable_IN component.
TaxDocumentComponentTransaction_In taxDocumentComponentTransactionIn;
select sum (TaxAmount) from TaxDocumentComponentTransaction
exists join TaxDocumentRowTransaction
where TaxDocumentRowTransaction.RecId == TaxDocumentComponentTransaction.TaxDocumentRowTransactionRecId
&& TaxDocumentRowTransaction. Voucher == this. Voucher
&& TaxDocumentRowTransaction.InvoiceId == this.CustomerInvoiceNo
&& TaxDocumentRowTransaction.TransactionDate == this.CustomerInvoiceDate
exists join taxDocumentComponentTransactionIn
where taxDocumentComponentTransactionIn.TaxDocumentComponnetTransactionRecId == TaxDocumentComponentTransaction.RecId
exists join component where component.RecId == taxDocumentComponentTransactionIn.TaxComponent
&& component.TaxType == TaxType_IN::GST
&& component. Component == type;
return TaxDocumentComponentTransaction.TaxAmount;
}
Subscribe to:
Comments (Atom)