fix: count updates and small ui adjustments

This commit is contained in:
Rafael Taranto 2024-02-13 21:44:49 +00:00
parent eaa2b69f18
commit 24d0973f12
3 changed files with 95 additions and 66 deletions

View file

@ -182,7 +182,7 @@ function setCassetteBills (rec) {
return getMachine(rec.deviceId)
.then(machine => {
const oldCashboxCount = machine?.cashUnits?.cashbox
if (_.isNil(oldCashboxCount) || cashbox === oldCashboxCount) {
if (_.isNil(oldCashboxCount) || cashbox.toString() === oldCashboxCount.toString()) {
const sql = 'UPDATE devices SET cassette1=$1, cassette2=$2, cassette3=$3, cassette4=$4, recycler1=$5, recycler2=$6, recycler3=$7, recycler4=$8, recycler5=$9, recycler6=$10 WHERE device_id=$11'
return db.none(sql, [cassette1, cassette2, cassette3, cassette4, recycler1, recycler2, recycler3, recycler4, recycler5, recycler6, rec.deviceId])
}