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.
46 lines
1.0 KiB
46 lines
1.0 KiB
<?php
|
|
|
|
namespace App\Domains\Billing\Models;
|
|
|
|
use Database\Factories\Billing\DiscountSnapshotFactory;
|
|
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([
|
|
'name',
|
|
'type',
|
|
'value',
|
|
'amount',
|
|
'chart_of_account_id',
|
|
'discount_id',
|
|
'invoice_id',
|
|
'invoice_item_id'
|
|
])]
|
|
#[UseFactory(DiscountSnapshotFactory::class)]
|
|
class DiscountSnapshot extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
public function chartOfAccount(): BelongsTo
|
|
{
|
|
return $this->belongsTo(ChartOfAccount::class);
|
|
}
|
|
|
|
public function discount(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Discount::class);
|
|
}
|
|
|
|
public function invoice(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Invoice::class);
|
|
}
|
|
|
|
public function invoiceItem(): BelongsTo
|
|
{
|
|
return $this->belongsTo(InvoiceItem::class);
|
|
}
|
|
}
|
|
|