I could use some assistance in writing a query to list ALL Sales Orders, and their related documents. For example:
This would be somewhat straightforward if the Target Document of a SO was always a Delivery Note, but this is not the case. Most of the orders are a traditional document flow:
However, many times this is the case:
Complicating even more, in the company's early history, Delivery Notes were not even used: