Skip to content

Commit

Permalink
fix in aggiornamento ordine
Browse files Browse the repository at this point in the history
  • Loading branch information
madbob committed May 13, 2024
1 parent 67b522c commit 1d4e072
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion code/app/Services/OrdersService.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,13 @@ public function update($id, array $request)
$order->detachProduct($rp);
}

$products = $order->supplier->products()->whereIn('id', $enabled)->get();
/*
Nota bene: mentre l'ordine è aperto, alcuni prodotti potrebbero
essere stati rimossi ma comunque lasciati nell'ordine stesso.
Quando aggiorno l'elenco, devo tenere in considerazione l'elenco di
tutti i prodotti del fornitore inclusi quelli marcati come eliminati
*/
$products = $order->supplier->products()->withTrashed()->whereIn('id', $enabled)->get();
$order->syncProducts($products, false);
return $order->aggregate;
}
Expand Down

0 comments on commit 1d4e072

Please sign in to comment.