<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class POProducts extends Model
{
    protected $table = 'po_products';
    
    public $timestamps = true;
    protected $fillable = [
        'po_id','product_id','unit_id','standard_id','grade_id','qty','unit_price','price','weight','bal_qty'
    ];

    public function poSupplier()
    {
    	return $this->belongsTo('App\PurchaseRequest','po_id');
    }

    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 standard()
    {
        return $this->belongsTo('App\StandardMaster','standard_id');
    }
}
