|
|
|
|
|
|
|
|
|
|
|
|
|
|
$model->delete(); |
|
|
$model->delete(); |
|
|
|
|
|
|
|
|
Order::updateAll([ |
|
|
|
|
|
'order.id_delivery_note' => null |
|
|
|
|
|
], [ |
|
|
|
|
|
'order.id_delivery_note' => $id |
|
|
|
|
|
]); |
|
|
|
|
|
|
|
|
if($this->getClass() == 'DeliveryNote') { |
|
|
|
|
|
Order::updateAll([ |
|
|
|
|
|
'order.id_delivery_note' => null |
|
|
|
|
|
], [ |
|
|
|
|
|
'order.id_delivery_note' => $id |
|
|
|
|
|
]); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if($this->getClass() == 'Quotation') { |
|
|
|
|
|
Order::updateAll([ |
|
|
|
|
|
'order.id_quotation' => null |
|
|
|
|
|
], [ |
|
|
|
|
|
'order.id_quotation' => $id |
|
|
|
|
|
]); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if($this->getClass() == 'Invoice') { |
|
|
|
|
|
Order::updateAll([ |
|
|
|
|
|
'order.id_invoice' => null |
|
|
|
|
|
], [ |
|
|
|
|
|
'order.id_invoice' => $id |
|
|
|
|
|
]); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
Yii::$app->getSession()->setFlash('success', $this->getFlashMessage('delete', $model)); |
|
|
Yii::$app->getSession()->setFlash('success', $this->getFlashMessage('delete', $model)); |
|
|
$this->redirect([$this->getControllerUrl().'/index']); |
|
|
$this->redirect([$this->getControllerUrl().'/index']); |