Fix: customer not able to upload bank in slip, due to $amountOutstanding including the floating balance

This commit is contained in:
Edmond Lang
2025-07-15 14:24:03 +08:00
parent 1aee476649
commit f313d975dd
2 changed files with 4 additions and 1 deletions
@@ -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);
}
}
@@ -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);