<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class MRseaproduct extends Model
{
    protected $table = 'mr_sea_products';
    
    protected $fillable = [
        'material_requisition_sea_id','product_id','qty','unit_id','grade_id','standard_id','unit_price','requested_month','schedule_id','flag_in','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 mrApproval()
    {
        return $this->hasmany('App\MRapprovalproduct','mr_product_id');
    }

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