<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class SupplierJournal extends Model
{
    use HasFactory;

    protected $table = 'supplier_journals';
    protected $fillable = [
        'date',
        'supplier_account_id',
        'narration',
        'reference',
        'currency_id',
        'tr_code',
        'amount'
    ];

    public function supplier()
    {
        return $this->belongsTo(SupplierAccount::class, 'supplier_account_id');
    }

    public function currency()
    {
        return $this->belongsTo(Currency::class);
    }
}