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; |
</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)"> |
'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' => $featureChecker->isEnabled(Feature::ALIAS_SHARED_POINT_SALE), | |||||
'visible' => false, | |||||
'label' => 'Partages', | 'label' => 'Partages', | ||||
'format' => 'raw', | 'format' => 'raw', | ||||
'headerOptions' => ['class' => 'column-hide-on-mobile'], | 'headerOptions' => ['class' => 'column-hide-on-mobile'], | ||||
'contentOptions' => ['class' => 'td-shared-point-sale column-hide-on-mobile'], | 'contentOptions' => ['class' => 'td-shared-point-sale column-hide-on-mobile'], | ||||
'value' => function ($pointSale) use ($sharedPointSaleModule) { | 'value' => function ($pointSale) use ($sharedPointSaleModule) { | ||||
$countPointsSaleSharedWithPointSale = $sharedPointSaleModule->getResolver()->countPointsSaleSharedWithPointSale($pointSale); | $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()->getPointsSaleSharedWithPointSaleAsTitle($pointSale).'">'.$countPointsSaleSharedWithPointSale.' <span class="fa fa-share-alt"></span></a>'; | |||||
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>'; | |||||
} | } | ||||
], | ], | ||||
[ | [ |
'enableClientValidation' => false, | 'enableClientValidation' => false, | ||||
'action' => Yii::$app->urlManager->createUrl(['shared-point-sale/confirm', 'id' => $sharedPointSale->getId()]) | 'action' => Yii::$app->urlManager->createUrl(['shared-point-sale/confirm', 'id' => $sharedPointSale->getId()]) | ||||
]); ?> | ]); ?> | ||||
<div class="row"> | |||||
<div class="col-md-8"> | |||||
<?= $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>'); ?> | |||||
</div> | |||||
<div class="col-md-4"> | |||||
<br /> | |||||
<?= Html::submitButton('Confirmer', ['class' => 'btn btn-success', 'name' => 'save']) ?> | |||||
</div> | |||||
</div> | |||||
<?= $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(); ?> | <?php ActiveForm::end(); ?> | ||||
</td> | </td> | ||||
<td> | <td> | ||||
<div class="col-md-4"> | <div class="col-md-4"> | ||||
<div class="callout callout-info"> | <div class="callout callout-info"> | ||||
<span class="glyphicon glyphicon-info-sign"></span> | <span class="glyphicon glyphicon-info-sign"></span> | ||||
Cette fonctionnalité vous permet de partager des points de vente avec d'autres producteurs inscrits sur Souke.<br /> | |||||
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 | 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 | |||||
si vous avez une distribution de prévue ce jour-là.<br /> | |||||
Cela peut se révèler pratique quand vous faites des distributions en commun avec d'autres producteurs. | |||||
proposé aux clients de ce producteur quand ils passent commande sur le point de vente en partage. | |||||
</div> | </div> | ||||
</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; |
.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 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; | |||||
} | |||||
} | } |
namespace domain\PointSale\SharedPointSale; | namespace domain\PointSale\SharedPointSale; | ||||
use common\helpers\GlobalParam; | |||||
use domain\_\AbstractResolver; | 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\PointSale; | ||||
use domain\PointSale\PointSale\PointSaleRepository; | use domain\PointSale\PointSale\PointSaleRepository; | ||||
use yii\helpers\Html; | use yii\helpers\Html; | ||||
{ | { | ||||
protected PointSaleRepository $pointSaleRepository; | protected PointSaleRepository $pointSaleRepository; | ||||
protected SharedPointSaleRepository $sharedPointSaleRepository; | protected SharedPointSaleRepository $sharedPointSaleRepository; | ||||
protected PointSaleDistributionRepository $pointSaleDistributionRepository; | |||||
protected DistributionRepository $distributionRepository; | |||||
public function loadDependencies(): void | public function loadDependencies(): void | ||||
{ | { | ||||
$this->pointSaleRepository = $this->loadService(PointSaleRepository::class); | $this->pointSaleRepository = $this->loadService(PointSaleRepository::class); | ||||
$this->sharedPointSaleRepository = $this->loadService(SharedPointSaleRepository::class); | $this->sharedPointSaleRepository = $this->loadService(SharedPointSaleRepository::class); | ||||
$this->distributionRepository = $this->loadService(DistributionRepository::class); | |||||
$this->pointSaleDistributionRepository = $this->loadService(PointSaleDistributionRepository::class); | |||||
} | } | ||||
public function getPointsSaleSharedWithPointSale(PointSale $pointSale, array &$pointsSaleSharedWithPointSaleArray = []): array | |||||
public function getPointsSaleSharedWithPointSale(PointSale $pointSale, Distribution $distribution = null, array &$pointsSaleSharedWithPointSaleArray = []): array | |||||
{ | { | ||||
$idProducerContext = $this->getProducerContextId(); | $idProducerContext = $this->getProducerContextId(); | ||||
$sharedPointsSaleConfirmedArray = $this->sharedPointSaleRepository->findSharedPointsSaleConfirmedByPointSale($pointSale); | $sharedPointsSaleConfirmedArray = $this->sharedPointSaleRepository->findSharedPointsSaleConfirmedByPointSale($pointSale); | ||||
&& !in_array($sharedPointSaleConfirmed->getPointSale(), $pointsSaleSharedWithPointSaleArray) | && !in_array($sharedPointSaleConfirmed->getPointSale(), $pointsSaleSharedWithPointSaleArray) | ||||
&& $sharedPointSaleConfirmed->getPointSale()->getProducer()->id != $idProducerContext) { | && $sharedPointSaleConfirmed->getPointSale()->getProducer()->id != $idProducerContext) { | ||||
$pointsSaleSharedWithPointSaleArray[] = $sharedPointSaleConfirmed->getPointSale(); | |||||
$this->getPointsSaleSharedWithPointSale($sharedPointSaleConfirmed->getPointSale(), $pointsSaleSharedWithPointSaleArray); | |||||
$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 | if ($sharedPointSaleConfirmed->getPointSaleWithSharing()->id != $pointSale->id | ||||
&& !in_array($sharedPointSaleConfirmed->getPointSaleWithSharing(), $pointsSaleSharedWithPointSaleArray) | && !in_array($sharedPointSaleConfirmed->getPointSaleWithSharing(), $pointsSaleSharedWithPointSaleArray) | ||||
&& $sharedPointSaleConfirmed->getProducerWithSharing()->id != $idProducerContext) { | && $sharedPointSaleConfirmed->getProducerWithSharing()->id != $idProducerContext) { | ||||
$pointsSaleSharedWithPointSaleArray[] = $sharedPointSaleConfirmed->getPointSaleWithSharing(); | |||||
$this->getPointsSaleSharedWithPointSale($sharedPointSaleConfirmed->getPointSaleWithSharing(), $pointsSaleSharedWithPointSaleArray); | |||||
$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); | return array_unique($pointsSaleSharedWithPointSaleArray, SORT_REGULAR); | ||||
} | } | ||||
public function getPointsSaleSharedWithPointSaleAsTitle(PointSale $pointSale): string | |||||
public function getProducersSharingPointSaleAsString(PointSale $pointSale, Distribution $distribution = null, string $separator = ', ', bool $withLink = false): string | |||||
{ | { | ||||
$title = ''; | |||||
$pointsSaleSharedWithPointSale = $this->getPointsSaleSharedWithPointSale($pointSale); | |||||
foreach($pointsSaleSharedWithPointSale as $pointSaleShared) { | |||||
$title .= Html::encode($pointSaleShared->getProducer()->getName().' - '.$pointSaleShared->getName()).'
'; | |||||
} | |||||
return $title; | |||||
$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 | public function countPointsSaleSharedWithPointSale(PointSale $pointSale): int |
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 { |