[IMP]pms: includes board services in cancelation penalty #336
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces enhancements to the penalty calculation logic in the
pms_reservationmodel, specifically targeting board services. The changes ensure penalties account for board services consumed before or after the reservation dates, improving accuracy in penalty computations.Enhancements to penalty calculation:
pms/models/pms_reservation.py: Added a new helper method_get_board_services_penalty_amountto calculate the penalty amount for board services based on their consumption dates relative to the reservation dates. Only services consumed "before" or "after" the reservation dates are considered, excluding those consumed on the first or last day.pms/models/pms_reservation.py: Updated the_check_cancel_penaltymethod to include the penalty amount from board services by invoking the_get_board_services_penalty_amountmethod whenservice_idsare present.