My Invoice table does not contain always an ordernumber. It contains the reference to the document that triggers the invoice and the reference from which table that trigger document originates. The trigger is either a delivery document, or the order document itself.
how to connect ordernumber to the invoicenumber. the result in the end needs to give me all orders and all invoices