fix: cashbox count returning null

This commit is contained in:
Rafael Taranto 2023-08-28 10:24:13 +01:00
parent 43118f712d
commit 2e15d576cb

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