diff --git a/app/Classes/Modules/Bookings/Services/CalculatesBookingOutstanding.php b/app/Classes/Modules/Bookings/Services/CalculatesBookingOutstanding.php index f3a70a6a..31a9ebd3 100644 --- a/app/Classes/Modules/Bookings/Services/CalculatesBookingOutstanding.php +++ b/app/Classes/Modules/Bookings/Services/CalculatesBookingOutstanding.php @@ -34,4 +34,7 @@ class CalculatesBookingOutstanding return $booking->fix_amount - $this->calculatesBookingFloatingAmount->execute($booking, $booking->fix_currency_id) - $this->calculatesBookingPayableAmount->execute($booking, $booking->fix_currency_id) + $this->calculatesBookingRefundAmount->execute($booking, $booking->fix_currency_id); } + public function executeWithoutFloatingAmount(Booking $booking){ + return $booking->fix_amount - $this->calculatesBookingPayableAmount->execute($booking, $booking->fix_currency_id) + $this->calculatesBookingRefundAmount->execute($booking, $booking->fix_currency_id); + } } \ No newline at end of file diff --git a/app/Classes/Modules/Transactions/Services/CalculatesTransactionExpiryDateTime.php b/app/Classes/Modules/Transactions/Services/CalculatesTransactionExpiryDateTime.php index 529992cc..033da71f 100644 --- a/app/Classes/Modules/Transactions/Services/CalculatesTransactionExpiryDateTime.php +++ b/app/Classes/Modules/Transactions/Services/CalculatesTransactionExpiryDateTime.php @@ -113,7 +113,7 @@ class CalculatesTransactionExpiryDateTime private function getNewBookingExpiresAt2($booking, $paymentAttemptLimit){ $newBookingExpiresAt = null; - $amountOutstanding = $this->calculatesBookingOutstanding->execute($booking); + $amountOutstanding = $this->calculatesBookingOutstanding->executeWithoutFloatingAmount($booking); $amountPaid = $this->calculatesBookingPaidAmount->execute($booking); if($amountPaid > 0.01 && $amountOutstanding > 0){ $newBookingExpiresAt = Carbon::now()->addMinutes($paymentAttemptLimit);