Fix per php8.1

This commit is contained in:
Pek5892 2024-04-17 10:39:25 +02:00
parent 9b1e2e82e0
commit 6b7fa73bc3
1 changed files with 1 additions and 3 deletions

View File

@ -81,9 +81,7 @@ if (!empty($id_record)) {
$fattura_acquisto_originale = null;
if (!empty($fattura)) {
$reverse_charge = $fattura->getRighe()->first(function ($item, $key) {
return $item->aliquota != null && $item->aliquota->codice_natura_fe !== null && substr($item->aliquota->codice_natura_fe, 0, 2) == 'N6';
})->id;
$reverse_charge = $fattura->getRighe()->first(fn($item, $key) => $item->aliquota != null && $item->aliquota->codice_natura_fe !== null && substr($item->aliquota->codice_natura_fe, 0, 2) == 'N6')->id;
$autofattura_vendita = Fattura::find($fattura->id_autofattura);
$abilita_autofattura = (($fattura->anagrafica->nazione->iso2 != 'IT' && !empty($fattura->anagrafica->nazione->iso2)) || $reverse_charge) && $dir == 'uscita' && $fattura->id_autofattura == null;