<?php

namespace App\Models;

use App\Models\Concerns\BranchScoped;

use Illuminate\Database\Eloquent\Model;

class Receipt extends Model
{
    use BranchScoped;
    protected $fillable = ['branch_id', 'receipt_no', 'receipt_date', 'customer_id', 'amount', 'payment_method', 'reference', 'notes', 'journal_entry_id', 'created_by', 'status'];
    protected $casts = ['receipt_date' => 'date', 'amount' => 'decimal:2'];
    public function customer() { return $this->belongsTo(Customer::class); }
    public function allocations() { return $this->hasMany(ReceiptAllocation::class); }
    public function branch() { return $this->belongsTo(Branch::class); }
}
