Fix delivery deletion: allow negative stock instead of clamping to 0
Deploy / deploy (push) Successful in 16s
Deploy / deploy (push) Successful in 16s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
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);
|
||||
}
|
||||
}),
|
||||
];
|
||||
|
||||
Reference in new issue
Block a user