Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Smartlist With Invoice Info. & Payment Info. On The Same Line

Posted on by Microsoft Employee

Can someone help me with how to design a smartlist that contains the detail information regarding a purchase (ie. GL account distribution, voucher number, amount, date, etc.) and it's corresponding payment information  (ie. check number & check date).  I would like this information to be contained with one individual record so that I can query all of our purchases and quantify the amount of paid invoices for various GL account numbers.  I have been working with various tables within the purchasing and financial directories but have not found a way bring these two elements together in a composite query.  I am knowledgeable with linking tables, just don't know what tables to link and how to present the info.  I am new to MS Great Plains.  

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Smartlist With Invoice Info. & Payment Info. On The Same Line

    Leslie,

    Thank you for the solution.  I will get it input and see what it looks like.

  • Suggested answer
    L Vail Profile Picture
    L Vail 65,271 on at
    RE: Smartlist With Invoice Info. & Payment Info. On The Same Line

    I think Victoria Yudin has created the view you need to accomplish this. If you have a one to one relationship between vendor invoices and the check that pays them you'll get one line per transaction. If not, you'll get multiple lines. Victoria is exceptional and it will benefit you to look at the other views she has created and shares with us:

    victoriayudin.com/.../payables-sql-views

    Here's the view Victoria Created for apply information:

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

    -- view_AP_Apply

    -- Created on Oct 10 2008 by Victoria Yudin, Flexible Solutions

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

    -- Does not take Multicurrency into account

    -- Will return multiple lines for transactions applied to by

    --    more than one check, credit memo or return

    -- Updated Jan 6 2009 to include Vendor Name

    -- Updated Feb 20 2009 to include trx not fully applied

    -- Updated Mar 20 2009 to include Payment Date

    -- Updated Mar 30 2009 to include Apply Date

    -- Updated Apr 28 2009 to include Apply GL Posting Date

    -- Updated May 27 2009 to add Payment Status, take space

    --     out of column names and eliminate duplicates for

    --     payment that are not fully applied

    -- Updated Jan 29 2014 to add 1099 columns

    -- Updated Apr 10, 2015 to use APPLDAMT instead of APFRMAPLYAMT

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

    create view view_AP_Apply

    as

    select

    P.VENDORID Vendor_ID,

    PM.VENDNAME Vendor_Name,

    case P.DOCTYPE

      when 1 then 'Invoice'

      when 2 then 'Finance Charge'

      when 3 then 'Misc Charge'

      end Document_Type,

    P.DOCDATE Document_Date,

    P.VCHRNMBR Voucher_Number,

    P.DOCNUMBR Document_Number,

    P.DOCAMNT Document_Amount,

    P.TEN99AMNT [1099_Amount],

    P.TEN99BOXNUMBER [1099_Box],

    case P.TEN99TYPE

      when 1 then 'Not a 1099 Vendor'

      when 2 then 'Divident'

      when 3 then 'Interest'

      when 4 then 'Miscellaneous'

      when 5 then 'Withholding'

      else ''

      end [1099_Type],

    coalesce(PA.APPLDAMT,0) Applied_Amount,

    coalesce(PA.VCHRNMBR,'') Payment_Voucher_Number,

    coalesce(P2.DOCNUMBR,'') Payment_Doc_Number,

    coalesce(P2.DOCDATE,'1/1/1900') Payment_Date,

    coalesce(PA.DATE1,'1/1/1900') Apply_Date,

    coalesce(PA.GLPOSTDT, '1/1/1900') Apply_GL_Posting_Date,

    case PA.DOCTYPE

      when 4 then 'Return'

      when 5 then 'Credit Memo'

      when 6 then 'Payment'

      else ''

      end Payment_Type,

    coalesce(PA.POSTED, 'Unpaid') Payment_Status

    from

    (select VENDORID, DOCTYPE, DOCDATE, VCHRNMBR, DOCNUMBR,

     DOCAMNT, VOIDED, TEN99AMNT, TEN99BOXNUMBER, TEN99TYPE

     from PM30200

    union all

     select VENDORID, DOCTYPE, DOCDATE, VCHRNMBR, DOCNUMBR,

     DOCAMNT, VOIDED, TEN99AMNT, TEN99BOXNUMBER, TEN99TYPE

     from PM20000) P

    left outer join

    (select VENDORID, APTVCHNM, APTODCTY, APFRDCNM, DOCTYPE,

     DOCDATE, APPLDAMT, VCHRNMBR, DATE1, GLPOSTDT,

     case POSTED when 0 then 'Unposted' else 'Posted' end POSTED

     from PM10200

    union

     select VENDORID, APTVCHNM, APTODCTY, APFRDCNM, DOCTYPE,

     DOCDATE, APPLDAMT, VCHRNMBR, DATE1, GLPOSTDT,

     'Posted' POSTED

     from PM30300) PA

       on P.VCHRNMBR = PA.APTVCHNM and P.VENDORID = PA.VENDORID

       and P.DOCTYPE = PA.APTODCTY

    left outer join

    (select VCHRNMBR, DOCTYPE, DOCNUMBR, DOCDATE

     from PM20000

    union all

     select VCHRNMBR, DOCTYPE, DOCNUMBR, DOCDATE

     from PM30200) P2

       on P2.VCHRNMBR = PA.VCHRNMBR and P2.DOCTYPE = PA.DOCTYPE

    left outer join PM00200 PM

       on P.VENDORID = PM.VENDORID

    where P.DOCTYPE in (1,2,3) and P.VOIDED = 0

    -- add permissions for DYNGRP

    go

    grant select on view_AP_Apply to DYNGRP

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Smartlist With Invoice Info. & Payment Info. On The Same Line

    Hi Leslie,

    Thank you for your response.  The following is an example of what this query would look like:

    Vendor Name Vendor # Voucher # Invoice Date GL Account Check # Payment Date Amount
    Vendor A 132 13243 5/12/2016 4000-1000 1234 6/15/2016 $ 5,000.00
  • L Vail Profile Picture
    L Vail 65,271 on at
    RE: Smartlist With Invoice Info. & Payment Info. On The Same Line

    I think this would be a challenge because you need multiple one to many relationships. for example, each purchase can result in a number of receipts and you could get more than one, or perhaps only one invoice match. the account distributions are also one to many relationships with the items or customers. you have the same problem with payments.  a check can pay many invoices in the same transaction.

    can you give us a mock up of what output you are wanting to produce? create a spreadsheet that illustrates what the smartlist should look like.

    kind regards,

    Leslie

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans