Changed logic in production quantity 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:
@@ -8,6 +8,7 @@ use App\Models\Machine;
|
||||
use App\Models\Plant;
|
||||
use App\Models\ProductionQuantity;
|
||||
use App\Models\Shift;
|
||||
use App\Models\Block;
|
||||
use Carbon\Carbon;
|
||||
use Filament\Facades\Filament;
|
||||
use Filament\Forms\Components\Hidden;
|
||||
@@ -1296,6 +1297,8 @@ class ProductionQuantityPage extends Page implements HasForms
|
||||
|
||||
$machine = Machine::where('work_center', $this->mId)->where('plant_id', $this->pId)->first();
|
||||
|
||||
$workCenter = $this->mId;
|
||||
|
||||
if (!$machine) {
|
||||
Notification::make()
|
||||
->title('Unknown Machine')
|
||||
@@ -1350,13 +1353,21 @@ class ProductionQuantityPage extends Page implements HasForms
|
||||
|
||||
$this->iId = null;
|
||||
|
||||
// Get line + block in one shot
|
||||
$line = Line::with('block')->find($lineId);
|
||||
|
||||
$lineName = $line?->name;
|
||||
$blockName = $line?->block?->name;
|
||||
$shiftName = $shift?->name;
|
||||
|
||||
// after success insertion
|
||||
$this->form->fill([
|
||||
|
||||
'plant_id'=> $this->pId,
|
||||
'block_name'=> $this->bId,
|
||||
'shift_id'=> $this->sId,
|
||||
'line_id'=> $this->lId,
|
||||
'machine_id'=> $workCenter,
|
||||
'block_name'=> $blockName,
|
||||
'shift_id'=> $shiftName,
|
||||
'line_id'=> $lineName,
|
||||
'item_id'=> null,
|
||||
//'item_code'=> null,
|
||||
'serial_number'=> null,
|
||||
|
||||
Reference in New Issue
Block a user