- aggiunto note 'note_ordine_gas'
- corretto bug
This commit is contained in:
@@ -30,6 +30,9 @@ const CartSchema = new Schema({
|
||||
note: {
|
||||
type: String,
|
||||
},
|
||||
note_ordine_gas: {
|
||||
type: String,
|
||||
},
|
||||
modify_at: {
|
||||
type: Date,
|
||||
},
|
||||
@@ -121,6 +124,7 @@ module.exports.updateCartByCartId = async function (cartId, newCart) {
|
||||
const totalPrice = newCart.totalPrice;
|
||||
const totalPriceCalc = newCart.totalPriceCalc;
|
||||
const note = newCart.note;
|
||||
const note_ordine_gas = newCart.note_ordine_gas;
|
||||
|
||||
const modify_at = new Date();
|
||||
|
||||
@@ -131,6 +135,7 @@ module.exports.updateCartByCartId = async function (cartId, newCart) {
|
||||
totalPriceCalc,
|
||||
totalQty,
|
||||
note,
|
||||
note_ordine_gas,
|
||||
modify_at: new Date(),
|
||||
},
|
||||
}, { new: false }).lean().then((ris) => {
|
||||
|
||||
@@ -34,6 +34,9 @@ const gasordineSchema = new Schema({
|
||||
img: {
|
||||
type: String,
|
||||
},
|
||||
note_ordine_gas: {
|
||||
type: String,
|
||||
},
|
||||
|
||||
dataora_chiusura_ordini: {
|
||||
type: Date,
|
||||
|
||||
@@ -94,6 +94,9 @@ const OrdersCartSchema = new Schema({
|
||||
note_per_gestore: {
|
||||
type: String
|
||||
},
|
||||
note_ordine_gas: {
|
||||
type: String
|
||||
},
|
||||
note_per_admin: {
|
||||
type: String
|
||||
},
|
||||
@@ -1079,7 +1082,8 @@ module.exports.updateOrdersCartTotals = async function (idOrdersCart, update) {
|
||||
|
||||
let newOrdersCart = CartClass.constructByCart(orderscart);
|
||||
|
||||
await newOrdersCart.updatecarttotals(false);
|
||||
newOrdersCart.updatecarttotals(false);
|
||||
await newOrdersCart.updateExtraOrder();
|
||||
|
||||
if (update) {
|
||||
await OrdersCart.findOneAndUpdate({ _id: idOrdersCart }, {
|
||||
|
||||
Reference in New Issue
Block a user