ultimatepos/Modules/IndustrialEngineering/Models/SupplierSourcingCase.php

48 lines
1.0 KiB
PHP

<?php
namespace Modules\IndustrialEngineering\Models;
use App\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class SupplierSourcingCase extends Model
{
use BelongsToBusiness;
use SoftDeletes;
protected $table = 'ie_supplier_sourcing_cases';
protected $guarded = ['id'];
protected $casts = [
'required_quantity' => 'decimal:4',
'needed_by' => 'date',
];
public function itemMaster()
{
return $this->belongsTo(ItemMaster::class, 'item_master_id');
}
public function installedAsset()
{
return $this->belongsTo(CustomerInstalledAsset::class, 'installed_asset_id');
}
public function quotes()
{
return $this->hasMany(VendorQuoteComparison::class, 'sourcing_case_id');
}
public function procurementTasks()
{
return $this->hasMany(ProcurementTask::class, 'sourcing_case_id');
}
public function assignedTo()
{
return $this->belongsTo(User::class, 'assigned_to');
}
}