<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class ProductionOrder extends Model
{
    protected $table = 'production_order';
    public function fg_product(){
        return $this->belongsTo(Products::class,'product_id')->withTrashed();
    }
    public function production_order_stage(){
        return $this->belongsTo(ProductionOrderStage::class,'production_stage_id');
    }
    public function bill_of_materials(){
        return $this->belongsTo(BOM::class,'bom_id');
    }
    public function finished_goods_store(){
        return $this->belongsTo(Store::class,'fg_store_id')->withTrashed();
    }
    public function raw_material_store(){
        return $this->belongsTo(Store::class,'rm_store_id')->withTrashed();
    }
    public function scrap_store(){
        return $this->belongsTo(Store::class,'scrap_store_id')->withTrashed();
    }

    public function logistic_details(){
        return $this->belongsTo(LogisticDetails::class,'logistic_details_id');
    }
    public function last_modified_by(){
        return $this->belongsTo(User::class,'last_modified_by');
    }
}
