Browse Source

Merge branch 'dev'

master
Guillaume Bourgeois 5 years ago
parent
commit
72ba7aee84
15 changed files with 310 additions and 138 deletions
  1. +12
    -5
      backend/controllers/DistributionController.php
  2. +7
    -3
      backend/controllers/SubscriptionController.php
  3. +7
    -7
      backend/views/distribution/index.php
  4. +71
    -0
      backend/views/layouts/header.php
  5. +1
    -0
      backend/views/user/credit.php
  6. +4
    -0
      backend/web/js/vuejs/distribution-index.js
  7. +2
    -0
      common/models/CreditHistory.php
  8. +2
    -2
      common/models/Distribution.php
  9. +33
    -0
      common/models/User.php
  10. +23
    -1
      producer/controllers/OrderController.php
  11. +2
    -1
      producer/views/order/order.php
  12. +115
    -112
      producer/web/css/screen.css
  13. +26
    -4
      producer/web/js/vuejs/order-order.js
  14. +0
    -1
      producer/web/sass/_layout.scss
  15. +5
    -2
      producer/web/sass/order/_order.scss

+ 12
- 5
backend/controllers/DistributionController.php View File

@@ -160,13 +160,15 @@ class DistributionController extends BackendController
$potentialRevenues = 0;
$potentialWeight = 0;
foreach($productsArray as &$theProduct) {
$quantityOrder = Order::getProductQuantity($theProduct['id'], $ordersArray) ;
$theProduct['quantity_ordered'] = $quantityOrder ;
if(!isset($theProduct['productDistribution'][0])) {
$theProduct['productDistribution'][0] = $distribution->linkProduct($theProduct) ;
$theProductObject = (object) $theProduct ;
$theProduct['productDistribution'][0] = $distribution->linkProduct($theProductObject) ;
}
if(!is_numeric($theProduct['productDistribution'][0]['quantity_max'])) {
@@ -200,9 +202,6 @@ class DistributionController extends BackendController
] ;
}
/*$productOrderArray = \yii\helpers\ArrayHelper::map($order->productOrder, 'id_product', 'quantity') ;
*/
foreach($productsArray as $product) {
if(!isset($productOrderArray[$product['id']])) {
$productOrderArray[$product['id']] = [
@@ -292,6 +291,14 @@ class DistributionController extends BackendController
// utilisateurs
$usersArray = User::findBy()->all() ;
foreach($usersArray as &$user) {
$userObject = User::findOne(['id' => $user['user_id']]) ;
$favoritePointSale = $userObject->getFavoritePointSale() ;
if($favoritePointSale) {
$user['id_point_sale_favorite'] = $favoritePointSale->id ;
}
}
$json['users'] = $usersArray ;
// une production de la semaine activée ou non

+ 7
- 3
backend/controllers/SubscriptionController.php View File

@@ -117,7 +117,9 @@ class SubscriptionController extends BackendController
}
// produits
$productsArray = Product::searchAll() ;
$productsArray = Product::searchAll([], [
'orderby' => 'product.order ASC'
]) ;
if ($model->load(Yii::$app->request->post()) && $model->validate()
&& $model->save())
@@ -191,7 +193,9 @@ class SubscriptionController extends BackendController
}

// produits
$productsArray = Product::searchAll() ;
$productsArray = Product::searchAll([], [
'orderby' => 'product.order ASC'
]) ;

if ($model->load(Yii::$app->request->post()) && $model->validate()) {
if (!strlen($model->date_end)) {
@@ -270,7 +274,7 @@ class SubscriptionController extends BackendController
}]) ;
}
$productsArray = $productsQuery->asArray()->all() ;
$productsArray = $productsQuery->asArray()->orderBy('order ASC')->all() ;
foreach($productsArray as &$theProduct) {
$theProduct['unit_save'] = $theProduct['unit'] ;

+ 7
- 7
backend/views/distribution/index.php View File

@@ -455,12 +455,6 @@ $this->setPageTitle('Distributions') ;
</ul>
</div>
<div class="col-md-4">
<div class="form-group">
<label class="control-label" for="select-id-point-sale">Point de vente</label>
<select class="form-control" id="select-id-point-sale" v-model="order.id_point_sale">
<option v-for="pointSale in pointsSale" v-if="pointSale.pointSaleDistribution[0].delivery == 1" :value="pointSale.id">{{ pointSale.name }}</option>
</select>
</div>
<div class="form-group">
<a v-if="producer.credit && order.id_user > 0" class="btn btn-xs btn-primary btn-credit" :href="baseUrl+'/user/credit?id='+user.id_user" v-for="user in users" v-if="user.id_user == order.id_user">{{ parseFloat(user.credit).toFixed(2).replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+'&nbsp;€' }}</a>
<label class="control-label" for="select-id-user">
@@ -468,10 +462,16 @@ $this->setPageTitle('Distributions') ;
</label>
<select class="form-control" v-model="order.id_user">
<option value="0">--</option>
<option v-for="user in users" :value="user.id_user">{{ user.lastname +' '+ user.name }}</option>
<option v-for="user in users" :value="user.id_user" @click="userChange" :data-id-point-sale-favorite="user.id_point_sale_favorite">{{ user.lastname +' '+ user.name }}</option>
</select>
<input v-model="order.username" type="text" class="form-control" placeholder="Ou saisissez ici le nom de l'utilisateur" />
</div>
<div class="form-group">
<label class="control-label" for="select-id-point-sale">Point de vente</label>
<select class="form-control" id="select-id-point-sale" v-model="order.id_point_sale">
<option v-for="pointSale in pointsSale" v-if="pointSale.pointSaleDistribution[0].delivery == 1" :value="pointSale.id">{{ pointSale.name }}</option>
</select>
</div>
<div class="form-group">
<label class="control-label" for="textarea-comment">Commentaire</label>
<textarea class="form-control" id="textarea-comment" v-model="order.comment"></textarea>

+ 71
- 0
backend/views/layouts/header.php View File

@@ -70,6 +70,77 @@ $producer = Producer::getCurrent() ;
?>
<ul class="nav navbar-nav">
<?php
$pastDistributionsArray = Distribution::find()
->with('order')
->where(['<', 'distribution.date', date('Y-m-d')])
->andWhere([
'distribution.id_producer' => Producer::getId(),
'distribution.active' => 1
])
->orderBy('date DESC')
->limit(3)
->all();
$pastDistributionsArray = array_reverse($pastDistributionsArray) ;
$incomingDistributionsArray = Distribution::find()
->with('order')
->where(['>=', 'distribution.date', date('Y-m-d')])
->andWhere([
'distribution.id_producer' => Producer::getId(),
'distribution.active' => 1
])
->orderBy('date ASC')
->limit(20)
->all();
?>
<li class="dropdown distributions-menu notifications-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-calendar"></i>
</a>
<ul class="dropdown-menu">
<?php if(count($pastDistributionsArray)): ?>
<li class="header">3 dernières distributions :</li>
<li>
<ul class="menu">
<?php foreach($pastDistributionsArray as $distribution): ?>
<li>
<a href="<?= Yii::$app->urlManagerBackend->createUrl(['distribution/index','date' => $distribution->date]) ; ?>">
<h5><?= strftime('%A %d %B', strtotime($distribution->date)) ?></h5>
</a>
</li>
<?php endforeach; ?>
</ul>
</li>
<?php endif; ?>
<?php if(count($incomingDistributionsArray)): ?>
<li class="header">Prochaines distributions :</li>
<li>
<ul class="menu">
<?php foreach($incomingDistributionsArray as $distribution): ?>
<li>
<a href="<?= Yii::$app->urlManagerBackend->createUrl(['distribution/index','date' => $distribution->date]) ; ?>">
<h5><?= strftime('%A %d %B', strtotime($distribution->date)) ?></h5>
</a>
</li>
<?php endforeach; ?>
</ul>
</li>
<?php else: ?>
<li class="header">
Aucune distribution prévue.<br />
<a class="btn btn-default" href="<?= Yii::$app->urlManagerBackend->createUrl(['distribution/index']) ; ?>">Gérer mes distributions</a>
</li>
<?php endif; ?>
</ul>
</li>
<li class="dropdown users-menu notifications-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-user-plus"></i>

+ 1
- 0
backend/views/user/credit.php View File

@@ -94,6 +94,7 @@ $this->addBreadcrumb('Créditer') ;
CreditHistory::MEAN_PAYMENT_MONEY => CreditHistory::getStrMeanPaymentBy(CreditHistory::MEAN_PAYMENT_MONEY),
CreditHistory::MEAN_PAYMENT_CREDIT_CARD => CreditHistory::getStrMeanPaymentBy(CreditHistory::MEAN_PAYMENT_CREDIT_CARD),
CreditHistory::MEAN_PAYMENT_CHEQUE => CreditHistory::getStrMeanPaymentBy(CreditHistory::MEAN_PAYMENT_CHEQUE),
CreditHistory::MEAN_PAYMENT_TRANSFER => CreditHistory::getStrMeanPaymentBy(CreditHistory::MEAN_PAYMENT_TRANSFER),
CreditHistory::MEAN_PAYMENT_OTHER => CreditHistory::getStrMeanPaymentBy(CreditHistory::MEAN_PAYMENT_OTHER),
]) ?>
<?= $form->field($creditForm, 'comment')->textarea() ?>

