ultimatepos/Modules/IndustrialEngineering/Models/CostScenario.php

42 lines
938 B
PHP

<?php
namespace Modules\IndustrialEngineering\Models;
use App\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class CostScenario extends Model
{
use BelongsToBusiness;
use SoftDeletes;
protected $table = 'ie_cost_scenarios';
protected $guarded = ['id'];
protected $casts = [
'total_material_cost' => 'decimal:4',
'total_labor_cost' => 'decimal:4',
'total_machine_cost' => 'decimal:4',
'total_overhead_cost' => 'decimal:4',
'total_cost' => 'decimal:4',
'assumptions' => 'array',
];
public function lineRevision()
{
return $this->belongsTo(LineRevision::class, 'line_revision_id');
}
public function bom()
{
return $this->belongsTo(Bom::class, 'bom_id');
}
public function lines()
{
return $this->hasMany(CostScenarioLine::class, 'cost_scenario_id');
}
}