- Tambahkan kolom 'nomor_tiket' di tabel NOC (index, pembayaran, penyelesaian) - Perbaiki null safety dengan operator ?-> untuk mencegah error - Update model Noc: ganti fillable dengan guarded, tambah relasi debiture & branch - Hapus filter whereDoesntHave untuk memo_penyelesaian (commented out) - Tambah fallback data dari noc->debiture dan noc->branch - Perbaiki sorting dengan ->values() untuk reset array keys - Update view pembayaran.blade.php dengan kolom nomor tiket
58 lines
1.6 KiB
PHP
58 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace Modules\Lpj\Models;
|
|
|
|
use Illuminate\Foundation\Auth\User;
|
|
|
|
class Noc extends Base
|
|
{
|
|
protected $table = 'noc';
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
protected $casts = [
|
|
'nominal_bayar' => 'decimal:2',
|
|
'status_bayar' => 'boolean',
|
|
'status_kurang_bayar' => 'boolean',
|
|
'nominal_kurang_bayar' => 'decimal:2',
|
|
'status_lebih_bayar' => 'boolean',
|
|
'nominal_lebih_bayar' => 'decimal:2',
|
|
'tanggal_pembayaran' => 'date',
|
|
'nominal_penyelesaian' => 'decimal:2',
|
|
'status_penyelesaiaan' => 'boolean',
|
|
'tanggal_penyelesaian' => 'date',
|
|
'memo_penyelesaian_date' => 'date',
|
|
'memo_penyelesaian_payment_date' => 'date',
|
|
'memo_penyelesaian_created_at' => 'datetime',
|
|
'status' => 'boolean',
|
|
'authorized_status' => 'boolean',
|
|
'authorized_at' => 'datetime',
|
|
];
|
|
|
|
// Relationship with Permohonan
|
|
public function permohonan()
|
|
{
|
|
return $this->belongsTo(Permohonan::class, 'permohonan_id');
|
|
}
|
|
|
|
// Relationship with PersetujuanPenawaran
|
|
public function persetujuanPenawaran()
|
|
{
|
|
return $this->belongsTo(PersetujuanPenawaran::class, 'persetujuan_penawaran_id');
|
|
}
|
|
|
|
// Relationship with User (for authorized_by)
|
|
public function authorizedBy()
|
|
{
|
|
return $this->belongsTo(User::class, 'authorized_by');
|
|
}
|
|
|
|
public function debiture(){
|
|
return $this->belongsTo(Debiture::class,'debiture_id');
|
|
}
|
|
|
|
public function branch(){
|
|
return $this->belongsTo(Branch::class,'branch_id');
|
|
}
|
|
}
|