Quantcast
Channel: SCN: Message List - Reporting and Printing
Viewing all articles
Browse latest Browse all 2719

Query to Find Journal Entries Using an Incorrect Sales Returns Account

$
0
0

I have been trying in earnest to write a query to solve a problem in our system. An incorrect Sales Returns account was designated in the Item Groups Setup for the sales returns account. The transactions can be seen in the journal entries and I can get all the data I need from JDT1 table if I can find a way to search for any Journal entries that are being made using that account when it is used as the Sales Returns Account. The journal entries all appear to be coming from credit memos for items. I have tried joining tables to get them linked together so I can specify to only return rows from JDT1 where ReturnAC on the item groups setup is equal to the account code but it returns unusable information. I imagine it has something to do with the table joins or maybe my overall approach is wrong from the start.

 

My joins were: ORIN T0  INNER JOIN RIN1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OJDT T2 ON T0.TransId = T2.TransId INNER JOIN JDT1 T3 ON T2.TransId = T3.TransId INNER JOIN OITM T4 ON T1.ItemCode = T4.ItemCode INNER JOIN OITB T5 ON T4.ItmsGrpCod = T5.ItmsGrpCod INNER JOIN OACT T6 ON T0.CtlAccount = T6.AcctCode

I Specified WHERE T5.[ReturnAc] = '_SYS00000000929' to try to pull the amounts and information from JDT1 but got hundreds of unrelated rows instead

Am I going about the process entirely wrong? I need to be able to:

1.Pull the amount of the journal entry

2.Specify that it originated from an item Group using the account code listed as the Sales Returns Account

3.List the original transaction (Credit Memos) number

Am I looking at the right tables or is there a better place to look for the information? Is there a better way to get the information?

I appreciate the help.


Viewing all articles
Browse latest Browse all 2719

Trending Articles



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