Added fucntion in both edit and 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) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
This commit is contained in:
@@ -89,6 +89,39 @@ class EditProductionOrder extends EditRecord
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function printItemSerial()
|
||||||
|
{
|
||||||
|
$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.printItemSerial', ['production_order' => $pOrder]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected function getHeaderActions(): array
|
protected function getHeaderActions(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class ViewProductionOrder extends ViewRecord
|
|||||||
{
|
{
|
||||||
protected static string $resource = ProductionOrderResource::class;
|
protected static string $resource = ProductionOrderResource::class;
|
||||||
|
|
||||||
public function printProductionOrder()
|
public function printProductionOrder()
|
||||||
{
|
{
|
||||||
$pOrder = trim($this->form->getState()['production_order'] ?? '') ?? null;
|
$pOrder = trim($this->form->getState()['production_order'] ?? '') ?? null;
|
||||||
|
|
||||||
@@ -89,6 +89,41 @@ class ViewProductionOrder extends ViewRecord
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function printItemSerial()
|
||||||
|
{
|
||||||
|
$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.printItemSerial', ['production_order' => $pOrder]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected function getHeaderActions(): array
|
protected function getHeaderActions(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
|||||||
Reference in New Issue
Block a user