<?php
namespace App\Models;
class PurchaseInvoice extends BaseModel {
    protected function casts(): array { return ['invoice_date' => 'date', 'due_date' => 'date']; }
    public function supplier() { return $this->belongsTo(Supplier::class); }
    public function purchaseOrder() { return $this->belongsTo(PurchaseOrder::class); }
    public function goodsReceipt() { return $this->belongsTo(GoodsReceipt::class); }
    public function lines() { return $this->hasMany(PurchaseInvoiceLine::class); }
    public function journal() { return $this->belongsTo(Journal::class); }
}
