Browse Source

Merge branch 'details_ergonomie_backend' into dev

dev
Guillaume Bourgeois 5 years ago
parent
commit
f629c5a5e5
23 changed files with 229 additions and 556 deletions
  1. +3
    -2
      backend/controllers/ProductController.php
  2. +15
    -11
      backend/views/distribution/index.php
  3. +33
    -8
      backend/views/layouts/header.php
  4. +1
    -1
      backend/views/layouts/main.php
  5. +0
    -102
      backend/views/order/_total_orders.php
  6. +0
    -321
      backend/views/order/index.php
  7. +1
    -5
      backend/views/point-sale/_form.php
  8. +0
    -15
      backend/views/point-sale/index.php
  9. +8
    -4
      backend/views/producer/billing.php
  10. +1
    -1
      backend/views/product/index.php
  11. +3
    -3
      backend/views/site/index.php
  12. +94
    -56
      backend/web/css/screen.css
  13. +4
    -1
      backend/web/js/lechatdesnoisettes.js
  14. +3
    -1
      backend/web/js/vuejs/distribution-index.js
  15. +28
    -5
      backend/web/sass/distribution/_index.scss
  16. +17
    -0
      backend/web/sass/product/_form.scss
  17. +1
    -0
      backend/web/sass/screen.scss
  18. +1
    -1
      common/mail/creditUser-html.php
  19. +1
    -1
      common/mail/creditUser-text.php
  20. +12
    -15
      common/mail/layouts/html.php
  21. +1
    -1
      common/models/PointSale.php
  22. +1
    -2
      common/models/PointSaleDistribution.php
  23. +1
    -0
      common/models/ProductSearch.php

+ 3
- 2
backend/controllers/ProductController.php View File

