Merge pull request #1909 from siiky/fix/lam-1489/include-re-paired-machine-bills

LAM-1489 fix: includes bills from re-paired machines
This commit is contained in:
Rafael Taranto 2025-07-10 13:49:57 +01:00 committed by GitHub
commit 7ed9b88ccd

View file

@ -31,7 +31,7 @@ const getBills = filters => {
FROM cash_in_txs
WHERE ${AND(
deviceIDCondition,
'device_id NOT IN (SELECT device_id FROM unpaired_devices)',
'device_id IN (SELECT device_id FROM devices WHERE paired)',
)}
) AS cit
ON cit.id = b.cash_in_txs_id
@ -46,7 +46,7 @@ const getBills = filters => {
WHERE ${AND(
deviceIDCondition,
batchIDCondition,
'b.device_id NOT IN (SELECT device_id FROM unpaired_devices)',
'b.device_id IN (SELECT device_id FROM devices WHERE paired)',
)}`
return Promise.all([db.any(cashboxBills), db.any(recyclerBills)]).then(