+ 4
- 0
backend/web/js/vuejs/distribution-index.js View File

@@ -512,6 +512,10 @@ Vue.component('order-form',{
var theQuantity = parseFloat(this.order.productOrder[id_product].quantity) + parseFloat(quantity) ;
Vue.set(this.order.productOrder, id_product, {quantity: theQuantity, unit: this.order.productOrder[id_product].unit});
}
},
userChange: function(event) {
var idPointSaleFavorite = event.currentTarget.getAttribute('data-id-point-sale-favorite') ;
this.order.id_point_sale = idPointSaleFavorite ;
}
}
}) ;

+ 2
- 0
common/models/CreditHistory.php View File

@@ -70,6 +70,7 @@ class CreditHistory extends ActiveRecordCommon
const MEAN_PAYMENT_CREDIT_CARD = 'credit-card';
const MEAN_PAYMENT_MONEY = 'money';
const MEAN_PAYMENT_CHEQUE = 'cheque';
const MEAN_PAYMENT_TRANSFER = 'transfer';
const MEAN_PAYMENT_OTHER = 'other';
/**
@@ -367,6 +368,7 @@ class CreditHistory extends ActiveRecordCommon
case CreditHistory::MEAN_PAYMENT_MONEY : return 'Espèces' ;
case CreditHistory::MEAN_PAYMENT_CHEQUE : return 'Chèque' ;
case CreditHistory::MEAN_PAYMENT_CREDIT_CARD : return 'Carte bancaire' ;
case CreditHistory::MEAN_PAYMENT_TRANSFER : return 'Virement' ;
case CreditHistory::MEAN_PAYMENT_OTHER : return 'Autre' ;
default: return 'Crédit' ;
}

+ 2
- 2
common/models/Distribution.php View File

@@ -242,12 +242,12 @@ class Distribution extends ActiveRecordCommon
* @param Product $product
*/
public function linkProduct($product)
{
{
$productDistribution = ProductDistribution::searchOne([
'id_distribution' => $this->id,
'id_product' => $product->id
]) ;
if(!$productDistribution) {
$productDistribution = new ProductDistribution();
$productDistribution->id_distribution = $this->id;

+ 33
- 0
common/models/User.php View File

@@ -581,6 +581,39 @@ class User extends ActiveRecordCommon implements IdentityInterface

return 0;
}
/**
* Retourne le point de vente favoris d'un utilisateur : le point de vente auquel le client est lié,
* le point de vente de la dernière commande sinon.
*
* @return PointSale
*/
public function getFavoritePointSale()
{
$arrayUserPointSale = UserPointSale::find()->where(['id_user' => $this->id])->all() ;
if(count($arrayUserPointSale) == 1) {
$pointSale = PointSale::findOne(['id' => $arrayUserPointSale[0]->id_point_sale]) ;
}
else {
$lastOrder = Order::find()->innerJoinWith('pointSale', true)->where([
'id_user' => $this->id,
'point_sale.id_producer' => Producer::getId()
])
->orderBy('order.id DESC')
->one() ;
if($lastOrder) {
$pointSale = PointSale::findOne(['id' => $lastOrder->id_point_sale]) ;
}
}
if(isset($pointSale)) {
return $pointSale ;
}
return false ;
}

/**
* Met à jour la date de dernière connexion de l'utilisateur.

+ 23
- 1
producer/controllers/OrderController.php View File

@@ -568,7 +568,29 @@ class OrderController extends ProducerBaseController
}
}
$json['points_sale'] = $pointsSaleArray;
$favoritePointSale = User::getCurrent()->getFavoritePointSale() ;
if($favoritePointSale) {
$newPointSaleArray = [] ;
foreach($pointsSaleArray as $pointSale) {
if($pointSale['id'] != $favoritePointSale->id) {
$newPointSaleArray[] = $pointSale ;
}
else {
$theFavoritePointSale = $pointSale ;
}
}
if(isset($theFavoritePointSale)) {
array_unshift($newPointSaleArray, $theFavoritePointSale) ;
}
}
else {
$newPointSaleArray = $pointsSaleArray ;
}
$json['points_sale'] = $newPointSaleArray;
// Commandes totales
$ordersArray = Order::searchAll([

+ 2
- 1
producer/views/order/order.php View File

@@ -125,6 +125,7 @@ $this->setTitle('Commander') ;
Chargement ...
</div>
<div v-else>
<h3>Où souhaitez-vous récupérer votre commande ?</h3>
<table id="points-sale" class="table table-bordered" v-if="pointsSale.length">
<thead>
<tr>
@@ -134,7 +135,7 @@ $this->setTitle('Commander') ;
</tr>
</thead>
<tbody>
<tr v-for="pointSale in pointsSale" v-if="pointSale && pointSale.pointSaleDistribution.delivery" :class="(pointSaleActive && pointSale.id == pointSaleActive.id) ? 'selected' : ''">
<tr v-for="pointSale in orderedPointsSale" v-if="pointSale && pointSale.pointSaleDistribution.delivery" :class="(pointSaleActive && pointSale.id == pointSaleActive.id) ? 'selected' : ''">
<td class="name">
<span class="the-name">{{ pointSale.name }}</span>
<div class="comment" v-if="pointSale.userPointSale">

+ 115
- 112
producer/web/css/screen.css View File

@@ -499,7 +499,6 @@ ul.pagination li a:hover, ul.pagination li a:focus, ul.pagination li a:active {
}
/* line 417, ../sass/_layout.scss */
#main #content h3 {
font-family: "highvoltageregular";
font-family: "capsuularegular";
text-transform: uppercase;
font-size: 23px;
@@ -507,29 +506,29 @@ ul.pagination li a:hover, ul.pagination li a:focus, ul.pagination li a:active {
margin-bottom: 30px;
margin-top: 45px;
}
/* line 426, ../sass/_layout.scss */
/* line 425, ../sass/_layout.scss */
#main #content h3 span {
padding-top: 14px;
color: #323232;
}
/* line 432, ../sass/_layout.scss */
/* line 431, ../sass/_layout.scss */
#main #content h4 {
font-size: 20px;
}
/* line 436, ../sass/_layout.scss */
/* line 435, ../sass/_layout.scss */
#main #content h5 {
font-size: 18px;
}
/* line 440, ../sass/_layout.scss */
/* line 439, ../sass/_layout.scss */
#main #content h6 {
font-size: 16px;
}
/* line 446, ../sass/_layout.scss */
/* line 445, ../sass/_layout.scss */
#main #content form .form-group .hint-block {
color: gray;
}

