Bladeren bron

[Administration] Distributions > Nouvelle commande : bug affichage quantités restantes #1236

feature/souke
Guillaume Bourgeois 1 jaar geleden
bovenliggende
commit
1c4a0973d8
2 gewijzigde bestanden met toevoegingen van 11 en 2 verwijderingen
  1. +3
    -0
      backend/views/distribution/index.php
  2. +8
    -2
      backend/web/js/vuejs/distribution-index.js

+ 3
- 0
backend/views/distribution/index.php Bestand weergeven

@@ -240,6 +240,7 @@ $this->setPageTitle('Distributions') ;
<div class="panel-body">
<order-form
v-if="showModalFormOrderCreate"
create="1"
:date="date"
:order="orderCreate"
:points-sale="pointsSale"
@@ -248,6 +249,7 @@ $this->setPageTitle('Distributions') ;
:users="users"
:products="products"
:producer="producer"
:orders="ordersUpdate"
:loading-update-product-order="loadingUpdateProductOrder"
@close="showModalFormOrderCreate = false"
@ordercreatedupdated="orderCreatedUpdated"
@@ -510,6 +512,7 @@ $this->setPageTitle('Distributions') ;

<order-form
v-if="showModalFormOrderUpdate && idOrderUpdate == order.id"
create="0"
:date="date"
:date-format="dateFormat"
:points-sale="pointsSale"

+ 8
- 2
backend/web/js/vuejs/distribution-index.js Bestand weergeven

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

Vue.component('order-form', {
props: ['date', 'dateFormat', 'pointsSale', 'idActivePointSale', 'meansPayment', 'users', 'products', 'order', 'orders', 'producer', 'loadingUpdateProductOrder'],
props: ['date', 'dateFormat', 'pointsSale', 'idActivePointSale', 'meansPayment', 'users', 'products', 'order', 'orders', 'producer', 'loadingUpdateProductOrder', 'create'],
emits: ['updateProductPrice', 'updateInvoicePrices'],
data: function () {
return {
@@ -1132,13 +1132,19 @@ Vue.component('order-form', {
}
},
getProductQuantityRemaining: function(product) {
var order = null;
var app = this;
var productQuantityOrder = 0;

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

if(app.create == 1) {
productQuantityOrder += app.order.productOrder[product.id].quantity;
}

return product.productDistribution[0].quantity_max - productQuantityOrder;
}
}

Laden…
Annuleren
Opslaan