start booking with time now
This commit is contained in:
parent
92970d8c63
commit
2b2246f2de
@ -8,7 +8,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = 'de.jottyfan.camporganizer'
|
||||
version = '0.8.8'
|
||||
version = '0.8.9'
|
||||
|
||||
description = """CampOrganizer2"""
|
||||
|
||||
|
@ -435,10 +435,8 @@ public class AdminRepository {
|
||||
jooq.transaction(t -> {
|
||||
LocalDate arriveDate = bean.getArrive();
|
||||
LocalDate departDate = bean.getDepart();
|
||||
LocalDate startBookingDate = bean.getStartBooking();
|
||||
LocalDateTime arrive = arriveDate == null ? null : arriveDate.atStartOfDay();
|
||||
LocalDateTime depart = departDate == null ? null : departDate.atStartOfDay();
|
||||
LocalDateTime startBooking = startBookingDate == null ? null : startBookingDate.atStartOfDay();
|
||||
if (bean.getPk() == null) {
|
||||
InsertValuesStep16<TCampRecord, LocalDateTime, String, LocalDateTime, Integer, Integer, Integer, Boolean, Integer, Integer, String, String, Integer, Integer, Integer, Integer, LocalDateTime> sql = DSL
|
||||
.using(t)
|
||||
@ -462,7 +460,7 @@ public class AdminRepository {
|
||||
T_CAMP.START_BOOKING)
|
||||
.values(arrive, bean.getCountries(), depart, bean.getFkDocument(), bean.getFkLocation(), bean.getFkProfile(),
|
||||
bean.getLockSales() != null ? bean.getLockSales() : false, bean.getMaxAge(), bean.getMinAge(), bean.getName(), bean.getPrice(),
|
||||
bean.getBedsFemale(), bean.getBedsMale(), bean.getBlockedBedsFemale(), bean.getBlockedBedsMale(), startBooking);
|
||||
bean.getBedsFemale(), bean.getBedsMale(), bean.getBlockedBedsFemale(), bean.getBlockedBedsMale(), bean.getStartBooking());
|
||||
// @formatter:on
|
||||
LOGGER.trace(sql);
|
||||
sql.execute();
|
||||
@ -485,7 +483,7 @@ public class AdminRepository {
|
||||
.set(T_CAMP.BEDS_MALE, bean.getBedsMale())
|
||||
.set(T_CAMP.BLOCKED_BEDS_FEMALE, bean.getBlockedBedsFemale())
|
||||
.set(T_CAMP.BLOCKED_BEDS_MALE, bean.getBlockedBedsMale())
|
||||
.set(T_CAMP.START_BOOKING, startBooking)
|
||||
.set(T_CAMP.START_BOOKING, bean.getStartBooking())
|
||||
.where(T_CAMP.PK.eq(bean.getPk()));
|
||||
// @formatter:on
|
||||
LOGGER.trace(sql);
|
||||
|
@ -58,8 +58,8 @@ public class CampBean implements Serializable {
|
||||
@Min(value = 0)
|
||||
private Integer blockedBedsMale;
|
||||
@NotNull
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate startBooking;
|
||||
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
|
||||
private LocalDateTime startBooking;
|
||||
|
||||
/**
|
||||
* generate a camp bean out of r
|
||||
@ -74,7 +74,6 @@ public class CampBean implements Serializable {
|
||||
CampBean bean = new CampBean();
|
||||
LocalDateTime arrive = r.getArrive();
|
||||
LocalDateTime depart = r.getDepart();
|
||||
LocalDateTime startBooking = r.getStartBooking();
|
||||
bean.setArrive(arrive == null ? null : arrive.toLocalDate());
|
||||
bean.setCountries(r.getCountries());
|
||||
bean.setDepart(depart == null ? null : depart.toLocalDate());
|
||||
@ -91,7 +90,7 @@ public class CampBean implements Serializable {
|
||||
bean.setBedsMale(r.getBedsMale());
|
||||
bean.setBlockedBedsFemale(r.getBlockedBedsFemale());
|
||||
bean.setBlockedBedsMale(r.getBlockedBedsMale());
|
||||
bean.setStartBooking(startBooking == null ? null : startBooking.toLocalDate());
|
||||
bean.setStartBooking(r.getStartBooking());
|
||||
return bean;
|
||||
}
|
||||
|
||||
@ -353,14 +352,14 @@ public class CampBean implements Serializable {
|
||||
/**
|
||||
* @return the startBooking
|
||||
*/
|
||||
public LocalDate getStartBooking() {
|
||||
public LocalDateTime getStartBooking() {
|
||||
return startBooking;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param startBooking the startBooking to set
|
||||
*/
|
||||
public void setStartBooking(LocalDate startBooking) {
|
||||
public void setStartBooking(LocalDateTime startBooking) {
|
||||
this.startBooking = startBooking;
|
||||
}
|
||||
}
|
||||
|
@ -120,7 +120,8 @@
|
||||
</div>
|
||||
<label for="startBooking" class="col-sm-2 col-form-label mb-2">Buchungsbeginn</label>
|
||||
<div class="col-sm-4 mb-2">
|
||||
<span class="error" th:each="error : ${#fields.errors('startBooking')}">[[${error}]]<br /></span> <input id="startBooking" type="date" th:field="*{startBooking}"
|
||||
<span class="error" th:each="error : ${#fields.errors('startBooking')}">[[${error}]]<br /></span>
|
||||
<input id="startBooking" type="datetime-local" th:field="*{startBooking}"
|
||||
th:class="${'form-control ' + (#fields.hasErrors('startBooking') ? 'inputerror' : '')}" />
|
||||
</div>
|
||||
<label for="inputBedsFemale" class="col-sm-2 col-form-label mb-2">Anzahl Betten für Mädchen</label>
|
||||
|
@ -47,7 +47,7 @@
|
||||
</div>
|
||||
<div class="row g-5" th:unless="${c.bookingHasStarted}">
|
||||
<div class="col-12 alert alert-info" role="alert">
|
||||
Die Anmeldung wird erst am <span th:text="${#temporals.format(c.startBooking, 'dd.MM.yyyy, um HH:mm')}"></span> Uhr, freigeschaltet.
|
||||
Die Anmeldung wird erst am <span th:text="${#temporals.format(c.startBooking, 'dd.MM.yyyy, HH:mm')}"></span> Uhr, freigeschaltet.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user