Hello awesome community! :)
There is a sales order with 2 invoices. the 2nd invoice is a return of the 1st invoice. they have the same amount but the returned one is in negative, but they have different invoice IDs.
My issue is, there is a custom report which runs on the invoice level, that uses CustInvoiceJour and CustInvoiceTrans tables. They asked me to show in the report the original invoice ID if the report did run on the returned invoice (Credit Note). I couldn't find a relation between the the original invoice id and the credit invoice ID. I tried checking the CustVendInvoicingJourHeader Table but it's empty.
The only way I found was to check the SalesLine.InventTransIdReturn (Returned Lot ID Field) if there is a returned item, then I can get the original SalesLine.InventTransID and then I can get the original InvoiceID from there. But maybe it will be a problem if the sales order number of the credit invoice was different....
Is there a more simple or more direct way to get the original Invoice ID from a credit invoice ID?
Any advice would be appreciated!
Thanks in advance!
*This post is locked for comments
I have the same question (0)