35 lines
770 B
PHP
35 lines
770 B
PHP
<?php
|
|
|
|
namespace Modules\FinancialManagement\Models;
|
|
|
|
use App\Traits\HasPublicIdentifier;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Modules\ProjectManagement\Models\Project;
|
|
|
|
class RetentionEntry extends Model
|
|
{
|
|
use HasPublicIdentifier;
|
|
|
|
protected $table = 'retention_ledger';
|
|
|
|
protected $fillable = [
|
|
'project_id', 'invoice_id', 'type', 'amount', 'description',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return ['amount' => 'decimal:2'];
|
|
}
|
|
|
|
public function project(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Project::class);
|
|
}
|
|
|
|
public function invoice(): BelongsTo
|
|
{
|
|
return $this->belongsTo(FinancialInvoice::class, 'invoice_id');
|
|
}
|
|
}
|