web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Gst ledger dimension

(0) ShareShare
ReportReport
Posted on by 110
How can i get ledgerdimension of gst transaction before posting the transaction in invoice journal

*This post is locked for comments

I have the same question (0)
  • Crispin John Augustine Profile Picture
    37,081 on at

    after posting: you can find it in the table field TaxTransGeneralJournalAccountEntry.LedgerDimension

    before posting: you can find it by Debugging for the table field LedgerJournalTrans.LedgerDimension

    Several classes extending LedgerJournalEngine_** can post a tax transaction. You have to find your exact type of posting, and it?s corresponding class, and start Debugging there.

    Alternately, you have two generic places to start the trace:

    1. you can also place a breakpoint at class method LedgerJournalEngine.initTaxGroup() and follow the _ledgerJournalTrans instance.

    2. breakpoint at table method LedgerJournalTrans.parmLedgerDimension()

  • Derik Profile Picture
    110 on at

    Thank you Crispin,

    Is it possible to get ledgeraccount based on taxcomponent ,taxgroup

  • Crispin John Augustine Profile Picture
    37,081 on at

    Yes, but that will be only after posting. You get it with an easy join between TaxTrans and TaxTransGeneralJournalAccountEntry

  • Suggested answer
    Derik Profile Picture
    110 on at
    Code - gst calculation for ledger transaction TmpTaxDocument tmpTax; SalesCalcTax PurchCalcTax; SalesTotals salesTotals; ITaxableDocument taxableDocument; ITaxDocumentComponentLineEnumerator lineEnumerator; ITaxDocument taxDocumentObject; ITaxDocumentMeasure taxMeasure; ITaxDocumentMeasureEnumerator taxMeasureEnumerator; ITaxDocumentMeasureValue partyTaxMeasureValue; int i; TaxEngineLedgerJournalTransHeader taxEngineLedgerJournalTrans; CustInvoiceJour custInvoiceJourtax; real taxTotalGTE,taxtotal,SGST,CGST,IGST; taxEngineLedgerJournalTrans = TaxEngineLedgerJournalTransHeader::findByJourNumVoucher(_LedgerJournalTrans.JournalNum, _LedgerJournalTrans.Voucher); taxDocumentObject = TaxBusinessService::getTaxDocumentBySource(taxEngineLedgerJournalTrans.TableId, taxEngineLedgerJournalTrans.RecId); if (taxDocumentObject) { taxTotalGTE = taxDocumentObject.getTotalTax().amountTransactionCurrency(); // Calculation of Tax amount for Tax type GST and Tax component SGST lineEnumerator = taxDocumentObject.componentLines("GST","SGST"); while (lineEnumerator.moveNext()) { taxMeasureEnumerator = lineEnumerator.current().measures(); while (taxMeasureEnumerator.moveNext()) { i++; if (i == 3) { partyTaxMeasureValue = taxMeasureEnumerator.current().value(); SGST += partyTaxMeasureValue.amountTransactionCurrency(); i=0; break; } } } // Calculation of Tax amount for Tax type GST and Tax component CGST lineEnumerator = taxDocumentObject.componentLines("GST","CGST"); while (lineEnumerator.moveNext()) { taxMeasureEnumerator = lineEnumerator.current().measures(); while (taxMeasureEnumerator.moveNext()) { i++; if (i == 3) { partyTaxMeasureValue = taxMeasureEnumerator.current().value(); CGST += partyTaxMeasureValue.amountTransactionCurrency(); i=0; break; } } } // Calculation of Tax amount for Tax type GST and Tax component IGST lineEnumerator = taxDocumentObject.componentLines("GST","IGST"); while (lineEnumerator.moveNext()) { taxMeasureEnumerator = lineEnumerator.current().measures(); while (taxMeasureEnumerator.moveNext()) { i++; if (i == 3) { partyTaxMeasureValue = taxMeasureEnumerator.current().value(); IGST += partyTaxMeasureValue.amountTransactionCurrency(); i=0; break; } } } } CITLedgerJournalTmp.AmountCurCredit = taxTotalGTE; info( strFmt("Total GST value of sales order : %1 " , taxTotalGTE)); if(IGST) { CITLedgerJournalTmp.LedgerAccount = 'IGST'; CITLedgerJournalTmp.AmountCurCredit = IGST; CITLedgerJournalTmp.insert(); info( strFmt("Line IGST value of sales order : %1 " , IGST)); } else { CITLedgerJournalTmp.LedgerAccount = 'SGST'; CITLedgerJournalTmp.AmountCurCredit = SGST; CITLedgerJournalTmp.insert(); CITLedgerJournalTmp.LedgerAccount = 'CGST'; CITLedgerJournalTmp.AmountCurCredit = CGST; CITLedgerJournalTmp.insert(); info( strFmt("Line SGST value of sales order : %1 " , SGST)); info( strFmt("Line CGST value of sales order : %1 " , CGST)); } This is the code i have written for calculating gst , I need to get ledger dimension for corressponding taxes like IGST,CGST etc how can i achieve ?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans