Deploy / deploy (push) Successful in 16s
Every delivery and batch now writes a signed movement entry instead of directly incrementing/decrementing spice.quantity. The balance is always the sum of all movements. Existing data is backfilled in the migration. Rohstoff edit page shows the full movement history (Lagerbewegungen tab). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
25 lines
837 B
PHP
25 lines
837 B
PHP
<?php
|
|
|
|
namespace App\Filament\User\Resources\SpiceSupplierResource\Pages;
|
|
|
|
use App\Filament\User\Resources\SpiceSupplierResource;
|
|
use Filament\Resources\Pages\EditRecord;
|
|
|
|
class EditSpiceSupplier extends EditRecord
|
|
{
|
|
protected static string $resource = SpiceSupplierResource::class;
|
|
|
|
protected function getHeaderActions(): array
|
|
{
|
|
return [
|
|
\Filament\Actions\DeleteAction::make()
|
|
->requiresConfirmation()
|
|
->modalHeading('Lieferung löschen')
|
|
->modalDescription(fn ($record) => $record->spice && $record->spice->quantity < $record->amount
|
|
? 'Warnung: Nach dem Löschen wird der Bestand von ' . $record->spice->name . ' negativ.'
|
|
: 'Soll diese Lieferung wirklich gelöscht werden?'
|
|
),
|
|
];
|
|
}
|
|
}
|