Merge pull request 'Changed logic in bulk sticker printing page' (#1257) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #1257
This commit was merged in pull request #1257.
This commit is contained in:
@@ -982,6 +982,8 @@ class BulkStickerPrinting extends Page implements HasForms
|
|||||||
|
|
||||||
$itemCode = Item::where('id', $pOrderExist->item_id)->value('code');
|
$itemCode = Item::where('id', $pOrderExist->item_id)->value('code');
|
||||||
|
|
||||||
|
$plantCode = Plant::where('id', $plantId)->value('code');
|
||||||
|
|
||||||
if (!$checkItem) {
|
if (!$checkItem) {
|
||||||
|
|
||||||
Notification::make()
|
Notification::make()
|
||||||
@@ -1008,19 +1010,19 @@ class BulkStickerPrinting extends Page implements HasForms
|
|||||||
|
|
||||||
$matchedMachineId = null;
|
$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) {
|
if (!$matchedMachineId) {
|
||||||
|
|
||||||
@@ -1035,10 +1037,20 @@ class BulkStickerPrinting extends Page implements HasForms
|
|||||||
|
|
||||||
$itemCharacteristic = ClassCharacteristic::where('plant_id', $plantId)
|
$itemCharacteristic = ClassCharacteristic::where('plant_id', $plantId)
|
||||||
->where('item_id', $checkItem->item_id)
|
->where('item_id', $checkItem->item_id)
|
||||||
->where('machine_id', $matchedMachineId)
|
->where('machine_id', $machineId)
|
||||||
->where('aufnr', $pOrder)
|
->where('aufnr', $pOrder)
|
||||||
->first();
|
->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();
|
$elements = StickerDetail::where('sticker_structure_detail_id',$structure->id)->get();
|
||||||
|
|
||||||
if ($elements->isEmpty()) {
|
if ($elements->isEmpty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user