Skip to content

Commit

Permalink
fix(waterbalance): allow also hydrometers which is_waterbal is null. …
Browse files Browse the repository at this point in the history
…Only false values will be excluded
  • Loading branch information
albertbofill committed Aug 22, 2024
1 parent cebfab5 commit c81179c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ws/fct/ws_gw_fct_waterbalance.sql
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ BEGIN
JOIN rtc_hydrometer_x_connec USING (hydrometer_id)
JOIN connec c USING (connec_id)
JOIN ext_rtc_hydrometer h ON h.id::text = d.hydrometer_id::text
where is_waterbal IS TRUE
WHERE is_waterbal IS TRUE OR is_waterbal IS NULL
GROUP BY dma_id, cat_period_id)a
WHERE n.dma_id = a.dma_id AND n.cat_period_id = a.cat_period_id;

Expand All @@ -189,7 +189,7 @@ BEGIN
JOIN rtc_hydrometer_x_connec USING (hydrometer_id)
JOIN connec c USING (connec_id)
JOIN ext_rtc_hydrometer h ON h.id::text = d.hydrometer_id::text
where is_waterbal IS true and cat_period_id = v_period;
WHERE (is_waterbal IS TRUE OR is_waterbal IS NULL) AND cat_period_id = v_period;

UPDATE om_waterbalance SET auth_bill_met_hydro = 0 WHERE auth_bill_met_hydro is null AND cat_period_id = v_period;

Expand Down

0 comments on commit c81179c

Please sign in to comment.