<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class OtherDebt extends Model
{
    protected $fillable = [
        'other_debt_number',
        'document_date',
        'supplier_id',
        'tax',
        'tax_tariff',
        'add_tax',
        'tax_revenue',
        'tax_revenue_tarif',
        'add_tax_revenue',
        'nominal',
        'note',
        'company_code',
        'department_id',
        'created_by',
        'updated_by',
    ];

    public function details()
    {
        return $this->hasMany(OtherDebtDetail::class, 'other_debt_id');
    }

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

    public function department()
    {
        return $this->belongsTo(Department::class, 'department_id');
    }
}
