Browse Source

Counter Report added for Admin login

master
kanimozhi 1 year ago
parent
commit
10f911d6a5
  1. 17
      src/main/java/com/gcc/communityHall/controller/Admincontroller.java
  2. 900
      src/main/java/com/gcc/communityHall/controller/OfficerController.java
  3. 4
      src/main/java/com/gcc/communityHall/controller/UserAPIController.java
  4. 4
      src/main/java/com/gcc/communityHall/paymentService/scheduler/PaymentStatusScheduler.java
  5. 28
      src/main/java/com/gcc/communityHall/repository/BookingDetailsRepository.java
  6. 7
      src/main/java/com/gcc/communityHall/service/BookingService.java
  7. 18
      src/main/java/com/gcc/communityHall/service/Impl/BookingServiceImpl.java
  8. 159
      src/main/java/com/gcc/communityHall/service/Impl/UserServiceImpl.java
  9. 494
      src/main/resources/templates/admin/reports.html
  10. 3
      src/main/resources/templates/fragments/Details.html
  11. 4
      src/main/resources/templates/fragments/logRegiOtpScript.html
  12. 4
      src/main/resources/templates/fragments/menuOfficer.html
  13. 18
      src/main/resources/templates/headquarters/refund-failedlist.html
  14. 31
      src/main/resources/templates/headquarters/reports.html
  15. 6
      src/main/resources/templates/user/dashboard.html
  16. 11
      src/main/resources/templates/user/viewhistory.html

17
src/main/java/com/gcc/communityHall/controller/Admincontroller.java