@@ -190,10 +190,11 @@ class ProductController extends BackendController
*
* @param array $array
*/
public function actionOrder($array)
public function actionOrder()
{
$array = Yii::$app->request->post('array') ;
$orderArray = json_decode(stripslashes($array));
foreach($orderArray as $id => $order) {
$product = $this->findModel($id);
$product->order = $order;

+ 15
- 11
backend/views/distribution/index.php View File

@@ -163,13 +163,13 @@ $this->setPageTitle('Distributions') ;
</modal>
<div class="col-md-6">
<div class="info-box col-md-4">
<div id="summary-ca-weight" class="info-box col-md-4">
<span class="info-box-icon bg-yellow"><i class="fa fa-euro"></i></span>
<div class="info-box-content">
<span class="info-box-text">Commandé</span>
<span class="info-box-number">{{ distribution.revenues }} € / {{ distribution.weight }} kg</span>
<span class="info-box-text">Potentiel</span>
<span class="info-box-number">{{ distribution.potential_revenues }} € / {{ distribution.potential_weight }} kg</span>
<span class="info-box-text">CA</span>
<span class="info-box-number">{{ distribution.revenues }} € <span class="normal">/ {{ distribution.potential_revenues }} €</span></span>
<span class="info-box-text">Poids</span>
<span class="info-box-number">{{ distribution.weight }} kg <span class="normal">/ {{ distribution.potential_weight }} kg</span></span>
</div>
</div>
</div>
@@ -179,7 +179,8 @@ $this->setPageTitle('Distributions') ;
<div class="info-box-content">
<span class="info-box-text">
{{ countOrders }} Commande<span v-if="countOrders > 1">s</span><br /><br />
<a :href="distribution.url_report" class="btn btn-default" v-if="orders.length">Télécharger (PDF)</a>
<a href="#" class="btn btn-default" disabled="disabled" v-if="countOrders == 0">Télécharger (PDF)</a>
<a :href="distribution.url_report" class="btn btn-default" v-else>Télécharger (PDF)</a>
</span>
</div>
</div>
@@ -200,7 +201,7 @@ $this->setPageTitle('Distributions') ;
<h3 class="panel-title">Commandes <label class="label label-success" v-if="orders.length">{{ orders.length }}</label><label class="label label-danger" v-else>0</label></h3>
</div>
<div class="panel-body">
<button id="btn-add-order" @click="showModalFormOrderCreate = true" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Ajouter une commande</button>
<button id="btn-add-order" @click="showModalFormOrderCreate = true" class="btn btn-primary btn-xs"><span class="glyphicon glyphicon-plus"></span> Ajouter une commande</button>
<order-form
v-if="showModalFormOrderCreate"
:date="date"
@@ -253,6 +254,7 @@ $this->setPageTitle('Distributions') ;
<span class="label label-warning" v-if="order.date_update">modifiée</span>
</td>
<td class="column-actions">
<a class="btn btn-default" :href="baseUrl+'/subscription/update?id='+order.id_subscription" v-if="order.id_subscription > 0"><span class="glyphicon glyphicon-repeat"></span></a>
<button class="btn btn-default" :data-id-order="order.id" @click="orderViewClick"><span :class="'glyphicon ' + ((showViewProduct && idOrderView == order.id) ? 'glyphicon-eye-close' : 'glyphicon-eye-open')"></span></button>
<button class="btn btn-default" :data-id-order="order.id" @click="orderPaymentModalClick"><span class="glyphicon glyphicon-euro"></span></button>
<button class="btn btn-default" :data-id-order="order.id" @click="updateOrderClick"><span class="glyphicon glyphicon-pencil"></span></button>
@@ -445,10 +447,12 @@ $this->setPageTitle('Distributions') ;
</div>
</div>
<div slot="footer">
<button class="modal-default-button btn btn-primary" @click="submitFormUpdate" v-if="order.id">Modifier</button>
<button class="modal-default-button btn btn-primary" @click="submitFormCreate" v-else>Créer</button>
<button class="modal-default-button btn btn-default" @click="$emit('close')">Annuler</button>
<div class="actions-form">
<button class="modal-default-button btn btn-primary" @click="submitFormUpdate" v-if="order.id">Modifier</button>
<button class="modal-default-button btn btn-primary" @click="submitFormCreate" v-else>Créer</button>

<button class="modal-default-button btn btn-default" @click="$emit('close')">Annuler</button>
</div>
</div>
</modal>
</script>

+ 33
- 8
backend/views/layouts/header.php View File

@@ -74,6 +74,7 @@ use yii\helpers\ArrayHelper;
<?php else: ?><span class="label label-warning">0</span><?php endif; ?>
</a>
<ul class="dropdown-menu">
<?php if(count($usersArray)): ?>
<li class="header">Inscriptions des 7 derniers jours</li>
<li>
<ul class="menu">
@@ -86,6 +87,9 @@ use yii\helpers\ArrayHelper;
<?php endforeach; ?>
</ul>
</li>
<?php else: ?>
<li class="header">Aucun nouvel inscrit ces 7 derniers jours.</li>
<?php endif; ?>
</ul>
</li>
@@ -104,7 +108,9 @@ use yii\helpers\ArrayHelper;
<?php if(count($usersNegativeCreditArray)): ?><span class="label label-warning"><?= count($usersNegativeCreditArray) ?></span>
<?php else: ?><span class="label label-success">0</span><?php endif; ?>
</a>
<ul class="dropdown-menu">
<?php if(count($usersNegativeCreditArray)): ?>
<li class="header">Utilisateurs au crédit négatif</li>
<li>
<ul class="menu">
@@ -117,7 +123,11 @@ use yii\helpers\ArrayHelper;
<?php endforeach; ?>
</ul>
</li>
<?php else: ?>
<li class="header">Aucun de vos utilisateurs n'a de crédit négatif.</li>
<?php endif; ?>
</ul>
</li>
<?php if (User::isCurrentProducer() || User::isCurrentAdmin()): ?>
@@ -125,23 +135,39 @@ use yii\helpers\ArrayHelper;
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-home"></i>
<span><?= Html::encode(Yii::$app->user->identity->getNameProducer()); ?></span>
<i class="fa fa-caret-down"></i>
</a>
<?php if(User::isCurrentAdmin()): ?>
<ul class="dropdown-menu">
<?php $producersArray = Producer::find()->orderBy('name ASC')->all(); ?>
<?php foreach($producersArray as $producer): ?>
<li><a href="<?= Yii::$app->urlManagerBackend->createUrl(['site/change-producer', 'id' => $producer->id]); ?>"><?= Html::encode($producer->name) ?></a></li>
<?php endforeach; ?>
<?php if(User::isCurrentAdmin()): ?>
<li>
<a href="<?= Yii::$app->urlManagerProducer->createUrl(['site/index','slug_producer' => Producer::getCurrent()->slug]); ?>">
<i class="fa fa-th-large"></i>
<span class="hidden-xs">Espace du producteur</span>
</a>
</li>
<li class="header">&nbsp;<strong>Autres producteurs</strong></li>
<?php $producersArray = Producer::find()->orderBy('name ASC')->all(); ?>
<?php foreach($producersArray as $producer): ?>
<li><a href="<?= Yii::$app->urlManagerBackend->createUrl(['site/change-producer', 'id' => $producer->id]); ?>"><?= Html::encode($producer->name) ?></a></li>
<?php endforeach; ?>
<?php else: ?>
<li>
<a href="<?= Yii::$app->urlManagerProducer->createUrl(['site/index','slug_producer' => Producer::getCurrent()->slug]); ?>">
<i class="fa fa-th-large"></i>
<span class="hidden-xs">Mon espace</span>
</a>
</li>
<?php endif; ?>
</ul>
<?php endif; ?>
</li>
<?php endif; ?>
<!-- User Account: style can be found in dropdown.less -->
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-user"></i>
<span class="hidden-xs"><?= Html::encode(User::getCurrent()->name.' '.User::getCurrent()->lastname) ; ?></span>
<i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu">
<li><a href="<?= Yii::$app->urlManagerFrontend->createAbsoluteUrl(['user/update']); ?>"><i class="fa fa-user"></i> Profil</a></li>
@@ -149,7 +175,6 @@ use yii\helpers\ArrayHelper;
</ul>
</li>

<!-- User Account: style can be found in dropdown.less -->
<li class="link-control-sidebar">
<a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
</li>

+ 1
- 1
backend/views/layouts/main.php View File

@@ -68,7 +68,7 @@ if (Yii::$app->controller->action->id === 'login') {
<meta name="baseurl" content="<?= Yii::$app->urlManagerBackend->baseUrl ; ?>">
<meta name="baseurl-absolute" content="<?= Yii::$app->urlManagerBackend->getHostInfo().Yii::$app->urlManagerBackend->baseUrl; ?>">
<?= Html::csrfMetaTags() ?>
<title><?= Html::encode($this->title) ?></title>
<title><?= Html::encode($this->title) ?> | distrib</title>
<link rel="icon" type="image/png" href="<?php echo Yii::$app->urlManagerBackend->getBaseUrl(); ?>/img/favicon-distrib.png" />
<?php $this->head() ?>
</head>

+ 0
- 102
backend/views/order/_total_orders.php View File

@@ -1,102 +0,0 @@
<?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 common\models\Order ;
use yii\helpers\Html ;

?>

<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
Global
</h3>
</div>
<div class="panel-body">
<div class="alert alert-warning">
<strong>Potentiel :</strong> <?= number_format($potentialTurnover,2); ?> € (<?= $totalWeight ?> kg) &bull;
<strong>Commandé :</strong> <?= number_format($revenues,2); ?> € (<?= $weight ?> kg)
</div>

<table class="table table-bordered tab-content table-produits table-header-rotated">
<tbody>
<tr>
<?php
foreach ($arrayProducts as $p) {
if ((isset($arrayProductsSelected[$p->id]['active']) && $arrayProductsSelected[$p->id]['active']) ||
(!$arrayProductsSelected[$p->id]['active'] && Order::getProductQuantity($p->id, $arrayOrders)))
{
(!$arrayProductsSelected[$p->id]['active']) ? $class_disabled = 'disabled' : $class_disabled = '' ;
echo '<th class="rotate-45 '.$class_disabled.'"><div><span>'.Html::encode($p->getStrWordingAdmin()).'</span></div></th>' ;
}
}
?>
</tr>
<tr>
<?php
foreach ($arrayProducts as $p) {
$quantity = Order::getProductQuantity($p->id, $arrayOrders);
if ((isset($arrayProductsSelected[$p->id]['active']) && $arrayProductsSelected[$p->id]['active']) || $quantity)
{
$strQuantity = '';
if ($quantity) {
$strQuantity = $quantity ;
}
$class = 'total';
if ($strQuantity > $arrayProductsSelected[$p->id]['quantity_max'])
{
$class .= ' depasse';
}
echo '<td class="' . $class . '"><strong>' . $strQuantity . '</strong> ';

if ($arrayProductsSelected[$p->id]['quantity_max'] && $strQuantity) {
echo '<br /><span>' . $arrayProductsSelected[$p->id]['quantity_max'] . '</span>';
}
echo '</td>' ;
}
}
?>
</tr>
</tbody>
</table>
</div>
</div>


+ 0
- 321
backend/views/order/index.php View File

@@ -1,321 +0,0 @@
<?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 common\models\Order;
use common\models\User ;
use yii\helpers\ArrayHelper ;
use yii\widgets\ActiveForm;

$this->title = 'Commande';

?>

<div id="page-order">
<div class="col-md-3" id="col-left">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Calendrier</h3>
</div>
<div class="panel-body">
<?php
// chargement assets
common\components\fullcalendar\FullcalendarWidget::widget();
// --> lancement du js en manuel (via lechatdesnoisettes.js)
?>
<div id="calendar"></div>
<?php if (!$date): ?>
<br />
<div class="alert alert-info">
<span class="glyphicon glyphicon-share-alt"></span> Choisissez une date pour initier ou
éditer un jour de production.
</div>
<?php else: ?>
<a class="btn btn-sm btn-default btn-active-week" href="<?= Yii::$app->urlManager->createUrl(['order/change-state-week', 'date' => $date, 'active' => !$oneDistributionWeekActive, ]); ?>"><span class="glyphicon glyphicon-<?= $oneDistributionWeekActive ? 'remove' : 'ok' ?>"></span> <?= $oneDistributionWeekActive ? 'Désactiver' : 'Activer' ?> cette semaine de production</a>
<?php endif; ?>
</div>
</div>
<?php if ($date != ''): ?>
<div id="bloc-production">
<input type="hidden" id="date-production" value="<?= $date ?>" />
<input type="hidden" id="id-production" value="<?= $distribution->id ?>" />
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Distribution du <strong><?php echo date('d/m/Y', strtotime($date)); ?></strong></h3>
</div>
<div class="panel-body">
<strong>Distribution</strong><br />
<div class="btn-group" role="group">
<a class="btn btn-default<?php if ($distribution->active): ?> btn-success<?php endif; ?>" href="<?php echo Yii::$app->urlManager->createUrl(['order/change-state', 'date' => $date, 'active' => 1]); ?>">Activé</a>
<a class="btn btn-default<?php if (!$distribution->active): ?> btn-danger<?php endif; ?>" href="<?php echo Yii::$app->urlManager->createUrl(['order/change-state', 'date' => $date, 'active' => 0]); ?>">Désactivé</a>
</div>
<br />
<br />
<?php if (!$distribution->active): ?>
<div class="alert alert-info">
<span class="glyphicon glyphicon-share-alt"></span> Activez ici la distribution pour qu'elle soit visible au client.
</div>
<?php endif; ?>

<?php if($distribution->delivery && count($arrayPointsSaleDistribution)): ?>
<div id="productions-point-vente">
<strong>Points de vente : </strong>
<div class="checkbox-list">
<?= Html::activeCheckboxList(
$pointSaleDistribution,
'points_sale_distribution',
$arrayPointsSaleDistribution ,
['encode' => false, 'class' => '']) ?>
</div>
</div>
<?php endif; ?>
</div>
</div>
</div>
<?php endif; ?>
<?php if ($distribution): ?>
<div id="bloc-produits">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Produits</h3>
</div>
<div class="panel-body">
<!-- produits sélectionnés -->
<form id="produits-production" action="<?php echo Yii::$app->urlManager->createUrl(['order/index', 'date' => $date]); ?>" method="post">
<div class="overflow">
<table class="table table-condensed">
<thead>
<tr>
<th class="td-active">Actif</th>
<th class="td-produit">Produit</th>
<th class="td-max">Max. <span class="glyphicon glyphicon-info-sign" data-toggle="tooltip" data-placement="top" data-original-title="Quantité disponible à la commande. Laisser vide si vous ne souhaitez pas avoir de limite de commande. La valeur par défaut est configurable dans vos produits."></span></th>
</tr>
</thead>
<tbody>
<?php foreach ($arrayProducts as $p): ?>
<tr <?php if (isset($selectedProducts[$p->id]['active']) && $selectedProducts[$p->id]['active']): ?>class="active"<?php endif; ?>>
<td class="td-active"><input id="product-<?php echo $p->id; ?>" name="Product[<?php echo $p->id; ?>][active]" type="checkbox" <?php if (isset($selectedProducts[$p->id]['active']) && $selectedProducts[$p->id]['active']): ?>checked="checked"<?php endif; ?> /></td>
<td class="td-produit"><label for="product-<?php echo $p->id; ?>"><?= Html::encode($p->name) ?></label></td>
<td class="td-max"><input class="quantity-max" name="Product[<?php echo $p->id; ?>][quantity_max]" type="text" value="<?php if (isset($selectedProducts[$p->id])) echo $selectedProducts[$p->id]['quantity_max']; ?>" /></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<input type="submit" name="valider_produit_selec" class="btn btn-default" value="Valider" />
</form>
</div>
</div>
</div>
<?php endif; ?>
</div>
<div class="col-md-9" id="col-right">
<input type="hidden" value="<?php echo $date; ?>" id="current-date" />
<ul id="jours-production">
<?php foreach ($arrayDistributionDays as $distributionDay) : ?>
<li><?php echo $distributionDay->date; ?></li>
<?php endforeach; ?>
</ul>
<?php if ($date != ''): ?>
<div id="bloc-totaux">
<?= $this->render('_total_orders.php',[
'arrayProducts' => $arrayProducts,
'arrayOrders' => $arrayOrders,
'arrayProductsSelected' => $selectedProducts,
'revenues' => $revenues,
'weight' => $weight,
'potentialTurnover' => $potentialTurnover,
'totalWeight' => $totalWeight,
]); ?>
</div>

<?php
$num_jour_semaine = date('w', strtotime($date));
$arr_jour_semaine = [0 => 'dimanche', 1 => 'lundi', 2 => 'mardi', 3 => 'mercredi', 4 => 'jeudi', 5 => 'vendredi', 6 => 'samedi'];
$champs_horaires_point_vente = 'horaires_' . $arr_jour_semaine[$num_jour_semaine];
?>
<div class="panel panel-default" id="panel-commandes">
<div class="panel-heading">
<h3 class="panel-title">
Commandes
<?php if (!count($arrayOrders)): ?><span class="label label-danger">0</span>
<?php else: ?><span class="label label-success"><?= count($arrayOrders) ?></span>
<?php endif; ?>
<?php if (count($arrayOrders)): ?>
<a id="btn-export-commandes" class="btn btn-primary" href="<?php echo Yii::$app->urlManager->createUrl(['order/report', 'date' => $date, 'idPointSale' => 0, 'global' => 1]); ?>"><span class="glyphicon glyphicon-download-alt"></span> Exporter</a>
<?php endif; ?>
<div id="btn-commandes-auto" class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="glyphicon glyphicon-repeat"></span> Abonnements <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="<?= Yii::$app->urlManager->createUrl(['order/add-subscriptions', 'date' => $date]); ?>">Importer toutes les commandes</a></li>
</ul>
</div>
</h3>
</div>
<div class="panel-body">
<div class="col-md-12">
<div class="alert alert-danger" style="display:none;">Aucun point de vente activé</div>
<!-- Nav tabs -->
<ul id="tabs-points-vente" class="nav nav-tabs" role="tablist">
<?php foreach($arrayPointsSale as $pointSale): ?>
<li role="presentation" class="<?php if($pointSale->point_production): ?>active<?php endif; ?>">
<a href="#point-vente-<?= $pointSale->id ?>" id="btn-point-vente-<?= $pointSale->id ?>" aria-controls="point-sale-<?= $pointSale->id ?>" role="tab" data-toggle="tab"><?= Html::encode($pointSale->name) ?> <span class="badge badge-<?php if(count($pointSale->orders)): ?>success<?php else: ?>danger<?php endif; ?>"><?php echo count($pointSale->orders); ?></span></a>
</li>
<?php endforeach; ?>
</ul>

<!-- Tab panes -->
<div class="tab-content" id="commandes-points-vente">
<?php foreach($arrayPointsSale as $pointSale): ?>
<div role="tabpanel" data-id-pv="<?= $pointSale->id ?>" class="bloc-point-vente tab-pane <?php if($pointSale->point_production): ?> active<?php endif; ?>" id="point-vente-<?= $pointSale->id ?>">
<div class="col-md-12">
<div class="alert alert-warning recap-pv <?php if(!count($pointSale->orders)): ?>no-order<?php endif; ?>">
<?php if(count($pointSale->orders)): ?>
<strong class="commandes"><?= count($pointSale->orders) ?> commande<?php if(count($pointSale->orders) > 1): ?>s<?php endif; ?></strong>
<span class="recettes"><?= number_format($pointSale->revenues, 2) ?> €</span>
<?php else: ?>
<strong class="commandes">Aucune commande</strong>
<span class="recettes"></span>
<?php endif; ?>
</div>
<ul class="liste-commandes btn-group-vertical<?php if(!count($pointSale->orders)): ?> no-order<?php endif; ?>">
<?php foreach($pointSale->orders as $order): ?>
<li>
<a href="javascript:void(0);" class="btn btn-default" data-pv-id="<?= $pointSale->id ?>" data-id-commande="<?= $order->id ?>" data-commande='<?= $pointSale->data_options_orders[$order->id]['data-order'] ?>' data-commentaire="<?= Html::encode($order->comment) ?>" data-date="<?= date('d/m à H:i',strtotime($order->date)); ?>">
<span class="montant <?php if(number_format($order->paid_amount,2) >= number_format($order->amount,2)): ?>paye<?php endif; ?>">
<?= Html::encode(number_format($order->amount, 2)); ?> €
<?php if($order->paid_amount - $order->amount > 0.01): ?><span class="glyphicon glyphicon-warning-sign"></span><?php endif; ?>
</span>
<span class="user">
<?php if($order->origin): ?>
<?php if($order->origin == Order::ORIGIN_ADMIN): ?>
<span class="label label-warning">vous</span>
<?php elseif($order->origin == Order::ORIGIN_AUTO): ?>
<span class="label label-default">auto</span>
<?php elseif($order->origin == Order::ORIGIN_USER): ?>
<span class="label label-success">client</span>
<?php endif; ?>
<?php endif; ?>
<?php if(isset($order->user)): ?>
<?= Html::encode($order->user->lastname.' '.$order->user->name); ?>
<?php else: ?>
<?= Html::encode($order->username); ?>
<?php endif; ?>
<?php if(!is_null($order->date_delete)): ?>
(<span class="glyphicon glyphicon-remove"></span> Annulée)
<?php endif; ?>
</span>
<?php if (strlen($order->comment)): ?>
<span class="glyphicon glyphicon-comment"></span>
<?php endif; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<?= Html::a('<span class="glyphicon glyphicon-plus"></span> Créer une commande', 'javascript:void(0);', ['class' => 'btn btn-default creer-commande', 'data-pv-id' => $pointSale->id]) ?>
</div>
<div class="col-md-12 bloc-commande">
<h2 class="title-user">
<span class="buttons-edit-remove">
<?= Html::a('<span class="glyphicon glyphicon-trash"></span> Supprimer', 'javascript:void(0);', ['class' => 'btn btn-default btn-remove']) ?>
<?= Html::a('<span class="glyphicon glyphicon-pencil"></span> Modifier', 'javascript:void(0);', ['class' => 'btn btn-default btn-edit']) ?>
</span>
<span class="buttons-save-cancel">
<?= Html::a('<span class="glyphicon glyphicon-ok"></span> Sauvegarder', 'javascript:void(0);', ['class' => 'btn btn-primary btn-save']) ?>
<?= Html::a('<span class="glyphicon glyphicon-remove"></span> Annuler', 'javascript:void(0);', ['class' => 'btn btn-default btn-cancel']) ?>
</span>
<span class="the-title"></span>
<span class="choix-user">
<?= Html::activeDropDownList(new User, 'id', ArrayHelper::map(User::find()->joinWith('userProducer')->where('user_producer.id_producer = '.Producer::getId())->andWhere('user_producer.active = 1')->orderBy('user.lastname ASC, user.name ASC')->all(), 'id', function($model, $defaultValue) {
return $model['lastname'].' '.$model['name'];
}), ['prompt' => '--','class' => 'form-control user-id']) ?>
OU <input type="text" class="form-control username" placeholder="Choisissez un nom" />
</span>
</h2>
<div class="commentaire alert alert-info">
</div>
<textarea name="comment" class="form-control textarea-commentaire" placeholder="Commentaire"></textarea>
<table class="table table-bordered table-condensed tab-content table-produits">
<tbody>
<?php foreach ($arrayProducts as $p): ?>
<tr class="produit-<?= $p->id ?> <?php if(!$selectedProducts[$p->id]['active']): ?> disabled<?php endif; ?>" data-id-produit="<?= $p->id ?>">
<td class="td-commande"></td>
<td class="td-produit"><?php echo Html::encode($p->getStrWordingAdmin()); ?></td>
</tr>
<?php endforeach; ?>
<tr class="tr-total">
<td class="td-total"></td>
<td class="td-paiement"></td>
</tr>
</tbody>
</table>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
<?php endif; ?>
</div>
</div>

+ 1
- 5
backend/views/point-sale/_form.php View File

@@ -56,10 +56,6 @@ use common\models\Producer ;
<?= $form->field($model, 'locality')->textInput(['maxlength' => 255]) ?>
<?= $form->field($model, 'address')->textarea(['rows' => 6]) ?>

<?= $form->field($model, 'point_production')
->checkbox()
->hint('Cochez cette case si ce point de vente correspond à votre lieu de production.') ?>

<?php
$addHintCredit = '' ;
if(!Producer::getConfig('credit')):
@@ -68,7 +64,7 @@ use common\models\Producer ;
echo $form->field($model, 'credit')
->checkbox()
->hint('Cochez cette case si le client peut régler ses commandes via son compte Crédit Pain pour ce point de vente.'
->hint('Cochez cette case si le client peut régler ses commandes via son compte <strong>Crédit</strong> pour ce point de vente.'
.$addHintCredit);
?>

+ 0
- 15
backend/views/point-sale/index.php View File

@@ -53,21 +53,6 @@ $this->addButton(['label' => '+', 'url' => 'point-sale/create', 'class' => 'btn
'columns' => [
'name',
'locality',
[
'attribute' => 'point_production',
'format' => 'raw',
'filter' => [0 => 'Non',1 => 'Oui'],
'value' => function($model) {
if($model->point_production)
{
return '<span class="label label-success">Oui</span>' ;
}
else {
return '<span class="label label-danger">Non</span>' ;
}
}
],
[
'attribute' => 'delivery',
'label' => 'Livraison',

+ 8
- 4
backend/views/producer/billing.php View File

@@ -47,16 +47,20 @@ $this->addBreadcrumb($this->getTitle()) ;

?>

<div class="well">
Vous seuls savez ce que vous apporte cet outil et dans quelle mesure vous souhaitez le soutenir.<br />
C'est pourquoi le modèle économique est basé sur un prix libre facturé mensuellement.<br />
<div class="callout callout-info">
<h4>Abonnement à prix libre</h4>
<p><i>distrib</i> fonctionne avec système d'abonnement à prix libre pour en
assurer la plus grande diffusion possible. Ceci correspond également à l'unique source de revenus
nécessaire à la maintenance et au développement de la plateforme.<br />
Si cet outil est important dans votre activité, nous vous encourageons à nous soutenir en vous abonnant.
</p>
</div>

<div id="free-price" class="">
<?php if($alertFreePrice): ?>
<div class="alert alert-success">
Le montant de votre abonnement a bien été mis à jour.
Le montant de votre abonnement a bien été mis à jour.
<?php if($producer->free_price != 0): ?>
Vos prochaines factures mensuelles auront un montant de <strong><?= number_format(Html::encode($producer->free_price),2).' € HT' ; ?></strong>.
<?php endif; ?>

+ 1
- 1
backend/views/product/index.php View File

@@ -68,7 +68,7 @@ $this->addButton(['label' => '+', 'url' => 'product/create', 'class' => 'btn btn
'value' => function($model) {
if(strlen($model->photo)) {
$url = Yii::$app->urlManagerProducer->getHostInfo().'/'.Yii::$app->urlManagerProducer->baseUrl ;
return '<img class="photo-product" src="'.$url.'uploads/'.$model->photo.'" />' ;
return '<img class="photo-product" src="'.$url.'/uploads/'.$model->photo.'" />' ;
}
return '' ;
}

+ 3
- 3
backend/views/site/index.php View File

@@ -113,7 +113,7 @@ $this->title = 'Tableau de bord';
<span class="info-box-number"></span>
<div class="buttons">
<?= Html::a('<span class="fa fa-eye"></span>', ['distribution/index', 'date' => $distribution->date], ['class' => 'btn btn-default']); ?>
<?php if(count($distribution->order)): ?><?= Html::a('<span class="fa fa-download"></span>', ['order/report', 'date' => $distribution->date], ['class' => 'btn btn-default']); ?><?php endif; ?>
<?php if(count($distribution->order)): ?><?= Html::a('<span class="fa fa-download"></span>', ['distribution/report', 'date' => $distribution->date], ['class' => 'btn btn-default']); ?><?php endif; ?>
</div>
</div>
</div>
@@ -140,10 +140,10 @@ $this->title = 'Tableau de bord';
<th></th>
<th>Date</th>
<th>Client</th>
<th>Historique</th>
<th>Produits</th>
<th>Point de vente</th>
<th>Montant</th>
<th>Historique</th>
</tr>
</thead>
<tbody>
@@ -160,10 +160,10 @@ $this->title = 'Tableau de bord';
<td>
<?= $order->getStrUser(); ?><br />
</td>
<td class="history"><?= $order->getStrHistory() ; ?></td>
<td><?= $order->getCartSummary() ; ?></td>
<td><?= $order->getPointSaleSummary() ; ?></td>
<td><?= $order->getAmount(Order::AMOUNT_TOTAL, true) ; ?></td>
<td class="history"><?= $order->getStrHistory() ; ?></td>
</tr>
<?php endforeach; ?>
</tbody>

+ 94
- 56
backend/web/css/screen.css View File

@@ -1556,6 +1556,18 @@ body.login-page .login-box .login-box-body a:hover {
background-color: white;
}

/* line 5, ../sass/product/_form.scss */
.product-create #product-active label,
.product-update #product-active label {
margin-right: 15px;
}
/* line 10, ../sass/product/_form.scss */
.product-create #days-production .form-group,
.product-update #days-production .form-group {
float: left;
margin-right: 15px;
}

/**
Copyright distrib (2018)

@@ -1624,138 +1636,160 @@ termes.
}
/* line 60, ../sass/distribution/_index.scss */
.distribution-index #loading {
position: absolute;
top: -60px;
position: fixed;
top: 50%;
left: 50%;
margin-left: -15px;
width: 100px;
height: 100px;
-moz-border-radius: 50px;
-webkit-border-radius: 50px;
border-radius: 50px;
background-color: white;
z-index: 10;
-moz-box-shadow: 0px 0px 5px #d0d0d0;
-webkit-box-shadow: 0px 0px 5px #d0d0d0;
box-shadow: 0px 0px 5px #d0d0d0;
}
/* line 66, ../sass/distribution/_index.scss */
/* line 71, ../sass/distribution/_index.scss */
.distribution-index #loading img {
position: relative;
top: 35px;
left: 35px;
width: 30px;
height: 30px;
}
/* line 72, ../sass/distribution/_index.scss */
/* line 80, ../sass/distribution/_index.scss */
.distribution-index #calendar {
margin-bottom: 15px;
}
/* line 74, ../sass/distribution/_index.scss */
/* line 82, ../sass/distribution/_index.scss */
.distribution-index #calendar .c-header .c-title-layout .c-title-popover .c-title-anchor .c-title[data-v-2083cb72] {
font-size: 2rem;
}
/* line 77, ../sass/distribution/_index.scss */
/* line 85, ../sass/distribution/_index.scss */
.distribution-index #calendar .c-day-background {
padding: 16px;
}
/* line 84, ../sass/distribution/_index.scss */
/* line 92, ../sass/distribution/_index.scss */
.distribution-index #calendar .c-day-popover-content {
font-size: 1.3rem;
}
/* line 88, ../sass/distribution/_index.scss */
/* line 96, ../sass/distribution/_index.scss */
.distribution-index #calendar .c-title {
text-transform: uppercase;
font-family: "capsuularegular";
}
/* line 95, ../sass/distribution/_index.scss */
/* line 103, ../sass/distribution/_index.scss */
.distribution-index #products td.quantities {
width: 100px;
text-align: right;
}
/* line 99, ../sass/distribution/_index.scss */
/* line 107, ../sass/distribution/_index.scss */
.distribution-index #products input.quantity-max {
width: 50px;
text-align: center;
display: inline;
}
/* line 107, ../sass/distribution/_index.scss */
/* line 115, ../sass/distribution/_index.scss */
.distribution-index #infos-top .col-md-4 {
padding: 0px;
}
/* line 111, ../sass/distribution/_index.scss */
/* line 119, ../sass/distribution/_index.scss */
.distribution-index #infos-top .info-box {
min-height: 96px;
height: 96px;
}
/* line 114, ../sass/distribution/_index.scss */
/* line 122, ../sass/distribution/_index.scss */
.distribution-index #infos-top .info-box .info-box-icon {
height: 96px;
width: 50px;
line-height: 96px;
}
/* line 118, ../sass/distribution/_index.scss */
/* line 126, ../sass/distribution/_index.scss */
.distribution-index #infos-top .info-box .info-box-icon i.fa {
font-size: 30px;
}
/* line 122, ../sass/distribution/_index.scss */
/* line 130, ../sass/distribution/_index.scss */
.distribution-index #infos-top .info-box .info-box-content {
margin-left: 55px;
}
/* line 124, ../sass/distribution/_index.scss */
/* line 132, ../sass/distribution/_index.scss */
.distribution-index #infos-top .info-box .info-box-content .info-box-text {
font-size: 12px;
}
/* line 126, ../sass/distribution/_index.scss */
/* line 134, ../sass/distribution/_index.scss */
.distribution-index #infos-top .info-box .info-box-content .info-box-text .btn {
font-size: 12px;
text-transform: uppercase;
}
/* line 131, ../sass/distribution/_index.scss */
/* line 139, ../sass/distribution/_index.scss */
.distribution-index #infos-top .info-box .info-box-content .info-box-number {
font-size: 14px;
}
/* line 138, ../sass/distribution/_index.scss */
/* line 146, ../sass/distribution/_index.scss */
.distribution-index #infos-top #info-box-distribution .btn-active-week {
float: right;
}
/* line 148, ../sass/distribution/_index.scss */
/* line 152, ../sass/distribution/_index.scss */
.distribution-index #infos-top #summary-ca-weight .normal {
font-weight: normal;
}
/* line 162, ../sass/distribution/_index.scss */
.distribution-index #modal-products table.table thead tr td {
font-weight: bold;
}
/* line 153, ../sass/distribution/_index.scss */
/* line 167, ../sass/distribution/_index.scss */
.distribution-index #modal-products table.table td.quantity-ordered,
.distribution-index #modal-products table.table td.quantity-max {
text-align: center;
}
/* line 158, ../sass/distribution/_index.scss */
/* line 172, ../sass/distribution/_index.scss */
.distribution-index #modal-products table.table td.quantity-ordered {
width: 50px;
}
/* line 161, ../sass/distribution/_index.scss */
/* line 175, ../sass/distribution/_index.scss */
.distribution-index #modal-products table.table td.quantity-max {
width: 70px;
}
/* line 164, ../sass/distribution/_index.scss */
/* line 178, ../sass/distribution/_index.scss */
.distribution-index #modal-products table.table td.quantity-max input {
text-align: center;
}
/* line 172, ../sass/distribution/_index.scss */
/* line 185, ../sass/distribution/_index.scss */
.distribution-index #orders {
position: relative;
}
/* line 187, ../sass/distribution/_index.scss */
.distribution-index #orders #btn-add-order {
float: right;
position: absolute;
top: 9px;
right: 10px;
}
/* line 176, ../sass/distribution/_index.scss */
/* line 193, ../sass/distribution/_index.scss */
.distribution-index #orders #wrapper-nav-points-sale {
margin-bottom: 10px;
}
/* line 179, ../sass/distribution/_index.scss */
/* line 196, ../sass/distribution/_index.scss */
.distribution-index #orders #wrapper-nav-points-sale ul#nav-points-sale {
margin: 0px;
padding: 0px;
list-style-type: none;
}
/* line 184, ../sass/distribution/_index.scss */
/* line 201, ../sass/distribution/_index.scss */
.distribution-index #orders #wrapper-nav-points-sale ul#nav-points-sale li {
float: left;
margin-right: 10px;
margin-bottom: 10px;
}
/* line 189, ../sass/distribution/_index.scss */
/* line 206, ../sass/distribution/_index.scss */
.distribution-index #orders #wrapper-nav-points-sale ul#nav-points-sale li a {
position: relative;
}
/* line 193, ../sass/distribution/_index.scss */
/* line 210, ../sass/distribution/_index.scss */
.distribution-index #orders #wrapper-nav-points-sale ul#nav-points-sale li a.btn-primary .glyphicon {
display: block;
}
/* line 198, ../sass/distribution/_index.scss */
/* line 215, ../sass/distribution/_index.scss */
.distribution-index #orders #wrapper-nav-points-sale ul#nav-points-sale li a .glyphicon {
display: none;
position: absolute;
@@ -1766,7 +1800,7 @@ termes.
color: #FF7F00;
position: absolute;
}
/* line 209, ../sass/distribution/_index.scss */
/* line 226, ../sass/distribution/_index.scss */
.distribution-index #orders #wrapper-nav-points-sale ul#nav-points-sale li a .label {
background-color: white;
border: solid 1px #e0e0e0;
@@ -1774,57 +1808,61 @@ termes.
-webkit-border-radius: 10px;
border-radius: 10px;
}
/* line 222, ../sass/distribution/_index.scss */
/* line 239, ../sass/distribution/_index.scss */
.distribution-index #orders table td.column-actions {
text-align: right;
width: 200px;
width: 230px;
}
/* line 226, ../sass/distribution/_index.scss */
/* line 243, ../sass/distribution/_index.scss */
.distribution-index #orders table td.column-actions .modal-form-order,
.distribution-index #orders table td.column-actions .modal-payment {
text-align: left;
}
/* line 233, ../sass/distribution/_index.scss */
/* line 250, ../sass/distribution/_index.scss */
.distribution-index #orders table tr.view ul {
list-style-type: none;
margin-left: 0px;
padding-left: 15px;
}
/* line 249, ../sass/distribution/_index.scss */
/* line 266, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products .product-ordered td {
background-color: #e9e9e9;
}
/* line 253, ../sass/distribution/_index.scss */
/* line 270, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products .product-ordered input {
font-size: 16px;
font-weight: bold;
}
/* line 259, ../sass/distribution/_index.scss */
/* line 276, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity {
width: 150px;
}
/* line 262, ../sass/distribution/_index.scss */
/* line 279, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity input {
text-align: center;
color: gray;
}
/* line 268, ../sass/distribution/_index.scss */
/* line 285, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity-remaining {
text-align: right;
}
/* line 276, ../sass/distribution/_index.scss */
/* line 291, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order .actions-form button {
margin-left: 15px;
}
/* line 299, ../sass/distribution/_index.scss */
.distribution-index .modal-payment .info-box .info-box-icon {
width: 50px;
}
/* line 278, ../sass/distribution/_index.scss */
/* line 301, ../sass/distribution/_index.scss */
.distribution-index .modal-payment .info-box .info-box-icon i {
font-size: 30px;
}
/* line 282, ../sass/distribution/_index.scss */
/* line 305, ../sass/distribution/_index.scss */
.distribution-index .modal-payment .info-box .info-box-content {
margin-left: 50px;
}
/* line 288, ../sass/distribution/_index.scss */
/* line 311, ../sass/distribution/_index.scss */
.distribution-index .modal-mask {
position: fixed;
z-index: 9998;
@@ -1836,12 +1874,12 @@ termes.
display: table;
transition: opacity .3s ease;
}
/* line 300, ../sass/distribution/_index.scss */
/* line 323, ../sass/distribution/_index.scss */
.distribution-index .modal-wrapper {
display: table-cell;
vertical-align: middle;
}
/* line 305, ../sass/distribution/_index.scss */
/* line 328, ../sass/distribution/_index.scss */
.distribution-index .modal-container {
width: 70%;
margin: 0px auto;
@@ -1852,37 +1890,37 @@ termes.
transition: all .3s ease;
font-family: Helvetica, Arial, sans-serif;
}
/* line 316, ../sass/distribution/_index.scss */
/* line 339, ../sass/distribution/_index.scss */
.distribution-index .modal-header {
padding-bottom: 0px;
}
/* line 318, ../sass/distribution/_index.scss */
/* line 341, ../sass/distribution/_index.scss */
.distribution-index .modal-header h3 {
margin-top: 0;
color: #333;
text-transform: uppercase;
margin-bottom: 0px;
}
/* line 326, ../sass/distribution/_index.scss */
/* line 349, ../sass/distribution/_index.scss */
.distribution-index .modal-body {
margin: 20px 0;
max-height: 300px;
height: 300px;
overflow-y: scroll;
}
/* line 333, ../sass/distribution/_index.scss */
/* line 356, ../sass/distribution/_index.scss */
.distribution-index .modal-default-button {
float: right;
}
/* line 346, ../sass/distribution/_index.scss */
/* line 369, ../sass/distribution/_index.scss */
.distribution-index .modal-enter {
opacity: 0;
}
/* line 350, ../sass/distribution/_index.scss */
/* line 373, ../sass/distribution/_index.scss */
.distribution-index .modal-leave-active {
opacity: 0;
}
/* line 354, ../sass/distribution/_index.scss */
/* line 377, ../sass/distribution/_index.scss */
.distribution-index .modal-enter .modal-container,
.distribution-index .modal-leave-active .modal-container {
-webkit-transform: scale(1.1);

+ 4
- 1
backend/web/js/lechatdesnoisettes.js View File

@@ -646,7 +646,10 @@ function chat_ordre_produits() {
}) ;
console.log(tab_ordre) ;
$.get(UrlManager.getBaseUrl()+'product/order',{
/*$.get(UrlManager.getBaseUrl()+'product/order',{
array: JSON.stringify(tab_ordre)
}) ;*/
$.post(UrlManager.getBaseUrl()+'product/order',{
array: JSON.stringify(tab_ordre)
}) ;
}

+ 3
- 1
backend/web/js/vuejs/distribution-index.js View File

@@ -3,6 +3,7 @@
var app = new Vue({
el: '#app-distribution-index',
data: {
baseUrl: $('meta[name=baseurl]').attr('content'),
date: null,
dateFormat: null,
loading: true,
@@ -115,15 +116,16 @@ var app = new Vue({
this.oneDistributionWeekActive = response.data.one_distribution_week_active ;
this.countOrders = 0 ;
if(response.data.orders) {
this.orders = response.data.orders ;
this.countOrders = 0 ;
for(i=0 ; i < this.orders.length ; i++) {
if(!this.orders[i].date_delete) {
this.countOrders ++ ;
}
}
}
else {
this.orders = [] ;

+ 28
- 5
backend/web/sass/distribution/_index.scss View File

@@ -58,12 +58,20 @@ termes.
}
#loading {
position: absolute ;
top: -60px ;
position: fixed ;
top: 50% ;
left: 50% ;
margin-left: -15px ;
width: 100px ;
height: 100px ;
@include border-radius(50px) ;
background-color: white ;
z-index: 10 ;
@include box-shadow(0px 0px 5px #d0d0d0) ;
img {
position: relative ;
top: 35px ;
left: 35px ;
width: 30px ;
height: 30px ;
}
@@ -139,6 +147,12 @@ termes.
float: right ;
}
}
#summary-ca-weight {
.normal {
font-weight: normal ;
}
}
}
#modal-products {
@@ -169,8 +183,11 @@ termes.
}
#orders {
position: relative ;
#btn-add-order {
float: right ;
position: absolute ;
top: 9px ;
right: 10px ;
}
#wrapper-nav-points-sale {
@@ -221,7 +238,7 @@ termes.
table {
td.column-actions {
text-align: right ;
width: 200px ;
width: 230px ;
.modal-form-order,
.modal-payment {
@@ -269,6 +286,12 @@ termes.
text-align: right ;
}
}
.actions-form {
button {
margin-left: 15px ;
}
}
}
.modal-payment {

+ 17
- 0
backend/web/sass/product/_form.scss View File

@@ -0,0 +1,17 @@

.product-create,
.product-update {
#product-active {
label {
margin-right: 15px ;
}
}
#days-production {
.form-group {
float: left ;
margin-right: 15px ;
}
}
}


