Query - Link Outgoing Payment with A/P Invoice
I am looking to create a query between Outgoing Payment (OVPM) with A/P Invoice (OPCH).
We have in my company the case where we have several Outgoing payment for one A/P Invoice and in the field of the OPCH (receiptNum), we have only the last Outgoing Payment.
I would like to monitor by a query all outgoing payment for one invoice given.
We are using: SBO2005A SP01 PL18 and SQLserver 2000
I will definitely appreciate your help.
May be, U use 3 table : OVPM, VPM2, OPCH. e.g :
SELECT T0.[DocNum],T0.[DocDate], T0.[CardCode], T0.[CardName], T1.[SumApplied] As 'Payment', T2.[DocNum] 'AP Invoice No.',T2.[DocDate], T2.[DocDueDate], T2.[DocTotal], T2.[PaidToDate], T2.[PaidSum] FROM [dbo].[OVPM] T0 INNER JOIN [dbo].[VPM2] T1 ON T0.DocNum = T1.DocNum INNER JOIN OPCH T2 ON T1.DocEntry = T2.DocEntry ORDER BY T2.[DocNum]
Actually I don't like this query result, but it's the best we can do I think without SDK.