Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Commit

Permalink
fix: bug in calculation of travel refund
Browse files Browse the repository at this point in the history
The formula didn't take into account that the trip was already calculated as a round trip. Fix is to
remove the "* 2" in the formula
  • Loading branch information
Shomlings committed Aug 20, 2023
1 parent 3591da0 commit 3dbf0be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kaaf/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def calculate_traveling_refund(data):
numberOfTravelers = int(data["numberOfTravelers"])
amount = float(data["amount"].replace(",", "."))

res = (distance * 2 * 0.9 * numberOfTravelers) / 2
res = (distance * 0.9 * numberOfTravelers) / 2
if((amount / 2) < res):
res = amount / 2

Expand Down

0 comments on commit 3dbf0be

Please sign in to comment.