Added print second produciton order sticker method in all resource pages
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 21s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 24s
Laravel Pint / pint (pull_request) Successful in 2m58s
Laravel Larastan / larastan (pull_request) Failing after 5m56s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 21s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 24s
Laravel Pint / pint (pull_request) Successful in 2m58s
Laravel Larastan / larastan (pull_request) Failing after 5m56s
This commit is contained in:
@@ -211,6 +211,42 @@ class CreateProductionOrder extends CreateRecord
|
||||
}
|
||||
}
|
||||
|
||||
public function printProductionOrderSecond()
|
||||
{
|
||||
$pOrder = trim($this->form->getState()['production_order'] ?? '') ?? null;
|
||||
|
||||
$plantId = trim($this->form->getState()['plant_id'] ?? '') ?? null;
|
||||
|
||||
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.print2', ['production_order' => $pOrder]);
|
||||
}
|
||||
}
|
||||
|
||||
public function printItemSerial()
|
||||
{
|
||||
$pOrder = trim($this->form->getState()['production_order'] ?? '') ?? null;
|
||||
@@ -378,6 +414,7 @@ class CreateProductionOrder extends CreateRecord
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected function getFormActions(): array
|
||||
{
|
||||
return [];
|
||||
|
||||
@@ -49,6 +49,42 @@ class EditProductionOrder extends EditRecord
|
||||
}
|
||||
}
|
||||
|
||||
public function printProductionOrderSecond()
|
||||
{
|
||||
$pOrder = trim($this->form->getState()['production_order'] ?? '') ?? null;
|
||||
|
||||
$plantId = trim($this->form->getState()['plant_id'] ?? '') ?? null;
|
||||
|
||||
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.print2', ['production_order' => $pOrder]);
|
||||
}
|
||||
}
|
||||
|
||||
public function printPanel()
|
||||
{
|
||||
$plantId = $this->form->getState()['plant_id'] ?? null;
|
||||
|
||||
@@ -50,6 +50,42 @@ class ViewProductionOrder extends ViewRecord
|
||||
}
|
||||
}
|
||||
|
||||
public function printProductionOrderSecond()
|
||||
{
|
||||
$pOrder = trim($this->form->getState()['production_order'] ?? '') ?? null;
|
||||
|
||||
$plantId = trim($this->form->getState()['plant_id'] ?? '') ?? null;
|
||||
|
||||
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.print2', ['production_order' => $pOrder]);
|
||||
}
|
||||
}
|
||||
|
||||
public function printPanel()
|
||||
{
|
||||
$plantId = $this->form->getState()['plant_id'] ?? null;
|
||||
|
||||
Reference in New Issue
Block a user