Aggiornamento modifiche preOrdini
This commit is contained in:
@@ -40,14 +40,29 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function addsubqty(addqty: boolean, subqty: boolean) {
|
||||
if (addqty) {
|
||||
if (props.order.quantity >= 10)
|
||||
return false
|
||||
}
|
||||
if (products.isQtyAvailableByOrder(props.order)) {
|
||||
if (addqty) {
|
||||
if (props.order.quantity >= 20)
|
||||
return false
|
||||
}
|
||||
|
||||
if (subqty) {
|
||||
if (props.order.quantity === 0)
|
||||
return false
|
||||
if (subqty) {
|
||||
if (props.order.quantity === 0)
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
|
||||
if (products.isInPreorderByOrder(props.order)) {
|
||||
if (addqty) {
|
||||
if (props.order.quantitypreordered >= 20)
|
||||
return false
|
||||
}
|
||||
|
||||
if (subqty) {
|
||||
if (props.order.quantitypreordered === 0)
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
products.addSubQtyToItem({
|
||||
@@ -56,14 +71,15 @@ export default defineComponent({
|
||||
order: props.order,
|
||||
}).then((res: any) => {
|
||||
if (res.risult) {
|
||||
order.value.quantity = res.qty
|
||||
order.value.quantity = res.myord.quantity
|
||||
order.value.quantitypreordered = res.myord.quantitypreordered
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function isApplicatoSconto() {
|
||||
const totalipotetico = order.value.price! * order.value.quantity
|
||||
if (totalipotetico > order.value.TotalPriceProduct!) {
|
||||
const totalipotetico = order.value.price * (order.value.quantity + order.value.quantitypreordered)
|
||||
if (totalipotetico > order.value.TotalPriceProduct) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user