possibilità di modificare un ordine, e anche i totali
This commit is contained in:
@@ -1330,6 +1330,22 @@ async function eseguiDbOp(idapp, mydata, locale, req, res) {
|
||||
} catch (e) {
|
||||
console.error('Err:', e);
|
||||
}
|
||||
} else if (mydata.dbop === 'CopyPriceToCalc') {
|
||||
|
||||
try {
|
||||
const arrrec = await OrdersCart.find({}).lean();
|
||||
for (const rec of arrrec) {
|
||||
await OrdersCart.findByIdAndUpdate(rec._id, { $set: { totalPriceCalc: rec.totalPrice } })
|
||||
}
|
||||
|
||||
const arrrec2 = await Order.find({}).lean();
|
||||
for (const rec of arrrec2) {
|
||||
await Order.findByIdAndUpdate(rec._id, { $set: { TotalPriceProductCalc: rec.TotalPriceProduct } })
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
console.error('Err:', e);
|
||||
}
|
||||
|
||||
} else if (mydata.dbop === 'dropAllCarts') {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user