<?php

namespace App\Models;

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

class Transaction extends Model
{
    use HasFactory;

    protected $table = 'transactions';

    protected $fillable = [
        'motion',
        'type',
        'date',
        'total',
        'igv',
        'subtotal',
    ];

    public function buyReceipts()
    {
        return $this->hasMany(BuyReceipt::class, 'id_transaction');
    }
    public function salesGuides()
    {
        return $this->hasMany(SalesGuide::class, 'id_transaction');
    }
}
