Added duplicate logic for bulk sticker printing #1012
@@ -879,6 +879,18 @@ class BulkStickerPrinting extends Page implements HasForms
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$updatePrintStatusCompleted = ProductionOrder::where('plant_id', $plantId)->where('production_order', $pOrder)->where('from_serial_number', $fromSerNo)->where('to_serial_number', $toSerNo)->where('print_status', 'Printed')->first();
|
||||||
|
|
||||||
|
if ($updatePrintStatusCompleted) {
|
||||||
|
Notification::make()
|
||||||
|
->danger()
|
||||||
|
->title('Duplicate Sticker')
|
||||||
|
->body("Already Sticker generated successfully for Production Order '$pOrder' and plant '$plantName'.")
|
||||||
|
->send();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$structure = StickerStructureDetail::where('sticker_id',$stickerId)->first();
|
$structure = StickerStructureDetail::where('sticker_id',$stickerId)->first();
|
||||||
|
|
||||||
if (!$structure) {
|
if (!$structure) {
|
||||||
@@ -1035,6 +1047,13 @@ class BulkStickerPrinting extends Page implements HasForms
|
|||||||
|
|
||||||
$totalStickers = ($toSerNo - $fromSerNo) + 1;
|
$totalStickers = ($toSerNo - $fromSerNo) + 1;
|
||||||
|
|
||||||
|
$updatePrintStatus = ProductionOrder::where('plant_id', $plantId)->where('production_order', $pOrder)->where('from_serial_number', $fromSerNo)->where('to_serial_number', $toSerNo)->first();
|
||||||
|
|
||||||
|
if ($updatePrintStatus) {
|
||||||
|
$updatePrintStatus->update([
|
||||||
|
'print_status' => 'Printed',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->success()
|
->success()
|
||||||
|
|||||||
Reference in New Issue
Block a user