Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

CGST, SGST, IGST and total with GST for sales invoice report

(0) ShareShare
ReportReport
Posted on by 76

I'm working in India localization for Business Central. I'm looking for CGST, SGST, IGST and total with GST values for my sales invoice report. If i opened my sales invoice page, i can able to see tax information factbox showing CGST, SGST values, but i'm unable to get those values to my report through report extension. I want to know from where we have to take CGST, SGST, IGST and total with GST values. Also how to write a code in AL to show CGST, SGST and IGST depending upon interstate/intrastate? how in report CGST, SGST and IGST values gets changed when we changed the currency and inter/intrastate?

...pastedimage1661247761873v3.png 

  • Lakshmanan.R Profile Picture
    Lakshmanan.R 137 on at
    RE: CGST, SGST, IGST and total with GST for sales invoice report

    Dear Revathi.T ,

    Thank you  for your suggestions and responses. your responses helped me a lot to get solutions quicker.

  • Revathi.T Profile Picture
    Revathi.T 76 on at
    RE: CGST, SGST, IGST and total with GST for sales invoice report

    If you see in my code, i have created object DGST for Detailed GST Ledger Entry in OnAfterGetRecord trigger under the dataitem ("Sales Invoice Line"; "Sales Invoice Line") in Report extension extending "Standard Sales Invoice". Please try like this. The Detailed GST Ledger Entry Table will automatically comes when you press Alt+Space when defining object for the record.

  • Lakshmanan.R Profile Picture
    Lakshmanan.R 137 on at
    RE: CGST, SGST, IGST and total with GST for sales invoice report

    sorry for the confusion. I meant I'm not able to find the Detailed GST Ledger Entry in VS Code

  • Revathi.T Profile Picture
    Revathi.T 76 on at
    RE: CGST, SGST, IGST and total with GST for sales invoice report

    Or the other way, Go to Posted Sales Invoice, Select "Find Entries" in Home Tab, you can able to "Detailed GST Ledger Entry"

  • Revathi.T Profile Picture
    Revathi.T 76 on at
    RE: CGST, SGST, IGST and total with GST for sales invoice report

    Hi Lakshmanan.R,

    You can simply type "Detailed GST Ledger Entry" in search bar.

  • Lakshmanan.R Profile Picture
    Lakshmanan.R 137 on at
    RE: CGST, SGST, IGST and total with GST for sales invoice report

    Dear Revathi.T,

     Thanks for your response ,but I'm not able to find the mentioned table "Detailed GST Ledger Entry". Could you please tell me where would I find the above mentioned table.?

  • Revathi.T Profile Picture
    Revathi.T 76 on at
    RE: CGST, SGST, IGST and total with GST for sales invoice report

    dataitem("Sales invoice Line"; "Sales Invoice Line")

               {

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

                   DataItemLinkReference = Header;

                   DataItemTableView = sorting("Document No.");

                   column(HSN_SAC_Code_; "HSN/SAC Code") { }

                   column(CGSTAmount; CGSTAmount) { }

                   column(SGSTAmount; SGSTAmount) { }

                   column(IGSTAmount; IGSTAmount) { }

                   column(TotalGST; TotalGST) { }

                   column(TotalAmountwithGST_; TotalAmountwithGST) { }

                   column(GSTpercent; GSTpercentage) { }

                   column(SGSTpercent; SGSTpercentage) { }

                   column(IGSTpercent; IGSTpercentage) { }

                   trigger OnAfterGetRecord()

                   var

                       DGST: Record "Detailed GST Ledger Entry";

                       Salesinvline: Record "Sales Invoice line";

                       TotalAmountwithoutGST: Decimal;

                   begin

                       DGST.Reset();

                       DGST.SetRange("Document No.", CurrReport.Header."No.");

                       TotalGST := 0;

                       CGSTAmount := 0;

                       SGSTAmount := 0;

                       IGSTAmount := 0;

                       TotalAmountwithoutGST := CurrReport.Header.Amount;

                       if DGST.FindFirst() then

                           repeat

                               TotalGST += -DGST."GST Amount";

                               if DGST."GST Component Code" = 'CGST' then begin

                                   CGSTAmount += -DGST."GST Amount";

                                   GSTpercentage := DGST."GST %";

                               end;

                               if DGST."GST Component Code" = 'SGST' then begin

                                   SGSTAmount += -DGST."GST Amount";

                                   SGSTpercentage := DGST."GST %";

                               end;

                               if DGST."GST Component Code" = 'IGST' then begin

                                   IGSTAmount += -DGST."GST Amount";

                                   IGSTpercentage := DGST."GST %";

                               end;

                           until DGST.Next() = 0

                       else begin

                           TotalGST := 0;

                           CGSTAmount := 0;

                           SGSTAmount := 0;

                           IGSTAmount := 0;

                           GSTpercentage := 0;

                           SGSTpercentage := 0;

                           IGSTpercentage := 0;

                       end;

                       TotalAmountwithGST := TotalAmountwithoutGST + TotalGST;

                   end;

               }

    Previously i made mistake by linking "Sales Line" and "Detailed Gst Ledger Entry", i couldn't able to get values in my report. Later i tried linking "Sales Invoice Line" and "Detailed GST Ledger Entry", and also i used CurrReport.Header."No." . This time i can able to get current line values from Detailed GST Ledger Entry. The Above Code is perfect. Now i can able to get all cgst, igst and sgst values in my standard sales invoice report. Thank you all for your suggestions and responses. your responses helped me a lot to get solutions quicker.

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,081 Super User 2024 Season 1 on at
    RE: CGST, SGST, IGST and total with GST for sales invoice report

    Thanks for the update.

  • Revathi.T Profile Picture
    Revathi.T 76 on at
    RE: CGST, SGST, IGST and total with GST for sales invoice report
    [deleted]
  • Lakshmanan.R Profile Picture
    Lakshmanan.R 137 on at
    RE: CGST, SGST, IGST and total with GST for sales invoice report

    Dear Revathi.T,

    Have you met your requirement on this, with the above code..? If yes, please share the proper code for achieving that.

    If not, please share your GL Setup Screenshots.

    Thanks & Regards,

    Lakshmanan R

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans