feat: allow for cashbox batch editing

This commit is contained in:
Sérgio Salgado 2021-04-12 19:28:57 +01:00 committed by Josh Harvey
parent 21708aa75c
commit d6d8280a36
5 changed files with 119 additions and 18 deletions

View file

@ -30,9 +30,14 @@ function getBatches () {
}), res))
}
function editBatchById (id, performedBy) {
const sql = `UPDATE cashbox_batches SET performed_by=$1 WHERE id=$2`
return db.none(sql, [performedBy, id])
}
function getBillsByBatchId (id) {
const sql = `SELECT * FROM bills WHERE cashbox_batch_id=$1`
return db.any(sql, [id])
}
module.exports = { createCashboxBatch, getBatches, getBillsByBatchId }
module.exports = { createCashboxBatch, getBatches, getBillsByBatchId, editBatchById }