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

* *
* @param array $array * @param array $array
*/ */
public function actionOrder($array)
public function actionOrder()
{ {
$array = Yii::$app->request->post('array') ;
$orderArray = json_decode(stripslashes($array)); $orderArray = json_decode(stripslashes($array));
foreach($orderArray as $id => $order) { foreach($orderArray as $id => $order) {
$product = $this->findModel($id); $product = $this->findModel($id);
$product->order = $order; $product->order = $order;

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

</modal> </modal>
<div class="col-md-6"> <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> <span class="info-box-icon bg-yellow"><i class="fa fa-euro"></i></span>
<div class="info-box-content"> <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> </div>
</div> </div>
<div class="info-box-content"> <div class="info-box-content">
<span class="info-box-text"> <span class="info-box-text">
{{ countOrders }} Commande<span v-if="countOrders > 1">s</span><br /><br /> {{ 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> </span>
</div> </div>
</div> </div>
<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> <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>
<div class="panel-body"> <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 <order-form
v-if="showModalFormOrderCreate" v-if="showModalFormOrderCreate"
:date="date" :date="date"
<span class="label label-warning" v-if="order.date_update">modifiée</span> <span class="label label-warning" v-if="order.date_update">modifiée</span>
</td> </td>
<td class="column-actions"> <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="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="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> <button class="btn btn-default" :data-id-order="order.id" @click="updateOrderClick"><span class="glyphicon glyphicon-pencil"></span></button>
</div> </div>
</div> </div>
<div slot="footer"> <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> </div>
</modal> </modal>
</script> </script>

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

<?php else: ?><span class="label label-warning">0</span><?php endif; ?> <?php else: ?><span class="label label-warning">0</span><?php endif; ?>
</a> </a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<?php if(count($usersArray)): ?>
<li class="header">Inscriptions des 7 derniers jours</li> <li class="header">Inscriptions des 7 derniers jours</li>
<li> <li>
<ul class="menu"> <ul class="menu">
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
</li> </li>
<?php else: ?>
<li class="header">Aucun nouvel inscrit ces 7 derniers jours.</li>
<?php endif; ?>
</ul> </ul>
</li> </li>
<?php if(count($usersNegativeCreditArray)): ?><span class="label label-warning"><?= count($usersNegativeCreditArray) ?></span> <?php if(count($usersNegativeCreditArray)): ?><span class="label label-warning"><?= count($usersNegativeCreditArray) ?></span>
<?php else: ?><span class="label label-success">0</span><?php endif; ?> <?php else: ?><span class="label label-success">0</span><?php endif; ?>
</a> </a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<?php if(count($usersNegativeCreditArray)): ?>
<li class="header">Utilisateurs au crédit négatif</li> <li class="header">Utilisateurs au crédit négatif</li>
<li> <li>
<ul class="menu"> <ul class="menu">
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
</li> </li>
<?php else: ?>
<li class="header">Aucun de vos utilisateurs n'a de crédit négatif.</li>
<?php endif; ?>
</ul> </ul>
</li> </li>
<?php if (User::isCurrentProducer() || User::isCurrentAdmin()): ?> <?php if (User::isCurrentProducer() || User::isCurrentAdmin()): ?>
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-home"></i> <i class="fa fa-home"></i>
<span><?= Html::encode(Yii::$app->user->identity->getNameProducer()); ?></span> <span><?= Html::encode(Yii::$app->user->identity->getNameProducer()); ?></span>
<i class="fa fa-caret-down"></i>
</a> </a>
<?php if(User::isCurrentAdmin()): ?>
<ul class="dropdown-menu"> <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> </ul>
<?php endif; ?>
</li> </li>
<?php endif; ?> <?php endif; ?>
<!-- User Account: style can be found in dropdown.less -->
<li class="dropdown user user-menu"> <li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-user"></i> <i class="fa fa-user"></i>
<span class="hidden-xs"><?= Html::encode(User::getCurrent()->name.' '.User::getCurrent()->lastname) ; ?></span> <span class="hidden-xs"><?= Html::encode(User::getCurrent()->name.' '.User::getCurrent()->lastname) ; ?></span>
<i class="fa fa-caret-down"></i>
</a> </a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a href="<?= Yii::$app->urlManagerFrontend->createAbsoluteUrl(['user/update']); ?>"><i class="fa fa-user"></i> Profil</a></li> <li><a href="<?= Yii::$app->urlManagerFrontend->createAbsoluteUrl(['user/update']); ?>"><i class="fa fa-user"></i> Profil</a></li>
</ul> </ul>
</li> </li>


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

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

<meta name="baseurl" content="<?= Yii::$app->urlManagerBackend->baseUrl ; ?>"> <meta name="baseurl" content="<?= Yii::$app->urlManagerBackend->baseUrl ; ?>">
<meta name="baseurl-absolute" content="<?= Yii::$app->urlManagerBackend->getHostInfo().Yii::$app->urlManagerBackend->baseUrl; ?>"> <meta name="baseurl-absolute" content="<?= Yii::$app->urlManagerBackend->getHostInfo().Yii::$app->urlManagerBackend->baseUrl; ?>">
<?= Html::csrfMetaTags() ?> <?= 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" /> <link rel="icon" type="image/png" href="<?php echo Yii::$app->urlManagerBackend->getBaseUrl(); ?>/img/favicon-distrib.png" />
<?php $this->head() ?> <?php $this->head() ?>
</head> </head>

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

<?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

<?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

<?= $form->field($model, 'locality')->textInput(['maxlength' => 255]) ?> <?= $form->field($model, 'locality')->textInput(['maxlength' => 255]) ?>
<?= $form->field($model, 'address')->textarea(['rows' => 6]) ?> <?= $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 <?php
$addHintCredit = '' ; $addHintCredit = '' ;
if(!Producer::getConfig('credit')): if(!Producer::getConfig('credit')):
echo $form->field($model, 'credit') echo $form->field($model, 'credit')
->checkbox() ->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); .$addHintCredit);
?> ?>

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

'columns' => [ 'columns' => [
'name', 'name',
'locality', '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', 'attribute' => 'delivery',
'label' => 'Livraison', 'label' => 'Livraison',

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



?> ?>


<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>


<div id="free-price" class=""> <div id="free-price" class="">
<?php if($alertFreePrice): ?> <?php if($alertFreePrice): ?>
<div class="alert alert-success"> <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): ?> <?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>. Vos prochaines factures mensuelles auront un montant de <strong><?= number_format(Html::encode($producer->free_price),2).' € HT' ; ?></strong>.
<?php endif; ?> <?php endif; ?>

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

'value' => function($model) { 'value' => function($model) {
if(strlen($model->photo)) { if(strlen($model->photo)) {
$url = Yii::$app->urlManagerProducer->getHostInfo().'/'.Yii::$app->urlManagerProducer->baseUrl ; $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 '' ; return '' ;
} }

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

<span class="info-box-number"></span> <span class="info-box-number"></span>
<div class="buttons"> <div class="buttons">
<?= Html::a('<span class="fa fa-eye"></span>', ['distribution/index', 'date' => $distribution->date], ['class' => 'btn btn-default']); ?> <?= 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> </div>
</div> </div>
<th></th> <th></th>
<th>Date</th> <th>Date</th>
<th>Client</th> <th>Client</th>
<th>Historique</th>
<th>Produits</th> <th>Produits</th>
<th>Point de vente</th> <th>Point de vente</th>
<th>Montant</th> <th>Montant</th>
<th>Historique</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<td> <td>
<?= $order->getStrUser(); ?><br /> <?= $order->getStrUser(); ?><br />
</td> </td>
<td class="history"><?= $order->getStrHistory() ; ?></td>
<td><?= $order->getCartSummary() ; ?></td> <td><?= $order->getCartSummary() ; ?></td>
<td><?= $order->getPointSaleSummary() ; ?></td> <td><?= $order->getPointSaleSummary() ; ?></td>
<td><?= $order->getAmount(Order::AMOUNT_TOTAL, true) ; ?></td> <td><?= $order->getAmount(Order::AMOUNT_TOTAL, true) ; ?></td>
<td class="history"><?= $order->getStrHistory() ; ?></td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>

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

background-color: white; 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) Copyright distrib (2018)


} }
/* line 60, ../sass/distribution/_index.scss */ /* line 60, ../sass/distribution/_index.scss */
.distribution-index #loading { .distribution-index #loading {
position: absolute;
top: -60px;
position: fixed;
top: 50%;
left: 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 { .distribution-index #loading img {
position: relative;
top: 35px;
left: 35px;
width: 30px; width: 30px;
height: 30px; height: 30px;
} }
/* line 72, ../sass/distribution/_index.scss */
/* line 80, ../sass/distribution/_index.scss */
.distribution-index #calendar { .distribution-index #calendar {
margin-bottom: 15px; 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] { .distribution-index #calendar .c-header .c-title-layout .c-title-popover .c-title-anchor .c-title[data-v-2083cb72] {
font-size: 2rem; font-size: 2rem;
} }
/* line 77, ../sass/distribution/_index.scss */
/* line 85, ../sass/distribution/_index.scss */
.distribution-index #calendar .c-day-background { .distribution-index #calendar .c-day-background {
padding: 16px; padding: 16px;
} }
/* line 84, ../sass/distribution/_index.scss */
/* line 92, ../sass/distribution/_index.scss */
.distribution-index #calendar .c-day-popover-content { .distribution-index #calendar .c-day-popover-content {
font-size: 1.3rem; font-size: 1.3rem;
} }
/* line 88, ../sass/distribution/_index.scss */
/* line 96, ../sass/distribution/_index.scss */
.distribution-index #calendar .c-title { .distribution-index #calendar .c-title {
text-transform: uppercase; text-transform: uppercase;
font-family: "capsuularegular"; font-family: "capsuularegular";
} }
/* line 95, ../sass/distribution/_index.scss */
/* line 103, ../sass/distribution/_index.scss */
.distribution-index #products td.quantities { .distribution-index #products td.quantities {
width: 100px; width: 100px;
text-align: right; text-align: right;
} }
/* line 99, ../sass/distribution/_index.scss */
/* line 107, ../sass/distribution/_index.scss */
.distribution-index #products input.quantity-max { .distribution-index #products input.quantity-max {
width: 50px; width: 50px;
text-align: center; text-align: center;
display: inline; display: inline;
} }
/* line 107, ../sass/distribution/_index.scss */
/* line 115, ../sass/distribution/_index.scss */
.distribution-index #infos-top .col-md-4 { .distribution-index #infos-top .col-md-4 {
padding: 0px; padding: 0px;
} }
/* line 111, ../sass/distribution/_index.scss */
/* line 119, ../sass/distribution/_index.scss */
.distribution-index #infos-top .info-box { .distribution-index #infos-top .info-box {
min-height: 96px; min-height: 96px;
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 { .distribution-index #infos-top .info-box .info-box-icon {
height: 96px; height: 96px;
width: 50px; width: 50px;
line-height: 96px; 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 { .distribution-index #infos-top .info-box .info-box-icon i.fa {
font-size: 30px; font-size: 30px;
} }
/* line 122, ../sass/distribution/_index.scss */
/* line 130, ../sass/distribution/_index.scss */
.distribution-index #infos-top .info-box .info-box-content { .distribution-index #infos-top .info-box .info-box-content {
margin-left: 55px; 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 { .distribution-index #infos-top .info-box .info-box-content .info-box-text {
font-size: 12px; 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 { .distribution-index #infos-top .info-box .info-box-content .info-box-text .btn {
font-size: 12px; font-size: 12px;
text-transform: uppercase; 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 { .distribution-index #infos-top .info-box .info-box-content .info-box-number {
font-size: 14px; 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 { .distribution-index #infos-top #info-box-distribution .btn-active-week {
float: right; 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 { .distribution-index #modal-products table.table thead tr td {
font-weight: bold; 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-ordered,
.distribution-index #modal-products table.table td.quantity-max { .distribution-index #modal-products table.table td.quantity-max {
text-align: center; text-align: center;
} }
/* line 158, ../sass/distribution/_index.scss */
/* line 172, ../sass/distribution/_index.scss */
.distribution-index #modal-products table.table td.quantity-ordered { .distribution-index #modal-products table.table td.quantity-ordered {
width: 50px; width: 50px;
} }
/* line 161, ../sass/distribution/_index.scss */
/* line 175, ../sass/distribution/_index.scss */
.distribution-index #modal-products table.table td.quantity-max { .distribution-index #modal-products table.table td.quantity-max {
width: 70px; width: 70px;
} }
/* line 164, ../sass/distribution/_index.scss */
/* line 178, ../sass/distribution/_index.scss */
.distribution-index #modal-products table.table td.quantity-max input { .distribution-index #modal-products table.table td.quantity-max input {
text-align: center; 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 { .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 { .distribution-index #orders #wrapper-nav-points-sale {
margin-bottom: 10px; 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 { .distribution-index #orders #wrapper-nav-points-sale ul#nav-points-sale {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
list-style-type: none; 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 { .distribution-index #orders #wrapper-nav-points-sale ul#nav-points-sale li {
float: left; float: left;
margin-right: 10px; margin-right: 10px;
margin-bottom: 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 { .distribution-index #orders #wrapper-nav-points-sale ul#nav-points-sale li a {
position: relative; 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 { .distribution-index #orders #wrapper-nav-points-sale ul#nav-points-sale li a.btn-primary .glyphicon {
display: block; 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 { .distribution-index #orders #wrapper-nav-points-sale ul#nav-points-sale li a .glyphicon {
display: none; display: none;
position: absolute; position: absolute;
color: #FF7F00; color: #FF7F00;
position: absolute; 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 { .distribution-index #orders #wrapper-nav-points-sale ul#nav-points-sale li a .label {
background-color: white; background-color: white;
border: solid 1px #e0e0e0; border: solid 1px #e0e0e0;
-webkit-border-radius: 10px; -webkit-border-radius: 10px;
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 { .distribution-index #orders table td.column-actions {
text-align: right; 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-form-order,
.distribution-index #orders table td.column-actions .modal-payment { .distribution-index #orders table td.column-actions .modal-payment {
text-align: left; text-align: left;
} }
/* line 233, ../sass/distribution/_index.scss */
/* line 250, ../sass/distribution/_index.scss */
.distribution-index #orders table tr.view ul { .distribution-index #orders table tr.view ul {
list-style-type: none; list-style-type: none;
margin-left: 0px; margin-left: 0px;
padding-left: 15px; 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 { .distribution-index .modal-form-order table.table-products .product-ordered td {
background-color: #e9e9e9; 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 { .distribution-index .modal-form-order table.table-products .product-ordered input {
font-size: 16px; font-size: 16px;
font-weight: bold; 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 { .distribution-index .modal-form-order table.table-products td.quantity {
width: 150px; 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 { .distribution-index .modal-form-order table.table-products td.quantity input {
text-align: center; text-align: center;
color: gray; 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 { .distribution-index .modal-form-order table.table-products td.quantity-remaining {
text-align: right; 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 { .distribution-index .modal-payment .info-box .info-box-icon {
width: 50px; width: 50px;
} }
/* line 278, ../sass/distribution/_index.scss */
/* line 301, ../sass/distribution/_index.scss */
.distribution-index .modal-payment .info-box .info-box-icon i { .distribution-index .modal-payment .info-box .info-box-icon i {
font-size: 30px; font-size: 30px;
} }
/* line 282, ../sass/distribution/_index.scss */
/* line 305, ../sass/distribution/_index.scss */
.distribution-index .modal-payment .info-box .info-box-content { .distribution-index .modal-payment .info-box .info-box-content {
margin-left: 50px; margin-left: 50px;
} }
/* line 288, ../sass/distribution/_index.scss */
/* line 311, ../sass/distribution/_index.scss */
.distribution-index .modal-mask { .distribution-index .modal-mask {
position: fixed; position: fixed;
z-index: 9998; z-index: 9998;
display: table; display: table;
transition: opacity .3s ease; transition: opacity .3s ease;
} }
/* line 300, ../sass/distribution/_index.scss */
/* line 323, ../sass/distribution/_index.scss */
.distribution-index .modal-wrapper { .distribution-index .modal-wrapper {
display: table-cell; display: table-cell;
vertical-align: middle; vertical-align: middle;
} }
/* line 305, ../sass/distribution/_index.scss */
/* line 328, ../sass/distribution/_index.scss */
.distribution-index .modal-container { .distribution-index .modal-container {
width: 70%; width: 70%;
margin: 0px auto; margin: 0px auto;
transition: all .3s ease; transition: all .3s ease;
font-family: Helvetica, Arial, sans-serif; font-family: Helvetica, Arial, sans-serif;
} }
/* line 316, ../sass/distribution/_index.scss */
/* line 339, ../sass/distribution/_index.scss */
.distribution-index .modal-header { .distribution-index .modal-header {
padding-bottom: 0px; padding-bottom: 0px;
} }
/* line 318, ../sass/distribution/_index.scss */
/* line 341, ../sass/distribution/_index.scss */
.distribution-index .modal-header h3 { .distribution-index .modal-header h3 {
margin-top: 0; margin-top: 0;
color: #333; color: #333;
text-transform: uppercase; text-transform: uppercase;
margin-bottom: 0px; margin-bottom: 0px;
} }
/* line 326, ../sass/distribution/_index.scss */
/* line 349, ../sass/distribution/_index.scss */
.distribution-index .modal-body { .distribution-index .modal-body {
margin: 20px 0; margin: 20px 0;
max-height: 300px; max-height: 300px;
height: 300px; height: 300px;
overflow-y: scroll; overflow-y: scroll;
} }
/* line 333, ../sass/distribution/_index.scss */
/* line 356, ../sass/distribution/_index.scss */
.distribution-index .modal-default-button { .distribution-index .modal-default-button {
float: right; float: right;
} }
/* line 346, ../sass/distribution/_index.scss */
/* line 369, ../sass/distribution/_index.scss */
.distribution-index .modal-enter { .distribution-index .modal-enter {
opacity: 0; opacity: 0;
} }
/* line 350, ../sass/distribution/_index.scss */
/* line 373, ../sass/distribution/_index.scss */
.distribution-index .modal-leave-active { .distribution-index .modal-leave-active {
opacity: 0; opacity: 0;
} }
/* line 354, ../sass/distribution/_index.scss */
/* line 377, ../sass/distribution/_index.scss */
.distribution-index .modal-enter .modal-container, .distribution-index .modal-enter .modal-container,
.distribution-index .modal-leave-active .modal-container { .distribution-index .modal-leave-active .modal-container {
-webkit-transform: scale(1.1); -webkit-transform: scale(1.1);

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

}) ; }) ;
console.log(tab_ordre) ; 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) array: JSON.stringify(tab_ordre)
}) ; }) ;
} }

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

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

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

} }
#loading { #loading {
position: absolute ;
top: -60px ;
position: fixed ;
top: 50% ;
left: 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 { img {
position: relative ;
top: 35px ;
left: 35px ;
width: 30px ; width: 30px ;
height: 30px ; height: 30px ;
} }
float: right ; float: right ;
} }
} }
#summary-ca-weight {
.normal {
font-weight: normal ;
}
}
} }
#modal-products { #modal-products {
} }
#orders { #orders {
position: relative ;
#btn-add-order { #btn-add-order {
float: right ;
position: absolute ;
top: 9px ;
right: 10px ;
} }
#wrapper-nav-points-sale { #wrapper-nav-points-sale {
table { table {
td.column-actions { td.column-actions {
text-align: right ; text-align: right ;
width: 200px ;
width: 230px ;
.modal-form-order, .modal-form-order,
.modal-payment { .modal-payment {
text-align: right ; text-align: right ;
} }
} }
.actions-form {
button {
margin-left: 15px ;
}
}
} }
.modal-payment { .modal-payment {

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


.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

@import "site/_index.scss" ; @import "site/_index.scss" ;
@import "subscription/_index.scss" ; @import "subscription/_index.scss" ;
@import "product/_index.scss" ; @import "product/_index.scss" ;
@import "product/_form.scss" ;
@import "stats/_products.scss" ; @import "stats/_products.scss" ;
@import "distribution/_index.scss" ; @import "distribution/_index.scss" ;
@import "user/_emails.scss" ; @import "user/_emails.scss" ;

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

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> 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 /> <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> <p>À bientôt.</p>

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

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 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); ?>. 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 À bientôt

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

<?php $this->head() ?> <?php $this->head() ?>
<style type="text/css"> <style type="text/css">
body { body {
padding: 0px;
margin: 0px ;
font-family: Arial ; font-family: Arial ;
font-size: 14px ; font-size: 14px ;
background-color: white ;
} }
a { a {
color: #BB8757 ;
}
#header {
background-color: #F7F7F7 ;
border-bottom: 1px solid #e0e0e0 ;
height: 50px ;
text-align: center ;
color: #FF7F00 ;
} }
#header .icon { #header .icon {
padding: 5px 15px ; padding: 5px 15px ;
color: gray ; color: gray ;
border-top: dotted 1px #e0e0e0 ; border-top: dotted 1px #e0e0e0 ;
text-align: center ;
} }
#link-distrib { #link-distrib {
text-decoration: none ; text-decoration: none ;
color: #FF7F00 ; color: #FF7F00 ;
} }
#link-distrib img {
width: 45px ;
}
#footer .baseline {
margin-top: 10px ;
}
</style> </style>
</head> </head>
<body> <body>
<?php $this->beginBody() ?> <?php $this->beginBody() ?>
<div id="header">
<img class="icon" src="http://www.opendistrib.net/img/logo-distrib.png" alt="distrib" />
</div>
<div id="content"> <div id="content">
<?= $content ?> <?= $content ?>
</div> </div>
<div id="footer"> <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> </div>
<?php $this->endBody() ?> <?php $this->endBody() ?>
</body> </body>

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

