<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class ConsignmentProduct extends Model
{
    protected $table = 'consignment_products';
    
    protected $fillable = [
        'po_id','po_consignment_id','product_id','tot_qty','supplied_qty','unit_id','grade_id'
    ];

   public $timestamps = false;
   
    public function purchaseOrder()
    {
    	return $this->belongsTo('App\PurchaseOrder','po_id');
    }

    public function consignment()
    {
    	return $this->belongsTo('App\POconsignment','po_consignment_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');
    }

}
