update
This commit is contained in:
@@ -471,13 +471,13 @@ module.exports.createOrdersCart = async function (newOrdersCart) {
|
||||
}
|
||||
|
||||
|
||||
module.exports.addOrderToCash = async function (idorderscart, userIdStore, req) {
|
||||
module.exports.addOrderToCash = async function (idorderscart, usernameStore, req) {
|
||||
|
||||
try {
|
||||
|
||||
const myorderscart = await OrdersCart.findOne({ _id: idorderscart }).populate('items.order').lean();
|
||||
|
||||
const mycash = await Cash.createMovementCashByOrdersCart(myorderscart, userIdStore, req);
|
||||
const mycash = await Cash.createMovementCashByOrdersCart(myorderscart, usernameStore, req);
|
||||
|
||||
} catch (e) {
|
||||
console.error('Err', e);
|
||||
@@ -649,7 +649,7 @@ module.exports.updateStockQtaPerCancellazioneOrdine = async function (idordersca
|
||||
|
||||
module.exports.updateCmd = async function (ordersCart, status, value, req, options) {
|
||||
|
||||
const userIdStore = options.userIdStore ?? null;
|
||||
const usernameStore = options.usernameStore ?? null;
|
||||
|
||||
let myOrderCart = await OrdersCart.findOne({ _id: ordersCart._id })
|
||||
.populate('items.order').lean();
|
||||
@@ -675,7 +675,7 @@ module.exports.updateCmd = async function (ordersCart, status, value, req, optio
|
||||
} else if (status === shared_consts.OrderStatus.PAYED) {
|
||||
|
||||
if (value) {
|
||||
await OrdersCart.addOrderToCash(id, userIdStore, req);
|
||||
await OrdersCart.addOrderToCash(id, usernameStore, req);
|
||||
}
|
||||
|
||||
ris = await OrdersCart.setPagatoById(value, myOrderCart);
|
||||
|
||||
Reference in New Issue
Block a user