Fix rimozione riga singola intervento in fattura

This commit is contained in:
Matteo Baccarin 2020-01-29 09:37:11 +01:00
parent cfad7fd3e4
commit 94070ce0e0
1 changed files with 2 additions and 5 deletions

View File

@ -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!'));
}