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 :
Microsoft Dynamics GP (Archived)

AP invoice distribution by vendor - report

(1) ShareShare
ReportReport
Posted on by

Hello:

I am trying to run a Report or Smart List in Microsoft Dynamics GP 2013 that shows me the General Ledger account distribution and debit/credit amounts for a list of A/P vendors and invoice numbers.  I am basically looking for an invoice distribution report that I can summarize be vendor. 

I welcome any input you can provide.

Thanks.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Tom Cruse Profile Picture
    1,477 on at

    I'm not sure if you have access to SQL but here's a great view Victoria Yudin built that gives you everything you need and more. After you build the view you can either build a smartlist off it with Smartlist Builder or expose the data in a refreshable spreadsheet.

    victoriayudin.com/.../sql-view-to-show-all-gl-distributions-for-ap-transactions

    Then just filter out the invoice doc type.

    CREATE VIEW view_AP_Distributions

    AS

    --~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    --view_AP_Distributions

    --Shows GL distributions for all AP transactions

    --Created Nov 28 2008 by Victoria Yudin, Flexible Solutions

    --For updates see victoriayudin.com/gp-reports

    --Does not exclude voided transactions

    --Transactions with no MC information will show

    --   an exchange rate of 0

    --Updated Feb 11, 2009 to correct link to GL account number

    --Updated May 13, 2009 to add distribution reference

    --Updated Nov 10, 2009 to add GP posting date and more

    --   user friendly column names

    --Updated Jan 22, 2010 to add Document Date

    --Updated Mar 10, 2010 to add Batch ID, Trx Description,

    --   and include unposted transactions

    --Updated May 23, 2010 to add Voucher Number

    --Updated Jun 25, 2010 to add additional distribution types,

    --   currency, exchange rate and originating amounts

    --Updated Jun 27, 2010 to fix copying issue

    --Updated Jun 30, 2010 to add Voided field

    --Updated Dec 17, 2010 to add Vendor Name, GL Account Name

    --Updated Jan 31, 2011 to add ROUND distribution type

    --Updated Mar 8, 2011 to add PM10300 and PM10400 tables

    --Updated Dec 20, 2011 to add PO Number

    --Updated Oct 14, 2014 to fix GL posting date for Work trx

    --Updated Feb 17, 2015 to add 1099 amount

    --~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    SELECT  D.VENDORID Vendor_ID,

       N.VENDNAME Vendor_Name,

       K.DOCNUMBR Document_Number,

       T.PSTGDATE GL_Posting_Date,

       K.DOCDATE Document_Date,

       CASE K.DOCTYPE

            WHEN 1 THEN 'Invoice'

            WHEN 2 THEN 'Finance Charge'

            WHEN 3 THEN 'Misc Charge'

            WHEN 4 THEN 'Return'

            WHEN 5 THEN 'Credit Memo'

            WHEN 6 THEN 'Payment'

            END Document_Type,

       G.ACTNUMST Account_Number,

       A.ACTDESCR Account_Name,

       CASE D.DISTTYPE

            WHEN 1 THEN 'Cash'

            WHEN 2 THEN 'Payable'

            WHEN 3 THEN 'Discount Available'

            WHEN 4 THEN 'Discount Taken'

            WHEN 5 THEN 'Finance Charge'

            WHEN 6 THEN 'Purchase'

            WHEN 7 THEN 'Trade Disc.'

            WHEN 8 THEN 'Misc. Charge'

            WHEN 9 THEN 'Freight'

            WHEN 10 THEN 'Taxes'

            WHEN 11 THEN 'Writeoffs'

            WHEN 12 THEN 'Other'

            WHEN 13 THEN 'GST Disc'

            WHEN 14 THEN 'PPS Amount'

            WHEN 16 THEN 'Round'

            WHEN 17 THEN 'Realized Gain'

            WHEN 18 THEN 'Realized Loss'

            WHEN 19 THEN 'Due To'

            WHEN 20 THEN 'Due From'

            END Distribution_Type,

       D.DEBITAMT Debit_Amount,

       D.CRDTAMNT Credit_Amount,

       D.DistRef Distribution_Reference,

       T.BACHNUMB Batch_ID,

       T.TRXDSCRN Trx_Description,

       T.STAT Trx_Status,

       D.VCHRNMBR Voucher_Number,

       D.CURNCYID Currency_ID,

       coalesce(D.XCHGRATE,0) Exchange_Rate,

       D.ORDBTAMT Originating_Debit_Amount,

       D.ORCRDAMT Originating_Credit_Amount,

       CASE T.VOIDED

            WHEN 0 THEN 'No'

            WHEN 1 THEN 'Yes'

            END Voided,

       T.PORDNMBR PO_Number,

       T.TEN99AMNT [1099_Amount]

    FROM

    -- all open trx distributions

    (SELECT  VENDORID, VCHRNMBR, CNTRLTYP, DEBITAMT, CRDTAMNT,

            DSTINDX, DISTTYPE, DistRef, PSTGDATE, CURNCYID,

            ORDBTAMT, ORCRDAMT, XCHGRATE

            FROM PM10100

    UNION ALL

    -- all historical trx distributions

    SELECT  P.VENDORID, P.VCHRNMBR, P.CNTRLTYP, P.DEBITAMT,

            P.CRDTAMNT, P.DSTINDX, P.DISTTYPE, P.DistRef,

            P.PSTGDATE, P.CURNCYID, P.ORDBTAMT, P.ORCRDAMT,

            M.XCHGRATE

            FROM PM30600 P

            LEFT OUTER JOIN  -- historical exchange rate

          MC020103 M

          ON P.VCHRNMBR = M.VCHRNMBR

          AND P.DOCTYPE = M.DOCTYPE) D

    -- add document number and type

    LEFT OUTER JOIN

           PM00400 K

           ON D.VCHRNMBR = K.CNTRLNUM

           AND D.CNTRLTYP = K.CNTRLTYP

    --add GL account number

    LEFT OUTER JOIN

           GL00105 G

           ON D.DSTINDX = G.ACTINDX

    --add status, batch, GL date and trx description

    LEFT OUTER JOIN

        (SELECT VCHRNMBR, CNTRLTYP, BACHNUMB, TRXDSCRN,

         STAT = 'Work', VOIDED = 0, PORDNMBR, PSTGDATE, TEN99AMNT

         FROM PM10000

        UNION

         SELECT VCHRNMBR, CNTRLTYP, BACHNUMB, TRXDSCRN,

         STAT = 'Open', VOIDED, PORDNMBR, PSTGDATE, TEN99AMNT

         FROM PM20000

        UNION

         SELECT VCHRNMBR, CNTRLTYP, BACHNUMB, TRXDSCRN,

         STAT = 'History', VOIDED, PORDNMBR, PSTGDATE, TEN99AMNT

         FROM PM30200

        UNION

         SELECT PMNTNMBR, CNTRLTYP = 1, BACHNUMB, COMMENT1,

         STAT = 'Work', VOIDED = 0, PORDNMBR = '', PSTGDATE, 0

         FROM PM10300

        UNION

         SELECT PMNTNMBR, CNTRLTYP = 1, BACHNUMB, TRXDSCRN,

         STAT = 'Work', VOIDED = 0, PORDNMBR = '', PSTGDATE, 0

         FROM PM10400) T

        ON T.VCHRNMBR = D.VCHRNMBR

        AND T.CNTRLTYP = D.CNTRLTYP

    --add GL account name

    LEFT OUTER JOIN

           GL00100 A

           ON A.ACTINDX = D.DSTINDX

    --add vendor name

    LEFT OUTER JOIN

           PM00200 N

           ON N.VENDORID = D.VENDORID

    --the following will grant permissions to this view to DYNGRP

    --leave this section off if you do not want to grant permissions

    GO

    GRANT SELECT ON view_AP_Distributions TO DYNGRP

  • L Vail Profile Picture
    65,271 on at

    Hi,

    I think this is perfect. That Victoria Yudin is amazing. She has created and shared so many SQL views that are often exactly what you need. Hats off to Victoria!

    Kind regards,

    Leslie

  • Victoria Yudin Profile Picture
    22,769 on at

    Thanks Tom and Leslie!

    Appreciate the shout out and the kind words!!

  • Community Member Profile Picture
    on at

    Thanks a lot Tom.  I will see if our IT group can support me on this as I am not trained on SQL views.  

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 > 🔒一 Microsoft Dynamics GP (Archived)

#1
mtabor Profile Picture

mtabor 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans