[WIP] Add Linksehat Payment Report
This commit is contained in:
@@ -31,6 +31,20 @@ class Appointment extends Model
|
||||
5 => 'Voucher',
|
||||
];
|
||||
|
||||
public $sPaymentStatusName = [
|
||||
'settlement' => 'Diterima',
|
||||
'expired' => 'Kadaluarsa',
|
||||
'capture' => 'Captured',
|
||||
'deny' => 'Ditolak',
|
||||
'pending' => 'Menunggu Pembayaran',
|
||||
'cancel' => 'Dibatalkan',
|
||||
'refund' => 'Dikembalikan',
|
||||
'expire' => 'Kadaluarsa',
|
||||
'cod' => 'COD',
|
||||
'FAILED' => 'Gagal',
|
||||
'COMPLETED' => 'Complete',
|
||||
];
|
||||
|
||||
public $nIDJenisBookingNames = [
|
||||
1 => 'Rawat Jalan',
|
||||
2 => 'Telekonsultasi',
|
||||
@@ -60,7 +74,8 @@ class Appointment extends Model
|
||||
protected $appends = [
|
||||
'status_name',
|
||||
'payment_method',
|
||||
'type'
|
||||
'type',
|
||||
'payment_status'
|
||||
];
|
||||
|
||||
protected function statusName(): Attribute
|
||||
@@ -71,6 +86,16 @@ class Appointment extends Model
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
protected function paymentStatus(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: function ($value) {
|
||||
return $this->sPaymentStatusName[$this->sPaymentStatus] ?? $this->sPaymentStatus;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
protected function paymentMethod(): Attribute
|
||||
{
|
||||
@@ -96,6 +121,11 @@ class Appointment extends Model
|
||||
return $this->hasOne(AppointmentDetail::class, 'nIDAppointment', 'nID');
|
||||
}
|
||||
|
||||
public function detail()
|
||||
{
|
||||
return $this->hasOne(AppointmentDetail::class, 'nIDAppointment', 'nID');
|
||||
}
|
||||
|
||||
public function doctor()
|
||||
{
|
||||
return $this->belongsTo(Dokter::class, 'nIDDokter', 'nID');
|
||||
|
||||
Reference in New Issue
Block a user