web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Getting date of invoices and vouchers were paid

(0) ShareShare
ReportReport
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:
I have the same question (0)
  • Suggested answer
    Lisa at AonC.com Profile Picture
    912 Super User 2025 Season 2 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/.../

  • Suggested answer
    Josh Page Profile Picture
    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).

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 683 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 563 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 398 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans