|
|
@@ -759,9 +759,13 @@ class DistributionController extends BackendController |
|
|
|
*/ |
|
|
|
public function actionAjaxProcessAddSubscriptions($date) |
|
|
|
{ |
|
|
|
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; |
|
|
|
$this->getOrderManager()->createAllOrdersFromSubscriptions($date, true); |
|
|
|
return ['success']; |
|
|
|
$ordersArray = $this->getOrderManager()->createAllOrdersFromSubscriptions($date, true); |
|
|
|
|
|
|
|
if($ordersArray && count($ordersArray)) { |
|
|
|
return Ajax::responseSuccess('Les abonnements ont bien été importés.'); |
|
|
|
} |
|
|
|
|
|
|
|
return Ajax::responseError('Aucun abonnement à importer.'); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@@ -860,23 +864,12 @@ class DistributionController extends BackendController |
|
|
|
|
|
|
|
public function actionAjaxGenerateDeliveryNote(int $idOrder) |
|
|
|
{ |
|
|
|
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; |
|
|
|
|
|
|
|
$this->generateDeliveryNote($idOrder); |
|
|
|
|
|
|
|
return [ |
|
|
|
'return' => 'success', |
|
|
|
'alert' => [ |
|
|
|
'type' => 'success', |
|
|
|
'message' => 'Bon de livraison généré' |
|
|
|
] |
|
|
|
]; |
|
|
|
return Ajax::responseSuccess('Bon de livraison généré'); |
|
|
|
} |
|
|
|
|
|
|
|
public function actionAjaxGenerateDeliveryNotePointSale($idOrders) |
|
|
|
{ |
|
|
|
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; |
|
|
|
|
|
|
|
$orderManager = $this->getOrderManager(); |
|
|
|
$deliveryNoteManager = $this->getDeliveryNoteManager(); |
|
|
|
|
|
|
@@ -949,8 +942,6 @@ class DistributionController extends BackendController |
|
|
|
|
|
|
|
public function actionAjaxGenerateDeliveryNoteEachUser($idOrders) |
|
|
|
{ |
|
|
|
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; |
|
|
|
|
|
|
|
if (strlen($idOrders)) { |
|
|
|
$idOrders = json_decode($idOrders, true); |
|
|
|
|
|
|
@@ -960,22 +951,10 @@ class DistributionController extends BackendController |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return [ |
|
|
|
'return' => 'success', |
|
|
|
'alert' => [ |
|
|
|
'type' => 'success', |
|
|
|
'message' => 'Bon(s) de livraison généré(s)' |
|
|
|
] |
|
|
|
]; |
|
|
|
return Ajax::responseSuccess('Bon(s) de livraison généré(s)'); |
|
|
|
} |
|
|
|
|
|
|
|
return [ |
|
|
|
'return' => 'error', |
|
|
|
'alert' => [ |
|
|
|
'type' => 'danger', |
|
|
|
'message' => 'Une erreur est survenue lors de la génération du bon de livraison.' |
|
|
|
] |
|
|
|
]; |
|
|
|
return Ajax::responseError('Une erreur est survenue lors de la génération du bon de livraison.'); |
|
|
|
} |
|
|
|
|
|
|
|
public function generateDeliveryNote(int $idOrder) |