added paid flag to know if the invoice was correctly set to paid