export excel livechat

This commit is contained in:
Muhammad Fajar
2023-09-04 11:07:12 +07:00
parent e0f3a38be0
commit 510269c9ee
4 changed files with 158 additions and 86 deletions

View File

@@ -70,7 +70,7 @@ class Appointment extends Model
'dUpdateOn',
'dDeleteOn',
];
protected $appends = [
'status_name',
'payment_method',
@@ -86,7 +86,7 @@ class Appointment extends Model
},
);
}
protected function paymentStatus(): Attribute
{
@@ -109,7 +109,7 @@ class Appointment extends Model
protected function type(): Attribute
{
return Attribute::make(
get: function($value) {
get: function ($value) {
return $this->nIDJenisBookingNames[$this->nIDJenisBooking] ?? '-';
}
);
@@ -118,16 +118,14 @@ class Appointment extends Model
protected function shareKonsultasi(): Attribute
{
return Attribute::make(
get: function() {
get: function () {
$consulPrice = ((float) $this->detail->sPaymentDetails['gross_amount'] ?? 0) - $this->nAdminFee;
if ( $this->nIDJenisBooking == 3 ) { // Telekonsultasi Sekarang
return $consulPrice * (100-$this->healthCare->commission->nCommissionATC) / 100;
}
else if ( $this->nIDJenisBooking == 2 ) { // Telekonsultasi
return $consulPrice * (100-$this->healthCare->commission->nCommissionTC) / 100;
}
else { // Walk In
return $consulPrice * (100-$this->healthCare->commission->nCommission) / 100;
if ($this->nIDJenisBooking == 3) { // Telekonsultasi Sekarang
return $consulPrice * (100 - $this->healthCare->commission->nCommissionATC) / 100;
} else if ($this->nIDJenisBooking == 2) { // Telekonsultasi
return $consulPrice * (100 - $this->healthCare->commission->nCommissionTC) / 100;
} else { // Walk In
return $consulPrice * (100 - $this->healthCare->commission->nCommission) / 100;
}
}
);
@@ -136,16 +134,14 @@ class Appointment extends Model
protected function shareKomisi(): Attribute
{
return Attribute::make(
get: function() {
get: function () {
$consulPrice = ((float) $this->detail->sPaymentDetails['gross_amount'] ?? 0) - $this->nAdminFee;
if ( $this->nIDJenisBooking == 3 ) { // Telekonsultasi Sekarang
return $consulPrice * ($this->healthCare->commission->nCommissionATC) / 100;
}
else if ( $this->nIDJenisBooking == 2 ) { // Telekonsultasi
if ($this->nIDJenisBooking == 3) { // Telekonsultasi Sekarang
return $consulPrice * ($this->healthCare->commission->nCommissionATC) / 100;
} else if ($this->nIDJenisBooking == 2) { // Telekonsultasi
return $consulPrice * ($this->healthCare->commission->nCommissionTC) / 100;
}
else { // Walk In
return $consulPrice * ($this->healthCare->commission->nCommission) / 100;
} else { // Walk In
return $consulPrice * ($this->healthCare->commission->nCommission) / 100;
}
}
);