42 lines
846 B
PHP
42 lines
846 B
PHP
<?php
|
|
|
|
namespace Modules\IndustrialEngineering\Models;
|
|
|
|
use App\User;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class MrpRun extends Model
|
|
{
|
|
use BelongsToBusiness;
|
|
|
|
protected $table = 'ie_mrp_runs';
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
protected $casts = [
|
|
'planned_quantity' => 'decimal:4',
|
|
'shortage_analysis' => 'array',
|
|
'purchase_order_ids' => 'array',
|
|
];
|
|
|
|
public function lineRevision()
|
|
{
|
|
return $this->belongsTo(LineRevision::class, 'line_revision_id');
|
|
}
|
|
|
|
public function bom()
|
|
{
|
|
return $this->belongsTo(Bom::class, 'bom_id');
|
|
}
|
|
|
|
public function workOrder()
|
|
{
|
|
return $this->belongsTo(ManufacturingWorkOrder::class, 'work_order_id');
|
|
}
|
|
|
|
public function createdBy()
|
|
{
|
|
return $this->belongsTo(User::class, 'created_by');
|
|
}
|
|
}
|