Bladeren bron

[Administration et boutique] Points de vente : minimum de commande #1345

feature/souke
Guillaume Bourgeois 1 jaar geleden
bovenliggende
commit
80362ed31d
10 gewijzigde bestanden met toevoegingen van 88 en 42 verwijderingen
  1. +2
    -0
      backend/views/point-sale/_form.php
  2. +3
    -1
      common/logic/Feature/Feature/Model/Feature.php
  3. +3
    -2
      common/logic/PointSale/PointSale/Model/PointSale.php
  4. +26
    -0
      console/migrations/m231113_084553_add_column_point_sale_minimum_order_amount.php
  5. +0
    -1
      producer/controllers/OrderController.php
  6. +3
    -0
      producer/views/order/order.php
  7. +35
    -33
      producer/web/css/screen.css
  8. +3
    -3
      producer/web/js/producer.js
  9. +11
    -1
      producer/web/js/vuejs/order-order.js
  10. +2
    -1
      producer/web/sass/order/_order.scss

+ 2
- 0
backend/views/point-sale/_form.php Bestand weergeven

->dropDownList( ProductPrice::percentValues(), [])->hint('Pourcentage appliqué aux prix de chaque produit dans ce point de vente.');*/ ?> ->dropDownList( ProductPrice::percentValues(), [])->hint('Pourcentage appliqué aux prix de chaque produit dans ce point de vente.');*/ ?>


<?= $form->field($model, 'maximum_number_orders')->textInput() ?> <?= $form->field($model, 'maximum_number_orders')->textInput() ?>
<?= $form->field($model, 'minimum_order_amount')->textInput() ?>



<div id="delivery-days"> <div id="delivery-days">
<h2>Jours de livraison</h2> <h2>Jours de livraison</h2>

+ 3
- 1
common/logic/Feature/Feature/Model/Feature.php Bestand weergeven

return [ return [
[['alias', 'name'], 'required'], [['alias', 'name'], 'required'],
[['status', 'is_paid_feature', 'only_for_selected_producers'], 'boolean'], [['status', 'is_paid_feature', 'only_for_selected_producers'], 'boolean'],
[['position'], 'integer'],
[['price'], 'double'], [['price'], 'double'],
[['alias', 'name', 'description'], 'string'], [['alias', 'name', 'description'], 'string'],
]; ];
'status' => 'Statut', 'status' => 'Statut',
'is_paid_feature' => "Fonctionnalité payante", 'is_paid_feature' => "Fonctionnalité payante",
'price' => 'Prix', 'price' => 'Prix',
'only_for_selected_producers' => 'Uniquement pour les producteurs sélectionnés'
'only_for_selected_producers' => 'Uniquement pour les producteurs sélectionnés',
'position' => 'Position'
]; ];
} }



+ 3
- 2
common/logic/PointSale/PointSale/Model/PointSale.php Bestand weergeven

[['id_producer', 'id_user', 'maximum_number_orders', 'status'], 'integer'], [['id_producer', 'id_user', 'maximum_number_orders', 'status'], 'integer'],
['id_producer', 'required'], ['id_producer', 'required'],
[['users', 'users_comment', 'code'], 'safe'], [['users', 'users_comment', 'code'], 'safe'],
[['product_price_percent'], 'double'],
[['product_price_percent', 'minimum_order_amount'], 'double'],
]; ];
} }


'button_generate_delivery_note_point_sale' => 'Activer le bouton de génération de bon de livraison par point de vente', 'button_generate_delivery_note_point_sale' => 'Activer le bouton de génération de bon de livraison par point de vente',
'button_generate_delivery_note_each_user' => 'Activer le bouton de génération de bon de livraison par client', 'button_generate_delivery_note_each_user' => 'Activer le bouton de génération de bon de livraison par client',
'exclude_export_shopping_cart_labels' => "Exclure de l'export d'étiquettes", 'exclude_export_shopping_cart_labels' => "Exclure de l'export d'étiquettes",
'is_home_delivery' => "Livraison à domicile"
'is_home_delivery' => "Livraison à domicile",
'minimum_order_amount' => "Montant minimum de commande (€)"
]; ];
} }



+ 26
- 0
console/migrations/m231113_084553_add_column_point_sale_minimum_order_amount.php Bestand weergeven

<?php

use yii\db\Migration;
use yii\db\Schema;

/**
* Class m231113_084553_add_column_point_sale_minimum_order_amount
*/
class m231113_084553_add_column_point_sale_minimum_order_amount extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->addColumn('point_sale', 'minimum_order_amount', Schema::TYPE_FLOAT);
}

/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->dropColumn('point_sale', 'minimum_order_amount');
}
}

+ 0
- 1
producer/controllers/OrderController.php Bestand weergeven

use common\logic\PointSale\PointSale\Model\PointSale; use common\logic\PointSale\PointSale\Model\PointSale;
use common\logic\Producer\Producer\Model\Producer; use common\logic\Producer\Producer\Model\Producer;
use common\logic\Product\Product\Model\Product; use common\logic\Product\Product\Model\Product;
use common\logic\User\CreditHistory\Model\CreditHistory;
use common\logic\User\User\Model\User; use common\logic\User\User\Model\User;
use DateTime; use DateTime;
use yii\base\UserException; use yii\base\UserException;

+ 3
- 0
producer/views/order/order.php Bestand weergeven

</div> </div>
<div class="comment" v-if="pointSale.infos && pointSale.infos.length > 0" <div class="comment" v-if="pointSale.infos && pointSale.infos.length > 0"
v-html="pointSale.infos"></div> v-html="pointSale.infos"></div>
<div class="minimum-order-amount" v-if="pointSale.minimum_order_amount">
Montant minimum de commande : {{ formatPrice(pointSale.minimum_order_amount) }}
</div>
</td> </td>
<td class="locality">{{ pointSale.locality }}</td> <td class="locality">{{ pointSale.locality }}</td>
<td class="actions"> <td class="actions">

+ 35
- 33
producer/web/css/screen.css Bestand weergeven

font-weight: bold; font-weight: bold;
} }
/* line 222, ../sass/order/_order.scss */ /* line 222, ../sass/order/_order.scss */
.order-order #main #app-order-order table#points-sale td.name .comment {
.order-order #main #app-order-order table#points-sale td.name .comment,
.order-order #main #app-order-order table#points-sale td.name .minimum-order-amount {
color: gray; color: gray;
} }
/* line 225, ../sass/order/_order.scss */
.order-order #main #app-order-order table#points-sale td.name .comment a {
/* line 226, ../sass/order/_order.scss */
.order-order #main #app-order-order table#points-sale td.name .comment a,
.order-order #main #app-order-order table#points-sale td.name .minimum-order-amount a {
color: #F39C12; color: #F39C12;
} }
/* line 231, ../sass/order/_order.scss */
/* line 232, ../sass/order/_order.scss */
.order-order #main #app-order-order table#points-sale td.actions { .order-order #main #app-order-order table#points-sale td.actions {
width: 150px; width: 150px;
} }
/* line 233, ../sass/order/_order.scss */
/* line 234, ../sass/order/_order.scss */
.order-order #main #app-order-order table#points-sale td.actions button { .order-order #main #app-order-order table#points-sale td.actions button {
width: 100%; width: 100%;
} }
/* line 239, ../sass/order/_order.scss */
/* line 240, ../sass/order/_order.scss */
.order-order #main #app-order-order table#points-sale tr.selected td { .order-order #main #app-order-order table#points-sale tr.selected td {
background-color: white; background-color: white;
} }
/* line 247, ../sass/order/_order.scss */
/* line 248, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products td.category-name { .order-order #main #app-order-order table#products td.category-name {
font-family: "highvoltageregular"; font-family: "highvoltageregular";
font-size: 22px; font-size: 22px;
text-transform: uppercase; text-transform: uppercase;
padding-top: 13px; padding-top: 13px;
} }
/* line 254, ../sass/order/_order.scss */
/* line 255, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products td.category-name .glyphicon-triangle-bottom, .order-order #main #app-order-order table#products td.category-name .glyphicon-triangle-bottom,
.order-order #main #app-order-order table#products td.category-name .glyphicon-triangle-right { .order-order #main #app-order-order table#products td.category-name .glyphicon-triangle-right {
font-size: 15px; font-size: 15px;
} }
/* line 259, ../sass/order/_order.scss */
/* line 260, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products td.category-name span.label { .order-order #main #app-order-order table#products td.category-name span.label {
font-family: "Arial"; font-family: "Arial";
font-weight: normal; font-weight: normal;
text-transform: none; text-transform: none;
margin-left: 15px; margin-left: 15px;
} }
/* line 268, ../sass/order/_order.scss */
/* line 269, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products td.category-name:hover { .order-order #main #app-order-order table#products td.category-name:hover {
cursor: pointer; cursor: pointer;
background-color: #F39C12; background-color: #F39C12;
color: white; color: white;
} }
/* line 276, ../sass/order/_order.scss */
/* line 277, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products td.photo img { .order-order #main #app-order-order table#products td.photo img {
width: 100px; width: 100px;
} }
/* line 286, ../sass/order/_order.scss */
/* line 287, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products .price-unit .decreasing-prices { .order-order #main #app-order-order table#products .price-unit .decreasing-prices {
margin-top: 10px; margin-top: 10px;
font-size: 10px; font-size: 10px;
padding-bottom: 2px; padding-bottom: 2px;
margin-bottom: 0px; margin-bottom: 0px;
} }
/* line 294, ../sass/order/_order.scss */
/* line 295, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products .price-unit .decreasing-prices ul li { .order-order #main #app-order-order table#products .price-unit .decreasing-prices ul li {
margin-bottom: 5px; margin-bottom: 5px;
} }
/* line 296, ../sass/order/_order.scss */
/* line 297, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products .price-unit .decreasing-prices ul li strong { .order-order #main #app-order-order table#products .price-unit .decreasing-prices ul li strong {
font-weight: bold; font-weight: bold;
} }
/* line 304, ../sass/order/_order.scss */
/* line 305, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products .price-unit, .order-order #main #app-order-order table#products .price-total { .order-order #main #app-order-order table#products .price-unit, .order-order #main #app-order-order table#products .price-total {
width: 135px; width: 135px;
text-align: center; text-align: center;
} }
/* line 308, ../sass/order/_order.scss */
/* line 309, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products .price-unit .unit, .order-order #main #app-order-order table#products .price-total .unit { .order-order #main #app-order-order table#products .price-unit .unit, .order-order #main #app-order-order table#products .price-total .unit {
color: gray; color: gray;
font-size: 13px; font-size: 13px;
} }
/* line 313, ../sass/order/_order.scss */
/* line 314, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products .td-quantity { .order-order #main #app-order-order table#products .td-quantity {
width: 175px; width: 175px;
} }
/* line 315, ../sass/order/_order.scss */
/* line 316, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products .td-quantity input.quantity { .order-order #main #app-order-order table#products .td-quantity input.quantity {
text-align: center; text-align: center;
border-right: 0px none; border-right: 0px none;
} }
/* line 319, ../sass/order/_order.scss */
/* line 320, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products .td-quantity .input-group-addon { .order-order #main #app-order-order table#products .td-quantity .input-group-addon {
padding: 5px; padding: 5px;
padding-left: 0px; padding-left: 0px;
border-left: 0px none; border-left: 0px none;
border-right: 0px none; border-right: 0px none;
} }
/* line 330, ../sass/order/_order.scss */
/* line 331, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products tr.total .summary h3 { .order-order #main #app-order-order table#products tr.total .summary h3 {
margin-top: 0px; margin-top: 0px;
font-family: "capsuularegular"; font-family: "capsuularegular";
text-transform: none; text-transform: none;
margin-bottom: 5px; margin-bottom: 5px;
} }
/* line 337, ../sass/order/_order.scss */
/* line 338, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products tr.total .summary ul { .order-order #main #app-order-order table#products tr.total .summary ul {
margin-bottom: 15px; margin-bottom: 15px;
padding-left: 20px; padding-left: 20px;
font-size: 23px; font-size: 23px;
} }
/* line 344, ../sass/order/_order.scss */
/* line 345, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products tr.total .summary ul li .quantity { .order-order #main #app-order-order table#products tr.total .summary ul li .quantity {
font-size: 18px; font-size: 18px;
} }
/* line 348, ../sass/order/_order.scss */
/* line 349, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products tr.total .summary ul li .name { .order-order #main #app-order-order table#products tr.total .summary ul li .name {
font-family: "capsuularegular"; font-family: "capsuularegular";
font-size: 24px; font-size: 24px;
} }
/* line 352, ../sass/order/_order.scss */
/* line 353, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products tr.total .summary ul li .other { .order-order #main #app-order-order table#products tr.total .summary ul li .other {
font-family: "capsuularegular"; font-family: "capsuularegular";
font-size: 18px; font-size: 18px;
} }
/* line 360, ../sass/order/_order.scss */
/* line 361, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products tr.total .price-total { .order-order #main #app-order-order table#products tr.total .price-total {
font-size: 23px; font-size: 23px;
} }
/* line 368, ../sass/order/_order.scss */
/* line 369, ../sass/order/_order.scss */
.order-order #main #app-order-order #content-step-payment .delivery { .order-order #main #app-order-order #content-step-payment .delivery {
margin-bottom: 20px; margin-bottom: 20px;
} }
/* line 371, ../sass/order/_order.scss */
/* line 372, ../sass/order/_order.scss */
.order-order #main #app-order-order #content-step-payment .delivery .delivery-home { .order-order #main #app-order-order #content-step-payment .delivery .delivery-home {
margin-bottom: 20px; margin-bottom: 20px;
} }
/* line 380, ../sass/order/_order.scss */
/* line 381, ../sass/order/_order.scss */
.order-order #main #app-order-order #content-step-payment .comment { .order-order #main #app-order-order #content-step-payment .comment {
margin-bottom: 20px; margin-bottom: 20px;
} }
/* line 385, ../sass/order/_order.scss */
/* line 386, ../sass/order/_order.scss */
.order-order #main #app-order-order #content-step-payment .credit .info { .order-order #main #app-order-order #content-step-payment .credit .info {
margin-left: 20px; margin-left: 20px;
color: gray; color: gray;
} }
/* line 392, ../sass/order/_order.scss */
/* line 393, ../sass/order/_order.scss */
.order-order #main #app-order-order #specific-delays { .order-order #main #app-order-order #specific-delays {
margin-top: 15px; margin-top: 15px;
} }
/* line 400, ../sass/order/_order.scss */
/* line 401, ../sass/order/_order.scss */
.order-order #main #app-order-order #infos { .order-order #main #app-order-order #infos {
margin-top: 30px; margin-top: 30px;
} }
/* line 402, ../sass/order/_order.scss */
/* line 403, ../sass/order/_order.scss */
.order-order #main #app-order-order #infos .panel-body { .order-order #main #app-order-order #infos .panel-body {
padding-top: 0px; padding-top: 0px;
white-space: pre-line; white-space: pre-line;
} }


/* line 412, ../sass/order/_order.scss */
/* line 413, ../sass/order/_order.scss */
#main #content .panel h3 { #main #content .panel h3 {
font-family: "highvoltageregular"; font-family: "highvoltageregular";
margin: 0px; margin: 0px;

+ 3
- 3
producer/web/js/producer.js Bestand weergeven

} }


function opendistrib_scroll(id) { function opendistrib_scroll(id) {
if ($("#" + id).size())
if ($("#" + id).size()) {
$('html,body').animate({ $('html,body').animate({
scrollTop: $("#" + id).offset().top scrollTop: $("#" + id).offset().top
},
1000);
}, 500);
}
} }


function opendistrib_base_url(with_slug) { function opendistrib_base_url(with_slug) {

+ 11
- 1
producer/web/js/vuejs/order-order.js Bestand weergeven

return thePriceWithTax; return thePriceWithTax;
} }
}, },

confirmClick: function() { confirmClick: function() {


var app = this ; var app = this ;
// delivery // delivery
if(app.pointSaleActive.is_home_delivery && !app.deliveryAddress) { if(app.pointSaleActive.is_home_delivery && !app.deliveryAddress) {
this.errors = [] ; this.errors = [] ;
this.errors.push('Veuillez saisir une adresse de livraison') ;
this.errors.push('Veuillez saisir une adresse de livraison.') ;
opendistrib_scroll('page-title');
return false ;
}

// montant minimum de commande
if(app.pointSaleActive.minimum_order_amount > 0 && app.priceTotal() < app.pointSaleActive.minimum_order_amount) {
this.errors = [] ;
this.errors.push('Le montant minimum de commande est de '+app.formatPrice(app.pointSaleActive.minimum_order_amount)+' pour ce point de vente.') ;
opendistrib_scroll('page-title');
return false ; return false ;
} }



+ 2
- 1
producer/web/sass/order/_order.scss Bestand weergeven

font-weight: bold; font-weight: bold;
} }


.comment {
.comment,
.minimum-order-amount {
color: gray; color: gray;


a { a {

Laden…
Annuleren
Opslaan