2024-12-11 12:29:55 +07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
|
|
|
|
|
|
class FormEntertaimentPresentation extends Model
|
|
|
|
|
{
|
2026-06-01 15:01:03 +07:00
|
|
|
use SoftDeletes, \App\Traits\HasAttachments;
|
2024-12-11 12:29:55 +07:00
|
|
|
|
|
|
|
|
protected $table = 'form_entertainment_presentation';
|
|
|
|
|
protected $fillable = [
|
|
|
|
|
'expense_number',
|
|
|
|
|
'user_id',
|
|
|
|
|
'tanggal',
|
|
|
|
|
'jenis',
|
|
|
|
|
'keterangan',
|
|
|
|
|
'total',
|
2025-01-02 17:59:33 +07:00
|
|
|
'approved_total',
|
2024-12-11 12:29:55 +07:00
|
|
|
'name',
|
|
|
|
|
'alamat',
|
|
|
|
|
'nik_or_npwp',
|
2025-01-06 16:00:51 +07:00
|
|
|
'bukti_total',
|
2024-12-11 12:29:55 +07:00
|
|
|
'account_number',
|
|
|
|
|
'status',
|
2025-10-12 20:47:43 +07:00
|
|
|
'remarks',
|
2024-12-23 10:10:09 +07:00
|
|
|
'approved_at',
|
2025-01-16 15:56:22 +07:00
|
|
|
'approved2_at',
|
2024-12-23 10:10:09 +07:00
|
|
|
'approved_by',
|
2025-01-16 15:56:22 +07:00
|
|
|
'approved2_by',
|
2024-12-23 10:10:09 +07:00
|
|
|
'final_approved_at',
|
|
|
|
|
'final_approved_by',
|
2026-06-01 15:01:03 +07:00
|
|
|
// Kolom baru
|
|
|
|
|
'jabatan',
|
|
|
|
|
'nama_perusahaan',
|
|
|
|
|
'jenis_usaha',
|
2024-12-11 12:29:55 +07:00
|
|
|
];
|
2024-12-18 12:56:16 +07:00
|
|
|
|
2026-06-01 15:01:03 +07:00
|
|
|
protected $casts = [
|
|
|
|
|
'created_at' => 'datetime',
|
|
|
|
|
'approved_at' => 'datetime',
|
|
|
|
|
'approved2_at' => 'datetime',
|
|
|
|
|
'final_approved_at' => 'datetime',
|
|
|
|
|
];
|
|
|
|
|
|
2024-12-18 12:56:16 +07:00
|
|
|
public function user()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo('App\Models\Admin');
|
|
|
|
|
}
|
2025-10-13 10:55:21 +07:00
|
|
|
|
2026-06-01 15:01:03 +07:00
|
|
|
// Relasi ke kategori untuk mengambil account_number
|
|
|
|
|
public function kategori()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Kategori::class, 'kategori_id');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function rejector() {
|
|
|
|
|
return $this->belongsTo(User::class, 'rejected_by');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// public function attachments()
|
|
|
|
|
// {
|
|
|
|
|
// // form_id adalah kolom di tabel attachment_forms
|
|
|
|
|
// // table_name digunakan jika satu tabel attachment dipakai banyak form
|
|
|
|
|
// return $this->hasMany(\App\Models\AttachmentForm::class, 'form_id')
|
|
|
|
|
// ->where('table_name', 'form_entertainment_presentation');
|
|
|
|
|
// }
|
2025-10-13 10:55:21 +07:00
|
|
|
|
2024-12-11 12:29:55 +07:00
|
|
|
}
|