'infos_saturday' => 'Samedi', 'infos_saturday' => 'Samedi',
'infos_sunday' => 'Dimanche', 'infos_sunday' => 'Dimanche',
'restricted_access' => 'Accès restreint', 'restricted_access' => 'Accès restreint',
'credit' => 'Activer le Crédit Pain',
'credit' => 'Activer le Crédit',
'delivery_monday' => 'Lundi', 'delivery_monday' => 'Lundi',
'delivery_tuesday' => 'Mardi', 'delivery_tuesday' => 'Mardi',
'delivery_wednesday' => 'Mercredi', 'delivery_wednesday' => 'Mercredi',

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

($day == 4 && $pointSaleDistribution->pointSale->delivery_thursday) || ($day == 4 && $pointSaleDistribution->pointSale->delivery_thursday) ||
($day == 5 && $pointSaleDistribution->pointSale->delivery_friday) || ($day == 5 && $pointSaleDistribution->pointSale->delivery_friday) ||
($day == 6 && $pointSaleDistribution->pointSale->delivery_saturday) || ($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; $pointSaleDistribution->delivery = 1;
} else { } else {

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

->with($optionsSearch['with']) ->with($optionsSearch['with'])
->innerJoinWith($optionsSearch['join_with'], true) ->innerJoinWith($optionsSearch['join_with'], true)
->where(['product.id_producer' => Producer::getId()]) ->where(['product.id_producer' => Producer::getId()])
->orderBy('product.order ASC')
; ;
$dataProvider = new ActiveDataProvider([ $dataProvider = new ActiveDataProvider([

Loading…
Cancel
Save