Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8497

Query for AR Invoice and AR Credit Memo

$
0
0

Hello,

 

Can anyone please let me to write a combined query for AR Invoice along AR Credit Memo :

 

Basically I want to have a report which should show all the AR Invoice and AR Credit Memo which is based on a AR Invoice ( Base Document ) or it is made without AR Invoice which means Direct Credit Memo in the same report / query.

 

Sample AR Invoice Query which I have :

 

SELECT T1.[SeriesName], T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName],T3.[SlpName], T2.[PymntGroup],  T0.[DocCur], T0.[DocTotal], T0.[Comments] FROM OINV T0  INNER JOIN NNM1 T1 ON T0.Series = T1.Series INNER JOIN OCTG T2 ON T0.GroupNum = T2.GroupNum INNER JOIN OSLP T3 ON T0.SlpCode = T3.SlpCode INNER JOIN INV1 T4 ON T0.DocEntry = T4.DocEntry WHERE T1.[SeriesName] = 'AP' and T0.[CANCELED] = 'N' and T4.[LineStatus] ='O'

 

Sample AR Credit Memo Query which I have :

 

SELECT T2.[SeriesName], T0.[DocNum],T1.[TargetType], T1.[TrgetEntry], T1.[BaseRef], T1.[BaseType], T1.[BaseEntry], T1.[BaseLine], T1.[LineStatus],  T0.[DocDate], T0.[CardCode], T0.[CardName], T4.[SlpName], T3.[PymntGroup], T0.[DocCur], T0.[DocTotal], T0.[Comments] FROM ORIN T0  INNER JOIN RIN1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN NNM1 T2 ON T0.Series = T2.Series INNER JOIN OCTG T3 ON T0.GroupNum = T3.GroupNum INNER JOIN OSLP T4 ON T0.SlpCode = T4.SlpCode WHERE T2.[SeriesName] = 'AP'

 

Please advise.

 

Kind Regards,

Ravi


Viewing all articles
Browse latest Browse all 8497

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>