@ -13,6 +13,8 @@ import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.gcc.communityHall.others.AppConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
@ -564,7 +566,7 @@ public class Admincontroller {
@RequestParam(name = "division1", required = false, defaultValue = "ALL") String division,
@RequestParam(name = "hall1", required = false, defaultValue = "1000") Integer hallid,
@RequestParam(name = "basedon", required = false) String basedon,
@RequestParam(name = "bookingId", required = false) Long bookingId, HttpSession session) {
@RequestParam(name = "bookingId", required = false) Long bookingId, HttpSession session) throws JsonProcessingException {
String adminname = (String) session.getAttribute("usertype");
if (adminname != null) {
long mobileno = (long) session.getAttribute("mobileno");
@ -619,6 +621,19 @@ public class Admincontroller {
model.addAttribute("totalBookings", totalBookings);
List<Object[]> hallbookingList = handleBookingHallDetailsReportRequest(request, fromDate, toDate, filterby, zone, division, hallid);
List<Object[]> counterBookingList = request.equals("9") ? bookingService.getCounterWiseBookingCount(fromDate, toDate) : new ArrayList<>();
model.addAttribute("counterBookingList",counterBookingList);
System.out.println("counterBookingList.."+counterBookingList);
List<Object[]> hallBookingByCounter = bookingService.getHallWiseBookingDetails(fromDate, toDate);
// Convert to JSON for JS usage
String hallBookingJson = new ObjectMapper().writeValueAsString(hallBookingByCounter);
model.addAttribute("hallBookingJson", hallBookingJson);
List<Object[]> hallBookingDetails = bookingService.getBookingDetailsForAllHalls(fromDate, toDate);
String hallBookingDetailsJson = new ObjectMapper().writeValueAsString(hallBookingDetails);
model.addAttribute("hallBookingDetailsJson", hallBookingDetailsJson);
model.addAttribute("filterby", filterby);
model.addAttribute("users", userList);

900
src/main/java/com/gcc/communityHall/controller/OfficerController.java

@ -35,504 +35,472 @@ import jakarta.servlet.http.HttpSession;
@Controller
@RequestMapping("/communityhall/officer")
public class OfficerController {
@Autowired
@Autowired
private AppConfig appConfig;
@Autowired
private BookingDetailsRepository bookingDetailsRepository;
@Autowired
private PaymentsRepository paymentsRepository;
@Autowired
private UsersRepository usersRepository;
@Autowired
private SettlementRepository settlementRepository;
@Autowired
private CounterRefundListRepository counterRefundListRepository;
@Autowired
private BookingService bookingService;
@Autowired
private HallDetailsRepository hallDetailsRepository;
@Autowired
private HallDetailService hallDetailsService;
@GetMapping("/login")
public String viewLoginPage(Model model) {
String msg="Login to Your Account";
model.addAttribute("errortxt",msg);
return "officiallogin";
}
@GetMapping("/officer-dashboard")
public String viewDashboard(Model model,HttpSession session) {
String officername = (String) session.getAttribute("usertype");
if(officername!=null) {
String zone = (String) session.getAttribute("zone");
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("zone", zone);
return "officer/officer-dashboard";
}else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
@Autowired
private BookingDetailsRepository bookingDetailsRepository;
@Autowired
private PaymentsRepository paymentsRepository;
@Autowired
private UsersRepository usersRepository;
@Autowired
private SettlementRepository settlementRepository;
@Autowired
private CounterRefundListRepository counterRefundListRepository;
@Autowired
private BookingService bookingService;
@Autowired
private HallDetailsRepository hallDetailsRepository;
@Autowired
private HallDetailService hallDetailsService;
@GetMapping("/login")
public String viewLoginPage(Model model) {
String msg = "Login to Your Account";
model.addAttribute("errortxt", msg);
return "officiallogin";
}
@GetMapping("/officer-dashboard")
public String viewDashboard(Model model, HttpSession session) {
String officername = (String) session.getAttribute("usertype");
if (officername != null) {
String zone = (String) session.getAttribute("zone");
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("zone", zone);
return "officer/officer-dashboard";
} else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
@GetMapping("/booking-pending")
public String viewhall(Model model,HttpSession session) {
String officername = (String) session.getAttribute("usertype");
if(officername!=null) {
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("title", "pending bookings");
model.addAttribute("baseURL", appConfig.getBaseUrl());
String zone = (String) session.getAttribute("zone");
model.addAttribute("zone", zone);
List<BookingDetails> pendingbooking=bookingDetailsRepository.getPendingOrPaymentFailureBookings(zone);
model.addAttribute("pendingbooking",pendingbooking);
return "officer/booking-pending";
}else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
public String viewhall(Model model, HttpSession session) {
String officername = (String) session.getAttribute("usertype");
if (officername != null) {
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("title", "pending bookings");
model.addAttribute("baseURL", appConfig.getBaseUrl());
String zone = (String) session.getAttribute("zone");
model.addAttribute("zone", zone);
List<BookingDetails> pendingbooking = bookingDetailsRepository.getPendingOrPaymentFailureBookings(zone);
model.addAttribute("pendingbooking", pendingbooking);
return "officer/booking-pending";
} else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
@GetMapping("/payment-list")
public String viewPayment(Model model,HttpSession session){
String officername = (String) session.getAttribute("usertype");
if(officername!=null) {
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("title","paymentlist");
model.addAttribute("baseURL",appConfig.getBaseUrl());
String zone = (String) session.getAttribute("zone");
model.addAttribute("zone", zone);
// System.out.println(zone);
List<Payments> pay=paymentsRepository.getPaymentListByzone(zone);
model.addAttribute("paymentlist",pay);
return "officer/payment-list";
}else {
session.invalidate();
return "redirect:/communityhall/login";
}
public String viewPayment(Model model, HttpSession session) {
String officername = (String) session.getAttribute("usertype");
if (officername != null) {
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("title", "paymentlist");
model.addAttribute("baseURL", appConfig.getBaseUrl());
String zone = (String) session.getAttribute("zone");
model.addAttribute("zone", zone);
// System.out.println(zone);
List<Payments> pay = paymentsRepository.getPaymentListByzone(zone);
model.addAttribute("paymentlist", pay);
return "officer/payment-list";
} else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
@GetMapping("/bookingwaitinglist")
public String viewWaitingBookings(Model model,HttpSession session) {
String officername = (String) session.getAttribute("usertype");
if(officername!=null) {
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("title","bookinglist");
model.addAttribute("baseURL",appConfig.getBaseUrl());
String zone = (String) session.getAttribute("zone");
model.addAttribute("zone", zone);
List<BookingDetails> bookingList = bookingDetailsRepository.getWaitinglist(zone);
model.addAttribute("bookingList", bookingList);
return "officer/booking-list"; // Assuming "officer/rejected-booking-list" is the name of your HTML template
}else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
public String viewWaitingBookings(Model model, HttpSession session) {
String officername = (String) session.getAttribute("usertype");
if (officername != null) {
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("title", "bookinglist");
model.addAttribute("baseURL", appConfig.getBaseUrl());
String zone = (String) session.getAttribute("zone");
model.addAttribute("zone", zone);
List<BookingDetails> bookingList = bookingDetailsRepository.getWaitinglist(zone);
model.addAttribute("bookingList", bookingList);
return "officer/booking-list"; // Assuming "officer/rejected-booking-list" is the name of your HTML template
} else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
@GetMapping("/booking-list")
public String viewBookingList(Model model,HttpSession session) {
String officername = (String) session.getAttribute("usertype");
if(officername!=null) {
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("title","bookinglist");
model.addAttribute("baseURL",appConfig.getBaseUrl());
String zone = (String) session.getAttribute("zone");
model.addAttribute("zone", zone);
List<BookingDetails> bookingList = bookingDetailsRepository.getApprovedlist(zone);
model.addAttribute("bookingList", bookingList);
return "officer/booking-list"; // Assuming "officer/rejected-booking-list" is the name of your HTML template
}else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
public String viewBookingList(Model model, HttpSession session) {
String officername = (String) session.getAttribute("usertype");
if (officername != null) {
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("title", "bookinglist");
model.addAttribute("baseURL", appConfig.getBaseUrl());
String zone = (String) session.getAttribute("zone");
model.addAttribute("zone", zone);
List<BookingDetails> bookingList = bookingDetailsRepository.getApprovedlist(zone);
model.addAttribute("bookingList", bookingList);
return "officer/booking-list"; // Assuming "officer/rejected-booking-list" is the name of your HTML template
} else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
@GetMapping("/rejected-list")
public String viewRejectedBookings(Model model,HttpSession session) {
String officername = (String) session.getAttribute("usertype");
if(officername!=null) {
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("title","rejectedlist");
model.addAttribute("baseURL",appConfig.getBaseUrl());
String zone = (String) session.getAttribute("zone");
model.addAttribute("zone", zone);
List<BookingDetails> rejectedBookings = bookingDetailsRepository.getrejectedlist(zone);
model.addAttribute("rejectedBookings", rejectedBookings);
return "officer/rejected-list";
}else {
session.invalidate();
return "redirect:/communityhall/login";
}
public String viewRejectedBookings(Model model, HttpSession session) {
String officername = (String) session.getAttribute("usertype");
if (officername != null) {
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("title", "rejectedlist");
model.addAttribute("baseURL", appConfig.getBaseUrl());
String zone = (String) session.getAttribute("zone");
model.addAttribute("zone", zone);
List<BookingDetails> rejectedBookings = bookingDetailsRepository.getrejectedlist(zone);
model.addAttribute("rejectedBookings", rejectedBookings);
return "officer/rejected-list";
} else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
@GetMapping("/settlement-list")
public String settlementPendingList(Model model,HttpSession session) {
String officername = (String) session.getAttribute("usertype");
if(officername!=null) {
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("title","settlement Pending");
model.addAttribute("baseURL",appConfig.getBaseUrl());
String zone = (String) session.getAttribute("zone");
model.addAttribute("zone", zone);
List<BookingDetails> settlement=bookingDetailsRepository.findSettlementPendingByZone(zone);
List<BookingDetails> cancelledbookings=bookingDetailsRepository.findCancelledListByZone(zone);
List<BookingDetails> rejectedbookings=bookingDetailsRepository.findRejectedListByZone(zone);
model.addAttribute("settlementlist",settlement);
model.addAttribute("cancelledbookings",cancelledbookings);
model.addAttribute("rejectedbookings",rejectedbookings);
return "officer/settlement-list";
}else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
public String settlementPendingList(Model model, HttpSession session) {
String officername = (String) session.getAttribute("usertype");
if (officername != null) {
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("title", "settlement Pending");
model.addAttribute("baseURL", appConfig.getBaseUrl());
String zone = (String) session.getAttribute("zone");
model.addAttribute("zone", zone);
List<BookingDetails> settlement = bookingDetailsRepository.findSettlementPendingByZone(zone);
List<BookingDetails> cancelledbookings = bookingDetailsRepository.findCancelledListByZone(zone);
List<BookingDetails> rejectedbookings = bookingDetailsRepository.findRejectedListByZone(zone);
model.addAttribute("settlementlist", settlement);
model.addAttribute("cancelledbookings", cancelledbookings);
model.addAttribute("rejectedbookings", rejectedbookings);
return "officer/settlement-list";
} else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
@GetMapping("/refundfailed-list")
public String RefundFailedList(Model model,HttpSession session) {
String officername = (String) session.getAttribute("usertype");
if(officername!=null) {
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("title","settlementapproved");
model.addAttribute("baseURL",appConfig.getBaseUrl());
String zone = (String) session.getAttribute("zone");
model.addAttribute("zone", zone);
List<BookingDetails> settlementrefundfailed=bookingDetailsRepository.findSettlementRefundFailedByZone(zone);
List<BookingDetails> refundfailedcancelledbookings=bookingDetailsRepository.findRefundFaileCancelledListByZone(zone);
List<BookingDetails> refundfailedrejectedbookings=bookingDetailsRepository.findRefundFaileRejectedListByZone(zone);
model.addAttribute("settlementrefundfailed",settlementrefundfailed);
model.addAttribute("refundfailedcancelledbookings",refundfailedcancelledbookings);
model.addAttribute("refundfailedrejectedbookings",refundfailedrejectedbookings);
return "officer/refund-failedlist";
}
else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
public String RefundFailedList(Model model, HttpSession session) {
String officername = (String) session.getAttribute("usertype");
if (officername != null) {
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("title", "settlementapproved");
model.addAttribute("baseURL", appConfig.getBaseUrl());
String zone = (String) session.getAttribute("zone");
model.addAttribute("zone", zone);
List<BookingDetails> settlementrefundfailed = bookingDetailsRepository.findSettlementRefundFailedByZone(zone);
List<BookingDetails> refundfailedcancelledbookings = bookingDetailsRepository.findRefundFaileCancelledListByZone(zone);
List<BookingDetails> refundfailedrejectedbookings = bookingDetailsRepository.findRefundFaileRejectedListByZone(zone);
model.addAttribute("settlementrefundfailed", settlementrefundfailed);
model.addAttribute("refundfailedcancelledbookings", refundfailedcancelledbookings);
model.addAttribute("refundfailedrejectedbookings", refundfailedrejectedbookings);
return "officer/refund-failedlist";
} else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
@GetMapping("/settlement-approved")
public String settlementApprovedList(Model model,HttpSession session) {
String officername = (String) session.getAttribute("usertype");
if(officername!=null) {
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("title","settlementapproved");
model.addAttribute("baseURL",appConfig.getBaseUrl());
String zone = (String) session.getAttribute("zone");
model.addAttribute("zone", zone);
List<BookingDetails> settlement=bookingDetailsRepository.findSettlementApprovedByZone(zone);
List<BookingDetails> approvedcancelledbookings=bookingDetailsRepository.findapprovedCancelledListByZone(zone);
List<BookingDetails> approvedrejectedbookings=bookingDetailsRepository.findapprovedRejectedListByZone(zone);
model.addAttribute("approvedSettlementlist",settlement);
model.addAttribute("approvedcancelledbookings",approvedcancelledbookings);
model.addAttribute("approvedrejectedbookings",approvedrejectedbookings);
return "officer/settlement-approved";
}
else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
@GetMapping("/settlement-reject")
public String settlementRejectedList(Model model,HttpSession session) {
String officername = (String) session.getAttribute("usertype");
if(officername!=null) {
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("title","settlement rejected");
model.addAttribute("baseURL",appConfig.getBaseUrl());
String zone = (String) session.getAttribute("zone");
model.addAttribute("zone", zone);
List<BookingDetails> settlement=bookingDetailsRepository.findSettlementRejectedByZone(zone);
model.addAttribute("rejectSettlementlist",settlement);
return "officer/settlement-reject";
}else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
@GetMapping("/settlement-completedlist")
public String viewSettlementcompletedMaster(Model model,HttpSession session) {
String officername = (String) session.getAttribute("usertype");
if(officername != null) {
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
String zone = (String) session.getAttribute("zone");
model.addAttribute("zone", zone);
List<BookingDetails> completedlist=bookingDetailsRepository.findSettlementCompletedListbyzone(zone);
List<BookingDetails> cancelledcompletedlist=bookingDetailsRepository.findCancelledCompletedListbyzone(zone);
List<BookingDetails> rejectedcompletedlist=bookingDetailsRepository.findRejectedSettlementCompletedListbyzone(zone);
model.addAttribute("title","settlement initiate");
model.addAttribute("officername", officername);
model.addAttribute("completedlist",completedlist);
model.addAttribute("cancelledcompletedlist",cancelledcompletedlist);
model.addAttribute("rejectedcompletedlist",rejectedcompletedlist);
return "officer/settlement-completed";
}else {
session.invalidate(); // Invalidate the session to clear all session attributes
return "redirect:/communityhall/login";
}
}
@GetMapping("/reports")
public String viewReports(Model model,HttpSession session)
{
String officername = (String) session.getAttribute("usertype");
if(officername!=null) {
String zone = (String) session.getAttribute("zone");
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("zone", zone);
List<HallDetails> hallnames=hallDetailsService.getHallNames();
model.addAttribute("hallnames", hallnames);
return "officer/report";
}else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
@GetMapping("/getReport")
public String viewgetReports(Model model,HttpSession session)
{
String officername = (String) session.getAttribute("usertype");
if(officername!=null) {
String zone = (String) session.getAttribute("zone");
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("zone", zone);
List<HallDetails> hallnames=hallDetailsService.getHallNames();
model.addAttribute("hallnames", hallnames);
return "officer/report";
}else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
@PostMapping("/getReport")
public String generateReport(Model model,HttpSession session,
@RequestParam(name = "FromDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) String fromDate,
@RequestParam(name = "ToDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) String toDate,
@RequestParam(name = "request") String request,
@RequestParam(name = "bookingStatus", required = false) String bookingStatus,
@RequestParam(name = "filterby", required = false) String filterby,
@RequestParam(name = "refundStatus", required = false) String refundStatus,
@RequestParam(name = "hallname", required = false,defaultValue = "0") Integer hallId) {
String officername = (String) session.getAttribute("usertype");
if(officername!=null) {
String zone = (String) session.getAttribute("zone");
model.addAttribute("zone", zone);
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
List<HallDetails> hallnames=hallDetailsService.getHallNamesbyzone(zone);
model.addAttribute("hallnames", hallnames);
List<BookingDetails> bookingList = handleBookingRequest(request, fromDate, toDate, bookingStatus,zone,filterby);
List<BookingDetails> bookingSettlementList = handleBookingSettlementRequest(request, fromDate, toDate, refundStatus,zone,filterby);
List<Object[]> paymentList = request.equals("3") ? bookingService.getAllPaymentsDetailsByZone(fromDate, toDate,zone) : new ArrayList<>();
List<Object[]> hallbookingList= handleHallBookingRequest(request, fromDate, toDate,zone,hallId,filterby);
model.addAttribute("bookings", bookingList);
model.addAttribute("bookingSettlementList", bookingSettlementList);
model.addAttribute("bookingStatus", bookingStatus);
model.addAttribute("refundStatus", refundStatus);
model.addAttribute("fromdate", fromDate);
model.addAttribute("todate", toDate);
model.addAttribute("request", request);
model.addAttribute("filterby", filterby);
model.addAttribute("paymentLists", paymentList);
model.addAttribute("hallbookingLists", hallbookingList);
return "officer/report";
}else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
@GetMapping("/settlement-approved")
public String settlementApprovedList(Model model, HttpSession session) {
String officername = (String) session.getAttribute("usertype");
if (officername != null) {
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("title", "settlementapproved");
model.addAttribute("baseURL", appConfig.getBaseUrl());
String zone = (String) session.getAttribute("zone");
model.addAttribute("zone", zone);
List<BookingDetails> settlement = bookingDetailsRepository.findSettlementApprovedByZone(zone);
List<BookingDetails> approvedcancelledbookings = bookingDetailsRepository.findapprovedCancelledListByZone(zone);
List<BookingDetails> approvedrejectedbookings = bookingDetailsRepository.findapprovedRejectedListByZone(zone);
model.addAttribute("approvedSettlementlist", settlement);
model.addAttribute("approvedcancelledbookings", approvedcancelledbookings);
model.addAttribute("approvedrejectedbookings", approvedrejectedbookings);
return "officer/settlement-approved";
} else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
@GetMapping("/settlement-reject")
public String settlementRejectedList(Model model, HttpSession session) {
String officername = (String) session.getAttribute("usertype");
if (officername != null) {
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("title", "settlement rejected");
model.addAttribute("baseURL", appConfig.getBaseUrl());
String zone = (String) session.getAttribute("zone");
model.addAttribute("zone", zone);
List<BookingDetails> settlement = bookingDetailsRepository.findSettlementRejectedByZone(zone);
model.addAttribute("rejectSettlementlist", settlement);
return "officer/settlement-reject";
} else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
private List<BookingDetails> handleBookingRequest(String request, String fromDate, String toDate, String bookingStatus,String zone,String filterby) {
if (!request.equals("1")) {
return new ArrayList<>();
@GetMapping("/settlement-completedlist")
public String viewSettlementcompletedMaster(Model model, HttpSession session) {
String officername = (String) session.getAttribute("usertype");
if (officername != null) {
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
String zone = (String) session.getAttribute("zone");
model.addAttribute("zone", zone);
List<BookingDetails> completedlist = bookingDetailsRepository.findSettlementCompletedListbyzone(zone);
List<BookingDetails> cancelledcompletedlist = bookingDetailsRepository.findCancelledCompletedListbyzone(zone);
List<BookingDetails> rejectedcompletedlist = bookingDetailsRepository.findRejectedSettlementCompletedListbyzone(zone);
model.addAttribute("title", "settlement initiate");
model.addAttribute("officername", officername);
model.addAttribute("completedlist", completedlist);
model.addAttribute("cancelledcompletedlist", cancelledcompletedlist);
model.addAttribute("rejectedcompletedlist", rejectedcompletedlist);
return "officer/settlement-completed";
} else {
session.invalidate(); // Invalidate the session to clear all session attributes
return "redirect:/communityhall/login";
}
}
if (bookingStatus.isEmpty() && filterby.isEmpty()) {
return bookingService.getAllBookingDetailsBookingDateByZone(fromDate, toDate, zone);
@GetMapping("/reports")
public String viewReports(Model model, HttpSession session) {
String officername = (String) session.getAttribute("usertype");
if (officername != null) {
String zone = (String) session.getAttribute("zone");
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("zone", zone);
List<HallDetails> hallnames = hallDetailsService.getHallNames();
model.addAttribute("hallnames", hallnames);
return "officer/report";
} else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
if(filterby.isEmpty() && !bookingStatus.isEmpty())
{
return bookingService.getAllBookingDetailsBookingDateByZoneWithStatus(fromDate, toDate, zone, bookingStatus);
@GetMapping("/getReport")
public String viewgetReports(Model model, HttpSession session) {
String officername = (String) session.getAttribute("usertype");
if (officername != null) {
String zone = (String) session.getAttribute("zone");
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("zone", zone);
List<HallDetails> hallnames = hallDetailsService.getHallNames();
model.addAttribute("hallnames", hallnames);
return "officer/report";
} else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
if(!filterby.isEmpty())
{
if ("1".equals(filterby))
{
if(bookingStatus.isEmpty())
{
return bookingService.getAllBookingDetailsBookingDateByZone(fromDate, toDate, zone);
}
else
{
return bookingService.getAllBookingDetailsBookingDateByZoneWithStatus(fromDate, toDate, zone, bookingStatus);
}
}
if ("2".equals(filterby))
{
if(bookingStatus.isEmpty())
{
return bookingService.getAllBookingDetailsEventDateByZone(fromDate, toDate, zone);
}
else
{
return bookingService.getAllBookingDetailsEventDateByZoneWithStatus(fromDate, toDate, zone, bookingStatus);
}
@PostMapping("/getReport")
public String generateReport(Model model, HttpSession session,
@RequestParam(name = "FromDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) String fromDate,
@RequestParam(name = "ToDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) String toDate,
@RequestParam(name = "request") String request,
@RequestParam(name = "bookingStatus", required = false) String bookingStatus,
@RequestParam(name = "filterby", required = false) String filterby,
@RequestParam(name = "refundStatus", required = false) String refundStatus,
@RequestParam(name = "hallname", required = false, defaultValue = "0") Integer hallId) {
String officername = (String) session.getAttribute("usertype");
if (officername != null) {
String zone = (String) session.getAttribute("zone");
model.addAttribute("zone", zone);
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
List<HallDetails> hallnames = hallDetailsService.getHallNamesbyzone(zone);
model.addAttribute("hallnames", hallnames);
List<BookingDetails> bookingList = handleBookingRequest(request, fromDate, toDate, bookingStatus, zone, filterby);
List<BookingDetails> bookingSettlementList = handleBookingSettlementRequest(request, fromDate, toDate, refundStatus, zone, filterby);
List<Object[]> paymentList = request.equals("3") ? bookingService.getAllPaymentsDetailsByZone(fromDate, toDate, zone) : new ArrayList<>();
List<Object[]> hallbookingList = handleHallBookingRequest(request, fromDate, toDate, zone, hallId, filterby);
model.addAttribute("bookings", bookingList);
model.addAttribute("bookingSettlementList", bookingSettlementList);
model.addAttribute("bookingStatus", bookingStatus);
model.addAttribute("refundStatus", refundStatus);
model.addAttribute("fromdate", fromDate);
model.addAttribute("todate", toDate);
model.addAttribute("request", request);
model.addAttribute("filterby", filterby);
model.addAttribute("paymentLists", paymentList);
model.addAttribute("hallbookingLists", hallbookingList);
return "officer/report";
} else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
return new ArrayList<>();
}
private List<BookingDetails> handleBookingSettlementRequest(String request, String fromDate, String toDate, String refundStatus,String zone,String filterby) {
if (!request.equals("2")) {
private List<BookingDetails> handleBookingRequest(String request, String fromDate, String toDate, String bookingStatus, String zone, String filterby) {
if (!request.equals("1")) {
return new ArrayList<>();
}
if (bookingStatus.isEmpty() && filterby.isEmpty()) {
return bookingService.getAllBookingDetailsBookingDateByZone(fromDate, toDate, zone);
}
if (filterby.isEmpty() && !bookingStatus.isEmpty()) {
return bookingService.getAllBookingDetailsBookingDateByZoneWithStatus(fromDate, toDate, zone, bookingStatus);
}
if (!filterby.isEmpty()) {
if ("1".equals(filterby)) {
if (bookingStatus.isEmpty()) {
return bookingService.getAllBookingDetailsBookingDateByZone(fromDate, toDate, zone);
} else {
return bookingService.getAllBookingDetailsBookingDateByZoneWithStatus(fromDate, toDate, zone, bookingStatus);
}
}
if ("2".equals(filterby)) {
if (bookingStatus.isEmpty()) {
return bookingService.getAllBookingDetailsEventDateByZone(fromDate, toDate, zone);
} else {
return bookingService.getAllBookingDetailsEventDateByZoneWithStatus(fromDate, toDate, zone, bookingStatus);
}
}
}
return new ArrayList<>();
}
if ((refundStatus == null || refundStatus.isEmpty()) && filterby.isEmpty())
{
return bookingService.getAllBookingsettlementDetailsByZoneByBookingDate(fromDate, toDate, zone);
}
if ((refundStatus != null && !refundStatus.isEmpty()) && filterby.isEmpty())
{
return bookingService.getAllBookingsettlementDetailsByZoneByBookingDateWithStatus(fromDate, toDate, zone, refundStatus);
private List<BookingDetails> handleBookingSettlementRequest(String request, String fromDate, String toDate, String refundStatus, String zone, String filterby) {
if (!request.equals("2")) {
return new ArrayList<>();
}
if ((refundStatus == null || refundStatus.isEmpty()) && filterby.isEmpty()) {
return bookingService.getAllBookingsettlementDetailsByZoneByBookingDate(fromDate, toDate, zone);
}
if ((refundStatus != null && !refundStatus.isEmpty()) && filterby.isEmpty()) {
return bookingService.getAllBookingsettlementDetailsByZoneByBookingDateWithStatus(fromDate, toDate, zone, refundStatus);
}
if (!filterby.isEmpty()) {
if ("1".equals(filterby)) {
if (refundStatus.isEmpty() || refundStatus == null) {
return bookingService.getAllBookingsettlementDetailsByZoneByBookingDate(fromDate, toDate, zone);
} else {
return bookingService.getAllBookingsettlementDetailsByZoneByBookingDateWithStatus(fromDate, toDate, zone, refundStatus);
}
}
if ("2".equals(filterby)) {
if (refundStatus.isEmpty() || refundStatus == null) {
return bookingService.getAllBookingsettlementDetailsByZoneByEventDate(fromDate, toDate, zone);
} else {
return bookingService.getAllBookingsettlementDetailsByZoneByEventDateWithStatus(fromDate, toDate, zone, refundStatus);
}
}
}
return new ArrayList<>();
}
if(!filterby.isEmpty())
{
if ("1".equals(filterby))
{
if(refundStatus.isEmpty() || refundStatus==null)
{
return bookingService.getAllBookingsettlementDetailsByZoneByBookingDate(fromDate, toDate, zone);
}
else
{
return bookingService.getAllBookingsettlementDetailsByZoneByBookingDateWithStatus(fromDate, toDate, zone, refundStatus);
}
}
if ("2".equals(filterby))
{
if(refundStatus.isEmpty() || refundStatus==null)
{
return bookingService.getAllBookingsettlementDetailsByZoneByEventDate(fromDate, toDate, zone);
}
else
{
return bookingService.getAllBookingsettlementDetailsByZoneByEventDateWithStatus(fromDate, toDate, zone, refundStatus);
}
private List<Object[]> handleHallBookingRequest(String request, String fromDate, String toDate, String zone, Integer hallId, String filterby) {
if (!request.equals("4")) {
return new ArrayList<>();
}
if (filterby.isEmpty() && hallId == 0) {
return bookingService.getBookingHallDetailsReportByZoneByBookingDate(fromDate, toDate, zone);
}
if (filterby.isEmpty() && hallId != 0) {
return bookingService.getBookingHallDetailsReportByZoneByBookingDateHallname(fromDate, toDate, zone, hallId);
}
if (!filterby.isEmpty()) {
if ("1".equals(filterby)) {
if (hallId != 0) {
return bookingService.getBookingHallDetailsReportByZoneByBookingDateHallname(fromDate, toDate, zone, hallId);
} else {
return bookingService.getBookingHallDetailsReportByZoneByBookingDate(fromDate, toDate, zone);
}
}
if ("2".equals(filterby)) {
if (hallId != 0) {
return bookingService.getBookingHallDetailsReportByZoneByEventDateHallname(fromDate, toDate, zone, hallId);
} else {
return bookingService.getBookingHallDetailsReportByZoneByEventDate(fromDate, toDate, zone);
}
}
}
return new ArrayList<>();
}
return new ArrayList<>();
}
private List<Object[]> handleHallBookingRequest(String request, String fromDate, String toDate, String zone,Integer hallId,String filterby){
if(!request.equals("4")) {
return new ArrayList<>();
}
if(filterby.isEmpty() && hallId==0)
{
return bookingService.getBookingHallDetailsReportByZoneByBookingDate(fromDate, toDate, zone);
}
if(filterby.isEmpty() && hallId!=0)
{
return bookingService.getBookingHallDetailsReportByZoneByBookingDateHallname(fromDate, toDate, zone, hallId);
}
if(!filterby.isEmpty())
{
if("1".equals(filterby) )
{
if(hallId != 0)
{
return bookingService.getBookingHallDetailsReportByZoneByBookingDateHallname(fromDate, toDate, zone, hallId);
}
else
{
return bookingService.getBookingHallDetailsReportByZoneByBookingDate(fromDate, toDate, zone);
}
}
if("2".equals(filterby) )
{
if(hallId != 0)
{
return bookingService.getBookingHallDetailsReportByZoneByEventDateHallname(fromDate, toDate, zone, hallId);
}
else
{
return bookingService.getBookingHallDetailsReportByZoneByEventDate(fromDate, toDate, zone);
}
}
}
return new ArrayList<>();
}
@GetMapping("/counter-refund")
public String counterRefundList(Model model, HttpSession session) {
String officername = (String) session.getAttribute("usertype");
if (officername != null) {
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("title", "settlement rejected");
model.addAttribute("baseURL", appConfig.getBaseUrl());
String zone = (String) session.getAttribute("zone");
model.addAttribute("zone", zone);
List<CounterRefundList> counterRefund = counterRefundListRepository.findCounterRefundList(zone);
model.addAttribute("counterRefund", counterRefund);
return "officer/counter-refund";
} else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
@GetMapping("/counter-refund")
public String counterRefundList(Model model,HttpSession session) {
String officername = (String) session.getAttribute("usertype");
if(officername!=null) {
model.addAttribute("officername", officername);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("title","settlement rejected");
model.addAttribute("baseURL",appConfig.getBaseUrl());
String zone = (String) session.getAttribute("zone");
model.addAttribute("zone", zone);
List<CounterRefundList> counterRefund=counterRefundListRepository.findCounterRefundList(zone);
model.addAttribute("counterRefund",counterRefund);
return "officer/counter-refund";
}else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
@GetMapping("/logout")
public String viewLogout(Model model,HttpSession session) {
session.invalidate();
public String viewLogout(Model model, HttpSession session) {
session.invalidate();
return "redirect:/communityhall/login";
}
}

4
src/main/java/com/gcc/communityHall/controller/UserAPIController.java

@ -745,9 +745,9 @@ public class UserAPIController {
LocalDateTime rescheduledUpdatedDate = null;
BookingDetails bookingDetails = bookingService.getBookingsById(bookingId);
if (bookingDetails.getComments().equals( "slots Resheduled the Dates")) {
/*if (bookingDetails.getComments().equals("slots Resheduled the Dates")) {
rescheduledUpdatedDate = LocalDateTime.parse(bookingDetails.getUpdatedDate());
} /*else if(bookingDetails.getScheduleCount()==1){
} else if(bookingDetails.getScheduleCount()==1){
List<BookingHistory> histories = bookingDetails.getBookingHistories();
if (histories != null && !histories.isEmpty()) {

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

@ -1,4 +1,3 @@
/*
package com.gcc.communityHall.paymentService.scheduler;
// Import necessary packages
@ -36,7 +35,7 @@ import java.time.LocalDate;
import java.util.*;
@Component
@EnableScheduling
//@EnableScheduling
public class PaymentStatusScheduler {
@Autowired
@ -347,4 +346,3 @@ public class PaymentStatusScheduler {
*/

28
src/main/java/com/gcc/communityHall/repository/BookingDetailsRepository.java

@ -1257,7 +1257,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"SUM(p.amount_received) AS AmountReceived, " +
"COALESCE(SUM(r.amount - r.balace_amount), 0) AS AmountRefund, " +
"COALESCE(SUM(CASE WHEN bd.booking_status IN ('COMPLETED', 'CANCELED') THEN r.balace_amount - bd.gst ELSE 0 END), 0) AS NetRevenue ," +
"h.hall_id "+
"h.hall_id " +
"FROM " +
"booking_details bd " +
"JOIN " +
@ -1433,4 +1433,30 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
@Query(value = "SELECT * FROM booking_details where booking_status='WAITING_FOR_NOC' order by booking_id", nativeQuery = true)
List<BookingDetails> getAllwaitingNOC();
@Query(value = "SELECT bd.counter_id, COUNT(*) AS total_count " +
"FROM booking_details bd " +
"WHERE DATE(bd.booking_date) BETWEEN :fromDate AND :toDate " +
"AND bd.counter_id IS NOT NULL " +
"GROUP BY bd.counter_id", nativeQuery = true)
List<Object[]> getCounterWiseBookingCount(@Param("fromDate") String fromDate, @Param("toDate") String toDate);
@Query(value = "SELECT bd.counter_id, h.zone, h. division, h.hall_name, COUNT(*) as total_bookings " +
"FROM booking_details bd " +
"JOIN hall_details h ON h.hall_id = bd.hall_details_hall_id " +
"WHERE DATE(bd.booking_date) BETWEEN :fromDate AND :toDate " +
"AND bd.counter_id IS NOT NULL " +
"GROUP BY bd.counter_id,h.zone, h. division, h.hall_name", nativeQuery = true)
List<Object[]> getHallWiseBookingDetails(@Param("fromDate") String fromDate, @Param("toDate") String toDate);
@Query(value = "SELECT bd.booking_id,h.hall_name, bd.booking_date, bd.start_date, bd.end_date," +
"bd.starting_slot,bd.ending_slot,bd.no_of_days,bd.reason,bd.amount_received, " +
"bd.hall_amount,bd.deposit_amount,bd.gst, " +
"bd.booking_status,bd.booking_type " +
"FROM booking_details bd " +
"JOIN hall_details h ON h.hall_id = bd.hall_details_hall_id " +
"WHERE DATE(bd.booking_date) BETWEEN :fromDate AND :toDate " +
"AND bd.counter_id IS NOT NULL", nativeQuery = true)
List<Object[]> getBookingDetailsForAllHalls(@Param("fromDate") String fromDate, @Param("toDate") String toDate);
}

7
src/main/java/com/gcc/communityHall/service/BookingService.java

@ -204,4 +204,11 @@ public interface BookingService {
List<BookingDetails> getBookingsByDateAndHall(String bookingDate, Long hallId);
BookingDetails updateRefundStatusScheduler(int bookingId, RefundStatus status);
List<Object[]> getCounterWiseBookingCount(String fromDate, String toDate);
List<Object[]> getHallWiseBookingDetails(String fromDate, String toDate);
List<Object[]> getBookingDetailsForAllHalls(String fromDate, String toDate);
}

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

@ -631,6 +631,8 @@ public class BookingServiceImpl implements BookingService {
Integer userId = userSession.getUserId();
String counterId = userSession.getCounter();
System.out.println("counterId.."+counterId);
ReasonMaster reasonMaster = reasonMasterService.getReasonById(Integer.parseInt(formData.get("reasonId").toString()));
HallDetails hallDetails = hallDetailService.getHallById(Integer.parseInt(formData.get("hallId").toString()));
Users user = userService.getUserById(userId);
@ -1616,7 +1618,7 @@ public class BookingServiceImpl implements BookingService {
bookingHistory.setBookingStatus(book.getBookingStatus());
bookingHistory.setUpdatedBy(adminname);
bookingHistory.setCdate(new Date());
bookingHistory.setRefundStatus(book.getRefundStatus());
bookingHistory.setRefundStatus(book.getRefundStatus());
bookingHistoryRepository.save(bookingHistory);
book.setComments("Refund status Updated to:-" + status);
@ -2446,5 +2448,19 @@ public class BookingServiceImpl implements BookingService {
return null;
}
@Override
public List<Object[]> getCounterWiseBookingCount(String fromDate, String toDate) {
return bookingDetailsRepository.getCounterWiseBookingCount(fromDate, toDate);
}
@Override
public List<Object[]> getHallWiseBookingDetails(String fromDate, String toDate) {
return bookingDetailsRepository.getHallWiseBookingDetails(fromDate, toDate);
}
@Override
public List<Object[]> getBookingDetailsForAllHalls(String fromDate, String toDate){
return bookingDetailsRepository.getBookingDetailsForAllHalls(fromDate,toDate);
}
}

159
src/main/java/com/gcc/communityHall/service/Impl/UserServiceImpl.java

@ -34,12 +34,11 @@ import jakarta.servlet.http.HttpSession;
@Service
public class UserServiceImpl implements UserService {
@Autowired
UsersRepository usersRepository;
@Autowired
private CounsellorDetailsRepository counsellorDetailsRepository;
@Autowired
@ -51,30 +50,31 @@ public class UserServiceImpl implements UserService {
@PersistenceContext
private EntityManager entityManager;
@Value("${file.upload.directory}")
private String uploadDirectory;
@Value("${file.fullpath}")
private String serverPath;
private String uploadDirectory;
@Value("${file.fullpath}")
private String serverPath;
@Override
@Transactional
public void approveUser(int userId) {
entityManager.createQuery("UPDATE Users u SET u.userstatus = 'APPROVED' WHERE u.userId = :userId AND u.userstatus = 'PENDING'")
.setParameter("userId", userId)
.executeUpdate();
.setParameter("userId", userId)
.executeUpdate();
}
@Autowired
UserHistoryRepository userHistoryRepository;
public UserServiceImpl(UsersRepository userRepo){
this.usersRepository=userRepo;
public UserServiceImpl(UsersRepository userRepo) {
this.usersRepository = userRepo;
}
public UserServiceImpl(){
public UserServiceImpl() {
}
@Override
public Users user(Users user) {
if (user.getUsertype() == null || !user.getUsertype().equals(Users.userType.PUBLIC)) {
@ -105,8 +105,8 @@ public class UserServiceImpl implements UserService {
@Override
public Users getUserById(int userId) {
Optional<Users> user= usersRepository.findById(userId);
if(user.isPresent()){
Optional<Users> user = usersRepository.findById(userId);
if (user.isPresent()) {
return user.get();
}
return null;
@ -124,10 +124,10 @@ public class UserServiceImpl implements UserService {
@Override
public Users updateUserStatus(int userId, Users.userStatus status, String comments) {
Optional<Users> user= usersRepository.findById(userId);
Optional<Users> user = usersRepository.findById(userId);
String adminname = (String) session.getAttribute("usertype");
Integer loginid = (Integer) session.getAttribute("id");
if(user.isPresent()){
if (user.isPresent()) {
Users usr = user.get();
UserHistory userHistory = new UserHistory();
@ -141,23 +141,23 @@ public class UserServiceImpl implements UserService {
usr.setUserstatus(status);
usr.setUpdatedBy(adminname);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
String formattedDate = LocalDateTime.now().format(formatter);
String formattedDate = LocalDateTime.now().format(formatter);
usr.setUpdatedDate(formattedDate);
Users users = usersRepository.save(usr);
ApplicationLogs logs=new ApplicationLogs();
logs.setComments("Action by "+adminname);
logs.setLoginId(loginid);
logs.setLogType("User Status:-"+status.toString());
InetAddress inetAddress;
try {
inetAddress = InetAddress.getLocalHost();
String hostname = InetAddress.getLocalHost().getHostName();
logs.setIpaddress(inetAddress.getHostAddress());
logs.setSystemName(hostname);
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Users users = usersRepository.save(usr);
ApplicationLogs logs = new ApplicationLogs();
logs.setComments("Action by " + adminname);
logs.setLoginId(loginid);
logs.setLogType("User Status:-" + status.toString());
InetAddress inetAddress;
try {
inetAddress = InetAddress.getLocalHost();
String hostname = InetAddress.getLocalHost().getHostName();
logs.setIpaddress(inetAddress.getHostAddress());
logs.setSystemName(hostname);
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
applicationLogsRepository.save(logs);
return users;
@ -165,36 +165,37 @@ public class UserServiceImpl implements UserService {
}
return null;
}
@Override
public Users findByMobileno(Long mobileNo) {
// TODO Auto-generated method stub
return usersRepository.findByMobileNo(mobileNo);
}
//yoga
@Override
public List<Users> getAllUsers(String fromDate, String toDate)
{
@Override
public Users findByMobileno(Long mobileNo) {
// TODO Auto-generated method stub
return usersRepository.findByMobileNo(mobileNo);
}
//yoga
@Override
public List<Users> getAllUsers(String fromDate, String toDate) {
return usersRepository.getAllUsers(fromDate, toDate);
}
}
@Override
@Override
public List<Users> getAllUsersWithFilters(String fromDate, String toDate, String userStatus, String userType) {
return usersRepository.getAllUsersWithFilters(fromDate, toDate, userStatus, userType);
}
@Override
public List<Users> getAllUsersWithStatusFilters(String fromDate, String toDate, String userStatus) {
return usersRepository.getAllUsersWithStatusFilters(fromDate, toDate, userStatus);
}
@Override
public List<Users> getAllUsersWithStatusFilters(String fromDate, String toDate, String userStatus) {
@Override
public List<Users> getAllUsersWithTypeFilters(String fromDate, String toDate, String userType) {
return usersRepository.getAllUsersWithTypeFilters(fromDate, toDate, userType);
}
return usersRepository.getAllUsersWithStatusFilters(fromDate, toDate, userStatus);
}
@Override
public List<Users> getAllUsersWithTypeFilters(String fromDate, String toDate, String userType) {
return usersRepository.getAllUsersWithTypeFilters(fromDate, toDate, userType);
}
public void updateProfile(Users userProfileRequest) {
@ -211,10 +212,10 @@ public class UserServiceImpl implements UserService {
user.setEmail(userProfileRequest.getDoorNo());
usersRepository.save(user);
} else {
System.out.println("User with ID " + userProfileRequest.getUserId() + " not found");
System.out.println("User with ID " + userProfileRequest.getUserId() + " not found");
}
}
@Override
public String updateUserDetails(Users userDetails) {
Users existingUser = usersRepository.findById(userDetails.getUserId()).orElse(null);
@ -246,25 +247,27 @@ public class UserServiceImpl implements UserService {
}
@Override
public void saveUsers(Users user) {
// TODO Auto-generated method stub
}
public Counsellordetails findByMobile(long mobileno) {
return counsellorDetailsRepository.findByMobile(mobileno);
}
@Override
public Users getUserDetailsByMobileNo(long mobileNo) {
return usersRepository.findByMobileNo(mobileNo);
}
public void toggleUserStatus(Integer userId, boolean active) {
Optional<Users> optionalUser = usersRepository.findById(userId);
if (optionalUser.isPresent()) {
Users user = optionalUser.get();
user.setActive(active);
usersRepository.save(user);
}
}
@Override
public void saveUsers(Users user) {
// TODO Auto-generated method stub
}
public Counsellordetails findByMobile(long mobileno) {
return counsellorDetailsRepository.findByMobile(mobileno);
}
@Override
public Users getUserDetailsByMobileNo(long mobileNo) {
return usersRepository.findByMobileNo(mobileNo);
}
public void toggleUserStatus(Integer userId, boolean active) {
Optional<Users> optionalUser = usersRepository.findById(userId);
if (optionalUser.isPresent()) {
Users user = optionalUser.get();
user.setActive(active);
usersRepository.save(user);
}
}
}

494
src/main/resources/templates/admin/reports.html

@ -52,6 +52,21 @@
.hidden {
display: none;
}
.modal-fullscreen-custom {
max-width: 98% !important;
width: 98%;
margin: 0 auto;
}
/* Ensure second modal is on top of the first modal */
.modal-backdrop.show:nth-of-type(2) {
z-index: 1055 !important; /* slightly above the first modal */
}
#showBookingDetails.modal {
z-index: 1060 !important; /* higher than .modal-backdrop */
}
</style>
<body>
@ -111,8 +126,24 @@
<option value="5" th:selected="${request=='5'}">Hall Booking List</option>
<option value="6" th:selected="${request=='6'}">Refund Details</option>
<option value="7" th:selected="${request=='7'}">Total Count</option>
<option value="9" th:selected="${request=='9'}">Counter Details</option>
</select>
</div>
<div class="col-sm-3 mb-2" id="bookingcountbasedonDropdown" style="display: none;">
<label class="form-label" for="basedon" >Based On: <span
class="text-danger">*</span></label>
<select class="form-control text-center" id="basedon" name="basedon"
th:value="${basedon}">
<option value="">Select</option>
<option value="zone" th:selected="${basedon == 'zone'}">Zone
</option>
<option value="division" th:selected="${basedon == 'division'}">Division
</option>
</select>
<span id="basedonError" class="text-danger"></span>
</div>
<!-- UsersDropdown2 -->
<div class="col-sm-3 mb-2" id="userDropdown2" style="display: none;">
<label class="form-label" for="usertype">User Type: </label>
@ -273,18 +304,6 @@
</select>
</div>
<div class="col-sm-3 mb-2" id="bookingcountbasedonDropdown" style="display: none;">
<label class="form-label" for="basedon">Based On: </label>
<select class="form-control text-center" id="basedon" name="basedon"
th:value="${basedon}">
<option value="">Select</option>
<option value="zone" th:selected="${basedon == 'zone'}">Zone
</option>
<option value="division" th:selected="${basedon == 'division'}">Division
</option>
</select>
</div>
<div class="col-sm-3">
<br>
@ -312,7 +331,6 @@
<th>Address</th>
<th>UserType</th>
<th>UserStatus</th>
</tr>
</thead>
<tr th:each="user, iterStat : ${users}">
@ -600,7 +618,36 @@
</tfoot>
</table>
</div>
<!--<div class="table-responsive" id="countertable" th:if="${request == '9'}">-->
<div class="table-responsive" id="countertable" th:if="${request}==9">
<table id="requestTable9" class="table table-striped table-bordered table-hover dataTable"
role="grid" width="99.5%">
<thead class="thead-dark">
<tr role="row">
<th>S.No</th>
<th>Counter ID</th>
<th>Total Bookings</th>
</tr>
</thead>
<tbody>
<tr th:each="counterdata, iterstat : ${counterBookingList}">
<td th:text="${iterstat.index + 1}"></td>
<td th:text="${counterdata[0]}"></td>
<td>
<button href="#"
th:attr="data-counter-id=${counterdata[0]}"
data-bs-toggle="modal"
data-bs-target="#bookingModal"
style="background-color: #2a807f; color: white; border: none; padding: 6px 12px; border-radius: 4px;"
onclick="showCounterTable(this)">
<span th:text="${counterdata[1]}"></span>
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
@ -877,7 +924,7 @@
<!--Newly added for Reschedule Details-->
<div class="row col-md-12 col-lg-12 col-sm-12"
<!--<div class="row col-md-12 col-lg-12 col-sm-12"
id="rescheduleDetails"
style="display:none;margin-left: 0px;margin-top: -10px">
<div class="card-body">
@ -916,7 +963,7 @@
</tbody>
</table>
</div>
</div>
</div>-->
<div class="row col-md-12 col-lg-12 col-sm-12"
@ -1116,15 +1163,15 @@
</div>
</div>
</div>
<div class="block-content block-content-full text-end bg-body"
id="mbutton">
<button type="button"
style="background-color: rgb(21,69,93);color: white;"
class="btn btn-sm btn-alt-secondary"
data-bs-dismiss="modal">Close
</button>
</div>
</div>
<div class="block-content block-content-full text-end bg-body"
id="mbutton">
<button type="button"
style="background-color: rgb(21,69,93);color: white;"
class="btn btn-sm btn-alt-secondary"
data-bs-dismiss="modal">Close
</button>
</div>
</form>
</div>
</div>
@ -1247,7 +1294,91 @@
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="bookingModal" tabindex="-1" aria-labelledby="bookingModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-scrollable">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Hall-wise Booking Details</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<!--
<table id="modalBookingTable" class="table table-bordered table-striped dataTable" style="width: 100%;">
-->
<table id="modalBookingTable" class="table table-striped table-bordered table-hover dataTable"
role="grid" width="99.5%">
<input type="hidden" id="hallBookingJsonInput" th:value="${hallBookingJson}">
<thead>
<tr>
<th>S.No</th>
<th>Zone</th>
<th>Division</th>
<th>Hall Name</th>
<th>Total Bookings</th>
</tr>
</thead>
<tbody id="modalBookingDetails"></tbody>
</table>
</div>
</div>
</div>
</div>
<div class="modal fade" id="hallDetailModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-fullscreen-custom modal-dialog-scrollable">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Booking Details for Hall</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<table id="hallDetailsTable" class="table table-bordered table-striped">
<input type="hidden" id="hallBookingDetailsJsonInput" th:value="${hallBookingDetailsJson}">
<thead>
<tr>
<th>S.No</th>
<th>Booking ID</th>
<th>Hall Name</th>
<th>Booking Date</th>
<th>Start Date</th>
<th>End Date</th>
<th>Starting Slot</th>
<th>Ending Slot</th>
<th>No.of.Days</th>
<th>Reason for Booking</th>
<th>Hall Amount</th>
<th>Deposit Amount</th>
<th>GSt</th>
<th>Amount Received</th>
<th>Booking Status</th>
<th>Booking Type</th>
<th>View</th>
</tr>
</thead>
<tbody id="hallDetailsTableBody"></tbody>
</table>
</div>
</div>
</div>
</div>
<div class="modal fade" id="bookingInfoModal" tabindex="-1" aria-labelledby="bookingInfoModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header bg-dark text-white">
<h5 class="modal-title">Booking Information</h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body" id="bookingInfoContent">
<!-- Filled by JS -->
</div>
</div>
</div>
</div>
</main>
<footer th:replace="~{fragments/footer2 :: footer}"></footer>
@ -1259,7 +1390,7 @@
<script>
$(document).ready(function () {
/*$(document).ready(function () {
// Common buttons configuration
var buttons = [{
extend: 'pageLength',
@ -1288,7 +1419,7 @@
}];
// DataTables initialization
$('#requestTable1, #requestTable2, #requestTable3, #requestTable8, #requestTable4, #requestTable5, #requestTable6, #requestTable7').DataTable({
$('#requestTable1, #requestTable2, #requestTable3, #requestTable8, #requestTable4, #requestTable5, #requestTable6, #requestTable7,#requestTable9,#modalBookingTable,#hallDetailsTable').DataTable({
dom: 'Bftip',
columnDefs: [{
targets: 'no-sort',
@ -1298,7 +1429,7 @@
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', '500 rows', 'Show all']
],
scrollY: '50vh',
// scrollY: '50vh',
fixedColumns: {
left: 1,
right: 1
@ -1311,6 +1442,126 @@
order: [] // Remove any default sorting
});
// Link the search input to DataTable
$('#searchInput').on('keyup', function () {
$('#bookinglistdataTable').DataTable().search(this.value).draw();
});
});*/
$(document).ready(function () {
// Common buttons (default for most tables)
var commonButtons = [{
extend: 'pageLength',
className: 'btn btn-primary'
}, {
title: 'Data export',
extend: 'copyHtml5',
text: 'Copy',
className: 'btn btn-primary',
id: 'copyBtn'
}, {
extend: 'excelHtml5',
text: 'Excel',
className: 'btn btn-primary',
id: 'excelBtn'
}, {
extend: 'csvHtml5',
text: 'CSV',
className: 'btn btn-primary',
id: 'csvBtn'
}, {
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-primary',
id: 'pdfBtn'
}];
// Custom PDF buttons for specific tables
function getCustomButtons(tableId) {
let orientation = 'portrait';
let pageSize = 'A4';
if (tableId === 'modalBookingTable') {
orientation = 'landscape';
pageSize = 'A4';
} else if (tableId === 'hallDetailsTable') {
orientation = 'landscape';
pageSize = 'A3';
}
return [{
extend: 'pageLength',
className: 'btn btn-primary'
}, {
title: 'Data export',
extend: 'copyHtml5',
text: 'Copy',
className: 'btn btn-primary'
}, {
extend: 'excelHtml5',
text: 'Excel',
className: 'btn btn-primary'
}, {
extend: 'csvHtml5',
text: 'CSV',
className: 'btn btn-primary'
}, {
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-primary',
orientation: orientation,
pageSize: pageSize
}];
}
// Tables using default buttons
$('#requestTable1, #requestTable2, #requestTable3, #requestTable8, #requestTable4, #requestTable5, #requestTable6, #requestTable7').DataTable({
dom: 'Bftip',
columnDefs: [{
targets: 'no-sort',
orderable: false
}],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', '500 rows', 'Show all']
],
fixedColumns: {
left: 1,
right: 1
},
buttons: commonButtons,
responsive: true,
searching: true,
select: false,
processing: false,
order: []
});
// Tables with custom PDF buttons
['requestTable9', 'modalBookingTable', 'hallDetailsTable'].forEach(function (tableId) {
$('#' + tableId).DataTable({
dom: 'Bftip',
columnDefs: [{
targets: 'no-sort',
orderable: false
}],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', '500 rows', 'Show all']
],
fixedColumns: {
left: 1,
right: 1
},
buttons: getCustomButtons(tableId),
responsive: true,
searching: true,
select: false,
processing: false,
order: []
});
});
// Link the search input to DataTable
$('#searchInput').on('keyup', function () {
$('#bookinglistdataTable').DataTable().search(this.value).draw();
@ -1319,6 +1570,7 @@
function validateme() {
// checkTodateCon();
return true;
}
@ -1336,6 +1588,7 @@
fromdate.onchange = validateDate;
todate.onchange = validateDate;
$(document).ready(function () {
var today = new Date();
$('.datepicker').datepicker({
@ -1348,10 +1601,16 @@
}
});
});
document.addEventListener("DOMContentLoaded", function () {
myRequest(); // Initial call to set dropdowns based on initial value
});
document.addEventListener("DOMContentLoaded", function () {
checkTodateCon();
});
function checkTodateCon(){
var today = new Date();
var sixMonthsLater = new Date();
sixMonthsLater.setMonth(today.getMonth() + 6);
@ -1360,7 +1619,9 @@
var maxDate = sixMonthsLater.toISOString().split('T')[0];
let fromDateInput = document.getElementById('fromdate');
let toDateInput = document.getElementById('todate');
let selectedFromDate = document.getElementById('fromdate').value;
fromDateInput.setAttribute('max', maxDate);
toDateInput.setAttribute('min', selectedFromDate);
toDateInput.setAttribute('max', maxDate);
fromDateInput.addEventListener('change', function () {
let selectedFromDate = this.value;
@ -1368,8 +1629,66 @@
toDateInput.setAttribute('min', selectedFromDate);
toDateInput.value = ''; // Reset the value of toDate
});
}
// document.addEventListener("DOMContentLoaded", function () {
// const form = document.getElementById('myForm'); // Change selector if needed
// var requestValue = document.getElementById("request").value;
// if(requestValue ==="7"){
// console.log("inside 7");
// const basedonSelect = document.getElementById('basedon');
// const errorSpan = document.getElementById('basedonError');
//
// form.addEventListener("submit", function (event) {
// console.log("basedonSelect.value====="+basedonSelect.value);
// if (basedonSelect.value === "") {
// event.preventDefault(); // Stop form submission
// errorSpan.textContent = "Please select a value.";
// basedonSelect.classList.add("is-invalid"); // Optional: Bootstrap styling
// }
// else {
// errorSpan.textContent = "";
// basedonSelect.classList.remove("is-invalid");
// }
// });
// }
//
// });
document.addEventListener("DOMContentLoaded", function () {
const form = document.getElementById('myForm');
const basedonSelect = document.getElementById('basedon');
const errorSpan = document.getElementById('basedonError');
const request = document.getElementById('request');
form.addEventListener("submit", function (event) {
const requestValue = request.value;
if (requestValue === "7") {
console.log("inside 7");
console.log("basedonSelect.value=====" + basedonSelect.value);
if (basedonSelect.value === "") {
event.preventDefault(); // Stop form submission
errorSpan.textContent = "Please select a value.";
basedonSelect.classList.add("is-invalid");
} else {
errorSpan.textContent = "";
basedonSelect.classList.remove("is-invalid");
}
}
});
document.getElementById("basedon").addEventListener("change", function () {
this.classList.remove("is-invalid");
document.getElementById("basedonError").textContent = "";
});
});
// Function to manage the display of dropdowns based on the request type
function myRequest() {
var requestValue = document.getElementById("request").value;
@ -1435,7 +1754,7 @@
document.getElementById("divisionContainer").style.display = "block";
document.getElementById("hallContainer").style.display = "block";
} else if (requestValue === "7") {
document.getElementById("bookingcountbasedonDropdown").style.display = "block"
document.getElementById("bookingcountbasedonDropdown").style.display = "block";
} else if (requestValue === "8") {
document.getElementById("zoneDropdown").style.display = "block";
document.getElementById("divisionContainer").style.display = "block";
@ -1520,6 +1839,8 @@
document.getElementById("td_endingSlot").innerHTML = getTimeSlot(response.endingSlot);
document.getElementById("bookingstatus_td").innerHTML = response.bookingStatus;
console.log("before comments admin...");
console.log("Comments..." + response.comments);
if (response.bookingStatus === 'REJECTED' && response.comments) {
document.getElementById("rejectionreasondiv").style.display = "block";
const rejectionCell = document.getElementById("reasonforrejection");
@ -1571,14 +1892,14 @@
document.getElementById("refunddetails").style.display = "none";
}
if (response.scheduleCount === 1) {
/*if (response.scheduleCount === 1) {
document.getElementById("rescheduleDetails").style.display = "block";
document.getElementById("td_res_start_date").innerHTML = response.startDate;
document.getElementById("td_res_end_date").innerHTML = response.endDate;
document.getElementById("td_res_date").innerHTML = response.updatedDate;
} else {
document.getElementById("rescheduleDetails").style.display = "none";
}
}*/
showDamageDetails(response);
if (response.bookingStatus === 'CANCELED' && ['WAITING', 'APPROVED', 'INITIATED'].includes(response.refundStatus)) {
@ -1798,6 +2119,16 @@
$('#fileModal').modal('show');
}
$('#fileModal').on('shown.bs.modal', function () {
// boost the last backdrop above everything else
$('.modal-backdrop').last().css({
'z-index': 1095,
'pointer-events': 'none'
});
// boost this modal
$(this).css('z-index', 1100);
});
function viewbookingDetails(userId) {
$.ajax({
type: "GET",
@ -2041,6 +2372,107 @@
storeSelectedValues();
});
let hallBookingData = [];
let hallDetailsData = [];
window.addEventListener("DOMContentLoaded", () => {
try {
const jsonString1 = document.getElementById("hallBookingJsonInput")?.value;
if (jsonString1) {
hallBookingData = JSON.parse(jsonString1);
console.log("Parsed hallBookingData:", hallBookingData);
}
const jsonString2 = document.getElementById("hallBookingDetailsJsonInput")?.value;
if (jsonString2) {
hallDetailsData = JSON.parse(jsonString2);
console.log("Parsed hallDetailsData:", hallDetailsData);
}
} catch (e) {
console.error("Failed to parse JSON inputs", e);
}
// Delegate click event for dynamically added booking links
$(document).on('click', '.hall-detail-link', function (e) {
e.preventDefault();
const hallName = $(this).data('hall-name');
showHallBookingDetails(hallName);
});
});
function showCounterTable(elem) {
const counterId = elem.getAttribute("data-counter-id");
const filtered = hallBookingData.filter(row => row[0] == counterId);
const table = $('#modalBookingTable').DataTable();
table.clear();
filtered.forEach((row, index) => {
table.row.add([
index + 1,
row[1], // Zone
row[2], // Division
row[3], // Hall Name
`<button href="#" class="hall-detail-link"
style="background-color: #2a807f; color: white; border: none; padding: 6px 12px; border-radius: 4px;"
data-hall-name="${row[3]}">${row[4]}</button>`
]);
});
table.draw();
table.columns.adjust().responsive.recalc();
// Show modal after data is loaded
$('#bookingModal').modal('show');
}
function formatDateFromTimestamp(timestamp) {
const date = new Date(parseInt(timestamp));
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
function getSlotLabel(slot) {
return slot === 1 ? 'Morning' : (slot === 2 ? 'Evening' : '');
}
function showHallBookingDetails(hallName) {
const filtered = hallDetailsData.filter(row => row[1] === hallName);
const table = $('#hallDetailsTable').DataTable();
table.clear();
filtered.forEach((row, index) => {
table.row.add([
index + 1,
row[0],
row[1],
formatDateFromTimestamp(row[2]),
row[3],
row[4],
getSlotLabel(row[5]),
getSlotLabel(row[6]),
row[7],
row[8],
row[9],
row[10],
row[11],
row[12],
row[13],
row[14],
` <button class="btn btn-sm btn-primary" onclick="viewDetails('${row[0]}')">View</button>`
]);
});
table.draw();
table.columns.adjust().responsive.recalc();
$('#hallDetailModal').modal('show');
}
function viewCounterBookingDetails(bookingId) {
viewDetails(bookingId);
}
</script>
</body>

3
src/main/resources/templates/fragments/Details.html

@ -141,8 +141,7 @@
<strong>Booking Status:</strong>
<span style="background-color: red;font-weight: bold; padding: 2px 5px;color:white">FAILURE</span><br><br>
<strong>Refund Status:</strong>
<span style="background-color: yellow; font-weight: bold; padding: 2px 5px;">Refund has to be initiated. Please contact
admin.</span>
<span style="background-color: yellow; font-weight: bold; padding: 2px 5px;">Refund has to be initiated.</span>
</p>
<!-- If booking status is 'Refunded' and refund status is 'Completed', display refund initiated message -->

4
src/main/resources/templates/fragments/logRegiOtpScript.html

@ -1141,11 +1141,15 @@
$('#cloginModal').on('shown.bs.modal', function () {
$('#cusername').val('');
$('#cpassword').val('');
// $("#error").text("").removeClass("text-danger");
});
// Unbind the modal shown event after it has been triggered once
$('#cloginModal').one('hide.bs.modal', function () {
$('#cloginModal').off('shown.bs.modal'); // Unbind the shown.bs.modal event
$("#error").text("");
$('#cusername').val('');
$('#cpassword').val('');
});
}

4
src/main/resources/templates/fragments/menuOfficer.html

@ -24,12 +24,12 @@
<span class="nav-main-link-name">Settlement Pending List</span>
</a>
</li>
<li class="nav-main-item">
<!--<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/officer/refundfailed-list">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">Refund Failed List</span>
</a>
</li>
</li>-->
<!-- <li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/officer/settlement-approved">
<i class="nav-main-link-icon fa fa-location-arrow"></i>

18
src/main/resources/templates/headquarters/refund-failedlist.html

@ -89,7 +89,7 @@
<th>Collection Pending</th>
<th>Refund Amount</th>
<th>Status</th>
<th>Action</th>
<!--<th>Action</th>-->
</tr>
</thead>
<tbody>
@ -109,12 +109,12 @@
<td class="text-center" th:text="${settlement.settlement.refundedAmount}">
</td>
<td class="text-center" th:text="${settlement.refundStatus}"></td>
<td>
<!--<td>
<p>
<span class="badge bg-warning" style="cursor: pointer;"
th:onclick="pending([[${settlement.settlement.settlementId}]])">Approve</span>
</p>
</td>
</td>-->
</tr>
</tbody>
</table>
@ -142,7 +142,7 @@
<th>User type</th>
<th>Reason for Booking</th>
<th>Refund Amount</th>
<th>Action</th>
<!--<th>Action</th>-->
</tr>
</thead>
<tbody>
@ -157,12 +157,12 @@
<td class="text-center" th:text="${cancelledbookings.reason}"></td>
<td class="text-center"
th:text="${cancelledbookings.depositAmount}"></td>
<td>
<!--<td>
<p>
<span class="badge bg-warning" style="cursor: pointer;"
th:onclick="cancelledbooking([[${cancelledbookings.bookingId}]])">Approve</span>
</p>
</td>
</td>-->
</tr>
</tbody>
</table>
@ -191,7 +191,7 @@
<th>Reason for Booking</th>
<th>Reason for Rejection</th>
<th>Refund Amount</th>
<th>Action</th>
<!--<th>Action</th>-->
</tr>
</thead>
<tbody>
@ -206,12 +206,12 @@
<td class="text-center" th:text="${rejectedbookings.reason}"></td>
<td class="text-center" th:text="${rejectedbookings.comments}"></td>
<td class="text-center" th:text="${rejectedbookings.amountReceived}"></td>
<td>
<!--<td>
<p>
<span class="badge bg-warning" style="cursor: pointer;"
th:onclick="rejectedbooking([[${rejectedbookings.bookingId}]])">Approve</span>
</p>
</td>
</td>-->
</tr>
</tbody>
</table>

31
src/main/resources/templates/headquarters/reports.html

@ -106,6 +106,7 @@
<option value="6" th:selected="${request=='6'}">Refund Details</option>
<option value="7" th:selected="${request=='7'}">Total Count</option>
<option value="8" th:selected="${request=='8'}">Extra Payments Info</option>
<option value="9" th:selected="${request=='9'}">Counter Details</option>
</select>
</div>
<!-- UsersDropdown2 -->
@ -586,7 +587,35 @@
</table>
</div>
<div class="table-responsive" id="countertable" th:if="${request}==9">
<table id="requestTable9" class="table table-striped table-bordered table-hover dataTable"
role="grid" width="99.5%">
<thead class="thead-dark">
<tr role="row">
<th>S.No</th>
<th>Counter ID</th>
<th>Total Bookings</th>
</tr>
</thead>
<tbody>
<tr th:each="counterdata, iterstat : ${counterBookingList}">
<td th:text="${iterstat.index + 1}"></td>
<td th:text="${counterdata[0]}"></td>
<td>
<button href="#"
th:attr="data-counter-id=${counterdata[0]}"
data-bs-toggle="modal"
data-bs-target="#bookingModal"
style="background-color: #2a807f; color: white; border: none; padding: 6px 12px; border-radius: 4px;"
onclick="showCounterTable(this)">
<span th:text="${counterdata[1]}"></span>
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>

6
src/main/resources/templates/user/dashboard.html

@ -294,7 +294,8 @@
</div>
<div class="col-sm-2">
<label for="startingslot">Starting Slot:</label>
<label for="startingslot">Starting Slot:<span
class="required-field">*</span></label>
<select class="form-control" id="startingslot"
name="startingslot"
aria-label="Starting Slot">
@ -310,7 +311,8 @@
</select>
</div>
<div class="col-sm-2">
<label for="endingslot">Ending Slot:</label>
<label for="endingslot">Ending Slot:<span
class="required-field">*</span></label>
<select class="form-control" id="endingslot"
name="endingslot" aria-label="Ending Slot">
<option value="0"

11
src/main/resources/templates/user/viewhistory.html

@ -1242,7 +1242,7 @@
</h1>
</div>
<!--Newly added for Reschedule Details-->
<div class="row col-md-12 col-lg-12 col-sm-12"
<!--<div class="row col-md-12 col-lg-12 col-sm-12"
id="rescheduleDetails"
style="display:none;margin-left: 0px;margin-top: -49px">
<div class="card-body">
@ -1280,7 +1280,7 @@
</tbody>
</table>
</div>
</div>
</div>-->
</div>
</div>
@ -1834,6 +1834,9 @@
document.getElementById("td_endingSlot").innerHTML = getTimeSlot(response.endingSlot);
document.getElementById("bookingstatus_td").innerHTML = response.bookingStatus;
console.log("before comments user view history...");
console.log("Comments..."+response.comments);
if (response.bookingStatus === 'REJECTED' && response.comments) {
document.getElementById("rejectionreasondiv").style.display = "block";
const rejectionCell = document.getElementById("reasonforrejection");
@ -1923,12 +1926,12 @@
document.getElementById("refundamountDetails").style.display = "block";
document.getElementById("td_bookingStatus").innerHTML = response.bookingStatus;
document.getElementById("td_refundStatus").innerHTML = response.refundStatus;
} else if(response.scheduleCount === 1){
} /*else if(response.scheduleCount === 1){
document.getElementById("rescheduleDetails").style.display = "block";
document.getElementById("td_res_start_date").innerHTML = response.startDate;
document.getElementById("td_res_end_date").innerHTML = response.endDate;
document.getElementById("td_res_date").innerHTML = response.updatedDate;
} else {
}*/ else {
document.getElementById("refundamountDetails").style.display = "none";
}
// Show the modal

Loading…
Cancel
Save