42 lines
870 B
PHP
42 lines
870 B
PHP
<?php
|
|
|
|
namespace Modules\IndustrialEngineering\Models;
|
|
|
|
use App\Transaction;
|
|
use App\User;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class ProcurementTask extends Model
|
|
{
|
|
use BelongsToBusiness;
|
|
|
|
protected $table = 'ie_procurement_tasks';
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
protected $casts = [
|
|
'due_date' => 'date',
|
|
'completed_at' => 'datetime',
|
|
];
|
|
|
|
public function sourcingCase()
|
|
{
|
|
return $this->belongsTo(SupplierSourcingCase::class, 'sourcing_case_id');
|
|
}
|
|
|
|
public function itemMaster()
|
|
{
|
|
return $this->belongsTo(ItemMaster::class, 'item_master_id');
|
|
}
|
|
|
|
public function purchaseRequisition()
|
|
{
|
|
return $this->belongsTo(Transaction::class, 'purchase_requisition_id');
|
|
}
|
|
|
|
public function assignedTo()
|
|
{
|
|
return $this->belongsTo(User::class, 'assigned_to');
|
|
}
|
|
}
|