diff --git a/lib/routes/cashboxRoutes.js b/lib/routes/cashboxRoutes.js index c39085d7..709dc121 100644 --- a/lib/routes/cashboxRoutes.js +++ b/lib/routes/cashboxRoutes.js @@ -10,13 +10,12 @@ function notifyCashboxRemoval (req, res, next) { return getMachine(req.deviceId) .then(machine => { loadLatestConfig() - .then(async config => { + .then(config => { const cashInSettings = getCashInSettings(config) - console.log(cashInSettings) if (cashInSettings.cashboxReset === 'Automatic') { - await cashbox.createCashboxBatch(req.deviceId, machine.cashbox) - await setMachine({ deviceId: req.deviceId, action: 'emptyCashInBills' }) - return res.status(200).send({ status: 'OK' }) + return cashbox.createCashboxBatch(req.deviceId, machine.cashbox) + .then(() => setMachine({ deviceId: req.deviceId, action: 'emptyCashInBills' })) + .then(() => res.status(200).send({ status: 'OK' })) } }) })