Merge pull request #1585 from lamassu/feat/aveiro-stuff

fix: cashbox count returning null
This commit is contained in:
Rafael Taranto 2023-08-28 10:25:13 +01:00 committed by GitHub
commit a2b074bd66

View file

@ -19,7 +19,7 @@ const unresponsiveStatus = { label: 'Unresponsive', type: 'error' }
const stuckStatus = { label: 'Stuck', type: 'error' }
const MACHINE_WITH_CALCULATED_FIELD_SQL = `
select d.*, emptybills + regularbills as cashbox from devices d
select d.*, COALESCE(emptybills, 0) + COALESCE(regularbills, 0) as cashbox from devices d
left join (
select count(*) as emptyBills, eub.device_id
from empty_unit_bills eub