Carrello con scontistica aggiornata
This commit is contained in:
@@ -415,11 +415,13 @@ export const useProducts = defineStore('Products', {
|
||||
if (order.quantity === 0)
|
||||
order.quantity = 1
|
||||
|
||||
neworder = this.createOrderByProduct(product, order)
|
||||
if (order.idStorehouse) {
|
||||
neworder = this.createOrderByProduct(product, order)
|
||||
}
|
||||
}
|
||||
|
||||
if (neworder && !neworder.idStorehouse)
|
||||
return new Types.AxiosError(serv_constants.RIS_CODE_ERR, null, toolsext.ERR_GENERICO, 'Nessuno Store')
|
||||
// if (neworder && !neworder.idStorehouse)
|
||||
// return new Types.AxiosError(serv_constants.RIS_CODE_ERR, null, toolsext.ERR_GENERICO, 'Nessuno Store')
|
||||
|
||||
console.log('addToCart', 'userid=', userStore.my._id, neworder)
|
||||
|
||||
|
||||
@@ -1754,9 +1754,23 @@ export const useUserStore = defineStore('UserStore', {
|
||||
|
||||
async importToServerCmd($q: any, t: any, cmd: number, data: any) {
|
||||
return Api.SendReq('/admin/import', 'POST', { cmd, data })
|
||||
.then((res) => {
|
||||
.then((res: any) => {
|
||||
if (res) {
|
||||
tools.showPositiveNotif($q, t('db.recupdated'))
|
||||
let msg = ''
|
||||
|
||||
if (res.data.imported) {
|
||||
msg += ' ' + t('db.records_imported', {num: res.data.imported})
|
||||
}
|
||||
if (res.data.errors) {
|
||||
msg += ' ' + t('db.records_errors', {num: res.data.errors})
|
||||
}
|
||||
if (res.data.updated) {
|
||||
msg += ' ' + t('db.records_updated', {num: res.data.updated})
|
||||
}
|
||||
if (!msg) {
|
||||
msg = t('db.recupdated')
|
||||
}
|
||||
tools.showPositiveNotif($q, msg)
|
||||
}
|
||||
}).catch((error) => {
|
||||
tools.showNegativeNotif($q, t('db.recfailed'))
|
||||
|
||||
Reference in New Issue
Block a user