Updated validation logic against machin name on resource and import page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
This commit is contained in:
@@ -410,13 +410,13 @@ class ProcessOrderResource extends Resource
|
||||
$orderQty = (float) $get('order_quantity');
|
||||
$updatedQty = (float) $value;
|
||||
|
||||
$allowedVariance = $orderQty * 0.10;
|
||||
$allowedVariance = $orderQty * 0.10;
|
||||
|
||||
$maxAllowed = $orderQty + $allowedVariance;
|
||||
$minAllowed = $orderQty - $allowedVariance;
|
||||
|
||||
if ($updatedQty > $maxAllowed || $updatedQty < $minAllowed) {
|
||||
$fail("Quantity can vary by ±10% of the order quantity.");
|
||||
$fail('Quantity can vary by ±10% of the order quantity.');
|
||||
}
|
||||
|
||||
$otherReceivedQty = ProcessOrder::where('plant_id', $plantId)
|
||||
@@ -631,6 +631,7 @@ class ProcessOrderResource extends Resource
|
||||
Forms\Components\TextInput::make('machine_name')
|
||||
->label('Machine Name')
|
||||
->reactive()
|
||||
->maxLength(18)
|
||||
->readOnly(fn ($get) => (trim($get('process_order')) == null || trim($get('process_order')) == ''))
|
||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
|
||||
Reference in New Issue
Block a user