From bcb283e0e05232d4651c5828d45ea0545496dc9c Mon Sep 17 00:00:00 2001 From: michele Date: Sun, 30 Aug 2026 20:42:52 +0200 Subject: [PATCH] fix(catasto-hub): remove automatic fallbacks and prevent overwriting physical scala/interno (task-d095b0e23b) --- app/Filament/Pages/Condomini/CatastoHub.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/app/Filament/Pages/Condomini/CatastoHub.php b/app/Filament/Pages/Condomini/CatastoHub.php index 3078489..34b3037 100644 --- a/app/Filament/Pages/Condomini/CatastoHub.php +++ b/app/Filament/Pages/Condomini/CatastoHub.php @@ -461,14 +461,14 @@ public function loadUnitaList(): void } if (empty($uFoglio) || $uFoglio === '-' || $uFoglio === '0') { - $uFoglio = $this->stabileAttivo?->foglio ?? $this->stabileAttivo?->foglio_catasto ?? '403'; + $uFoglio = $this->stabileAttivo?->foglio ?? $this->stabileAttivo?->foglio_catasto ?? ''; } if (empty($uParticella) || $uParticella === '-' || $uParticella === '0') { if ($this->stabileAttivo && ($this->stabileAttivo->id == 4 || $this->stabileAttivo->codice_stabile === '0021')) { $scalaUpper = strtoupper(trim($u->scala ?: '')); $uParticella = ($scalaUpper === 'D') ? '253' : '256'; } else { - $uParticella = $this->stabileAttivo?->particella_catasto ?? $this->stabileAttivo?->mappale ?? '60'; + $uParticella = $this->stabileAttivo?->particella_catasto ?? $this->stabileAttivo?->mappale ?? ''; } } @@ -641,7 +641,7 @@ public function selectUnita(int $unitaId): void } if (empty($uFoglio) || $uFoglio === '-' || $uFoglio === '0') { - $uFoglio = $this->stabileAttivo?->foglio ?? $this->stabileAttivo?->foglio_catasto ?? '403'; + $uFoglio = $this->stabileAttivo?->foglio ?? $this->stabileAttivo?->foglio_catasto ?? ''; } if ($this->stabileAttivo && ($this->stabileAttivo->id == 4 || $this->stabileAttivo->codice_stabile === '0021')) { $scalaUpper = strtoupper(trim($u->scala ?: '')); @@ -653,7 +653,7 @@ public function selectUnita(int $unitaId): void } } else { if (empty($uParticella) || $uParticella === '-' || $uParticella === '0') { - $uParticella = $this->stabileAttivo?->particella_catasto ?? $this->stabileAttivo?->mappale ?? '60'; + $uParticella = $this->stabileAttivo?->particella_catasto ?? $this->stabileAttivo?->mappale ?? ''; } } @@ -1605,12 +1605,6 @@ public function applicaECorreggi(): void $updatePayload['catasto_piano_fisico'] = $scomp['catasto_piano_fisico']; } - if (Schema::hasColumn('unita_immobiliari', 'scala') && !empty($scomp['catasto_scala'])) { - $updatePayload['scala'] = $scomp['catasto_scala']; - } - if (Schema::hasColumn('unita_immobiliari', 'interno') && !empty($scomp['catasto_interno'])) { - $updatePayload['interno'] = $scomp['catasto_interno']; - } if (Schema::hasColumn('unita_immobiliari', 'indirizzo') && !empty($scomp['catasto_via'])) { $updatePayload['indirizzo'] = $scomp['catasto_via']; }