fix: remove console log and rename function
This commit is contained in:
parent
20703d0271
commit
b5c2114cbf
1 changed files with 2 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
const db = require('./db')
|
const db = require('./db')
|
||||||
|
|
||||||
function createCashBoxBatch (rec) {
|
function createCashboxBatch (rec) {
|
||||||
const sql = 'INSERT INTO cashbox_batches (device_id, created) VALUES ($1, now()) RETURNING *'
|
const sql = 'INSERT INTO cashbox_batches (device_id, created) VALUES ($1, now()) RETURNING *'
|
||||||
const sql2 = `
|
const sql2 = `
|
||||||
UPDATE bills SET cashbox_batch_id=$1
|
UPDATE bills SET cashbox_batch_id=$1
|
||||||
|
|
@ -11,9 +11,8 @@ function createCashBoxBatch (rec) {
|
||||||
`
|
`
|
||||||
return db.oneOrNone(sql, [rec.deviceId])
|
return db.oneOrNone(sql, [rec.deviceId])
|
||||||
.then(res => {
|
.then(res => {
|
||||||
console.log(res)
|
|
||||||
return db.oneOrNone(sql2, [res.id, res.device_id])
|
return db.oneOrNone(sql2, [res.id, res.device_id])
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = { createCashBoxBatch }
|
module.exports = { createCashboxBatch }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue