Browse Source

Merge branch 'dev'

prodstable
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

$potentialRevenues = 0; $potentialRevenues = 0;
$potentialWeight = 0; $potentialWeight = 0;
foreach($productsArray as &$theProduct) { foreach($productsArray as &$theProduct) {
$quantityOrder = Order::getProductQuantity($theProduct['id'], $ordersArray) ; $quantityOrder = Order::getProductQuantity($theProduct['id'], $ordersArray) ;
$theProduct['quantity_ordered'] = $quantityOrder ; $theProduct['quantity_ordered'] = $quantityOrder ;
if(!isset($theProduct['productDistribution'][0])) { 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'])) { if(!is_numeric($theProduct['productDistribution'][0]['quantity_max'])) {
] ; ] ;
} }
/*$productOrderArray = \yii\helpers\ArrayHelper::map($order->productOrder, 'id_product', 'quantity') ;
*/
foreach($productsArray as $product) { foreach($productsArray as $product) {
if(!isset($productOrderArray[$product['id']])) { if(!isset($productOrderArray[$product['id']])) {
$productOrderArray[$product['id']] = [ $productOrderArray[$product['id']] = [
// utilisateurs // utilisateurs
$usersArray = User::findBy()->all() ; $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 ; $json['users'] = $usersArray ;
// une production de la semaine activée ou non // une production de la semaine activée ou non

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

} }
// produits // produits
$productsArray = Product::searchAll() ;
$productsArray = Product::searchAll([], [
'orderby' => 'product.order ASC'
]) ;
if ($model->load(Yii::$app->request->post()) && $model->validate() if ($model->load(Yii::$app->request->post()) && $model->validate()
&& $model->save()) && $model->save())
} }


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


if ($model->load(Yii::$app->request->post()) && $model->validate()) { if ($model->load(Yii::$app->request->post()) && $model->validate()) {
if (!strlen($model->date_end)) { if (!strlen($model->date_end)) {
}]) ; }]) ;
} }
$productsArray = $productsQuery->asArray()->all() ;
$productsArray = $productsQuery->asArray()->orderBy('order ASC')->all() ;
foreach($productsArray as &$theProduct) { foreach($productsArray as &$theProduct) {
$theProduct['unit_save'] = $theProduct['unit'] ; $theProduct['unit_save'] = $theProduct['unit'] ;

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

</ul> </ul>
</div> </div>
<div class="col-md-4"> <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"> <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> <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"> <label class="control-label" for="select-id-user">
</label> </label>
<select class="form-control" v-model="order.id_user"> <select class="form-control" v-model="order.id_user">
<option value="0">--</option> <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> </select>
<input v-model="order.username" type="text" class="form-control" placeholder="Ou saisissez ici le nom de l'utilisateur" /> <input v-model="order.username" type="text" class="form-control" placeholder="Ou saisissez ici le nom de l'utilisateur" />
</div> </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"> <div class="form-group">
<label class="control-label" for="textarea-comment">Commentaire</label> <label class="control-label" for="textarea-comment">Commentaire</label>
<textarea class="form-control" id="textarea-comment" v-model="order.comment"></textarea> <textarea class="form-control" id="textarea-comment" v-model="order.comment"></textarea>

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

?> ?>
<ul class="nav navbar-nav"> <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"> <li class="dropdown users-menu notifications-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-user-plus"></i> <i class="fa fa-user-plus"></i>

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

CreditHistory::MEAN_PAYMENT_MONEY => CreditHistory::getStrMeanPaymentBy(CreditHistory::MEAN_PAYMENT_MONEY), 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_CREDIT_CARD => CreditHistory::getStrMeanPaymentBy(CreditHistory::MEAN_PAYMENT_CREDIT_CARD),
CreditHistory::MEAN_PAYMENT_CHEQUE => CreditHistory::getStrMeanPaymentBy(CreditHistory::MEAN_PAYMENT_CHEQUE), 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), CreditHistory::MEAN_PAYMENT_OTHER => CreditHistory::getStrMeanPaymentBy(CreditHistory::MEAN_PAYMENT_OTHER),
]) ?> ]) ?>
<?= $form->field($creditForm, 'comment')->textarea() ?> <?= $form->field($creditForm, 'comment')->textarea() ?>

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

var theQuantity = parseFloat(this.order.productOrder[id_product].quantity) + parseFloat(quantity) ; 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}); 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

