Преглед на файлове

[Administration] Distributions : mise en avant des dépassements de quantités #1186

feature/souke
Guillaume Bourgeois преди 1 година
родител
ревизия
dbcb472c83
променени са 2 файла, в които са добавени 17 реда и са изтрити 3 реда
  1. +6
    -2
      backend/views/distribution/index.php
  2. +11
    -1
      backend/web/js/vuejs/distribution-index.js

+ 6
- 2
backend/views/distribution/index.php Целия файл

@@ -432,6 +432,7 @@ $this->setPageTitle('Distributions') ;
:users="users"
:products="products"
:order="ordersUpdate[key]"
:orders="ordersUpdate"
:producer="producer"
:loading-update-product-order="loadingUpdateProductOrder"
@close="showModalFormOrderUpdate = false"
@@ -691,8 +692,11 @@ $this->setPageTitle('Distributions') ;
</div>
</td>
<td class="quantity-remaining infinite" v-if="product.quantity_remaining === null || order.productOrder[product.id].unit != product.unit">&infin;</td>
<td class="quantity-remaining negative" v-else-if="product.quantity_remaining <= 0">{{ product.quantity_remaining }} {{ order.productOrder[product.id].unit == 'piece' ? ' p.' : ' '+(order.productOrder[product.id].unit == 'g' || order.productOrder[product.id].unit == 'kg') ? 'kg' : 'litre(s)' }}</td>
<td class="quantity-remaining has-quantity" v-else>{{ product.quantity_remaining }} {{ order.productOrder[product.id].unit == 'piece' ? ' p.' : ' '+(order.productOrder[product.id].unit == 'g' || order.productOrder[product.id].unit == 'kg') ? 'kg' : 'litre(s)' }}</td>
<td class="quantity-remaining negative" v-else-if="getProductQuantityRemaining(product) <= 0">
{{ getProductQuantityRemaining(product) }} {{ order.productOrder[product.id].unit == 'piece' ? ' p.' : ' '+(order.productOrder[product.id].unit == 'g' || order.productOrder[product.id].unit == 'kg') ? 'kg' : 'litre(s)' }}
<span class="glyphicon glyphicon-alert" v-if="getProductQuantityRemaining(product) < 0"></span>
</td>
<td class="quantity-remaining has-quantity" v-else>{{ getProductQuantityRemaining(product) }} {{ order.productOrder[product.id].unit == 'piece' ? ' p.' : ' '+(order.productOrder[product.id].unit == 'g' || order.productOrder[product.id].unit == 'kg') ? 'kg' : 'litre(s)' }}</td>
</tr>
</tbody>
</table>

+ 11
- 1
backend/web/js/vuejs/distribution-index.js Целия файл

@@ -871,7 +871,7 @@ Vue.component('modal', {
});

Vue.component('order-form', {
props: ['date', 'dateFormat', 'pointsSale', 'idActivePointSale', 'meansPayment', 'users', 'products', 'order', 'producer', 'loadingUpdateProductOrder'],
props: ['date', 'dateFormat', 'pointsSale', 'idActivePointSale', 'meansPayment', 'users', 'products', 'order', 'orders', 'producer', 'loadingUpdateProductOrder'],
emits: ['updateProductPrice', 'updateInvoicePrices'],
data: function () {
return {
@@ -1078,6 +1078,16 @@ Vue.component('order-form', {
} else {
this.vatMode = 'all';
}
},
getProductQuantityRemaining: function(product) {
var app = this;
var productQuantityOrder = 0;

for(key in app.orders) {
var order = app.orders[key];
productQuantityOrder += order.productOrder[product.id].quantity;
}
return product.productDistribution[0].quantity_max - productQuantityOrder;
}
}
});

Loading…
Отказ
Запис