use common\helpers\Price; | use common\helpers\Price; | ||||
use domain\Distribution\Distribution\Distribution; | use domain\Distribution\Distribution\Distribution; | ||||
use domain\Document\DeliveryNote\DeliveryNote; | use domain\Document\DeliveryNote\DeliveryNote; | ||||
use domain\Feature\Feature\Feature; | |||||
use domain\Order\Order\Order; | use domain\Order\Order\Order; | ||||
use domain\Producer\Producer\Producer; | use domain\Producer\Producer\Producer; | ||||
use DateTime; | use DateTime; | ||||
$producerModule = $this->getProducerModule(); | $producerModule = $this->getProducerModule(); | ||||
$pointSaleModule = $this->getPointSaleModule(); | $pointSaleModule = $this->getPointSaleModule(); | ||||
$pointSaleDistributionModule = $this->getPointSaleDistributionModule(); | $pointSaleDistributionModule = $this->getPointSaleDistributionModule(); | ||||
$sharedPointSaleModule = $this->getSharedPointSaleModule(); | |||||
$featureModule = $this->getFeatureModule(); | |||||
$pointsSaleArray = $pointSaleModule->findPointSalesByDistributionAsArray($distribution); | $pointsSaleArray = $pointSaleModule->findPointSalesByDistributionAsArray($distribution); | ||||
} | } | ||||
$pointSaleArray['credit_functioning'] = $producerModule->getPointSaleCreditFunctioning($pointSale); | $pointSaleArray['credit_functioning'] = $producerModule->getPointSaleCreditFunctioning($pointSale); | ||||
$pointSaleArray['producers_sharing_point_sale_as_string'] = false; | |||||
if($featureModule->getChecker()->isEnabled(Feature::ALIAS_SHARED_POINT_SALE)) { | |||||
$pointSaleArray['producers_sharing_point_sale_as_string'] = $sharedPointSaleModule->getResolver()->getProducersSharingPointSaleAsString($pointSale, $distribution); | |||||
} | |||||
} | } | ||||
return $pointsSaleArray; | return $pointsSaleArray; | ||||
return $this->getOrderModule()->getTillerManager()->synchronizeDistribution($date); | return $this->getOrderModule()->getTillerManager()->synchronizeDistribution($date); | ||||
} | } | ||||
public function actionAjaxForceSynchronizeOrderTiller(int $idOrder) | |||||
{ | |||||
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; | |||||
$order = $this->getOrderModule()->getRepository()->findOneOrderById($idOrder); | |||||
return $this->getOrderModule()->getTillerManager()->synchronizeOrder($order, true); | |||||
} | |||||
public function actionAjaxGenerateDeliveryNotePointSale(string $idOrders) | public function actionAjaxGenerateDeliveryNotePointSale(string $idOrders) | ||||
{ | { | ||||
if (strlen($idOrders)) { | if (strlen($idOrders)) { |
foreach ($model->ordersOnCreate as $key => $idOrder) { | foreach ($model->ordersOnCreate as $key => $idOrder) { | ||||
$order = $orderModule->findOneOrderById($idOrder); | $order = $orderModule->findOneOrderById($idOrder); | ||||
$orderModule->updateOrderInvoice($order, $model); | $orderModule->updateOrderInvoice($order, $model); | ||||
$orderModule->getBuilder()->updateOrderInvoicePrices($order, | |||||
[ | |||||
'user' => $model->user, | |||||
'user_producer' => $this->getUserProducerModule()->getRepository() | |||||
->findOneUserProducer($model->user), | |||||
'point_sale' => $order->pointSale | |||||
]); | |||||
} | } | ||||
} | } | ||||
} | } |
<?php | |||||
/** | |||||
* Copyright Souke (2018) | |||||
* | |||||
* contact@souke.fr | |||||
* | |||||
* Ce logiciel est un programme informatique servant à aider les producteurs | |||||
* à distribuer leur production en circuits courts. | |||||
* | |||||
* Ce logiciel est régi par la licence CeCILL soumise au droit français et | |||||
* respectant les principes de diffusion des logiciels libres. Vous pouvez | |||||
* utiliser, modifier et/ou redistribuer ce programme sous les conditions | |||||
* de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA | |||||
* sur le site "http://www.cecill.info". | |||||
* | |||||
* En contrepartie de l'accessibilité au code source et des droits de copie, | |||||
* de modification et de redistribution accordés par cette licence, il n'est | |||||
* offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons, | |||||
* seule une responsabilité restreinte pèse sur l'auteur du programme, le | |||||
* titulaire des droits patrimoniaux et les concédants successifs. | |||||
* | |||||
* A cet égard l'attention de l'utilisateur est attirée sur les risques | |||||
* associés au chargement, à l'utilisation, à la modification et/ou au | |||||
* développement et à la reproduction du logiciel par l'utilisateur étant | |||||
* donné sa spécificité de logiciel libre, qui peut le rendre complexe à | |||||
* manipuler et qui le réserve donc à des développeurs et des professionnels | |||||
* avertis possédant des connaissances informatiques approfondies. Les | |||||
* utilisateurs sont donc invités à charger et tester l'adéquation du | |||||
* logiciel à leurs besoins dans des conditions permettant d'assurer la | |||||
* sécurité de leurs systèmes et ou de leurs données et, plus généralement, | |||||
* à l'utiliser et l'exploiter dans les mêmes conditions de sécurité. | |||||
* | |||||
* Le fait que vous puissiez accéder à cet en-tête signifie que vous avez | |||||
* pris connaissance de la licence CeCILL, et que vous en avez accepté les | |||||
* termes. | |||||
*/ | |||||
namespace backend\controllers; | |||||
use domain\PointSale\SharedPointSale\SharedPointSale; | |||||
use domain\Feature\Feature\Feature; | |||||
use yii\filters\AccessControl; | |||||
use yii\web\NotFoundHttpException; | |||||
/** | |||||
* UserController implements the CRUD actions for User model. | |||||
*/ | |||||
class SharedPointSaleController extends BackendController | |||||
{ | |||||
public function behaviors() | |||||
{ | |||||
return [ | |||||
'access' => [ | |||||
'class' => AccessControl::class, | |||||
'rules' => [ | |||||
[ | |||||
'allow' => true, | |||||
'roles' => ['@'], | |||||
'matchCallback' => function ($rule, $action) { | |||||
$authorizationChecker = $this->getUserModule()->getAuthorizationChecker(); | |||||
$featureChecker = $this->getFeatureModule()->getChecker(); | |||||
return $authorizationChecker->isGrantedAsProducer($this->getUserCurrent()) | |||||
&& $featureChecker->isEnabled(Feature::ALIAS_SHARED_POINT_SALE); | |||||
} | |||||
] | |||||
], | |||||
], | |||||
]; | |||||
} | |||||
public function actionIndex() | |||||
{ | |||||
$sharedPointSaleRepository = $this->getSharedPointSaleModule()->getRepository(); | |||||
return $this->render('index', [ | |||||
'sharedPointsSaleRequestOfMe' => $sharedPointSaleRepository->findSharedPointsSaleRequestsOfMe(), | |||||
'sharedPointsSaleRequestOthers' => $sharedPointSaleRepository->findSharedPointsSaleRequestsOthers(), | |||||
'pointsSaleArray' => $this->getPointSaleModule()->getRepository()->findPointSales() | |||||
]); | |||||
} | |||||
public function actionCreate() | |||||
{ | |||||
$sharedPointSaleModule = $this->getSharedPointSaleModule(); | |||||
$sharedPointSaleModel = $sharedPointSaleModule->getBuilder()->instanciateSharedPointSale(null, null, $this->getUserCurrent()); | |||||
if($sharedPointSaleModel->load(\Yii::$app->request->post()) && $sharedPointSaleModel->validate()) { | |||||
$sharedPointSaleModule->getManager()->createSharedPointSale( | |||||
$sharedPointSaleModel->getPointSale(), | |||||
$sharedPointSaleModel->getProducerWithSharing(), | |||||
$this->getUserCurrent() | |||||
); | |||||
$this->setFlash('success', "La demande de partage a bien été créée"); | |||||
return $this->redirect(['index']); | |||||
} | |||||
return $this->render('create', [ | |||||
'sharedPointSaleModel' => $sharedPointSaleModel | |||||
]); | |||||
} | |||||
public function actionConfirm(int $id) | |||||
{ | |||||
$sharedPointSale = $this->findSharedPointSale($id); | |||||
$sharedPointSale->scenario = SharedPointSale::SCENARIO_CONFIRM; | |||||
if($sharedPointSale->load(\Yii::$app->request->post()) && $sharedPointSale->validate()) { | |||||
$pointSaleWithSharing = $sharedPointSale->getPointSaleWithSharing(); | |||||
if($this->getSharedPointSaleModule()->getManager()->confirmSharedPointSale($sharedPointSale, $pointSaleWithSharing, $this->getUserCurrent())) { | |||||
$this->addFlash('success', "Le partage de point de vente a bien été confirmé"); | |||||
} | |||||
else { | |||||
$this->addFlash('error', "Une erreur est survenue lors de la confirmation du partage"); | |||||
} | |||||
} | |||||
else { | |||||
$this->addFlash('error', "Veuillez sélectionner un point de vente pour confirmer le partage"); | |||||
} | |||||
return $this->redirect(['index']); | |||||
} | |||||
public function actionDecline(int $id) | |||||
{ | |||||
$sharedPointSale = $this->findSharedPointSale($id); | |||||
if($this->getSharedPointSaleModule()->getManager()->declineSharedPointSale($sharedPointSale, $this->getUserCurrent())) { | |||||
$this->addFlash('success', "La demande de partage de point de vente a bien été annulée."); | |||||
} | |||||
else { | |||||
$this->addFlash('error', "Une erreur est survenue lors de l'annulation de la demande de partage."); | |||||
} | |||||
return $this->redirect(['index']); | |||||
} | |||||
public function findSharedPointSale(int $id) | |||||
{ | |||||
$sharedPointSale = $this->getSharedPointSaleModule()->getRepository()->findOneSharedPointSaleById($id); | |||||
if(!$sharedPointSale) { | |||||
throw new NotFoundHttpException("La demande de point de vente partagé n'a pas été trouvée."); | |||||
} | |||||
return $sharedPointSale; | |||||
} | |||||
} |
<h3 class="panel-title">Participer</h3> | <h3 class="panel-title">Participer</h3> | ||||
</div> | </div> | ||||
<div class="panel-body"> | <div class="panel-body"> | ||||
<p>Le logiciel Opendistrib se construit pour et avec vous. Toutes vos remarques, suggestions et remontées | |||||
<p>Le logiciel Souke se construit pour et avec vous. Toutes vos remarques, suggestions et remontées | |||||
de bugs sont les bienvenues et forment le terreau des versions futures.</p> | de bugs sont les bienvenues et forment le terreau des versions futures.</p> | ||||
<p> | <p> | ||||
<a class="btn btn-default" href="<?= $this->getUrlManagerBackend()->createUrl(['support/index']); ?>"> | <a class="btn btn-default" href="<?= $this->getUrlManagerBackend()->createUrl(['support/index']); ?>"> |
</template> | </template> | ||||
<template v-else>Désactivé</template> | <template v-else>Désactivé</template> | ||||
</div> | </div> | ||||
<div v-if="pointSaleActive.producers_sharing_point_sale_as_string"> | |||||
<span class="title">Point de vente partagé</span> | |||||
<i class="fa fa-share-alt"></i> {{ pointSaleActive.producers_sharing_point_sale_as_string }} | |||||
</div> | |||||
</div> | </div> | ||||
<table class="table table-condensed table-bordered table-hover" v-if="countOrdersByPointSale[idActivePointSale] > 0 || (idActivePointSale == 0 && orders.length > 0)"> | <table class="table table-condensed table-bordered table-hover" v-if="countOrdersByPointSale[idActivePointSale] > 0 || (idActivePointSale == 0 && orders.length > 0)"> | ||||
</button> | </button> | ||||
<ul class="dropdown-menu"> | <ul class="dropdown-menu"> | ||||
<li><a href="javascript:void(0);" class="" :data-id-order="order.id" @click="deleteOrderClick"><span class="glyphicon glyphicon-trash"></span> {{ order.labelDeleteAction }}</a></li> | <li><a href="javascript:void(0);" class="" :data-id-order="order.id" @click="deleteOrderClick"><span class="glyphicon glyphicon-trash"></span> {{ order.labelDeleteAction }}</a></li> | ||||
<li v-if="producer && producer.tiller"><a href="javascript:void(0);" @click="forceSynchronizeOrderTiller(order.id)"><span class="glyphicon glyphicon-transfer"></span> Synchroniser avec Tiller</a></li> | |||||
<li v-if="order.id_subscription > 0"><a class="" :href="baseUrl+'/subscription/update?id='+order.id_subscription"><span class="glyphicon glyphicon-repeat"></span> Modifier l'abonnement lié</a></li> | <li v-if="order.id_subscription > 0"><a class="" :href="baseUrl+'/subscription/update?id='+order.id_subscription"><span class="glyphicon glyphicon-repeat"></span> Modifier l'abonnement lié</a></li> | ||||
<li v-else><a class="add-subscription" :href="baseUrl+'/subscription/create?idOrder='+order.id"><span class="glyphicon glyphicon-plus"></span><span class="glyphicon glyphicon-repeat"></span>Créer un abonnement</a></li> | <li v-else><a class="add-subscription" :href="baseUrl+'/subscription/create?idOrder='+order.id"><span class="glyphicon glyphicon-plus"></span><span class="glyphicon glyphicon-repeat"></span>Créer un abonnement</a></li> | ||||
</ul> | </ul> |
$producerModule = $this->getProducerModule(); | $producerModule = $this->getProducerModule(); | ||||
$adminSettingBag = $this->getSettingModule()->getAdminSettingBag(); | $adminSettingBag = $this->getSettingModule()->getAdminSettingBag(); | ||||
$sharedPointSaleModule = $this->getSharedPointSaleModule(); | |||||
?> | ?> | ||||
<div class="content-wrapper"> | <div class="content-wrapper"> | ||||
<?php $producer = GlobalParam::getCurrentProducer(); ?> | <?php $producer = GlobalParam::getCurrentProducer(); ?> | ||||
<?php if($producer && !$producerModule->isUpToDateWithOpendistribVersion($producer) && $producer->option_display_message_new_opendistrib_version): ?> | <?php if($producer && !$producerModule->isUpToDateWithOpendistribVersion($producer) && $producer->option_display_message_new_opendistrib_version): ?> | ||||
<div class="alert alert-success"> | <div class="alert alert-success"> | ||||
<p>Souke a été mis à jour vers la version <?= GlobalParam::getSoukeVersion() ?> ! <a class="alert-link" href="<?= Yii::$app->urlManager->createUrl(['development/index']) ?>">Découvrir les nouveautés</a></p> | |||||
<p> | |||||
<i class="icon fa fa-cogs"></i> | |||||
Souke a été mis à jour vers la version <?= GlobalParam::getSoukeVersion() ?> ! <a class="alert-link" href="<?= Yii::$app->urlManager->createUrl(['development/index']) ?>">Découvrir les nouveautés</a> | |||||
</p> | |||||
<a href="<?= Yii::$app->urlManager->createUrl(['producer/update-opendistrib-version']) ?>" class="close"><span aria-hidden="true">×</span></a> | <a href="<?= Yii::$app->urlManager->createUrl(['producer/update-opendistrib-version']) ?>" class="close"><span aria-hidden="true">×</span></a> | ||||
</div> | </div> | ||||
<?php endif; ?> | <?php endif; ?> | ||||
<?php $countSharedPointsSaleRequestsOthers = $sharedPointSaleModule->getResolver()->countSharedPointsSaleRequestsOthers(); ?> | |||||
<?php if($countSharedPointsSaleRequestsOthers && Yii::$app->controller->id != 'shared-point-sale'): ?> | |||||
<div class="alert alert-info"> | |||||
<p> | |||||
<i class="icon fa fa-share-alt"></i> | |||||
Vous avez une demande de partage de point de vente en attente. <a class="alert-link" href="<?= Yii::$app->urlManager->createUrl(['shared-point-sale/index']) ?>">Voir</a> | |||||
</p> | |||||
</div> | |||||
<?php endif; ?> | |||||
<?php | <?php | ||||
$flashTypeArray = ['error' => 'ban', 'danger' => 'ban', 'warning' => 'warning', 'info' => 'info', 'success' => 'check']; | $flashTypeArray = ['error' => 'ban', 'danger' => 'ban', 'warning' => 'warning', 'info' => 'info', 'success' => 'check']; | ||||
foreach($flashTypeArray as $flashType => $icon) { | foreach($flashTypeArray as $flashType => $icon) { |
['label' => 'Import prix', 'icon' => 'upload', 'url' => ['/product/price-import'], 'visible' => $isUserCurrentGrantedAsProducer && $featureChecker->isEnabled(Feature::ALIAS_PRODUCT_PRICE_IMPORT)], | ['label' => 'Import prix', 'icon' => 'upload', 'url' => ['/product/price-import'], 'visible' => $isUserCurrentGrantedAsProducer && $featureChecker->isEnabled(Feature::ALIAS_PRODUCT_PRICE_IMPORT)], | ||||
] | ] | ||||
], | ], | ||||
['label' => 'Points de vente', 'icon' => 'map-marker', 'url' => ['/point-sale/index'], 'visible' => $isUserCurrentGrantedAsProducer, 'active' => Yii::$app->controller->id == 'point-sale'], | |||||
[ | |||||
'label' => 'Points de vente', | |||||
'icon' => 'map-marker', | |||||
'url' => ['/point-sale/index'], | |||||
'visible' => $isUserCurrentGrantedAsProducer, | |||||
'active' => Yii::$app->controller->id == 'point-sale' || Yii::$app->controller->id == 'shared-point-sale', | |||||
'items' => [ | |||||
['label' => 'Liste', 'icon' => 'th-list', 'url' => ['/point-sale/index'], 'visible' => $isUserCurrentGrantedAsProducer], | |||||
['label' => 'Partages', 'icon' => 'share-alt', 'url' => ['/shared-point-sale/index'], 'visible' => $isUserCurrentGrantedAsProducer && $featureChecker->isEnabled(Feature::ALIAS_SHARED_POINT_SALE)], | |||||
] | |||||
], | |||||
[ | [ | ||||
'label' => 'Utilisateurs', | 'label' => 'Utilisateurs', | ||||
'icon' => 'users', | 'icon' => 'users', | ||||
], | ], | ||||
['label' => 'Paramètres', 'icon' => 'cog', 'url' => ['/producer/update'], 'visible' => $isUserCurrentGrantedAsProducer], | ['label' => 'Paramètres', 'icon' => 'cog', 'url' => ['/producer/update'], 'visible' => $isUserCurrentGrantedAsProducer], | ||||
['label' => 'Accès', 'icon' => 'lock', 'url' => ['/access/index'], 'visible' => $isUserCurrentGrantedAsProducer], | ['label' => 'Accès', 'icon' => 'lock', 'url' => ['/access/index'], 'visible' => $isUserCurrentGrantedAsProducer], | ||||
['label' => "Opendistrib", 'options' => ['class' => 'header'], 'visible' => $isUserCurrentGrantedAsProducer], | |||||
['label' => "Souke", 'options' => ['class' => 'header'], 'visible' => $isUserCurrentGrantedAsProducer], | |||||
[ | [ | ||||
'label' => 'Mes factures', | 'label' => 'Mes factures', | ||||
'icon' => 'clone', | 'icon' => 'clone', |
* termes. | * termes. | ||||
*/ | */ | ||||
use domain\Feature\Feature\Feature; | |||||
use domain\PointSale\UserPointSale\UserPointSale; | use domain\PointSale\UserPointSale\UserPointSale; | ||||
use domain\Producer\Producer\Producer; | use domain\Producer\Producer\Producer; | ||||
use yii\grid\GridView; | use yii\grid\GridView; | ||||
use yii\helpers\Html; | use yii\helpers\Html; | ||||
$pointSaleModule = $this->getPointSaleModule(); | $pointSaleModule = $this->getPointSaleModule(); | ||||
$sharedPointSaleModule = $this->getSharedPointSaleModule(); | |||||
$featureChecker = $this->getFeatureModule()->getChecker(); | |||||
$this->setTitle('Points de vente'); | $this->setTitle('Points de vente'); | ||||
$this->addBreadcrumb($this->getTitle()); | $this->addBreadcrumb($this->getTitle()); | ||||
'attribute' => 'name', | 'attribute' => 'name', | ||||
'label' => 'Nom', | 'label' => 'Nom', | ||||
'format' => 'raw', | 'format' => 'raw', | ||||
'value' => function ($model) { | |||||
'contentOptions' => ['class' => 'column-name'], | |||||
'value' => function ($model) use ($featureChecker, $sharedPointSaleModule) { | |||||
$html = ''; | $html = ''; | ||||
$html .= '<div class="name">'; | |||||
$html .= $model->name; | $html .= $model->name; | ||||
if ($model->is_bread_box) { | if ($model->is_bread_box) { | ||||
$html .= ' <span class="label label-default">Boîte à pain</span> '; | $html .= ' <span class="label label-default">Boîte à pain</span> '; | ||||
} | } | ||||
$html .= '</div>'; | |||||
if($featureChecker->isEnabled(Feature::ALIAS_SHARED_POINT_SALE)) { | |||||
if($sharedPointSaleModule->getResolver()->countPointsSaleSharedWithPointSale($model)) { | |||||
$html .= '<div class="shared-point-sale-producers"><small><span class="fa fa-share-alt"></span> '; | |||||
$html .= $sharedPointSaleModule->getResolver()->getProducersSharingPointSaleAsString($model); | |||||
$html .= '</small></div>'; | |||||
} | |||||
} | |||||
return $html; | return $html; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
], | ], | ||||
[ | |||||
//'visible' => $featureChecker->isEnabled(Feature::ALIAS_SHARED_POINT_SALE), | |||||
'visible' => false, | |||||
'label' => 'Partages', | |||||
'format' => 'raw', | |||||
'headerOptions' => ['class' => 'column-hide-on-mobile'], | |||||
'filterOptions' => ['class' => 'column-hide-on-mobile'], | |||||
'contentOptions' => ['class' => 'td-shared-point-sale column-hide-on-mobile'], | |||||
'value' => function ($pointSale) use ($sharedPointSaleModule) { | |||||
$countPointsSaleSharedWithPointSale = $sharedPointSaleModule->getResolver()->countPointsSaleSharedWithPointSale($pointSale); | |||||
return '<a class="btn btn-'.($countPointsSaleSharedWithPointSale ? 'success' : 'default').'" href="'.Yii::$app->urlManager->createUrl(['shared-point-sale/index']).'" title="'.$sharedPointSaleModule->getResolver()->getProducersSharingPointSaleAsString($pointSale, null, '
').'">'.$countPointsSaleSharedWithPointSale.' <span class="fa fa-share-alt"></span></a>'; | |||||
} | |||||
], | |||||
[ | [ | ||||
'class' => 'yii\grid\ActionColumn', | 'class' => 'yii\grid\ActionColumn', | ||||
'template' => '{update} {delete}', | 'template' => '{update} {delete}', |
<?= $form->field($model, 'option_weeks_distributions_activated_in_advance') | <?= $form->field($model, 'option_weeks_distributions_activated_in_advance') | ||||
->dropDownList($choicesWeeksDistributionsActivatedInAdvanceArray) | ->dropDownList($choicesWeeksDistributionsActivatedInAdvanceArray) | ||||
->hint("Attention, les premières semaines doivent être activées manuellement."); ?> | ->hint("Attention, les premières semaines doivent être activées manuellement."); ?> | ||||
<?= $form->field($model, 'option_order_reference_type') | |||||
<?php | |||||
// Fonctionnalité désactivée car elle crée des bugs | |||||
// @TODO : à réactiver quand tous les problèmes seront résolus | |||||
/*$form->field($model, 'option_order_reference_type') | |||||
->dropDownList([ | ->dropDownList([ | ||||
Producer::ORDER_REFERENCE_TYPE_NONE => '--', | Producer::ORDER_REFERENCE_TYPE_NONE => '--', | ||||
Producer::ORDER_REFERENCE_TYPE_YEARLY => 'Annuelle', | Producer::ORDER_REFERENCE_TYPE_YEARLY => 'Annuelle', | ||||
], []); ?> | |||||
], []);*/ ?> | |||||
<?= $form->field($model, 'option_behavior_cancel_order') | <?= $form->field($model, 'option_behavior_cancel_order') | ||||
->dropDownList([ | ->dropDownList([ | ||||
Producer::BEHAVIOR_DELETE_ORDER_DELETE => 'Suppression de la commande', | Producer::BEHAVIOR_DELETE_ORDER_DELETE => 'Suppression de la commande', |
<?php | |||||
/** | |||||
Copyright Souke (2018) | |||||
contact@souke.fr | |||||
Ce logiciel est un programme informatique servant à aider les producteurs | |||||
à distribuer leur production en circuits courts. | |||||
Ce logiciel est régi par la licence CeCILL soumise au droit français et | |||||
respectant les principes de diffusion des logiciels libres. Vous pouvez | |||||
utiliser, modifier et/ou redistribuer ce programme sous les conditions | |||||
de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA | |||||
sur le site "http://www.cecill.info". | |||||
En contrepartie de l'accessibilité au code source et des droits de copie, | |||||
de modification et de redistribution accordés par cette licence, il n'est | |||||
offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons, | |||||
seule une responsabilité restreinte pèse sur l'auteur du programme, le | |||||
titulaire des droits patrimoniaux et les concédants successifs. | |||||
A cet égard l'attention de l'utilisateur est attirée sur les risques | |||||
associés au chargement, à l'utilisation, à la modification et/ou au | |||||
développement et à la reproduction du logiciel par l'utilisateur étant | |||||
donné sa spécificité de logiciel libre, qui peut le rendre complexe à | |||||
manipuler et qui le réserve donc à des développeurs et des professionnels | |||||
avertis possédant des connaissances informatiques approfondies. Les | |||||
utilisateurs sont donc invités à charger et tester l'adéquation du | |||||
logiciel à leurs besoins dans des conditions permettant d'assurer la | |||||
sécurité de leurs systèmes et ou de leurs données et, plus généralement, | |||||
à l'utiliser et l'exploiter dans les mêmes conditions de sécurité. | |||||
Le fait que vous puissiez accéder à cet en-tête signifie que vous avez | |||||
pris connaissance de la licence CeCILL, et que vous en avez accepté les | |||||
termes. | |||||
*/ | |||||
use domain\PointSale\PointSale\PointSaleRepository; | |||||
use yii\helpers\Html; | |||||
use yii\widgets\ActiveForm; | |||||
$pointSaleModule = $this->getPointSaleModule(); | |||||
$producerModule = $this->getProducerModule(); | |||||
$this->setTitle('Partager un point de vente') ; | |||||
$this->addBreadcrumb(['label' => 'Points de vente partagés', 'url' => ['index']]) ; | |||||
$this->addBreadcrumb('Partager') ; | |||||
?> | |||||
<div class="shared-point-sale-create"> | |||||
<?php $form = ActiveForm::begin([ | |||||
'enableClientValidation' => false | |||||
]); ?> | |||||
<div class="panel panel-default"> | |||||
<div class="panel-body"> | |||||
<?= $form->field($sharedPointSaleModel, 'id_point_sale') | |||||
->dropDownList($pointSaleModule->getRepository()->populatePointSaleDropdownList()) | |||||
->label('Point de vente'); ?> | |||||
<?php $producerPopulateDropdownArray = $producerModule->getRepository()->populateProducerDropdown(true); ?> | |||||
<?= $form->field($sharedPointSaleModel, 'id_producer_with_sharing') | |||||
->dropDownList($producerPopulateDropdownArray['data'], ['prompt' => '--','encode' => false,'options' => $producerPopulateDropdownArray['options']]) | |||||
->label('Producteur avec qui vous souhaitez le partager');?> | |||||
</div> | |||||
</div> | |||||
<div class="form-group form-actions"> | |||||
<?= Html::a('Retour', ['index'], ['class' => 'btn btn-default']) ?> | |||||
<?= Html::submitButton($sharedPointSaleModel->isNewRecord ? 'Créer' : 'Modifier', ['class' => 'btn btn-primary', 'name' => 'save']) ?> | |||||
</div> | |||||
<?php ActiveForm::end(); ?> | |||||
</div> |
<?php | |||||
/** | |||||
* Copyright Souke (2018) | |||||
* | |||||
* contact@souke.fr | |||||
* | |||||
* Ce logiciel est un programme informatique servant à aider les producteurs | |||||
* à distribuer leur production en circuits courts. | |||||
* | |||||
* Ce logiciel est régi par la licence CeCILL soumise au droit français et | |||||
* respectant les principes de diffusion des logiciels libres. Vous pouvez | |||||
* utiliser, modifier et/ou redistribuer ce programme sous les conditions | |||||
* de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA | |||||
* sur le site "http://www.cecill.info". | |||||
* | |||||
* En contrepartie de l'accessibilité au code source et des droits de copie, | |||||
* de modification et de redistribution accordés par cette licence, il n'est | |||||
* offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons, | |||||
* seule une responsabilité restreinte pèse sur l'auteur du programme, le | |||||
* titulaire des droits patrimoniaux et les concédants successifs. | |||||
* | |||||
* A cet égard l'attention de l'utilisateur est attirée sur les risques | |||||
* associés au chargement, à l'utilisation, à la modification et/ou au | |||||
* développement et à la reproduction du logiciel par l'utilisateur étant | |||||
* donné sa spécificité de logiciel libre, qui peut le rendre complexe à | |||||
* manipuler et qui le réserve donc à des développeurs et des professionnels | |||||
* avertis possédant des connaissances informatiques approfondies. Les | |||||
* utilisateurs sont donc invités à charger et tester l'adéquation du | |||||
* logiciel à leurs besoins dans des conditions permettant d'assurer la | |||||
* sécurité de leurs systèmes et ou de leurs données et, plus généralement, | |||||
* à l'utiliser et l'exploiter dans les mêmes conditions de sécurité. | |||||
* | |||||
* Le fait que vous puissiez accéder à cet en-tête signifie que vous avez | |||||
* pris connaissance de la licence CeCILL, et que vous en avez accepté les | |||||
* termes. | |||||
*/ | |||||
use domain\PointSale\UserPointSale\UserPointSale; | |||||
use domain\Producer\Producer\Producer; | |||||
use yii\grid\GridView; | |||||
use yii\helpers\Html; | |||||
use yii\widgets\ActiveForm; | |||||
$sharedPointSaleModule = $this->getSharedPointSaleModule(); | |||||
$pointSaleModule = $this->getPointSaleModule(); | |||||
$this->setTitle('Points de vente partagés'); | |||||
$this->addBreadcrumb($this->getTitle()); | |||||
$this->addButton( | |||||
[ | |||||
'label' => 'Partager un point de vente <span class="glyphicon glyphicon-plus"></span>', | |||||
'url' => 'shared-point-sale/create', | |||||
'class' => 'btn btn-primary' | |||||
] | |||||
); | |||||
?> | |||||
<div class="shared-point-sale-index"> | |||||
<div class="row"> | |||||
<div class="col-md-8"> | |||||
<?php if(count($sharedPointsSaleRequestOfMe)): ?> | |||||
<div class="panel panel-default"> | |||||
<div class="panel-heading"> | |||||
<h3 class="panel-title"> | |||||
Mes demandes de partages en attente | |||||
</h3> | |||||
</div> | |||||
<div class="panel-body"> | |||||
<table class="table table-striped table-bordered"> | |||||
<tbody> | |||||
<?php foreach($sharedPointsSaleRequestOfMe as $sharedPointSale): ?> | |||||
<tr> | |||||
<td> | |||||
Vous souhaitez partager votre point de vente <strong><?= Html::encode($sharedPointSale->getPointSale()->getName()); ?></strong> | |||||
avec le producteur <strong><?= Html::encode($sharedPointSale->getProducerWithSharing()->getName()); ?></strong> | |||||
</td> | |||||
<td> | |||||
<a href="<?= Yii::$app->urlManager->createUrl(['shared-point-sale/decline', 'id' => $sharedPointSale->getId()]) ?>" class="btn btn-default">Annuler</a> | |||||
</td> | |||||
</tr> | |||||
<?php endforeach; ?> | |||||
</tbody> | |||||
</table> | |||||
</div> | |||||
</div> | |||||
<?php endif; ?> | |||||
<?php if(count($sharedPointsSaleRequestOthers)): ?> | |||||
<div class="panel panel-default"> | |||||
<div class="panel-heading"> | |||||
<h3 class="panel-title"> | |||||
Demandes de partage des autres producteurs | |||||
</h3> | |||||
</div> | |||||
<div class="panel-body"> | |||||
<table class="table table-striped table-bordered"> | |||||
<tbody> | |||||
<?php foreach($sharedPointsSaleRequestOthers as $sharedPointSale): ?> | |||||
<tr> | |||||
<td>Le producteur <strong><?= Html::encode($sharedPointSale->getPointSale()->getProducer()->getName()); ?></strong> | |||||
souhaite partager son point de vente <strong><?= Html::encode($sharedPointSale->getPointSale()->getName()); ?></strong> | |||||
avec vous. | |||||
</td> | |||||
<td> | |||||
<?php $form = ActiveForm::begin([ | |||||
'enableClientValidation' => false, | |||||
'action' => Yii::$app->urlManager->createUrl(['shared-point-sale/confirm', 'id' => $sharedPointSale->getId()]) | |||||
]); ?> | |||||
<?= $form->field($sharedPointSale, 'id_point_sale_with_sharing') | |||||
->dropDownList($pointSaleModule->getRepository()->populatePointSaleDropdownList()) | |||||
->label('Votre point de vente correspondant') | |||||
->hint('Absent de la liste ? <a href="'.Yii::$app->urlManager->createUrl(['point-sale/create']).'">Créer le point de vente</a>'); ?> | |||||
<?= Html::submitButton('Confirmer', ['class' => 'btn btn-success', 'name' => 'save']) ?> | |||||
<?php ActiveForm::end(); ?> | |||||
</td> | |||||
<td> | |||||
<br /> | |||||
<a href="<?= Yii::$app->urlManager->createUrl(['shared-point-sale/decline', 'id' => $sharedPointSale->getId()]) ?>" class="btn btn-danger"> | |||||
Refuser | |||||
</a> | |||||
</td> | |||||
</tr> | |||||
<?php endforeach; ?> | |||||
</tbody> | |||||
</table> | |||||
</div> | |||||
</div> | |||||
<?php endif; ?> | |||||
<?php if($sharedPointSaleModule->getResolver()->countPointsSaleShared()): ?> | |||||
<div class="panel panel-default"> | |||||
<div class="panel-heading"> | |||||
<h3 class="panel-title"> | |||||
Partages confirmés | |||||
</h3> | |||||
</div> | |||||
<div class="panel-body"> | |||||
<table class="table table-striped table-bordered"> | |||||
<thead> | |||||
<tr> | |||||
<td>Point de vente</td> | |||||
<td>Partagé avec</td> | |||||
</tr> | |||||
</thead> | |||||
<tbody> | |||||
<?php foreach($pointsSaleArray as $pointSale): ?> | |||||
<?php | |||||
$pointsSaleSharedWithPointSaleArray = $sharedPointSaleModule->getResolver()->getPointsSaleSharedWithPointSale($pointSale); | |||||
if(count($pointsSaleSharedWithPointSaleArray)): | |||||
?> | |||||
<tr> | |||||
<td><?= Html::encode($pointSale->getName()); ?></td> | |||||
<td> | |||||
<?php foreach($pointsSaleSharedWithPointSaleArray as $pointSaleSharedWithPointSale): ?> | |||||
<div> | |||||
<?= Html::encode($pointSaleSharedWithPointSale->getProducer()->getName()); ?> | |||||
- <?= Html::encode($pointSaleSharedWithPointSale->getName()); ?> | |||||
<!--<a href="<?= Yii::$app->urlManager->createUrl(['shared-point-sale/decline']) ?>" class="btn btn-xs btn-default"> | |||||
<span class="glyphicon glyphicon-remove"></span> | |||||
</a>--> | |||||
</div> | |||||
<?php endforeach; ?> | |||||
</td> | |||||
</tr> | |||||
<?php endif; ?> | |||||
<?php endforeach; ?> | |||||
</tbody> | |||||
</table> | |||||
</div> | |||||
</div> | |||||
<?php endif; ?> | |||||
</div> | |||||
<div class="col-md-4"> | |||||
<div class="callout callout-info"> | |||||
<span class="glyphicon glyphicon-info-sign"></span> | |||||
Cette fonctionnalité vous permet de partager des points de vente avec d'autres producteurs inscrits sur Souke | |||||
et avec qui vous avez des distributions en commun.<br /> | |||||
Quand vous partagez un point de vente avec un autre producteur, un lien vers votre boutique est | |||||
proposé aux clients de ce producteur quand ils passent commande sur le point de vente en partage. | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> |
text-align: center; | text-align: center; | ||||
} | } | ||||
/* line 8, ../sass/point_sale/_index.scss */ | /* line 8, ../sass/point_sale/_index.scss */ | ||||
.point-sale-index table .column-name .shared-point-sale-producers { | |||||
margin-top: 5px; | |||||
} | |||||
/* line 13, ../sass/point_sale/_index.scss */ | |||||
.point-sale-index table .column-payment-method ul { | .point-sale-index table .column-payment-method ul { | ||||
list-style-type: none; | list-style-type: none; | ||||
padding: 0px; | padding: 0px; |
function opendistrib_products_event_price() { | function opendistrib_products_event_price() { | ||||
taxRateSelected = $('#product-id_tax_rate').find('option:selected').data('tax-rate-value'); | taxRateSelected = $('#product-id_tax_rate').find('option:selected').data('tax-rate-value'); | ||||
if (typeof taxRateSelected == 'undefined') { | |||||
taxRateSelected = 0; | |||||
} | |||||
var priceWithTax = $('#product-price-with-tax').val(); | var priceWithTax = $('#product-price-with-tax').val(); | ||||
if (priceWithTax) { | if (priceWithTax) { | ||||
$('#product-price').val(getPrice(priceWithTax, taxRateSelected)); | $('#product-price').val(getPrice(priceWithTax, taxRateSelected)); | ||||
// formattage | // formattage | ||||
$('#productprice-price-with-tax').val(getPriceWithTax(price, taxRateValue)); | $('#productprice-price-with-tax').val(getPriceWithTax(price, taxRateValue)); | ||||
// formattage | // formattage | ||||
$('#productprice-price').val(parseFloat(price).toFixed(5)); | $('#productprice-price').val(parseFloat(price).toFixed(5)); | ||||
opendistrib_product_prices_update_reduction_increase(); | opendistrib_product_prices_update_reduction_increase(); | ||||
} | } | ||||
} | } | ||||
$('#productprice-price').val(getPrice(priceWithTax, taxRateValue)); | $('#productprice-price').val(getPrice(priceWithTax, taxRateValue)); | ||||
// formattage | // formattage | ||||
$('#productprice-price-with-tax').val(parseFloat(priceWithTax).toFixed(2)); | $('#productprice-price-with-tax').val(parseFloat(priceWithTax).toFixed(2)); | ||||
opendistrib_product_prices_update_reduction_increase(); | opendistrib_product_prices_update_reduction_increase(); | ||||
} | } | ||||
} | } |
app.init(app.idActivePointSale); | app.init(app.idActivePointSale); | ||||
}); | }); | ||||
}, | }, | ||||
forceSynchronizeOrderTiller: function(idOrder) { | |||||
var app = this; | |||||
this.showLoading = true; | |||||
axios.get(UrlManager.getBaseUrlAbsolute() + "distribution/ajax-force-synchronize-order-tiller", { | |||||
params: { | |||||
idOrder: idOrder | |||||
} | |||||
}) | |||||
.then(function (response) { | |||||
app.init(app.idActivePointSale); | |||||
}); | |||||
}, | |||||
authTiller: function () { | authTiller: function () { | ||||
}, | }, |
.td-default { | .td-default { | ||||
text-align: center ; | text-align: center ; | ||||
} | } | ||||
.column-name { | |||||
.shared-point-sale-producers { | |||||
margin-top: 5px; | |||||
} | |||||
} | |||||
.column-payment-method { | .column-payment-method { | ||||
ul { | ul { | ||||
list-style-type: none; | list-style-type: none; |
public function postOrder($params) | public function postOrder($params) | ||||
{ | { | ||||
return $this->curl->setPostParams( | return $this->curl->setPostParams( | ||||
array_merge([ | |||||
'provider_token' => $this->providerToken, | |||||
'restaurant_token' => $this->restaurantToken, | |||||
], $params) | |||||
) | |||||
->post($this->urlApi . 'orders'); | |||||
array_merge([ | |||||
'provider_token' => $this->providerToken, | |||||
'restaurant_token' => $this->restaurantToken, | |||||
], $params) | |||||
)->post($this->urlApi . 'orders'); | |||||
} | } | ||||
} | } |
} | } | ||||
} | } | ||||
if (Yii::$app->params['maintenanceMode']) { | |||||
if (Yii::$app->params['maintenanceMode'] && Yii::$app instanceof \yii\web\Application) { | |||||
if(isset($_GET['letMeIn'])) { | if(isset($_GET['letMeIn'])) { | ||||
Yii::$app->session->set('letMeIn', (int) $_GET['letMeIn']); | Yii::$app->session->set('letMeIn', (int) $_GET['letMeIn']); | ||||
} | } |
*/ | */ | ||||
return [ | return [ | ||||
'version' => '24.6.A', | |||||
'version' => '24.6.B', | |||||
'maintenanceMode' => false, | 'maintenanceMode' => false, | ||||
'siteName' => 'Souke', | 'siteName' => 'Souke', | ||||
'tinyMcePlugins' => 'preview searchreplace autolink autosave save directionality code visualblocks visualchars fullscreen image link lists wordcount help', | 'tinyMcePlugins' => 'preview searchreplace autolink autosave save directionality code visualblocks visualchars fullscreen image link lists wordcount help', |
if ($width > 500) { | if ($width > 500) { | ||||
$image = Yii::$app->image->load($path_file); | $image = Yii::$app->image->load($path_file); | ||||
// fix exif orientation | |||||
$image->rotate(array_values([0, 0, 0, 180, 0, 0, 90, 0, -90])[@exif_read_data($path_file)['Orientation'] ?: 0]); | |||||
// big | // big | ||||
if ($width > 1600) { | if ($width > 1600) { | ||||
$image->resize(1600)->save($dir_file . $file_name . '-big.' . $file->extension); | $image->resize(1600)->save($dir_file . $file_name . '-big.' . $file->extension); |
<?php | |||||
require_once dirname(__FILE__).'/_macros.php'; | |||||
version( | |||||
'10/06/2024', | |||||
[ | |||||
[ | |||||
"[Administration] Distributions > Tiller : possibilité de forcer la synchronisation d'une commande" | |||||
], | |||||
[ | |||||
"[Administration] Produits > photo : correctif orientation image (données EXIF non prises en compte)", | |||||
"[Administration] Produits : correctif problème saisie prix via champs TTC (NaN)", | |||||
"[Administration] Factures : correctif initialisation prix facturés lors de la création d'une facture sur base de commandes", | |||||
"[Site & boutique] Menu haut : affichage du nom de l'utilisateur en entier" | |||||
] | |||||
], | |||||
[ | |||||
[ | |||||
], | |||||
[ | |||||
"Mode maintenance : correctif lancement de commandes via la console" | |||||
] | |||||
], | |||||
$userCurrent | |||||
); | |||||
?> |
<?php if($display && $message): ?> | <?php if($display && $message): ?> | ||||
<div class="alert alert-<?= $type ?>"> | <div class="alert alert-<?= $type ?>"> | ||||
<?php if($title): ?> | |||||
<?php if(isset($title) && $title): ?> | |||||
<h4> | <h4> | ||||
<?php if($icon): ?> | <?php if($icon): ?> | ||||
<i class="icon fa fa-<?= $icon ?>"></i> | <i class="icon fa fa-<?= $icon ?>"></i> | ||||
</h4> | </h4> | ||||
<?php endif; ?> | <?php endif; ?> | ||||
<p> | <p> | ||||
<?php if(!$title && $icon): ?> | |||||
<?php if((!isset($title) || !$title) && $icon): ?> | |||||
<i class="icon fa fa-<?= $icon ?>"></i> | <i class="icon fa fa-<?= $icon ?>"></i> | ||||
<?php endif; ?> | <?php endif; ?> | ||||
<?php if(is_array($message)): ?> | <?php if(is_array($message)): ?> |
$itemUser = [ | $itemUser = [ | ||||
'label' => '<i class="bi bi-person"></i> <span class="link-text">' . | 'label' => '<i class="bi bi-person"></i> <span class="link-text">' . | ||||
((!Yii::$app->user->isGuest) ? Html::encode(Yii::$app->user->identity->name . ' ' . strtoupper(substr(Yii::$app->user->identity->lastname, 0, 1)) . '.') : '') . | |||||
((!Yii::$app->user->isGuest) ? Html::encode(Yii::$app->user->identity->name . ' ' . Yii::$app->user->identity->lastname) : '') . | |||||
'</span>', | '</span>', | ||||
'options' => ['id' => 'label1'], | |||||
'options' => ['id' => 'label1', 'class' => 'nav-item-user'], | |||||
'url' => '#', | 'url' => '#', | ||||
'linkOptions' => ['class' => ''], | 'linkOptions' => ['class' => ''], | ||||
'items' => $itemsUserArray, | 'items' => $itemsUserArray, |
position: relative; | position: relative; | ||||
top: 1px; | top: 1px; | ||||
} | } | ||||
/* line 281, ../sass/_common.scss */ | |||||
/* line 280, ../sass/_common.scss */ | |||||
.container-nav-user-top .nav-user-top .navbar ul li.nav-item-producers .dropdown-menu { | |||||
right: -75px; | |||||
left: -75px; | |||||
} | |||||
/* line 285, ../sass/_common.scss */ | |||||
.container-nav-user-top .nav-user-top .navbar ul li.nav-item-user .dropdown-menu { | |||||
right: -22px; | |||||
left: 9px; | |||||
} | |||||
/* line 291, ../sass/_common.scss */ | |||||
.container-nav-user-top .nav-user-top .navbar ul li .dropdown-menu a { | .container-nav-user-top .nav-user-top .navbar ul li .dropdown-menu a { | ||||
padding: 2px 20px; | padding: 2px 20px; | ||||
} | } | ||||
/* line 284, ../sass/_common.scss */ | |||||
/* line 294, ../sass/_common.scss */ | |||||
.container-nav-user-top .nav-user-top .navbar ul li .dropdown-menu a:hover, .container-nav-user-top .nav-user-top .navbar ul li .dropdown-menu a:focus { | .container-nav-user-top .nav-user-top .navbar ul li .dropdown-menu a:hover, .container-nav-user-top .nav-user-top .navbar ul li .dropdown-menu a:focus { | ||||
background-color: #ece4d8; | background-color: #ece4d8; | ||||
} | } | ||||
/* line 293, ../sass/_common.scss */ | |||||
/* line 303, ../sass/_common.scss */ | |||||
.container-nav-user-top .nav-user-top .dropdown-menu { | .container-nav-user-top .nav-user-top .dropdown-menu { | ||||
z-index: 9999; | z-index: 9999; | ||||
} | } | ||||
/* line 295, ../sass/_common.scss */ | |||||
/* line 305, ../sass/_common.scss */ | |||||
.container-nav-user-top .nav-user-top .dropdown-menu .divider.dropdown-header { | .container-nav-user-top .nav-user-top .dropdown-menu .divider.dropdown-header { | ||||
padding: 0px; | padding: 0px; | ||||
} | } | ||||
@media screen and (max-width: 991px) { | @media screen and (max-width: 991px) { | ||||
/* line 306, ../sass/_common.scss */ | |||||
/* line 316, ../sass/_common.scss */ | |||||
.container-nav-user-top .nav-user-top { | .container-nav-user-top .nav-user-top { | ||||
position: relative; | position: relative; | ||||
} | } | ||||
/* line 310, ../sass/_common.scss */ | |||||
/* line 320, ../sass/_common.scss */ | |||||
.container-nav-user-top .nav-user-top .navbar ul { | .container-nav-user-top .nav-user-top .navbar ul { | ||||
width: 100%; | width: 100%; | ||||
display: block; | display: block; | ||||
margin-right: 0px; | margin-right: 0px; | ||||
text-align: center; | text-align: center; | ||||
} | } | ||||
/* line 316, ../sass/_common.scss */ | |||||
/* line 326, ../sass/_common.scss */ | |||||
.container-nav-user-top .nav-user-top .navbar ul li { | .container-nav-user-top .nav-user-top .navbar ul li { | ||||
display: inline-block; | display: inline-block; | ||||
} | } | ||||
/* line 320, ../sass/_common.scss */ | |||||
/* line 329, ../sass/_common.scss */ | |||||
.container-nav-user-top .nav-user-top .navbar ul li.nav-item-producers .dropdown-menu { | .container-nav-user-top .nav-user-top .navbar ul li.nav-item-producers .dropdown-menu { | ||||
right: -95px; | |||||
left: -115px; | |||||
width: 300px; | |||||
} | } | ||||
/* line 327, ../sass/_common.scss */ | |||||
/* line 334, ../sass/_common.scss */ | |||||
.container-nav-user-top .nav-user-top .navbar ul li.nav-item-user .dropdown-menu { | |||||
left: -40px; | |||||
width: 150px; | |||||
} | |||||
/* line 341, ../sass/_common.scss */ | |||||
.container-nav-user-top .nav-user-top .navbar .link-text { | .container-nav-user-top .nav-user-top .navbar .link-text { | ||||
display: none; | display: none; | ||||
} | } | ||||
/* line 331, ../sass/_common.scss */ | |||||
/* line 345, ../sass/_common.scss */ | |||||
.container-nav-user-top .nav-user-top .navbar .dropdown-menu { | .container-nav-user-top .nav-user-top .navbar .dropdown-menu { | ||||
position: absolute; | position: absolute; | ||||
right: 5%; | right: 5%; | ||||
-webkit-box-shadow: 0px 0px 4px gray; | -webkit-box-shadow: 0px 0px 4px gray; | ||||
box-shadow: 0px 0px 4px gray; | box-shadow: 0px 0px 4px gray; | ||||
} | } | ||||
/* line 340, ../sass/_common.scss */ | |||||
/* line 354, ../sass/_common.scss */ | |||||
.container-nav-user-top .nav-user-top .navbar .dropdown-menu li a { | .container-nav-user-top .nav-user-top .navbar .dropdown-menu li a { | ||||
padding-left: 15px; | padding-left: 15px; | ||||
} | } | ||||
} | } | ||||
/* Block de date */ | /* Block de date */ | ||||
/* line 353, ../sass/_common.scss */ | |||||
/* line 367, ../sass/_common.scss */ | |||||
.block-date { | .block-date { | ||||
margin: 0px auto; | margin: 0px auto; | ||||
padding-top: 0px; | padding-top: 0px; | ||||
text-align: center; | text-align: center; | ||||
} | } | ||||
/* line 358, ../sass/_common.scss */ | |||||
/* line 372, ../sass/_common.scss */ | |||||
.block-date .day { | .block-date .day { | ||||
text-transform: capitalize; | text-transform: capitalize; | ||||
line-height: 15px; | line-height: 15px; | ||||
font-size: 15px; | font-size: 15px; | ||||
text-transform: uppercase; | text-transform: uppercase; | ||||
} | } | ||||
/* line 365, ../sass/_common.scss */ | |||||
/* line 379, ../sass/_common.scss */ | |||||
.block-date .num { | .block-date .num { | ||||
font-size: 30px; | font-size: 30px; | ||||
line-height: 35px; | line-height: 35px; | ||||
font-weight: bold; | font-weight: bold; | ||||
} | } | ||||
/* line 371, ../sass/_common.scss */ | |||||
/* line 385, ../sass/_common.scss */ | |||||
.block-date .month { | .block-date .month { | ||||
text-transform: uppercase; | text-transform: uppercase; | ||||
line-height: 15px; | line-height: 15px; | ||||
} | } | ||||
/* Page d'erreur */ | /* Page d'erreur */ | ||||
/* line 381, ../sass/_common.scss */ | |||||
/* line 395, ../sass/_common.scss */ | |||||
#main #content .site-error .col-lg-6 { | #main #content .site-error .col-lg-6 { | ||||
margin: 0px auto; | margin: 0px auto; | ||||
float: none; | float: none; | ||||
} | } | ||||
/* line 391, ../sass/_common.scss */ | |||||
/* line 405, ../sass/_common.scss */ | |||||
#main #content .site-error .panel h2 { | #main #content .site-error .panel h2 { | ||||
text-transform: none; | text-transform: none; | ||||
font-size: 25px; | font-size: 25px; | ||||
margin-top: 0px; | margin-top: 0px; | ||||
margin-bottom: 20px; | margin-bottom: 20px; | ||||
} | } | ||||
/* line 398, ../sass/_common.scss */ | |||||
/* line 412, ../sass/_common.scss */ | |||||
#main #content .site-error .panel p:last-child { | #main #content .site-error .panel p:last-child { | ||||
margin-bottom: 0px; | margin-bottom: 0px; | ||||
padding-bottom: 0px; | padding-bottom: 0px; | ||||
} | } | ||||
/* line 404, ../sass/_common.scss */ | |||||
/* line 418, ../sass/_common.scss */ | |||||
#main #content .site-error .alert { | #main #content .site-error .alert { | ||||
padding-bottom: 5px; | padding-bottom: 5px; | ||||
} | } | ||||
/* line 407, ../sass/_common.scss */ | |||||
/* line 421, ../sass/_common.scss */ | |||||
#main #content .site-error .alert h3 { | #main #content .site-error .alert h3 { | ||||
margin-top: 5px; | margin-top: 5px; | ||||
margin-bottom: 18px; | margin-bottom: 18px; | ||||
} | } | ||||
/* line 412, ../sass/_common.scss */ | |||||
/* line 426, ../sass/_common.scss */ | |||||
#main #content .site-error .alert p { | #main #content .site-error .alert p { | ||||
margin-bottom: 15px; | margin-bottom: 15px; | ||||
} | } | ||||
/* line 416, ../sass/_common.scss */ | |||||
/* line 430, ../sass/_common.scss */ | |||||
#main #content .site-error .alert .btn { | #main #content .site-error .alert .btn { | ||||
text-decoration: none; | text-decoration: none; | ||||
} | } | ||||
/* line 421, ../sass/_common.scss */ | |||||
/* line 435, ../sass/_common.scss */ | |||||
#main #content .site-error p.error-message { | #main #content .site-error p.error-message { | ||||
font-weight: bold; | font-weight: bold; | ||||
} | } | ||||
/* Paiement */ | /* Paiement */ | ||||
/* line 427, ../sass/_common.scss */ | |||||
/* line 441, ../sass/_common.scss */ | |||||
.payment-detail-remaining-surplus { | .payment-detail-remaining-surplus { | ||||
font-size: 13px; | font-size: 13px; | ||||
color: gray; | color: gray; | ||||
} | } | ||||
/* line 431, ../sass/_common.scss */ | |||||
/* line 445, ../sass/_common.scss */ | |||||
.payment-detail-remaining-surplus strong { | .payment-detail-remaining-surplus strong { | ||||
font-weight: bold; | font-weight: bold; | ||||
} | } |
} | } | ||||
} | } | ||||
&.nav-item-producers .dropdown-menu { | |||||
right: -75px; | |||||
left: -75px; | |||||
} | |||||
&.nav-item-user .dropdown-menu { | |||||
right: -22px; | |||||
left: 9px; | |||||
} | |||||
.dropdown-menu { | .dropdown-menu { | ||||
a { | a { | ||||
padding: 2px 20px; | padding: 2px 20px; | ||||
li { | li { | ||||
display: inline-block; | display: inline-block; | ||||
&.nav-item-producers { | |||||
.dropdown-menu { | |||||
right: -95px; | |||||
} | |||||
&.nav-item-producers .dropdown-menu { | |||||
left: -115px; | |||||
width: 300px; | |||||
} | |||||
&.nav-item-user .dropdown-menu { | |||||
left: -40px; | |||||
width: 150px; | |||||
} | } | ||||
} | } | ||||
} | } |
<?php | |||||
use yii\db\Migration; | |||||
use yii\db\Schema; | |||||
/** | |||||
* Class m240603_131331_create_table_shared_point_sale | |||||
*/ | |||||
class m240603_131331_create_table_shared_point_sale extends Migration | |||||
{ | |||||
/** | |||||
* {@inheritdoc} | |||||
*/ | |||||
public function safeUp() | |||||
{ | |||||
$this->createTable('shared_point_sale', [ | |||||
'id' => 'pk', | |||||
'id_point_sale' => Schema::TYPE_INTEGER, | |||||
'id_producer_with_sharing' => Schema::TYPE_INTEGER, | |||||
'id_point_sale_with_sharing' => Schema::TYPE_INTEGER, | |||||
'status' => Schema::TYPE_INTEGER, | |||||
]); | |||||
$this->addForeignKey('fk_id_point_sale', 'shared_point_sale', 'id_point_sale', 'point_sale', 'id'); | |||||
$this->addForeignKey('fk_id_producer', 'shared_point_sale', 'id_producer_with_sharing', 'producer', 'id'); | |||||
$this->addForeignKey('fk_id_point_sale_with_sharing', 'shared_point_sale', 'id_point_sale_with_sharing', 'point_sale', 'id'); | |||||
} | |||||
/** | |||||
* {@inheritdoc} | |||||
*/ | |||||
public function safeDown() | |||||
{ | |||||
$this->dropTable('shared_point_sale'); | |||||
$this->dropForeignKey('fk_id_point_sale', 'shared_point_sale'); | |||||
$this->dropForeignKey('fk_id_producer', 'shared_point_sale'); | |||||
$this->dropForeignKey('fk_id_point_sale_with_sharing', 'shared_point_sale'); | |||||
} | |||||
} |
<?php | |||||
use yii\db\Migration; | |||||
use yii\db\Schema; | |||||
/** | |||||
* Class m240604_093627_add_columns_shared_point_sale_created_confirmed_declined | |||||
*/ | |||||
class m240604_093627_add_columns_shared_point_sale_created_confirmed_declined extends Migration | |||||
{ | |||||
/** | |||||
* {@inheritdoc} | |||||
*/ | |||||
public function safeUp() | |||||
{ | |||||
$this->addColumn('shared_point_sale', 'created_at', Schema::TYPE_DATETIME); | |||||
$this->addColumn('shared_point_sale', 'created_by', Schema::TYPE_INTEGER); | |||||
$this->addColumn('shared_point_sale', 'confirmed_at', Schema::TYPE_DATETIME); | |||||
$this->addColumn('shared_point_sale', 'confirmed_by', Schema::TYPE_INTEGER); | |||||
$this->addColumn('shared_point_sale', 'declined_at', Schema::TYPE_DATETIME); | |||||
$this->addColumn('shared_point_sale', 'declined_by', Schema::TYPE_INTEGER); | |||||
$this->addForeignKey('fk_created_by', 'shared_point_sale', 'created_by', 'user', 'id'); | |||||
$this->addForeignKey('fk_confirmed_by', 'shared_point_sale', 'confirmed_by', 'user', 'id'); | |||||
$this->addForeignKey('fk_declined_by', 'shared_point_sale', 'declined_by', 'user', 'id'); | |||||
} | |||||
/** | |||||
* {@inheritdoc} | |||||
*/ | |||||
public function safeDown() | |||||
{ | |||||
$this->dropColumn('shared_point_sale', 'created_at'); | |||||
$this->dropColumn('shared_point_sale', 'created_by'); | |||||
$this->dropColumn('shared_point_sale', 'confirmed_at'); | |||||
$this->dropColumn('shared_point_sale', 'confirmed_by'); | |||||
$this->dropColumn('shared_point_sale', 'declined_at'); | |||||
$this->dropColumn('shared_point_sale', 'declined_by'); | |||||
$this->dropForeignKey('fk_created_by', 'shared_point_sale'); | |||||
$this->dropForeignKey('fk_confirmed_by', 'shared_point_sale'); | |||||
$this->dropForeignKey('fk_declined_by', 'shared_point_sale'); | |||||
} | |||||
} |
]; | ]; | ||||
} | } | ||||
public function findOnePointSaleDistribution(Distribution $distribution, PointSale $pointSale): ?PointSaleDistribution | |||||
public function findOnePointSaleDistribution(Distribution $distribution, PointSale $pointSale, bool $delivery = null): ?PointSaleDistribution | |||||
{ | { | ||||
return $this->createDefaultQuery() | |||||
$query = $this->createDefaultQuery() | |||||
->filterByDistribution($distribution) | ->filterByDistribution($distribution) | ||||
->filterByPointSale($pointSale) | |||||
->findOne(); | |||||
->filterByPointSale($pointSale); | |||||
if(!is_null($delivery)) { | |||||
$query->filterIsDelivery($delivery); | |||||
} | |||||
return $query->findOne(); | |||||
} | } | ||||
public function findPointSaleDistributionsByDistribution(Distribution $distribution): array | public function findPointSaleDistributionsByDistribution(Distribution $distribution): array |
return $this; | return $this; | ||||
} | } | ||||
public function filterIsDelivery(bool $delivery) | |||||
{ | |||||
$this->andWhere(['delivery' => $delivery ? 1 : 0]); | |||||
return $this; | |||||
} | |||||
} | } |
const ALIAS_EXPORT_SHOPPING_CART_LABELS_ADVANCED = 'export_shopping_cart_labels_advanced'; | const ALIAS_EXPORT_SHOPPING_CART_LABELS_ADVANCED = 'export_shopping_cart_labels_advanced'; | ||||
const ALIAS_SETTINGS = 'settings'; | const ALIAS_SETTINGS = 'settings'; | ||||
const ALIAS_SHOP_SUPPORT = 'shop_support'; | const ALIAS_SHOP_SUPPORT = 'shop_support'; | ||||
const ALIAS_SHARED_POINT_SALE = 'shared_point_sale'; | |||||
/** | /** | ||||
* @inheritdoc | * @inheritdoc |
Feature::ALIAS_ONLINE_PAYMENT => 'Paiement en ligne', | Feature::ALIAS_ONLINE_PAYMENT => 'Paiement en ligne', | ||||
Feature::ALIAS_EXPORT_SHOPPING_CART_LABELS_ADVANCED => "Génération d'étiquettes avec un format spécifique", | Feature::ALIAS_EXPORT_SHOPPING_CART_LABELS_ADVANCED => "Génération d'étiquettes avec un format spécifique", | ||||
Feature::ALIAS_SETTINGS => 'Système de paramètres', | Feature::ALIAS_SETTINGS => 'Système de paramètres', | ||||
Feature::ALIAS_SHOP_SUPPORT => 'Support boutique' | |||||
Feature::ALIAS_SHOP_SUPPORT => 'Support boutique', | |||||
Feature::ALIAS_SHARED_POINT_SALE => 'Points de vente partagés', | |||||
]; | ]; | ||||
} | } | ||||
} | } |
{ | { | ||||
if ($this->orderSolver->isOrderFromProducer($order)) { | if ($this->orderSolver->isOrderFromProducer($order)) { | ||||
$this->updateOrderDeliveryNote($order, $deliveryNote); | $this->updateOrderDeliveryNote($order, $deliveryNote); | ||||
$order = $this->orderRepository->findOneOrderById($order->id); | $order = $this->orderRepository->findOneOrderById($order->id); | ||||
$user = $this->userRepository->findOneUserById($deliveryNote->id_user); | $user = $this->userRepository->findOneUserById($deliveryNote->id_user); | ||||
$userProducer = $this->userProducerRepository->findOneUserProducer($user); | $userProducer = $this->userProducerRepository->findOneUserProducer($user); |
public function synchronizeDistribution(string $date): array | public function synchronizeDistribution(string $date): array | ||||
{ | { | ||||
$apiVersion = $this->producerSolver->getConfig('tiller_api_version'); | |||||
$return = []; | $return = []; | ||||
if($this->tillerActivated) { | if($this->tillerActivated) { | ||||
'conditions' => OrderRepositoryQuery::getSqlFilterIsValid() | 'conditions' => OrderRepositoryQuery::getSqlFilterIsValid() | ||||
]); | ]); | ||||
$strDate = date('Y-m-d\T12:i:s+0000', strtotime($date) + 1); | |||||
$datetime = new \DateTime(date('Y-m-d 12:i:s', strtotime($date))); | |||||
if ($orders && count($orders)) { | if ($orders && count($orders)) { | ||||
foreach ($orders as $order) { | foreach ($orders as $order) { | ||||
$this->orderBuilder->initOrder($order); | |||||
$lines = []; | |||||
foreach ($order->productOrder as $productOrder) { | |||||
// v3 | |||||
if($apiVersion == 'v3') { | |||||
$amount = round($this->productOrderSolver->getPriceWithTax($productOrder) * 100); | |||||
// classique | |||||
if(is_int($productOrder->quantity)) { | |||||
$quantity = $productOrder->quantity; | |||||
} | |||||
// vrac | |||||
else { | |||||
$amount = $amount * $productOrder->quantity; | |||||
$quantity = 1; | |||||
} | |||||
$lines[] = [ | |||||
'name' => $productOrder->product->name, | |||||
'unitPrice' => [ | |||||
'amount' => $amount, | |||||
], | |||||
'taxRate' => $productOrder->taxRate->value * 100, | |||||
'quantity' => $quantity | |||||
]; | |||||
} | |||||
// v2 | |||||
else { | |||||
$lines[] = [ | |||||
'name' => $productOrder->product->name, | |||||
'price' => $this->productOrderSolver->getPriceWithTax($productOrder) * 100 * $productOrder->quantity, | |||||
'tax' => $productOrder->taxRate->value * 100, | |||||
'date' => $strDate, | |||||
'quantity' => $productOrder->quantity | |||||
]; | |||||
} | |||||
$res = $this->synchronizeOrder($order); | |||||
if($res) { | |||||
$return[] = $res; | |||||
} | } | ||||
} | |||||
} | |||||
} | |||||
} | |||||
$typePaymentTiller = ''; | |||||
if ($order->mean_payment == MeanPayment::MONEY) { | |||||
$typePaymentTiller = 'CASH'; | |||||
} | |||||
if ($order->mean_payment == MeanPayment::CREDIT_CARD | |||||
|| $order->mean_payment == MeanPayment::CREDIT | |||||
|| $order->mean_payment == MeanPayment::TRANSFER | |||||
|| $order->mean_payment == MeanPayment::OTHER) { | |||||
$typePaymentTiller = 'CARD'; | |||||
} | |||||
if ($order->mean_payment == MeanPayment::CHEQUE) { | |||||
$typePaymentTiller = 'BANK_CHECK'; | |||||
} | |||||
if (!strlen($typePaymentTiller) || !$order->mean_payment) { | |||||
$typePaymentTiller = 'CASH'; | |||||
} | |||||
return $return; | |||||
} | |||||
if (!$this->isSynchronized($date, $order->id)) { | |||||
// v3 | |||||
if($apiVersion == 'v3') { | |||||
$payments = []; | |||||
$amountPayment = round($this->orderSolver->getOrderAmountWithTax($order, Order::AMOUNT_PAID) * 100); | |||||
if($amountPayment) { | |||||
$payments[] = [ | |||||
'externalId' => ''.$order->id, | |||||
'amount' => $amountPayment | |||||
]; | |||||
} | |||||
public function synchronizeOrder(Order $order, bool $force = false) | |||||
{ | |||||
$apiVersion = $this->producerSolver->getConfig('tiller_api_version'); | |||||
$date = $order->distribution->date; | |||||
$strDate = date('Y-m-d\T12:i:s+0000', strtotime($date) + 1); | |||||
$datetime = new \DateTime(date('Y-m-d 12:i:s', strtotime($date))); | |||||
$this->orderBuilder->initOrder($order); | |||||
$lines = []; | |||||
$returnTiller = $this->tillerClient->postOrder([ | |||||
'externalId' => ''.$order->id, | |||||
'purchaseRequestType' => 'clickAndCollect', | |||||
'date' => $datetime->format(\DateTime::ATOM), | |||||
'order' => [ | |||||
'currencyCode' => 'EUR', | |||||
'itemLines' => $lines, | |||||
'payments' => $payments | |||||
] | |||||
]); | |||||
} | |||||
// v2 | |||||
else { | |||||
$returnTiller = $this->tillerClient->postOrder([ | |||||
'externalId' => $order->id, | |||||
'type' => 1, | |||||
'status' => 'IN_PROGRESS', | |||||
'openDate' => $strDate, | |||||
'closeDate' => $strDate, | |||||
'lines' => $lines, | |||||
'payments' => [ | |||||
[ | |||||
'type' => $typePaymentTiller, | |||||
'amount' => $this->orderSolver->getOrderAmountWithTax( | |||||
$order, | |||||
Order::AMOUNT_PAID | |||||
) * 100, | |||||
'status' => 'ACCEPTED', | |||||
'date' => $strDate | |||||
] | |||||
] | |||||
]); | |||||
} | |||||
foreach ($order->productOrder as $productOrder) { | |||||
// v3 | |||||
if($apiVersion == 'v3') { | |||||
$amount = round($this->productOrderSolver->getPriceWithTax($productOrder) * 100); | |||||
$returnTillerObject = json_decode($returnTiller); | |||||
if($apiVersion == 'v3') { | |||||
$order->tiller_external_id = '' . $returnTillerObject->referenceId; | |||||
} | |||||
else { | |||||
$order->tiller_external_id = '' . $returnTillerObject->id; | |||||
} | |||||
$order->save(); | |||||
// classique | |||||
if(is_int($productOrder->quantity)) { | |||||
$quantity = $productOrder->quantity; | |||||
} | |||||
// vrac | |||||
else { | |||||
$amount = $amount * $productOrder->quantity; | |||||
$quantity = 1; | |||||
} | |||||
$return[] = $returnTiller; | |||||
} | |||||
} | |||||
$lines[] = [ | |||||
'name' => $productOrder->product->name, | |||||
'unitPrice' => [ | |||||
'amount' => $amount, | |||||
], | |||||
'taxRate' => $productOrder->taxRate->value * 100, | |||||
'quantity' => $quantity | |||||
]; | |||||
} | |||||
// v2 | |||||
else { | |||||
$lines[] = [ | |||||
'name' => $productOrder->product->name, | |||||
'price' => $this->productOrderSolver->getPriceWithTax($productOrder) * 100 * $productOrder->quantity, | |||||
'tax' => $productOrder->taxRate->value * 100, | |||||
'date' => $strDate, | |||||
'quantity' => $productOrder->quantity | |||||
]; | |||||
} | |||||
} | |||||
$typePaymentTiller = ''; | |||||
if ($order->mean_payment == MeanPayment::MONEY) { | |||||
$typePaymentTiller = 'CASH'; | |||||
} | |||||
if ($order->mean_payment == MeanPayment::CREDIT_CARD | |||||
|| $order->mean_payment == MeanPayment::CREDIT | |||||
|| $order->mean_payment == MeanPayment::TRANSFER | |||||
|| $order->mean_payment == MeanPayment::OTHER) { | |||||
$typePaymentTiller = 'CARD'; | |||||
} | |||||
if ($order->mean_payment == MeanPayment::CHEQUE) { | |||||
$typePaymentTiller = 'BANK_CHECK'; | |||||
} | |||||
if (!strlen($typePaymentTiller) || !$order->mean_payment) { | |||||
$typePaymentTiller = 'CASH'; | |||||
} | |||||
if (!$this->isSynchronized($date, $order->id) || $force) { | |||||
// v3 | |||||
if($apiVersion == 'v3') { | |||||
$payments = []; | |||||
$amountPayment = round($this->orderSolver->getOrderAmountWithTax($order, Order::AMOUNT_PAID) * 100); | |||||
if($amountPayment) { | |||||
$payments[] = [ | |||||
'externalId' => ''.$order->id, | |||||
'amount' => $amountPayment | |||||
]; | |||||
} | } | ||||
$returnTiller = $this->tillerClient->postOrder([ | |||||
'externalId' => ''.$order->id, | |||||
'purchaseRequestType' => 'clickAndCollect', | |||||
'date' => $datetime->format(\DateTime::ATOM), | |||||
'order' => [ | |||||
'currencyCode' => 'EUR', | |||||
'itemLines' => $lines, | |||||
'payments' => $payments | |||||
] | |||||
]); | |||||
} | |||||
// v2 | |||||
else { | |||||
$returnTiller = $this->tillerClient->postOrder([ | |||||
'externalId' => $order->id, | |||||
'type' => 1, | |||||
'status' => 'IN_PROGRESS', | |||||
'openDate' => $strDate, | |||||
'closeDate' => $strDate, | |||||
'lines' => $lines, | |||||
'payments' => [ | |||||
[ | |||||
'type' => $typePaymentTiller, | |||||
'amount' => $this->orderSolver->getOrderAmountWithTax( | |||||
$order, | |||||
Order::AMOUNT_PAID | |||||
) * 100, | |||||
'status' => 'ACCEPTED', | |||||
'date' => $strDate | |||||
] | |||||
] | |||||
]); | |||||
} | |||||
$returnTillerObject = json_decode($returnTiller); | |||||
if($apiVersion == 'v3') { | |||||
$order->tiller_external_id = '' . $returnTillerObject->referenceId; | |||||
} | |||||
else { | |||||
$order->tiller_external_id = '' . $returnTillerObject->id; | |||||
} | } | ||||
$order->save(); | |||||
return $returnTiller; | |||||
} | } | ||||
return $return; | |||||
return null; | |||||
} | } | ||||
public function isSynchronized($date, $idOrder = null): bool | public function isSynchronized($date, $idOrder = null): bool |
{ | { | ||||
return [ | return [ | ||||
OrderStatus::ALIAS_ORDERED => [ | OrderStatus::ALIAS_ORDERED => [ | ||||
'label' => 'Créée' | |||||
'label' => 'Ajoutée' | |||||
], | ], | ||||
OrderStatus::ALIAS_UPDATED => [ | OrderStatus::ALIAS_UPDATED => [ | ||||
'label' => 'Modifiée' | 'label' => 'Modifiée' |
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use domain\Distribution\PointSaleDistribution\PointSaleDistribution; | use domain\Distribution\PointSaleDistribution\PointSaleDistribution; | ||||
use domain\PointSale\UserPointSale\UserPointSale; | use domain\PointSale\UserPointSale\UserPointSale; | ||||
use domain\Producer\Producer\Producer; | |||||
use domain\User\User\User; | use domain\User\User\User; | ||||
/** | /** | ||||
]; | ]; | ||||
} | } | ||||
public function getName(): string | |||||
{ | |||||
return $this->name; | |||||
} | |||||
public function getProducer(): Producer | |||||
{ | |||||
return $this->producerRelation; | |||||
} | |||||
/* | /* | ||||
* Relations | * Relations | ||||
*/ | */ | ||||
public function getProducerRelation() | |||||
{ | |||||
return $this->hasOne(Producer::class, ['id' => 'id_producer']); | |||||
} | |||||
public function getUserPointSale() | public function getUserPointSale() | ||||
{ | { | ||||
return $this->hasMany(UserPointSale::class, ['id_point_sale' => 'id']); | return $this->hasMany(UserPointSale::class, ['id_point_sale' => 'id']); |
use common\components\ActiveRecordCommon; | use common\components\ActiveRecordCommon; | ||||
use domain\PointSale\PointSale\PointSale; | use domain\PointSale\PointSale\PointSale; | ||||
use domain\Producer\Producer\Producer; | use domain\Producer\Producer\Producer; | ||||
use domain\User\User\User; | |||||
class SharedPointSale extends ActiveRecordCommon | class SharedPointSale extends ActiveRecordCommon | ||||
{ | { | ||||
/* Yii */ | |||||
public const SCENARIO_CONFIRM = 'confirm'; | |||||
public static function tableName() | |||||
{ | |||||
return 'shared_point_sale'; | |||||
} | |||||
public function rules() | |||||
{ | |||||
return [ | |||||
[['id_point_sale', 'id_producer_with_sharing', 'created_at', 'created_by'], 'required'], | |||||
['id_point_sale_with_sharing', 'required', 'on' => self::SCENARIO_CONFIRM], | |||||
[['id_point_sale', 'id_producer_with_sharing', 'id_point_sale_with_sharing', 'status', | |||||
'created_by', 'confirmed_by', 'declined_by'], 'integer'], | |||||
[['created_at', 'confirmed_at', 'declined_at'], 'safe'], | |||||
['id_point_sale', 'exist', 'targetClass' => PointSale::class, 'targetAttribute' => 'id'], | |||||
['id_point_sale_with_sharing', 'exist', 'targetClass' => PointSale::class, 'targetAttribute' => 'id'], | |||||
['id_producer_with_sharing', 'exist', 'targetClass' => Producer::class, 'targetAttribute' => 'id'], | |||||
[['created_by', 'confirmed_by', 'declined_by'], 'exist', 'targetClass' => User::class, 'targetAttribute' => 'id'], | |||||
]; | |||||
} | |||||
public function attributeLabels() | |||||
{ | |||||
return [ | |||||
'id_point_sale' => 'Point de vente', | |||||
'id_producer_with_sharing' => 'Producteur', | |||||
'id_point_sale_with_sharing' => 'Point de vente partagé', | |||||
]; | |||||
} | |||||
/* Get / Set */ | |||||
public function getId(): ?int | |||||
{ | |||||
return $this->id; | |||||
} | |||||
public function getPointSale(): PointSale | public function getPointSale(): PointSale | ||||
{ | { | ||||
return $this->pointSaleRelation; | return $this->pointSaleRelation; | ||||
public function getPointSaleWithSharing(): ?PointSale | public function getPointSaleWithSharing(): ?PointSale | ||||
{ | { | ||||
return $this->pointSaleWithSharing; | |||||
return $this->pointSaleWithSharingRelation; | |||||
} | } | ||||
public function setPointSaleWithSharing(PointSale $pointSaleWithSharing = null): self | public function setPointSaleWithSharing(PointSale $pointSaleWithSharing = null): self | ||||
return $this; | return $this; | ||||
} | } | ||||
public static function tableName() | |||||
public function getCreatedAt(): \DateTime | |||||
{ | { | ||||
return 'shared_point_sale'; | |||||
return new \DateTime($this->created_at); | |||||
} | } | ||||
public function rules() | |||||
public function setCreatedAt(\DateTime $createdAt): self | |||||
{ | { | ||||
return [ | |||||
[['id_point_sale', 'id_producer_with_sharing'], 'required'], | |||||
[['id_point_sale', 'id_producer_with_sharing', 'id_point_sale_with_sharing', 'status'], 'integer'], | |||||
]; | |||||
$this->created_at = $createdAt->format('Y-m-d H:i:s'); | |||||
return $this; | |||||
} | } | ||||
public function attributeLabels() | |||||
public function getConfirmedAt(): \DateTime | |||||
{ | { | ||||
return [ | |||||
'id_point_sale' => 'Point de vente que vous souhaitez partager', | |||||
'id_producer_with_sharing' => 'Producteur avec qui vous souhaitez partager un point de vente', | |||||
'id_point_sale_with_sharing' => 'Point de vente du producteur avec qui vous souhaitez partager un point de vente', | |||||
]; | |||||
return new \DateTime($this->confirmed_at); | |||||
} | |||||
public function setConfirmedAt(\DateTime $confirmedAt): self | |||||
{ | |||||
$this->confirmed_at = $confirmedAt->format('Y-m-d H:i:s'); | |||||
return $this; | |||||
} | |||||
public function getDeclinedAt(): \DateTime | |||||
{ | |||||
return new \DateTime($this->declined_at); | |||||
} | |||||
public function setDeclinedAt(\DateTime $declinedAt): self | |||||
{ | |||||
$this->declined_at = $declinedAt->format('Y-m-d H:i:s'); | |||||
return $this; | |||||
} | |||||
public function getCreatedBy(): User | |||||
{ | |||||
return $this->createdByRelation; | |||||
} | |||||
public function setCreatedBy(User $createdBy): SharedPointSale | |||||
{ | |||||
$this->populateFieldObject('created_by', 'createdByRelation', $createdBy); | |||||
return $this; | |||||
} | |||||
public function getConfirmedBy(): User | |||||
{ | |||||
return $this->confirmedByRelation; | |||||
} | |||||
public function setConfirmedBy(User $confirmedBy): SharedPointSale | |||||
{ | |||||
$this->populateFieldObject('confirmed_by', 'confirmedByRelation', $confirmedBy); | |||||
return $this; | |||||
} | |||||
public function getDeclinedBy(): User | |||||
{ | |||||
return $this->declinedByRelation; | |||||
} | |||||
public function setDeclinedBy(User $declinedBy): SharedPointSale | |||||
{ | |||||
$this->populateFieldObject('declined_by', 'declinedByRelation', $declinedBy); | |||||
return $this; | |||||
} | } | ||||
/* Relations */ | /* Relations */ | ||||
{ | { | ||||
return $this->hasOne(PointSale::class, ['id' => 'id_point_sale_with_sharing']); | return $this->hasOne(PointSale::class, ['id' => 'id_point_sale_with_sharing']); | ||||
} | } | ||||
public function getCreatedByRelation() | |||||
{ | |||||
return $this->hasOne(User::class, ['id' => 'created_by']); | |||||
} | |||||
public function getConfirmedByRelation() | |||||
{ | |||||
return $this->hasOne(User::class, ['id' => 'confirmed_by']); | |||||
} | |||||
public function getDeclinedByRelation() | |||||
{ | |||||
return $this->hasOne(User::class, ['id' => 'declined_by']); | |||||
} | |||||
} | } |
use domain\_\StatusInterface; | use domain\_\StatusInterface; | ||||
use domain\PointSale\PointSale\PointSale; | use domain\PointSale\PointSale\PointSale; | ||||
use domain\Producer\Producer\Producer; | use domain\Producer\Producer\Producer; | ||||
use domain\User\User\User; | |||||
class SharedPointSaleBuilder extends AbstractBuilder | class SharedPointSaleBuilder extends AbstractBuilder | ||||
{ | { | ||||
public function instanciateSharedPointSale(PointSale $pointSale, Producer $producerWithSharing): SharedPointSale | |||||
public function instanciateSharedPointSale(PointSale $pointSale = null, Producer $producerWithSharing = null, User $createdBy = null): SharedPointSale | |||||
{ | { | ||||
$sharedPointSale = new SharedPointSale(); | $sharedPointSale = new SharedPointSale(); | ||||
$sharedPointSale->setPointSale($pointSale); | |||||
$sharedPointSale->setProducerWithSharing($producerWithSharing); | |||||
if($pointSale) { | |||||
$sharedPointSale->setPointSale($pointSale); | |||||
} | |||||
if($producerWithSharing) { | |||||
$sharedPointSale->setProducerWithSharing($producerWithSharing); | |||||
} | |||||
if($createdBy) { | |||||
$sharedPointSale->setCreatedBy($createdBy); | |||||
} | |||||
$sharedPointSale->setCreatedAt(new \DateTime()); | |||||
$sharedPointSale->setStatus(StatusInterface::STATUS_ONLINE); | $sharedPointSale->setStatus(StatusInterface::STATUS_ONLINE); | ||||
return $sharedPointSale; | return $sharedPointSale; | ||||
} | } | ||||
public function initConfirmSharedPointSale(SharedPointSale $sharedPointSale, PointSale $pointSaleWithSharing, User $confirmedBy) | |||||
{ | |||||
$sharedPointSale->setPointSaleWithSharing($pointSaleWithSharing); | |||||
$sharedPointSale->setConfirmedBy($confirmedBy); | |||||
$sharedPointSale->setConfirmedAt(new \DateTime()); | |||||
} | |||||
public function initDeclineSharedPointSale(SharedPointSale $sharedPointSale, User $declinedBy) | |||||
{ | |||||
$sharedPointSale->setStatus(StatusInterface::STATUS_OFFLINE); | |||||
$sharedPointSale->setDeclinedBy($declinedBy); | |||||
$sharedPointSale->setDeclinedAt(new \DateTime()); | |||||
} | |||||
} | } |
use domain\_\AbstractManager; | use domain\_\AbstractManager; | ||||
use domain\PointSale\PointSale\PointSale; | use domain\PointSale\PointSale\PointSale; | ||||
use domain\Producer\Producer\Producer; | use domain\Producer\Producer\Producer; | ||||
use domain\User\User\User; | |||||
class SharedPointSaleManager extends AbstractManager | class SharedPointSaleManager extends AbstractManager | ||||
{ | { | ||||
$this->sharedPointSaleBuilder = $this->loadService(SharedPointSaleBuilder::class); | $this->sharedPointSaleBuilder = $this->loadService(SharedPointSaleBuilder::class); | ||||
} | } | ||||
public function createSharedPointSale(PointSale $pointSale, Producer $producerWithSharing) | |||||
public function createSharedPointSale(PointSale $pointSale, Producer $producerWithSharing, User $createdBy): SharedPointSale | |||||
{ | { | ||||
$sharedPointSale = $this->sharedPointSaleBuilder->instanciateSharedPointSale($pointSale, $producerWithSharing); | |||||
$sharedPointSale = $this->sharedPointSaleBuilder->instanciateSharedPointSale($pointSale, $producerWithSharing, $createdBy); | |||||
$this->sharedPointSaleBuilder->create($sharedPointSale); | $this->sharedPointSaleBuilder->create($sharedPointSale); | ||||
return $sharedPointSale; | |||||
} | |||||
public function confirmSharedPointSale(SharedPointSale $sharedPointSale, PointSale $pointSaleWithSharing, User $confirmedBy): bool | |||||
{ | |||||
$this->sharedPointSaleBuilder->initConfirmSharedPointSale($sharedPointSale, $pointSaleWithSharing, $confirmedBy); | |||||
return $this->sharedPointSaleBuilder->update($sharedPointSale); | |||||
} | |||||
public function declineSharedPointSale(SharedPointSale $sharedPointSale, User $declinedBy): bool | |||||
{ | |||||
$this->sharedPointSaleBuilder->initDeclineSharedPointSale($sharedPointSale, $declinedBy); | |||||
return $this->sharedPointSaleBuilder->update($sharedPointSale); | |||||
} | } | ||||
} | } |
return [ | return [ | ||||
SharedPointSaleDefinition::class, | SharedPointSaleDefinition::class, | ||||
SharedPointSaleBuilder::class, | SharedPointSaleBuilder::class, | ||||
SharedPointSaleRepository::class, | |||||
SharedPointSaleResolver::class, | |||||
SharedPointSaleManager::class | SharedPointSaleManager::class | ||||
]; | ]; | ||||
} | } | ||||
return SharedPointSaleBuilder::getInstance(); | return SharedPointSaleBuilder::getInstance(); | ||||
} | } | ||||
public function getRepository(): SharedPointSaleRepository | |||||
{ | |||||
return SharedPointSaleRepository::getInstance(); | |||||
} | |||||
public function getResolver(): SharedPointSaleResolver | |||||
{ | |||||
return SharedPointSaleResolver::getInstance(); | |||||
} | |||||
public function getManager(): SharedPointSaleManager | public function getManager(): SharedPointSaleManager | ||||
{ | { | ||||
return SharedPointSaleManager::getInstance(); | return SharedPointSaleManager::getInstance(); |
<?php | |||||
namespace domain\PointSale\SharedPointSale; | |||||
use domain\_\AbstractRepository; | |||||
use domain\PointSale\PointSale\PointSale; | |||||
class SharedPointSaleRepository extends AbstractRepository | |||||
{ | |||||
protected SharedPointSaleRepositoryQuery $sharedPointSaleRepositoryQuery; | |||||
public function loadDependencies(): void | |||||
{ | |||||
$this->loadQuery(SharedPointSaleRepositoryQuery::class); | |||||
} | |||||
public function getDefaultOptionsSearch(): array | |||||
{ | |||||
return [ | |||||
self::WITH => [], | |||||
self::JOIN_WITH => ['pointSaleRelation'], | |||||
self::ORDER_BY => '', | |||||
self::ATTRIBUTE_ID_PRODUCER => '' | |||||
]; | |||||
} | |||||
public function findOneSharedPointSaleById(int $id) | |||||
{ | |||||
return $this->createQuery() | |||||
->filterById($id) | |||||
->findOne(); | |||||
} | |||||
public function findSharedPointsSaleRequestsOfMe() | |||||
{ | |||||
return $this->createQuery() | |||||
->filterByProducerOfPointSale($this->getProducerContext()) | |||||
->filterIsRequest() | |||||
->find(); | |||||
} | |||||
public function findSharedPointsSaleRequestsOthers() | |||||
{ | |||||
return $this->createQuery() | |||||
->filterByProducerWithSharing($this->getProducerContext()) | |||||
->filterIsRequest() | |||||
->find(); | |||||
} | |||||
public function findSharedPointsSaleConfirmedByPointSale(PointSale $pointSale) | |||||
{ | |||||
return $this->createQuery() | |||||
->filterByPointSale($pointSale) | |||||
->filterIsConfirmed() | |||||
->find(); | |||||
} | |||||
} |
<?php | |||||
namespace domain\PointSale\SharedPointSale; | |||||
use domain\_\AbstractRepositoryQuery; | |||||
use domain\_\StatusInterface; | |||||
use domain\PointSale\PointSale\PointSale; | |||||
use domain\Producer\Producer\Producer; | |||||
class SharedPointSaleRepositoryQuery extends AbstractRepositoryQuery | |||||
{ | |||||
protected SharedPointSaleDefinition $sharedPointSaleDefinition; | |||||
public function loadDependencies(): void | |||||
{ | |||||
$this->loadDefinition(SharedPointSaleDefinition::class); | |||||
} | |||||
public function filterIsStatusOnline() | |||||
{ | |||||
$this->andWhere(['shared_point_sale.status' => StatusInterface::STATUS_ONLINE]); | |||||
return $this; | |||||
} | |||||
public function filterByProducerOfPointSale(Producer $producer): self | |||||
{ | |||||
$this->andWhere(['point_sale.id_producer' => $producer->id]); | |||||
return $this; | |||||
} | |||||
public function filterByProducerWithSharing(Producer $producer): self | |||||
{ | |||||
$this->andWhere(['id_producer_with_sharing' => $producer->id]); | |||||
return $this; | |||||
} | |||||
public function filterByPointSale(PointSale $pointSale) | |||||
{ | |||||
$this->andWhere('id_point_sale = :id_point_sale OR id_point_sale_with_sharing = :id_point_sale') | |||||
->addParams(['id_point_sale' => $pointSale->id]); | |||||
return $this; | |||||
} | |||||
public function filterIsRequest() | |||||
{ | |||||
$this->filterIsPointSaleWithSharingIsNull() | |||||
->filterIsStatusOnline(); | |||||
return $this; | |||||
} | |||||
public function filterIsConfirmed() | |||||
{ | |||||
$this->filterIsStatusOnline(); | |||||
$this->andWhere('id_point_sale_with_sharing IS NOT NULL AND confirmed_at IS NOT NULL'); | |||||
return $this; | |||||
} | |||||
public function filterIsPointSaleWithSharingIsNull(): self | |||||
{ | |||||
$this->andWhere('id_point_sale_with_sharing IS NULL'); | |||||
return $this; | |||||
} | |||||
} |
<?php | |||||
namespace domain\PointSale\SharedPointSale; | |||||
use common\helpers\GlobalParam; | |||||
use domain\_\AbstractResolver; | |||||
use domain\Distribution\Distribution\Distribution; | |||||
use domain\Distribution\Distribution\DistributionRepository; | |||||
use domain\Distribution\PointSaleDistribution\PointSaleDistributionRepository; | |||||
use domain\PointSale\PointSale\PointSale; | |||||
use domain\PointSale\PointSale\PointSaleRepository; | |||||
use yii\helpers\Html; | |||||
class SharedPointSaleResolver extends AbstractResolver | |||||
{ | |||||
protected PointSaleRepository $pointSaleRepository; | |||||
protected SharedPointSaleRepository $sharedPointSaleRepository; | |||||
protected PointSaleDistributionRepository $pointSaleDistributionRepository; | |||||
protected DistributionRepository $distributionRepository; | |||||
public function loadDependencies(): void | |||||
{ | |||||
$this->pointSaleRepository = $this->loadService(PointSaleRepository::class); | |||||
$this->sharedPointSaleRepository = $this->loadService(SharedPointSaleRepository::class); | |||||
$this->distributionRepository = $this->loadService(DistributionRepository::class); | |||||
$this->pointSaleDistributionRepository = $this->loadService(PointSaleDistributionRepository::class); | |||||
} | |||||
public function getPointsSaleSharedWithPointSale(PointSale $pointSale, Distribution $distribution = null, array &$pointsSaleSharedWithPointSaleArray = []): array | |||||
{ | |||||
$idProducerContext = $this->getProducerContextId(); | |||||
$sharedPointsSaleConfirmedArray = $this->sharedPointSaleRepository->findSharedPointsSaleConfirmedByPointSale($pointSale); | |||||
foreach($sharedPointsSaleConfirmedArray as $sharedPointSaleConfirmed) { | |||||
if ($sharedPointSaleConfirmed->getPointSale()->id != $pointSale->id | |||||
&& !in_array($sharedPointSaleConfirmed->getPointSale(), $pointsSaleSharedWithPointSaleArray) | |||||
&& $sharedPointSaleConfirmed->getPointSale()->getProducer()->id != $idProducerContext) { | |||||
$distributionProducer = null; | |||||
if($distribution) { | |||||
$distributionProducer = $this->distributionRepository | |||||
->setProducerContext($sharedPointSaleConfirmed->getPointSale()->getProducer()) | |||||
->findOneDistribution($distribution->date, true); | |||||
} | |||||
if(!$distribution || ($distributionProducer && $this->pointSaleDistributionRepository->findOnePointSaleDistribution($distributionProducer, $sharedPointSaleConfirmed->getPointSale(), true))) { | |||||
$pointsSaleSharedWithPointSaleArray[] = $sharedPointSaleConfirmed->getPointSale(); | |||||
$this->getPointsSaleSharedWithPointSale($sharedPointSaleConfirmed->getPointSale(), $distribution, $pointsSaleSharedWithPointSaleArray); | |||||
} | |||||
} | |||||
if ($sharedPointSaleConfirmed->getPointSaleWithSharing()->id != $pointSale->id | |||||
&& !in_array($sharedPointSaleConfirmed->getPointSaleWithSharing(), $pointsSaleSharedWithPointSaleArray) | |||||
&& $sharedPointSaleConfirmed->getProducerWithSharing()->id != $idProducerContext) { | |||||
$distributionProducer = null; | |||||
if($distribution) { | |||||
$distributionProducer = $this->distributionRepository | |||||
->setProducerContext($sharedPointSaleConfirmed->getProducerWithSharing()) | |||||
->findOneDistribution($distribution->date, true); | |||||
} | |||||
if(!$distribution || ($distributionProducer && $this->pointSaleDistributionRepository->findOnePointSaleDistribution($distributionProducer, $sharedPointSaleConfirmed->getPointSaleWithSharing(), true))) { | |||||
$pointsSaleSharedWithPointSaleArray[] = $sharedPointSaleConfirmed->getPointSaleWithSharing(); | |||||
$this->getPointsSaleSharedWithPointSale($sharedPointSaleConfirmed->getPointSaleWithSharing(), $distribution, $pointsSaleSharedWithPointSaleArray); | |||||
} | |||||
} | |||||
} | |||||
return array_unique($pointsSaleSharedWithPointSaleArray, SORT_REGULAR); | |||||
} | |||||
public function getProducersSharingPointSaleAsString(PointSale $pointSale, Distribution $distribution = null, string $separator = ', ', bool $withLink = false): string | |||||
{ | |||||
$pointsSaleSharedWithPointSaleArray = $this->getPointsSaleSharedWithPointSale($pointSale, $distribution); | |||||
return implode($separator, array_map( | |||||
function($pointSale) use ($withLink) { | |||||
$return = ''; | |||||
if($withLink) { | |||||
$return .= '<a href="'.\Yii::$app->urlManagerProducer->createUrl(['site/index', 'slug_producer' => $pointSale->getProducer()->slug]).'">'; | |||||
} | |||||
$return .= $pointSale->getProducer()->getName(); | |||||
if($withLink) { | |||||
$return .= '</a>'; | |||||
} | |||||
return $return; | |||||
}, | |||||
$pointsSaleSharedWithPointSaleArray) | |||||
); | |||||
} | |||||
public function countPointsSaleSharedWithPointSale(PointSale $pointSale): int | |||||
{ | |||||
return count($this->getPointsSaleSharedWithPointSale($pointSale)); | |||||
} | |||||
public function hasPointSaleSharedWithPointSale(PointSale $pointSale): bool | |||||
{ | |||||
return (bool) $this->countPointsSaleSharedWithPointSale($pointSale); | |||||
} | |||||
public function countPointsSaleShared(): int | |||||
{ | |||||
$count = 0; | |||||
$pointsSaleArray = $this->pointSaleRepository->findPointSales(); | |||||
foreach($pointsSaleArray as $pointSale) { | |||||
if($this->hasPointSaleSharedWithPointSale($pointSale)) { | |||||
$count ++; | |||||
} | |||||
} | |||||
return $count; | |||||
} | |||||
public function countSharedPointsSaleRequestsOthers(): int | |||||
{ | |||||
return count($this->sharedPointSaleRepository->findSharedPointsSaleRequestsOthers()); | |||||
} | |||||
} |
]; | ]; | ||||
} | } | ||||
public function getName(): string | |||||
{ | |||||
return $this->name; | |||||
} | |||||
/* | /* | ||||
* Relations | * Relations | ||||
*/ | */ |
/** | /** | ||||
* Retourne la liste des établissements pour l'initialisation d'une listesélective. | * Retourne la liste des établissements pour l'initialisation d'une listesélective. | ||||
*/ | */ | ||||
public function populateProducerDropdown(): array | |||||
public function populateProducerDropdown(bool $excludeProducerContext = false): array | |||||
{ | { | ||||
$producerContext = $this->getProducerContext(false); | |||||
$producers = $this->createQuery() | $producers = $this->createQuery() | ||||
->filterIsActive() | ->filterIsActive() | ||||
->orderBy('postcode, city ASC') | ->orderBy('postcode, city ASC') | ||||
$optionsProducers = []; | $optionsProducers = []; | ||||
foreach ($producers as $p) { | foreach ($producers as $p) { | ||||
$departmentCode = substr($p->postcode, 0, 2); | |||||
if (!key_exists('d' . $departmentCode, $dataProducers) && isset($departments[$departmentCode])) { | |||||
$dataProducers['d' . $departmentCode] = '<strong>' . $departments[$departmentCode] . '</strong>'; | |||||
$optionsProducers['d' . $departmentCode] = ['disabled' => true]; | |||||
} | |||||
if($excludeProducerContext && $producerContext && $producerContext->id != $p->id || !$excludeProducerContext) { | |||||
$departmentCode = substr($p->postcode, 0, 2); | |||||
if (!key_exists('d' . $departmentCode, $dataProducers) && isset($departments[$departmentCode])) { | |||||
$dataProducers['d' . $departmentCode] = '<strong>' . $departments[$departmentCode] . '</strong>'; | |||||
$optionsProducers['d' . $departmentCode] = ['disabled' => true]; | |||||
} | |||||
$dataProducers[$p->id] = '<span class="glyphicon glyphicon-lock"></span> ' . Html::encode( | |||||
$p->name | |||||
) . ' - ' . Html::encode($p->postcode) . ' ' . Html::encode( | |||||
$p->city | |||||
) . ' <span class="glyphicon glyphicon-lock"></span>'; | |||||
$dataProducers[$p->id] = '<span class="glyphicon glyphicon-lock"></span> ' . Html::encode( | |||||
$p->name | |||||
) . ' - ' . Html::encode($p->postcode) . ' ' . Html::encode( | |||||
$p->city | |||||
) . ' <span class="glyphicon glyphicon-lock"></span>'; | |||||
if (strlen($p->code)) { | |||||
$optionsProducers[$p->id] = ['class' => 'lock']; | |||||
if (strlen($p->code)) { | |||||
$optionsProducers[$p->id] = ['class' => 'lock']; | |||||
} | |||||
} | } | ||||
} | } | ||||
$userProducerModule = UserProducerModule::getInstance(); | $userProducerModule = UserProducerModule::getInstance(); | ||||
$userCurrent = GlobalParam::getCurrentUser(); | $userCurrent = GlobalParam::getCurrentUser(); | ||||
$this->setTitle('Passez commande auprès de producteurs locaux') ; | |||||
$this->setTitle('Passer commande auprès de producteurs locaux') ; | |||||
$this->setMeta('description', 'Trouvez des producteurs proches de chez vous et passez commande pour un jour et un lieu donné.') ; | $this->setMeta('description', 'Trouvez des producteurs proches de chez vous et passez commande pour un jour et un lieu donné.') ; | ||||
?> | ?> |
use common\helpers\Password; | use common\helpers\Password; | ||||
use domain\Config\Unit\UnitDefinition; | use domain\Config\Unit\UnitDefinition; | ||||
use domain\Distribution\Distribution\Distribution; | use domain\Distribution\Distribution\Distribution; | ||||
use domain\Feature\Feature\Feature; | |||||
use domain\Order\Order\Order; | use domain\Order\Order\Order; | ||||
use domain\Order\Order\OrderRepositoryQuery; | use domain\Order\Order\OrderRepositoryQuery; | ||||
use domain\Order\OrderStatus\OrderStatus; | use domain\Order\OrderStatus\OrderStatus; | ||||
return $jsonUser; | return $jsonUser; | ||||
} | } | ||||
private function ajaxInfosPointsSale($producer, $distribution = false) | |||||
private function ajaxInfosPointsSale($producer, $distribution = null) | |||||
{ | { | ||||
$pointSaleModule = $this->getPointSaleModule(); | $pointSaleModule = $this->getPointSaleModule(); | ||||
$producerModule = $this->getProducerModule(); | $producerModule = $this->getProducerModule(); | ||||
$pointSale['infos'] = $pointSaleModule->getSolver()->getStrInfosByDistribution($pointSaleObject, $distribution); | $pointSale['infos'] = $pointSaleModule->getSolver()->getStrInfosByDistribution($pointSaleObject, $distribution); | ||||
} | } | ||||
$pointSale['producers_sharing_point_sale_as_string'] = false; | |||||
if($this->getFeatureModule()->getChecker()->isEnabled(Feature::ALIAS_SHARED_POINT_SALE)) { | |||||
$pointSale['producers_sharing_point_sale_as_string'] = $this->getSharedPointSaleModule()->getResolver() | |||||
->getProducersSharingPointSaleAsString($pointSaleObject, $distribution, ', ', true); | |||||
} | |||||
$pointSale['position'] = $position; | $pointSale['position'] = $position; | ||||
$position++; | $position++; | ||||
} | } |
*/ | */ | ||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use domain\Feature\Feature\Feature; | |||||
use domain\Feature\Feature\FeatureModule; | |||||
use domain\Order\Order\Order; | use domain\Order\Order\Order; | ||||
use domain\Order\Order\OrderModule; | use domain\Order\Order\OrderModule; | ||||
use domain\PointSale\PointSale\PointSaleModule; | use domain\PointSale\PointSale\PointSaleModule; | ||||
use domain\PointSale\SharedPointSale\SharedPointSaleModule; | |||||
use domain\Producer\Producer\ProducerModule; | use domain\Producer\Producer\ProducerModule; | ||||
use yii\helpers\Html; | use yii\helpers\Html; | ||||
$orderModule = OrderModule::getInstance(); | $orderModule = OrderModule::getInstance(); | ||||
$pointSaleModule = PointSaleModule::getInstance(); | $pointSaleModule = PointSaleModule::getInstance(); | ||||
$producer = GlobalParam::getCurrentProducer() ; | $producer = GlobalParam::getCurrentProducer() ; | ||||
$featureModule = FeatureModule::getInstance(); | |||||
$sharedPointSaleModule = SharedPointSaleModule::getInstance(); | |||||
$this->setPageTitle('Confirmation de commande'); | $this->setPageTitle('Confirmation de commande'); | ||||
</div> | </div> | ||||
<?php endif; ?> | <?php endif; ?> | ||||
<?php if($featureModule->getChecker()->isEnabled(Feature::ALIAS_SHARED_POINT_SALE)): ?> | |||||
<?php $pointsSaleSharedWithPointSaleArray = $sharedPointSaleModule->getResolver()->getPointsSaleSharedWithPointSale($order->pointSale, $order->distribution); ?> | |||||
<?php if($pointsSaleSharedWithPointSaleArray && count($pointsSaleSharedWithPointSaleArray)): ?> | |||||
<div class="alert alert-info"> | |||||
<h4 class="alert-heading"> | |||||
<i class="bi bi-share"></i> | |||||
Commander chez d'autres producteurs présents à cette distribution<br /> | |||||
</h4> | |||||
<?php foreach($pointsSaleSharedWithPointSaleArray as $pointSaleSharedWithPointSale): ?> | |||||
<a href="<?= Yii::$app->urlManagerProducer->createAbsoluteUrl(['order/order', 'date' => date('Y-m-d', strtotime($order->distribution->date)), 'idPointSale' => $pointSaleSharedWithPointSale->id, 'slug_producer' => $pointSaleSharedWithPointSale->getProducer()->slug]) ?>"><?= Html::encode($pointSaleSharedWithPointSale->getProducer()->getName()) ?></a> | |||||
<?php endforeach; ?> | |||||
</div> | |||||
<?php endif; ?> | |||||
<?php endif; ?> | |||||
<div class="alert alert-info alert-order-summary"> | <div class="alert alert-info alert-order-summary"> | ||||
<h4 class="alert-heading"> | <h4 class="alert-heading"> | ||||
<i class="bi bi-list-check"></i> | <i class="bi bi-list-check"></i> |
<table id="points-sale" class="table table-striped" v-if="pointsSale.length"> | <table id="points-sale" class="table table-striped" v-if="pointsSale.length"> | ||||
<thead> | <thead> | ||||
<tr> | <tr> | ||||
<th>Point de vente</th> | |||||
<th><?= $producerModule->getPointSaleWording($producer); ?></th> | |||||
<th class="column-locality">Localité</th> | <th class="column-locality">Localité</th> | ||||
<th></th> | <th></th> | ||||
</tr> | </tr> | ||||
<div class="minimum-order-amount" v-if="pointSale.minimum_order_amount"> | <div class="minimum-order-amount" v-if="pointSale.minimum_order_amount"> | ||||
Montant minimum de commande : {{ formatPrice(pointSale.minimum_order_amount) }} | Montant minimum de commande : {{ formatPrice(pointSale.minimum_order_amount) }} | ||||
</div> | </div> | ||||
<div class="shared-point-sale-producers" v-if="pointSale.producers_sharing_point_sale_as_string"> | |||||
Autres producteurs présents : <span v-html="pointSale.producers_sharing_point_sale_as_string"></span> | |||||
</div> | |||||
</td> | </td> | ||||
<td class="column-locality">{{ pointSale.locality }}</td> | <td class="column-locality">{{ pointSale.locality }}</td> | ||||
<td class="actions"> | <td class="actions"> |
use common\helpers\Price; | use common\helpers\Price; | ||||
use domain\Distribution\Distribution\DistributionModule; | use domain\Distribution\Distribution\DistributionModule; | ||||
use domain\Distribution\PointSaleDistribution\PointSaleDistribution; | use domain\Distribution\PointSaleDistribution\PointSaleDistribution; | ||||
use domain\Feature\Feature\Feature; | |||||
use domain\PointSale\PointSale\PointSaleModule; | use domain\PointSale\PointSale\PointSaleModule; | ||||
use domain\Producer\Producer\Producer; | use domain\Producer\Producer\Producer; | ||||
use domain\Producer\Producer\ProducerModule; | use domain\Producer\Producer\ProducerModule; | ||||
$producerModule = ProducerModule::getInstance(); | $producerModule = ProducerModule::getInstance(); | ||||
$distributionModule = DistributionModule::getInstance(); | $distributionModule = DistributionModule::getInstance(); | ||||
$pointSaleModule = PointSaleModule::getInstance(); | $pointSaleModule = PointSaleModule::getInstance(); | ||||
$sharedPointSaleModule = $this->getSharedPointSaleModule(); | |||||
$featureChecker = $this->getFeatureModule()->getChecker(); | |||||
$producer = $this->context->getProducerCurrent(); | $producer = $this->context->getProducerCurrent(); | ||||
'attribute' => 'name', | 'attribute' => 'name', | ||||
'format' => 'raw', | 'format' => 'raw', | ||||
'contentOptions' => ['class' => 'name'], | 'contentOptions' => ['class' => 'name'], | ||||
'value' => function ($model) use ($pointSaleModule) { | |||||
'value' => function ($model) use ($pointSaleModule, $sharedPointSaleModule, $featureChecker) { | |||||
$html = '<span class="the-name">' . Html::encode($model->name) . '</span>'; | $html = '<span class="the-name">' . Html::encode($model->name) . '</span>'; | ||||
if (strlen($model->locality)) { | if (strlen($model->locality)) { | ||||
$html .= '<br />' . $pointSaleModule->getSolver()->getLocalityWithAddressTooltip($model); | $html .= '<br />' . $pointSaleModule->getSolver()->getLocalityWithAddressTooltip($model); | ||||
} | } | ||||
if($featureChecker->isEnabled(Feature::ALIAS_SHARED_POINT_SALE)) { | |||||
if($sharedPointSaleModule->getResolver()->countPointsSaleSharedWithPointSale($model)) { | |||||
$html .= '<div class="shared-point-sale-producers">Autres producteurs présents :<br />'; | |||||
$html .= $sharedPointSaleModule->getResolver()->getProducersSharingPointSaleAsString($model, null, ', ', true); | |||||
$html .= '</div>'; | |||||
} | |||||
} | |||||
return $html; | return $html; | ||||
} | } | ||||
], | ], |
.site-points-sale #points-sale .name .locality { | .site-points-sale #points-sale .name .locality { | ||||
color: gray; | color: gray; | ||||
} | } | ||||
/* line 17, ../sass/site/_points_sale.scss */ | |||||
/* line 15, ../sass/site/_points_sale.scss */ | |||||
.site-points-sale #points-sale .name .shared-point-sale-producers { | |||||
color: gray; | |||||
margin-top: 10px; | |||||
} | |||||
/* line 22, ../sass/site/_points_sale.scss */ | |||||
.site-points-sale #points-sale .days .block-day:not(:last-child) { | .site-points-sale #points-sale .days .block-day:not(:last-child) { | ||||
margin-bottom: 15px; | margin-bottom: 15px; | ||||
} | } | ||||
/* line 20, ../sass/site/_points_sale.scss */ | |||||
/* line 25, ../sass/site/_points_sale.scss */ | |||||
.site-points-sale #points-sale .days .block-day strong { | .site-points-sale #points-sale .days .block-day strong { | ||||
font-family: 'worksans_medium'; | font-family: 'worksans_medium'; | ||||
} | } | ||||
/* line 23, ../sass/site/_points_sale.scss */ | |||||
/* line 28, ../sass/site/_points_sale.scss */ | |||||
.site-points-sale #points-sale .days .block-day small { | .site-points-sale #points-sale .days .block-day small { | ||||
color: gray; | color: gray; | ||||
} | } | ||||
} | } | ||||
/* line 234, ../sass/order/_order.scss */ | /* line 234, ../sass/order/_order.scss */ | ||||
.order-order #main #app-order-order table#points-sale td.name .comment, | .order-order #main #app-order-order table#points-sale td.name .comment, | ||||
.order-order #main #app-order-order table#points-sale td.name .minimum-order-amount { | |||||
.order-order #main #app-order-order table#points-sale td.name .minimum-order-amount, | |||||
.order-order #main #app-order-order table#points-sale td.name .shared-point-sale-producers { | |||||
color: gray; | color: gray; | ||||
} | } | ||||
/* line 238, ../sass/order/_order.scss */ | |||||
/* line 239, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#points-sale td.name .comment a, | .order-order #main #app-order-order table#points-sale td.name .comment a, | ||||
.order-order #main #app-order-order table#points-sale td.name .minimum-order-amount a { | |||||
.order-order #main #app-order-order table#points-sale td.name .minimum-order-amount a, | |||||
.order-order #main #app-order-order table#points-sale td.name .shared-point-sale-producers a { | |||||
color: #ee6f42; | color: #ee6f42; | ||||
} | } | ||||
/* line 244, ../sass/order/_order.scss */ | |||||
/* line 245, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#points-sale td.actions { | .order-order #main #app-order-order table#points-sale td.actions { | ||||
width: 150px; | width: 150px; | ||||
} | } | ||||
/* line 246, ../sass/order/_order.scss */ | |||||
/* line 247, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#points-sale td.actions button { | .order-order #main #app-order-order table#points-sale td.actions button { | ||||
width: 100%; | width: 100%; | ||||
} | } | ||||
/* line 258, ../sass/order/_order.scss */ | |||||
/* line 259, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products { | .order-order #main #app-order-order table#products { | ||||
margin-bottom: 40px; | margin-bottom: 40px; | ||||
border-top: solid 1px #b7ab9b; | border-top: solid 1px #b7ab9b; | ||||
border-left: solid 1px #b7ab9b; | border-left: solid 1px #b7ab9b; | ||||
border-right: solid 1px #b7ab9b; | border-right: solid 1px #b7ab9b; | ||||
} | } | ||||
/* line 264, ../sass/order/_order.scss */ | |||||
/* line 265, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products thead { | .order-order #main #app-order-order table#products thead { | ||||
display: none; | display: none; | ||||
} | } | ||||
/* line 268, ../sass/order/_order.scss */ | |||||
/* line 269, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products td { | .order-order #main #app-order-order table#products td { | ||||
border-bottom: solid 1px #b7ab9b; | border-bottom: solid 1px #b7ab9b; | ||||
border-left: 0px none; | border-left: 0px none; | ||||
border-right: 0px none; | border-right: 0px none; | ||||
} | } | ||||
/* line 276, ../sass/order/_order.scss */ | |||||
/* line 277, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products tr.category-closed:hover td.category-name, | .order-order #main #app-order-order table#products tr.category-closed:hover td.category-name, | ||||
.order-order #main #app-order-order table#products tr.category-open td.category-name { | .order-order #main #app-order-order table#products tr.category-open td.category-name { | ||||
padding-left: 30px; | padding-left: 30px; | ||||
background-color: #f4efe8; | background-color: #f4efe8; | ||||
} | } | ||||
/* line 283, ../sass/order/_order.scss */ | |||||
/* line 284, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products td.category-name { | .order-order #main #app-order-order table#products td.category-name { | ||||
transition: all 0.1s linear; | transition: all 0.1s linear; | ||||
background-color: #f4efe8; | background-color: #f4efe8; | ||||
padding-top: 13px; | padding-top: 13px; | ||||
padding-left: 20px; | padding-left: 20px; | ||||
} | } | ||||
/* line 294, ../sass/order/_order.scss */ | |||||
/* line 295, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products td.category-name .bi-caret-down-fill, | .order-order #main #app-order-order table#products td.category-name .bi-caret-down-fill, | ||||
.order-order #main #app-order-order table#products td.category-name .bi-caret-right-fill { | .order-order #main #app-order-order table#products td.category-name .bi-caret-right-fill { | ||||
font-size: 15px; | font-size: 15px; | ||||
} | } | ||||
/* line 299, ../sass/order/_order.scss */ | |||||
/* line 300, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products td.category-name span.badge { | .order-order #main #app-order-order table#products td.category-name span.badge { | ||||
font-family: "worksans_bold"; | font-family: "worksans_bold"; | ||||
text-transform: uppercase; | text-transform: uppercase; | ||||
position: relative; | position: relative; | ||||
top: -3px; | top: -3px; | ||||
} | } | ||||
/* line 307, ../sass/order/_order.scss */ | |||||
/* line 308, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products td.category-name span.badge.bg-primary { | .order-order #main #app-order-order table#products td.category-name span.badge.bg-primary { | ||||
float: right; | float: right; | ||||
top: 2px; | top: 2px; | ||||
} | } | ||||
/* line 313, ../sass/order/_order.scss */ | |||||
/* line 314, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products td.category-name:hover { | .order-order #main #app-order-order table#products td.category-name:hover { | ||||
cursor: pointer; | cursor: pointer; | ||||
background-color: white; | background-color: white; | ||||
} | } | ||||
/* line 320, ../sass/order/_order.scss */ | |||||
/* line 321, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products td.photo img { | .order-order #main #app-order-order table#products td.photo img { | ||||
width: 75px; | width: 75px; | ||||
} | } | ||||
/* line 330, ../sass/order/_order.scss */ | |||||
/* line 331, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products .price-unit .decreasing-prices { | .order-order #main #app-order-order table#products .price-unit .decreasing-prices { | ||||
margin-top: 10px; | margin-top: 10px; | ||||
font-size: 10px; | font-size: 10px; | ||||
padding-bottom: 2px; | padding-bottom: 2px; | ||||
margin-bottom: 0px; | margin-bottom: 0px; | ||||
} | } | ||||
/* line 338, ../sass/order/_order.scss */ | |||||
/* line 339, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products .price-unit .decreasing-prices ul li { | .order-order #main #app-order-order table#products .price-unit .decreasing-prices ul li { | ||||
margin-bottom: 5px; | margin-bottom: 5px; | ||||
} | } | ||||
/* line 340, ../sass/order/_order.scss */ | |||||
/* line 341, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products .price-unit .decreasing-prices ul li strong { | .order-order #main #app-order-order table#products .price-unit .decreasing-prices ul li strong { | ||||
font-weight: bold; | font-weight: bold; | ||||
} | } | ||||
/* line 348, ../sass/order/_order.scss */ | |||||
/* line 349, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products .price-unit, .order-order #main #app-order-order table#products .price-total { | .order-order #main #app-order-order table#products .price-unit, .order-order #main #app-order-order table#products .price-total { | ||||
width: 135px; | width: 135px; | ||||
text-align: center; | text-align: center; | ||||
} | } | ||||
/* line 352, ../sass/order/_order.scss */ | |||||
/* line 353, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products .price-unit .price-infos, .order-order #main #app-order-order table#products .price-total .price-infos { | .order-order #main #app-order-order table#products .price-unit .price-infos, .order-order #main #app-order-order table#products .price-total .price-infos { | ||||
color: gray; | color: gray; | ||||
font-size: 13px; | font-size: 13px; | ||||
line-height: 15px; | line-height: 15px; | ||||
} | } | ||||
/* line 359, ../sass/order/_order.scss */ | |||||
/* line 360, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products tr.product-open td.price-total { | .order-order #main #app-order-order table#products tr.product-open td.price-total { | ||||
font-size: 1.1rem; | font-size: 1.1rem; | ||||
font-family: 'worksans_bold'; | font-family: 'worksans_bold'; | ||||
padding-top: 19px; | padding-top: 19px; | ||||
} | } | ||||
/* line 365, ../sass/order/_order.scss */ | |||||
/* line 366, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products .td-quantity { | .order-order #main #app-order-order table#products .td-quantity { | ||||
width: 175px; | width: 175px; | ||||
} | } | ||||
/* line 368, ../sass/order/_order.scss */ | |||||
/* line 369, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products .td-quantity input.quantity, | .order-order #main #app-order-order table#products .td-quantity input.quantity, | ||||
.order-order #main #app-order-order table#products .td-quantity .input-group-text { | .order-order #main #app-order-order table#products .td-quantity .input-group-text { | ||||
background-color: white; | background-color: white; | ||||
} | } | ||||
/* line 373, ../sass/order/_order.scss */ | |||||
/* line 374, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products .td-quantity input.quantity { | .order-order #main #app-order-order table#products .td-quantity input.quantity { | ||||
text-align: center; | text-align: center; | ||||
border: 0px none; | border: 0px none; | ||||
} | } | ||||
/* line 377, ../sass/order/_order.scss */ | |||||
/* line 378, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products .td-quantity .input-group-text { | .order-order #main #app-order-order table#products .td-quantity .input-group-text { | ||||
border: 0px none; | border: 0px none; | ||||
padding-right: 10px; | padding-right: 10px; | ||||
padding-left: 0px; | padding-left: 0px; | ||||
margin: 0px; | margin: 0px; | ||||
} | } | ||||
/* line 385, ../sass/order/_order.scss */ | |||||
/* line 386, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products .td-quantity .input-group-btn button { | .order-order #main #app-order-order table#products .td-quantity .input-group-btn button { | ||||
padding: 4px 5px 0px 5px; | padding: 4px 5px 0px 5px; | ||||
} | } | ||||
/* line 387, ../sass/order/_order.scss */ | |||||
/* line 388, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products .td-quantity .input-group-btn button .bi { | .order-order #main #app-order-order table#products .td-quantity .input-group-btn button .bi { | ||||
font-size: 1.5em; | font-size: 1.5em; | ||||
font-weight: bold; | font-weight: bold; | ||||
margin: 0px; | margin: 0px; | ||||
} | } | ||||
/* line 398, ../sass/order/_order.scss */ | |||||
/* line 399, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products tr.total .summary { | .order-order #main #app-order-order table#products tr.total .summary { | ||||
padding: 25px; | padding: 25px; | ||||
} | } | ||||
/* line 401, ../sass/order/_order.scss */ | |||||
/* line 402, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products tr.total .summary h3 { | .order-order #main #app-order-order table#products tr.total .summary h3 { | ||||
font-family: 'worksans_bold'; | font-family: 'worksans_bold'; | ||||
margin-top: 0px; | margin-top: 0px; | ||||
text-transform: uppercase; | text-transform: uppercase; | ||||
margin-bottom: 5px; | margin-bottom: 5px; | ||||
} | } | ||||
/* line 408, ../sass/order/_order.scss */ | |||||
/* line 409, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products tr.total .summary ul { | .order-order #main #app-order-order table#products tr.total .summary ul { | ||||
margin-bottom: 15px; | margin-bottom: 15px; | ||||
padding-left: 20px; | padding-left: 20px; | ||||
line-height: 1.4rem; | line-height: 1.4rem; | ||||
list-style-type: disc; | list-style-type: disc; | ||||
} | } | ||||
/* line 416, ../sass/order/_order.scss */ | |||||
/* line 417, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products tr.total .summary ul li .quantity { | .order-order #main #app-order-order table#products tr.total .summary ul li .quantity { | ||||
font-weight: bold; | font-weight: bold; | ||||
} | } | ||||
/* line 423, ../sass/order/_order.scss */ | |||||
/* line 424, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products tr.total .price-total { | .order-order #main #app-order-order table#products tr.total .price-total { | ||||
padding-top: 25px; | padding-top: 25px; | ||||
font-size: 1.5rem; | font-size: 1.5rem; | ||||
font-family: 'worksans_bold'; | font-family: 'worksans_bold'; | ||||
} | } | ||||
/* line 428, ../sass/order/_order.scss */ | |||||
/* line 429, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products tr.total .price-total span { | .order-order #main #app-order-order table#products tr.total .price-total span { | ||||
display: inline-block; | display: inline-block; | ||||
padding: 7px 15px; | padding: 7px 15px; | ||||
color: white; | color: white; | ||||
font-size: 1.2rem; | font-size: 1.2rem; | ||||
} | } | ||||
/* line 440, ../sass/order/_order.scss */ | |||||
/* line 441, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order #payment-methods .infos { | .order-order #main #app-order-order #payment-methods .infos { | ||||
margin-top: 10px; | margin-top: 10px; | ||||
color: gray; | color: gray; | ||||
} | } | ||||
/* line 447, ../sass/order/_order.scss */ | |||||
/* line 448, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order #content-step-payment .delivery { | .order-order #main #app-order-order #content-step-payment .delivery { | ||||
margin-bottom: 20px; | margin-bottom: 20px; | ||||
} | } | ||||
/* line 451, ../sass/order/_order.scss */ | |||||
/* line 452, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order #content-step-payment .comment { | .order-order #main #app-order-order #content-step-payment .comment { | ||||
margin-bottom: 20px; | margin-bottom: 20px; | ||||
} | } | ||||
/* line 455, ../sass/order/_order.scss */ | |||||
/* line 456, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order #content-step-payment #payment-methods { | .order-order #main #app-order-order #content-step-payment #payment-methods { | ||||
margin-bottom: 20px; | margin-bottom: 20px; | ||||
} | } | ||||
/* line 460, ../sass/order/_order.scss */ | |||||
/* line 461, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order #content-step-payment .credit .info { | .order-order #main #app-order-order #content-step-payment .credit .info { | ||||
margin-left: 20px; | margin-left: 20px; | ||||
color: gray; | color: gray; | ||||
} | } | ||||
/* line 473, ../sass/order/_order.scss */ | |||||
/* line 474, ../sass/order/_order.scss */ | |||||
#main #content .panel h3 { | #main #content .panel h3 { | ||||
font-family: "worksans_bold"; | font-family: "worksans_bold"; | ||||
margin: 0px; | margin: 0px; |
} | } | ||||
.comment, | .comment, | ||||
.minimum-order-amount { | |||||
.minimum-order-amount, | |||||
.shared-point-sale-producers{ | |||||
color: gray; | color: gray; | ||||
a { | a { |
.locality { | .locality { | ||||
color: gray; | color: gray; | ||||
} | } | ||||
.shared-point-sale-producers { | |||||
color: gray; | |||||
margin-top: 10px; | |||||
} | |||||
} | } | ||||
.days { | .days { | ||||
.block-day { | .block-day { |