/* line 454, ../sass/_layout.scss */
/* line 453, ../sass/_layout.scss */
#footer-producer {
text-align: center;
position: absolute;
@@ -537,28 +536,28 @@ ul.pagination li a:hover, ul.pagination li a:focus, ul.pagination li a:active {
left: 0px;
width: 100%;
}
/* line 461, ../sass/_layout.scss */
/* line 460, ../sass/_layout.scss */
#footer-producer a {
color: #FF7F00;
}
/* line 463, ../sass/_layout.scss */
/* line 462, ../sass/_layout.scss */
#footer-producer a:active {
text-decoration: underline;
}

/* line 469, ../sass/_layout.scss */
/* line 468, ../sass/_layout.scss */
#footer {
background-color: #FFF8DC;
height: 100px;
float: right;
text-align: center;
}
/* line 475, ../sass/_layout.scss */
/* line 474, ../sass/_layout.scss */
#footer .content {
padding-top: 20px;
color: black;
}
/* line 479, ../sass/_layout.scss */
/* line 478, ../sass/_layout.scss */
#footer .content a {
color: black;
font-family: "capsuularegular";
@@ -566,11 +565,11 @@ ul.pagination li a:hover, ul.pagination li a:focus, ul.pagination li a:active {
padding-left: 10px;
padding-right: 10px;
}
/* line 486, ../sass/_layout.scss */
/* line 485, ../sass/_layout.scss */
#footer .content a:hover {
text-decoration: underline;
}
/* line 493, ../sass/_layout.scss */
/* line 492, ../sass/_layout.scss */
#footer #code-source img {
height: 20px;
}
@@ -1279,47 +1278,51 @@ termes.
}

