Gestione Ordini: evaso...
This commit is contained in:
@@ -42,6 +42,41 @@ const orderSchema = new Schema({
|
||||
quantity: {
|
||||
type: Number
|
||||
},
|
||||
evaso: { // e quindi è stato tolto dal magazzino (aggiornando il campo StockQty)
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
date_evaso: {
|
||||
type: Date
|
||||
},
|
||||
pagato: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
date_pagato: {
|
||||
type: Date
|
||||
},
|
||||
spedito: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
date_spedito: {
|
||||
type: Date
|
||||
},
|
||||
completed: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
date_completed: {
|
||||
type: Date
|
||||
},
|
||||
consegnato: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
date_consegnato: {
|
||||
type: Date
|
||||
},
|
||||
weight: {
|
||||
type: Number
|
||||
},
|
||||
@@ -148,6 +183,14 @@ module.exports.updateStatusOrders = async function (arrOrders, status) {
|
||||
|
||||
}
|
||||
|
||||
module.exports.updateStatusOrdersElements = async function (arrOrders, myelements) {
|
||||
|
||||
for (const order of arrOrders) {
|
||||
const ret = await this.findOneAndUpdate({ _id: order._id }, { $set: myelements });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports.getTotalOrderById = async function (id) {
|
||||
const query = [
|
||||
{ $match: { _id: ObjectID(id) } },
|
||||
|
||||
Reference in New Issue
Block a user