<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class PurchaseReturnItem extends Model
{
    protected $fillable = ['purchase_return_id', 'purchase_item_id', 'product_id', 'unit_id', 'quantity', 'base_quantity', 'unit_cost', 'taxable_amount', 'vat_rate', 'vat_amount', 'line_total'];
    protected $casts = ['quantity' => 'decimal:4', 'base_quantity' => 'decimal:4', 'unit_cost' => 'decimal:4', 'taxable_amount' => 'decimal:2', 'vat_rate' => 'decimal:2', 'vat_amount' => 'decimal:2', 'line_total' => 'decimal:2'];
    public function purchaseReturn() { return $this->belongsTo(PurchaseReturn::class); }
    public function product() { return $this->belongsTo(Product::class); }
}
