You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
872 B
38 lines
872 B
<?php
|
|
|
|
namespace App\Domains\Billing\Models;
|
|
|
|
use Database\Factories\Billing\InvoiceItemFactory;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
|
use Illuminate\Database\Eloquent\Attributes\UseFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
#[Fillable([
|
|
'code',
|
|
'name',
|
|
'quantity',
|
|
'unit_price',
|
|
'gross_amount',
|
|
'discount_amount',
|
|
'net_amount',
|
|
'invoice_id',
|
|
'product_id',
|
|
'chart_of_account_id'
|
|
])]
|
|
#[UseFactory(InvoiceItemFactory::class)]
|
|
class InvoiceItem extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
public function product(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Product::class);
|
|
}
|
|
|
|
public function chartOfAccount(): BelongsTo
|
|
{
|
|
return $this->belongsTo(ChartOfAccount::class);
|
|
}
|
|
}
|
|
|