fix: cashbox batch creation with the new settings
fix: correctly update cassette and stacker count post-cashout tx
This commit is contained in:
parent
460a8cf1fd
commit
4338b3d98e
6 changed files with 15 additions and 18 deletions
|
|
@ -11,7 +11,8 @@ function createCashboxBatch (deviceId, cashboxCount) {
|
|||
UPDATE bills SET cashbox_batch_id=$1
|
||||
FROM cash_in_txs
|
||||
WHERE bills.cash_in_txs_id = cash_in_txs.id AND
|
||||
cash_in_txs.device_id = $2 AND
|
||||
cash_in_txs.device_id = $2 AND
|
||||
bills.destination_unit = 'cashbox' AND
|
||||
bills.cashbox_batch_id IS NULL
|
||||
`
|
||||
const sql3 = `
|
||||
|
|
@ -42,7 +43,8 @@ function updateMachineWithBatch (machineContext, oldCashboxCount) {
|
|||
const q1 = t.none(`INSERT INTO cash_unit_operation (id, device_id, created, operation_type) VALUES ($1, $2, now(), 'cash-box-empty')`, [batchId, deviceId])
|
||||
const q2 = t.none(`UPDATE bills SET cashbox_batch_id=$1 FROM cash_in_txs
|
||||
WHERE bills.cash_in_txs_id = cash_in_txs.id AND
|
||||
cash_in_txs.device_id = $2 AND
|
||||
cash_in_txs.device_id = $2 AND
|
||||
bills.destination_unit = 'cashbox' AND
|
||||
bills.cashbox_batch_id IS NULL`, [batchId, deviceId])
|
||||
const q3 = t.none(`UPDATE empty_unit_bills SET cashbox_batch_id=$1
|
||||
WHERE empty_unit_bills.device_id = $2 AND empty_unit_bills.cashbox_batch_id IS NULL`, [batchId, deviceId])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue