You can create Purchase Invoice from Purchase order, Contract or available items.
From the invoice management -> select the invoice to edit and click Edit
Or view invoice details -> click
When deleting the invoice, the applied debit is also deleted -> refund the applied amount to the corresponding Debit Note
From the invoice management -> select the invoice to delete and click delete