Fix delivery deletion: allow negative stock instead of clamping to 0
Deploy / deploy (push) Successful in 16s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Malek TellissiandClaude Sonnet 4.6 committed 2026-09-12 21:50:58 +02:00
1 parent 88224f887c
commit 7545aed494
1 file changed
+1 -3
@@ -21,9 +21,7 @@ class EditSpiceSupplier extends EditRecord
)
->before(function ($record) {
if ($record->spice) {
$record->spice->update([
'quantity' => max(0, $record->spice->quantity - $record->amount),
]);
$record->spice->decrement('quantity', $record->amount);
}
}),
];