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

I want to add a column in the Vendor ledger entries table for VAT.

(2) ShareShare
ReportReport
Posted on by 21
I want to add a column to the vendor ledger entries table where we have all the invoices and when we click in the Posted date field an invoice is opened via Posted Purchase Invoice which has a field called total VAT.
 
But I want this Total VAT field to be shown in the Vendor ledger entries table so that I don't have to open invoices again and again to view the VAT amount.
  • Suggested answer
    YUN ZHU Profile Picture
    78,972 Super User 2025 Season 1 on at
    I want to add a column in the Vendor ledger entries table for VAT.
    Hi, Because Payment generally does not generate VAT, I only calculated the type of Invoice. If you need to calculate Credit Memo, you need to add a condition and get the value from the Sales Cr.Memo Header
     
    Thanks.
    ZHU
  • Community member Profile Picture
    21 on at
    I want to add a column in the Vendor ledger entries table for VAT.
    can you help me understand the first if condition logic here?
     if Rec."Document Type" = Rec."Document Type"::Invoice then
                if PurchInvHeader.Get(Rec."Document No.") then begin
                    PurchInvHeader.CalcFields(Amount, "Amount Including VAT");
                    TotalVAT := PurchInvHeader."Amount Including VAT" - PurchInvHeader.Amount;
                end;
     
  • Community member Profile Picture
    21 on at
    I want to add a column in the Vendor ledger entries table for VAT.
    Thanks a lot I was stuck on this for a week or more.

    Thank You very much you are brilliant.
  • Verified answer
    YUN ZHU Profile Picture
    78,972 Super User 2025 Season 1 on at
    I want to add a column in the Vendor ledger entries table for VAT.
    Hi, If you want to display the following field, I hope the following scheme can give you some tips.
    For example,
    pageextension 50122 MyExtension7 extends "Vendor Ledger Entries"
    {
        layout
        {
            addafter("Posting Date")
            {
                field(TotalVAT; TotalVAT)
                {
                    Caption = 'Total VAT';
                    ApplicationArea = All;
                }
            }
        }
    
        trigger OnAfterGetRecord()
        var
            PurchInvHeader: Record "Purch. Inv. Header";
        begin
            TotalVAT := 0;
            if Rec."Document Type" = Rec."Document Type"::Invoice then
                if PurchInvHeader.Get(Rec."Document No.") then begin
                    PurchInvHeader.CalcFields(Amount, "Amount Including VAT");
                    TotalVAT := PurchInvHeader."Amount Including VAT" - PurchInvHeader.Amount;
                end;
        end;
    
        var
            TotalVAT: Decimal;
    }
     
    Thanks.
    ZHU

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,020 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,837 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans