Skip to content

Commit

Permalink
Merge pull request #424 from geosolutions-it/fix_populate_ubic_f_alla…
Browse files Browse the repository at this point in the history
…ccio_nearest

Fix populate ubic f allaccio nearest
  • Loading branch information
mattiagiupponi authored Jun 17, 2024
2 parents 2bc196a + 3730f72 commit 4278f93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from app.utils import TemplateWithDefaults
from django_auth_ldap.config import LDAPSearch, GroupOfNamesType

APP_VERSION = '1.42.1 (23/04/2024)'
APP_VERSION = '1.42.2 (17/06/2024)'

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
Expand Down
6 changes: 3 additions & 3 deletions database/functions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4181,8 +4181,8 @@ BEGIN
select ufa.id_ubic_contatore
from ubic_f_allaccio ufa
join utenza_sap us on ufa.id_ubic_contatore = us.id_ubic_contatore
where fgn_idrete is null and esente_fog = 0
and c.idgis = ufa.id_ubic_contatore
where ((fgn_idrete is null and esente_fog = 0) OR (fgn_idrete is null and esente_fog = 1 and vol_fgn_fatt >0))
and c.idgis = ufa.id_ubic_contatore
)
and r.d_gestore ='PUBLIACQUA' and r.d_ambito in ('AT3', null) AND r.d_stato not in ('IPR', 'IAC', 'NAC')
and r.geom && ST_buffer(c.geom, v_buff)
Expand Down Expand Up @@ -4393,7 +4393,7 @@ begin
SUM(CASE WHEN ut.esente_fog = 0 AND ut.gruppo = 'A' AND (ut.esclusione_m2_m3a is false OR (ut.esclusione_m2_m3a is true and ut.cattariffa in ('APB_REFIND', 'APBLREFIND', 'APBNREFCIV'))) THEN 1 ELSE 0 END) nr_utenze_totali,
SUM(CASE WHEN ut.cattariffa IN ('APB_REFIND', 'APBLREFIND') AND ut.gruppo = 'A' THEN 1 ELSE 0 END) utenze_industriali,
SUM(CASE WHEN ut.cattariffa IN ('APB_REFIND', 'APBLREFIND') THEN vol_fgn_fatt ELSE 0 END) volume_utenze_industriali,
SUM(CASE WHEN ut.esente_fog = 0 THEN vol_fgn_fatt ELSE 0 END) volume_utenze_totali
SUM(vol_fgn_fatt) volume_utenze_totali
FROM
utenze ut
GROUP BY
Expand Down

0 comments on commit 4278f93

Please sign in to comment.