$invoice = $invoiceManager->findOneInvoiceById($idInvoice); | $invoice = $invoiceManager->findOneInvoiceById($idInvoice); | ||||
if ($invoice && $invoice->isStatusDraft()) { | |||||
if ($invoice && $invoiceManager->isStatusDraft($invoice)) { | |||||
Order::updateAll([ | Order::updateAll([ | ||||
'id_invoice' => null | 'id_invoice' => null | ||||
], [ | ], [ |