Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

How to know which GL Account in GL Ledger Entry is generated for a certain Posted Purchase Invoice Line

(0) ShareShare
ReportReport
Posted on by 295

The purchase invoice has many item line, each item has a different Posting Group.

After posting the invoice, I don't know how to map between Invoice Line and GL Ledger entry line

Can someone show me how to link them together

Posted Purchase invoice line

pastedimage1668511295865v1.png

General Ledger Entry

  • Suggested answer
    Greg Enns Profile Picture
    1,102 on at
    RE: How to know which GL Account in GL Ledger Entry is generated for a certain Posted Purchase Invoice Line

    You are correct that the setups can be changed, which can change where things post to. And in that case you really can't trace it back unless you keep a log of changes, and try to incorporate that into your linking process.

    The link between GL and Invoice is primarily based on Document No. It sounds like you're trying to link inventory transactions, in which case you may find some help by analyzing the Item Ledger Entry and Value Entry tables. These will not help with tracing to proper GL account, but they can help to clarify the inventory value that was posted for each line.

  • Suggested answer
    Dallefeld Profile Picture
    175 User Group Leader on at
    RE: How to know which GL Account in GL Ledger Entry is generated for a certain Posted Purchase Invoice Line

    I am very concerned that you state your Inventory Posting Setup is not fixed. If you change the inventory Posting Group on an item, you have a requirement to make an accounting change to keep your subledger and general ledger balanced.

    Using the Inventory Posting, General Product Posting Group, General Business Posting and Customer Posting Group will tell you what was used to get the general ledger account. Then as @ZHU shows you in his response, you have all the general ledger entries that were created based on the document number and posting date.

  • Suggested answer
    YUN ZHU Profile Picture
    81,598 Super User 2025 Season 1 on at
    RE: How to know which GL Account in GL Ledger Entry is generated for a certain Posted Purchase Invoice Line

    Hi, they are not directly related. If you want to investigate, you can check it in detail according to Document No.

    For example,

    pastedimage1668578189684v5.png

    pastedimage1668578129873v4.png

    Hope this helps as well.

    Thanks.

    ZHU

  • Hoang Ng Profile Picture
    295 on at
    RE: How to know which GL Account in GL Ledger Entry is generated for a certain Posted Purchase Invoice Line

    Thanks Amit, NavNab

    The big problem is that the Inventory Posting Setup is not fixed forever, It can be changed.  If it is changed, you will not know which line in GL mapping with Invoice line.

    Is there another way to know exactly the relationship between to table Invoice Line and GL Ledger Entry ?

  • Suggested answer
    Dallefeld Profile Picture
    175 User Group Leader on at
    RE: How to know which GL Account in GL Ledger Entry is generated for a certain Posted Purchase Invoice Line

    Also know this, there are 4 entries made when invoicing inventory items.

    Debit to Purchases Account from General Posting Setup

    Credit to Accounts Payable from Vendor Posting Setup

    Debit to Inventory from Inventory Posting Setup

    Credit to Direct Cost Applied from General Posting Setup

    Note: do not make purchase account and direct cost applied account the same GL account. They should net to zero but if you make them the same account it is a bit harder to find your problems.

  • Suggested answer
    DAnny3211 Profile Picture
    9,276 Moderator on at
    RE: How to know which GL Account in GL Ledger Entry is generated for a certain Posted Purchase Invoice Line

    hello

    you do not have a direct relationship between the two tables

    you should make a customisation

    DAniele

  • Suggested answer
    NavNab Profile Picture
    4 on at
    RE: How to know which GL Account in GL Ledger Entry is generated for a certain Posted Purchase Invoice Line

    You can see the accounts in "General Posting Setup".

    Identify the line that corresponds to your "Gen. Bus. Posting Group" (invoice header) and "Gen. Prod. Posting Group" (invoice line). You'll the find the account(s) in the columns. For example: "Purch. Account".

    Now that you know the basics you can explore more advanced setup and try to identify "discount accounts" or "COGS accounts" for example.

    P.S: The same logic applies to VAT >> see "VAT Posting Setup".

  • Suggested answer
    Amit_Sharma Profile Picture
    2,545 on at
    RE: How to know which GL Account in GL Ledger Entry is generated for a certain Posted Purchase Invoice Line

    Hi,

    Entries created according to the posting groups. for more information. read Purch-Post codeunit.

    Regards

    Amit Sharma

    www.erpconsultors.com

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March 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... 294,190 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,968 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans