|
|
@@ -446,6 +446,9 @@ class CommandeController extends ProducerBaseController { |
|
|
|
->where(['id' => $id]) |
|
|
|
->one(); |
|
|
|
|
|
|
|
if(!$commande) |
|
|
|
throw new \yii\web\NotFoundHttpException('Commande introuvable'); |
|
|
|
|
|
|
|
if ($commande->getEtat() != Commande::ETAT_MODIFIABLE) { |
|
|
|
throw new UserException('Vous ne pouvez plus annuler cette commande.'); |
|
|
|
} |
|
|
@@ -465,9 +468,11 @@ class CommandeController extends ProducerBaseController { |
|
|
|
// delete |
|
|
|
$commande->delete(); |
|
|
|
CommandeProduit::deleteAll(['id_commande' => $commande->id]); |
|
|
|
|
|
|
|
Yii::$app->session->setFlash('success','Votre commande a bien été annulée.') ; |
|
|
|
} |
|
|
|
|
|
|
|
$this->redirect(Yii::$app->urlManager->createUrl(['commande/index', 'annule_ok' => true])); |
|
|
|
|
|
|
|
$this->redirect(Yii::$app->urlManager->createUrl(['commande/historique'])); |
|
|
|
} |
|
|
|
|
|
|
|
public function actionVerifCodePointVente($id_point_vente, $code) { |