const MEAN_PAYMENT_CREDIT_CARD = 'credit-card'; const MEAN_PAYMENT_CREDIT_CARD = 'credit-card';
const MEAN_PAYMENT_MONEY = 'money'; const MEAN_PAYMENT_MONEY = 'money';
const MEAN_PAYMENT_CHEQUE = 'cheque'; const MEAN_PAYMENT_CHEQUE = 'cheque';
const MEAN_PAYMENT_TRANSFER = 'transfer';
const MEAN_PAYMENT_OTHER = 'other'; const MEAN_PAYMENT_OTHER = 'other';
/** /**
case CreditHistory::MEAN_PAYMENT_MONEY : return 'Espèces' ; case CreditHistory::MEAN_PAYMENT_MONEY : return 'Espèces' ;
case CreditHistory::MEAN_PAYMENT_CHEQUE : return 'Chèque' ; case CreditHistory::MEAN_PAYMENT_CHEQUE : return 'Chèque' ;
case CreditHistory::MEAN_PAYMENT_CREDIT_CARD : return 'Carte bancaire' ; case CreditHistory::MEAN_PAYMENT_CREDIT_CARD : return 'Carte bancaire' ;
case CreditHistory::MEAN_PAYMENT_TRANSFER : return 'Virement' ;
case CreditHistory::MEAN_PAYMENT_OTHER : return 'Autre' ; case CreditHistory::MEAN_PAYMENT_OTHER : return 'Autre' ;
default: return 'Crédit' ; default: return 'Crédit' ;
} }

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

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

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



return 0; 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. * Met à jour la date de dernière connexion de l'utilisateur.

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

} }
} }
$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 // Commandes totales
$ordersArray = Order::searchAll([ $ordersArray = Order::searchAll([

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

Chargement ... Chargement ...
</div> </div>
<div v-else> <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"> <table id="points-sale" class="table table-bordered" v-if="pointsSale.length">
<thead> <thead>
<tr> <tr>
</tr> </tr>
</thead> </thead>
<tbody> <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"> <td class="name">
<span class="the-name">{{ pointSale.name }}</span> <span class="the-name">{{ pointSale.name }}</span>
<div class="comment" v-if="pointSale.userPointSale"> <div class="comment" v-if="pointSale.userPointSale">

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

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


/* line 454, ../sass/_layout.scss */
/* line 453, ../sass/_layout.scss */
#footer-producer { #footer-producer {
text-align: center; text-align: center;
position: absolute; position: absolute;
left: 0px; left: 0px;
width: 100%; width: 100%;
} }
/* line 461, ../sass/_layout.scss */
/* line 460, ../sass/_layout.scss */
#footer-producer a { #footer-producer a {
color: #FF7F00; color: #FF7F00;
} }
/* line 463, ../sass/_layout.scss */
/* line 462, ../sass/_layout.scss */
#footer-producer a:active { #footer-producer a:active {
text-decoration: underline; text-decoration: underline;
} }


/* line 469, ../sass/_layout.scss */
/* line 468, ../sass/_layout.scss */
#footer { #footer {
background-color: #FFF8DC; background-color: #FFF8DC;
height: 100px; height: 100px;
float: right; float: right;
text-align: center; text-align: center;
} }
/* line 475, ../sass/_layout.scss */
/* line 474, ../sass/_layout.scss */
#footer .content { #footer .content {
padding-top: 20px; padding-top: 20px;
color: black; color: black;
} }
/* line 479, ../sass/_layout.scss */
/* line 478, ../sass/_layout.scss */
#footer .content a { #footer .content a {
color: black; color: black;
font-family: "capsuularegular"; font-family: "capsuularegular";
padding-left: 10px; padding-left: 10px;
padding-right: 10px; padding-right: 10px;
} }
/* line 486, ../sass/_layout.scss */
/* line 485, ../sass/_layout.scss */
#footer .content a:hover { #footer .content a:hover {
text-decoration: underline; text-decoration: underline;
} }
/* line 493, ../sass/_layout.scss */
/* line 492, ../sass/_layout.scss */
#footer #code-source img { #footer #code-source img {
height: 20px; height: 20px;
} }
} }


/* line 3, ../sass/order/_order.scss */ /* line 3, ../sass/order/_order.scss */
.order-order #app-order-order {
.order-order #main #app-order-order {
display: none; 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; 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; 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; 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; 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); transform: translateX(10px);
opacity: 0; 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; 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; 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; text-align: center;
padding-right: 8px; padding-right: 8px;
padding-left: 8px; padding-left: 8px;
position: relative; 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; position: absolute;
top: 45px; top: 45px;
left: 0px; left: 0px;
font-size: 17px; font-size: 17px;
font-weight: bold; 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; float: right;
color: gray; color: gray;
position: relative; position: relative;
top: 10px; 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; 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; 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; 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; color: #333;
text-transform: uppercase; text-transform: uppercase;
display: block; display: block;
border: 0px none; border: 0px none;
text-transform: uppercase; 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; position: relative;
left: 8px; 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; 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: ""; content: "";
position: absolute; position: absolute;
top: -1px; 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; right: -34px;
border: 17px solid transparent; border: 17px solid transparent;
border-left: 17px solid #e0e0e0; border-left: 17px solid #e0e0e0;
background-color: transparent; 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; left: 0px;
border: 17px solid transparent; border: 17px solid transparent;
border-left: 17px solid white; border-left: 17px solid white;
background-color: transparent; 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; 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; 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; width: 13px;
height: 13px; height: 13px;
display: inline-block; 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; 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; 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; 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; 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; 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; background-color: #FF7F00 !important;
color: white !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; 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; text-align: right;
margin-top: 20px; 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"; font-family: "capsuularegular";
color: black; color: black;
font-size: 20px; font-size: 20px;
line-height: 25px; 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; 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%; 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; 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; 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"; font-family: "capsuularegular";
color: black; color: black;
font-size: 20px; font-size: 20px;
line-height: 25px; 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; font-size: 14px;
color: #333; 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; 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; width: 100px;
text-align: center; 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; color: gray;
font-size: 13px; 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; 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; text-align: center;
border-right: 0px none; 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: 5px;
padding-left: 0px; padding-left: 0px;
margin: 0px; margin: 0px;
border-left: 0px none; border-left: 0px none;
border-right: 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; 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; margin-left: 20px;
color: gray; 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; 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; 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; padding-top: 0px;
white-space: pre-line; white-space: pre-line;
} }

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

} }
} }
}, },
getPointSaleKey: function(idPointSale) {
for(var key in this.pointsSale) {
if(this.pointsSale[key].id == idPointSale) {
return key ;
}
}
},
init: function() { init: function() {
var app = this ; var app = this ;
this.loading = true ; this.loading = true ;
if(response.data.distribution) { if(response.data.distribution) {
app.distribution = response.data.distribution ; app.distribution = response.data.distribution ;
} }

if(response.data.points_sale) { if(response.data.points_sale) {
app.pointsSale = [] ; app.pointsSale = [] ;
var orderPointSale = 0 ;
for(var key in response.data.points_sale) { 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.pointsSale[response.data.points_sale[key].id] = response.data.points_sale[key] ;
app.pointsSaleCodes[response.data.points_sale[key].id] = '' ; app.pointsSaleCodes[response.data.points_sale[key].id] = '' ;
Vue.set(app.pointsSaleCodes, response.data.points_sale[key].id, ''); Vue.set(app.pointsSaleCodes, response.data.points_sale[key].id, '');
code: this.pointsSaleCodes[idPointSale] code: this.pointsSaleCodes[idPointSale]
}}).then(function(response) { }}).then(function(response) {
if(response.data) { if(response.data) {
app.pointsSale[idPointSale].invalid_code = false ;
app.pointsSale[app.getPointSaleKey(idPointSale)].invalid_code = false ;
app.validatePointSale(idPointSale) ; app.validatePointSale(idPointSale) ;
} }
else { else {
app.pointsSale[idPointSale].invalid_code = true ;
app.pointsSale[app.getPointSaleKey(idPointSale)].invalid_code = true ;
Vue.set(app.pointsSaleCodes, idPointSale, ''); Vue.set(app.pointsSaleCodes, idPointSale, '');
} }
}) ; }) ;
} }
return this.producer.credit_limit == null || (this.producer.credit_limit != null && (this.user.credit - total >= this.producer.credit_limit)) ; return this.producer.credit_limit == null || (this.producer.credit_limit != null && (this.user.credit - total >= this.producer.credit_limit)) ;
} }
},
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

} }
h3 { h3 {
font-family: 'highvoltageregular' ;
font-family: 'capsuularegular' ; font-family: 'capsuularegular' ;
text-transform: uppercase ; text-transform: uppercase ;
font-size: 23px ; font-size: 23px ;

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



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

Loading…
Cancel
Save