you could simply override Request_Delete in the header DD class (trip)

first add the detail dd (Invoice) as an externally updated table to trip then add the following

Code:
Procedure Request_Delete
    Begin_Transaction
         // mark header as cancelled
        Set Field_Changed_Value FIELD header.cancelled to todaysdate 
        Forward Send Request_Save

        // now mark detail if any 
        If (Trip.Invoice_Id <> 0) Begin
            Clear Invoice
            Move Trip.Invoice_Id to Invoice.Id
            Find EQ Invoice by 1 // Id (unique)
            If (Found) Begin
                Reread Invoice
                Move Trip.Job_Set_Id        to Invoice.Job_Set_Id
                Move Trip.Job_Set_Ok        to Invoice.Job_Set_Ok
                Move Trip.Job_Set_Send      to Invoice.Job_Set_Send
                Move Trip.Job_Set_Sent      to Invoice.Job_Set_Sent
                Move Trip.Sent_Date         to Invoice.Sent_Date
                Move Trip.Last_Sent_Date    to Invoice.Last_Sent_Date
                Saverecord Invoice
                Unlock
            End
        end
    End_Transaction
End_Procedure