- preordinabili corretti + altro
This commit is contained in:
@@ -439,6 +439,7 @@ export const colTableStorehouse = [
|
||||
AddCol({ name: 'email_html_footer', label_trans: 'store.email_html_footer', fieldtype: costanti.FieldType.html }),
|
||||
AddCol({ name: 'email_html_makeorder', label_trans: 'store.email_html_makeorder', fieldtype: costanti.FieldType.html }),
|
||||
AddCol({ name: 'email_html_order_confirmed', label_trans: 'store.email_html_order_confirmed', fieldtype: costanti.FieldType.html }),
|
||||
AddCol({ name: 'email_html_order_consegnato', label_trans: 'store.email_html_order_consegnato', fieldtype: costanti.FieldType.html }),
|
||||
AddCol(DeleteRec),
|
||||
AddCol(DuplicateRec),
|
||||
]
|
||||
@@ -2050,6 +2051,11 @@ export const colTableProducts = [
|
||||
label_trans: 'products.minBuyQty',
|
||||
fieldtype: costanti.FieldType.number
|
||||
}),
|
||||
AddCol({
|
||||
name: 'minStepQty',
|
||||
label_trans: 'products.minStepQty',
|
||||
fieldtype: costanti.FieldType.number
|
||||
}),
|
||||
AddCol({
|
||||
name: 'maxBookableQty',
|
||||
label_trans: 'products.maxBookableQty',
|
||||
@@ -2065,6 +2071,16 @@ export const colTableProducts = [
|
||||
label_trans: 'products.bookableQty',
|
||||
fieldtype: costanti.FieldType.number
|
||||
}),
|
||||
AddCol({
|
||||
name: 'stockBloccatiQty',
|
||||
label_trans: 'products.stockBloccatiQty',
|
||||
fieldtype: costanti.FieldType.number
|
||||
}),
|
||||
AddCol({
|
||||
name: 'bookableBloccatiQty',
|
||||
label_trans: 'products.bookableBloccatiQty',
|
||||
fieldtype: costanti.FieldType.number
|
||||
}),
|
||||
AddCol({ name: 'canBeShipped', label_trans: 'products.canBeShipped', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'canBeBuyOnline', label_trans: 'products.canBeBuyOnline', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol(DeleteRec),
|
||||
|
||||
@@ -41,7 +41,9 @@ function getRecordProductEmpty() {
|
||||
},
|
||||
storehouses: [], scontisticas: [],
|
||||
price: 0, stockQty: 0, bookableQty: 0, gasordines: [],
|
||||
stockBloccatiQty: 0, bookableBloccatiQty: 0,
|
||||
idGasordines: [], minBuyQty: 1, maxBookableQty: 0,
|
||||
minStepQty: 1,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,10 +305,12 @@ export const useProducts = defineStore('Products', {
|
||||
quantityAvailable: 0,
|
||||
bookableAvailableQty: 0,
|
||||
stockQty: 0,
|
||||
stockBloccatiQty: 0,
|
||||
minBuyQty: 1,
|
||||
minStepQty: 1,
|
||||
maxBookableQty: 0,
|
||||
bookableQty: 0,
|
||||
bookableBloccatiQty: 0,
|
||||
canBeShipped: false,
|
||||
QuantitaOrdinateInAttesa: 0,
|
||||
QuantitaPrenotateInAttesa: 0,
|
||||
@@ -821,6 +825,16 @@ export const useProducts = defineStore('Products', {
|
||||
return qty
|
||||
},
|
||||
|
||||
getQtyBloccataAvailable(myproduct: IProduct): number {
|
||||
let qty = myproduct.stockBloccatiQty
|
||||
return qty
|
||||
},
|
||||
|
||||
getQtyBloccataBookableAvailable(myproduct: IProduct): number {
|
||||
let qty = myproduct.bookableBloccatiQty
|
||||
return qty
|
||||
},
|
||||
|
||||
enableSubQty(myorder: IOrder): boolean {
|
||||
let qty = myorder.quantity + myorder.quantitypreordered
|
||||
return qty ? qty > 0 : false
|
||||
@@ -846,21 +860,21 @@ export const useProducts = defineStore('Products', {
|
||||
},
|
||||
|
||||
qtaNextAdd(myorder: IOrder, myproduct: IProduct): number {
|
||||
let step = 1
|
||||
let step = myproduct.minStepQty
|
||||
if (this.getQtyAvailable(myproduct) > 0) {
|
||||
if (myorder.quantity === 0)
|
||||
step = myproduct.minBuyQty | 1
|
||||
step = myproduct.minBuyQty
|
||||
} else {
|
||||
if (myorder.quantitypreordered === 0)
|
||||
step = myproduct.minBuyQty | 1
|
||||
step = myproduct.minBuyQty
|
||||
}
|
||||
|
||||
return step
|
||||
},
|
||||
|
||||
qtaNextSub(myorder: IOrder, myproduct: IProduct) {
|
||||
let step = 1
|
||||
let minqta = myproduct.minBuyQty | 1
|
||||
let step = myproduct.minStepQty
|
||||
let minqta = myproduct.minBuyQty
|
||||
if (this.getQtyAvailable(myproduct) > 0) {
|
||||
if (myorder.quantity === minqta)
|
||||
step = minqta
|
||||
|
||||
Reference in New Issue
Block a user