<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class MRseaproductschedule extends Model
{
    protected $table = 'mr_sea_product_schedules';
    
    protected $fillable = [
        'material_requisition_sea_id','mr_sea_product_id','product_id','qty','unit_id','grade_id','standard_id','unit_price','scheduled_date','schedule_id','deleted_at'
    ];

    public $timestamps = false;

    public function product()
    {
    	return $this->belongsTo('App\Product','product_id');
    }

    public function unit()
    {
    	return $this->belongsTo('App\UnitMeasurement','unit_id');
    }

    public function grade()
    {
    	return $this->belongsTo('App\GradeMaster','grade_id');
    }

    public function materialRequest()
    {
    	return $this->belongsTo('App\MaterialRequisitionSea','material_requisition_sea_id');
    }

    public function materialRequestSeaProduct()
    {
        return $this->belongsTo('App\MRseaproduct','mr_sea_product_id');
    }

    public function mrApproval()
    {
        return $this->hasmany('App\MRapprovalproduct','mr_product_id');
    }

    public function commonSchedule()
    {
        return $this->belongsTo('App\Common','schedule_id');
    }
}
