From 2e9bb3c7df29d4232dc027239b1b59b7ee334ea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Salgado?= Date: Tue, 2 May 2023 16:14:12 +0100 Subject: [PATCH] fix: cashbox batches fix: pairing missing stacker parameter --- lib/cashbox-batches.js | 2 +- lib/pairing.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cashbox-batches.js b/lib/cashbox-batches.js index 17b8ad55..bcdf5e71 100644 --- a/lib/cashbox-batches.js +++ b/lib/cashbox-batches.js @@ -36,7 +36,7 @@ function updateMachineWithBatch (machineContext, oldCashboxCount) { WHERE bills.cash_in_txs_id = cash_in_txs.id AND cash_in_txs.device_id = $2 AND bills.cashbox_batch_id IS NULL`, [batchId, deviceId]) - const q3 = t.none(`UPDATE devices SET cashbox=$1, cassette1=$2, cassette2=$3, cassette3=$4, cassette4=$5, stacker1f=$6, stacker1r=$7, stacker1f=$8, stacker1r=$9, stacker1f=$10, stacker1r=$11 WHERE device_id=$12`, [ + const q3 = t.none(`UPDATE devices SET cashbox=$1, cassette1=$2, cassette2=$3, cassette3=$4, cassette4=$5, stacker1f=$6, stacker1r=$7, stacker2f=$8, stacker2r=$9, stacker3f=$10, stacker3r=$11 WHERE device_id=$12`, [ cashUnits.cashbox, cashUnits.cassette1, cashUnits.cassette2, diff --git a/lib/pairing.js b/lib/pairing.js index bc613db9..48e069b4 100644 --- a/lib/pairing.js +++ b/lib/pairing.js @@ -42,7 +42,7 @@ function pair (token, deviceId, machineModel, numOfCassettes = DEFAULT_NUMBER_OF .then(r => { if (r.expired) return false - const insertSql = `insert into devices (device_id, name, number_of_cassettes, number_of_stackers) values ($1, $2, $3) + const insertSql = `insert into devices (device_id, name, number_of_cassettes, number_of_stackers) values ($1, $2, $3, $4) on conflict (device_id) do update set paired=TRUE, display=TRUE`