changed logic in bulk sticker printing of machine issue
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 25s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 20s
Laravel Pint / pint (pull_request) Successful in 3m40s
Laravel Larastan / larastan (pull_request) Failing after 7m22s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 25s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 20s
Laravel Pint / pint (pull_request) Successful in 3m40s
Laravel Larastan / larastan (pull_request) Failing after 7m22s
This commit is contained in:
@@ -1077,25 +1077,54 @@ class BulkStickerPrinting extends Page implements HasForms
|
||||
|
||||
$matchedMachineId = null;
|
||||
|
||||
// for ($i = 1; $i <= 8; $i++) {
|
||||
|
||||
// $structureColumn = "sticker_structure{$i}_id";
|
||||
|
||||
// if (
|
||||
// (string) $stickerMappingMasterItem->{$structureColumn}
|
||||
// == (string) $structure->id
|
||||
// ) {
|
||||
// $machineColumn = "sticker{$i}_machine_id";
|
||||
|
||||
// $matchedMachineId = $stickerMappingMasterItem->{$machineColumn};
|
||||
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// if ($matchedMachineId == null || (string) $matchedMachineId != (string) $machineId)
|
||||
// {
|
||||
// Notification::make()
|
||||
// ->danger()
|
||||
// ->title('Machine Mapping Mismatch')
|
||||
// ->body("Selected machine '{$machineId}' does not match the machine mapped to the selected sticker.")
|
||||
// ->send();
|
||||
|
||||
// return;
|
||||
// }
|
||||
|
||||
//..New
|
||||
|
||||
for ($i = 1; $i <= 8; $i++) {
|
||||
|
||||
$structureColumn = "sticker_structure{$i}_id";
|
||||
$machineColumn = "sticker{$i}_machine_id";
|
||||
|
||||
$mappedStructureId = $stickerMappingMasterItem->{$structureColumn} ?? null;
|
||||
|
||||
if (
|
||||
(string) $stickerMappingMasterItem->{$structureColumn}
|
||||
== (string) $structure->id
|
||||
$mappedStructureId !== null &&
|
||||
(string) $mappedStructureId === (string) $structure->id
|
||||
) {
|
||||
$machineColumn = "sticker{$i}_machine_id";
|
||||
|
||||
$matchedMachineId = $stickerMappingMasterItem->{$machineColumn};
|
||||
|
||||
$matchedMachineId = $stickerMappingMasterItem->{$machineColumn} ?? null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
$matchedMachineId == null ||
|
||||
(string) $matchedMachineId != (string) $machineId
|
||||
$matchedMachineId === null ||
|
||||
trim((string) $matchedMachineId) !== trim((string) $machineId)
|
||||
) {
|
||||
Notification::make()
|
||||
->danger()
|
||||
@@ -1106,25 +1135,11 @@ class BulkStickerPrinting extends Page implements HasForms
|
||||
return;
|
||||
}
|
||||
|
||||
if ((string) $matchedMachineId != (string) $machineId) {
|
||||
Notification::make()
|
||||
->danger()
|
||||
->title('Machine Not Found')
|
||||
->body("Machine '{$machineId}' is not mapped for Item Code '{$itemCode}' against sticker '$stickerId' in sticker mapping master.")
|
||||
->send();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// $matchedMachineId = StickerMappingMaster::where('plant_id', $plantId)->where('item_id', $pOrderExist->item_id)->where('sticker_structure1_id', $structure->id)->where('sticker1_machine_id', $machineId)->first();
|
||||
|
||||
// if (!$matchedMachineId) {
|
||||
|
||||
// if ((string) $matchedMachineId != (string) $machineId) {
|
||||
// Notification::make()
|
||||
// ->danger()
|
||||
// ->title('Machine Not Found')
|
||||
// ->body("Machine '{$machineId}' is not mapped for Item Code '{$itemCode}' in sticker mapping master.")
|
||||
// ->body("Machine '{$machineId}' is not mapped for Item Code '{$itemCode}' against sticker '$stickerId' in sticker mapping master.")
|
||||
// ->send();
|
||||
|
||||
// return;
|
||||
|
||||
Reference in New Issue
Block a user