Changed logic in bulk sticker printing page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Laravel Larastan / larastan (pull_request) Failing after 5m48s
Laravel Pint / pint (pull_request) Successful in 5m50s

This commit is contained in:
dhanabalan
2026-10-15 15:59:44 +05:30
parent c18a0fdaaa
commit 3197a7ff22

View File

@@ -982,6 +982,8 @@ class BulkStickerPrinting extends Page implements HasForms
$itemCode = Item::where('id', $pOrderExist->item_id)->value('code');
$plantCode = Plant::where('id', $plantId)->value('code');
if (!$checkItem) {
Notification::make()
@@ -1008,19 +1010,19 @@ class BulkStickerPrinting extends Page implements HasForms
$matchedMachineId = null;
for ($i = 1; $i <= 8; $i++) {
// for ($i = 1; $i <= 8; $i++) {
$machineColumn = "sticker{$i}_machine_id";
// $machineColumn = "sticker{$i}_machine_id";
if ((string) $stickerMappingMasterItem->{$machineColumn} == (string) $machineId) {
// if ((string) $stickerMappingMasterItem->{$machineColumn} == (string) $machineId) {
$matchedMachineId = $stickerMappingMasterItem->{$machineColumn};
// $matchedMachineId = $stickerMappingMasterItem->{$machineColumn};
break;
}
}
// break;
// }
// }
// $matchedMachineId = StickerMappingMaster::where('plant_id', $plantId)->where('item_id', $pOrderExist->item_id)->where('sticker_structure1_id', $structure->id)->where('sticker1_machine_id', $machineId)->first();
$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) {
@@ -1035,10 +1037,20 @@ class BulkStickerPrinting extends Page implements HasForms
$itemCharacteristic = ClassCharacteristic::where('plant_id', $plantId)
->where('item_id', $checkItem->item_id)
->where('machine_id', $matchedMachineId)
->where('machine_id', $machineId)
->where('aufnr', $pOrder)
->first();
if(!$itemCharacteristic){
Notification::make()
->danger()
->title('Record Not Found')
->body("Record not found in class characteristic against job '$pOrder', item '$itemCode' and plant '$plantCode'.")
->send();
return;
}
$elements = StickerDetail::where('sticker_structure_detail_id',$structure->id)->get();
if ($elements->isEmpty()) {