+ 1
- 0
backend/web/sass/screen.scss View File

@@ -1308,6 +1308,7 @@ a {
@import "site/_index.scss" ;
@import "subscription/_index.scss" ;
@import "product/_index.scss" ;
@import "product/_form.scss" ;
@import "stats/_products.scss" ;
@import "distribution/_index.scss" ;
@import "user/_emails.scss" ;

+ 1
- 1
common/mail/creditUser-html.php View File

@@ -48,6 +48,6 @@ use common\models\CreditHistorique;
de <?php if($creditForm->type == CreditHistory::TYPE_CREDIT): ?>créditer<?php else: ?>débiter<?php endif; ?> votre compte de <strong><?= Price::format($creditForm->amount); ?></strong> sur le site <a href="http://www.opendistrib.net/">distrib</a>.</p>

<p>Votre compte est désormais à <strong><?= Price::format($userProducer->credit); ?></strong><br />
<a href="<?= Yii::$app->urlManagerProducer->createAbsoluteUrl(['site/credit-history','slug_producer' => $producer->slug]) ?>">Cliquez ici</a> pour voir l'historique de votre crédit.</p>
<a href="<?= Yii::$app->urlManagerProducer->createAbsoluteUrl(['credit/history','slug_producer' => $producer->slug]) ?>">Cliquez ici</a> pour voir l'historique de votre crédit.</p>

<p>À bientôt.</p>

+ 1
- 1
common/mail/creditUser-text.php View File

@@ -45,6 +45,6 @@ Bonjour <?= $user->name; ?>,</p>
Votre producteur <?= $producer->name; ?> vient de <?php if($creditForm->type == CreditHistory::TYPE_CREDIT): ?>créditer<?php else: ?>débiter<?php endif; ?> votre compte de <?= Price::format($creditForm->amount); ?> sur le site http://www.laboiteapain.net/

Votre compte est désormais à : <?= Price::format($userProducer->credit); ?>.
Suivez ce lien pour voir l'historique de votre crédit : <?= Yii::$app->urlManagerProducer->createAbsoluteUrl(['site/credit-history','slug_producer' => $producer->slug]) ?>">
Suivez ce lien pour voir l'historique de votre crédit : <?= Yii::$app->urlManagerProducer->createAbsoluteUrl(['credit/history','slug_producer' => $producer->slug]) ?>">

À bientôt

+ 12
- 15
common/mail/layouts/html.php View File

@@ -51,22 +51,12 @@ use yii\helpers\Html;
<?php $this->head() ?>
<style type="text/css">
body {
padding: 0px;
margin: 0px ;
font-family: Arial ;
font-size: 14px ;
background-color: white ;
}
a {
color: #BB8757 ;
}
#header {
background-color: #F7F7F7 ;
border-bottom: 1px solid #e0e0e0 ;
height: 50px ;
text-align: center ;
color: #FF7F00 ;
}
#header .icon {
@@ -84,24 +74,31 @@ use yii\helpers\Html;
padding: 5px 15px ;
color: gray ;
border-top: dotted 1px #e0e0e0 ;
text-align: center ;
}
#link-distrib {
text-decoration: none ;
color: #FF7F00 ;
}
#link-distrib img {
width: 45px ;
}
#footer .baseline {
margin-top: 10px ;
}
</style>
</head>
<body>
<?php $this->beginBody() ?>
<div id="header">
<img class="icon" src="http://www.opendistrib.net/img/logo-distrib.png" alt="distrib" />
</div>
<div id="content">
<?= $content ?>
</div>
<div id="footer">
<p><a id="link-distrib" href="http://www.opendistrib.net/">distrib</a> | Plateforme de gestion de commandes</p>
<a id="link-distrib" href="http://www.opendistrib.net/"><img src="http://www.opendistrib-dev.net/img/logo-distrib.png" alt="distrib" /></a>
<div class="baseline">Plateforme de gestion de commandes</div>
</div>
<?php $this->endBody() ?>
</body>

