瀏覽代碼

[Administration] Distribution > édition commande : pouvoir modifier les prix facturés #888

refactoring
Guillaume 1 年之前
父節點
當前提交
18c7ccfaee
共有 7 個文件被更改,包括 47 次插入22 次删除
  1. +2
    -2
      backend/controllers/DistributionController.php
  2. +5
    -0
      backend/controllers/OrderController.php
  3. +6
    -7
      backend/views/distribution/index.php
  4. +22
    -12
      backend/web/css/screen.css
  5. +2
    -1
      backend/web/js/vuejs/distribution-index.js
  6. +9
    -0
      backend/web/sass/distribution/_index.scss
  7. +1
    -0
      common/logic/Document/Document/Service/DocumentUtils.php

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

@@ -263,7 +263,7 @@ class DistributionController extends BackendController
'quantity' => $productOrder->quantity * Product::$unitsArray[$productOrder->unit]['coefficient'],
'unit' => $productOrder->unit,
'price' => number_format($productOrder->price, 3),
'invoice_price' => number_format($productOrder->invoice_price, 2),
'invoice_price' => number_format($productOrder->invoice_price, 3),
'price_with_tax' => Price::getPriceWithTax($productOrder->price, $productOrder->taxRate->value),
];
}
@@ -509,7 +509,7 @@ class DistributionController extends BackendController
foreach ($order->productOrder as $productOrder) {
if ($productOrder->id_product == $product['id']) {
if ($productOrder->invoice_price) {
$invoicePrice = number_format($productOrder->invoice_price, 2);
$invoicePrice = number_format($productOrder->invoice_price, 3);
} else {
$invoicePrice = number_format($productOrder->price, 3);
}

+ 5
- 0
backend/controllers/OrderController.php 查看文件

@@ -946,6 +946,11 @@ class OrderController extends BackendController
if ($productOrder) {
$productOrder->quantity = $quantity;
$productOrder->price = $dataProductOrder->price;

if($dataProductOrder->invoice_price && $dataProductOrder->invoice_price != $dataProductOrder->price) {
//die('invoice price : '.$dataProductOrder->invoice_price);
$productOrder->invoice_price = $dataProductOrder->invoice_price;
}
} else {
$product = Product::findOne($key);


+ 6
- 7
backend/views/distribution/index.php 查看文件

@@ -650,13 +650,12 @@ $this->setPageTitle('Distributions') ;
<input type="text" v-model="order.productOrder[product.id].price_with_tax" class="form-control input-sm" @change="productPriceChange" :data-with-tax="true" :data-id-product="product.id" />
<span class="input-group-addon" id="basic-addon2">€ TTC</span>
</div>
<div v-if="(order.id_invoice || order.id_delivery_note || order.id_quotation) && order.productOrder[product.id].quantity > 0">
<span class="label label-default">
Facturé
<template v-if="order.productOrder[product.id].invoice_price != null">{{ order.productOrder[product.id].invoice_price }}</template>
<template v-else>{{ order.productOrder[product.id].price }}</template>
€ HT
</span>
<div class="invoice-price" v-show="vatMode == 'all'" v-if="(order.id_invoice || order.id_delivery_note || order.id_quotation) && order.productOrder[product.id].quantity > 0">
<span class="label-invoice-price">Prix facturé</span><br />
<div class="input-group">
<input type="text" v-model="order.productOrder[product.id].invoice_price" class="form-control input-sm" :data-id-product="product.id" />
<span class="input-group-addon" id="basic-addon2">€ HT</span>
</div>
</div>
</td>
<td class="quantity">

+ 22
- 12
backend/web/css/screen.css 查看文件

@@ -2251,21 +2251,31 @@ termes.
.distribution-index .modal-form-order table.table-products td.price .input-group-addon {
background-color: #eee;
}
/* line 396, ../sass/distribution/_index.scss */
/* line 395, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.price .invoice-price {
margin-top: 8px;
}
/* line 397, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.price .invoice-price .label-invoice-price {
font-size: 11px;
font-weight: bold;
color: gray;
}
/* line 405, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity {
width: 165px;
}
/* line 399, ../sass/distribution/_index.scss */
/* line 408, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity input {
text-align: center;
color: black;
}
/* line 404, ../sass/distribution/_index.scss */
/* line 413, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity .form-control {
border-right: 0px none;
padding-right: 4px;
}
/* line 409, ../sass/distribution/_index.scss */
/* line 418, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity .input-group-addon {
padding: 5px;
padding-left: 0px;
@@ -2273,35 +2283,35 @@ termes.
border-left: 0px none;
border-right: 0px none;
}
/* line 418, ../sass/distribution/_index.scss */
/* line 427, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity-remaining {
text-align: right;
}
/* line 421, ../sass/distribution/_index.scss */
/* line 430, ../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 425, ../sass/distribution/_index.scss */
/* line 434, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity-remaining.negative {
color: #DD4B39;
}
/* line 429, ../sass/distribution/_index.scss */
/* line 438, ../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 436, ../sass/distribution/_index.scss */
/* line 445, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order .actions-form button {
margin-left: 15px;
}
/* line 444, ../sass/distribution/_index.scss */
/* line 453, ../sass/distribution/_index.scss */
.distribution-index .modal-payment .info-box .info-box-icon {
width: 50px;
}
/* line 447, ../sass/distribution/_index.scss */
/* line 456, ../sass/distribution/_index.scss */
.distribution-index .modal-payment .info-box .info-box-icon i {
font-size: 30px;
}
/* line 452, ../sass/distribution/_index.scss */
/* line 461, ../sass/distribution/_index.scss */
.distribution-index .modal-payment .info-box .info-box-content {
margin-left: 50px;
}

+ 2
- 1
backend/web/js/vuejs/distribution-index.js 查看文件

@@ -817,7 +817,8 @@ Vue.component('order-form',{
productOrderArrayRequest[key] = {
quantity: this.order.productOrder[key].quantity,
unit: this.order.productOrder[key].unit,
price: this.order.productOrder[key].price
price: this.order.productOrder[key].price,
invoice_price: this.order.productOrder[key].invoice_price
};
}
return JSON.stringify(productOrderArrayRequest);

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

@@ -391,6 +391,15 @@ termes.
.input-group-addon {
background-color: #eee;
}

.invoice-price {
margin-top: 8px;
.label-invoice-price {
font-size: 11px;
font-weight: bold;
color: gray;
}
}
}

td.quantity {

+ 1
- 0
common/logic/Document/Document/Service/DocumentUtils.php 查看文件

@@ -81,6 +81,7 @@ class DocumentUtils extends AbstractService implements UtilsInterface
$aliasDirectoryBase = $this->documentSolver->getAliasDirectoryBase($document);
$directoryPdf = \Yii::getAlias($aliasDirectoryBase);
if (!file_exists($directoryPdf)) {
//die('dir : '.$directoryPdf);
mkdir($directoryPdf, 0755);
}
}

Loading…
取消
儲存