/* line 3, ../sass/order/_order.scss */
.order-order #app-order-order {
.order-order #main #app-order-order {
display: none;
}
/* line 7, ../sass/order/_order.scss */
.order-order #app-order-order.loaded {
/* line 6, ../sass/order/_order.scss */
.order-order #main #app-order-order h3 {
font-family: "highvoltageregular";
}
/* line 10, ../sass/order/_order.scss */
.order-order #main #app-order-order.loaded {
display: block;
}
/* line 11, ../sass/order/_order.scss */
.order-order #app-order-order #distribution-date {
/* line 14, ../sass/order/_order.scss */
.order-order #main #app-order-order #distribution-date {
display: none;
}
/* line 15, ../sass/order/_order.scss */
.order-order #app-order-order .slide-enter-active {
/* line 18, ../sass/order/_order.scss */
.order-order #main #app-order-order .slide-enter-active {
transition: all .2s ease;
}
/* line 19, ../sass/order/_order.scss */
.order-order #app-order-order .slide-leave-active {
/* line 22, ../sass/order/_order.scss */
.order-order #main #app-order-order .slide-leave-active {
transition: all 0s ease;
}
/* line 22, ../sass/order/_order.scss */
.order-order #app-order-order .slide-enter, .order-order #app-order-order .slide-leave-to {
/* line 25, ../sass/order/_order.scss */
.order-order #main #app-order-order .slide-enter, .order-order #main #app-order-order .slide-leave-to {
transform: translateX(10px);
opacity: 0;
}
/* line 27, ../sass/order/_order.scss */
.order-order #app-order-order #steps {
/* line 30, ../sass/order/_order.scss */
.order-order #main #app-order-order #steps {
margin-bottom: 20px;
}
/* line 29, ../sass/order/_order.scss */
.order-order #app-order-order #steps ul {
/* line 32, ../sass/order/_order.scss */
.order-order #main #app-order-order #steps ul {
height: 70px;
}
/* line 32, ../sass/order/_order.scss */
.order-order #app-order-order #steps ul li {
/* line 35, ../sass/order/_order.scss */
.order-order #main #app-order-order #steps ul li {
text-align: center;
padding-right: 8px;
padding-left: 8px;
position: relative;
}
/* line 38, ../sass/order/_order.scss */
.order-order #app-order-order #steps ul li .info-step {
/* line 41, ../sass/order/_order.scss */
.order-order #main #app-order-order #steps ul li .info-step {
position: absolute;
top: 45px;
left: 0px;
@@ -1330,27 +1333,27 @@ termes.
font-size: 17px;
font-weight: bold;
}
/* line 50, ../sass/order/_order.scss */
.order-order #app-order-order #steps ul li .glyphicon-chevron-right, .order-order #app-order-order #steps ul li.active .glyphicon-chevron-right {
/* line 53, ../sass/order/_order.scss */
.order-order #main #app-order-order #steps ul li .glyphicon-chevron-right, .order-order #main #app-order-order #steps ul li.active .glyphicon-chevron-right {
float: right;
color: gray;
position: relative;
top: 10px;
}
/* line 58, ../sass/order/_order.scss */
.order-order #app-order-order #steps ul li#step-date {
/* line 61, ../sass/order/_order.scss */
.order-order #main #app-order-order #steps ul li#step-date {
padding-left: 0px;
}
/* line 62, ../sass/order/_order.scss */
.order-order #app-order-order #steps ul li#step-payment {
/* line 65, ../sass/order/_order.scss */
.order-order #main #app-order-order #steps ul li#step-payment {
padding-right: 0px;
}
/* line 66, ../sass/order/_order.scss */
.order-order #app-order-order #steps ul li#step-payment .btn::after, .order-order #app-order-order #steps ul li#step-date .btn::before {
/* line 69, ../sass/order/_order.scss */
.order-order #main #app-order-order #steps ul li#step-payment .btn::after, .order-order #main #app-order-order #steps ul li#step-date .btn::before {
display: none;
}
/* line 71, ../sass/order/_order.scss */
.order-order #app-order-order #steps ul li .btn {
/* line 74, ../sass/order/_order.scss */
.order-order #main #app-order-order #steps ul li .btn {
color: #333;
text-transform: uppercase;
display: block;
@@ -1363,169 +1366,169 @@ termes.
border: 0px none;
text-transform: uppercase;
}
/* line 82, ../sass/order/_order.scss */
.order-order #app-order-order #steps ul li .btn .button-content {
/* line 85, ../sass/order/_order.scss */
.order-order #main #app-order-order #steps ul li .btn .button-content {
position: relative;
left: 8px;
}
/* line 87, ../sass/order/_order.scss */
.order-order #app-order-order #steps ul li .btn.btn-primary {
/* line 90, ../sass/order/_order.scss */
.order-order #main #app-order-order #steps ul li .btn.btn-primary {
background-color: #FF7F00;
}
/* line 91, ../sass/order/_order.scss */
.order-order #app-order-order #steps ul li .btn::after, .order-order #app-order-order #steps ul li .btn::before {
/* line 94, ../sass/order/_order.scss */
.order-order #main #app-order-order #steps ul li .btn::after, .order-order #main #app-order-order #steps ul li .btn::before {
content: "";
position: absolute;
top: -1px;
}
/* line 97, ../sass/order/_order.scss */
.order-order #app-order-order #steps ul li .btn::after {
/* line 100, ../sass/order/_order.scss */
.order-order #main #app-order-order #steps ul li .btn::after {
right: -34px;
border: 17px solid transparent;
border-left: 17px solid #e0e0e0;
background-color: transparent;
}
/* line 104, ../sass/order/_order.scss */
.order-order #app-order-order #steps ul li .btn::before {
/* line 107, ../sass/order/_order.scss */
.order-order #main #app-order-order #steps ul li .btn::before {
left: 0px;
border: 17px solid transparent;
border-left: 17px solid white;
background-color: transparent;
}
/* line 111, ../sass/order/_order.scss */
.order-order #app-order-order #steps ul li .btn.btn-primary::after {
/* line 114, ../sass/order/_order.scss */
.order-order #main #app-order-order #steps ul li .btn.btn-primary::after {
border-left: 17px solid #FF7F00;
}
/* line 125, ../sass/order/_order.scss */
.order-order #app-order-order #steps ul li .btn-primary {
/* line 128, ../sass/order/_order.scss */
.order-order #main #app-order-order #steps ul li .btn-primary {
color: white;
}
/* line 133, ../sass/order/_order.scss */
.order-order #app-order-order #legend #order-date-color,
.order-order #app-order-order #legend #distribution-date-color {
/* line 136, ../sass/order/_order.scss */
.order-order #main #app-order-order #legend #order-date-color,
.order-order #main #app-order-order #legend #distribution-date-color {
width: 13px;
height: 13px;
display: inline-block;
}
/* line 140, ../sass/order/_order.scss */
.order-order #app-order-order #legend #order-date-color {
/* line 143, ../sass/order/_order.scss */
.order-order #main #app-order-order #legend #order-date-color {
background-color: #FF7F00;
}
/* line 143, ../sass/order/_order.scss */
.order-order #app-order-order #legend #distribution-date-color {
/* line 146, ../sass/order/_order.scss */
.order-order #main #app-order-order #legend #distribution-date-color {
background-color: #5cb85c;
}
/* line 148, ../sass/order/_order.scss */
.order-order #app-order-order #calendar {
/* line 151, ../sass/order/_order.scss */
.order-order #main #app-order-order #calendar {
margin-bottom: 15px;
}
/* line 150, ../sass/order/_order.scss */
.order-order #app-order-order #calendar .c-header .c-title-layout .c-title-popover .c-title-anchor .c-title[data-v-2083cb72] {
/* line 153, ../sass/order/_order.scss */
.order-order #main #app-order-order #calendar .c-header .c-title-layout .c-title-popover .c-title-anchor .c-title[data-v-2083cb72] {
font-size: 2rem;
}
/* line 153, ../sass/order/_order.scss */
.order-order #app-order-order #calendar .c-day-background {
/* line 156, ../sass/order/_order.scss */
.order-order #main #app-order-order #calendar .c-day-background {
padding: 20px;
}
/* line 158, ../sass/order/_order.scss */
.order-order #app-order-order #calendar .c-day:hover .c-day-background {
/* line 161, ../sass/order/_order.scss */
.order-order #main #app-order-order #calendar .c-day:hover .c-day-background {
background-color: #FF7F00 !important;
color: white !important;
}
/* line 164, ../sass/order/_order.scss */
.order-order #app-order-order #calendar .c-day-popover-content {
/* line 167, ../sass/order/_order.scss */
.order-order #main #app-order-order #calendar .c-day-popover-content {
font-size: 1.3rem;
}
/* line 169, ../sass/order/_order.scss */
.order-order #app-order-order .block-actions {
/* line 172, ../sass/order/_order.scss */
.order-order #main #app-order-order .block-actions {
text-align: right;
margin-top: 20px;
}
/* line 176, ../sass/order/_order.scss */
.order-order #app-order-order table#points-sale td.name .the-name {
/* line 179, ../sass/order/_order.scss */
.order-order #main #app-order-order table#points-sale td.name .the-name {
font-family: "capsuularegular";
color: black;
font-size: 20px;
line-height: 25px;
}
/* line 184, ../sass/order/_order.scss */
.order-order #app-order-order table#points-sale td.actions {
/* line 187, ../sass/order/_order.scss */
.order-order #main #app-order-order table#points-sale td.actions {
width: 150px;
}
/* line 186, ../sass/order/_order.scss */
.order-order #app-order-order table#points-sale td.actions button {
/* line 189, ../sass/order/_order.scss */
.order-order #main #app-order-order table#points-sale td.actions button {
width: 100%;
}
/* line 192, ../sass/order/_order.scss */
.order-order #app-order-order table#points-sale tr.selected td {
/* line 195, ../sass/order/_order.scss */
.order-order #main #app-order-order table#points-sale tr.selected td {
background-color: white;
}
/* line 200, ../sass/order/_order.scss */
.order-order #app-order-order table#products td.photo img {
/* line 203, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products td.photo img {
width: 100px;
}
/* line 206, ../sass/order/_order.scss */
.order-order #app-order-order table#products td.name .name {
/* line 209, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products td.name .name {
font-family: "capsuularegular";
color: black;
font-size: 20px;
line-height: 25px;
}
/* line 212, ../sass/order/_order.scss */
.order-order #app-order-order table#products td.name .other {
/* line 215, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products td.name .other {
font-size: 14px;
color: #333;
}
/* line 216, ../sass/order/_order.scss */
.order-order #app-order-order table#products td.name .recipe {
/* line 219, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products td.name .recipe {
color: gray;
}
/* line 220, ../sass/order/_order.scss */
.order-order #app-order-order table#products .price-unit, .order-order #app-order-order table#products .price-total {
/* line 223, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products .price-unit, .order-order #main #app-order-order table#products .price-total {
width: 100px;
text-align: center;
}
/* line 224, ../sass/order/_order.scss */
.order-order #app-order-order table#products .price-unit .unit, .order-order #app-order-order table#products .price-total .unit {
/* line 227, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products .price-unit .unit, .order-order #main #app-order-order table#products .price-total .unit {
color: gray;
font-size: 13px;
}
/* line 229, ../sass/order/_order.scss */
.order-order #app-order-order table#products .td-quantity {
/* line 232, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products .td-quantity {
width: 175px;
}
/* line 231, ../sass/order/_order.scss */
.order-order #app-order-order table#products .td-quantity input.quantity {
/* line 234, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products .td-quantity input.quantity {
text-align: center;
border-right: 0px none;
}
/* line 235, ../sass/order/_order.scss */
.order-order #app-order-order table#products .td-quantity .input-group-addon {
/* line 238, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products .td-quantity .input-group-addon {
padding: 5px;
padding-left: 0px;
margin: 0px;
border-left: 0px none;
border-right: 0px none;
}
/* line 245, ../sass/order/_order.scss */
.order-order #app-order-order table#products tr.total .price-total {
/* line 248, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products tr.total .price-total {
font-size: 23px;
}
/* line 253, ../sass/order/_order.scss */
.order-order #app-order-order #content-step-payment .credit .info {
/* line 256, ../sass/order/_order.scss */
.order-order #main #app-order-order #content-step-payment .credit .info {
margin-left: 20px;
color: gray;
}
/* line 259, ../sass/order/_order.scss */
.order-order #app-order-order #content-step-payment .comment {
/* line 262, ../sass/order/_order.scss */
.order-order #main #app-order-order #content-step-payment .comment {
margin-bottom: 20px;
}
/* line 264, ../sass/order/_order.scss */
.order-order #app-order-order #infos {
/* line 267, ../sass/order/_order.scss */
.order-order #main #app-order-order #infos {
margin-top: 30px;
}
/* line 266, ../sass/order/_order.scss */
.order-order #app-order-order #infos .panel-body {
/* line 269, ../sass/order/_order.scss */
.order-order #main #app-order-order #infos .panel-body {
padding-top: 0px;
white-space: pre-line;
}

