feat: allow for cashbox batch editing
This commit is contained in:
parent
21708aa75c
commit
d6d8280a36
5 changed files with 119 additions and 18 deletions
|
|
@ -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 }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue