diff --git a/app/Models/OLDLMS/Appointment.php b/app/Models/OLDLMS/Appointment.php index 32801ab7..ce18e5f4 100644 --- a/app/Models/OLDLMS/Appointment.php +++ b/app/Models/OLDLMS/Appointment.php @@ -119,7 +119,7 @@ class Appointment extends Model { return Attribute::make( get: function() { - $consulPrice = ((float) $this->detail->sPaymentDetails['gross_amount'] ?? 0) - $this->nAdminFee; + $consulPrice = ((float) ($this->detail->sPaymentDetails['gross_amount'] ?? null) ?? 0) - $this->nAdminFee; if ( $this->nIDJenisBooking == 3 ) { // Telekonsultasi Sekarang return $consulPrice * (100-$this->healthCare->commission->nCommissionATC) / 100; } @@ -137,7 +137,7 @@ class Appointment extends Model { return Attribute::make( get: function() { - $consulPrice = ((float) $this->detail->sPaymentDetails['gross_amount'] ?? 0) - $this->nAdminFee; + $consulPrice = ((float) ($this->detail->sPaymentDetails['gross_amount'] ?? null) ?? 0) - $this->nAdminFee; if ( $this->nIDJenisBooking == 3 ) { // Telekonsultasi Sekarang return $consulPrice * ($this->healthCare->commission->nCommissionATC) / 100; }