35 lines
803 B
PHP
35 lines
803 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class ClientInvoicePayment extends Model
|
|
{
|
|
public $timestamps = false;
|
|
|
|
protected $fillable = [
|
|
'client_invoice_id',
|
|
'payment_no',
|
|
'payment_total_amount',
|
|
'payment_nett_amount',
|
|
];
|
|
|
|
protected $casts = [
|
|
'payment_total_amount' => 'decimal:6',
|
|
'payment_nett_amount' => 'decimal:6',
|
|
];
|
|
|
|
public function invoice(): BelongsTo
|
|
{
|
|
return $this->belongsTo(ClientInvoice::class, 'client_invoice_id');
|
|
}
|
|
|
|
public function items(): HasMany
|
|
{
|
|
return $this->hasMany(ClientInvoicePaymentItem::class, 'client_invoice_payment_id');
|
|
}
|
|
}
|