+ 26
- 4
producer/web/js/vuejs/order-order.js View File

@@ -103,6 +103,13 @@ var app = new Vue({
}
}
},
getPointSaleKey: function(idPointSale) {
for(var key in this.pointsSale) {
if(this.pointsSale[key].id == idPointSale) {
return key ;
}
}
},
init: function() {
var app = this ;
this.loading = true ;
@@ -161,11 +168,12 @@ var app = new Vue({
if(response.data.distribution) {
app.distribution = response.data.distribution ;
}

if(response.data.points_sale) {
app.pointsSale = [] ;
var orderPointSale = 0 ;
for(var key in response.data.points_sale) {
response.data.points_sale[key].order = orderPointSale ++ ;
app.pointsSale[response.data.points_sale[key].id] = response.data.points_sale[key] ;
app.pointsSaleCodes[response.data.points_sale[key].id] = '' ;
Vue.set(app.pointsSaleCodes, response.data.points_sale[key].id, '');
@@ -232,11 +240,11 @@ var app = new Vue({
code: this.pointsSaleCodes[idPointSale]
}}).then(function(response) {
if(response.data) {
app.pointsSale[idPointSale].invalid_code = false ;
app.pointsSale[app.getPointSaleKey(idPointSale)].invalid_code = false ;
app.validatePointSale(idPointSale) ;
}
else {
app.pointsSale[idPointSale].invalid_code = true ;
app.pointsSale[app.getPointSaleKey(idPointSale)].invalid_code = true ;
Vue.set(app.pointsSaleCodes, idPointSale, '');
}
}) ;
@@ -337,5 +345,19 @@ var app = new Vue({
}
return this.producer.credit_limit == null || (this.producer.credit_limit != null && (this.user.credit - total >= this.producer.credit_limit)) ;
}
},
computed : {
orderedPointsSale: function() {
var orderedPointsSaleArray = this.pointsSale.sort(function(a, b) {
if(a.order > b.order) {
return 1 ;
}
else {
return -1 ;
}
}) ;
return orderedPointsSaleArray ;
}
}
});

+ 0
- 1
producer/web/sass/_layout.scss View File

@@ -415,7 +415,6 @@ ul.pagination {
}
h3 {
font-family: 'highvoltageregular' ;
font-family: 'capsuularegular' ;
text-transform: uppercase ;
font-size: 23px ;

+ 5
- 2
producer/web/sass/order/_order.scss View File

@@ -1,9 +1,12 @@

.order-order {
.order-order #main {
#app-order-order {
display: none ;
h3 {
font-family: "highvoltageregular" ;
}
&.loaded {
display: block ;
}

Loading…
Cancel
Save