<?php

namespace App\Models;

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

class Expense extends Model
{
    protected $table = 'expense'; 
    protected $fillable = [
        'grn_no', 'payment_method', 'payment_amount', 'cheque_no', 
        'credit_payment_due_on', 'credit_payment_due_date'
    ];

    public function purchase()
    {
        return $this->belongsTo(Purchase::class, 'grn_no', 'grn_no');
    }

    public function issuedCheque()
    {
        return $this->hasOne(IssuedCheque::class);
    }
}
