It's not unusual to want to drill down from a sales or purchase invoice/credit note to the SOP/POP invoice. At present, the database structure makes this difficult or impossible as it depends on the transaction reference - which can be amended.
A simple way to implement this would be to write the transaction URN back to the SOPInvoiceCredit / POPInvoiceCreditLine table when a SOP/POP invoice is posted. And of course, the implementation of a POPInvoiceCredit table, not just POPInvoiceCreditLine, would also help.