return 0; | return 0; | ||||
} | } | ||||
public function getOnlinePaymentMinimumAmount(Producer $producer): float | |||||
public function getOnlinePaymentMinimumAmount(): float | |||||
{ | { | ||||
$onlinePaymentMinimumAmount = $this->getConfig('option_online_payment_minimum_amount'); | $onlinePaymentMinimumAmount = $this->getConfig('option_online_payment_minimum_amount'); | ||||
if (!$onlinePaymentMinimumAmount) { | if (!$onlinePaymentMinimumAmount) { |
{ | { | ||||
protected ?Producer $producerContext = null; | protected ?Producer $producerContext = null; | ||||
public function setProducerContext(Producer $producer): void | |||||
public function setProducerContext(Producer $producer): self | |||||
{ | { | ||||
$this->producerContext = $producer; | $this->producerContext = $producer; | ||||
return $this; | |||||
} | } | ||||
public function getProducerContext(): Producer | public function getProducerContext(): Producer |
<p>Votre commande <?= ($order->reference && strlen($order->reference) > 0) ? 'N°'.$order->reference : '' ?> d'une valeur de <strong><?= $orderManager->getOrderAmountWithTax($order, Order::AMOUNT_TOTAL, true); ?></strong> a bien été prise en compte.</p> | <p>Votre commande <?= ($order->reference && strlen($order->reference) > 0) ? 'N°'.$order->reference : '' ?> d'une valeur de <strong><?= $orderManager->getOrderAmountWithTax($order, Order::AMOUNT_TOTAL, true); ?></strong> a bien été prise en compte.</p> | ||||
<p>Récapitulatif des produits commandés :</p> | <p>Récapitulatif des produits commandés :</p> | ||||
<p><?= $order->getCartSummary() ?></p> | |||||
<p><?= $orderManager->getCartSummary($order) ?></p> | |||||
<p>Elle sera à retirer le <strong><?= date('d/m/Y',strtotime($distribution->date)) ?></strong> au point de retrait | <p>Elle sera à retirer le <strong><?= date('d/m/Y',strtotime($distribution->date)) ?></strong> au point de retrait | ||||
<strong><?= Html::encode($pointSale->name) ?></strong> | <strong><?= Html::encode($pointSale->name) ?></strong> |
Votre commande <?= ($order->reference && strlen($order->reference) > 0) ? '<strong>N°'.$order->reference.'</strong>' : '' ?> d'une valeur de <?= $orderManager->getOrderAmountWithTax($order, Order::AMOUNT_TOTAL, true); ?> a bien été prise en compte. | Votre commande <?= ($order->reference && strlen($order->reference) > 0) ? '<strong>N°'.$order->reference.'</strong>' : '' ?> d'une valeur de <?= $orderManager->getOrderAmountWithTax($order, Order::AMOUNT_TOTAL, true); ?> a bien été prise en compte. | ||||
Récapitulatif des produits commandés : | Récapitulatif des produits commandés : | ||||
<?= $order->getCartSummary(false) ?> | |||||
<?= $orderManager->getCartSummary($order, false) ?> | |||||
Elle sera à retirer le <?= date('d/m/Y',strtotime($distribution->date)) ?> au point de retrait <?= $pointSale->name ?> <?php if($order->pointSale->is_bread_box && $order->pointSale->bread_box_code): ?> (Code : <?= $order->pointSale->bread_box_code; ?>) <?php endif; ?> <?php if(strlen($pointSale->locality) > 0): ?> situé à <?= Html::encode($pointSale->locality) ?><?php endif ?>. | Elle sera à retirer le <?= date('d/m/Y',strtotime($distribution->date)) ?> au point de retrait <?= $pointSale->name ?> <?php if($order->pointSale->is_bread_box && $order->pointSale->bread_box_code): ?> (Code : <?= $order->pointSale->bread_box_code; ?>) <?php endif; ?> <?php if(strlen($pointSale->locality) > 0): ?> situé à <?= Html::encode($pointSale->locality) ?><?php endif ?>. | ||||
*/ | */ | ||||
public function actionHistory(string $returnPayment = '') | public function actionHistory(string $returnPayment = '') | ||||
{ | { | ||||
$producer = $this->getProducer(); | |||||
$producer = $this->getProducerCurrent(); | |||||
if (\Yii::$app->user->isGuest) { | if (\Yii::$app->user->isGuest) { | ||||
return $this->redirect($this->getUrlManagerFrontend()->createAbsoluteUrl(['site/producer', 'id' => $producer->id])); | return $this->redirect($this->getUrlManagerFrontend()->createAbsoluteUrl(['site/producer', 'id' => $producer->id])); | ||||
} | } | ||||
public function actionAdd() | public function actionAdd() | ||||
{ | { | ||||
$producer = $this->getProducer(); | |||||
$producer = $this->getProducerCurrent(); | |||||
if (\Yii::$app->user->isGuest) { | if (\Yii::$app->user->isGuest) { | ||||
return $this->redirect($this->getUrlManagerFrontend()->createAbsoluteUrl(['site/producer', 'id' => $producer->id])); | return $this->redirect($this->getUrlManagerFrontend()->createAbsoluteUrl(['site/producer', 'id' => $producer->id])); | ||||
} | } | ||||
$creditHistoryManager = $this->getCreditHistoryManager(); | $creditHistoryManager = $this->getCreditHistoryManager(); | ||||
$producerManager = $this->getProducerManager(); | $producerManager = $this->getProducerManager(); | ||||
$userManager = $this->getUserManager(); | $userManager = $this->getUserManager(); | ||||
$producer = $this->getProducer(); | |||||
$producer = $this->getProducerCurrent(); | |||||
$contactProducer = $producerManager->getMainContact($producer); | $contactProducer = $producerManager->getMainContact($producer); | ||||
$payload = @file_get_contents('php://input'); | $payload = @file_get_contents('php://input'); |
public function actionOrder(int $id = 0, $date = '') | public function actionOrder(int $id = 0, $date = '') | ||||
{ | { | ||||
$params = []; | $params = []; | ||||
$producer = $this->getProducer(); | |||||
$producer = $this->getProducerCurrent(); | |||||
if (\Yii::$app->user->isGuest && !$producer->option_allow_order_guest) { | if (\Yii::$app->user->isGuest && !$producer->option_allow_order_guest) { | ||||
return $this->redirect( | return $this->redirect( | ||||
public function actionHistory($type = 'incoming') | public function actionHistory($type = 'incoming') | ||||
{ | { | ||||
$queryHistoryArray = $this->getOrderManager() | $queryHistoryArray = $this->getOrderManager() | ||||
->queryOrdersHistory($this->getProducer(), $this->getUserCurrent(), $type); | |||||
->queryOrdersHistory($this->getProducerCurrent(), $this->getUserCurrent(), $type); | |||||
$queryHistoryIncoming = $queryHistoryArray['incoming']; | $queryHistoryIncoming = $queryHistoryArray['incoming']; | ||||
$queryHistoryPassed = $queryHistoryArray['passed']; | $queryHistoryPassed = $queryHistoryArray['passed']; | ||||
$orderManager = $this->getOrderManager(); | $orderManager = $this->getOrderManager(); | ||||
$producerManager = $this->getProducerManager(); | $producerManager = $this->getProducerManager(); | ||||
$producer = $this->getProducerCurrent(); | |||||
$redirect = null; | $redirect = null; | ||||
$producer = $this->getProducer(); | |||||
$idProducer = $producer->id; | $idProducer = $producer->id; | ||||
$order = $orderManager->instanciateOrder(); | |||||
$order = new Order; | |||||
if ($idProducer) { | if ($idProducer) { | ||||
$this->_verifyProducerActive($idProducer); | $this->_verifyProducerActive($idProducer); | ||||
$posts = \Yii::$app->request->post(); | $posts = \Yii::$app->request->post(); | ||||
$productsArray = []; | $productsArray = []; | ||||
$totalQuantity = 0; | $totalQuantity = 0; | ||||
$producer = $this->getProducer(); | |||||
$producer = $this->getProducerCurrent(); | |||||
$isNewOrder = false; | $isNewOrder = false; | ||||
if (!$order->id) { | if (!$order->id) { | ||||
$errorDate = false; | $errorDate = false; | ||||
if (isset($order->id_distribution)) { | if (isset($order->id_distribution)) { | ||||
$distribution = $distributionManager->findOneDistributionById($order->id_distribution); | $distribution = $distributionManager->findOneDistributionById($order->id_distribution); | ||||
if ($order->getState() != Order::STATE_OPEN) { | |||||
if ($orderManager->getState($order) != Order::STATE_OPEN) { | |||||
$errorDate = true; | $errorDate = true; | ||||
} | } | ||||
} | } | ||||
$userProducer = $userProducerManager->findOneUserProducer($user, $producer); | $userProducer = $userProducerManager->findOneUserProducer($user, $producer); | ||||
$pointSale = $pointSaleManager->findOnePointSaleById($order->id_point_sale); | $pointSale = $pointSaleManager->findOnePointSaleById($order->id_point_sale); | ||||
// commentaire point de vente | |||||
$order->comment_point_sale = ($pointSale && strlen($pointSale->getComment())) ? | |||||
$pointSale->getComment() : ''; | |||||
// la commande est automatiquement réactivée lors d'une modification | |||||
$order->date_delete = null; | |||||
// delivery | |||||
$order->comment_point_sale = ($pointSale && strlen($pointSaleManager->getComment($pointSale))) ? | |||||
$pointSaleManager->getComment($pointSale) : ''; | |||||
$order->date_delete = null; // la commande est automatiquement réactivée lors d'une modification | |||||
$order->delivery_home = isset($posts['Order']['delivery_home']) ? $posts['Order']['delivery_home'] : false; | $order->delivery_home = isset($posts['Order']['delivery_home']) ? $posts['Order']['delivery_home'] : false; | ||||
$order->delivery_address = (isset($posts['Order']['delivery_address']) && $order->delivery_home) ? $posts['Order']['delivery_address'] : null; | $order->delivery_address = (isset($posts['Order']['delivery_address']) && $order->delivery_home) ? $posts['Order']['delivery_address'] : null; | ||||
// comment | |||||
$order->comment = isset($posts['Order']['comment']) ? $posts['Order']['comment'] : null; | $order->comment = isset($posts['Order']['comment']) ? $posts['Order']['comment'] : null; | ||||
// sauvegarde de la commande | |||||
$order->save(); | $order->save(); | ||||
$orderManager->generateOrderReference($order); | $orderManager->generateOrderReference($order); | ||||
$orderManager->changeOrderStatus($order, 'new-order', 'user'); | |||||
$orderManager->updateOrderStatus($order, 'new-order', 'user'); | |||||
$producerManager->addUser($user, $producer); | $producerManager->addUser($user, $producer); | ||||
// suppression de tous les enregistrements ProductOrder | // suppression de tous les enregistrements ProductOrder | ||||
// credit | // credit | ||||
$credit = $producerManager->getConfig('credit'); | $credit = $producerManager->getConfig('credit'); | ||||
$creditLimit = $producerManager->getConfig('credit_limit'); | $creditLimit = $producerManager->getConfig('credit_limit'); | ||||
$creditFunctioning = $pointSaleManager->getPointSaleCreditFunctioning($pointSale); | |||||
$creditFunctioning = $producerManager->getPointSaleCreditFunctioning($pointSale); | |||||
$creditUser = $userManager->getCredit($user, $producer); | $creditUser = $userManager->getCredit($user, $producer); | ||||
$order = $orderManager->findOneOrderById($order->id); | $order = $orderManager->findOneOrderById($order->id); | ||||
$amountRemaining = $orderManager->getOrderAmount($order, Order::AMOUNT_REMAINING); | $amountRemaining = $orderManager->getOrderAmount($order, Order::AMOUNT_REMAINING); | ||||
$creditFunctioning == Producer::CREDIT_FUNCTIONING_MANDATORY || | $creditFunctioning == Producer::CREDIT_FUNCTIONING_MANDATORY || | ||||
($creditFunctioning == Producer::CREDIT_FUNCTIONING_USER && $userProducer->credit_active) | ($creditFunctioning == Producer::CREDIT_FUNCTIONING_USER && $userProducer->credit_active) | ||||
)) { | )) { | ||||
$orderManager->changeOrderStatus($order, 'waiting-paiement-by-credit', 'user'); | |||||
$orderManager->updateOrderStatus($order, 'waiting-paiement-by-credit', 'user'); | |||||
// à payer | // à payer | ||||
if ($orderManager->getPaymentStatus($order) == Order::PAYMENT_UNPAID) { | if ($orderManager->getPaymentStatus($order) == Order::PAYMENT_UNPAID) { | ||||
MeanPayment::CREDIT, | MeanPayment::CREDIT, | ||||
$order | $order | ||||
); | ); | ||||
$orderManager->changeOrderStatus($order, 'paid-by-credit', 'user'); | |||||
$orderManager->updateOrderStatus($order, 'paid-by-credit', 'user'); | |||||
} else { | } else { | ||||
$orderManager->changeOrderStatus($order, 'waiting-paiement-on-delivery', 'user'); | |||||
$orderManager->updateOrderStatus($order, 'waiting-paiement-on-delivery', 'user'); | |||||
} | } | ||||
} // surplus à rembourser | } // surplus à rembourser | ||||
elseif ($orderManager->getPaymentStatus($order) == Order::PAYMENT_SURPLUS) { | elseif ($orderManager->getPaymentStatus($order) == Order::PAYMENT_SURPLUS) { | ||||
); | ); | ||||
} | } | ||||
} else { | } else { | ||||
$orderManager->changeOrderStatus($order, 'waiting-paiement-on-delivery', 'user'); | |||||
$orderManager->updateOrderStatus($order, 'waiting-paiement-on-delivery', 'user'); | |||||
} | } | ||||
$paramsEmail = [ | $paramsEmail = [ | ||||
} | } | ||||
} | } | ||||
$orderManager->setTillerSynchronization($order); | |||||
$orderManager->updateOrderTillerSynchronization($order); | |||||
} | } | ||||
{ | { | ||||
$orderManager = $this->getOrderManager(); | $orderManager = $this->getOrderManager(); | ||||
$order = $orderManager->findOneOrderById($idOrder); | $order = $orderManager->findOneOrderById($idOrder); | ||||
$producer = $this->getProducer(); | |||||
$producer = $this->getProducerCurrent(); | |||||
if (!$order || (!$orderManager->isOrderBelongsToUser($order, GlobalParam::getCurrentUser()) && !$producer->option_allow_order_guest)) { | if (!$order || (!$orderManager->isOrderBelongsToUser($order, GlobalParam::getCurrentUser()) && !$producer->option_allow_order_guest)) { | ||||
throw new \yii\base\UserException('Commande introuvable.'); | throw new \yii\base\UserException('Commande introuvable.'); | ||||
} | } | ||||
$orderManager->initOrder($order); | |||||
return $this->render('confirm', [ | return $this->render('confirm', [ | ||||
'order' => $order, | 'order' => $order, | ||||
'returnPayment' => $returnPayment | 'returnPayment' => $returnPayment | ||||
{ | { | ||||
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; | \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; | ||||
$user = GlobalParam::getCurrentUser(); | $user = GlobalParam::getCurrentUser(); | ||||
$producer = $this->getProducer(); | |||||
$producer = $this->getProducerCurrent(); | |||||
$pointSale = $this->getPointSaleManager()->findOnePointSaleById($pointSaleId); | $pointSale = $this->getPointSaleManager()->findOnePointSaleById($pointSaleId); | ||||
$order = $this->getOrderUser($date, $pointSale); | $order = $this->getOrderUser($date, $pointSale); | ||||
$json['points_sale'] = $this->ajaxInfosPointsSale($producer); | $json['points_sale'] = $this->ajaxInfosPointsSale($producer); | ||||
if ($dateObject && $dateObject->format($format) === $date) { | if ($dateObject && $dateObject->format($format) === $date) { | ||||
$distribution = $this->getDistributionManager()->createDistributionIfNotExist($producer, $date); | |||||
$distribution = $this->getDistributionManager()->createDistributionIfNotExist($date); | |||||
$json['distribution'] = $distribution; | $json['distribution'] = $distribution; | ||||
$json['points_sale'] = $this->ajaxInfosPointsSale($producer, $distribution); | $json['points_sale'] = $this->ajaxInfosPointsSale($producer, $distribution); | ||||
$json['categories'] = $this->ajaxInfosProductCategories($producer); | $json['categories'] = $this->ajaxInfosProductCategories($producer); | ||||
'id_distribution' => $distribution->id, | 'id_distribution' => $distribution->id, | ||||
'id_point_sale' => $pointSaleCurrent->id | 'id_point_sale' => $pointSaleCurrent->id | ||||
]); | ]); | ||||
$orderUserPointSale = $this->_getOrderUser($distribution->date, $pointSaleId); | |||||
$orderUserPointSale = $this->getOrderUser($distribution->date, $pointSaleCurrent); | |||||
if (!$pointSaleCurrent->maximum_number_orders | if (!$pointSaleCurrent->maximum_number_orders | ||||
|| ($orderUserPointSale && $orderUserPointSale->id_point_sale == $pointSaleId) | |||||
|| ($orderUserPointSale && $orderUserPointSale->id_point_sale == $pointSaleCurrent->id) | |||||
|| ($pointSaleCurrent->maximum_number_orders && | || ($pointSaleCurrent->maximum_number_orders && | ||||
($countOrders < $pointSaleCurrent->maximum_number_orders))) { | ($countOrders < $pointSaleCurrent->maximum_number_orders))) { | ||||
$distributionsArrayFilterPointSale[] = $distribution; | $distributionsArrayFilterPointSale[] = $distribution; |
public function beforeAction($event) | public function beforeAction($event) | ||||
{ | { | ||||
$producer = $this->getProducer() ; | |||||
$producer = $this->getProducerCurrent() ; | |||||
$this->getLogic()->setProducerContext($producer); | |||||
$userProducer = UserProducer::find() | $userProducer = UserProducer::find() | ||||
->where([ | ->where([ | ||||
'id_user' => GlobalParam::getCurrentUserId(), | 'id_user' => GlobalParam::getCurrentUserId(), |
public function actionIndex() | public function actionIndex() | ||||
{ | { | ||||
$dataProviderPointsSale = new ActiveDataProvider([ | $dataProviderPointsSale = new ActiveDataProvider([ | ||||
'query' => $this->getPointSaleManager()->queryPointSalesPublic($this->getProducer()), | |||||
'query' => $this->getPointSaleManager()->queryPointSalesPublic($this->getProducerCurrent()), | |||||
'pagination' => [ | 'pagination' => [ | ||||
'pageSize' => 50, | 'pageSize' => 50, | ||||
], | ], | ||||
$queryProducts = Product::find() | $queryProducts = Product::find() | ||||
->andWhere([ | ->andWhere([ | ||||
'id_producer' => $this->getProducer()->id, | |||||
'id_producer' => $this->getProducerCurrent()->id, | |||||
'active' => true, | 'active' => true, | ||||
'id_product_category' => null, | 'id_product_category' => null, | ||||
]) | ]) | ||||
public function actionContact() | public function actionContact() | ||||
{ | { | ||||
$model = new ContactForm(); | $model = new ContactForm(); | ||||
$producer = $this->getProducer(); | |||||
$producer = $this->getProducerCurrent(); | |||||
if ($model->load(\Yii::$app->request->post()) && $model->validate()) { | if ($model->load(\Yii::$app->request->post()) && $model->validate()) { | ||||
$isSent = false; | $isSent = false; | ||||
*/ | */ | ||||
public function actionBookmarks(string $action) | public function actionBookmarks(string $action) | ||||
{ | { | ||||
$producer = $this->getProducer(); | |||||
$producer = $this->getProducerCurrent(); | |||||
$userProducer = $this->getUserProducerManager() | $userProducer = $this->getUserProducerManager() | ||||
->createUserProducerIfNotExist(GlobalParam::getCurrentUser(), $producer); | ->createUserProducerIfNotExist(GlobalParam::getCurrentUser(), $producer); | ||||
public function actionIndex() | public function actionIndex() | ||||
{ | { | ||||
if (\Yii::$app->user->isGuest) { | if (\Yii::$app->user->isGuest) { | ||||
$producer = $this->getProducer(); | |||||
$producer = $this->getProducerCurrent(); | |||||
return $this->redirect($this->getUrlManagerFrontend()->createAbsoluteUrl(['site/producer', 'id' => $producer->id])); | return $this->redirect($this->getUrlManagerFrontend()->createAbsoluteUrl(['site/producer', 'id' => $producer->id])); | ||||
} | } | ||||
public function actionForm(int $id = 0) | public function actionForm(int $id = 0) | ||||
{ | { | ||||
if (\Yii::$app->user->isGuest) { | if (\Yii::$app->user->isGuest) { | ||||
$producer = $this->getProducer(); | |||||
$producer = $this->getProducerCurrent(); | |||||
return $this->redirect($this->getUrlManagerFrontend()->createAbsoluteUrl(['site/producer', 'id' => $producer->id])); | return $this->redirect($this->getUrlManagerFrontend()->createAbsoluteUrl(['site/producer', 'id' => $producer->id])); | ||||
} | } | ||||
public function actionUpdate(int $id) | public function actionUpdate(int $id) | ||||
{ | { | ||||
if (\Yii::$app->user->isGuest) { | if (\Yii::$app->user->isGuest) { | ||||
$producer = $this->getProducer(); | |||||
$producer = $this->getProducerCurrent(); | |||||
return $this->redirect($this->getUrlManagerFrontend()->createAbsoluteUrl(['site/producer', 'id' => $producer->id])); | return $this->redirect($this->getUrlManagerFrontend()->createAbsoluteUrl(['site/producer', 'id' => $producer->id])); | ||||
} | } | ||||
public function actionDelete($id) | public function actionDelete($id) | ||||
{ | { | ||||
if (\Yii::$app->user->isGuest) { | if (\Yii::$app->user->isGuest) { | ||||
$producer = $this->getProducer(); | |||||
$producer = $this->getProducerCurrent(); | |||||
return $this->redirect($this->getUrlManagerFrontend()->createAbsoluteUrl(['site/producer', 'id' => $producer->id])); | return $this->redirect($this->getUrlManagerFrontend()->createAbsoluteUrl(['site/producer', 'id' => $producer->id])); | ||||
} | } | ||||
namespace producer\models; | namespace producer\models; | ||||
use common\logic\Producer\Producer\Producer; | |||||
use common\logic\Producer\Producer\Wrapper\ProducerManager; | |||||
use Yii; | use Yii; | ||||
use yii\base\Model; | use yii\base\Model; | ||||
*/ | */ | ||||
public function rules() | public function rules() | ||||
{ | { | ||||
$producerManager = ProducerManager::getInstance(); | |||||
return [ | return [ | ||||
[['amount'], 'required'], | [['amount'], 'required'], | ||||
[['amount'], 'double', 'min' => Producer::getOnlinePaymentMinimumAmount()], | |||||
[['amount'], 'double', 'min' => $producerManager->getOnlinePaymentMinimumAmount()], | |||||
]; | ]; | ||||
} | } | ||||
* termes. | * termes. | ||||
*/ | */ | ||||
use common\logic\Producer\Producer\Wrapper\ProducerManager; | |||||
use yii\helpers\Html; | use yii\helpers\Html; | ||||
use yii\widgets\ActiveForm; | use yii\widgets\ActiveForm; | ||||
use common\logic\Producer\Producer\Producer; | |||||
$producerManager = $this->getProducerManager(); | |||||
$producer = $this->context->getProducer(); | |||||
$producerManager = ProducerManager::getInstance(); | |||||
$producer = $this->context->getProducerCurrent(); | |||||
$this->setTitle('Créditer mon compte'); | $this->setTitle('Créditer mon compte'); | ||||
$this->setPageTitle('Crédit mon compte'); | $this->setPageTitle('Crédit mon compte'); | ||||
'template' => '{label}<div class="input-group input-group-lg">{input}<span class="input-group-addon"><span class="glyphicon glyphicon-euro"></span></span></div>{hint}', | 'template' => '{label}<div class="input-group input-group-lg">{input}<span class="input-group-addon"><span class="glyphicon glyphicon-euro"></span></span></div>{hint}', | ||||
]) | ]) | ||||
->label('Quel montant souhaitez-vous créditer ?') | ->label('Quel montant souhaitez-vous créditer ?') | ||||
->hint('Montant minimum : '.$producerManager->getOnlinePaymentMinimumAmount($producer).' €'); ?> | |||||
->hint('Montant minimum : '.$producerManager->getOnlinePaymentMinimumAmount().' €'); ?> | |||||
<div class="form-group"> | <div class="form-group"> | ||||
<?= Html::submitButton('<span class="glyphicon glyphicon-lock"></span> Payer', ['class' => 'btn btn-primary'] | <?= Html::submitButton('<span class="glyphicon glyphicon-lock"></span> Payer', ['class' => 'btn btn-primary'] |
* termes. | * termes. | ||||
*/ | */ | ||||
use common\logic\User\CreditHistory\Wrapper\CreditHistoryManager; | |||||
use yii\grid\GridView; | use yii\grid\GridView; | ||||
$creditHistoryManager = $this->getCreditHistoryManager(); | |||||
$producer = $this->context->getProducer(); | |||||
$creditHistoryManager = CreditHistoryManager::getInstance(); | |||||
$producer = $this->context->getProducerCurrent(); | |||||
$this->setTitle('Crédit : <span id="credit-user">' . number_format($creditUser, 2) . ' €</span>'); | $this->setTitle('Crédit : <span id="credit-user">' . number_format($creditUser, 2) . ' €</span>'); | ||||
$this->setPageTitle('Crédit'); | $this->setPageTitle('Crédit'); | ||||
if ($this->context->getProducer()->online_payment) { | |||||
if ($this->context->getProducerCurrent()->online_payment) { | |||||
$this->addButton( | $this->addButton( | ||||
[ | [ | ||||
'label' => '<span class="glyphicon glyphicon-credit-card"></span> Créditer mon compte', | 'label' => '<span class="glyphicon glyphicon-credit-card"></span> Créditer mon compte', |
* termes. | * termes. | ||||
*/ | */ | ||||
use common\logic\Order\Order\Model\Order; | |||||
use common\logic\User\UserProducer\Model\UserProducer; | |||||
use yii\bootstrap\Nav; | use yii\bootstrap\Nav; | ||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\logic\User\UserProducer\UserProducer; | |||||
use yii\helpers\Html; | use yii\helpers\Html; | ||||
use common\logic\Order\Order\Order; | |||||
\common\assets\CommonAsset::register($this); | \common\assets\CommonAsset::register($this); | ||||
\producer\assets\AppAsset::register($this); | \producer\assets\AppAsset::register($this); | ||||
$producer = $this->context->getProducer(); | |||||
$producer = $this->context->getProducerCurrent(); | |||||
if (!Yii::$app->user->isGuest) { | if (!Yii::$app->user->isGuest) { | ||||
$userProducer = UserProducer::findOne(['id_user' => GlobalParam::getCurrentUserId(), 'id_producer' => $producer->id]); | $userProducer = UserProducer::findOne(['id_user' => GlobalParam::getCurrentUserId(), 'id_producer' => $producer->id]); | ||||
} | } | ||||
], | ], | ||||
[ | [ | ||||
'label' => '<span class="glyphicon glyphicon-plus"></span> Commander', | 'label' => '<span class="glyphicon glyphicon-plus"></span> Commander', | ||||
'url' => $this->getUrlManagerFrontend()->createAbsoluteUrl(['site/producer', 'id' => $this->context->getProducer()->id, 'return_url' => \Yii::$app->urlManagerProducer->createAbsoluteUrl(['order/order', 'slug_producer' => $this->context->getProducer()->slug])]), | |||||
'url' => $this->getUrlManagerFrontend()->createAbsoluteUrl(['site/producer', 'id' => $this->context->getProducerCurrent()->id, 'return_url' => \Yii::$app->urlManagerProducer->createAbsoluteUrl(['order/order', 'slug_producer' => $this->context->getProducerCurrent()->slug])]), | |||||
'visible' => !$producer->option_allow_order_guest && \Yii::$app->user->isGuest, | 'visible' => !$producer->option_allow_order_guest && \Yii::$app->user->isGuest, | ||||
'active' => $this->getControllerAction() == 'order/order', | 'active' => $this->getControllerAction() == 'order/order', | ||||
], | ], |
*/ | */ | ||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\helpers\Price; | |||||
use common\logic\Order\Order\Wrapper\OrderManager; | |||||
use common\logic\Producer\Producer\Model\Producer; | |||||
use common\logic\Producer\Producer\Wrapper\ProducerManager; | |||||
use yii\helpers\Html; | |||||
use yii\widgets\ActiveForm; | use yii\widgets\ActiveForm; | ||||
$producerManager = $this->getProducerManager(); | |||||
$producerManager = ProducerManager::getInstance(); | |||||
$orderManager = OrderManager::getInstance(); | |||||
?> | ?> | ||||
<div class="order-form"> | <div class="order-form"> | ||||
<?php if (isset($model->id)): ?> | <?php if (isset($model->id)): ?> | ||||
<div class="date-order"><span><?php echo date('d/m/Y', strtotime($distribution->date)); ?></span></div> | <div class="date-order"><span><?php echo date('d/m/Y', strtotime($distribution->date)); ?></span></div> | ||||
<?= Html::hiddenInput('id_order', $model->id,['id'=>'id-order']); ?> | <?= Html::hiddenInput('id_order', $model->id,['id'=>'id-order']); ?> | ||||
<?= Html::hiddenInput('paid_amount', $model->getAmount(Order::AMOUNT_PAID),['id'=>'paid-amount']); ?> | |||||
<?= Html::hiddenInput('paid_amount', $orderManager->getOrderAmount($model, Order::AMOUNT_PAID),['id'=>'paid-amount']); ?> | |||||
<?php endif; ?> | <?php endif; ?> | ||||
<div id="datepicker-distribution" <?php if (isset($model->id)): ?>style="display:none"<?php endif; ?>> | <div id="datepicker-distribution" <?php if (isset($model->id)): ?>style="display:none"<?php endif; ?>> | ||||
$linkCredit = '<a class="info-credit" href="'.Yii::$app->urlManager->createUrl(['site/credit']) .'" data-toggle="tooltip" data-placement="bottom" title="En savoir plus sur le Crédit"><span class="glyphicon glyphicon-info-sign"></span></a>' ; ; | $linkCredit = '<a class="info-credit" href="'.Yii::$app->urlManager->createUrl(['site/credit']) .'" data-toggle="tooltip" data-placement="bottom" title="En savoir plus sur le Crédit"><span class="glyphicon glyphicon-info-sign"></span></a>' ; ; | ||||
?> | ?> | ||||
<div id="checkbox-credit" > | <div id="checkbox-credit" > | ||||
<?php if($credit || $model->getAmount(Order::AMOUNT_PAID)): ?> | |||||
<?php if($credit || $orderManager->getAmount($order, Order::AMOUNT_PAID)): ?> | |||||
<?= Html::checkbox('credit', true, ['label' => 'Utiliser mon Crédit <span class="the-credit" data-toggle="tooltip" data-placement="top" data-original-title="Vous avez actuellement '.number_format($credit,2).' € sur votre compte Crédit">'.number_format($credit,2).' €</span><br /><span class="info"></span>']) ?> | <?= Html::checkbox('credit', true, ['label' => 'Utiliser mon Crédit <span class="the-credit" data-toggle="tooltip" data-placement="top" data-original-title="Vous avez actuellement '.number_format($credit,2).' € sur votre compte Crédit">'.number_format($credit,2).' €</span><br /><span class="info"></span>']) ?> | ||||
<?= Html::hiddenInput('amount_credit', $credit, ['id' => 'amount-credit']) ?> | <?= Html::hiddenInput('amount_credit', $credit, ['id' => 'amount-credit']) ?> | ||||
<?= Html::hiddenInput('str_amount_credit', number_format($credit,2).' €', ['id' => 'str-amount-credit']) ?> | <?= Html::hiddenInput('str_amount_credit', number_format($credit,2).' €', ['id' => 'str-amount-credit']) ?> |
use common\helpers\GlobalParam ; | use common\helpers\GlobalParam ; | ||||
use common\logic\Order\Order\Model\Order; | use common\logic\Order\Order\Model\Order; | ||||
use common\logic\Order\Order\Wrapper\OrderManager; | use common\logic\Order\Order\Wrapper\OrderManager; | ||||
use common\logic\PointSale\PointSale\Wrapper\PointSaleManager; | |||||
use common\logic\Producer\Producer\Wrapper\ProducerManager; | use common\logic\Producer\Producer\Wrapper\ProducerManager; | ||||
use yii\helpers\Html; | use yii\helpers\Html; | ||||
$producerManager = ProducerManager::getInstance(); | $producerManager = ProducerManager::getInstance(); | ||||
$orderManager = OrderManager::getInstance(); | $orderManager = OrderManager::getInstance(); | ||||
$pointSaleManager = PointSaleManager::getInstance(); | |||||
$producer = GlobalParam::getCurrentProducer() ; | $producer = GlobalParam::getCurrentProducer() ; | ||||
$this->setTitle('Confirmation de commande') ; | $this->setTitle('Confirmation de commande') ; | ||||
?> | ?> | ||||
<div id="order-success"> | <div id="order-success"> | ||||
<?php if($producerManager->isOnlinePaymentActiveAndTypeOrder($producer) && $returnPayment != 'success'): ?> | <?php if($producerManager->isOnlinePaymentActiveAndTypeOrder($producer) && $returnPayment != 'success'): ?> | ||||
<div class="alert alert-danger"> | <div class="alert alert-danger"> | ||||
<h5>Le paiement en ligne a échoué.</h5> | <h5>Le paiement en ligne a échoué.</h5> | ||||
<?php endif; ?> | <?php endif; ?> | ||||
</li> | </li> | ||||
<?php | <?php | ||||
$strInfos = $order->pointSale->getStrInfos(strtolower(date('l',strtotime($order->distribution->date)))); | |||||
$strInfos = $pointSaleManager->getStrInfos($order->pointSale, strtolower(date('l',strtotime($order->distribution->date)))); | |||||
?> | ?> | ||||
<?php if(strlen($strInfos) > 0): ?> | <?php if(strlen($strInfos) > 0): ?> | ||||
<li><span class="glyphicon glyphicon-info-sign"></span> | <li><span class="glyphicon glyphicon-info-sign"></span> | ||||
<div class="col-md-6"> | <div class="col-md-6"> | ||||
<ul> | <ul> | ||||
<li> | <li> | ||||
<p><strong>Produit<?php if($order->countProducts() > 1): ?>s<?php endif; ?></strong></p> | |||||
<p><?= $order->getCartSummary() ?></p> | |||||
<p><strong>Produit<?php if($orderManager->countProducts($order) > 1): ?>s<?php endif; ?></strong></p> | |||||
<p><?= $orderManager->getCartSummary($order) ?></p> | |||||
</li> | </li> | ||||
<li>Total : <strong><?= $orderManager->getOrderAmountWithTax($order,Order::AMOUNT_TOTAL, true); ?></strong></li> | <li>Total : <strong><?= $orderManager->getOrderAmountWithTax($order,Order::AMOUNT_TOTAL, true); ?></strong></li> | ||||
</ul> | </ul> |
termes. | termes. | ||||
*/ | */ | ||||
use common\logic\Order\Order\Model\Order; | |||||
use common\logic\Order\Order\Wrapper\OrderManager; | |||||
use common\logic\Producer\Producer\Wrapper\ProducerManager; | |||||
use yii\bootstrap\ActiveForm; | use yii\bootstrap\ActiveForm; | ||||
use yii\grid\GridView; | |||||
$producer = $this->context->getProducer(); | |||||
$orderManager = OrderManager::getInstance(); | |||||
$producerManager = ProducerManager::getInstance(); | |||||
$producer = $this->context->getProducerCurrent(); | |||||
$this->setTitle('Mes commandes') ; | $this->setTitle('Mes commandes') ; | ||||
$this->addButton(['label' => '<span class="glyphicon glyphicon-plus"></span> Ajouter', 'url' => 'order/order', 'class' => 'btn btn-primary']) ; | $this->addButton(['label' => '<span class="glyphicon glyphicon-plus"></span> Ajouter', 'url' => 'order/order', 'class' => 'btn btn-primary']) ; | ||||
GridView::widget([ | GridView::widget([ | ||||
'dataProvider' => $dataProviderOrders, | 'dataProvider' => $dataProviderOrders, | ||||
'summary' => '', | 'summary' => '', | ||||
'beforeRow' => function($model) { | |||||
$model->init() ; | |||||
'beforeRow' => function($order) use ($orderManager) { | |||||
$orderManager->initOrder($order) ; | |||||
}, | }, | ||||
'columns' => [ | 'columns' => [ | ||||
[ | [ | ||||
'attribute' => 'distribution.date', | 'attribute' => 'distribution.date', | ||||
'label' => 'Date de livraison', | 'label' => 'Date de livraison', | ||||
'format' => 'raw', | 'format' => 'raw', | ||||
'value' => function($model) { | |||||
return $model->getBlockDate() ; | |||||
'value' => function($order) use ($orderManager) { | |||||
return $orderManager->getDateAsHtml($order) ; | |||||
} | } | ||||
], | ], | ||||
[ | [ | ||||
'label' => 'Point de vente', | 'label' => 'Point de vente', | ||||
'format' => 'raw', | 'format' => 'raw', | ||||
'value' => function($model) { | |||||
return $model->getPointSaleSummary(); | |||||
'value' => function($order) use ($orderManager) { | |||||
return $orderManager->getPointSaleSummary($order); | |||||
} | } | ||||
], | ], | ||||
[ | [ | ||||
'label' => 'Résumé', | 'label' => 'Résumé', | ||||
'format' => 'raw', | 'format' => 'raw', | ||||
'value' => function($model) { | |||||
return $model->getCartSummary(); | |||||
'value' => function($order) use ($orderManager) { | |||||
return $orderManager->getCartSummary($order); | |||||
} | } | ||||
], | ], | ||||
[ | [ | ||||
'label' => 'Montant', | 'label' => 'Montant', | ||||
'format' => 'raw', | 'format' => 'raw', | ||||
'value' => function($model) { | |||||
return $model->getAmountSummary(); | |||||
'value' => function($order) use ($orderManager) { | |||||
return $orderManager->getAmountSummary($order); | |||||
} | } | ||||
], | ], | ||||
[ | [ | ||||
'label' => 'Statut', | 'label' => 'Statut', | ||||
'format' => 'raw', | 'format' => 'raw', | ||||
'value' => function($c) { | |||||
'value' => function($order) use ($orderManager) { | |||||
$html = '' ; | $html = '' ; | ||||
if($c->date_delete) { | |||||
if($order->date_delete) { | |||||
$html .= '<span class="label label-danger">Annulée</span><br />' ; | $html .= '<span class="label label-danger">Annulée</span><br />' ; | ||||
} | } | ||||
else { | else { | ||||
if($c->getState() == Order::STATE_DELIVERED) { | |||||
if($orderManager->getState($order) == Order::STATE_DELIVERED) { | |||||
$html .= '<span class="label label-success">Livrée</span>' ; | $html .= '<span class="label label-success">Livrée</span>' ; | ||||
} | } | ||||
elseif($c->getState() == Order::STATE_PREPARATION) { | |||||
elseif($orderManager->getState($order) == Order::STATE_PREPARATION) { | |||||
$html .= '<span class="label label-warning">En préparation</span>' ; | $html .= '<span class="label label-warning">En préparation</span>' ; | ||||
} | } | ||||
elseif($c->getState() == Order::STATE_OPEN) { | |||||
elseif($orderManager->getState($order) == Order::STATE_OPEN) { | |||||
$html .= '<span class="label label-default">À venir</span>' ; | $html .= '<span class="label label-default">À venir</span>' ; | ||||
} | } | ||||
} | } | ||||
[ | [ | ||||
'label' => 'Actions', | 'label' => 'Actions', | ||||
'format' => 'raw', | 'format' => 'raw', | ||||
'value' => function($c) use ($producer) { | |||||
'value' => function($order) use ($producer, $producerManager, $orderManager) { | |||||
$html = '' ; | $html = '' ; | ||||
if($c->getState() == Order::STATE_OPEN) { | |||||
if ($producer->isOnlinePaymentActiveAndTypeOrder()) { | |||||
$paymentStatus = $c->getPaymentStatus(); | |||||
if($paymentStatus == Order::PAYMENT_UNPAID && $c->online_payment_url) { | |||||
$html .= '<a href="'.$c->online_payment_url.'" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span> Payer en ligne</a>'; | |||||
if($orderManager->getState($order) == Order::STATE_OPEN) { | |||||
if ($producerManager->isOnlinePaymentActiveAndTypeOrder($producer)) { | |||||
$paymentStatus = $orderManager->getPaymentStatus($order); | |||||
if($paymentStatus == Order::PAYMENT_UNPAID && $order->online_payment_url) { | |||||
$html .= '<a href="'.$order->online_payment_url.'" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span> Payer en ligne</a>'; | |||||
} | } | ||||
} | } | ||||
else { | else { | ||||
$html .= '<a href="'.Yii::$app->urlManager->createUrl(['order/order','id'=>$c->id]).'" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span></a> '. | |||||
'<a href="'.Yii::$app->urlManager->createUrl(['order/cancel','id'=>$c->id]).'" class="btn btn-default"><span class="glyphicon glyphicon-trash"></span></a> '. | |||||
(($c->id_subscription) ? '<a href="'.Yii::$app->urlManagerProducer->createUrl(['subscription/form','id'=>$c->id_subscription]).'" class="btn btn-default"><span class="glyphicon glyphicon-repeat"></span></a>' : '') ; | |||||
$html .= '<a href="'.Yii::$app->urlManager->createUrl(['order/order','id'=>$order->id]).'" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span></a> '. | |||||
'<a href="'.Yii::$app->urlManager->createUrl(['order/cancel','id'=>$order->id]).'" class="btn btn-default"><span class="glyphicon glyphicon-trash"></span></a> '. | |||||
(($order->id_subscription) ? '<a href="'.Yii::$app->urlManagerProducer->createUrl(['subscription/form','id'=>$order->id_subscription]).'" class="btn btn-default"><span class="glyphicon glyphicon-repeat"></span></a>' : '') ; | |||||
} | } | ||||
} | } | ||||
return $html ; | return $html ; | ||||
} | } | ||||
] | ] |
*/ | */ | ||||
use common\helpers\GlobalParam ; | use common\helpers\GlobalParam ; | ||||
use common\logic\Producer\Producer\Producer; | |||||
use common\logic\Distribution\Distribution\Model\Distribution; | |||||
use common\logic\Distribution\PointSaleDistribution\Model\PointSaleDistribution; | |||||
use common\logic\Producer\Producer\Model\Producer; | |||||
\producer\assets\VuejsOrderOrderAsset::register($this); | \producer\assets\VuejsOrderOrderAsset::register($this); | ||||
$this->setTitle('Commander') ; | $this->setTitle('Commander') ; | ||||
$producer = $this->context->getProducer(); | |||||
$producer = $this->context->getProducerCurrent(); | |||||
$producerManager = $this->getProducerManager(); | $producerManager = $this->getProducerManager(); | ||||
?> | ?> | ||||
<script> | <script> | ||||
var appInitValues = { | var appInitValues = { | ||||
urlLogin: '<?= \Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/producer', 'id' => $this->context->getProducer()->id, 'return_url' => \Yii::$app->urlManagerProducer->createAbsoluteUrl(['order/order', 'slug_producer' => $this->context->getProducer()->slug])]) ?>' | |||||
urlLogin: '<?= \Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/producer', 'id' => $this->context->getProducerCurrent()->id, 'return_url' => \Yii::$app->urlManagerProducer->createAbsoluteUrl(['order/order', 'slug_producer' => $this->context->getProducerCurrent()->slug])]) ?>' | |||||
}; | }; | ||||
</script> | </script> | ||||
<?php if($producer->behavior_order_select_distribution == Producer::BEHAVIOR_ORDER_SELECT_DISTRIBUTION_LIST ): ?> | <?php if($producer->behavior_order_select_distribution == Producer::BEHAVIOR_ORDER_SELECT_DISTRIBUTION_LIST ): ?> | ||||
<div id="distributions-list"> | <div id="distributions-list"> | ||||
<?php $incomingDistributions = DistributionModel::getIncoming(); ?> | |||||
<?php $incomingDistributions = Distribution::getIncoming(); ?> | |||||
<?php foreach($incomingDistributions as $distribution): ?> | <?php foreach($incomingDistributions as $distribution): ?> | ||||
<?php | <?php | ||||
$pointSaleDistributions = PointSaleDistributionModel::searchAll([ | |||||
$pointSaleDistributions = PointSaleDistribution::searchAll([ | |||||
'id_distribution' => $distribution->id, | 'id_distribution' => $distribution->id, | ||||
'delivery' => 1 | 'delivery' => 1 | ||||
], [], [ | ], [], [ | ||||
</template> | </template> | ||||
<template v-else> | <template v-else> | ||||
<div :class="'form-group' + (pointSale.invalid_code ? ' has-error' : '')"> | <div :class="'form-group' + (pointSale.invalid_code ? ' has-error' : '')"> | ||||
<div class="input-group" v-if="pointSale.code.length > 0"> | |||||
<div class="input-group" v-if="pointSale.code && pointSale.code.length > 0"> | |||||
<span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span> | <span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span> | ||||
<input v-model="pointsSaleCodes[pointSale.id]" type="password" placeholder="Code" class="form-control input-code" /> | <input v-model="pointsSaleCodes[pointSale.id]" type="password" placeholder="Code" class="form-control input-code" /> | ||||
</div> | </div> | ||||
</a> | </a> | ||||
</div> | </div> | ||||
<div v-else> | <div v-else> | ||||
<button class="btn btn-primary" @click="pointSaleClick" :data-code="pointSale.code.length > 0" :data-id-point-sale="pointSale.id"> | |||||
<button class="btn btn-primary" @click="pointSaleClick" :data-code="pointSale.code && pointSale.code.length > 0" :data-id-point-sale="pointSale.id"> | |||||
<span class="glyphicon glyphicon-map-marker"></span> | <span class="glyphicon glyphicon-map-marker"></span> | ||||
Choisir | Choisir | ||||
</button> | </button> | ||||
<th>Délai</th> | <th>Délai</th> | ||||
</tr> | </tr> | ||||
</thead> | </thead> | ||||
<?php foreach($producer->getSpecificDelays() as $day => $delay): ?> | |||||
<?php foreach($producerManager->getSpecificDelays($producer) as $day => $delay): ?> | |||||
<?php if($delay['order_delay'] && $delay['order_deadline']): ?> | <?php if($delay['order_delay'] && $delay['order_deadline']): ?> | ||||
<tr> | <tr> | ||||
<td> | <td> |
/* @var $exception Exception */ | /* @var $exception Exception */ | ||||
$this->title = $name; | $this->title = $name; | ||||
?> | ?> | ||||
<div class="site-error"> | <div class="site-error"> | ||||
<div class="site-contact"> | <div class="site-contact"> | ||||
<div class="row"> | <div class="row"> | ||||
<div class="col-lg-5"> | <div class="col-lg-5"> | ||||
<?php $form = yii\bootstrap\ActiveForm::begin(['id' => 'contact-form', 'enableClientValidation' => false,]); ?> | |||||
<?php $form = ActiveForm::begin(['id' => 'contact-form', 'enableClientValidation' => false,]); ?> | |||||
<?= $form->field($model, 'name') ?> | <?= $form->field($model, 'name') ?> | ||||
<?= $form->field($model, 'email') ?> | <?= $form->field($model, 'email') ?> | ||||
<?= $form->field($model, 'subject') ?> | <?= $form->field($model, 'subject') ?> |
termes. | termes. | ||||
*/ | */ | ||||
use yii\helpers\Html; | |||||
$this->setTitle('Conditions générales de vente'); | $this->setTitle('Conditions générales de vente'); | ||||
echo nl2br(Html::encode($producer->gcs)) ; | echo nl2br(Html::encode($producer->gcs)) ; |
termes. | termes. | ||||
*/ | */ | ||||
use common\logic\Producer\Producer\Producer; | |||||
use common\logic\Distribution\Distribution\Model\Distribution; | |||||
use common\logic\Distribution\PointSaleDistribution\Model\PointSaleDistribution; | |||||
use common\logic\Producer\Producer\Model\Producer; | |||||
use common\logic\Producer\Producer\Wrapper\ProducerManager; | |||||
use common\logic\Product\Product\Wrapper\ProductManager; | |||||
use yii\helpers\Html; | use yii\helpers\Html; | ||||
use yii\grid\GridView; | use yii\grid\GridView; | ||||
use common\helpers\Price; | use common\helpers\Price; | ||||
$producer = $this->context->getProducer() ; | |||||
$productManager = $this->getProductManager(); | |||||
$producerManager = $this->getProducerManager(); | |||||
$productManager = ProductManager::getInstance(); | |||||
$producerManager = ProducerManager::getInstance(); | |||||
$producer = $this->context->getProducerCurrent() ; | |||||
$this->setTitle('Accueil'); | $this->setTitle('Accueil'); | ||||
$this->setPageTitle(Html::encode($producer->type.' à '.$producer->city)) ; | $this->setPageTitle(Html::encode($producer->type.' à '.$producer->city)) ; | ||||
'contentOptions' => ['class' => 'days'], | 'contentOptions' => ['class' => 'days'], | ||||
'value' => function($model) { | 'value' => function($model) { | ||||
$producer = \Yii::$app->controller->getProducer() ; | |||||
$producer = \Yii::$app->controller->getProducerCurrent() ; | |||||
if($producer->behavior_home_point_sale_day_list == Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_WEEK) { | if($producer->behavior_home_point_sale_day_list == Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_WEEK) { | ||||
$arrayDays = [ | $arrayDays = [ | ||||
} | } | ||||
elseif($producer->behavior_home_point_sale_day_list == Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_INCOMING_DISTRIBUTIONS) { | elseif($producer->behavior_home_point_sale_day_list == Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_INCOMING_DISTRIBUTIONS) { | ||||
$html = '' ; | $html = '' ; | ||||
$incomingDistributions = DistributionModel::getIncoming(); | |||||
$incomingDistributions = Distribution::getIncoming(); | |||||
$cpt = 0 ; | $cpt = 0 ; | ||||
foreach($incomingDistributions as $distribution) { | foreach($incomingDistributions as $distribution) { | ||||
$countPointSaleDistribution = PointSaleDistributionModel::searchCount([ | |||||
$countPointSaleDistribution = PointSaleDistribution::searchCount([ | |||||
'id_distribution' => $distribution->id, | 'id_distribution' => $distribution->id, | ||||
'id_point_sale' => $model->id, | 'id_point_sale' => $model->id, | ||||
'delivery' => 1 | 'delivery' => 1 | ||||
<h3><span>Produits</span></h3> | <h3><span>Produits</span></h3> | ||||
<?php | <?php | ||||
$columnsProducts = [] ; | $columnsProducts = [] ; | ||||
if($hasProductPhoto) { | if($hasProductPhoto) { | ||||
$columnsProducts [] = [ | $columnsProducts [] = [ |
termes. | termes. | ||||
*/ | */ | ||||
use yii\helpers\Html; | |||||
$this->setTitle('Mentions légales'); | $this->setTitle('Mentions légales'); | ||||
termes. | termes. | ||||
*/ | */ | ||||
use common\logic\Producer\Producer\Producer; | |||||
use common\logic\Producer\Producer\Wrapper\ProducerManager; | |||||
\producer\assets\VuejsSubscriptionFormAsset::register($this) ; | |||||
$producerManager = ProducerManager::getInstance(); | |||||
$producerManager = $this->getProducerManager(); | |||||
\producer\assets\VuejsSubscriptionFormAsset::register($this) ; | |||||
?> | ?> | ||||
termes. | termes. | ||||
*/ | */ | ||||
use yii\helpers\Html; | |||||
if($idSubscription > 0) { | if($idSubscription > 0) { | ||||
$this->setTitle('Modifier un abonnement') ; | $this->setTitle('Modifier un abonnement') ; | ||||
} | } |
termes. | termes. | ||||
*/ | */ | ||||
use common\logic\PointSale\PointSale\Model\PointSale; | |||||
use common\logic\Product\Product\Model\Product; | |||||
use yii\helpers\Html; | use yii\helpers\Html; | ||||
use yii\grid\GridView; | use yii\grid\GridView; | ||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\logic\Producer\Producer\Producer; | |||||
use yii\helpers\ArrayHelper; | use yii\helpers\ArrayHelper; | ||||
use common\logic\PointSale\PointSale\PointSale; | |||||
$producerManager = $this->getProducerManager(); | $producerManager = $this->getProducerManager(); | ||||