Browse Source

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

feature/souke
Guillaume Bourgeois 1 year ago
parent
commit
1c4a0973d8
2 changed files with 11 additions and 2 deletions
  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 View File

<div class="panel-body"> <div class="panel-body">
<order-form <order-form
v-if="showModalFormOrderCreate" v-if="showModalFormOrderCreate"
create="1"
:date="date" :date="date"
:order="orderCreate" :order="orderCreate"
:points-sale="pointsSale" :points-sale="pointsSale"
:users="users" :users="users"
:products="products" :products="products"
:producer="producer" :producer="producer"
:orders="ordersUpdate"
:loading-update-product-order="loadingUpdateProductOrder" :loading-update-product-order="loadingUpdateProductOrder"
@close="showModalFormOrderCreate = false" @close="showModalFormOrderCreate = false"
@ordercreatedupdated="orderCreatedUpdated" @ordercreatedupdated="orderCreatedUpdated"


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

+ 8
- 2
backend/web/js/vuejs/distribution-index.js View File

}); });


Vue.component('order-form', { 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'], emits: ['updateProductPrice', 'updateInvoicePrices'],
data: function () { data: function () {
return { return {
} }
}, },
getProductQuantityRemaining: function(product) { getProductQuantityRemaining: function(product) {
var order = null;
var app = this; var app = this;
var productQuantityOrder = 0; var productQuantityOrder = 0;


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

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

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

Loading…
Cancel
Save