solved bug for throwing item id null exception in panel box validation
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 22s
Laravel Pint / pint (pull_request) Successful in 4m41s
Laravel Larastan / larastan (pull_request) Failing after 5m4s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 22s
Laravel Pint / pint (pull_request) Successful in 4m41s
Laravel Larastan / larastan (pull_request) Failing after 5m4s
This commit is contained in:
@@ -41,6 +41,8 @@ class PanelBoxValidationResource extends Resource
|
|||||||
|
|
||||||
public $data = [];
|
public $data = [];
|
||||||
|
|
||||||
|
// public bool $showChecklist = false;
|
||||||
|
|
||||||
public static function form(Form $form): Form
|
public static function form(Form $form): Form
|
||||||
{
|
{
|
||||||
return $form
|
return $form
|
||||||
@@ -237,6 +239,10 @@ class PanelBoxValidationResource extends Resource
|
|||||||
$set('pqLineError', null);
|
$set('pqLineError', null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if(!$state){
|
||||||
|
// $set('serial_exists', false);
|
||||||
|
// }
|
||||||
|
|
||||||
$pOrder = $get('production_order');
|
$pOrder = $get('production_order');
|
||||||
if (! $pOrder) {
|
if (! $pOrder) {
|
||||||
$set('prodOrdError', "Production Order can't be empty.");
|
$set('prodOrdError', "Production Order can't be empty.");
|
||||||
@@ -560,9 +566,11 @@ class PanelBoxValidationResource extends Resource
|
|||||||
->danger()
|
->danger()
|
||||||
->send();
|
->send();
|
||||||
$set('item_id', null);
|
$set('item_id', null);
|
||||||
|
// $set('serial_exists', false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$supplier = $parts[0];
|
$supplier = $parts[0];
|
||||||
$panelBoxCode = $parts[1];
|
$panelBoxCode = $parts[1];
|
||||||
$panelBoxSerialNo = implode('/', array_slice($parts, 2));
|
$panelBoxSerialNo = implode('/', array_slice($parts, 2));
|
||||||
@@ -660,6 +668,7 @@ class PanelBoxValidationResource extends Resource
|
|||||||
->danger()
|
->danger()
|
||||||
->send();
|
->send();
|
||||||
$set('item_id', null);
|
$set('item_id', null);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$existQuanInPanel = PanelBoxValidation::where('plant_id', $plantId)->where('production_order', $pOrder)->where('inspection_lot_number', $inspecLotNo)->where('sticker_master_id', $sticker->id)->count();
|
$existQuanInPanel = PanelBoxValidation::where('plant_id', $plantId)->where('production_order', $pOrder)->where('inspection_lot_number', $inspecLotNo)->where('sticker_master_id', $sticker->id)->count();
|
||||||
@@ -784,7 +793,13 @@ class PanelBoxValidationResource extends Resource
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$serialExists = PanelBoxValidation::where('serial_number', $serialNumber)->where('plant_id', $plantId)->exists();
|
$serialExists = PanelBoxValidation::where('serial_number', $serialNumber)->where('plant_id', $plantId)->first();
|
||||||
|
|
||||||
|
// if ($serialExists) {
|
||||||
|
// $set('serial_exists', true);
|
||||||
|
// } else {
|
||||||
|
// $set('serial_exists', false);
|
||||||
|
// }
|
||||||
|
|
||||||
if ($serialExists && ! $get('id')) {
|
if ($serialExists && ! $get('id')) {
|
||||||
$set('validationError', 'Serial number already exists in panel box validation.');
|
$set('validationError', 'Serial number already exists in panel box validation.');
|
||||||
|
|||||||
Reference in New Issue
Block a user