<?php

    namespace App\Model\ProductReturn;

    use App\Model\people\CustomerModel;
    use App\User;
    use Illuminate\Database\Eloquent\Model;

    class ProductReturnModel extends Model
    {
        protected $table = "nso007_product_return";
        protected $fillable = [
            'user_id',
            'branch_id',
            'warehouse_id',
            'member_type_id',
            'sale_id',
            'reference_number',
            'customer_id',
            'currency_id',
            'date',
            'note',
            'grand_total',
            'return_amount',
        ];

        public function customer()
        {
            return $this->hasOne(CustomerModel::class,'id','customer_id');
        }
        public function user()
        {
            return $this->hasOne(User::class,'id','user_id');
        }
        public function detail()
        {
            return $this->hasMany(ProductReturnDetailModel::class,'product_return_id','id');
        }
    }
