aggio gasordine
This commit is contained in:
@@ -1330,6 +1330,16 @@ async function eseguiDbOp(idapp, mydata, locale, req, res) {
|
||||
} catch (e) {
|
||||
console.error('Err:', e);
|
||||
}
|
||||
} else if (mydata.dbop === 'SistemaGasOrdine') {
|
||||
const arrrec = await Product.find({}).lean();
|
||||
for (const rec of arrrec) {
|
||||
if (tools.isArray(rec.idGasordines) && rec.idGasordines.length > 0) {
|
||||
await Product.findByIdAndUpdate(rec._id, { $set: { idGasordine: rec.idGasordines[0] } })
|
||||
} else {
|
||||
await Product.findByIdAndUpdate(rec._id, { $set: { idGasordine: null } })
|
||||
}
|
||||
}
|
||||
|
||||
} else if (mydata.dbop === 'CopyPriceToCalc') {
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user