🧮 Amount Calculation Test

This tool verifies that booking amounts are calculated based on your system settings, not hardcoded values.

Step 1: Check Security Deposit Setting

✅ Security deposit percentage found in settings

Current Value: 0%

Decimal Value: 0

Step 2: Test Calculation with Sample Data

Sample Data:

  • Monthly Price: ₵500.00
  • Duration: 6 months
  • Security Deposit %: 0%

Calculations:

Total Rent = Monthly Price × Duration

Total Rent = ₵500.00 × 6 = ₵3,000.00


Security Deposit = Total Rent × Security Deposit %

Security Deposit = ₵3,000.00 × 0 = ₵0.00


Booking Fee = ₵0.00 (currently 0)


Total Due Now = Security Deposit + Booking Fee

Total Due Now = ₵0.00 + ₵0.00 = ₵0.00

ItemAmount
Total Rent (Full Payment)₵3,000.00
Security Deposit (0%)₵0.00
Booking Fee₵0.00
Total Due Now₵0.00

Step 3: Verify BookingService Implementation

✅ BookingService includes settings_loader.php

✅ BookingService uses getSetting() for security deposit percentage

✅ No hardcoded 0.5 multiplier found in BookingService

Step 4: Test with Different Settings

Here's how the amounts would change with different security deposit percentages:

Security Deposit %Security Deposit AmountTotal Due Now
25%₵750.00₵750.00
30%₵900.00₵900.00
40%₵1,200.00₵1,200.00
50%₵1,500.00₵1,500.00
60%₵1,800.00₵1,800.00
75%₵2,250.00₵2,250.00
100%₵3,000.00₵3,000.00

✅ Summary

All checks passed!

Next Steps:

  1. Clear cache: clear_cache.php
  2. Try creating a booking on the website
  3. Verify the amounts shown in the confirmation modal match what's sent to the API
  4. Check that the payment gateway receives the correct amount

To change the security deposit percentage:

  1. Go to Admin Panel → Settings → Payment Settings
  2. Update "Security Deposit Percentage" field
  3. Save changes
  4. Clear cache and test again