fix bug cant approve the refund because booking amount cant be updated, error - Booking Amount cannot be less than xxxxx

This commit is contained in:
edmondlang
2024-04-16 22:34:41 +08:00
parent aeb0be11bf
commit 69e9328e74
2 changed files with 2 additions and 2 deletions
@@ -81,7 +81,7 @@ class UpdateBookingAmountLogic extends AbstractControllerLogic
$minimum_amount = $booking->fix_amount - $this->calculatesBookingOutstanding->execute($booking);
if ((float)$input_amount < $minimum_amount) {
if (((float)$input_amount + 0.01) < (float)$minimum_amount) {
throw new MalformedRequestException('Booking Amount cannot be less than '. $minimum_amount .'.');
}
@@ -114,7 +114,7 @@ class UpdateRefundTransactionStatusLogic extends AbstractControllerLogic
$this->updatesTransactionStatus->execute($po_transaction, (float) number_format($po_transaction->amount, 2, '.', '') === (float) number_format((float)$booking->fix_amount - $refundAmount, 2, '.', '') ? ApprovalStatus::PENDING_VERIFICATION : ApprovalStatus::PENDING_SUBMISSION);
}
$request['fix_amount'] = $paidAmount;
$request['fix_amount'] = $booking->fix_amount - $refundAmount;
$request->route()->setParameter('id', $booking->id);
$this->updateBookingAmountLogic->execute($request);
}