<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class SupplierRateEntry extends Model
{
    protected $table = 'supplier_rate_entry';
    
    protected $fillable = [
        'supplier_id','product_id','price','cash_price','unit_id','currency_id','cur_date','is_active','supplier_product_id','grade_id', 'standard_id'
    ];
    public $timestamps = true;
    public function supplier()
    {
    	return $this->belongsTo('App\Supplier','supplier_id');
    }

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

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

    
    public function supplierCurrency()
    {
        return $this->belongsTo('App\Currency','currency_type_id');
    }

    public function supplierProduct()
    {
        return $this->belongsTo('App\SupplierProduct','supplier_product_id');
    }

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

    public function standard()
    {
        return $this->belongsTo('App\StandardMaster','standard_id');
    }
}
