<?php
namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class PurchaseItem extends Model
{
    protected $fillable = [
        'purchase_id', 'product_id', 'product_code', 'product_name', 'qty',
        'unit_cost', 'discount', 'line_total', 'barcode_entered', 'batch_no', 'expiry_date', 'landed_unit_cost',
        'entered_unit', 'unit_factor', 'qty_in_base'
    ];

    public function purchase()
    {
        return $this->belongsTo(Purchase::class);
    }

    public function product()
    {
        return $this->belongsTo(Product::class);
    }
}
