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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to display GST rates and amounts used in Indian Taxation on Project Invoice Proposal Print Preview report?

(0) ShareShare
ReportReport
Posted on by 35

Hi all,

I want to display IGST, CGST, SGST amounts and rates used in Indian Taxation on Project Invoice proposal Print Preview report. We can see these amounts from the Tax document option as shown in following picture:

Snapshot.jpg

There are codes available online to calculate GST rates and amounts on Purchase order or sales order confirmation and invoice. But I can't find a way to calculate the same on Project Invoice Proposal.

Actually, I need this because I want to show these rates and amounts for each line on Print Preview report in action pane.

*This post is locked for comments

I have the same question (0)
  • B K Sharma Profile Picture
    737 on at

    Dear Sameer,

    Actually i do not have a setup of project module so i m unable to provide you exact solution but i can give you some code, may be it help you to identify actual code.

    The below code is for sales order invoice.

    //Variable declaration for tax document tables

    TaxDocumentRowTransaction_IN        taxDocumentRowTransaction_IN;

       TaxDocumentRowTransaction           taxDocumentRowTransaction;

       taxDocumentComponentTransaction     taxDocumentComponentTransaction;

       TaxDocumentComponentTransaction_IN  taxDocumentComponentTransaction_IN;

       TaxComponentTable_IN                taxComponentTable_IN;

       ITaxDocumentComponentLine           taxDocumentComponentLine;

       ITaxDocumentComponentLineEnumerator taxDocumentComponentLineEnumerator;

    select firstOnly HSNCode, SAC from taxDocumentRowTransaction_IN

                   join RecId, DiscountAmount from taxDocumentRowTransaction

                       where taxDocumentRowTransaction.RecId                       == taxDocumentRowTransaction_IN.TaxDocumentRowTransactionRecId

                           && taxDocumentRowTransaction.TransactionHeaderTableId   == salesParmTable.TableId

                           && taxDocumentRowTransaction.TransactionHeaderRecId     == salesParmTable.RecId

                           && taxDocumentRowTransaction.TransactionLineTableId     == salesParmLine.TableId

                           && taxDocumentRowTransaction.TransactionLineRecId       == salesParmLine.RecId

                       join TaxBaseAmount from taxDocumentComponentTransaction

                           where taxDocumentComponentTransaction.TaxDocumentRowTransactionRecId == taxDocumentRowTransaction.RecId;

    while select TaxBaseAmount, TaxAmount, TaxRate from taxDocumentComponentTransaction

               where taxDocumentComponentTransaction.TaxDocumentRowTransactionRecId                == taxDocumentRowTransaction.RecId

               join TotalReverseChargeAmount from taxDocumentComponentTransaction_IN

                   where taxDocumentComponentTransaction_IN.TaxDocumentComponnetTransactionRecId   == taxDocumentComponentTransaction.RecId

                   join Component from taxComponentTable_IN

                       where taxComponentTable_IN.RecId    == taxDocumentComponentTransaction_IN.TaxComponent

                           && taxComponentTable_IN.TaxType == TaxType_IN::GST

           {

               if(taxComponentTable_IN.Component == "IGST")

               {

                   _SalesOrderInvoiceTmp.IGSTTaxComponentRate = taxDocumentComponentTransaction.TaxRate;

                   _SalesOrderInvoiceTmp.IGSTComponentAmount  =  taxDocumentComponentTransaction.TaxAmount;

               }

               if(taxComponentTable_IN.Component == "CGST")

               {

                   _SalesOrderInvoiceTmp.cGSTTaxComponentRate = taxDocumentComponentTransaction.TaxRate;

                   _SalesOrderInvoiceTmp.cGSTComponentAmount  =  taxDocumentComponentTransaction.TaxAmount;

               }

               if(taxComponentTable_IN.Component == "SGST")

               {

                   _SalesOrderInvoiceTmp.SGSTTaxComponentRate = taxDocumentComponentTransaction.TaxRate;

                   _SalesOrderInvoiceTmp.SGSTComponentAmount  =  taxDocumentComponentTransaction.TaxAmount;

               }

           }

    Let me know if any help in this.

    Thanks

    B K Sharma

  • Sameer. Profile Picture
    35 on at

    Thanks for the reply. But this solution will provide GST rates and amounts only for sales order posted on a project.

    I want GST rates and amounts also for subscriptions and hour journals posted on a Project.

  • Verified answer
    Sameer. Profile Picture
    35 on at

    Finally I found the solution. It is the class ProjProposalTotals which provides methods for calculating tax for sales order, hour journal, subscription, on account transactions etc.

    Below given is the code for getting CGST, IGST, SGST rates and amounts for each line on Project Invoice Proposal-

    static void GetGSTRatesAndAmounts(Args _args)
    {
        ProjProposalTotals                  projProposalTotals;
    
        ITaxableDocument                    taxableDocument;
        ITaxDocumentComponentLineEnumerator lineEnumerator;
        ITaxDocumentComponentLine           componentLineObject;
        ITaxDocument                        taxDocumentObject;
    
    
        projProposalTotals = new ProjProposalTotals(ProjProposalJour::find('‪‪‪‪‪‪‪‪‪Your Proposal ID'));
        
        taxableDocument = TaxableDocumentObject::construct(projProposalTotals.parmTaxableDocDescriptorRevenueSubTrans());     //Use for Subscription
        //taxableDocument = TaxableDocumentObject::construct(projProposalTotals.parmTaxableDocDescriptorEmplTrans());         //Use for Hour journal
        //taxableDocument = TaxableDocumentObject::construct(projProposalTotals.parmTaxableDocDescriptorItemSOTrans());       //Use for Sales order
        //taxableDocument = TaxableDocumentObject::construct(projProposalTotals.parmTaxableDocumentDescriptorAccTrans());     //Use for On-account transaction
        
    
        taxDocumentObject = TaxBusinessService::calculateTax(taxableDocument);
    
        if (taxDocumentObject)
        {
            // Calculation of Tax amount for Tax type GST and Tax component SGST
    
            lineEnumerator = taxDocumentObject.componentLines("GST","CGST");
            while (lineEnumerator.moveNext())
            {
                componentLineObject = lineEnumerator.current();
    
                info(strFmt('CGST Rate: %1', componentLineObject.getMeasure("Rate").value().value()*100));
                info(strFmt('CGST Amount: %1', componentLineObject.getMeasure("Tax Amount").value().value()));
            }
    
    
            lineEnumerator = taxDocumentObject.componentLines("GST","IGST");
            while (lineEnumerator.moveNext())
            {
                componentLineObject = lineEnumerator.current();
    
                info(strFmt('IGST Rate: %1', componentLineObject.getMeasure("Rate").value().value()*100));
                info(strFmt('IGST Amount: %1', componentLineObject.getMeasure("Tax Amount").value().value()));
            }
            
    
            lineEnumerator = taxDocumentObject.componentLines("GST","SGST");
            while (lineEnumerator.moveNext())
            {
                componentLineObject = lineEnumerator.current();
    
                info(strFmt('SGST Rate: %1', componentLineObject.getMeasure("Rate").value().value()*100));
                info(strFmt('SGST Amount: %1', componentLineObject.getMeasure("Tax Amount").value().value()));
            }
        }
    }


    Thanks for your replies.
  • darshana.parnaik Profile Picture
    210 on at

    Hi Sameer,

      I have same requirement, Can u please help me how to use above method in invoice proposal report.

    Thanks

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans