Receiving inspection traveler report for Registered purchase orders


I need to write a report that would be printed when a quarantine order is created for a purchase order line or if the quarantine order is created manually.

I need to pull both the purch header info and the line info.

Since the quarantine order does carry the purchId the first part is easy but, I could not find a link between the SalesLinenumber and the Quarantine table.

Initially I though t of starting from the purchLine but, a single purchline can be split into multiple while registering the item.

I need a link of quarantine order and the purchLines also I have yet not started looking at what point should I call the report? may be on insert method with a check if the quarantine order is of type quarantine or purch.

Any feedback is appreciated,