modified the update of the invoice to only generate a new invoice if in draft status