<?php

namespace App;

use App\Traits\ModelTimeFormat;
use Illuminate\Database\Eloquent\Model;

use App\Traits\ModelLogChanging;

class ProcurementCheckSheet extends Model
{
    use ModelLogChanging;
    use ModelTimeFormat;

    const status=[
        0 => "未出账",
        1 => "待出账",
        2 => "已出账",
        3 => "已完结",
    ];
    protected $fillable=[
        'procurement_delivery_id','invoice_number', 'account_payable', 'auditor','status','created_at'
    ];
    public function procurementDelivery(){
        return $this->belongsTo('App\ProcurementDeliverie','procurement_delivery_id','id');
    }

    public function scopeFilter($query, $filters)
    {
        return $filters->apply($query);
    }
}
