|
|
@@ -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; |
|
|
|
} |
|
|
|
} |