Added operator_id column

This commit is contained in:
dhanabalan
2025-04-23 20:41:05 +05:30
parent 4cc0366fba
commit 3ac8c3c613
3 changed files with 7 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ class ProductionLineStop extends Model
"to_datetime",
"stop_hour",
"stop_min",
"operator_id",
];
public function plant(): BelongsTo

View File

@@ -17,6 +17,7 @@ class ProductionPlan extends Model
"line_id",
"plan_quantity",
"production_quantity",
"operator_id",
];
public function plant(): BelongsTo

View File

@@ -3,6 +3,7 @@
namespace App\Models;
use Carbon\Carbon;
use Filament\Facades\Filament;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
@@ -20,6 +21,7 @@ class ProductionQuantity extends Model
"item_id",
"serial_number",
"production_order",
"operator_id",
];
public function plant(): BelongsTo
@@ -69,10 +71,13 @@ class ProductionQuantity extends Model
->first();
}
$operatorName = Filament::auth()->user()->name;
if ($productionPlan) {
$productionPlan->update([
'production_quantity' => $productionPlan->production_quantity + 1,
'updated_at' => now(),
'operator_id'=> $operatorName,
]);
}
});