[WIP] Add Linksehat Payment Report

This commit is contained in:
R
2023-04-06 05:03:38 +07:00
parent 59e7394d13
commit cca2310f54
20 changed files with 1786 additions and 46 deletions

View File

@@ -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');