From 94070ce0e0a415c3b281859a72562226bf4b46a2 Mon Sep 17 00:00:00 2001 From: Matteo Baccarin Date: Wed, 29 Jan 2020 09:37:11 +0100 Subject: [PATCH] Fix rimozione riga singola intervento in fattura --- modules/fatture/actions.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/fatture/actions.php b/modules/fatture/actions.php index 0a0802354..9c5009ccc 100644 --- a/modules/fatture/actions.php +++ b/modules/fatture/actions.php @@ -485,15 +485,12 @@ switch (post('op')) { if (!empty($riga)) { try { - $righe = $fattura->getRighe(); - $righe_intervento = $righe->where('idintervento', $riga->idintervento); - foreach ($righe_intervento as $r) { - $r->delete(); - } + $riga->delete(); flash()->info(tr('Intervento _NUM_ rimosso!', [ '_NUM_' => $idintervento, ])); + } catch (InvalidArgumentException $e) { flash()->error(tr('Errore durante l\'eliminazione della riga!')); }