} | } | ||||
$arrayCreditUser = []; | $arrayCreditUser = []; | ||||
if (isset($order->user) && isset($order->user->userProducer)) { | |||||
if (isset($order->user) && isset($order->user->userProducer) && isset($order->user->userProducer[0])) { | |||||
$arrayCreditUser['credit'] = $order->user->userProducer[0]->credit; | $arrayCreditUser['credit'] = $order->user->userProducer[0]->credit; | ||||
} | } | ||||
'selectedProductsArray' => $selectedProductsArray, | 'selectedProductsArray' => $selectedProductsArray, | ||||
'pointsSaleArray' => $pointsSaleArray, | 'pointsSaleArray' => $pointsSaleArray, | ||||
'productsArray' => $productsArray, | 'productsArray' => $productsArray, | ||||
'ordersArray' => $ordersArray | |||||
'ordersArray' => $ordersArray, | |||||
'producer' => Producer::searchOne(['id' => $idProducer]) | |||||
]); | ]); | ||||
$dateStr = date('d/m/Y', strtotime($date)); | $dateStr = date('d/m/Y', strtotime($date)); | ||||
} | } | ||||
} | } | ||||
if ($productsHasQuantity[$product->id] > 0 || $optionCsvExportAllProducts) { | if ($productsHasQuantity[$product->id] > 0 || $optionCsvExportAllProducts) { | ||||
$productName = $product->name ; | |||||
$productName = $product->getNameExport() ; | |||||
if($optionCsvExportByPiece) { | if($optionCsvExportByPiece) { | ||||
$productUnit = 'piece' ; | $productUnit = 'piece' ; |
$productOrder->save(); | $productOrder->save(); | ||||
} | } | ||||
} | } | ||||
$order->initReference() ; | |||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if($order) { | if($order) { | ||||
$order->initReference() ; | |||||
$order->setTillerSynchronization() ; | $order->setTillerSynchronization() ; | ||||
} | } | ||||
<?php | |||||
/** | |||||
* Copyright distrib (2018) | |||||
* | |||||
* contact@opendistrib.net | |||||
* | |||||
* 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 common\helpers\GlobalParam; | |||||
use common\models\Product; | |||||
use common\models\ProductCategory; | |||||
use common\models\UserGroup; | |||||
use common\models\UserUserGroup; | |||||
use Yii; | |||||
use yii\filters\AccessControl; | |||||
use common\models\PointSale; | |||||
use yii\data\ActiveDataProvider; | |||||
use yii\web\Controller; | |||||
use yii\web\NotFoundHttpException; | |||||
use yii\filters\VerbFilter; | |||||
use common\models\User; | |||||
use common\models\UserPointSale; | |||||
use common\models\Order; | |||||
use common\models\Producer; | |||||
use common\models\Distribution; | |||||
use yii\helpers\Html; | |||||
/** | |||||
* PointVenteController implements the CRUD actions for PointVente model. | |||||
*/ | |||||
class ProductCategoryController extends BackendController | |||||
{ | |||||
public function behaviors() | |||||
{ | |||||
return [ | |||||
'verbs' => [ | |||||
'class' => VerbFilter::className(), | |||||
'actions' => [ | |||||
], | |||||
], | |||||
'access' => [ | |||||
'class' => AccessControl::className(), | |||||
'rules' => [ | |||||
[ | |||||
'allow' => true, | |||||
'roles' => ['@'], | |||||
'matchCallback' => function ($rule, $action) { | |||||
return User::hasAccessBackend(); | |||||
} | |||||
], | |||||
], | |||||
], | |||||
]; | |||||
} | |||||
/** | |||||
* Liste les points de vente. | |||||
* | |||||
* @return mixed | |||||
*/ | |||||
public function actionIndex() | |||||
{ | |||||
$searchModel = new ProductCategorySearch(); | |||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams); | |||||
return $this->render('index', [ | |||||
'searchModel' => $searchModel, | |||||
'dataProvider' => $dataProvider, | |||||
]); | |||||
} | |||||
/** | |||||
* Crée une catégorie. | |||||
* | |||||
* @return mixed | |||||
*/ | |||||
public function actionCreate() | |||||
{ | |||||
$model = new ProductCategory(); | |||||
$model->id_producer = GlobalParam::getCurrentProducerId() ; | |||||
if ($model->load(Yii::$app->request->post()) && $model->save()) { | |||||
Yii::$app->getSession()->setFlash('success', "Catégorie ajoutée."); | |||||
return $this->redirect(['index']); | |||||
} | |||||
else { | |||||
return $this->render('create', [ | |||||
'model' => $model, | |||||
]); | |||||
} | |||||
} | |||||
/** | |||||
* Modifie une catégorie. | |||||
* | |||||
* @param integer $id | |||||
* @return mixed | |||||
*/ | |||||
public function actionUpdate($id) | |||||
{ | |||||
$model = $this->findModel($id); | |||||
if ($model->load(Yii::$app->request->post()) && $model->save()) { | |||||
Yii::$app->getSession()->setFlash('success', "Catégorie modifiée."); | |||||
return $this->redirect(['index']); | |||||
} | |||||
else { | |||||
return $this->render('update', [ | |||||
'model' => $model, | |||||
]); | |||||
} | |||||
} | |||||
/** | |||||
* Supprime une catégorie | |||||
* | |||||
* @param integer $id | |||||
* @return mixed | |||||
*/ | |||||
public function actionDelete($id) | |||||
{ | |||||
$productCategory = $this->findModel($id); | |||||
$productCategory->delete(); | |||||
Product::updateAll(['id_product_category' => null], ['id_product_category' => $id]); | |||||
Yii::$app->getSession()->setFlash('success', 'Catégorie <strong>' . Html::encode($productCategory->name) . '</strong> supprimée.'); | |||||
return $this->redirect(['index']); | |||||
} | |||||
/** | |||||
* Modifie l'ordre des catégories. | |||||
* | |||||
* @param array $array | |||||
*/ | |||||
public function actionPosition() | |||||
{ | |||||
$array = Yii::$app->request->post('array'); | |||||
$positionArray = json_decode(stripslashes($array)); | |||||
foreach ($positionArray as $id => $position) { | |||||
$category = $this->findModel($id); | |||||
$category->position = $position; | |||||
$category->save(); | |||||
} | |||||
} | |||||
/** | |||||
* Recherche une catégorie en fonction de son ID. | |||||
* | |||||
* @param integer $id | |||||
* @return ProductCategory | |||||
* @throws NotFoundHttpException si le modèle n'est pas trouvé | |||||
*/ | |||||
protected function findModel($id) | |||||
{ | |||||
if (($model = ProductCategory::findOne($id)) !== null) { | |||||
return $model; | |||||
} else { | |||||
throw new NotFoundHttpException('The requested page does not exist.'); | |||||
} | |||||
} | |||||
} |
$strUser = ''; | $strUser = ''; | ||||
// username | // username | ||||
$strUser = $order->getStrUser() ; | |||||
$strUser .= $order->getStrUser() ; | |||||
if(strlen($order->comment_point_sale)) | if(strlen($order->comment_point_sale)) | ||||
{ | { | ||||
$strUser .= '<br />' . $order->user->phone . ''; | $strUser .= '<br />' . $order->user->phone . ''; | ||||
} | } | ||||
// référence | |||||
if($producer->option_order_reference_type == Producer::ORDER_REFERENCE_TYPE_YEARLY && $order->reference && strlen($order->reference) > 0) { | |||||
$strUser .= '<br />'.$order->reference ; | |||||
} | |||||
$html .= '<td>'.$strUser.'</td>'; | $html .= '<td>'.$strUser.'</td>'; | ||||
// produits | // produits | ||||
foreach ($order->productOrder as $productOrder) { | foreach ($order->productOrder as $productOrder) { | ||||
if($product->id == $productOrder->id_product) { | if($product->id == $productOrder->id_product) { | ||||
$unit = (Product::strUnit($productOrder->unit, 'wording_short', true) == 'p.') ? '' : ' '.Product::strUnit($productOrder->unit, 'wording_short', true) ; | $unit = (Product::strUnit($productOrder->unit, 'wording_short', true) == 'p.') ? '' : ' '.Product::strUnit($productOrder->unit, 'wording_short', true) ; | ||||
$strProducts .= $product->name . ' (' .$productOrder->quantity .$unit.')<br />'; | |||||
$strProducts .= $product->getNameExport() . ' (' .$productOrder->quantity .$unit.')<br />'; | |||||
$add = true; | $add = true; | ||||
} | } | ||||
} | } | ||||
$quantity = Order::getProductQuantity($product->id, $pointSale->orders, false, $unit); | $quantity = Order::getProductQuantity($product->id, $pointSale->orders, false, $unit); | ||||
if ($quantity) { | if ($quantity) { | ||||
$theUnit = (Product::strUnit($unit, 'wording_short', true) == 'p.') ? '' : ' '.Product::strUnit($unit, 'wording_short', true) ; | $theUnit = (Product::strUnit($unit, 'wording_short', true) == 'p.') ? '' : ' '.Product::strUnit($unit, 'wording_short', true) ; | ||||
$strProducts .= $product->name . ' (' .$quantity .$theUnit.')<br />'; | |||||
$strProducts .= $product->getNameExport() . ' (' .$quantity .$theUnit.')<br />'; | |||||
} | } | ||||
} | } | ||||
$quantity = Order::getProductQuantity($product->id, $pointSale->orders, false, $unit); | $quantity = Order::getProductQuantity($product->id, $pointSale->orders, false, $unit); | ||||
if ($quantity) { | if ($quantity) { | ||||
$theUnit = (Product::strUnit($unit, 'wording_short', true) == 'p.') ? '' : ' '.Product::strUnit($unit, 'wording_short', true) ; | $theUnit = (Product::strUnit($unit, 'wording_short', true) == 'p.') ? '' : ' '.Product::strUnit($unit, 'wording_short', true) ; | ||||
$html .= $product->name . ' (' .$quantity .$theUnit.')<br />'; | |||||
$html .= $product->getNameExport() . ' (' .$quantity .$theUnit.')<br />'; | |||||
} | } | ||||
} | } | ||||
'items' => [ | 'items' => [ | ||||
['label' => 'Tableau de bord','icon' => 'dashboard','url' => ['/site/index'], 'visible' => User::isCurrentProducer()], | ['label' => 'Tableau de bord','icon' => 'dashboard','url' => ['/site/index'], 'visible' => User::isCurrentProducer()], | ||||
['label' => 'Distributions','icon' => 'calendar','url' => ['/distribution/index'], 'visible' => User::isCurrentProducer()], | ['label' => 'Distributions','icon' => 'calendar','url' => ['/distribution/index'], 'visible' => User::isCurrentProducer()], | ||||
['label' => 'Produits','icon' => 'clone','url' => ['/product/index'], 'visible' => User::isCurrentProducer(), 'active' => Yii::$app->controller->id == 'product'], | |||||
[ | |||||
'label' => 'Produits', | |||||
'icon' => 'clone', | |||||
'url' => '#', | |||||
'visible' => User::isCurrentProducer(), | |||||
'active' => Yii::$app->controller->id == 'product', | |||||
'items' => [ | |||||
['label' => 'Liste','icon' => 'th-list','url' => ['/product/index'], 'visible' => User::isCurrentProducer()], | |||||
['label' => 'Catégories','icon' => 'book','url' => ['/product-category/index'], 'visible' => User::isCurrentProducer()], | |||||
] | |||||
], | |||||
['label' => 'Points de vente','icon' => 'map-marker','url' => ['/point-sale/index'], 'visible' => User::isCurrentProducer(), 'active' => Yii::$app->controller->id == 'point-sale'], | ['label' => 'Points de vente','icon' => 'map-marker','url' => ['/point-sale/index'], 'visible' => User::isCurrentProducer(), 'active' => Yii::$app->controller->id == 'point-sale'], | ||||
//['label' => 'Utilisateurs','icon' => 'users','url' => ['/user/index'], 'visible' => User::isCurrentProducer(), 'active' => Yii::$app->controller->id == 'user'], | |||||
[ | [ | ||||
'label' => 'Utilisateurs', | 'label' => 'Utilisateurs', | ||||
'icon' => 'users', | 'icon' => 'users', |
0 => 'Non', | 0 => 'Non', | ||||
1 => 'Oui' | 1 => 'Oui' | ||||
], []); ?> | ], []); ?> | ||||
<?= $form->field($model, 'option_order_reference_type') | |||||
->dropDownList([ | |||||
Producer::ORDER_REFERENCE_TYPE_NONE => '--', | |||||
Producer::ORDER_REFERENCE_TYPE_YEARLY => 'Annuelle', | |||||
], []) ; ?> | |||||
<?= $form->field($model, 'option_export_display_product_reference') | |||||
->dropDownList([ | |||||
0 => 'Non', | |||||
1 => 'Oui' | |||||
], []); ?> | |||||
<?= $form->field($model, 'option_allow_order_guest') | |||||
->dropDownList([ | |||||
0 => 'Non', | |||||
1 => 'Oui' | |||||
], []); ?> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
<?php | |||||
/** | |||||
* Copyright distrib (2018) | |||||
* | |||||
* contact@opendistrib.net | |||||
* | |||||
* 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 yii\helpers\Html; | |||||
use yii\widgets\ActiveForm; | |||||
use yii\helpers\ArrayHelper; | |||||
use common\models\Producer; | |||||
use common\models\ProductPrice ; | |||||
/* @var $this yii\web\View */ | |||||
/* @var $model backend\models\PointVente */ | |||||
/* @var $form yii\widgets\ActiveForm */ | |||||
?> | |||||
<div class="product-category-form"> | |||||
<?php $form = ActiveForm::begin(); ?> | |||||
<div class="col-md-8"> | |||||
<?= $form->field($model, 'name')->textInput(['maxlength' => 255]) ?> | |||||
</div> | |||||
<div class="clr"></div> | |||||
<div class="form-group"> | |||||
<?= Html::submitButton($model->isNewRecord ? 'Ajouter' : 'Modifier', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> | |||||
</div> | |||||
<?php ActiveForm::end(); ?> | |||||
</div> |
<?php | |||||
/** | |||||
Copyright distrib (2018) | |||||
contact@opendistrib.net | |||||
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 yii\helpers\Html; | |||||
$this->setTitle("Ajouter une catégorie") ; | |||||
$this->addBreadcrumb(['label' => "Catégories", 'url' => ['index']]) ; | |||||
$this->addBreadcrumb('Ajouter') ; | |||||
?> | |||||
<div class="product-category-create"> | |||||
<?= $this->render('_form', [ | |||||
'model' => $model, | |||||
]) ?> | |||||
</div> |
<?php | |||||
/** | |||||
* Copyright distrib (2018) | |||||
* | |||||
* contact@opendistrib.net | |||||
* | |||||
* 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 yii\helpers\Html; | |||||
use yii\grid\GridView; | |||||
use common\models\PointVenteUser; | |||||
$this->setTitle('Catégories'); | |||||
$this->addBreadcrumb($this->getTitle()); | |||||
$this->addButton(['label' => 'Nouvelle catégorie <span class="glyphicon glyphicon-plus"></span>', 'url' => 'product-category/create', 'class' => 'btn btn-primary']); | |||||
?> | |||||
<div class="product-category-index"> | |||||
<?= GridView::widget([ | |||||
'filterModel' => $searchModel, | |||||
'dataProvider' => $dataProvider, | |||||
'columns' => [ | |||||
[ | |||||
'attribute' => 'position', | |||||
'headerOptions' => ['class' => 'position'], | |||||
'format' => 'raw', | |||||
'filter' => '', | |||||
'value' => function ($model) { | |||||
return '<a class="btn-position btn btn-default" href="javascript:void(0);"><span class="glyphicon glyphicon-resize-vertical"></span></a>'; | |||||
} | |||||
], | |||||
'name', | |||||
[ | |||||
'class' => 'yii\grid\ActionColumn', | |||||
'template' => '{update} {delete}', | |||||
'headerOptions' => ['class' => 'column-actions'], | |||||
'contentOptions' => ['class' => 'column-actions'], | |||||
'buttons' => [ | |||||
'update' => function ($url, $model) { | |||||
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [ | |||||
'title' => Yii::t('app', 'Modifier'), 'class' => 'btn btn-default' | |||||
]); | |||||
}, | |||||
'delete' => function ($url, $model) { | |||||
return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, [ | |||||
'title' => Yii::t('app', 'Supprimer'), 'class' => 'btn btn-default' | |||||
]); | |||||
} | |||||
], | |||||
], | |||||
], | |||||
]); ?> | |||||
</div> |
<?php | |||||
/** | |||||
Copyright distrib (2018) | |||||
contact@opendistrib.net | |||||
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 yii\helpers\Html; | |||||
$this->setTitle("Modifier un groupe d'utilisateur") ; | |||||
$this->addBreadcrumb(['label' => "Groupes d'utilisateurs", 'url' => ['index']]) ; | |||||
$this->addBreadcrumb(['label' => Html::encode($model->name), 'url' => ['update', 'id' => $model->id]]) ; | |||||
$this->addBreadcrumb('Modifier') ; | |||||
?> | |||||
<div class="user-group-update"> | |||||
<?= $this->render('_form', [ | |||||
'model' => $model, | |||||
]) ?> | |||||
</div> |
<div class="col-md-8"> | <div class="col-md-8"> | ||||
<?= $form->field($model, 'active')->radioList([1 => 'Oui', 0 => 'Non']) ?> | <?= $form->field($model, 'active')->radioList([1 => 'Oui', 0 => 'Non']) ?> | ||||
<?= $form->field($model, 'name')->textInput(['maxlength' => 255]) ?> | <?= $form->field($model, 'name')->textInput(['maxlength' => 255]) ?> | ||||
<?= $form->field($model, 'reference')->textInput(['maxlength' => 255]) ?> | |||||
<?= $form->field($model, 'id_product_category')->dropDownList(ProductCategory::populateDropdownList()); ?> | |||||
<?= $form->field($model, 'description')->textInput(['maxlength' => 255]) ?> | <?= $form->field($model, 'description')->textInput(['maxlength' => 255]) ?> | ||||
<?= $form->field($model, 'recipe')->textarea()->label('Description longue') ?> | <?= $form->field($model, 'recipe')->textarea()->label('Description longue') ?> | ||||
], | ], | ||||
'name', | 'name', | ||||
'description', | 'description', | ||||
[ | |||||
'attribute' => 'id_product_category', | |||||
'format' => 'raw', | |||||
'headerOptions' => ['class' => 'td-product-category'], | |||||
'filter' => '', | |||||
'value' => function ($model) { | |||||
if ($model->productCategory) { | |||||
return $model->productCategory->name ; | |||||
} | |||||
return ''; | |||||
} | |||||
], | |||||
[ | [ | ||||
'attribute' => 'id_tax_rate', | 'attribute' => 'id_tax_rate', | ||||
'value' => function ($model) { | 'value' => function ($model) { |
/* @var $form yii\widgets\ActiveForm */ | /* @var $form yii\widgets\ActiveForm */ | ||||
?> | ?> | ||||
<div class="point-sale-form"> | |||||
<div class="user-group-form"> | |||||
<?php $form = ActiveForm::begin(); ?> | <?php $form = ActiveForm::begin(); ?> | ||||
<div class="col-md-8"> | <div class="col-md-8"> |
opendistrib_points_vente_acces() ; | opendistrib_points_vente_acces() ; | ||||
opendistrib_tooltip() ; | opendistrib_tooltip() ; | ||||
opendistrib_ordre_produits() ; | opendistrib_ordre_produits() ; | ||||
opendistrib_ordre_categories() ; | |||||
opendistrib_products() ; | opendistrib_products() ; | ||||
opendistrib_product_prices() ; | opendistrib_product_prices() ; | ||||
opendistrib_confirm_delete() ; | opendistrib_confirm_delete() ; | ||||
$('#subscriptionform-date_begin, #subscriptionform-date_end').datepicker() ; | $('#subscriptionform-date_begin, #subscriptionform-date_end').datepicker() ; | ||||
} | } | ||||
function opendistrib_sortable_list(element_selector, button_selector, route_ajax) { | |||||
var fixHelper = function(e, ui) { | |||||
ui.children().each(function() { | |||||
$(this).width($(this).width()); | |||||
}); | |||||
return ui; | |||||
}; | |||||
$(element_selector+" table tbody").sortable({ | |||||
items: "> tr", | |||||
appendTo: "parent", | |||||
cursor: "move", | |||||
placeholder: "ui-state-highlight", | |||||
handle: button_selector, | |||||
helper: fixHelper, | |||||
stop: function(event, ui) { | |||||
var tab_ordre = {} ; | |||||
var ordre = 1 ; | |||||
if($('ul.pagination').size()) { | |||||
var page = parseInt($('ul.pagination li.active a').html()) ; | |||||
var nb_items_by_page = parseInt($('#page-size').html()) ; | |||||
if(page != 1) { | |||||
ordre = (page - 1) * nb_items_by_page ; | |||||
} | |||||
} | |||||
$(element_selector+" table tbody tr").each(function() { | |||||
tab_ordre[$(this).attr('data-key')] = ordre ; | |||||
ordre++ ; | |||||
}) ; | |||||
$.post(UrlManager.getBaseUrl() + route_ajax,{ | |||||
array: JSON.stringify(tab_ordre) | |||||
}) ; | |||||
} | |||||
}).disableSelection(); | |||||
} | |||||
function opendistrib_ordre_categories() { | |||||
opendistrib_sortable_list( | |||||
'.product-category-index', | |||||
'.btn-position', | |||||
'product-category/position' | |||||
) ; | |||||
} | |||||
function opendistrib_ordre_produits() { | function opendistrib_ordre_produits() { | ||||
var fixHelper = function(e, ui) { | |||||
opendistrib_sortable_list( | |||||
'.product-index', | |||||
'.btn-order', | |||||
'product/order' | |||||
) ; | |||||
/*var fixHelper = function(e, ui) { | |||||
ui.children().each(function() { | ui.children().each(function() { | ||||
$(this).width($(this).width()); | $(this).width($(this).width()); | ||||
}); | }); | ||||
array: JSON.stringify(tab_ordre) | array: JSON.stringify(tab_ordre) | ||||
}) ; | }) ; | ||||
} | } | ||||
}).disableSelection(); | |||||
}).disableSelection();*/ | |||||
} | } | ||||
function opendistrib_datepicker() { | function opendistrib_datepicker() { |
<p>Bonjour <?= Html::encode($user->name); ?>,</p> | <p>Bonjour <?= Html::encode($user->name); ?>,</p> | ||||
<p>Votre commande d'une valeur de <strong><?= $order->getAmountWithTax(Order::AMOUNT_TOTAL, true); ?></strong> a bien été prise en compte.</p> | |||||
<p>Votre commande <?= ($order->reference && strlen($order->reference) > 0) ? 'N°'.$order->reference : '' ?> d'une valeur de <strong><?= $order->getAmountWithTax(Order::AMOUNT_TOTAL, true); ?></strong> a bien été prise en compte.</p> | |||||
<p>Récapitulatif des produits commandés :</p> | |||||
<p><?= $order->getCartSummary() ?></p> | |||||
<p>Elle sera à retirer le <strong><?= date('d/m/Y',strtotime($distribution->date)) ?></strong> au point de retrait | <p>Elle sera à retirer le <strong><?= date('d/m/Y',strtotime($distribution->date)) ?></strong> au point de retrait | ||||
<strong><?= Html::encode($pointSale->name) ?></strong><?php if(strlen($pointSale->locality) > 0): ?> situé à <?= Html::encode($pointSale->locality) ?><?php endif ?>.</p> | <strong><?= Html::encode($pointSale->name) ?></strong><?php if(strlen($pointSale->locality) > 0): ?> situé à <?= Html::encode($pointSale->locality) ?><?php endif ?>.</p> |
Bonjour <?= $user->name; ?>, | Bonjour <?= $user->name; ?>, | ||||
Votre commande d'une valeur de <?= $order->getAmountWithTax(Order::AMOUNT_TOTAL, true); ?> a bien été prise en compte. | |||||
Votre commande <?= ($order->reference && strlen($order->reference) > 0) ? '<strong>N°'.$order->reference.'</strong>' : '' ?> d'une valeur de <?= $order->getAmountWithTax(Order::AMOUNT_TOTAL, true); ?> a bien été prise en compte. | |||||
Récapitulatif des produits commandés : | |||||
<?= $order->getCartSummary(false) ?> | |||||
Elle sera à retirer le <?= date('d/m/Y',strtotime($distribution->date)) ?> au point de retrait <?= $pointSale->name ?><?php if(strlen($pointSale->locality) > 0): ?> situé à <?= Html::encode($pointSale->locality) ?><?php endif ?>. | Elle sera à retirer le <?= date('d/m/Y',strtotime($distribution->date)) ?> au point de retrait <?= $pointSale->name ?><?php if(strlen($pointSale->locality) > 0): ?> situé à <?= Html::encode($pointSale->locality) ?><?php endif ?>. | ||||
[['id_user', 'date', 'status'], 'required', 'message' => ''], | [['id_user', 'date', 'status'], 'required', 'message' => ''], | ||||
[['id_user', 'id_point_sale', 'id_distribution', 'id_subscription', 'id_invoice', 'id_quotation', 'id_delivery_note'], 'integer'], | [['id_user', 'id_point_sale', 'id_distribution', 'id_subscription', 'id_invoice', 'id_quotation', 'id_delivery_note'], 'integer'], | ||||
[['auto_payment', 'tiller_synchronization'], 'boolean'], | [['auto_payment', 'tiller_synchronization'], 'boolean'], | ||||
[['status'], 'string'], | |||||
[['status', 'reference'], 'string'], | |||||
[['date', 'date_update', 'comment', 'comment_point_sale', 'mean_payment'], 'safe'] | [['date', 'date_update', 'comment', 'comment_point_sale', 'mean_payment'], 'safe'] | ||||
]; | ]; | ||||
} | } | ||||
'status' => 'Statut', | 'status' => 'Statut', | ||||
'id_invoice' => 'Facture', | 'id_invoice' => 'Facture', | ||||
'id_quotation' => 'Devis', | 'id_quotation' => 'Devis', | ||||
'id_delivery_note' => 'Bon de livraison' | |||||
'id_delivery_note' => 'Bon de livraison', | |||||
'reference' => 'Référence' | |||||
]; | ]; | ||||
} | } | ||||
* | * | ||||
* @return string | * @return string | ||||
*/ | */ | ||||
public function getCartSummary() | |||||
public function getCartSummary($htmlFormat = true) | |||||
{ | { | ||||
if (!isset($this->productOrder)) { | if (!isset($this->productOrder)) { | ||||
$this->productOrder = productOrder::find()->where(['id_order' => $this->id])->all(); | $this->productOrder = productOrder::find()->where(['id_order' => $this->id])->all(); | ||||
if (isset($p->product)) { | if (isset($p->product)) { | ||||
$html .= Html::encode($p->product->name) . ' (' . $p->quantity . ' ' . Product::strUnit($p->unit, 'wording_short', true) . ')'; | $html .= Html::encode($p->product->name) . ' (' . $p->quantity . ' ' . Product::strUnit($p->unit, 'wording_short', true) . ')'; | ||||
if (++$i != $count) { | if (++$i != $count) { | ||||
$html .= '<br />'; | |||||
if($htmlFormat) { | |||||
$html .= '<br />'; | |||||
} | |||||
else { | |||||
$html .= "\n"; | |||||
} | |||||
} | } | ||||
} | } | ||||
} | } | ||||
{ | { | ||||
$count = 0; | $count = 0; | ||||
if ($this->productOrder && is_array($this->productOrder)) { | if ($this->productOrder && is_array($this->productOrder)) { | ||||
foreach ($this->productOrder as $productOrder) { | |||||
if ($productOrder->unit == 'piece') { | |||||
$count++; | |||||
} else { | |||||
$count += $productOrder->quantity; | |||||
} | |||||
} | |||||
return count($this->productOrder) ; | |||||
} | } | ||||
return $count; | |||||
return 0; | |||||
} | } | ||||
/** | /** | ||||
} | } | ||||
} | } | ||||
public function initReference() | |||||
{ | |||||
$producer = GlobalParam::getCurrentProducer() ; | |||||
if($producer->option_order_reference_type == Producer::ORDER_REFERENCE_TYPE_YEARLY) | |||||
{ | |||||
$lastOrder = Order::find()->innerJoinWith('distribution', true) | |||||
->where(['>=', 'distribution.date', date('Y').'-01-01']) | |||||
->andWhere([ | |||||
'distribution.id_producer' => $producer->id | |||||
]) | |||||
->andWhere(['not', ['order.reference' => null]]) | |||||
->orderBy('order.id DESC') | |||||
->one() ; | |||||
if($lastOrder && $lastOrder->reference && strlen($lastOrder->reference) > 0) { | |||||
$pattern = '#A([0-9]+)C([0-9]+)#'; | |||||
preg_match($pattern, $lastOrder->reference, $matches, PREG_OFFSET_CAPTURE); | |||||
$sizeNumReference = strlen($matches[2][0]); | |||||
$numReference = ((int)$matches[2][0]) + 1; | |||||
$numReference = str_pad($numReference, $sizeNumReference, '0', STR_PAD_LEFT); | |||||
$this->reference = 'A'.$matches[1][0].'C'.$numReference ; | |||||
} | |||||
else { | |||||
$this->reference = 'A'.date('y').'C0001' ; | |||||
} | |||||
$this->save() ; | |||||
} | |||||
} | |||||
} | } |
const BEHAVIOR_ORDER_SELECT_DISTRIBUTION_CALENDAR = 'calendar' ; | const BEHAVIOR_ORDER_SELECT_DISTRIBUTION_CALENDAR = 'calendar' ; | ||||
const BEHAVIOR_ORDER_SELECT_DISTRIBUTION_LIST = 'list' ; | const BEHAVIOR_ORDER_SELECT_DISTRIBUTION_LIST = 'list' ; | ||||
const ORDER_REFERENCE_TYPE_NONE = '' ; | |||||
const ORDER_REFERENCE_TYPE_YEARLY = 'yearly' ; | |||||
var $secret_key_payplug; | var $secret_key_payplug; | ||||
/** | /** | ||||
} | } | ||||
}], | }], | ||||
[['description', 'mentions', 'gcs', 'order_infos', 'slug', 'secret_key_payplug', 'background_color_logo', 'option_behavior_cancel_order', 'tiller_provider_token', 'tiller_restaurant_token', 'status', | [['description', 'mentions', 'gcs', 'order_infos', 'slug', 'secret_key_payplug', 'background_color_logo', 'option_behavior_cancel_order', 'tiller_provider_token', 'tiller_restaurant_token', 'status', | ||||
'document_infos_bottom', 'document_infos_quotation', 'document_infos_invoice', 'document_infos_delivery_note', 'address', 'behavior_home_point_sale_day_list', 'behavior_order_select_distribution', 'option_payment_info'], 'string'], | |||||
[['negative_balance', 'credit', 'active', 'online_payment', 'user_manage_subscription', 'option_allow_user_gift', 'use_credit_checked_default', 'tiller', 'document_display_orders_invoice', 'document_display_orders_delivery_note', 'document_display_prices_delivery_note', 'option_email_confirm', 'option_email_confirm_producer', 'option_csv_export_all_products', 'option_csv_export_by_piece'], 'boolean'], | |||||
'document_infos_bottom', 'document_infos_quotation', 'document_infos_invoice', 'document_infos_delivery_note', 'address', 'behavior_home_point_sale_day_list', 'behavior_order_select_distribution', 'option_payment_info', 'option_order_reference_type'], 'string'], | |||||
[['negative_balance', 'credit', 'active', 'online_payment', 'user_manage_subscription', 'option_allow_user_gift', 'use_credit_checked_default', 'tiller', 'document_display_orders_invoice', 'document_display_orders_delivery_note', 'document_display_prices_delivery_note', 'option_email_confirm', 'option_email_confirm_producer', 'option_csv_export_all_products', 'option_csv_export_by_piece', 'option_export_display_product_reference', 'option_allow_order_guest'], 'boolean'], | |||||
[['name', 'siret', 'logo', 'photo', 'postcode', 'city', 'code', 'type', 'credit_functioning', 'option_behavior_cancel_order', 'document_quotation_prefix', 'document_quotation_first_reference', 'document_invoice_prefix', 'document_invoice_first_reference', 'document_delivery_note_prefix', 'document_delivery_note_first_reference'], 'string', 'max' => 255], | [['name', 'siret', 'logo', 'photo', 'postcode', 'city', 'code', 'type', 'credit_functioning', 'option_behavior_cancel_order', 'document_quotation_prefix', 'document_quotation_first_reference', 'document_invoice_prefix', 'document_invoice_first_reference', 'document_delivery_note_prefix', 'document_delivery_note_first_reference'], 'string', 'max' => 255], | ||||
[['free_price', 'credit_limit_reminder', 'credit_limit'], 'double'], | [['free_price', 'credit_limit_reminder', 'credit_limit'], 'double'], | ||||
['free_price', 'compare', 'compareValue' => 0, 'operator' => '>=', 'type' => 'number', 'message' => 'Prix libre doit être supérieur ou égal à 0'], | ['free_price', 'compare', 'compareValue' => 0, 'operator' => '>=', 'type' => 'number', 'message' => 'Prix libre doit être supérieur ou égal à 0'], | ||||
'option_dashboard_date_end' => 'Date de fin', | 'option_dashboard_date_end' => 'Date de fin', | ||||
'option_csv_export_all_products' => 'Exporter tous les produits dans le fichier récapitulatif (CSV)', | 'option_csv_export_all_products' => 'Exporter tous les produits dans le fichier récapitulatif (CSV)', | ||||
'option_csv_export_by_piece' => 'Exporter les produits par pièce dans le fichier récapitulatif (CSV)', | 'option_csv_export_by_piece' => 'Exporter les produits par pièce dans le fichier récapitulatif (CSV)', | ||||
'option_order_reference_type' => 'Type de référence', | |||||
'option_export_display_product_reference' => 'Afficher la référence des produits au moment de l\'export', | |||||
'option_allow_order_guest' => 'Autoriser les visiteurs à passer commande (création de compte à la fin du tunnel)', | |||||
]; | ]; | ||||
} | } | ||||
{ | { | ||||
return [ | return [ | ||||
[['name', 'id_producer'], 'required'], | [['name', 'id_producer'], 'required'], | ||||
[['active', 'order', 'id_producer', 'id_tax_rate'], 'integer'], | |||||
[['active', 'order', 'id_producer', 'id_tax_rate', 'id_product_category'], 'integer'], | |||||
[['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday', 'unavailable', 'apply_distributions'], 'boolean'], | [['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday', 'unavailable', 'apply_distributions'], 'boolean'], | ||||
[['price', 'weight', 'step', 'quantity_max', 'quantity_max_monday', 'quantity_max_tuesday', 'quantity_max_wednesday', 'quantity_max_thursday', 'quantity_max_friday', 'quantity_max_saturday', 'quantity_max_sunday'], 'number'], | [['price', 'weight', 'step', 'quantity_max', 'quantity_max_monday', 'quantity_max_tuesday', 'quantity_max_wednesday', 'quantity_max_thursday', 'quantity_max_friday', 'quantity_max_saturday', 'quantity_max_sunday'], 'number'], | ||||
[['photo'], 'file'], | [['photo'], 'file'], | ||||
[['name', 'description', 'photo', 'unit'], 'string', 'max' => 255], | |||||
[['name', 'reference', 'description', 'photo', 'unit'], 'string', 'max' => 255], | |||||
[['recipe'], 'string', 'max' => 1000], | [['recipe'], 'string', 'max' => 1000], | ||||
['step', 'required', 'message' => 'Champs obligatoire', 'when' => function ($model) { | ['step', 'required', 'message' => 'Champs obligatoire', 'when' => function ($model) { | ||||
if ($model->unit != 'piece') { | if ($model->unit != 'piece') { | ||||
return [ | return [ | ||||
'id' => 'ID', | 'id' => 'ID', | ||||
'name' => 'Nom', | 'name' => 'Nom', | ||||
'reference' => 'Référence', | |||||
'description' => 'Description', | 'description' => 'Description', | ||||
'active' => 'Actif', | 'active' => 'Actif', | ||||
'photo' => 'Photo', | 'photo' => 'Photo', | ||||
'apply_distributions' => 'Appliquer ces modifications dans les distributions futures', | 'apply_distributions' => 'Appliquer ces modifications dans les distributions futures', | ||||
'unit' => 'Unité', | 'unit' => 'Unité', | ||||
'step' => 'Pas', | 'step' => 'Pas', | ||||
'id_tax_rate' => 'TVA' | |||||
'id_tax_rate' => 'TVA', | |||||
'id_product_category' => 'Catégorie' | |||||
]; | ]; | ||||
} | } | ||||
return $this->hasMany(ProductPrice::className(), ['id_product' => 'id']); | return $this->hasMany(ProductPrice::className(), ['id_product' => 'id']); | ||||
} | } | ||||
public function getProductCategory() | |||||
{ | |||||
return $this->hasOne(ProductCategory::className(), ['id' => 'id_product_category']) ; | |||||
} | |||||
/** | /** | ||||
* Retourne les options de base nécessaires à la fonction de recherche. | * Retourne les options de base nécessaires à la fonction de recherche. | ||||
* | * | ||||
} | } | ||||
} | } | ||||
public function getNameExport() | |||||
{ | |||||
$producer = GlobalParam::getCurrentProducer() ; | |||||
if($producer->option_export_display_product_reference && $this->reference && strlen($this->reference) > 0) { | |||||
return $this->reference ; | |||||
} | |||||
return $this->name ; | |||||
} | |||||
} | } |
<?php | |||||
/** | |||||
* Copyright distrib (2018) | |||||
* | |||||
* contact@opendistrib.net | |||||
* | |||||
* 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 common\models; | |||||
use common\helpers\GlobalParam; | |||||
use Yii; | |||||
use common\components\ActiveRecordCommon; | |||||
/** | |||||
* This is the model class for table "user_group". | |||||
* | |||||
*/ | |||||
class ProductCategory extends ActiveRecordCommon | |||||
{ | |||||
/** | |||||
* @inheritdoc | |||||
*/ | |||||
public static function tableName() | |||||
{ | |||||
return 'product_category'; | |||||
} | |||||
/** | |||||
* @inheritdoc | |||||
*/ | |||||
public function rules() | |||||
{ | |||||
return [ | |||||
[['name'], 'required'], | |||||
[['name'], 'string'], | |||||
[['position'], 'integer'], | |||||
]; | |||||
} | |||||
/** | |||||
* @inheritdoc | |||||
*/ | |||||
public function attributeLabels() | |||||
{ | |||||
return [ | |||||
'name' => 'Nom', | |||||
'position' => 'Position' | |||||
]; | |||||
} | |||||
/** | |||||
* Retourne les options de base nécessaires à la fonction de recherche. | |||||
* | |||||
* @return array | |||||
*/ | |||||
public static function defaultOptionsSearch() | |||||
{ | |||||
return [ | |||||
'with' => [], | |||||
'join_with' => [], | |||||
'orderby' => '', | |||||
'attribute_id_producer' => '' | |||||
]; | |||||
} | |||||
public static function populateDropdownList() | |||||
{ | |||||
$productCategoriesArrayDropdown = ['' => '--']; | |||||
$productCategoriesArray = ProductCategory::find()->where('id_producer = ' . GlobalParam::getCurrentProducerId())->all(); | |||||
foreach ($productCategoriesArray as $productCategory) { | |||||
$productCategoriesArrayDropdown[$productCategory['id']] = $productCategory['name']; | |||||
} | |||||
return $productCategoriesArrayDropdown; | |||||
} | |||||
} |
<?php | |||||
/** | |||||
Copyright distrib (2018) | |||||
contact@opendistrib.net | |||||
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 common\models ; | |||||
use common\helpers\GlobalParam; | |||||
class ProductCategorySearch extends ProductCategory | |||||
{ | |||||
public function rules() | |||||
{ | |||||
return [ | |||||
[['name'], 'string'], | |||||
[['name'], 'string', 'max' => 255], | |||||
['id_producer', 'integer'], | |||||
]; | |||||
} | |||||
public function search($params) | |||||
{ | |||||
$optionsSearch = self::defaultOptionsSearch() ; | |||||
$query = ProductCategory::find() | |||||
->with($optionsSearch['with']) | |||||
->innerJoinWith($optionsSearch['join_with'], true) | |||||
->where(['product_category.id_producer' => GlobalParam::getCurrentProducerId()]) | |||||
->orderBy('product_category.position ASC') | |||||
; | |||||
$dataProvider = new ActiveDataProvider([ | |||||
'query' => $query, | |||||
'sort' => ['attributes' => ['name']], | |||||
'pagination' => [ | |||||
'pageSize' => 20, | |||||
], | |||||
]); | |||||
$this->load($params); | |||||
if (!$this->validate()) { | |||||
return $dataProvider; | |||||
} | |||||
$query->andFilterWhere(['like', 'product_category.name', $this->name]) ; | |||||
return $dataProvider; | |||||
} | |||||
} |
if (!$productsAdd) { | if (!$productsAdd) { | ||||
$order->delete(); | $order->delete(); | ||||
} | } | ||||
$order->initReference() ; | |||||
} | } | ||||
} | } | ||||
} | } |
<?php | |||||
use yii\db\Migration; | |||||
use yii\db\Schema; | |||||
class m210317_100235_product_category extends Migration | |||||
{ | |||||
public function safeUp() | |||||
{ | |||||
$this->createTable('product_category', [ | |||||
'id' => 'pk', | |||||
'id_producer' => Schema::TYPE_INTEGER . ' NOT NULL', | |||||
'name' => Schema::TYPE_STRING . ' NOT NULL', | |||||
'position' => Schema::TYPE_INTEGER . ' DEFAULT 0 NOT NULL', | |||||
]); | |||||
$this->addColumn('product', 'id_product_category', Schema::TYPE_INTEGER) ; | |||||
} | |||||
public function safeDown() | |||||
{ | |||||
$this->dropTable('product_category') ; | |||||
$this->dropColumn('product', 'id_product_category') ; | |||||
} | |||||
} |
<?php | |||||
use yii\db\Migration; | |||||
use yii\db\Schema; | |||||
class m210317_120805_reference_order extends Migration | |||||
{ | |||||
public function safeUp() | |||||
{ | |||||
$this->addColumn('order', 'reference', Schema::TYPE_STRING) ; | |||||
} | |||||
public function safeDown() | |||||
{ | |||||
$this->dropColumn('order', 'reference') ; | |||||
} | |||||
} |
<?php | |||||
use yii\db\Migration; | |||||
class m210317_122616_option_order_reference_type extends Migration | |||||
{ | |||||
public function safeUp() | |||||
{ | |||||
$this->addColumn('producer', 'option_order_reference_type', Schema::TYPE_STRING); | |||||
} | |||||
public function safeDown() | |||||
{ | |||||
$this->dropColumn('producer', 'option_order_reference_type'); | |||||
} | |||||
} |
<?php | |||||
use yii\db\Migration; | |||||
use yii\db\Schema; | |||||
class m210318_095733_add_product_reference extends Migration | |||||
{ | |||||
public function safeUp() | |||||
{ | |||||
$this->addColumn('product', 'reference', Schema::TYPE_STRING . ' DEFAULT NULL') ; | |||||
$this->addColumn('producer', 'option_export_display_product_reference', Schema::TYPE_BOOLEAN.' DEFAULT 0') ; | |||||
} | |||||
public function safeDown() | |||||
{ | |||||
$this->dropColumn('product', 'reference') ; | |||||
$this->dropColumn('producer', 'option_export_display_product_reference') ; | |||||
} | |||||
} |
<?php | |||||
use yii\db\Migration; | |||||
class m210318_102840_add_option_allow_order_guest extends Migration | |||||
{ | |||||
public function safeUp() | |||||
{ | |||||
$this->addColumn('producer', 'option_allow_order_guest', Schema::TYPE_BOOLEAN); | |||||
} | |||||
public function safeDown() | |||||
{ | |||||
$this->dropColumn('producer', 'option_allow_order_guest'); | |||||
} | |||||
} |
public function __construct() | public function __construct() | ||||
{ | { | ||||
parent::__construct() ; | parent::__construct() ; | ||||
$this->addAsset('js','js/jquery.validate.min.js') ; | |||||
$this->addAsset('js','js/vuejs/order-order.js') ; | $this->addAsset('js','js/vuejs/order-order.js') ; | ||||
} | } | ||||
} | } |
use common\helpers\Debug; | use common\helpers\Debug; | ||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\helpers\Mailjet; | use common\helpers\Mailjet; | ||||
use common\models\ProductCategory; | |||||
use common\models\ProductDistribution; | use common\models\ProductDistribution; | ||||
use common\models\User; | use common\models\User; | ||||
use common\models\Producer; | use common\models\Producer; | ||||
use common\models\Order; | use common\models\Order; | ||||
use common\models\UserPointSale; | use common\models\UserPointSale; | ||||
use common\models\Product; | use common\models\Product; | ||||
use common\models\UserProducer; | |||||
use DateTime; | use DateTime; | ||||
class OrderController extends ProducerBaseController | class OrderController extends ProducerBaseController | ||||
public function behaviors() | public function behaviors() | ||||
{ | { | ||||
return [ | |||||
return []; | |||||
/*return [ | |||||
'access' => [ | 'access' => [ | ||||
'class' => AccessControl::className(), | 'class' => AccessControl::className(), | ||||
'rules' => [ | 'rules' => [ | ||||
] | ] | ||||
], | ], | ||||
], | ], | ||||
]; | |||||
];*/ | |||||
} | } | ||||
public function actionOrder($id = 0, $date = '') | public function actionOrder($id = 0, $date = '') | ||||
{ | { | ||||
$params = []; | $params = []; | ||||
if ($id) { | if ($id) { | ||||
} | } | ||||
if ($order->load($posts)) { | if ($order->load($posts)) { | ||||
$user = User::getCurrent() ; | |||||
$order = Order::find() | $order = Order::find() | ||||
->where('id_distribution = :id_distribution') | ->where('id_distribution = :id_distribution') | ||||
->andWhere('id_user = :id_user') | ->andWhere('id_user = :id_user') | ||||
->params([ | ->params([ | ||||
':id_distribution' => $posts['Order']['id_distribution'], | ':id_distribution' => $posts['Order']['id_distribution'], | ||||
':id_user' => User::getCurrentId() | |||||
':id_user' => $user ? $user->id : null | |||||
]) | ]) | ||||
->one(); | ->one(); | ||||
} | } | ||||
} | } | ||||
else { | else { | ||||
// gestion user : option_allow_order_guest | |||||
if(isset($posts['user']) && $posts['user']) { | |||||
$user = User::searchOne([ | |||||
'email' => $posts['user']['email'] | |||||
]) ; | |||||
if(!$user) { | |||||
$user = new User ; | |||||
$user->id_producer = 0; | |||||
$password = Password::generate() ; | |||||
//$password = $posts['user']['password'] ; | |||||
$user->setPassword($password); | |||||
$user->generateAuthKey(); | |||||
$user->username = $posts['user']['email']; | |||||
$user->email = $posts['user']['email']; | |||||
$user->name = $posts['user']['firstname']; | |||||
$user->lastname = $posts['user']['lastname']; | |||||
$user->phone = $posts['user']['phone']; | |||||
$user->save() ; | |||||
// liaison etablissement / user | |||||
$userProducer = new UserProducer(); | |||||
$userProducer->id_user = $user->id; | |||||
$userProducer->id_producer = $idProducer; | |||||
$userProducer->credit = 0; | |||||
$userProducer->active = 1; | |||||
$userProducer->save(); | |||||
$user->sendMailWelcome($password); | |||||
} | |||||
} | |||||
$order = new Order; | $order = new Order; | ||||
$order->load(Yii::$app->request->post()); | $order->load(Yii::$app->request->post()); | ||||
$order->id_user = User::getCurrentId(); | |||||
$order->id_user = $user ? $user->id : null; | |||||
$order->status = 'tmp-order'; | $order->status = 'tmp-order'; | ||||
$order->date = date('Y-m-d H:i:s'); | $order->date = date('Y-m-d H:i:s'); | ||||
$order->origin = Order::ORIGIN_USER; | $order->origin = Order::ORIGIN_USER; | ||||
} | } | ||||
$errors = $this->processForm($order); | |||||
$errors = $this->processForm($order, $user); | |||||
if (count($errors)) { | if (count($errors)) { | ||||
return ['status' => 'error', 'errors' => $errors]; | return ['status' => 'error', 'errors' => $errors]; | ||||
* | * | ||||
* @param Commande $order | * @param Commande $order | ||||
*/ | */ | ||||
public function processForm($order) | |||||
public function processForm($order, $user) | |||||
{ | { | ||||
$posts = Yii::$app->request->post(); | $posts = Yii::$app->request->post(); | ||||
$productsArray = []; | $productsArray = []; | ||||
$userProducer = UserProducer::searchOne([ | $userProducer = UserProducer::searchOne([ | ||||
'id_producer' => $order->distribution->id_producer, | 'id_producer' => $order->distribution->id_producer, | ||||
'id_user' => User::getCurrentId() | |||||
'id_user' => $user->id | |||||
]); | ]); | ||||
// gestion point de vente | // gestion point de vente | ||||
$order->changeOrderStatus('new-order', 'user'); | $order->changeOrderStatus('new-order', 'user'); | ||||
// ajout de l'utilisateur à l'établissement | // ajout de l'utilisateur à l'établissement | ||||
Producer::addUser(User::getCurrentId(), $distribution->id_producer); | |||||
Producer::addUser($user->id, $distribution->id_producer); | |||||
// suppression de tous les enregistrements ProductOrder | // suppression de tous les enregistrements ProductOrder | ||||
if (!is_null($order)) { | if (!is_null($order)) { | ||||
} | } | ||||
// lien utilisateur / point de vente | // lien utilisateur / point de vente | ||||
$pointSale->linkUser(User::getCurrentId()); | |||||
$pointSale->linkUser($user->id); | |||||
// credit | // credit | ||||
$credit = Producer::getConfig('credit'); | $credit = Producer::getConfig('credit'); | ||||
$creditLimit = Producer::getConfig('credit_limit'); | $creditLimit = Producer::getConfig('credit_limit'); | ||||
$creditFunctioning = $pointSale->getCreditFunctioning(); | $creditFunctioning = $pointSale->getCreditFunctioning(); | ||||
$creditUser = Yii::$app->user->identity->getCredit($distribution->id_producer); | |||||
$creditUser = $user->getCredit($distribution->id_producer); | |||||
$order = Order::searchOne([ | $order = Order::searchOne([ | ||||
'id' => $order->id | 'id' => $order->id | ||||
]); | ]); | ||||
$order->changeOrderStatus('waiting-paiement-on-delivery', 'user'); | $order->changeOrderStatus('waiting-paiement-on-delivery', 'user'); | ||||
} | } | ||||
$user = User::getCurrent() ; | |||||
$paramsEmail = [ | $paramsEmail = [ | ||||
'from_email' => $producer->getEmailOpendistrib(), | 'from_email' => $producer->getEmailOpendistrib(), | ||||
'from_name' => $producer->name, | 'from_name' => $producer->name, | ||||
] | ] | ||||
] ; | ] ; | ||||
/* | /* | ||||
* Envoi email de confirmation | * Envoi email de confirmation | ||||
*/ | */ | ||||
} | } | ||||
$order->setTillerSynchronization() ; | $order->setTillerSynchronization() ; | ||||
$order->initReference() ; | |||||
} | } | ||||
'credit' => $producer->credit, | 'credit' => $producer->credit, | ||||
'credit_functioning' => $producer->credit_functioning, | 'credit_functioning' => $producer->credit_functioning, | ||||
'use_credit_checked_default' => $producer->use_credit_checked_default, | 'use_credit_checked_default' => $producer->use_credit_checked_default, | ||||
'credit_limit' => is_numeric($producer->credit_limit) ? $producer->credit_limit : null | |||||
'credit_limit' => is_numeric($producer->credit_limit) ? $producer->credit_limit : null, | |||||
'option_allow_order_guest' => $producer->option_allow_order_guest, | |||||
]; | ]; | ||||
// Distributions | // Distributions | ||||
$json['distributions'] = $distributionsArray; | $json['distributions'] = $distributionsArray; | ||||
// Commandes de l'utilisateur | // Commandes de l'utilisateur | ||||
$ordersUserArray = Order::searchAll([ | |||||
'id_user' => User::getCurrentId() | |||||
], [ | |||||
'conditions' => [ | |||||
'distribution.date > :date' | |||||
], | |||||
'params' => [ | |||||
':date' => $dateMini | |||||
] | |||||
]); | |||||
$ordersUserArray = [] ; | |||||
if(User::getCurrentId()) { | |||||
$ordersUserArray = Order::searchAll([ | |||||
'id_user' => User::getCurrentId() | |||||
], [ | |||||
'conditions' => [ | |||||
'distribution.date > :date' | |||||
], | |||||
'params' => [ | |||||
':date' => $dateMini | |||||
] | |||||
]); | |||||
} | |||||
if (is_array($ordersUserArray) && count($ordersUserArray)) { | if (is_array($ordersUserArray) && count($ordersUserArray)) { | ||||
foreach ($ordersUserArray as &$order) { | foreach ($ordersUserArray as &$order) { | ||||
$order = array_merge($order->getAttributes(), [ | $order = array_merge($order->getAttributes(), [ | ||||
'id_user' => User::getCurrentId() | 'id_user' => User::getCurrentId() | ||||
]); | ]); | ||||
$json['user'] = [ | |||||
'credit' => $userProducer->credit, | |||||
'credit_active' => $userProducer->credit_active, | |||||
]; | |||||
$json['user'] = false ; | |||||
if($userProducer) { | |||||
$json['user'] = [ | |||||
'credit' => $userProducer->credit, | |||||
'credit_active' => $userProducer->credit_active, | |||||
]; | |||||
} | |||||
if ($dateObject && $dateObject->format($format) === $date) { | if ($dateObject && $dateObject->format($format) === $date) { | ||||
// Commande de l'utilisateur | // Commande de l'utilisateur | ||||
$orderUser = Order::searchOne([ | |||||
'distribution.date' => $date, | |||||
'id_user' => User::getCurrentId(), | |||||
]); | |||||
$orderUser = false ; | |||||
if(User::getCurrentId()) { | |||||
$orderUser = Order::searchOne([ | |||||
'distribution.date' => $date, | |||||
'id_user' => User::getCurrentId(), | |||||
]); | |||||
} | |||||
if ($orderUser) { | if ($orderUser) { | ||||
$json['order'] = array_merge($orderUser->getAttributes(), [ | $json['order'] = array_merge($orderUser->getAttributes(), [ | ||||
} | } | ||||
} | } | ||||
$favoritePointSale = User::getCurrent()->getFavoritePointSale(); | |||||
$favoritePointSale = false ; | |||||
if(User::getCurrent()) { | |||||
$favoritePointSale = User::getCurrent()->getFavoritePointSale(); | |||||
} | |||||
if ($favoritePointSale) { | if ($favoritePointSale) { | ||||
for ($i = 0; $i < count($pointsSaleArray); $i++) { | for ($i = 0; $i < count($pointsSaleArray); $i++) { | ||||
'distribution.date' => $date, | 'distribution.date' => $date, | ||||
]); | ]); | ||||
// Catégories | |||||
$categoriesArray = ProductCategory::searchAll([], ['orderby' => 'product_category.position ASC', 'as_array' => true]) ; | |||||
array_unshift($categoriesArray, ['id' => null, 'name' => 'Catégorie par défaut']) ; | |||||
$json['categories'] = $categoriesArray ; | |||||
// Produits | // Produits | ||||
$productsArray = Product::find() | $productsArray = Product::find() | ||||
->where([ | ->where([ | ||||
public function actionConfirm($idOrder) | public function actionConfirm($idOrder) | ||||
{ | { | ||||
$order = Order::searchOne(['id' => $idOrder]); | $order = Order::searchOne(['id' => $idOrder]); | ||||
$producer = $this->getProducer() ; | |||||
if (!$order || $order->id_user != User::getCurrentId()) { | |||||
if (!$order || ($order->id_user != User::getCurrentId() && !$producer->option_allow_order_guest)) { | |||||
throw new \yii\base\UserException('Commande introuvable.'); | throw new \yii\base\UserException('Commande introuvable.'); | ||||
} | } | ||||
[ | [ | ||||
'label' => '<span class="glyphicon glyphicon-plus"></span> Commander', | 'label' => '<span class="glyphicon glyphicon-plus"></span> Commander', | ||||
'url' => Yii::$app->urlManager->createUrl(['order/order']), | 'url' => Yii::$app->urlManager->createUrl(['order/order']), | ||||
'visible' => !Yii::$app->user->isGuest, | |||||
'visible' => $producer->option_allow_order_guest || !Yii::$app->user->isGuest, | |||||
'active' => $this->getControllerAction() == 'order/order', | 'active' => $this->getControllerAction() == 'order/order', | ||||
], | ], | ||||
[ | [ | ||||
'label' => '<span class="glyphicon glyphicon-plus"></span> Commander', | 'label' => '<span class="glyphicon glyphicon-plus"></span> Commander', | ||||
'url' => Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/producer', 'id' => $this->context->getProducer()->id, 'return_url' => Yii::$app->urlManagerProducer->createAbsoluteUrl(['order/order', 'slug_producer' => $this->context->getProducer()->slug])]), | 'url' => Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/producer', 'id' => $this->context->getProducer()->id, 'return_url' => Yii::$app->urlManagerProducer->createAbsoluteUrl(['order/order', 'slug_producer' => $this->context->getProducer()->slug])]), | ||||
'visible' => Yii::$app->user->isGuest, | |||||
'visible' => !$producer->option_allow_order_guest && Yii::$app->user->isGuest, | |||||
'active' => $this->getControllerAction() == 'order/order', | 'active' => $this->getControllerAction() == 'order/order', | ||||
], | ], | ||||
[ | [ |
use common\helpers\GlobalParam ; | use common\helpers\GlobalParam ; | ||||
$this->setTitle('Confirmation de commande') ; | $this->setTitle('Confirmation de commande') ; | ||||
$producer = GlobalParam::getCurrentProducer() ; | $producer = GlobalParam::getCurrentProducer() ; | ||||
?> | ?> | ||||
<div id="order-success"> | <div id="order-success"> | ||||
<span class="glyphicon glyphicon-ok glyphicon-big"></span> | <span class="glyphicon glyphicon-ok glyphicon-big"></span> | ||||
<div class="content"> | <div class="content"> | ||||
<h3>Votre commande a bien été prise en compte</h3> | <h3>Votre commande a bien été prise en compte</h3> | ||||
<a href="<?= Yii::$app->urlManagerProducer->createUrl(['order/history']) ?>" class="btn btn-default"> | |||||
<span class="glyphicon glyphicon-chevron-right"></span> | |||||
Voir toutes mes commandes | |||||
</a> | |||||
<?php if(!Yii::$app->user->isGuest): ?> | |||||
<a href="<?= Yii::$app->urlManagerProducer->createUrl(['order/history']) ?>" class="btn btn-default"> | |||||
<span class="glyphicon glyphicon-chevron-right"></span> | |||||
Voir toutes mes commandes | |||||
</a> | |||||
<?php endif; ?> | |||||
</div> | </div> | ||||
<div class="clr"></div> | <div class="clr"></div> | ||||
</div> | </div> | ||||
<div class="alert alert-info"> | |||||
<div class="alert alert-info alert-order-summary"> | |||||
<span class="glyphicon glyphicon-list-alt glyphicon-big"></span> | <span class="glyphicon glyphicon-list-alt glyphicon-big"></span> | ||||
<div class="content"> | <div class="content"> | ||||
<h3>Récapitulatif de votre commande</h3> | <h3>Récapitulatif de votre commande</h3> | ||||
<ul> | |||||
<li><span class="glyphicon glyphicon-time"></span><?= date('d/m/Y',strtotime($order->distribution->date)) ?></li> | |||||
<li><span class="glyphicon glyphicon-map-marker"></span><?= Html::encode($order->pointSale->name) ?><?php if(strlen($order->pointSale->name)): ?> <span class="locality">à <?= Html::encode($order->pointSale->locality) ?></span><?php endif; ?></li> | |||||
<li><span class="glyphicon glyphicon-th-list"></span><?= $order->countProducts(); ?> produit<?php if($order->countProducts() > 1): ?>s<?php endif; ?></li> | |||||
<li><span class="glyphicon glyphicon-chevron-right"></span><?= $order->getAmountWithTax(Order::AMOUNT_TOTAL, true); ?></li> | |||||
</ul> | |||||
<div class="row"> | |||||
<div class="col-md-6"> | |||||
<ul> | |||||
<li><span class="glyphicon glyphicon-time"></span>Le <?= date('d/m/Y',strtotime($order->distribution->date)) ?></li> | |||||
<li><span class="glyphicon glyphicon-map-marker"></span><?= Html::encode($order->pointSale->name) ?><?php if(strlen($order->pointSale->name)): ?> | |||||
<br /> <span class="locality">à <?= Html::encode($order->pointSale->locality) ?></span><?php endif; ?></li> | |||||
</ul> | |||||
</div> | |||||
<div class="col-md-6"> | |||||
<ul> | |||||
<li> | |||||
<p><strong>Produit<?php if($order->countProducts() > 1): ?>s<?php endif; ?></strong></p> | |||||
<p><?= $order->getCartSummary() ?></p> | |||||
</li> | |||||
<li>Total : <strong><?= $order->getAmountWithTax(Order::AMOUNT_TOTAL, true); ?></strong></li> | |||||
</ul> | |||||
</div> | |||||
</div> | |||||
</div> | </div> | ||||
<div class="clr"></div> | <div class="clr"></div> | ||||
</div> | </div> |
</tr> | </tr> | ||||
</thead> | </thead> | ||||
<tbody> | <tbody> | ||||
<tr v-for="product in products" v-if="product.productDistribution && product.productDistribution[0] && product.productDistribution[0].active == 1"> | |||||
<td class="photo"> | |||||
<img v-if="product.photo.length" class="photo-product" :src="'<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/uploads/'+product.photo" /> | |||||
</td> | |||||
<td class="name"> | |||||
<span class="name">{{ product.name }}</span> | |||||
<span class="other"> | |||||
<span v-if="product.description.length">/</span> | |||||
<span class="description">{{ product.description }}</span> | |||||
<span v-if="product.weight">({{ product.weight }} g)</span> | |||||
</span> | |||||
<span v-if="product.quantity_max > 0 && ((product.quantity_form / product.coefficient_unit == product.quantity_remaining) || ((product.quantity_remaining * product.coefficient_unit) - product.quantity_form) < product.step)" class="label label-danger"> | |||||
Épuisé | |||||
</span> | |||||
<div class="recipe" v-if="product.recipe.length">{{ product.recipe }}</div> | |||||
</td> | |||||
<td class="price-unit"> | |||||
<template v-if="product.price_with_tax > 0">{{ formatPrice(product.price_with_tax) }}<br /><span class="unit">{{ product.wording_unit }}</span></template> | |||||
</td> | |||||
<td class="td-quantity"> | |||||
<template v-if="product.price_with_tax > 0"> | |||||
<div class="input-group"> | |||||
<span class="input-group-btn"> | |||||
<button class="btn btn-default btn-moins" type="button" @click="productQuantityClick(product, product.unit == 'piece' ? -1 : -parseFloat(product.step))" :disabled="product.quantity_form == 0"><span class="glyphicon glyphicon-minus"></span></button> | |||||
</span> | |||||
<input type="text" v-model="product.quantity_form" class="form-control quantity" readonly="readonly" /> | |||||
<span class="input-group-addon">{{ product.unit == 'piece' ? 'p.' : product.unit }}</span> | |||||
<span class="input-group-btn"> | |||||
<button class="btn btn-default btn-plus" type="button" @click="productQuantityClick(product, product.unit == 'piece' ? 1 : parseFloat(product.step))" :disabled="product.quantity_form == product.quantity_remaining && product.quantity_max > 0"><span class="glyphicon glyphicon-plus"></span></button> | |||||
</span> | |||||
</div> | |||||
</template> | |||||
</td> | |||||
<td class="price-total"> | |||||
<template v-if="product.price_with_tax > 0 && product.quantity_form > 0"> | |||||
{{ formatPrice(product.price_with_tax * (product.quantity_form / product.coefficient_unit )) }} | |||||
</template> | |||||
</td> | |||||
</tr> | |||||
<template v-for="category in categories"> | |||||
<tr v-if="category.id && countProductsByCategory(category)"> | |||||
<td class="category-name" colspan="5">{{ category.name }}</td> | |||||
</tr> | |||||
<tr v-for="product in products" v-if="product.id_product_category == category.id && product.productDistribution && product.productDistribution[0] && product.productDistribution[0].active == 1"> | |||||
<td class="photo"> | |||||
<img v-if="product.photo.length" class="photo-product" :src="'<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/uploads/'+product.photo" /> | |||||
</td> | |||||
<td class="name"> | |||||
<span class="name">{{ product.name }}</span> | |||||
<span class="other"> | |||||
<span v-if="product.description.length">/</span> | |||||
<span class="description">{{ product.description }}</span> | |||||
<span v-if="product.weight">({{ product.weight }} g)</span> | |||||
</span> | |||||
<span v-if="product.quantity_max > 0 && ((product.quantity_form / product.coefficient_unit == product.quantity_remaining) || ((product.quantity_remaining * product.coefficient_unit) - product.quantity_form) < product.step)" class="label label-danger"> | |||||
Épuisé | |||||
</span> | |||||
<div class="recipe" v-if="product.recipe.length">{{ product.recipe }}</div> | |||||
</td> | |||||
<td class="price-unit"> | |||||
<template v-if="product.price_with_tax > 0">{{ formatPrice(product.price_with_tax) }}<br /><span class="unit">{{ product.wording_unit }}</span></template> | |||||
</td> | |||||
<td class="td-quantity"> | |||||
<template v-if="product.price_with_tax > 0"> | |||||
<div class="input-group"> | |||||
<span class="input-group-btn"> | |||||
<button class="btn btn-default btn-moins" type="button" @click="productQuantityClick(product, product.unit == 'piece' ? -1 : -parseFloat(product.step))" :disabled="product.quantity_form == 0"><span class="glyphicon glyphicon-minus"></span></button> | |||||
</span> | |||||
<input type="text" v-model="product.quantity_form" class="form-control quantity" readonly="readonly" /> | |||||
<span class="input-group-addon">{{ product.unit == 'piece' ? 'p.' : product.unit }}</span> | |||||
<span class="input-group-btn"> | |||||
<button class="btn btn-default btn-plus" type="button" @click="productQuantityClick(product, product.unit == 'piece' ? 1 : parseFloat(product.step))" :disabled="product.quantity_form == product.quantity_remaining && product.quantity_max > 0"><span class="glyphicon glyphicon-plus"></span></button> | |||||
</span> | |||||
</div> | |||||
</template> | |||||
</td> | |||||
<td class="price-total"> | |||||
<template v-if="product.price_with_tax > 0 && product.quantity_form > 0"> | |||||
{{ formatPrice(product.price_with_tax * (product.quantity_form / product.coefficient_unit )) }} | |||||
</template> | |||||
</td> | |||||
</tr> | |||||
</template> | |||||
<tr class="total"> | <tr class="total"> | ||||
<td colspan="4"></td> | <td colspan="4"></td> | ||||
<td class="price-total">{{ priceTotal(true) }}</td> | <td class="price-total">{{ priceTotal(true) }}</td> | ||||
</template> | </template> | ||||
<template v-else> | <template v-else> | ||||
<div class="credit"> | <div class="credit"> | ||||
<div v-if="producer.credit == 1 && pointSaleActive.credit == 1 && (pointSaleActive.credit_functioning != 'user' || (pointSaleActive.credit_functioning == 'user' && user.credit_active))"> | |||||
<div v-if="user && producer.credit == 1 && pointSaleActive.credit == 1 && (pointSaleActive.credit_functioning != 'user' || (pointSaleActive.credit_functioning == 'user' && user.credit_active))"> | |||||
<input type="checkbox" id="use-credit" v-model="useCredit" disabled="disabled" v-if="pointSaleActive.credit_functioning == 'mandatory' || (pointSaleActive.credit_functioning == 'user' && user.credit_active)" /> | <input type="checkbox" id="use-credit" v-model="useCredit" disabled="disabled" v-if="pointSaleActive.credit_functioning == 'mandatory' || (pointSaleActive.credit_functioning == 'user' && user.credit_active)" /> | ||||
<input type="checkbox" id="use-credit" v-model="useCredit" v-else /> <label for="use-credit">Utiliser mon Crédit ({{ formatPrice(user.credit) }})</label> | <input type="checkbox" id="use-credit" v-model="useCredit" v-else /> <label for="use-credit">Utiliser mon Crédit ({{ formatPrice(user.credit) }})</label> | ||||
<?php endif; ?> | <?php endif; ?> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div id="signup-guest" v-if="!user && producer.option_allow_order_guest"> | |||||
<h3>Informations personnelles</h3> | |||||
<form action="#"> | |||||
<div class="form-group field-signupguest-email required"> | |||||
<label class="control-label" for="signupguest-email">Email</label> | |||||
<input type="email" id="signupguest-email" class="form-control" name="SignupForm[email]"> | |||||
<p class="help-block help-block-error"></p> | |||||
</div> | |||||
<!--<div class="form-group field-signupguest-password required"> | |||||
<label class="control-label" for="signupguest-password">Mot de passe</label> | |||||
<input type="password" id="signupguest-password" class="form-control" name="SignupForm[password]"> | |||||
<p class="help-block help-block-error"></p> | |||||
</div>--> | |||||
<div class="form-group field-signupguest-firstname required"> | |||||
<label class="control-label" for="signupguest-firstname">Prénom</label> | |||||
<input type="text" id="signupguest-firstname" class="form-control" name="SignupForm[firstname]"> | |||||
<p class="help-block help-block-error"></p> | |||||
</div> | |||||
<div class="form-group field-signupguest-lastname required"> | |||||
<label class="control-label" for="signupguest-lastname">Nom</label> | |||||
<input type="text" id="signupguest-lastname" class="form-control" name="SignupForm[lastname]"> | |||||
<p class="help-block help-block-error"></p> | |||||
</div> | |||||
<div class="form-group field-signupguest-phone required"> | |||||
<label class="control-label" for="signupguest-phone">Téléphone</label> | |||||
<input type="text" id="signupguest-phone" class="form-control" name="SignupForm[phone]"> | |||||
<p class="help-block help-block-error"></p> | |||||
</div> | |||||
</form> | |||||
</div> | |||||
<div class="block-actions"> | <div class="block-actions"> | ||||
<button class="btn btn-primary" disabled="disabled" v-if="disableConfirmButton">Je confirme ma commande</button> | <button class="btn btn-primary" disabled="disabled" v-if="disableConfirmButton">Je confirme ma commande</button> | ||||
<button class="btn btn-primary" v-else @click="confirmClick">Je confirme ma commande</button> | <button class="btn btn-primary" v-else @click="confirmClick">Je confirme ma commande</button> |
background-color: white; | background-color: white; | ||||
} | } | ||||
/* line 223, ../sass/order/_order.scss */ | /* line 223, ../sass/order/_order.scss */ | ||||
.order-order #main #app-order-order table#products td.category-name { | |||||
font-family: "capsuularegular"; | |||||
font-size: 21px; | |||||
line-height: 30px; | |||||
text-transform: uppercase; | |||||
padding-top: 13px; | |||||
} | |||||
/* line 232, ../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: 100px; | width: 100px; | ||||
} | } | ||||
/* line 229, ../sass/order/_order.scss */ | |||||
/* line 238, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products td.name .name { | .order-order #main #app-order-order table#products td.name .name { | ||||
font-family: "capsuularegular"; | font-family: "capsuularegular"; | ||||
color: black; | color: black; | ||||
font-size: 20px; | font-size: 20px; | ||||
line-height: 25px; | line-height: 25px; | ||||
} | } | ||||
/* line 235, ../sass/order/_order.scss */ | |||||
/* line 244, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products td.name .other { | .order-order #main #app-order-order table#products td.name .other { | ||||
font-size: 14px; | font-size: 14px; | ||||
color: #333; | color: #333; | ||||
} | } | ||||
/* line 239, ../sass/order/_order.scss */ | |||||
/* line 248, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products td.name .recipe { | .order-order #main #app-order-order table#products td.name .recipe { | ||||
color: gray; | color: gray; | ||||
} | } | ||||
/* line 243, ../sass/order/_order.scss */ | |||||
/* line 252, ../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: 100px; | width: 100px; | ||||
text-align: center; | text-align: center; | ||||
} | } | ||||
/* line 247, ../sass/order/_order.scss */ | |||||
/* line 256, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products .price-unit .unit, .order-order #main #app-order-order table#products .price-total .unit { | .order-order #main #app-order-order table#products .price-unit .unit, .order-order #main #app-order-order table#products .price-total .unit { | ||||
color: gray; | color: gray; | ||||
font-size: 13px; | font-size: 13px; | ||||
} | } | ||||
/* line 252, ../sass/order/_order.scss */ | |||||
/* line 261, ../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 254, ../sass/order/_order.scss */ | |||||
/* line 263, ../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-right: 0px none; | border-right: 0px none; | ||||
} | } | ||||
/* line 258, ../sass/order/_order.scss */ | |||||
/* line 267, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order table#products .td-quantity .input-group-addon { | .order-order #main #app-order-order table#products .td-quantity .input-group-addon { | ||||
padding: 5px; | padding: 5px; | ||||
padding-left: 0px; | padding-left: 0px; | ||||
border-left: 0px none; | border-left: 0px none; | ||||
border-right: 0px none; | border-right: 0px none; | ||||
} | } | ||||
/* line 268, ../sass/order/_order.scss */ | |||||
/* line 277, ../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 { | ||||
font-size: 23px; | font-size: 23px; | ||||
} | } | ||||
/* line 276, ../sass/order/_order.scss */ | |||||
/* line 285, ../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 282, ../sass/order/_order.scss */ | |||||
/* line 291, ../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 293, ../sass/order/_order.scss */ | |||||
/* line 302, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order #infos { | .order-order #main #app-order-order #infos { | ||||
margin-top: 30px; | margin-top: 30px; | ||||
} | } | ||||
/* line 295, ../sass/order/_order.scss */ | |||||
/* line 304, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order #infos .panel-body { | .order-order #main #app-order-order #infos .panel-body { | ||||
padding-top: 0px; | padding-top: 0px; | ||||
white-space: pre-line; | white-space: pre-line; | ||||
} | } | ||||
/* line 305, ../sass/order/_order.scss */ | |||||
/* line 314, ../sass/order/_order.scss */ | |||||
#main #content .panel h3 { | #main #content .panel h3 { | ||||
font-family: "highvoltageregular"; | font-family: "highvoltageregular"; | ||||
margin: 0px; | margin: 0px; | ||||
.order-confirm #main #order-success .alert.alert-info .content .glyphicon { | .order-confirm #main #order-success .alert.alert-info .content .glyphicon { | ||||
margin-right: 5px; | margin-right: 5px; | ||||
} | } | ||||
/* line 23, ../sass/order/_confirm.scss */ | |||||
/* line 25, ../sass/order/_confirm.scss */ | |||||
.order-confirm #main #order-success .alert-order-summary ul li { | |||||
margin-bottom: 10px; | |||||
} | |||||
/* line 31, ../sass/order/_confirm.scss */ | |||||
.order-confirm #main #order-success .alert { | .order-confirm #main #order-success .alert { | ||||
padding: 0px; | padding: 0px; | ||||
} | } | ||||
/* line 25, ../sass/order/_confirm.scss */ | |||||
/* line 34, ../sass/order/_confirm.scss */ | |||||
.order-confirm #main #order-success .alert strong { | |||||
font-weight: bold; | |||||
} | |||||
/* line 38, ../sass/order/_confirm.scss */ | |||||
.order-confirm #main #order-success .alert .glyphicon-big { | .order-confirm #main #order-success .alert .glyphicon-big { | ||||
font-size: 90px; | font-size: 90px; | ||||
color: white; | color: white; | ||||
padding: 30px; | padding: 30px; | ||||
float: left; | float: left; | ||||
} | } | ||||
/* line 32, ../sass/order/_confirm.scss */ | |||||
/* line 45, ../sass/order/_confirm.scss */ | |||||
.order-confirm #main #order-success .alert div.content { | .order-confirm #main #order-success .alert div.content { | ||||
color: #333; | color: #333; | ||||
padding: 20px; | padding: 20px; | ||||
margin-left: 151px; | margin-left: 151px; | ||||
} | } | ||||
/* line 37, ../sass/order/_confirm.scss */ | |||||
/* line 50, ../sass/order/_confirm.scss */ | |||||
.order-confirm #main #order-success .alert div.content h3 { | .order-confirm #main #order-success .alert div.content h3 { | ||||
font-family: "capsuularegular"; | font-family: "capsuularegular"; | ||||
font-size: 30px; | font-size: 30px; | ||||
line-height: 35px; | line-height: 35px; | ||||
text-transform: none; | text-transform: none; | ||||
} | } | ||||
/* line 50, ../sass/order/_confirm.scss */ | |||||
/* line 63, ../sass/order/_confirm.scss */ | |||||
.order-confirm #main #order-success .alert div.content .locality { | .order-confirm #main #order-success .alert div.content .locality { | ||||
color: gray; | color: gray; | ||||
} | } |
pointSaleActive: null, | pointSaleActive: null, | ||||
pointsSaleCodes: [], | pointsSaleCodes: [], | ||||
products: [], | products: [], | ||||
categories: [], | |||||
comment: '', | comment: '', | ||||
creditCheckbox: false, | creditCheckbox: false, | ||||
useCredit: false, | useCredit: false, | ||||
app.products = response.data.products ; | app.products = response.data.products ; | ||||
} | } | ||||
if(response.data.categories) { | |||||
app.categories = response.data.categories ; | |||||
} | |||||
if(!updateOnlyProducts) { | if(!updateOnlyProducts) { | ||||
app.order = null ; | app.order = null ; | ||||
if(response.data.order) { | if(response.data.order) { | ||||
} | } | ||||
}, | }, | ||||
confirmClick: function() { | confirmClick: function() { | ||||
var $signupGuestForm = $('#signup-guest form') ; | |||||
if($signupGuestForm.length > 0 && !$signupGuestForm.valid()) { | |||||
$signupGuestForm.submit() ; | |||||
return false ; | |||||
} | |||||
this.disableConfirmButton = true ; | this.disableConfirmButton = true ; | ||||
var productsArray = {} ; | var productsArray = {} ; | ||||
productsArray[this.products[key].id] = this.products[key].quantity_form ; | productsArray[this.products[key].id] = this.products[key].quantity_form ; | ||||
} | } | ||||
} | } | ||||
var user = false ; | |||||
if(this.producer.option_allow_order_guest && !this.user) { | |||||
user = { | |||||
email: $('#signupguest-email').val(), | |||||
password: $('#signupguest-password').val(), | |||||
firstname: $('#signupguest-firstname').val(), | |||||
lastname: $('#signupguest-lastname').val(), | |||||
phone: $('#signupguest-phone').val(), | |||||
} ; | |||||
} | |||||
axios.post('ajax-process', { | axios.post('ajax-process', { | ||||
Order: { | Order: { | ||||
}, | }, | ||||
code_point_sale: this.pointsSaleCodes[this.pointSaleActive.id], | code_point_sale: this.pointsSaleCodes[this.pointSaleActive.id], | ||||
products: productsArray, | products: productsArray, | ||||
use_credit: Number(this.useCredit) | |||||
use_credit: Number(this.useCredit), | |||||
user: user | |||||
}).then(function(response) { | }).then(function(response) { | ||||
if(response.data.status == 'success') { | if(response.data.status == 'success') { | ||||
window.location.href = opendistrib_base_url(true)+'order/confirm?idOrder='+response.data.idOrder ; | window.location.href = opendistrib_base_url(true)+'order/confirm?idOrder='+response.data.idOrder ; | ||||
total = this.priceTotal() - order.amount_paid ; | total = this.priceTotal() - order.amount_paid ; | ||||
} | } | ||||
return this.producer.credit_limit == null || (this.producer.credit_limit != null && (this.user.credit - total >= this.producer.credit_limit)) ; | return this.producer.credit_limit == null || (this.producer.credit_limit != null && (this.user.credit - total >= this.producer.credit_limit)) ; | ||||
}, | |||||
countProductsByCategory: function(category) { | |||||
var count = 0 ; | |||||
for(var i = 0 ; i < this.products.length ; i++) { | |||||
if(this.products[i].id_product_category == category.id) { | |||||
count ++ ; | |||||
} | |||||
} | |||||
return count ; | |||||
} | } | ||||
}, | }, | ||||
computed : { | computed : { | ||||
return orderedPointsSaleArray ; | return orderedPointsSaleArray ; | ||||
} | } | ||||
}, | |||||
updated: function () { | |||||
var app = this; | |||||
this.$nextTick(function () { | |||||
if(app.step == 'payment' && !app.user && app.producer.option_allow_order_guest) { | |||||
$("#signup-guest form").validate({ | |||||
rules: { | |||||
'SignupForm[email]': { | |||||
'email': true, | |||||
'required': true, | |||||
'minlength': 8, | |||||
'maxlength': 255 | |||||
}, | |||||
'SignupForm[password]': { | |||||
'required': true, | |||||
'minlength': 8, | |||||
"maxlength": 255 | |||||
}, | |||||
'SignupForm[firstname]': { | |||||
'required': true, | |||||
'minlength': 2, | |||||
"maxlength": 255 | |||||
}, | |||||
'SignupForm[lastname]': { | |||||
'required': true, | |||||
'minlength': 2, | |||||
"maxlength": 255 | |||||
}, | |||||
'SignupForm[phone]': { | |||||
'required': true, | |||||
'minlength': 2, | |||||
"maxlength": 255 | |||||
}, | |||||
}, | |||||
messages: { | |||||
'SignupForm[email]' : { | |||||
'required': 'Ce champs est requis.', | |||||
'email' : 'Email invalide.' | |||||
}, | |||||
'SignupForm[password]' : { | |||||
'required': 'Ce champs est requis.', | |||||
}, | |||||
'SignupForm[firstname]' : { | |||||
'required': 'Ce champs est requis.', | |||||
}, | |||||
'SignupForm[lastname]' : { | |||||
'required': 'Ce champs est requis.', | |||||
}, | |||||
'SignupForm[phone]' : { | |||||
'required': 'Ce champs est requis.', | |||||
}, | |||||
} | |||||
}) ; | |||||
} | |||||
}); | |||||
} | } | ||||
}); | }); |
} | } | ||||
} | } | ||||
.alert-order-summary { | |||||
ul { | |||||
li { | |||||
margin-bottom: 10px ; | |||||
} | |||||
} | |||||
} | |||||
.alert { | .alert { | ||||
padding: 0px ; | padding: 0px ; | ||||
strong { | |||||
font-weight: bold ; | |||||
} | |||||
.glyphicon-big { | .glyphicon-big { | ||||
font-size: 90px ; | font-size: 90px ; | ||||
color: white ; | color: white ; |
} | } | ||||
table#products { | table#products { | ||||
td.category-name { | |||||
font-family: "capsuularegular" ; | |||||
font-size: 21px ; | |||||
line-height: 30px; | |||||
text-transform: uppercase; | |||||
padding-top: 13px ; | |||||
} | |||||
td.photo { | td.photo { | ||||
img { | img { | ||||
width: 100px ; | width: 100px ; |