Browse Source

Scheduler refund amount code disabled and right click disabled and coniditon added in 3rd step of hall booking form

master
Praveenkumartvmalai 1 year ago
parent
commit
267e7fe25e
  1. 24
      src/main/java/com/gcc/communityHall/paymentService/scheduler/PaymentStatusScheduler.java
  2. 12
      src/main/java/com/gcc/communityHall/service/Impl/BookingServiceImpl.java
  3. 4174
      src/main/resources/templates/user/hallbookingform.html
  4. 4367
      src/main/resources/templates/user/viewhistory.html

24
src/main/java/com/gcc/communityHall/paymentService/scheduler/PaymentStatusScheduler.java

@ -328,21 +328,21 @@ public class PaymentStatusScheduler {
}
//need to be commented
@Transactional
public void intiateRefund(int bookingId, int userId) throws Exception {
List<BookingCalendar> bc = calendarService.getCalendarByBookingId(bookingId);
if (bc != null && bc.isEmpty()) {
String s = paymentGatewayServiceImpl.refundTheAmount(bookingId, userId);
if (s.equals("Refunded")) {
bookingService.updateRefundStatus(bookingId, BookingDetails.RefundStatus.COMPLETED);
}
// @Transactional
// public void intiateRefund(int bookingId, int userId) throws Exception {
// List<BookingCalendar> bc = calendarService.getCalendarByBookingId(bookingId);
// if (bc != null && bc.isEmpty()) {
// String s = paymentGatewayServiceImpl.refundTheAmount(bookingId, userId);
// if (s.equals("Refunded")) {
// bookingService.updateRefundStatus(bookingId, BookingDetails.RefundStatus.COMPLETED);
// }
} else {
bookingService.updateRefundStatus(bookingId, BookingDetails.RefundStatus.FAILURE);
}
// } else {
// bookingService.updateRefundStatus(bookingId, BookingDetails.RefundStatus.FAILURE);
// }
}
// }
}

12
src/main/java/com/gcc/communityHall/service/Impl/BookingServiceImpl.java

@ -626,6 +626,7 @@ public class BookingServiceImpl implements BookingService {
@Override
public Map<String, Object> saveBookingDetails(Map<String, Object> formData) {
Map<String, Object> hs = new HashMap<>();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
BookingDetails bookingDetails = null;
Integer userId = userSession.getUserId();
@ -659,6 +660,16 @@ public class BookingServiceImpl implements BookingService {
bookingDetails.setHallDetails(hallDetails);
String startDate = formData.get("startDate").toString();
LocalDate startD = LocalDate.parse(startDate, formatter);
LocalDate today = LocalDate.now();
LocalDate sixMonthsLater = today.plusMonths(6);
if (startD.isBefore(today)) {
return Collections.singletonMap("status", "pastdate");
} else if (startD.isAfter(sixMonthsLater)) {
return Collections.singletonMap("status", "futuredate");
}
String endDate = formData.get("endDate").toString();
String relation = formData.get("relation").toString();
double days = Double.parseDouble(formData.get("days").toString());
@ -852,7 +863,6 @@ public class BookingServiceImpl implements BookingService {
int i = 0;
String startDateStr = bookingDetails.getStartDate();
String endDateStr = bookingDetails.getEndDate();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDate start = LocalDate.parse(startDateStr, formatter);
LocalDate end = LocalDate.parse(endDateStr, formatter);
int hallId = bookingDetails.getHallDetails().getHallId();

4174
src/main/resources/templates/user/hallbookingform.html
File diff suppressed because it is too large
View File

4367
src/main/resources/templates/user/viewhistory.html
File diff suppressed because it is too large
View File

Loading…
Cancel
Save