<?php

namespace Modules\Billing\Models;

use Illuminate\Database\Eloquent\Model;
use Modules\Billing\Models\Traits\HasBilling;
use Modules\Inventory\Models\Traits\HasStock;
use Modules\Inventory\Models\Traits\HasStockBatch;

class BillingItem extends Model
{
    use HasBilling,
        HasStock,
        HasStockBatch;

    /**
     * The attributes that are mass assignable.
     */
    protected $fillable = [
        'billing_id',
        'unit_id',
        'stock_id',
        'stock_batch_id',
        'qty',
        'unit_price',
        'vat_price_type',
        'subtotal',
        'discount_type',
        'discount_amount',
        'subsidy_type',
        'subsidy_value',
        'subsidy_amount',
        'taxable_amount',
        'vat_type',
        'vat_amount',
        'net_amount',
        'total',
    ];

    public function itemable()
    {
        return $this->morphTo();
    }

}
