feat: cashbox batch creation on machine cashbox removal
fix: cashbox batch creation with empty cashbox
This commit is contained in:
parent
482e1afc3a
commit
61cc772816
5 changed files with 15 additions and 13 deletions
|
|
@ -2,8 +2,8 @@ const db = require('./db')
|
|||
const _ = require('lodash/fp')
|
||||
const uuid = require('uuid')
|
||||
|
||||
function createCashboxBatch (deviceId) {
|
||||
console.log('herererere')
|
||||
function createCashboxBatch (deviceId, cashboxCount) {
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue