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

This commit is contained in:
dhanabalan
2026-02-16 12:29:02 +05:30
parent 85c7a3e286
commit 9602be624d

View File

@@ -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,