- aggiunto bottone per Confermare tutti gli ordini

- 1 bottone per Consegnare e Pagare
This commit is contained in:
Surya Paolo
2024-02-16 14:11:03 +01:00
parent 5a6c08e908
commit 1c31543af8
2 changed files with 27 additions and 14 deletions

View File

@@ -376,25 +376,26 @@ router.post('/:userId/ordercartstatus', authenticate, async function (req, res,
const userDest = await User.findById(myOrdersCart.userId).lean();
if (ris) {
let ordertype = '';
// Aggiorna gli Stati Interni !
myOrdersCart = await OrdersCart.updateCmd(myOrdersCart, status, true, options);
let ordertype = '';
if ((options.hasOwnProperty('sendmail') && options.sendmail) || !options.hasOwnProperty('sendmail')) {
if (status === shared_consts.OrderStatus.ORDER_CONFIRMED) {
ordertype = 'order_confirmed';
} else if (status === shared_consts.OrderStatus.DELIVERED) {
ordertype = 'order_consegnato';
} else if (status === shared_consts.OrderStatus.CANCELED) {
ordertype = 'order_canceled';
}
if (status === shared_consts.OrderStatus.ORDER_CONFIRMED) {
ordertype = 'order_confirmed';
} else if (status === shared_consts.OrderStatus.DELIVERED) {
ordertype = 'order_consegnato';
} else if (status === shared_consts.OrderStatus.CANCELED) {
ordertype = 'order_canceled';
}
if (ordertype !== '') {
sendemail.sendEmail_Order(userDest.lang, idapp, myOrdersCart, userDest, ordertype, status)
.then((ris) => {
if (ordertype !== '') {
sendemail.sendEmail_Order(userDest.lang, idapp, myOrdersCart, userDest, ordertype, status)
.then((ris) => {
})
})
}
}
}