feat: auto-fill vehicle booking end date (default 90 days, configurable)
This commit is contained in:
@@ -231,7 +231,8 @@ func ReadConfig() (*viper.Viper, error) {
|
||||
},
|
||||
},
|
||||
"vehicles": map[string]any{
|
||||
"enabled": true,
|
||||
"enabled": true,
|
||||
"default_booking_duration_days": 90,
|
||||
},
|
||||
"vehicles_management": map[string]any{
|
||||
"enabled": true,
|
||||
|
||||
@@ -26,10 +26,13 @@ func selectDocumentsDefaults(beneficiarydocuments []filestorage.FileInfo, mandat
|
||||
func (renderer *Renderer) VehiclesSearch(w http.ResponseWriter, r *http.Request, beneficiaries []mobilityaccountsstorage.Account, searched bool, vehicles []fleetsstorage.Vehicle, beneficiary any, startdate any, enddate any, mandatory_documents []string, file_types_map map[string]string, beneficiarydocuments []filestorage.FileInfo, selected_type string, automatic bool, vehicles_types []string, admingroups map[string]any) {
|
||||
files := renderer.ThemeConfig.GetStringSlice("views.vehicles.search.files")
|
||||
state := NewState(r, renderer.ThemeConfig, vehiclesMenu)
|
||||
defaultBookingDurationDays := renderer.GlobalConfig.GetInt("modules.vehicles.default_booking_duration_days")
|
||||
|
||||
viewstate := map[string]any{
|
||||
"beneficiaries": beneficiaries,
|
||||
"searched": searched,
|
||||
"vehicles_types": vehicles_types,
|
||||
"beneficiaries": beneficiaries,
|
||||
"searched": searched,
|
||||
"vehicles_types": vehicles_types,
|
||||
"default_booking_duration_days": defaultBookingDurationDays,
|
||||
}
|
||||
|
||||
if searched {
|
||||
|
||||
Reference in New Issue
Block a user