This commit is contained in:
Surya Paolo
2024-01-02 15:39:29 +01:00
parent 4e0c18f47c
commit 75ef581635
2 changed files with 9 additions and 9 deletions

View File

@@ -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);