fix: automatic cashbox batch creation

This commit is contained in:
Sérgio Salgado 2021-04-28 17:11:27 +01:00 committed by Josh Harvey
parent 61cc772816
commit cba519fb4d
2 changed files with 4 additions and 5 deletions

View file

@ -3,7 +3,7 @@ const _ = require('lodash/fp')
const uuid = require('uuid')
function createCashboxBatch (deviceId, cashboxCount) {
if (_.isEqual(0, cashboxCount)) throw new Error('Cashbox is empty. Cashbox batch could not be created')
if (_.isEqual(0, cashboxCount)) throw new Error('Cashbox is empty. Cashbox batch could not be created.')
const sql = `INSERT INTO cashbox_batches (id, device_id, created, operation_type) VALUES ($1, $2, now(), 'cash-in-empty') RETURNING *`
const sql2 = `
UPDATE bills SET cashbox_batch_id=$1