diff --git a/lib/machine-loader.js b/lib/machine-loader.js index 0fafb9ac..c60559c3 100644 --- a/lib/machine-loader.js +++ b/lib/machine-loader.js @@ -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