Added print panel 2 in view production order page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Failing after 25s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 17s
Laravel Pint / pint (pull_request) Successful in 2m47s
Laravel Larastan / larastan (pull_request) Failing after 4m21s

This commit is contained in:
dhanabalan
2026-11-16 10:53:26 +05:30
parent 8462653690
commit 09736ca158

View File

@@ -90,6 +90,43 @@ class ViewProductionOrder extends ViewRecord
}
public function printPanel2()
{
$pOrder = trim($this->form->getState()['production_order'] ?? '') ?? null;
$plantId = trim($this->form->getState()['plant_id'] ?? '') ?? null;
$plantCode = Plant::where('id', $plantId)->value('code');
if (empty($plantId)) {
Notification::make()
->title('Plant name cannot be empty!')
->danger()
->send();
return;
} elseif (empty($pOrder)) {
Notification::make()
->title('Production order cannot be empty!')
->danger()
->send();
return;
}
$pOrderExists = ProductionOrder::where('plant_id', $plantId)->where('production_order', $pOrder)->first();
if (! $pOrderExists) {
Notification::make()
->title("Production Order '{$pOrder}' does not exist to get print!")
->danger()
->send();
return;
} else {
return redirect()->route('production-orders.printpanel2', ['production_order' => $pOrder, 'plant_code' => $plantCode]);
}
}
// public function printItemSerial()
// {
// $pOrder = trim($this->form->getState()['production_order'] ?? '') ?? null;