We have added two new settings to be able to choose the calendar country depending on where the application is used geographically. The setting variable is called : JOANIE_CONTRACT_COUNTRY_CALENDAR. To get the instance of calendar set in settings, it can be retrieved by using the method : get_country_calendar()
The other setting allows (JOANIE_CONTRACT_COUNTRY_CALENDAR) to set the period of days a consumer has the right to withdraw from a contract.
The calendar was set to France and the withdrawal period of days (16 days for French context) was hard coded into the method :
Give more flexibility to set different values for the chosen calendar and the period of days for withdrawal when signing a contract (which may change depending the country's regulation).
# settings.py
# The full list of countries available for use:
# https://github.com/workalendar/workalendar#available-calendars
JOANIE_CONTRACT_COUNTRY_CALENDAR = values.Value(
"workalendar.europe.France",
environ_name="JOANIE_CONTRACT_COUNTRY_CALENDAR",
environ_prefix=None,
)
# Number of days for the withdrawal period as required by your country's contract legislation
JOANIE_CONTRACT_COUNTRY_CALENDAR = values.PositiveIntegerValue(
16,
environ_name="JOANIE_CONTRACT_WITHDRAWAL_PERIOD_DAYS",
environ_prefix=None,
)
[x] add 2 setting variables to configure calendar to use and period of withdrawal and add a method to get the an instantiated calendar object through the method get_country_calendar().
This PR will solve the issue
Purpose
We have added two new settings to be able to choose the calendar country depending on where the application is used geographically. The setting variable is called :
JOANIE_CONTRACT_COUNTRY_CALENDAR
. To get the instance of calendar set in settings, it can be retrieved by using the method :get_country_calendar()
The other setting allows (
JOANIE_CONTRACT_COUNTRY_CALENDAR
) to set the period of days a consumer has the right to withdraw from a contract.The calendar was set to France and the withdrawal period of days (16 days for French context) was hard coded into the method :
Proposal
Give more flexibility to set different values for the chosen calendar and the period of days for withdrawal when signing a contract (which may change depending the country's regulation).
get_country_calendar()
.