Compare commits
2 Commits
df09bc67b2
...
9d7992b324
| Author | SHA1 | Date | |
|---|---|---|---|
| 9d7992b324 | |||
| cfc1c07b91 |
|
|
@ -790,6 +790,80 @@ protected function refreshUnitaOptions(): void
|
|||
}
|
||||
}
|
||||
|
||||
if (DbSchema::hasTable('persone_unita_relazioni') && DbSchema::hasTable('persone')) {
|
||||
try {
|
||||
$today = now()->toDateString();
|
||||
$rows = DB::table('persone_unita_relazioni as pur')
|
||||
->join('persone as p', 'pur.persona_id', '=', 'p.id')
|
||||
->whereIn('pur.unita_id', $unita->pluck('id'))
|
||||
->where(function ($query) use ($today): void {
|
||||
$query->whereNull('pur.data_inizio')->orWhere('pur.data_inizio', '<=', $today);
|
||||
})
|
||||
->where(function ($query) use ($today): void {
|
||||
$query->whereNull('pur.data_fine')->orWhere('pur.data_fine', '>=', $today);
|
||||
})
|
||||
->where('pur.attivo', 1)
|
||||
->orderByRaw("CASE WHEN pur.tipo_relazione = 'proprietario' THEN 0 ELSE 1 END")
|
||||
->orderByDesc('pur.data_inizio')
|
||||
->select('pur.unita_id', 'p.cognome', 'p.nome', 'p.ragione_sociale')
|
||||
->get();
|
||||
|
||||
foreach ($rows as $row) {
|
||||
$unitId = (int) ($row->unita_id ?? 0);
|
||||
if ($unitId <= 0 || isset($currentNominativoByUnita[$unitId])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$name = trim((string) ($row->ragione_sociale ?? ''));
|
||||
if ($name === '') {
|
||||
$name = trim((string) ($row->cognome ?? '') . ' ' . (string) ($row->nome ?? ''));
|
||||
}
|
||||
if ($name !== '') {
|
||||
$currentNominativoByUnita[$unitId] = $name;
|
||||
}
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
// Ignore fallback error
|
||||
}
|
||||
}
|
||||
|
||||
if (DbSchema::hasTable('rubrica_ruoli') && DbSchema::hasTable('rubrica_universale')) {
|
||||
try {
|
||||
$today = now()->toDateString();
|
||||
$rows = DB::table('rubrica_ruoli as rr')
|
||||
->join('rubrica_universale as ru', 'rr.rubrica_id', '=', 'ru.id')
|
||||
->whereIn('rr.unita_id', $unita->pluck('id'))
|
||||
->where(function ($query) use ($today): void {
|
||||
$query->whereNull('rr.data_inizio')->orWhere('rr.data_inizio', '<=', $today);
|
||||
})
|
||||
->where(function ($query) use ($today): void {
|
||||
$query->whereNull('rr.data_fine')->orWhere('rr.data_fine', '>=', $today);
|
||||
})
|
||||
->where('rr.attivo', 1)
|
||||
->orderByRaw("CASE WHEN rr.ruolo = 'proprietario' THEN 0 ELSE 1 END")
|
||||
->orderByDesc('rr.data_inizio')
|
||||
->select('rr.unita_id', 'ru.cognome', 'ru.nome', 'ru.ragione_sociale')
|
||||
->get();
|
||||
|
||||
foreach ($rows as $row) {
|
||||
$unitId = (int) ($row->unita_id ?? 0);
|
||||
if ($unitId <= 0 || isset($currentNominativoByUnita[$unitId])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$name = trim((string) ($row->ragione_sociale ?? ''));
|
||||
if ($name === '') {
|
||||
$name = trim((string) ($row->cognome ?? '') . ' ' . (string) ($row->nome ?? ''));
|
||||
}
|
||||
if ($name !== '') {
|
||||
$currentNominativoByUnita[$unitId] = $name;
|
||||
}
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
// Ignore fallback error
|
||||
}
|
||||
}
|
||||
|
||||
$sorted = $unita->sort(function (UnitaImmobiliare $a, UnitaImmobiliare $b): int {
|
||||
$pa = (int) ($a->palazzina_id ?? 0);
|
||||
$pb = (int) ($b->palazzina_id ?? 0);
|
||||
|
|
@ -834,6 +908,20 @@ protected function refreshUnitaOptions(): void
|
|||
$codice = substr($codice, strlen($stabileCode . '-'));
|
||||
}
|
||||
|
||||
$details = [];
|
||||
if ($u->scala) {
|
||||
$details[] = 'Scala ' . $u->scala;
|
||||
}
|
||||
if ($u->interno) {
|
||||
$details[] = 'Int. ' . $u->interno;
|
||||
}
|
||||
if ($u->tipo_unita) {
|
||||
$details[] = '(' . ucfirst(strtolower($u->tipo_unita)) . ')';
|
||||
}
|
||||
|
||||
$detStr = implode(' - ', array_filter($details));
|
||||
$label = $detStr !== '' ? ($detStr . ' [' . $codice . ']') : trim($codice);
|
||||
|
||||
$owner = $currentNominativoByUnita[(int) $u->id] ?? ($this->ownerByUnitaLocal[(int) $u->id] ?? null);
|
||||
if ($this->unita && (int) $u->id === (int) $this->unita->id) {
|
||||
$legacyOwner = $this->getLegacyCondominoRiferimentoNome();
|
||||
|
|
@ -841,7 +929,6 @@ protected function refreshUnitaOptions(): void
|
|||
$owner = $legacyOwner;
|
||||
}
|
||||
}
|
||||
$label = trim($codice);
|
||||
if (is_string($owner) && trim($owner) !== '') {
|
||||
$label .= ' — ' . trim($owner);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ # CURRENT-205
|
|||
|
||||
## Obiettivo
|
||||
|
||||
Hotfix: Anagrafica Unica canonica, storico audit e CRUD protetto.
|
||||
Hotfix: Anagrafica Unica canonica, storico audit, CRUD protetto e ricerca per nominativo in Unità Immobiliare.
|
||||
|
||||
## Output del Giro Operativo
|
||||
|
||||
|
|
@ -14,23 +14,22 @@ ## Output del Giro Operativo
|
|||
TASK_ID: task-d095b0e23b
|
||||
REPOSITORY: ssh://git@git.netgescon.it:2222/michele/netgescon-day0.git
|
||||
BRANCH: stabilization/205-zero
|
||||
COMMIT: ae8f54dc364e930c5e13bfd73f3a4b1d2737aaf0
|
||||
COMMIT: cfc1c0709e20eb5a6d59ce6beeaefcfbcaad9020
|
||||
FILE_O_AREE_TOCCATE:
|
||||
- app/Livewire/Gescon/RubricaUniversaleTable.php
|
||||
- app/Models/RubricaUniversale.php
|
||||
- app/Models/Persona.php
|
||||
- app/Filament/Pages/UnitaImmobiliarePage.php
|
||||
- tests/Feature/AnagraficaUnicaCanonicaTest.php
|
||||
- app/Models/Amministratore.php
|
||||
- app/Console/Commands/MapGesconStabiliCommand.php
|
||||
- app/Providers/Filament/AdminFilamentPanelProvider.php
|
||||
- database/migrations/2025_11_16_120200_add_cassa_type_to_dati_bancari.php
|
||||
- tests/Feature/UnitaImmobiliarePageTest.php
|
||||
- tests/Feature/UnitaGestioneTemporaleTest.php
|
||||
TEST_ESEGUITI:
|
||||
- ./vendor/bin/pest tests/Feature/AnagraficaUnicaCanonicaTest.php (3 passed, 10 assertions)
|
||||
- ./vendor/bin/pest tests/Feature/AnagraficaUnicaCanonicaTest.php tests/Feature/BenedettoBonificaIdempotenteTest.php tests/Feature/UnitaGestioneTemporaleTest.php tests/Feature/AnagraficaFornitoriSyncTest.php tests/Feature/UnitaImmobiliarePageTest.php tests/Feature/ReconstructMirror0021Test.php tests/Feature/ImportCondominMirror0021Test.php tests/Feature/ControlTowerPollCommandTest.php (17 passed, 129 assertions)
|
||||
- ./vendor/bin/pest tests/Feature/UnitaImmobiliarePageTest.php tests/Feature/UnitaGestioneTemporaleTest.php tests/Feature/AnagraficaUnicaCanonicaTest.php tests/Feature/BenedettoBonificaIdempotenteTest.php tests/Feature/ControlTowerPollCommandTest.php (14 passed, 77 assertions)
|
||||
- ./scripts/ops/antigravity-cli/test_runner_and_parser.sh (6/6 passed)
|
||||
GATE_STATISTICS:
|
||||
- DANIELA_BENEDETTO_CANONICAL_RUBRICA: 697 (000000JC / BNDDNL86M58H224O)
|
||||
- DANIELA_BENEDETTO_ARCHIVED_DUPLICATES: 4 (000000I2, 000000I3, 000000R0, 000000R1)
|
||||
- SEARCH_BY_NOMINATIVO_UNITA_PICKER: enabled
|
||||
- ATER_BENEDETTO_SUBENTRO_DATE: 08/06/2026 (Gestione 0004 / 2026)
|
||||
- VISTA_STATO_FILTER_WORKING: true
|
||||
- PHYSICAL_DELETE_GUARDED: true
|
||||
BLOCCO_DATI: no
|
||||
|
|
@ -39,7 +38,6 @@ ## Output del Giro Operativo
|
|||
|
||||
## Prossimo Passo per .200 (Validazione)
|
||||
|
||||
- Eseguire il checkout del branch `stabilization/205-zero` al commit `ae8f54dc364e930c5e13bfd73f3a4b1d2737aaf0`.
|
||||
- Verificare in Anagrafica Unica la vista predefinita "Contatti attivi (Canonica)" (1 riga per Daniela Benedetto).
|
||||
- Verificare il filtro "Storico & bonifiche audit" che mostra le schede duplicate soft-archiviate.
|
||||
- Verificare che il blocco cancellazione impedisca la rimozione fisica se esistono relazioni attive o storiche.
|
||||
- Eseguire il checkout del branch `stabilization/205-zero` al commit `cfc1c0709e20eb5a6d59ce6beeaefcfbcaad9020`.
|
||||
- Verificare nella tendina Unità della pagina `/admin-filament/unita-immobiliare` la ricerca diretta per nominativo ("Benedetto", "ATER", "Tordini").
|
||||
- Verificare la corretta indicazione delle date di subentro per la Scala A Int. 11 (08/06/2026).
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user