Added validation gainst production order checking logic in panel box validation
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 19s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Laravel Pint / pint (pull_request) Successful in 4m57s
Laravel Larastan / larastan (pull_request) Failing after 5m13s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 19s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Laravel Pint / pint (pull_request) Successful in 4m57s
Laravel Larastan / larastan (pull_request) Failing after 5m13s
This commit is contained in:
@@ -289,276 +289,276 @@ class PanelBoxValidationResource extends Resource
|
|||||||
|
|
||||||
// Check if QR format contains '|'
|
// Check if QR format contains '|'
|
||||||
|
|
||||||
// if ($state && str_contains($state, '|'))
|
if ($state && str_contains($state, '|'))
|
||||||
// {
|
{
|
||||||
// if (strpos($state, '|') == false) {
|
if (strpos($state, '|') == false) {
|
||||||
// $set('validationError', 'Scan valid QR code. (Ex: Item_Code|Serial_Number)');
|
$set('validationError', 'Scan valid QR code. (Ex: Item_Code|Serial_Number)');
|
||||||
// $set('part_validation_type', null);
|
$set('part_validation_type', null);
|
||||||
// $set('show_validation_image', false);
|
$set('show_validation_image', false);
|
||||||
// $set('part_validation_type_options', []);
|
$set('part_validation_type_options', []);
|
||||||
// $set('validation1_image_url', null);
|
$set('validation1_image_url', null);
|
||||||
|
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// if (! preg_match('/^[a-zA-Z0-9]{6,}+\|[1-9][a-zA-Z0-9]{8,}+(\|)?$/', $state)) {
|
if (! preg_match('/^[a-zA-Z0-9]{6,}+\|[1-9][a-zA-Z0-9]{8,}+(\|)?$/', $state)) {
|
||||||
// $splits = explode('|', $state);
|
$splits = explode('|', $state);
|
||||||
// $iCode = trim($splits[0]);
|
$iCode = trim($splits[0]);
|
||||||
// $sNumber = isset($splits[1]) ? trim($splits[1]) : null;
|
$sNumber = isset($splits[1]) ? trim($splits[1]) : null;
|
||||||
|
|
||||||
// if (! ctype_alnum($iCode)) {
|
if (! ctype_alnum($iCode)) {
|
||||||
// $set('validationError', 'Item code must contain alpha-numeric values.');
|
$set('validationError', 'Item code must contain alpha-numeric values.');
|
||||||
// $set('part_validation_type', null);
|
$set('part_validation_type', null);
|
||||||
// $set('show_validation_image', false);
|
$set('show_validation_image', false);
|
||||||
// $set('part_validation_type_options', []);
|
$set('part_validation_type_options', []);
|
||||||
// $set('validation1_image_url', null);
|
$set('validation1_image_url', null);
|
||||||
|
|
||||||
// return;
|
return;
|
||||||
// } elseif (strlen($iCode) < 6) {
|
} elseif (strlen($iCode) < 6) {
|
||||||
// $set('validationError', 'Item code must be at least 6 digits.');
|
$set('validationError', 'Item code must be at least 6 digits.');
|
||||||
// $set('part_validation_type', null);
|
$set('part_validation_type', null);
|
||||||
// $set('show_validation_image', false);
|
$set('show_validation_image', false);
|
||||||
// $set('part_validation_type_options', []);
|
$set('part_validation_type_options', []);
|
||||||
// $set('validation1_image_url', null);
|
$set('validation1_image_url', null);
|
||||||
|
|
||||||
// return;
|
return;
|
||||||
// } elseif (! ctype_alnum($sNumber)) {
|
} elseif (! ctype_alnum($sNumber)) {
|
||||||
// $set('validationError', 'Serial Number must contain alpha-numeric values.');
|
$set('validationError', 'Serial Number must contain alpha-numeric values.');
|
||||||
// $set('part_validation_type', null);
|
$set('part_validation_type', null);
|
||||||
// $set('show_validation_image', false);
|
$set('show_validation_image', false);
|
||||||
// $set('part_validation_type_options', []);
|
$set('part_validation_type_options', []);
|
||||||
// $set('validation1_image_url', null);
|
$set('validation1_image_url', null);
|
||||||
|
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// $existInMasterPo = PanelGrMaster::where('document_number', $pOrder)->where('plant_id', $plantId)->first();
|
$existInMasterPo = PanelGrMaster::where('document_number', $pOrder)->where('plant_id', $plantId)->first();
|
||||||
|
|
||||||
// if(!$existInMasterPo){
|
if(!$existInMasterPo){
|
||||||
// Notification::make()
|
Notification::make()
|
||||||
// ->title('Panel GR Record')
|
->title('Panel GR Record')
|
||||||
// ->body("Production Order (Or) Doc No'{$pOrder}' not found against plant code '{$plaCode}' in Panel Gr master.")
|
->body("Production Order (Or) Doc No'{$pOrder}' not found against plant code '{$plaCode}' in Panel Gr master.")
|
||||||
// ->danger()
|
->danger()
|
||||||
// ->send();
|
->send();
|
||||||
// $set('item_id', null);
|
$set('item_id', null);
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// $iId = Item::where('code', $iCode)->where('plant_id', $plantId)->first();
|
$iId = Item::where('code', $iCode)->where('plant_id', $plantId)->first();
|
||||||
|
|
||||||
// if(!$iId){
|
if(!$iId){
|
||||||
// Notification::make()
|
Notification::make()
|
||||||
// ->title('Item not found')
|
->title('Item not found')
|
||||||
// ->body("Item code'{$iCode}' not found against plant code '{$plaCode}' in item master.")
|
->body("Item code'{$iCode}' not found against plant code '{$plaCode}' in item master.")
|
||||||
// ->danger()
|
->danger()
|
||||||
// ->send();
|
->send();
|
||||||
// $set('item_id', null);
|
$set('item_id', null);
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// $existInMaster = PanelGrMaster::where('document_number', $pOrder)->where('item_id', $iId->id)->where('plant_id', $plantId)->first();
|
$existInMaster = PanelGrMaster::where('document_number', $pOrder)->where('item_id', $iId->id)->where('plant_id', $plantId)->first();
|
||||||
|
|
||||||
// if(!$existInMaster){
|
if(!$existInMaster){
|
||||||
// Notification::make()
|
Notification::make()
|
||||||
// ->title('Panel GR Record Not Found')
|
->title('Panel GR Record Not Found')
|
||||||
// ->body("No Panel GR record found for Production Order (Or) Doc No'{$pOrder}' and for Item '{$iCode}'.")
|
->body("No Panel GR record found for Production Order (Or) Doc No'{$pOrder}' and for Item '{$iCode}'.")
|
||||||
// ->danger()
|
->danger()
|
||||||
// ->send();
|
->send();
|
||||||
// $set('item_id', null);
|
$set('item_id', null);
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
// else if($existInMaster->supplier_number == '' || $existInMaster->supplier_number == null){
|
else if($existInMaster->supplier_number == '' || $existInMaster->supplier_number == null){
|
||||||
|
Notification::make()
|
||||||
|
->title('Panel GR Found')
|
||||||
|
->body("Supplier Number cannot be empty Panel GR record found for Production Order '{$pOrder}' and Item '{$iCode}'.")
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
$set('item_id', null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// else if($existInMaster->supplier_number != $supplier){
|
||||||
// Notification::make()
|
// Notification::make()
|
||||||
// ->title('Panel GR Found')
|
// ->title('Panel GR Found')
|
||||||
// ->body("Supplier Number cannot be empty Panel GR record found for Production Order '{$pOrder}' and Item '{$iCode}'.")
|
// ->body("Supplier code not match for Production Order (Or) Doc No'{$pOrder}' and Item '{$iCode}'.")
|
||||||
// ->danger()
|
// ->danger()
|
||||||
// ->send();
|
// ->send();
|
||||||
// $set('item_id', null);
|
// $set('item_id', null);
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
// // else if($existInMaster->supplier_number != $supplier){
|
else if($existInMaster->quantity == '' || $existInMaster->quantity == null){
|
||||||
// // Notification::make()
|
Notification::make()
|
||||||
// // ->title('Panel GR Found')
|
->title('Panel GR Found')
|
||||||
// // ->body("Supplier code not match for Production Order (Or) Doc No'{$pOrder}' and Item '{$iCode}'.")
|
->body("Quantity cannot be empty Panel GR record found for Production Order '{$pOrder}' and Item '{$iCode}'.")
|
||||||
// // ->danger()
|
->danger()
|
||||||
// // ->send();
|
->send();
|
||||||
// // $set('item_id', null);
|
$set('item_id', null);
|
||||||
// // return;
|
return;
|
||||||
// // }
|
}
|
||||||
// else if($existInMaster->quantity == '' || $existInMaster->quantity == null){
|
else if($existInMaster->invoice_number == '' || $existInMaster->invoice_number == null){
|
||||||
|
Notification::make()
|
||||||
|
->title('Panel GR Found')
|
||||||
|
->body("Invoice Number cannot be empty Panel GR record found for Production Order '{$pOrder}' and Item '{$iCode}'.")
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
$set('item_id', null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sticker = StickerMaster::where('plant_id', $plantId)->where('item_id', $iId->id)->first();
|
||||||
|
|
||||||
|
if(!$sticker){
|
||||||
|
Notification::make()
|
||||||
|
->title('Unknown Item Code')
|
||||||
|
->body("Item code not found '{$iId->code}' in sticker master.")
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
$set('item_id', null);
|
||||||
|
}
|
||||||
|
|
||||||
|
$existQuanInPanel = PanelBoxValidation::where('plant_id', $plantId)->where('production_order', $pOrder)->where('sticker_master_id', $sticker->id)->count();
|
||||||
|
|
||||||
|
if ($existQuanInPanel >= (int) $existInMaster->quantity) {
|
||||||
|
Notification::make()
|
||||||
|
->title('Quantity Completed')
|
||||||
|
->body("Panel box quantity '{$existQuanInPanel}' exceeds the available quantity '{$existInMaster->quantity}' in Panel GR Master for Production Order '{$pOrder}' and Item '{$iCode}'.")
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
$set('item_id', null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$set('validationError', null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (str_contains($state, '|')) {
|
||||||
|
|
||||||
|
$parts = array_map('trim', explode('|', $state));
|
||||||
|
|
||||||
|
if (count($parts) != 2) {
|
||||||
|
Notification::make()
|
||||||
|
->title('Invalid QR Format')
|
||||||
|
->body('Expected format: ItemCode|SerialNumber')
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$itemCode = $parts[0];
|
||||||
|
$serialNumber = $parts[1];
|
||||||
|
|
||||||
|
if($serialNumber == '' || $serialNumber == null){
|
||||||
|
Notification::make()
|
||||||
|
->title('Unknown Serial number')
|
||||||
|
->body("Serial number can't be empty!")
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
|
||||||
|
$set('item_id', null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
elseif (! ctype_alnum($serialNumber)) {
|
||||||
|
$set('validationError', 'Serial Number should contain alpha-numeric values.');
|
||||||
|
$set('item_id', null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$existInMasterPo = PanelGrMaster::where('document_number', $pOrder)->where('plant_id', $plantId)->first();
|
||||||
|
|
||||||
|
if(!$existInMasterPo){
|
||||||
|
Notification::make()
|
||||||
|
->title('Panel GR Record')
|
||||||
|
->body("Production Order (Or) Doc No'{$pOrder}' not found against plant code '{$plaCode}' in Panel Gr master.")
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
$set('item_id', null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$iId = Item::where('code', $itemCode)->where('plant_id', $plantId)->first();
|
||||||
|
|
||||||
|
if(!$iId){
|
||||||
|
Notification::make()
|
||||||
|
->title('Item not found')
|
||||||
|
->body("Item code'{$itemCode}' not found against plant code '{$plaCode}' in item master.")
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
$set('item_id', null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$existInMaster = PanelGrMaster::where('document_number', $pOrder)->where('item_id', $iId->id)->where('plant_id', $plantId)->first();
|
||||||
|
|
||||||
|
if(!$existInMaster){
|
||||||
|
Notification::make()
|
||||||
|
->title('Panel GR Record Not Found')
|
||||||
|
->body("No Panel GR record found for Production Order (Or) Doc No'{$pOrder}' and for Item '{$itemCode}'.")
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
$set('item_id', null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if($existInMaster->supplier_number == '' || $existInMaster->supplier_number == null){
|
||||||
|
Notification::make()
|
||||||
|
->title('Panel GR Found')
|
||||||
|
->body("Supplier Number cannot be empty Panel GR record found for Production Order '{$pOrder}' and Item '{$itemCode}'.")
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
$set('item_id', null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// else if($existInMaster->supplier_number != $supplier){
|
||||||
// Notification::make()
|
// Notification::make()
|
||||||
// ->title('Panel GR Found')
|
// ->title('Panel GR Found')
|
||||||
// ->body("Quantity cannot be empty Panel GR record found for Production Order '{$pOrder}' and Item '{$iCode}'.")
|
// ->body("Supplier code not match for Production Order (Or) Doc No'{$pOrder}' and Item '{$iCode}'.")
|
||||||
// ->danger()
|
|
||||||
// ->send();
|
|
||||||
// $set('item_id', null);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// else if($existInMaster->invoice_number == '' || $existInMaster->invoice_number == null){
|
|
||||||
// Notification::make()
|
|
||||||
// ->title('Panel GR Found')
|
|
||||||
// ->body("Invoice Number cannot be empty Panel GR record found for Production Order '{$pOrder}' and Item '{$iCode}'.")
|
|
||||||
// ->danger()
|
// ->danger()
|
||||||
// ->send();
|
// ->send();
|
||||||
// $set('item_id', null);
|
// $set('item_id', null);
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
|
else if($existInMaster->quantity == '' || $existInMaster->quantity == null){
|
||||||
|
Notification::make()
|
||||||
|
->title('Panel GR Found')
|
||||||
|
->body("Quantity cannot be empty Panel GR record found for Production Order '{$pOrder}' and Item '{$itemCode}'.")
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
$set('item_id', null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if($existInMaster->invoice_number == '' || $existInMaster->invoice_number == null){
|
||||||
|
Notification::make()
|
||||||
|
->title('Panel GR Found')
|
||||||
|
->body("Invoice Number cannot be empty Panel GR record found for Production Order '{$pOrder}' and Item '{$itemCode}'.")
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
$set('item_id', null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// $sticker = StickerMaster::where('plant_id', $plantId)->where('item_id', $iId->id)->first();
|
$sticker = StickerMaster::where('plant_id', $plantId)->where('item_id', $iId->id)->first();
|
||||||
|
|
||||||
// if(!$sticker){
|
if(!$sticker){
|
||||||
// Notification::make()
|
Notification::make()
|
||||||
// ->title('Unknown Item Code')
|
->title('Unknown Item Code')
|
||||||
// ->body("Item code not found '{$iId->code}' in sticker master.")
|
->body("Item code not found '{$iId->code}' in sticker master.")
|
||||||
// ->danger()
|
->danger()
|
||||||
// ->send();
|
->send();
|
||||||
// $set('item_id', null);
|
$set('item_id', null);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// $existQuanInPanel = PanelBoxValidation::where('plant_id', $plantId)->where('production_order', $pOrder)->where('sticker_master_id', $sticker->id)->count();
|
$existQuanInPanel = PanelBoxValidation::where('plant_id', $plantId)->where('production_order', $pOrder)->where('sticker_master_id', $sticker->id)->count();
|
||||||
|
|
||||||
// if ($existQuanInPanel >= (int) $existInMaster->quantity) {
|
if ($existQuanInPanel >= (int) $existInMaster->quantity) {
|
||||||
// Notification::make()
|
Notification::make()
|
||||||
// ->title('Quantity Completed')
|
->title('Quantity Completed')
|
||||||
// ->body("Panel box quantity '{$existQuanInPanel}' exceeds the available quantity '{$existInMaster->quantity}' in Panel GR Master for Production Order '{$pOrder}' and Item '{$iCode}'.")
|
->body("Panel box quantity '{$existQuanInPanel}' exceeds the available quantity '{$existInMaster->quantity}' in Panel GR Master for Production Order '{$pOrder}' and Item '{$itemCode}'.")
|
||||||
// ->danger()
|
->danger()
|
||||||
// ->send();
|
->send();
|
||||||
// $set('item_id', null);
|
$set('item_id', null);
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
// } else {
|
|
||||||
// $set('validationError', null);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (str_contains($state, '|')) {
|
|
||||||
|
|
||||||
// $parts = array_map('trim', explode('|', $state));
|
}
|
||||||
|
|
||||||
// if (count($parts) != 2) {
|
|
||||||
// Notification::make()
|
|
||||||
// ->title('Invalid QR Format')
|
|
||||||
// ->body('Expected format: ItemCode|SerialNumber')
|
|
||||||
// ->danger()
|
|
||||||
// ->send();
|
|
||||||
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// $itemCode = $parts[0];
|
|
||||||
// $serialNumber = $parts[1];
|
|
||||||
|
|
||||||
// if($serialNumber == '' || $serialNumber == null){
|
|
||||||
// Notification::make()
|
|
||||||
// ->title('Unknown Serial number')
|
|
||||||
// ->body("Serial number can't be empty!")
|
|
||||||
// ->danger()
|
|
||||||
// ->send();
|
|
||||||
|
|
||||||
// $set('item_id', null);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// elseif (! ctype_alnum($serialNumber)) {
|
|
||||||
// $set('validationError', 'Serial Number should contain alpha-numeric values.');
|
|
||||||
// $set('item_id', null);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// $existInMasterPo = PanelGrMaster::where('document_number', $pOrder)->where('plant_id', $plantId)->first();
|
|
||||||
|
|
||||||
// if(!$existInMasterPo){
|
|
||||||
// Notification::make()
|
|
||||||
// ->title('Panel GR Record')
|
|
||||||
// ->body("Production Order (Or) Doc No'{$pOrder}' not found against plant code '{$plaCode}' in Panel Gr master.")
|
|
||||||
// ->danger()
|
|
||||||
// ->send();
|
|
||||||
// $set('item_id', null);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// $iId = Item::where('code', $itemCode)->where('plant_id', $plantId)->first();
|
|
||||||
|
|
||||||
// if(!$iId){
|
|
||||||
// Notification::make()
|
|
||||||
// ->title('Item not found')
|
|
||||||
// ->body("Item code'{$itemCode}' not found against plant code '{$plaCode}' in item master.")
|
|
||||||
// ->danger()
|
|
||||||
// ->send();
|
|
||||||
// $set('item_id', null);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// $existInMaster = PanelGrMaster::where('document_number', $pOrder)->where('item_id', $iId->id)->where('plant_id', $plantId)->first();
|
|
||||||
|
|
||||||
// if(!$existInMaster){
|
|
||||||
// Notification::make()
|
|
||||||
// ->title('Panel GR Record Not Found')
|
|
||||||
// ->body("No Panel GR record found for Production Order (Or) Doc No'{$pOrder}' and for Item '{$itemCode}'.")
|
|
||||||
// ->danger()
|
|
||||||
// ->send();
|
|
||||||
// $set('item_id', null);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// else if($existInMaster->supplier_number == '' || $existInMaster->supplier_number == null){
|
|
||||||
// Notification::make()
|
|
||||||
// ->title('Panel GR Found')
|
|
||||||
// ->body("Supplier Number cannot be empty Panel GR record found for Production Order '{$pOrder}' and Item '{$itemCode}'.")
|
|
||||||
// ->danger()
|
|
||||||
// ->send();
|
|
||||||
// $set('item_id', null);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// // else if($existInMaster->supplier_number != $supplier){
|
|
||||||
// // Notification::make()
|
|
||||||
// // ->title('Panel GR Found')
|
|
||||||
// // ->body("Supplier code not match for Production Order (Or) Doc No'{$pOrder}' and Item '{$iCode}'.")
|
|
||||||
// // ->danger()
|
|
||||||
// // ->send();
|
|
||||||
// // $set('item_id', null);
|
|
||||||
// // return;
|
|
||||||
// // }
|
|
||||||
// else if($existInMaster->quantity == '' || $existInMaster->quantity == null){
|
|
||||||
// Notification::make()
|
|
||||||
// ->title('Panel GR Found')
|
|
||||||
// ->body("Quantity cannot be empty Panel GR record found for Production Order '{$pOrder}' and Item '{$itemCode}'.")
|
|
||||||
// ->danger()
|
|
||||||
// ->send();
|
|
||||||
// $set('item_id', null);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// else if($existInMaster->invoice_number == '' || $existInMaster->invoice_number == null){
|
|
||||||
// Notification::make()
|
|
||||||
// ->title('Panel GR Found')
|
|
||||||
// ->body("Invoice Number cannot be empty Panel GR record found for Production Order '{$pOrder}' and Item '{$itemCode}'.")
|
|
||||||
// ->danger()
|
|
||||||
// ->send();
|
|
||||||
// $set('item_id', null);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// $sticker = StickerMaster::where('plant_id', $plantId)->where('item_id', $iId->id)->first();
|
|
||||||
|
|
||||||
// if(!$sticker){
|
|
||||||
// Notification::make()
|
|
||||||
// ->title('Unknown Item Code')
|
|
||||||
// ->body("Item code not found '{$iId->code}' in sticker master.")
|
|
||||||
// ->danger()
|
|
||||||
// ->send();
|
|
||||||
// $set('item_id', null);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// $existQuanInPanel = PanelBoxValidation::where('plant_id', $plantId)->where('production_order', $pOrder)->where('sticker_master_id', $sticker->id)->count();
|
|
||||||
|
|
||||||
// if ($existQuanInPanel >= (int) $existInMaster->quantity) {
|
|
||||||
// Notification::make()
|
|
||||||
// ->title('Quantity Completed')
|
|
||||||
// ->body("Panel box quantity '{$existQuanInPanel}' exceeds the available quantity '{$existInMaster->quantity}' in Panel GR Master for Production Order '{$pOrder}' and Item '{$itemCode}'.")
|
|
||||||
// ->danger()
|
|
||||||
// ->send();
|
|
||||||
// $set('item_id', null);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// }
|
|
||||||
if (str_contains($state, '/'))
|
if (str_contains($state, '/'))
|
||||||
{
|
{
|
||||||
$parts = explode('/', $state);
|
$parts = explode('/', $state);
|
||||||
@@ -794,6 +794,32 @@ class PanelBoxValidationResource extends Resource
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$plantCode = Plant::where('id', $plantId)->value('code');
|
||||||
|
|
||||||
|
if($plantCode != $supplier){
|
||||||
|
Notification::make()
|
||||||
|
->title('Supplier Mismatch')
|
||||||
|
->body("Supplier code '$supplier' mismatch with selected plant code '$plantCode'.")
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
$set('item_id', null);
|
||||||
|
$set('serial_exists', false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($existInMasterProdOrder->item_id != $iId){
|
||||||
|
$itemCodePOrd = Item::where('id', $existInMasterProdOrder->item_id)->value('code');
|
||||||
|
|
||||||
|
Notification::make()
|
||||||
|
->title('Panel Box Code Mismatch')
|
||||||
|
->body("Scanned Panel Box Code '$itemCode' not matched with produciton order item code '$itemCodePOrd'.")
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
$set('item_id', null);
|
||||||
|
$set('serial_exists', false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if($existInMasterProdOrder->quantity == '' || $existInMasterProdOrder->quantity == null){
|
if($existInMasterProdOrder->quantity == '' || $existInMasterProdOrder->quantity == null){
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title('Production Order Found')
|
->title('Production Order Found')
|
||||||
|
|||||||
Reference in New Issue
Block a user