+ 1
- 1
common/models/PointSale.php View File

@@ -110,7 +110,7 @@ class PointSale extends ActiveRecordCommon
'infos_saturday' => 'Samedi',
'infos_sunday' => 'Dimanche',
'restricted_access' => 'Accès restreint',
'credit' => 'Activer le Crédit Pain',
'credit' => 'Activer le Crédit',
'delivery_monday' => 'Lundi',
'delivery_tuesday' => 'Mardi',
'delivery_wednesday' => 'Mercredi',

+ 1
- 2
common/models/PointSaleDistribution.php View File

@@ -155,8 +155,7 @@ class PointSaleDistribution extends ActiveRecordCommon
($day == 4 && $pointSaleDistribution->pointSale->delivery_thursday) ||
($day == 5 && $pointSaleDistribution->pointSale->delivery_friday) ||
($day == 6 && $pointSaleDistribution->pointSale->delivery_saturday) ||
($day == 7 && $pointSaleDistribution->pointSale->delivery_sunday) ||
$pointSaleDistribution->pointSale->point_production
($day == 7 && $pointSaleDistribution->pointSale->delivery_sunday)
)) {
$pointSaleDistribution->delivery = 1;
} else {

+ 1
- 0
common/models/ProductSearch.php View File

@@ -62,6 +62,7 @@ class ProductSearch extends Product
->with($optionsSearch['with'])
->innerJoinWith($optionsSearch['join_with'], true)
->where(['product.id_producer' => Producer::getId()])
->orderBy('product.order ASC')
;
$dataProvider = new ActiveDataProvider([

Loading…
Cancel
Save