<?php
namespace App\Models;
class DeliveryNote extends BaseModel {
    protected function casts(): array { return ['dn_date' => 'date']; }
    public function customer() { return $this->belongsTo(Customer::class); }
    public function salesOrder() { return $this->belongsTo(SalesOrder::class); }
    public function transporter() { return $this->belongsTo(Transporter::class); }
    public function quarry() { return $this->belongsTo(Quarry::class); }
    public function ticket() { return $this->belongsTo(WeighbridgeTicket::class, 'weighbridge_ticket_id'); }
    public function lines() { return $this->hasMany(DeliveryNoteLine::class); }
}
