39 lines
849 B
PHP
39 lines
849 B
PHP
<?php
|
|
|
|
namespace Modules\IndustrialEngineering\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class CostScenarioLine extends Model
|
|
{
|
|
protected $table = 'ie_cost_scenario_lines';
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
protected $casts = [
|
|
'quantity' => 'decimal:4',
|
|
'unit_cost' => 'decimal:4',
|
|
'extended_cost' => 'decimal:4',
|
|
];
|
|
|
|
public function costScenario()
|
|
{
|
|
return $this->belongsTo(CostScenario::class, 'cost_scenario_id');
|
|
}
|
|
|
|
public function bomLine()
|
|
{
|
|
return $this->belongsTo(BomLine::class, 'bom_line_id');
|
|
}
|
|
|
|
public function itemMaster()
|
|
{
|
|
return $this->belongsTo(ItemMaster::class, 'item_master_id');
|
|
}
|
|
|
|
public function selectedAlternateItem()
|
|
{
|
|
return $this->belongsTo(ItemMaster::class, 'selected_alternate_item_id');
|
|
}
|
|
}
|