From dca61dd046e9fde4bb3196e64a30b11f4c2b3419 Mon Sep 17 00:00:00 2001 From: Mattia Date: Tue, 11 Jun 2024 10:23:33 +0200 Subject: [PATCH 1/2] Update populate_ubic_f_allaccio_nearest --- database/functions.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/database/functions.sql b/database/functions.sql index 0378ded..c87b042 100644 --- a/database/functions.sql +++ b/database/functions.sql @@ -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) @@ -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 From 3730f72b6ecc320b14729ee0febc6ea2da392000 Mon Sep 17 00:00:00 2001 From: Mattia Date: Mon, 17 Jun 2024 15:08:38 +0200 Subject: [PATCH 2/2] Update version --- app/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/settings.py b/app/settings.py index b31bde6..11babad 100644 --- a/app/settings.py +++ b/app/settings.py @@ -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__)))