2026-02-04 22:27:18 +09:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models\Finance;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
|
|
|
|
|
|
class Payable extends Model
|
|
|
|
|
{
|
|
|
|
|
use SoftDeletes;
|
|
|
|
|
|
|
|
|
|
protected $table = 'payables';
|
|
|
|
|
|
|
|
|
|
protected $fillable = [
|
|
|
|
|
'tenant_id',
|
|
|
|
|
'vendor_name',
|
|
|
|
|
'invoice_no',
|
|
|
|
|
'issue_date',
|
|
|
|
|
'due_date',
|
|
|
|
|
'category',
|
|
|
|
|
'amount',
|
|
|
|
|
'paid_amount',
|
|
|
|
|
'status',
|
|
|
|
|
'description',
|
|
|
|
|
'memo',
|
2026-02-05 18:08:11 +09:00
|
|
|
'tax_invoice_issued',
|
2026-02-04 22:27:18 +09:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
protected $casts = [
|
|
|
|
|
'amount' => 'integer',
|
|
|
|
|
'paid_amount' => 'integer',
|
|
|
|
|
'issue_date' => 'date',
|
|
|
|
|
'due_date' => 'date',
|
2026-02-05 18:08:11 +09:00
|
|
|
'tax_invoice_issued' => 'boolean',
|
2026-02-04 22:27:18 +09:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
public function scopeForTenant($query, $tenantId)
|
|
|
|
|
{
|
|
|
|
|
return $query->where('tenant_id', $tenantId);
|
|
|
|
|
}
|
|
|
|
|
}
|