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

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.
I have the same question (0)
  • Verified answer
    YUN ZHU Profile Picture
    95,636 Super User 2025 Season 2 on at
    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
  • Community member Profile Picture
    21 on at
    Thanks a lot I was stuck on this for a week or more.

    Thank You very much you are brilliant.
  • Community member Profile Picture
    21 on at
    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;
     
  • Suggested answer
    YUN ZHU Profile Picture
    95,636 Super User 2025 Season 2 on at
    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

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,577

#2
YUN ZHU Profile Picture

YUN ZHU 888 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 778 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans