瀏覽代碼

[Administration] Distributions > formulaire commande : ajout champs prix HT #577

refactoring
Guillaume Bourgeois 2 年之前
父節點
當前提交
a3233393be
共有 6 個檔案被更改,包括 70 行新增22 行删除
  1. +17
    -2
      backend/controllers/OrderController.php
  2. +11
    -3
      backend/views/distribution/index.php
  3. +25
    -17
      backend/web/css/screen.css
  4. +8
    -0
      backend/web/js/vuejs/distribution-index.js
  5. +8
    -0
      backend/web/sass/distribution/_index.scss
  6. +1
    -0
      common/versions/22.10.A.php

+ 17
- 2
backend/controllers/OrderController.php 查看文件

@@ -857,6 +857,16 @@ class OrderController extends BackendController

$order->save();

$user = false;
$userProducer = false;
if (isset($order->user) && $order->user) {
$user = $order->user;
$userProducer = UserProducer::searchOne([
'id_user' => $user->id,
'id_producer' => $order->distribution->id_producer
]);
}

foreach ($products as $key => $dataProductOrder) {
$product = Product::findOne($key);
$quantity = $dataProductOrder->quantity / Product::$unitsArray[$dataProductOrder->unit]['coefficient'];
@@ -868,9 +878,14 @@ class OrderController extends BackendController
$productOrder->unit = $product->unit;
$productOrder->step = $product->step;
if ($dataProductOrder->price) {
$productOrder->price = number_format(Price::getPrice($dataProductOrder->price, $product->taxRate->value), 3);
$productOrder->price = $dataProductOrder->price;
} else {
$productOrder->price = $product->price;
$productOrder->price = $product->getPrice([
'user' => $user,
'user_producer' => $userProducer,
'point_sale' => $order->pointSale,
'quantity' => $productOrder->quantity
]);
}
$productOrder->id_tax_rate = $product->taxRate->id;
$productOrder->save();

+ 11
- 3
backend/views/distribution/index.php 查看文件

@@ -640,7 +640,7 @@ $this->setPageTitle('Distributions') ;
</td>
<td>{{ product.name }}</td>
<td class="price">
<div class="input-group">
<div v-show="vatMode == 'all'" class="input-group">
<input type="text" v-model="order.productOrder[product.id].price" class="form-control input-sm" @change="productPriceChange" :data-with-tax="false" :data-id-product="product.id" />
<span class="input-group-addon" id="basic-addon2">€ HT&nbsp;&nbsp;</span>
</div>
@@ -677,8 +677,16 @@ $this->setPageTitle('Distributions') ;
<button class="modal-default-button btn btn-primary" @click="submitFormUpdate" v-if="order.id">Modifier</button>
<button class="modal-default-button btn btn-primary" @click="submitFormCreate" v-else>Créer</button>

<button class="modal-default-button btn btn-default" @click="updateProductOrderPrices(true)">Recharger les prix</button>
<button class="modal-default-button btn btn-default" @click="$emit('close')">Annuler</button>
<button class="modal-default-button btn btn-danger" @click="$emit('close')">Annuler</button>

<div class="right">
<button class="modal-default-button btn btn-info" @click="updateProductOrderPrices(true)">Recharger les prix</button>
<button class="modal-default-button btn btn-info" @click="toggleVatMode()">
<template v-if="vatMode == 'all'">Cacher</template>
<template v-else>Afficher</template>
les prix HT
</button>
</div>
</div>
</div>
</modal>

+ 25
- 17
backend/web/css/screen.css 查看文件

@@ -2182,42 +2182,50 @@ termes.
.distribution-index .modal-form-order .modal-container .modal-footer .actions-form button {
float: none;
}
/* line 360, ../sass/distribution/_index.scss */
/* line 357, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order .modal-container .modal-footer .actions-form div.right {
float: right;
}
/* line 364, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order .btn-credit {
float: right;
}
/* line 366, ../sass/distribution/_index.scss */
/* line 370, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products .product-ordered td {
background-color: #e9e9e9;
}
/* line 370, ../sass/distribution/_index.scss */
/* line 374, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products .product-ordered input.input-quantity {
font-size: 16px;
font-weight: bold;
}
/* line 376, ../sass/distribution/_index.scss */
/* line 380, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.price {
width: 150px;
}
/* line 379, ../sass/distribution/_index.scss */
/* line 383, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.price input {
text-align: center;
}
/* line 384, ../sass/distribution/_index.scss */
/* line 387, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.price .input-group-addon {
background-color: #eee;
}
/* line 392, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity {
width: 165px;
}
/* line 387, ../sass/distribution/_index.scss */
/* line 395, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity input {
text-align: center;
color: black;
}
/* line 392, ../sass/distribution/_index.scss */
/* line 400, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity .form-control {
border-right: 0px none;
padding-right: 4px;
}
/* line 397, ../sass/distribution/_index.scss */
/* line 405, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity .input-group-addon {
padding: 5px;
padding-left: 0px;
@@ -2225,35 +2233,35 @@ termes.
border-left: 0px none;
border-right: 0px none;
}
/* line 406, ../sass/distribution/_index.scss */
/* line 414, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity-remaining {
text-align: right;
}
/* line 409, ../sass/distribution/_index.scss */
/* line 417, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity-remaining.quantity-remaining, .distribution-index .modal-form-order table.table-products td.quantity-remaining.infinite {
color: #00A65A;
}
/* line 413, ../sass/distribution/_index.scss */
/* line 421, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity-remaining.negative {
color: #DD4B39;
}
/* line 417, ../sass/distribution/_index.scss */
/* line 425, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity-remaining.infinite, .distribution-index .modal-form-order table.table-products td.quantity-remaining.empty {
font-size: 18px;
}
/* line 424, ../sass/distribution/_index.scss */
/* line 432, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order .actions-form button {
margin-left: 15px;
}
/* line 432, ../sass/distribution/_index.scss */
/* line 440, ../sass/distribution/_index.scss */
.distribution-index .modal-payment .info-box .info-box-icon {
width: 50px;
}
/* line 435, ../sass/distribution/_index.scss */
/* line 443, ../sass/distribution/_index.scss */
.distribution-index .modal-payment .info-box .info-box-icon i {
font-size: 30px;
}
/* line 440, ../sass/distribution/_index.scss */
/* line 448, ../sass/distribution/_index.scss */
.distribution-index .modal-payment .info-box .info-box-content {
margin-left: 50px;
}

+ 8
- 0
backend/web/js/vuejs/distribution-index.js 查看文件

@@ -894,6 +894,14 @@ Vue.component('order-form',{
},
updateProductOrderPrices: function(updateProductOrderPrices) {
this.$emit('updateproductorderprices', updateProductOrderPrices) ;
},
toggleVatMode: function() {
if(this.vatMode == 'all') {
this.vatMode = 'with_tax';
}
else {
this.vatMode = 'all';
}
}
}
}) ;

+ 8
- 0
backend/web/sass/distribution/_index.scss 查看文件

@@ -353,6 +353,10 @@ termes.
button {
float: none;
}

div.right {
float: right;
}
}
}
}
@@ -379,6 +383,10 @@ termes.
input {
text-align: center;
}

.input-group-addon {
background-color: #eee;
}
}

td.quantity {

+ 1
- 0
common/versions/22.10.A.php 查看文件

@@ -7,6 +7,7 @@
<h4>Évolutions</h4>
<ul>
<li>[Administration] Distributions > commandes : ajout ligne avec montant total et poids par point de vente</li>
<li>[Administration] Distributions > formulaire commande : ajout champs prix HT</li>
<li>[Administration] Produits, Utilisateurs, Statistiques et Documents : accès rapide en un clic</li>
<li>[Administration] Produits > liste : possibilité de modifier directement le champs "actif"</li>
<li>[Administration] Utilisateurs > commandes : ajout lien vers modification</li>

Loading…
取消
儲存