Skip to main content

Notifications

Microsoft Dynamics GP forum
Suggested answer

Getting date of invoices and vouchers were paid

Posted on by 860

Im trying to get a list of invoices and vouchers AND include the date that it was actually paid. 

-- AR
SELECT TOP 100 * FROM dbo.RM20101 r ORDER BY r.GLPOSTDT DESC
SELECT TOP 100 * FROM dbo.RM30101 r ORDER BY r.GLPOSTDT DESC
-- Paid date = POSTDATE ? or GLPOSTDT?

-- AP
SELECT TOP 100 * FROM PM20000 p ORDER BY p.DOCDATE DESC
SELECT TOP 100 * FROM PM30200 p ORDER BY p.DOCDATE DESC

I guess its not quite that easy since there could be multiple apply records assocaited with an invoice?  So then I started looking a bit deeper, and found this.  

https://victoriayudin.com/2008/10/22/sql-view-ap-apply-in-gp/  

So where the last join happens for P2, eg.

left outer join
(select VCHRNMBR, DOCTYPE, DOCNUMBR, DOCDATE
from PM20000
where DOCTYPE > 3 and VOIDED = 0
union all
select VCHRNMBR, DOCTYPE, DOCNUMBR, DOCDATE
from PM30200
where DOCTYPE > 3 and VOIDED = 0)

This is the group that the payment date is pulled from, the docdate from either PM2000 or PM30200

Is it safe to say that if a voucher is in the history (PM30200) table, then its been "paid" in full?

However, what I need now is something similar for the AR side.  Could I do something similar, except using the RM20101 and RM30101 tables?

Categories:
  • Suggested answer
    Josh Page Profile Picture
    Josh Page on at
    RE: Getting date of invoices and vouchers were paid

    Hello ShiftBit!

    If your just looking for a quick check, you can use the column DINVPDOF in the RM20101, RM30101 and the PM30200.

    If your looking to see what was actually applied against the documents that paid off the transactions, you would want to link in the apply tables (PM30300 for PM and RM20201 or RM30201 for RM depending on if the doc was moved to history with paid transaction removal).

  • Suggested answer
    Lisa at AonC.com Profile Picture
    Lisa at AonC.com 3,023 on at
    RE: Getting date of invoices and vouchers were paid

    In Payables, transactions should automatically move to history when they are "Paid Off".  The same is NOT true with Receivables.

    With Receivables, "Paid Off" transactions don't move to history until (1) they are paid off and (2) paid transaction removal is completed for a Cut-off date at/beyond the Paid Off date.

    If you work from the ReceivablesTransaction view, instead of the RM open/history tables, you'll have everything together and then you'll just need to join to the Apply Records.

    Victoria has an RM Apply view here:

    victoriayudin.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

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

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

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,522 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,441 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Product updates

Dynamics 365 release plans