Guillaume pirms 1 gada
vecāks
revīzija
b0cc8b93bb
18 mainītis faili ar 166 papildinājumiem un 79 dzēšanām
  1. +3
    -3
      backend/controllers/DistributionController.php
  2. +2
    -0
      backend/controllers/OrderController.php
  3. +1
    -1
      backend/views/distribution/report-bourlingue.php
  4. +1
    -1
      backend/views/producer-admin/index.php
  5. +4
    -1
      backend/views/product/_form.php
  6. +21
    -6
      backend/views/product/index.php
  7. +24
    -13
      backend/web/css/screen.css
  8. +2
    -2
      backend/web/js/backend.js
  9. +6
    -1
      backend/web/sass/_responsive.scss
  10. +7
    -1
      backend/web/sass/product/_index.scss
  11. +6
    -2
      common/logic/Producer/Producer/Model/Producer.php
  12. +1
    -1
      common/web/js/utils.js
  13. +26
    -0
      console/migrations/m230524_091204_update_field_producer_option_billing_permanent_transfer_amount.php
  14. +0
    -4
      frontend/controllers/UserController.php
  15. +1
    -1
      frontend/views/user/update.php
  16. +15
    -10
      producer/views/order/order.php
  17. +35
    -28
      producer/web/css/screen.css
  18. +11
    -4
      producer/web/sass/order/_order.scss

+ 3
- 3
backend/controllers/DistributionController.php Parādīt failu

@@ -262,8 +262,8 @@ class DistributionController extends BackendController
$productOrderArray[$productOrder->id_product] = [
'quantity' => $productOrder->quantity * Product::$unitsArray[$productOrder->unit]['coefficient'],
'unit' => $productOrder->unit,
'price' => number_format($productOrder->price, 3),
'invoice_price' => number_format($productOrder->invoice_price, 3),
'price' => number_format($productOrder->price, 5),
'invoice_price' => number_format($productOrder->invoice_price, 5),
'price_with_tax' => Price::getPriceWithTax($productOrder->price, $productOrder->taxRate->value),
];
}
@@ -1335,7 +1335,7 @@ class DistributionController extends BackendController
$dateSaturday = date('Y-m-d', strtotime('Saturday', $start));
$dateSunday = date('Y-m-d', strtotime('Sunday', $start));

$pointsSaleArray = PointSale::searchAll();
$pointsSaleArray = PointSale::searchAll(['status' => 1]);

$activeMonday = false;
$activeTuesday = false;

+ 2
- 0
backend/controllers/OrderController.php Parādīt failu

@@ -858,6 +858,8 @@ class OrderController extends BackendController
$orderManager->processCredit($order);
}

$order = $orderManager->findOneOrderById($order->id);
$orderManager->initOrder($order);
if ($order) {
$orderManager->generateOrderReference($order);
$orderManager->updateOrderTillerSynchronization($order);

+ 1
- 1
backend/views/distribution/report-bourlingue.php Parādīt failu

@@ -237,7 +237,7 @@ foreach ($pointsSaleArray as $pointSale)
foreach( Product::$unitsArray as $unit => $dataUnit) {
$quantity = $orderManager->getProductQuantity($product, $pointSale->orders, false, $unit);
if ($quantity) {
$theUnit = ( Product::strUnit($unit, 'wording_short', true) == 'p.') ? '' : ' '. $productManager->strUnit($unit, 'wording_short', true) ;
$theUnit = ( $productManager->strUnit($unit, 'wording_short', true) == 'p.') ? '' : ' '. $productManager->strUnit($unit, 'wording_short', true) ;
$html .= $product->name . ' (' .$quantity .$theUnit.')<br />';
}
}

+ 1
- 1
backend/views/producer-admin/index.php Parādīt failu

@@ -192,7 +192,7 @@ $this->addButton(['label' => 'Nouveau producteur <span class="glyphicon glyphico
$str .= '<li>'.Producer::$billingFrequencyArray[$model->option_billing_frequency].'</li>';

if($model->option_billing_permanent_transfer) {
$str .= '<li>Virement permanent : <strong>'.Price::format($model->option_billing_permanent_transfer_amount, 0).'</strong></li>';
$str .= '<li>Virement permanent : <strong>'.Price::format($model->option_billing_permanent_transfer_amount).'</strong></li>';
}

$str .= '</ul>';

+ 4
- 1
backend/views/product/_form.php Parādīt failu

@@ -142,7 +142,10 @@ $taxRateManager = $this->getTaxRateManager();

<strong id="label-availability-points-sale">Et <span><?php if($model->available_on_points_sale): ?>indisponible<?php else: ?>disponible<?php endif; ?></span> sur les points de vente</strong>
<?php $pointSaleArray = PointSale::find()
->where(['id_producer' => GlobalParam::getCurrentProducerId()])
->where([
'id_producer' => GlobalParam::getCurrentProducerId(),
'status' => 1
])
->orderBy('is_bread_box ASC, name ASC')
->all(); ?>
<?= Html::activeCheckboxList($model, 'pointsSale', ArrayHelper::map($pointSaleArray, 'id', function ($pointSale, $defaultValue) use ($model) {

+ 21
- 6
backend/views/product/index.php Parādīt failu

@@ -59,7 +59,9 @@ $this->addButton(['label' => 'Nouveau produit <span class="glyphicon glyphicon-p
'columns' => [
[
'attribute' => 'order',
'headerOptions' => ['class' => 'order'],
'headerOptions' => ['class' => 'order column-hide-on-mobile'],
'filterOptions' => ['class' => 'column-hide-on-mobile'],
'contentOptions' => ['class' => 'column-hide-on-mobile'],
'format' => 'raw',
'filter' => '',
'value' => function ($model) {
@@ -69,7 +71,9 @@ $this->addButton(['label' => 'Nouveau produit <span class="glyphicon glyphicon-p
[
'attribute' => 'photo',
'format' => 'raw',
'headerOptions' => ['class' => 'td-photo'],
'headerOptions' => ['class' => 'td-photo column-hide-on-mobile'],
'filterOptions' => ['class' => 'column-hide-on-mobile'],
'contentOptions' => ['class' => 'column-hide-on-mobile'],
'filter' => '',
'value' => function ($model) {
if (strlen($model->photo)) {
@@ -81,11 +85,18 @@ $this->addButton(['label' => 'Nouveau produit <span class="glyphicon glyphicon-p
}
],
'name',
'description',
[
'attribute' => 'description',
'headerOptions' => ['class' => 'column-hide-on-mobile'],
'filterOptions' => ['class' => 'column-hide-on-mobile'],
'contentOptions' => ['class' => 'column-hide-on-mobile'],
],
[
'attribute' => 'id_product_category',
'format' => 'raw',
'headerOptions' => ['class' => 'td-product-category'],
'headerOptions' => ['class' => 'td-product-category column-hide-on-mobile'],
'filterOptions' => ['class' => 'column-hide-on-mobile'],
'contentOptions' => ['class' => 'column-hide-on-mobile'],
'filter' => '',
'value' => function ($model) {
if ($model->productCategory) {
@@ -96,6 +107,9 @@ $this->addButton(['label' => 'Nouveau produit <span class="glyphicon glyphicon-p
],
[
'attribute' => 'id_tax_rate',
'headerOptions' => ['class' => 'column-hide-on-mobile'],
'filterOptions' => ['class' => 'column-hide-on-mobile'],
'contentOptions' => ['class' => 'column-hide-on-mobile'],
'value' => function ($model) {
if ($model->id_tax_rate == 0 || $model->id_tax_rate == null) {

@@ -123,8 +137,9 @@ $this->addButton(['label' => 'Nouveau produit <span class="glyphicon glyphicon-p
],
[
'attribute' => 'active',
'headerOptions' => ['class' => 'active'],
'contentOptions' => ['class' => 'center'],
'headerOptions' => ['class' => 'active column-hide-on-mobile'],
'filterOptions' => ['class' => 'column-hide-on-mobile'],
'contentOptions' => ['class' => 'center column-hide-on-mobile'],
'format' => 'raw',
'filter' => [0 => 'Non', 1 => 'Oui'],
'value' => function ($model) {

+ 24
- 13
backend/web/css/screen.css Parādīt failu

@@ -1856,6 +1856,12 @@ body.login-page .login-box .login-box-body a:hover {
height: 75px;
background-color: white;
}
@media screen and (max-width: 768px) {
/* line 17, ../sass/product/_index.scss */
.product-index .td-photo {
display: none;
}
}

/* line 6, ../sass/product/_form.scss */
.product-create #product-active label,
@@ -2597,64 +2603,69 @@ termes.
display: none;
}

/* line 62, ../sass/_responsive.scss */
/* line 56, ../sass/_responsive.scss */
.table .column-hide-on-mobile {
display: none;
}

/* line 67, ../sass/_responsive.scss */
.distribution-index .modal-form-order .modal-container .modal-body table.table-products td.quantity .form-control {
width: 50px;
height: 52px;
}
/* line 68, ../sass/_responsive.scss */
/* line 73, ../sass/_responsive.scss */
.distribution-index .modal-form-order .modal-container .modal-body table.table-products td.price {
display: none;
}
/* line 76, ../sass/_responsive.scss */
/* line 81, ../sass/_responsive.scss */
.distribution-index .modal-form-order .modal-container .modal-footer .actions-form div.right {
display: none;
}
/* line 87, ../sass/_responsive.scss */
/* line 92, ../sass/_responsive.scss */
.distribution-index #orders #buttons-top-orders .left {
width: 100%;
float: none;
}
/* line 92, ../sass/_responsive.scss */
/* line 97, ../sass/_responsive.scss */
.distribution-index #orders #buttons-top-orders .right {
width: 100%;
float: none;
}
/* line 97, ../sass/_responsive.scss */
/* line 102, ../sass/_responsive.scss */
.distribution-index #orders #buttons-top-orders .btn {
padding: 8px 15px;
margin: 10px;
display: block;
width: 100%;
}
/* line 107, ../sass/_responsive.scss */
/* line 112, ../sass/_responsive.scss */
.distribution-index #orders #wrapper-nav-points-sale ul#nav-points-sale li {
float: none;
width: 100%;
}
/* line 111, ../sass/_responsive.scss */
/* line 116, ../sass/_responsive.scss */
.distribution-index #orders #wrapper-nav-points-sale ul#nav-points-sale li a {
display: block;
}
/* line 120, ../sass/_responsive.scss */
/* line 125, ../sass/_responsive.scss */
.distribution-index #orders table .state-payment-mobile {
display: block;
}
/* line 123, ../sass/_responsive.scss */
/* line 128, ../sass/_responsive.scss */
.distribution-index #orders table .state-payment-mobile .glyphicon-time {
display: none;
}
/* line 129, ../sass/_responsive.scss */
/* line 134, ../sass/_responsive.scss */
.distribution-index #orders table ul.dropdown-menu a {
padding: 15px;
}
/* line 134, ../sass/_responsive.scss */
/* line 139, ../sass/_responsive.scss */
.distribution-index #orders table button.dropdown-toggle,
.distribution-index #orders table button.btn-moins,
.distribution-index #orders table button.btn-plus {
padding: 15px;
}
/* line 141, ../sass/_responsive.scss */
/* line 146, ../sass/_responsive.scss */
.distribution-index #orders table .column-origin,
.distribution-index #orders table .column-point-sale,
.distribution-index #orders table .column-state-payment,

+ 2
- 2
backend/web/js/backend.js Parādīt failu

@@ -151,7 +151,7 @@ function opendistrib_products_event_price_with_tax() {
if (price) {
$('#product-price-with-tax').val(getPriceWithTax(price, taxRateSelected));
// formattage
$('#product-price').val(parseFloat(price).toFixed(3));
$('#product-price').val(parseFloat(price).toFixed(5));
}
}
}
@@ -224,7 +224,7 @@ function opendistrib_product_prices_event_price_with_tax() {
if (price) {
$('#productprice-price-with-tax').val(getPriceWithTax(price, taxRateValue));
// formattage
$('#productprice-price').val(parseFloat(price).toFixed(3));
$('#productprice-price').val(parseFloat(price).toFixed(5));
}
}


+ 6
- 1
backend/web/sass/_responsive.scss Parādīt failu

@@ -52,8 +52,13 @@ termes.
}
}

.distribution-index {
.table {
.column-hide-on-mobile {
display: none;
}
}

.distribution-index {
.modal-form-order {
.modal-container {
.modal-body {

+ 7
- 1
backend/web/sass/product/_index.scss Parādīt failu

@@ -11,5 +11,11 @@
.ui-state-highlight {
height: 75px;
background-color: $color2 ;
}
}

@media screen and (max-width: 768px) {
.td-photo {
display: none;
}
}
}

+ 6
- 2
common/logic/Producer/Producer/Model/Producer.php Parādīt failu

@@ -151,7 +151,6 @@ class Producer extends ActiveRecordCommon
'option_online_payment_minimum_amount',
'option_document_price_decimals',
'option_billing_reduction_percentage',
'option_billing_permanent_transfer_amount',
],
'integer'
],
@@ -279,7 +278,12 @@ class Producer extends ActiveRecordCommon
'string',
'max' => 255
],
[['free_price', 'credit_limit_reminder', 'credit_limit'], 'double'],
[[
'free_price',
'credit_limit_reminder',
'credit_limit',
'option_billing_permanent_transfer_amount'
], 'double'],
[
'free_price',
'compare',

+ 1
- 1
common/web/js/utils.js Parādīt failu

@@ -10,7 +10,7 @@
* @returns {string}
*/
function getPrice(priceWithTax, taxRate) {
return numberDecimals(parseFloat(parseFloat(priceWithTax) / (taxRate + 1)), 3);
return numberDecimals(parseFloat(parseFloat(priceWithTax) / (taxRate + 1)), 5);
}

/**

+ 26
- 0
console/migrations/m230524_091204_update_field_producer_option_billing_permanent_transfer_amount.php Parādīt failu

@@ -0,0 +1,26 @@
<?php

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

/**
* Class m230524_091204_update_field_producer_option_billing_permanent_transfer_amount
*/
class m230524_091204_update_field_producer_option_billing_permanent_transfer_amount extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->alterColumn('producer', 'option_billing_permanent_transfer_amount', Schema::TYPE_DOUBLE);
}

/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->alterColumn('producer', 'option_billing_permanent_transfer_amount', Schema::TYPE_INTEGER);
}
}

+ 0
- 4
frontend/controllers/UserController.php Parādīt failu

@@ -85,10 +85,6 @@ class UserController extends FrontendController
if ($model->load($this->getRequest()->post())
&& $model->validate()) {

// l'utilisateur ne peut pas changer d'adresse email
$oldModel = $this->findModel($idUser);
$model->email = $oldModel->email;

// modification du mot de passe
if (strlen($model->password_new)) {
$model->password_hash = \Yii::$app->security->generatePasswordHash($model->password_new);

+ 1
- 1
frontend/views/user/update.php Parādīt failu

@@ -56,7 +56,7 @@ $this->title = 'Mon profil' ;
<?= $form->field($model, 'lastname')->textInput() ?>
<?= $form->field($model, 'name')->textInput() ?>
<?= $form->field($model, 'phone')->textInput() ?>
<?= $form->field($model, 'email')->textInput(['readonly' => true]); ?>
<?= $form->field($model, 'email')->textInput(); ?>
<?= $form->field($model, 'address')->textarea() ?>
<h2>Mot de passe</h2>

+ 15
- 10
producer/views/order/order.php Parādīt failu

@@ -311,14 +311,17 @@ $this->setTitle('Commander') ;
<td class="name">
<span class="name">{{ product.name }}</span>
<span class="other">
<span v-if="product.description.length">/</span>
<span class="description">{{ product.description }}</span>
<span v-if="product.weight">({{ product.weight }}&nbsp;g)</span>
</span>
<span v-if="product.weight">({{ product.weight }}&nbsp;g)</span>
</span>
<span v-if="product.quantity_max > 0 && ((product.quantity_form / product.coefficient_unit == product.quantity_remaining) || ((product.quantity_remaining * product.coefficient_unit) - product.quantity_form) < product.step)" class="label label-danger">
Épuisé
</span>
<div class="recipe" v-if="product.recipe.length">{{ product.recipe }}</div>
Épuisé
</span>
<div class="description" v-if="product.description.length">
{{ product.description }}
</div>
<div class="recipe" v-if="product.recipe.length">
{{ product.recipe }}
</div>
</td>
<td class="price-unit">
<template v-if="productHasPrice(product)">
@@ -365,10 +368,12 @@ $this->setTitle('Commander') ;
<li v-for="product in products" v-if="product.quantity_form > 0">
<span class="quantity">{{ product.quantity_form }} {{ product.unit == 'piece' ? 'p.' : product.unit }} x</span>
<span class="name">{{ product.name }}</span>
<span class="other">
<!--<span class="other">
<span v-if="product.description.length">/</span>
<span class="description">{{ product.description }}</span>
<span v-if="product.weight">({{ product.weight }}&nbsp;g)</span>
<span class="description">{{ product.description }}</span>-->
<span class="other">
<span v-if="product.weight">({{ product.weight }}&nbsp;g)</span>
</span>
</li>
</ul>
</template>

+ 35
- 28
producer/web/css/screen.css Parādīt failu

@@ -1543,17 +1543,24 @@ termes.
color: black;
font-size: 20px;
line-height: 25px;
font-weight: bold;
}
/* line 276, ../sass/order/_order.scss */
/* line 277, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products td.name .other {
font-size: 14px;
color: #333;
font-family: "capsuularegular";
color: black;
font-weight: bold;
font-size: 17px;
}
/* line 280, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products td.name .recipe {
/* line 283, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products td.name .description {
color: gray;
}
/* line 286, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products td.name .recipe {
color: gray;
}
/* line 292, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products .price-unit .decreasing-prices {
margin-top: 10px;
font-size: 10px;
@@ -1561,34 +1568,34 @@ termes.
padding-bottom: 2px;
margin-bottom: 0px;
}
/* line 294, ../sass/order/_order.scss */
/* line 300, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products .price-unit .decreasing-prices ul li {
margin-bottom: 5px;
}
/* line 296, ../sass/order/_order.scss */
/* line 302, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products .price-unit .decreasing-prices ul li strong {
font-weight: bold;
}
/* line 304, ../sass/order/_order.scss */
/* line 310, ../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: 135px;
text-align: center;
}
/* line 308, ../sass/order/_order.scss */
/* line 314, ../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 313, ../sass/order/_order.scss */
/* line 319, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products .td-quantity {
width: 175px;
}
/* line 315, ../sass/order/_order.scss */
/* line 321, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products .td-quantity input.quantity {
text-align: center;
border-right: 0px none;
}
/* line 319, ../sass/order/_order.scss */
/* line 325, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products .td-quantity .input-group-addon {
padding: 5px;
padding-left: 0px;
@@ -1596,69 +1603,69 @@ termes.
border-left: 0px none;
border-right: 0px none;
}
/* line 330, ../sass/order/_order.scss */
/* line 336, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products tr.total .summary h3 {
margin-top: 0px;
font-family: "capsuularegular";
text-transform: none;
margin-bottom: 5px;
}
/* line 337, ../sass/order/_order.scss */
/* line 343, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products tr.total .summary ul {
margin-bottom: 15px;
padding-left: 20px;
font-size: 23px;
}
/* line 344, ../sass/order/_order.scss */
/* line 350, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products tr.total .summary ul li .quantity {
font-size: 18px;
}
/* line 348, ../sass/order/_order.scss */
/* line 354, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products tr.total .summary ul li .name {
font-family: "capsuularegular";
font-size: 24px;
}
/* line 352, ../sass/order/_order.scss */
/* line 358, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products tr.total .summary ul li .other {
font-family: "arial";
font-size: 14px;
font-family: "capsuularegular";
font-size: 18px;
}
/* line 359, ../sass/order/_order.scss */
/* line 366, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products tr.total .price-total {
font-size: 23px;
}
/* line 367, ../sass/order/_order.scss */
/* line 374, ../sass/order/_order.scss */
.order-order #main #app-order-order #content-step-payment .delivery {
margin-bottom: 20px;
}
/* line 370, ../sass/order/_order.scss */
/* line 377, ../sass/order/_order.scss */
.order-order #main #app-order-order #content-step-payment .delivery .delivery-home {
margin-bottom: 20px;
}
/* line 379, ../sass/order/_order.scss */
/* line 386, ../sass/order/_order.scss */
.order-order #main #app-order-order #content-step-payment .comment {
margin-bottom: 20px;
}
/* line 384, ../sass/order/_order.scss */
/* line 391, ../sass/order/_order.scss */
.order-order #main #app-order-order #content-step-payment .credit .info {
margin-left: 20px;
color: gray;
}
/* line 391, ../sass/order/_order.scss */
/* line 398, ../sass/order/_order.scss */
.order-order #main #app-order-order #specific-delays {
margin-top: 15px;
}
/* line 399, ../sass/order/_order.scss */
/* line 406, ../sass/order/_order.scss */
.order-order #main #app-order-order #infos {
margin-top: 30px;
}
/* line 401, ../sass/order/_order.scss */
/* line 408, ../sass/order/_order.scss */
.order-order #main #app-order-order #infos .panel-body {
padding-top: 0px;
white-space: pre-line;
}

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

+ 11
- 4
producer/web/sass/order/_order.scss Parādīt failu

@@ -272,10 +272,16 @@
color: black ;
font-size: 20px ;
line-height: 25px ;
font-weight: bold;
}
.other {
font-size: 14px ;
color: #333 ;
font-family: 'capsuularegular' ;
color: black ;
font-weight: bold;
font-size: 17px ;
}
.description {
color: gray;
}
.recipe {
color: gray ;
@@ -350,8 +356,9 @@
font-size: 24px ;
}
.other {
font-family: 'arial' ;
font-size: 14px ;
//font-family: 'arial' ;
font-family: 'capsuularegular' ;
font-size: 18px ;
}
}
}

Notiek ielāde…
Atcelt
Saglabāt