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 :
Small and medium business | Business Central, N...
Answered

GST Component % in Sales Order Confirmation report

(0) ShareShare
ReportReport
Posted on by 152
Hello Experts,
 
I am trying to bring GST Component % into the sales order confirmation report. I can see the % in Tax Transaction Value table, but this value is not populating into the report. See the below screen shots. 
 
//
 
//
 
//
 

 local procedure GetGSTAmounts(TaxTransactionValue: Record /Tax Transaction Value/;

       SalesLine: Record /Sales Line/;

       GSTSetup: Record /GST Setup/)

    var

        ComponentName: Code[30];

    begin

        ComponentName := GetComponentName(SalesLine, GSTSetup);

 

        if (SalesLine.Type <> SalesLine.Type::/ /) then begin

            TaxTransactionValue.Reset();

            TaxTransactionValue.SetRange(/Tax Record ID/, SalesLine.RecordId);

            TaxTransactionValue.SetRange(/Tax Type/, GSTSetup./GST Tax Type/);

            TaxTransactionValue.SetRange(/Value Type/, TaxTransactionValue./Value Type/::COMPONENT);

            TaxTransactionValue.SetFilter(Percent, '<>%1', 0);

            if TaxTransactionValue.FindSet() then

                repeat

                    case TaxTransactionValue./Value ID/ of

                        6:

                            begin

                                SGSTAmt += Round(TaxTransactionValue.Amount, GetGSTRoundingPrecision(ComponentName));

                                SGSTPerc := TaxTransactionValue.Percent;

                            end;

                        2:

                            begin

                                CGSTAmt += Round(TaxTransactionValue.Amount, GetGSTRoundingPrecision(ComponentName));

                                CGSTPerc := TaxTransactionValue.Percent;

                            end;

                        3:

                            begin

                                IGSSTAmt += Round(TaxTransactionValue.Amount, GetGSTRoundingPrecision(ComponentName));

                                IGSTPerc := TaxTransactionValue.Percent;

                            end;

                    end;

                until TaxTransactionValue.Next() = 0;

        end;

    end;

 

Share your thoughts,

Best Regards,

Ranjith E S 

I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    95,634 Super User 2025 Season 2 on at
    What trigger did you put in the GetGSTAmounts() function? Can you share all the code?
     
    Thanks
    ZHU
  • RE-24072358-0 Profile Picture
    152 on at
    Hi YUN ZHU,
     
    See the code detail
     

    dataitem("Sales Line"; "Sales Line")

                        {

                            DataItemLink = "Document Type" = field("Document Type"),

                                           "Document No." = field("No.");

                            DataItemLinkReference = "Sales Header";

                            DataItemTableView = sorting("Document Type", "Document No.", "Line No.");

     

     

                            trigger OnPreDataItem()

                            begin

                                CurrReport.Break();

                            end;

                        }

                        dataitem(RoundLoop; Integer)

                        {

                            DataItemTableView = sorting(Number);

     

                            column(SalesLineAmt; TempSalesLine."Line Amount")

                            {

                                AutoFormatExpression = "Sales Header"."Currency Code";

                                AutoFormatType = 1;

                            }

                            column(Desc_SalesLine; "Sales Line".Description)

                            {

                            }

                            column(NNCSalesLineLineAmt; NNC_SalesLineLineAmt)

                            {

                            }

                            column(NNCSalesLineInvDiscAmt; NNC_SalesLineInvDiscAmt)

                            {

                            }

                            column(NNCTotalLCY; NNC_TotalLCY)

                            {

                            }

                            column(NNCVATAmt; NNC_VATAmt)

                            {

                            }

     

                            column(NNCPmtDiscOnVAT; NNC_PmtDiscOnVAT)

                            {

                            }

                            column(NNCTotalInclVAT2; NNC_TotalInclVAT2)

                            {

                            }

                            column(NNCVatAmt2; NNC_VatAmt2)

                            {

                            }

                            column(NNCTotalExclVAT2; NNC_TotalExclVAT2)

                            {

                            }

                            column(VATBaseDisc_SalesHeader; "Sales Header"."VAT Base Discount %")

                            {

                            }

                            column(ShowInternalInfo; ShowInterInf)

                            {

                            }

                            column(No2_SalesLine; "Sales Line"."No.")

                            {

                            }

                            column(Qty_SalesLine; "Sales Line".Quantity)

                            {

                            }

                            column(UnitofMeasure_SalesLine; "Sales Line"."Unit of Measure")

                            {

                                IncludeCaption = false;

                            }

                            column(UnitPrice_SalesLine; "Sales Line"."Unit Price")

                            {

                                AutoFormatExpression = "Sales Header"."Currency Code";

                                AutoFormatType = 2;

                            }

                            column(LineDiscount_SalesLine; "Sales Line"."Line Discount %")

                            {

                            }

                            column(LineAmt_SalesLine; "Sales Line"."Line Amount")

                            {

                                AutoFormatExpression = "Sales Header"."Currency Code";

                                AutoFormatType = 1;

                            }

                            column(AllowInvDisc_SalesLine; "Sales Line"."Allow Invoice Disc.")

                            {

                                IncludeCaption = false;

                            }

                            column(LineDiscount_SalesLineAmount; "Sales Line"."Line Discount Amount")

                            {

                            }

                            column(VATIdentifier_SalesLine; "Sales Line"."VAT Identifier")

                            {

                            }

                            column(Type_SalesLine; Format("Sales Line".Type))

                            {

                            }

                            column(No_SalesLine; "Sales Line"."Line No.")

                            {

                            }

                            column(AllowInvoiceDisYesNo; Format("Sales Line"."Allow Invoice Disc."))

                            {

                            }

                            column(SalesLineInvDiscAmount; TempSalesLine."Inv. Discount Amount")

                            {

                                AutoFormatExpression = "Sales Header"."Currency Code";

                                AutoFormatType = 1;

                            }

                            column(TotalText; TotalText)

                            {

                            }

                            column(SalesLineLineAmtInvDiscAmt; TempSalesLine."Line Amount" - TempSalesLine."Inv. Discount Amount")

                            {

                                AutoFormatExpression = "Sales Header"."Currency Code";

                                AutoFormatType = 1;

                            }

                            column(SalesLineTaxAmount; 0)

                            {

                                AutoFormatExpression = "Sales Header"."Currency Code";

                                AutoFormatType = 1;

                            }

                            column(ChargesAmount; ChargesAmount)

                            {

                                AutoFormatExpression = "Sales Header"."Currency Code";

                                AutoFormatType = 1;

                            }

                            column(OtherTaxesAmount; OtherTaxesAmount)

                            {

                                AutoFormatExpression = "Sales Header"."Currency Code";

                                AutoFormatType = 1;

                            }

                            column(TotalInclVATText; TotalInclVATText)

                            {

                            }

                            column(TotalAmount; TotalAmount)

                            {

                                AutoFormatExpression = "Sales Header"."Currency Code";

                                AutoFormatType = 1;

                            }

                            column(NNCSalesLineExciseAmt; NNC_SalesLineExciseAmt)

                            {

                            }

                            column(NNCSalesLineTaxAmt; NNC_SalesLineTaxAmt)

                            {

                            }

                            column(NNCSalesLineSvcTaxAmt; NNC_SalesLineSvcTaxAmt)

                            {

                            }

                            column(NNCSalesLineSvcTaxeCessAmt; NNC_SalesLineSvcTaxeCessAmt)

                            {

                            }

                            column(NNCSalesLineSvcSHECessAmt; NNC_SalesLineSvcSHECessAmt)

                            {

                            }

                            column(NNCSalesLineTDSTCSSHECESS; NNC_SalesLineTDSTCSSHECESS)

                            {

                            }

                            column(VATDiscountAmount; -VATDiscountAmount)

                            {

                                AutoFormatExpression = "Sales Header"."Currency Code";

                                AutoFormatType = 1;

                            }

                            column(TotalExclVATText; TotalExclVATText)

                            {

                            }

                            column(VATBaseAmount; VATBaseAmount)

                            {

                                AutoFormatExpression = "Sales Header"."Currency Code";

                                AutoFormatType = 1;

                            }

                            column(VATAmtLineVATAmtText; TempVATAmountLine.VATAmountText())

                            {

                            }

                            column(VATAmount1; VATAmount)

                            {

                                AutoFormatExpression = "Sales Header"."Currency Code";

                                AutoFormatType = 1;

                            }

                            column(TotalAmountInclVAT; TotalAmountInclVAT)

                            {

                                AutoFormatExpression = "Sales Header"."Currency Code";

                                AutoFormatType = 1;

                            }

                            column(No_SalesLineCaption; "Sales Line".FieldCaption("No."))

                            {

                            }

                            column(Description_SalesLineCaption; "Sales Line".FieldCaption(Description))

                            {

                            }

                            column(Quantity_SalesLineCaption; "Sales Line".FieldCaption(Quantity))

                            {

                            }

                            column(UnitofMeasure_SalesLineCaption; "Sales Line".FieldCaption("Unit of Measure"))

                            {

                            }

                            column(AllowInvDisc_SalesLineCaption; "Sales Line".FieldCaption("Allow Invoice Disc."))

                            {

                            }

                            column(UnitPriceCaption; UnitPriceCaptionLbl)

                            {

                            }

                            column(DiscPercentCaption; DiscPercentCaptionLbl)

                            {

                            }

                            column(LineDiscCaption; LineDiscCaptionLbl)

                            {

                            }

                            column(SubtotalCaption; SubtotalCaptionLbl)

                            {

                            }

                            column(ExciseAmtCaption; ExciseAmtCaptionLbl)

                            {

                            }

                            column(TaxAmtCaption; TaxAmtCaptionLbl)

                            {

                            }

                            column(ServTaxAmtCaption; ServTaxAmtCaptionLbl)

                            {

                            }

                            column(ChargesAmtCaption; ChargesAmtCaptionLbl)

                            {

                            }

                            column(OtherTaxesAmtCaption; OtherTaxesAmtCaptionLbl)

                            {

                            }

                            column(ServTaxeCessAmtCaption; ServTaxeCessAmtCaptionLbl)

                            {

                            }

                            column(TCSAmtCaption; TCSAmtCaptionLbl)

                            {

                            }

                            column(ServTaxSHECessAmtCaption; ServTaxSHECessAmtCaptionLbl)

                            {

                            }

                            column(VATDisctAmtCaption; VATDisctAmtCaptionLbl)

                            {

                            }

                            column(NNCSalesLineSvcTaxSBCAmt; NNC_SalesLineSvcTaxSBCAmt)

                            {

                            }

                            column(ServTaxSBCAmtCaption; ServTaxSBCAmtCaptionLbl)

                            {

                            }

                            column(NNCSalesLineKKCessAmt; NNC_SalesLineKKCessAmt)

                            {

                            }

                            column(KKCessAmtCaption; KKCessAmtCaptionLbl)

                            {

                            }

                            /* -------------------02/08/2023 starts ------------------------- */

                            // column(SGSTPercentageVal; SGSTPerc)

                            // {

                            // }

                            // column(CGSTPercentageVal; CGSTPerc)

                            // {

                            // }

                            // column(IGSTPercentageVal; IGSTPerc)

                            // {

                            // }

                            /* -------------------02/08/2023 ends ------------------------- */

                            /* -------------------04/08/2023 starts ------------------------- */

                            column(SGSTPercentageVal; SGSTPerc)

                            {

                            }

                            column(CGSTPercentageVal; CGSTPerc)

                            {

                            }

                            column(IGSTPercentageVal; IGSTPerc)

                            {

                            }

                            column(TestVariable; Testvar)

                            {

     

                            }

                            /* -------------------04/08/2023 ends ------------------------- */

     

                            dataitem(DimensionLoop2; Integer)

                            {

                                DataItemTableView = sorting(Number)

                                                    where(Number = filter(1 ..));

     

                                column(DimText1; DimText)

                                {

                                }

                                column(LineDimsCaption; LineDimsCaptionLbl)

                                {

                                }

     

                                trigger OnAfterGetRecord()

                                var

                                    GSTSetup: Record "GST Setup";

                                begin

                                    DimText := GetDimensionText(DimSetEntry2, Number, Continue);

                                    if not Continue then

                                        CurrReport.Break();

     

                                    if not GSTSetup.Get() then

                                        exit;

     

                                    if ShowInterInf then begin

     

                                        GetGSTCaptions(TaxTrnasactionValue, TempSalesLine, GSTSetup);

     

                                        GetGSTAmounts(TaxTrnasactionValue, TempSalesLine, GSTSetup);

                                        TestVar := CheckGSTDoc("Sales Line");

                                        TotalAmount := NNC_SalesLineLineAmt - NNC_SalesLineInvDiscAmt + NNC_SalesLineExciseAmt + NNC_SalesLineTaxAmt +

                                        NNC_SalesLineSvcTaxAmt + NNC_SalesLineSvcTaxeCessAmt + ChargesAmount +

                                        OtherTaxesAmount +

                                        NNC_SalesLineTDSTCSSHECESS + NNC_SalesLineSvcSHECessAmt +

                                        NNC_SalesLineSvcTaxSBCAmt + NNC_SalesLineKKCessAmt;

                                    end;

                                end;

  • RE-24072358-0 Profile Picture
    152 on at
    YUN ZHU,
     
    Onaftergetrecord  trigger is used. 
     
     
  • Suggested answer
    RE-24072358-0 Profile Picture
    152 on at
    Issue has been solved. 
     
    There is a condition in the default code 

     begin

                                    if not ShowInterInf then begin

                                        if not GSTSetup.Get() then

                                            exit;

     

                                        if not TCSSetup.Get() then

                                            exit;

    Hence the value should be there in Tax Type field in TCS Setup screen. 

     

    Best Regards,

    Ranjith 

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,785

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,007 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 948 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans