Issue:
A ticket was allowed to be closed after the system allowed a Dispatch Time to be entered that was after the entered Departure time.
Note: This script is only for use when the system has created a true data error. This script is not intended for use when the customer has simply entered data differently than they intended to.
Resolution:
Run script:
//update sv_service_ticket set ticket_status = 'RS' where ticket_number = 'service ticket number'
The script allows for the ticket to be reopened but it will not open the Ticket Dispatch and make it available if the ticket is billed, which it will likely be if it is closed.
After the Ticket has been reopened, the Resolution field will need to be cleared on the front of the ticket. Since an invoice is active on the ticket, Resolution field, as seen below, will be grayed out and inactive.

To clear the Resolution field, open the Invoice associated with the Service Ticket and delete it.
Note: Close the Service Ticket first.
To delete the invoice, open it. Then find the Delete Data button in the toolbar.

Click the Delete Data button. Click Yes when the Delete Invoice window pops up asking “Are you sure you want to DELETE this invoice?
Once the invoice is deleted, remove the resolution status by opening the Service Ticket and going to the Ticket Detail. Remove the Resolution information that is in the Resolution field.
Save that change and then go back to Appointments and Labor.
Update the ticket times and resolve the ticket again and produce a new invoice.