Browse Source

Six month old transactions option created for HQ login and mail integration implemented.

master
KaNi-04 3 months ago
parent
commit
c1314e9f28
  1. 6
      pom.xml
  2. 93
      src/main/java/com/gcc/communityHall/controller/HQAPIController.java
  3. 304
      src/main/java/com/gcc/communityHall/controller/HeadquartersController.java
  4. 47
      src/main/java/com/gcc/communityHall/controller/OfficerAPIController.java
  5. 118
      src/main/java/com/gcc/communityHall/entity/BookingDetails.java
  6. 105
      src/main/java/com/gcc/communityHall/entity/SixMonthMailLog.java
  7. 52
      src/main/java/com/gcc/communityHall/paymentService/entity/RefundResponse.java
  8. 17
      src/main/java/com/gcc/communityHall/paymentService/repository/TransRefundResRepository.java
  9. 2
      src/main/java/com/gcc/communityHall/paymentService/repository/TransactionResponseRepository.java
  10. 138
      src/main/java/com/gcc/communityHall/repository/BookingDetailsRepository.java
  11. 7
      src/main/java/com/gcc/communityHall/repository/BookingHistoryRepository.java
  12. 13
      src/main/java/com/gcc/communityHall/repository/SixMonthMailLogRepository.java
  13. 18
      src/main/java/com/gcc/communityHall/service/Impl/BookingServiceImpl.java
  14. 1
      src/main/java/com/gcc/communityHall/service/Impl/HallDetailServiceImpl.java
  15. 86
      src/main/java/com/gcc/communityHall/service/MailService.java
  16. 21
      src/main/resources/application-dev.properties
  17. 19
      src/main/resources/application-prod.properties
  18. 843
      src/main/resources/resources/templates/headquarters/sixmonthold-transactions.html
  19. 12
      src/main/resources/templates/admin/gccblocking-new.html
  20. 398
      src/main/resources/templates/admin/reports.html
  21. 7
      src/main/resources/templates/fragments/headquartersMenu.html
  22. 55
      src/main/resources/templates/headquarters/bookingwaiting.html
  23. 12
      src/main/resources/templates/headquarters/gccblocking-new.html
  24. 2
      src/main/resources/templates/headquarters/halldetailslist.html
  25. 362
      src/main/resources/templates/headquarters/reports.html
  26. 80
      src/main/resources/templates/headquarters/settlement-completed.html
  27. 1772
      src/main/resources/templates/headquarters/sixmonthold-transactions.html
  28. 15
      src/main/resources/templates/officer/gccblocking-new.html
  29. 56
      src/main/resources/templates/user/hallbookingform.html
  30. 19
      src/main/resources/templates/user/viewhallform.html
  31. 181
      src/main/resources/templates/user/viewhistory.html

6
pom.xml

@ -97,6 +97,12 @@
<scope>runtime</scope> <scope>runtime</scope>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<!-- Email sending via JavaMailSender -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>

93
src/main/java/com/gcc/communityHall/controller/HQAPIController.java

@ -170,6 +170,9 @@ public class HQAPIController {
@Autowired @Autowired
private HallReasonRestrictionRepository hallReasonRestrictionRepository; private HallReasonRestrictionRepository hallReasonRestrictionRepository;
@Autowired
private BookingServiceImpl bookingServiceImpl;
@Operation(summary = "Update HallDetails REST API", description = "REST API to update the Hall Details") @Operation(summary = "Update HallDetails REST API", description = "REST API to update the Hall Details")
@ApiResponses({ @ApiResponses({
@ApiResponse(responseCode = "200", description = "HTTP Status UPDATED", content = @Content(mediaType = "text/plain", schema = @Schema(implementation = HallDetails.class), examples = @ExampleObject(value = "Hall details updated successfully"))), @ApiResponse(responseCode = "200", description = "HTTP Status UPDATED", content = @Content(mediaType = "text/plain", schema = @Schema(implementation = HallDetails.class), examples = @ExampleObject(value = "Hall details updated successfully"))),
@ -181,6 +184,7 @@ public class HQAPIController {
@RequestParam("zone") String zone, @RequestParam("zone") String zone,
@RequestParam("division") String division, @RequestParam("division") String division,
@RequestParam("hallName") String hallName, @RequestParam("hallName") String hallName,
@RequestParam("hallArea") String hallArea,
@RequestParam("doorNo") String doorNo, @RequestParam("doorNo") String doorNo,
@RequestParam("street") String street, @RequestParam("street") String street,
@RequestParam("area") String area, @RequestParam("area") String area,
@ -210,6 +214,7 @@ public class HQAPIController {
hallDetails.setZone(zone); hallDetails.setZone(zone);
hallDetails.setDivision(division); hallDetails.setDivision(division);
hallDetails.setHallName(hallName); hallDetails.setHallName(hallName);
hallDetails.setHallArea(Float.parseFloat(hallArea));
hallDetails.setDoorNo(doorNo); hallDetails.setDoorNo(doorNo);
hallDetails.setStreet(street); hallDetails.setStreet(street);
hallDetails.setArea(area); hallDetails.setArea(area);
@ -1499,4 +1504,92 @@ public class HQAPIController {
.body("File upload failed: " + e.getMessage()); .body("File upload failed: " + e.getMessage());
} }
} }
@Operation(summary = "Settlement APPROVED REST API", description = "REST API for Updating the Refund Status to Approved by Settlement Id If the settlement is Approved")
// Updating the Refund Status to Approved by Settlement Id If the settlement is
// Approved
@PostMapping("/updateApprovedSettlementStatus/{bookingId}") // need to check this API for settlement approval
public ResponseEntity<Object> updateApprovedSettlementStatus(
@PathVariable("bookingId") int bookingId,
@RequestParam("status") BookingDetails.RefundStatus status,
@RequestParam("comments") String comments) {
Map<String, Object> response = new HashMap<>();
try {
System.out.println("settlementId1: " + bookingId);
System.out.println("status" + status);
System.out.println("comments" + comments);
// Update settlement status
Settlement updateSettlement = settlementService.updateSettlementStatus(bookingId, status, comments);
if (updateSettlement == null) {
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
}
System.out.println("updateSettlement12" + updateSettlement);
// ak
// Set approvedFlag and approvedFlagDate
updateSettlement.setApprovedFlag(1);
updateSettlement.setApprovedFlagDate(new Date());
settlementRepository.save(updateSettlement);
// ak
// Log the action
String adminname = (String) session.getAttribute("usertype");
Integer loginid = (Integer) session.getAttribute("id");
ApplicationLogs logs = new ApplicationLogs();
logs.setComments("Action by " + adminname);
logs.setLoginId(loginid);
logs.setBookingId(updateSettlement.getBookingDetails().getBookingId());
logs.setLogType("Booking Status: " + status.toString());
try {
InetAddress inetAddress = InetAddress.getLocalHost();
String hostname = InetAddress.getLocalHost().getHostName();
logs.setIpaddress(inetAddress.getHostAddress());
logs.setSystemName(hostname);
} catch (UnknownHostException e) {
e.printStackTrace();
}
applicationLogsRepository.save(logs);
// Process refund request
String refundResponse = bookingServiceImpl
.processRefundRequest(updateSettlement.getBookingDetails().getBookingId());
// ak
// Prepare response map
response.put("settlement", updateSettlement);
response.put("approvedFlag", updateSettlement.getApprovedFlag());
response.put("approvedFlagDate", updateSettlement.getApprovedFlagDate());
if (refundResponse.contains("successful")) {
// Refund success, return updated settlement and status
// return new ResponseEntity<>(updateSettlement, HttpStatus.OK);
return new ResponseEntity<>(response, HttpStatus.OK);
} else {
// Refund failure, update refund status to FAILURE
bookingService.updateRefundStatus(updateSettlement.getBookingDetails().getBookingId(),
BookingDetails.RefundStatus.FAILURE);
Map<String, Object> responses = new HashMap<>();
responses.put("approvedFlag", 1);
responses.put("message", "Refund processing failed: " + refundResponse);
responses.put("status", "FAILURE");
return new ResponseEntity<>(responses, HttpStatus.INTERNAL_SERVER_ERROR);
// return new ResponseEntity<>("Refund processing failed: " + refundResponse,
// HttpStatus.INTERNAL_SERVER_ERROR);
}
} catch (Exception e) {
response.put("approvedFlag", 1);
response.put("message", "Exception while approving settlement: " + e.getMessage());
return new ResponseEntity<>(response, HttpStatus.INTERNAL_SERVER_ERROR);
// return new ResponseEntity<>("An error occurred while processing the
// settlement for Settlement ID: " + settlementId,
// HttpStatus.INTERNAL_SERVER_ERROR);
}
}
} }

304
src/main/java/com/gcc/communityHall/controller/HeadquartersController.java

@ -1,5 +1,9 @@
package com.gcc.communityHall.controller; package com.gcc.communityHall.controller;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import java.util.function.Predicate; import java.util.function.Predicate;
@ -7,13 +11,27 @@ import java.util.stream.Collectors;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.gcc.communityHall.entity.ApplicationLogs;
import com.gcc.communityHall.entity.BookingHistory;
import com.gcc.communityHall.entity.GccBlockingDate; import com.gcc.communityHall.entity.GccBlockingDate;
import com.gcc.communityHall.entity.Login; import com.gcc.communityHall.entity.Login;
import com.gcc.communityHall.entity.LoginHallId; import com.gcc.communityHall.entity.LoginHallId;
import com.gcc.communityHall.entity.RefundTransaction;
import com.gcc.communityHall.entity.Settlement;
import com.gcc.communityHall.entity.SettlementHistory;
import com.gcc.communityHall.entity.SixMonthMailLog;
import com.gcc.communityHall.others.AppConfig; import com.gcc.communityHall.others.AppConfig;
import com.gcc.communityHall.paymentService.entity.RefundResponse;
import com.gcc.communityHall.paymentService.repository.TransRefundResRepository;
import com.gcc.communityHall.repository.ApplicationLogsRepository;
import com.gcc.communityHall.repository.BookingHistoryRepository;
import com.gcc.communityHall.repository.GccBlockingDateRepository; import com.gcc.communityHall.repository.GccBlockingDateRepository;
import com.gcc.communityHall.repository.LoginHallIdRepository; import com.gcc.communityHall.repository.LoginHallIdRepository;
import com.gcc.communityHall.repository.LoginRepository; import com.gcc.communityHall.repository.LoginRepository;
import com.gcc.communityHall.repository.RefundTransactionRepository;
import com.gcc.communityHall.repository.SettlementHistoryRepository;
import com.gcc.communityHall.repository.SettlementRepository;
import com.gcc.communityHall.repository.SixMonthMailLogRepository;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -34,6 +52,7 @@ import com.gcc.communityHall.repository.HallDetailsRepository;
import com.gcc.communityHall.repository.UsersRepository; import com.gcc.communityHall.repository.UsersRepository;
import com.gcc.communityHall.service.BookingService; import com.gcc.communityHall.service.BookingService;
import com.gcc.communityHall.service.HallDetailService; import com.gcc.communityHall.service.HallDetailService;
import com.gcc.communityHall.service.MailService;
import com.gcc.communityHall.service.ReasonMasterService; import com.gcc.communityHall.service.ReasonMasterService;
import com.gcc.communityHall.service.UserService; import com.gcc.communityHall.service.UserService;
@ -76,6 +95,30 @@ public class HeadquartersController {
@Autowired @Autowired
private HallDetailsRepository hallDetailsRepository; private HallDetailsRepository hallDetailsRepository;
@Autowired
private SixMonthMailLogRepository sixMonthMailLogRepository;
@Autowired
private MailService mailService;
@Autowired
private BookingHistoryRepository bookingHistoryRepository;
@Autowired
private SettlementHistoryRepository settlementHistoryRepository;
@Autowired
private SettlementRepository settlementRepository;
@Autowired
private RefundTransactionRepository refundTransactionRepository;
@Autowired
private TransRefundResRepository transRefundResRepository;
@Autowired
private ApplicationLogsRepository applicationLogsRepository;
@GetMapping("/dashboard") @GetMapping("/dashboard")
public String viewDashboard( public String viewDashboard(
@RequestParam(required = false, defaultValue = "all zones") String zone, @RequestParam(required = false, defaultValue = "all zones") String zone,
@ -1086,4 +1129,265 @@ public class HeadquartersController {
} }
// Six months old transaction details – redesigned with 4 tabs
@GetMapping("/sixmonthold-transactions")
public String SixMonthOldTransactions(Model model, HttpSession session) {
String headquartersname = (String) session.getAttribute("usertype");
if (headquartersname != null && "headquarters".equals(headquartersname)) {
model.addAttribute("headquartersname", headquartersname);
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("title", "sixmonthold-transactions");
String zone = (String) session.getAttribute("zone");
model.addAttribute("zone", zone);
List<Map<String, Object>> sixMonthOldBookings = normalizeMapKeys(
bookingDetailsRepository.findSixMonthOldNonCancelledRejectedBookings());
List<Map<String, Object>> cancelledBookings = normalizeMapKeys(
bookingDetailsRepository.findSixMonthOldCancelledBookings());
List<Map<String, Object>> rejectedBookings = normalizeMapKeys(
bookingDetailsRepository.findSixMonthOldRejectedBookings());
List<Map<String, Object>> mailSentBookings = normalizeMapKeys(
bookingDetailsRepository.findMailSentBookings());
model.addAttribute("sixMonthOldBookings", sixMonthOldBookings);
model.addAttribute("cancelledBookings", cancelledBookings);
model.addAttribute("rejectedBookings", rejectedBookings);
model.addAttribute("mailSentBookings", mailSentBookings);
return "headquarters/sixmonthold-transactions";
} else {
session.invalidate();
return "redirect:/communityhall/login";
}
}
private List<Map<String, Object>> normalizeMapKeys(List<Map<String, Object>> list) {
if (list == null)
return new ArrayList<>();
List<Map<String, Object>> result = new ArrayList<>();
for (Map<String, Object> map : list) {
Map<String, Object> newMap = new HashMap<>();
for (Map.Entry<String, Object> entry : map.entrySet()) {
if (entry.getKey() != null) {
newMap.put(entry.getKey().toLowerCase(), entry.getValue());
}
}
result.add(newMap);
}
return result;
}
/**
* Marks a booking as "mail sent":
* 1. Stamps mail_sent = 1, mail_sent_date = NOW() on booking_details.
* 2. Inserts a row into six_month_mail_log for audit history.
*/
@PostMapping("/sixmonthold-transactions/markMailSent")
@ResponseBody
@Transactional
public Map<String, Object> markMailSent(
@RequestParam("bookingId") int bookingId,
@RequestParam("bookingStatus") String bookingStatus,
@RequestParam(value = "transactionId", required = false) String transactionId,
@RequestParam(value = "tpslId", required = false) String tpslId,
@RequestParam(value = "transactionDate", required = false) String transactionDate,
@RequestParam(value = "refundAmount", required = false) Double refundAmount,
HttpSession session) {
Map<String, Object> response = new HashMap<>();
String headquartersname = (String) session.getAttribute("usertype");
if (headquartersname == null || !"headquarters".equals(headquartersname)) {
response.put("status", "error");
response.put("message", "Unauthorized");
return response;
}
try {
// 1. Send the actual SMTP email via JavaMailSender
String mailBody = mailService.sendRefundFollowupMail(
bookingId, bookingStatus, transactionId, tpslId, transactionDate, refundAmount);
// 2. Stamp booking_details: mail_sent = 1, mail_sent_date = NOW()
bookingDetailsRepository.markMailSent(bookingId);
// 3. Write audit log entry
SixMonthMailLog log = new SixMonthMailLog(
bookingId, bookingStatus, transactionId, tpslId, refundAmount, headquartersname, mailBody);
sixMonthMailLogRepository.save(log);
response.put("status", "success");
response.put("message", "Mail sent and recorded successfully for booking " + bookingId);
} catch (Exception e) {
response.put("status", "error");
response.put("message", "Error sending mail: " + e.getMessage());
}
return response;
}
/**
* Update Refund Details for Mail Sent Bookings (new method – does NOT touch
* existing endpoints).
*
* ID logic:
* - Cancelled / Rejected → bookingId is the primary reference.
* - Approved → settlementId is the primary reference;
* bookingId used to fetch BookingDetails.
*
* Tables updated (in order):
* 1. booking_history – archive current BookingDetails snapshot.
* 2. booking_details – bookingStatus=COMPLETED, refundStatus=COMPLETED.
* 3. settlement_history – archive Settlement snapshot (APPROVED only).
* 4. settlement – update comments + updatedDate (APPROVED only).
* 5. refund_transaction – upsert.
* 6. refund_response – upsert with arn_number.
* 7. application_logs – audit entry.
*/
@PostMapping("/sixmonthold-transactions/updateRefundDetails")
@ResponseBody
@Transactional
public Map<String, Object> updateRefundDetails(
@RequestParam("bookingId") int bookingId,
@RequestParam(value = "settlementId", required = false) Integer settlementId,
@RequestParam("bookingStatus") String bookingStatus,
@RequestParam("refundStatus") String refundStatus,
@RequestParam("refundDate") String refundDate,
@RequestParam("comments") String comments,
@RequestParam(value = "arnNumber", required = false) String arnNumber,
HttpSession session) {
Map<String, Object> response = new HashMap<>();
String headquartersname = (String) session.getAttribute("usertype");
if (headquartersname == null || !"headquarters".equals(headquartersname)) {
response.put("status", "error");
response.put("message", "Unauthorized");
return response;
}
try {
// Step 1: Fetch BookingDetails
BookingDetails booking = bookingDetailsRepository.findById(bookingId).orElse(null);
if (booking == null) {
response.put("status", "error");
response.put("message", "Booking not found for ID: " + bookingId);
return response;
}
// Get refundAmount and transactionId from latest SixMonthMailLog
List<SixMonthMailLog> mailLogs = sixMonthMailLogRepository.findByBookingIdOrderBySentAtDesc(bookingId);
SixMonthMailLog latestLog = (mailLogs != null && !mailLogs.isEmpty()) ? mailLogs.get(0) : null;
double refundedAmount = (latestLog != null && latestLog.getRefundAmount() != null)
? latestLog.getRefundAmount()
: 0.0;
String transactionIdFromLog = (latestLog != null) ? latestLog.getTransactionId() : null;
// Step 2: Archive BookingDetails → booking_history
BookingHistory bookingHistory = new BookingHistory();
bookingHistory.setBookingStatus(booking.getBookingStatus());
bookingHistory.setRefundStatus(booking.getRefundStatus());
bookingHistory.setComments("Archived before updateRefundDetails. " + comments);
bookingHistory.setUpdatedBy("HQ");
bookingHistory.setCdate(new Date());
bookingHistory.setStartDate(booking.getStartDate());
bookingHistory.setEndDate(booking.getEndDate());
bookingHistory.setBookingDetails(booking);
bookingHistoryRepository.save(bookingHistory);
// Step 3: Update BookingDetails
booking.setBookingStatus(BookingDetails.BookingStatus.COMPLETED);
booking.setRefundStatus(BookingDetails.RefundStatus.COMPLETED);
booking.setComments(comments);
booking.setUpdatedDate(new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
bookingDetailsRepository.save(booking);
// Steps 4 & 5: Settlement (APPROVED bookings only)
boolean isApproved = "APPROVED".equalsIgnoreCase(bookingStatus);
if (isApproved && booking.getSettlement() != null) {
Settlement settlement = booking.getSettlement();
// Step 4: Archive Settlement → settlement_history
SettlementHistory settlementHistory = new SettlementHistory();
settlementHistory.setSettlementId(settlement.getSettlementId());
settlementHistory.setComments(settlement.getComments());
settlementHistory.setCdate(settlement.getCdate());
settlementHistory.setDamageAmount(settlement.getDamageAmount());
settlementHistory.setEbAmount(settlement.getEbAmount());
settlementHistory.setDepositAmount(settlement.getDepositAmount());
settlementHistory.setRefundedAmount(settlement.getRefundedAmount());
settlementHistory.setUpdatedDate(settlement.getUpdatedDate());
settlementHistory.setUpdatedId(settlement.getUpdatedId());
settlementHistory.setChallon(settlement.getChallon());
settlementHistory.setDddate(settlement.getDddate());
settlementHistory.setDdnumber(settlement.getDdnumber());
settlementHistory.setBookingDetails(booking);
settlementHistory.setCollectionPending(settlement.getCollectionPending());
settlementHistory.setDdamount(settlement.getDdamount());
settlementHistory.setChallonnumber(settlement.getChallonnumber());
settlementHistory.setCollectionStatus(settlement.getCollectionStatus());
settlementHistory.setShDate(new Date());
settlementHistoryRepository.save(settlementHistory);
// Step 5: Update Settlement
settlement.setComments(comments);
settlement.setUpdatedDate(new Date());
settlement.setUpdatedId("HQ");
settlementRepository.save(settlement);
}
// Step 6: Upsert RefundTransaction
RefundTransaction refundTransaction = refundTransactionRepository.findByBookingId(bookingId);
if (refundTransaction == null) {
refundTransaction = new RefundTransaction();
refundTransaction.setBookingDetails(booking);
}
refundTransaction.setTransactionId(transactionIdFromLog);
refundTransaction.setAmountRefunded(refundedAmount);
refundTransaction.setCdate(new Date());
refundTransaction.setRefundStatus("0400");
refundTransactionRepository.save(refundTransaction);
// Step 7: Upsert RefundResponse
RefundResponse refundResponse = transRefundResRepository.findByBookingId(bookingId);
if (refundResponse == null) {
refundResponse = new RefundResponse();
}
refundResponse.setAmount(String.valueOf(booking.getAmountReceived()));
refundResponse.setBalaceAmount(String.valueOf(refundedAmount));
refundResponse.setBookingId(bookingId);
refundResponse.setDate(LocalDate.now());
refundResponse.setStatusCode("0400");
refundResponse.setTxansactionId(transactionIdFromLog);
refundResponse.setUserId("HQ");
refundResponse.setCdate(LocalDateTime.now());
refundResponse.setArnNumber(arnNumber);
refundResponse.setRefundedDate(LocalDate.parse(refundDate));
transRefundResRepository.save(refundResponse);
// Step 8: Application Log
ApplicationLogs appLog = new ApplicationLogs();
appLog.setBookingId(bookingId);
appLog.setLogType("UPDATE_REFUND_DETAILS");
appLog.setComments("RefundStatus set to " + refundStatus
+ " by HQ. ARN: " + arnNumber + ". Comments: " + comments);
Integer loginId = (Integer) session.getAttribute("id");
if (loginId != null)
appLog.setLoginId(loginId);
try {
InetAddress inetAddress = InetAddress.getLocalHost();
appLog.setIpaddress(inetAddress.getHostAddress());
appLog.setSystemName(InetAddress.getLocalHost().getHostName());
} catch (UnknownHostException uhe) {
// non-fatal
}
applicationLogsRepository.save(appLog);
response.put("status", "success");
response.put("message", "Refund details updated successfully for Booking ID " + bookingId);
response.put("bookingId", bookingId);
} catch (Exception e) {
response.put("status", "error");
response.put("message", "Error updating refund details: " + e.getMessage());
}
return response;
}
} }

47
src/main/java/com/gcc/communityHall/controller/OfficerAPIController.java

@ -40,6 +40,7 @@ import com.gcc.communityHall.repository.BookingDetailsRepository;
import com.gcc.communityHall.repository.BookingHistoryRepository; import com.gcc.communityHall.repository.BookingHistoryRepository;
import com.gcc.communityHall.repository.CounterRefundListRepository; import com.gcc.communityHall.repository.CounterRefundListRepository;
import com.gcc.communityHall.repository.GccBlockingDateRepository; import com.gcc.communityHall.repository.GccBlockingDateRepository;
import com.gcc.communityHall.repository.LoginRepository;
import com.gcc.communityHall.repository.SettlementRepository; import com.gcc.communityHall.repository.SettlementRepository;
import com.gcc.communityHall.repository.UsersRepository; import com.gcc.communityHall.repository.UsersRepository;
import com.gcc.communityHall.service.BookingService; import com.gcc.communityHall.service.BookingService;
@ -56,6 +57,7 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpSession; import jakarta.servlet.http.HttpSession;
import jakarta.transaction.Transactional;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
@Tag(name = "CRUD REST APIs for Officer in CommunityHall", description = "CRUD REST APIs in CommunityHall to CREATE, UPDATE, FETCH AND DELETE Booking details") @Tag(name = "CRUD REST APIs for Officer in CommunityHall", description = "CRUD REST APIs in CommunityHall to CREATE, UPDATE, FETCH AND DELETE Booking details")
@ -99,6 +101,8 @@ public class OfficerAPIController {
@Autowired @Autowired
private HallDetailService hallDetailService; private HallDetailService hallDetailService;
@Autowired @Autowired
private BookingHistoryRepository bookingHistoryRepository;
@Autowired
private WhatsappMsgServiceImpl whatsappMsgServiceImpl; private WhatsappMsgServiceImpl whatsappMsgServiceImpl;
@Autowired @Autowired
private PaymentsService paymentsService; private PaymentsService paymentsService;
@ -112,6 +116,9 @@ public class OfficerAPIController {
@Autowired @Autowired
private ApplicationLogsRepository applicationLogsRepository; private ApplicationLogsRepository applicationLogsRepository;
@Autowired
private LoginRepository loginRepository;
@Operation(summary = "Retriving the User Details by userId REST API", description = "REST API for Retriving the User Details by UserId") @Operation(summary = "Retriving the User Details by userId REST API", description = "REST API for Retriving the User Details by UserId")
// Getting User Details by User Id // Getting User Details by User Id
@GetMapping("/getUserDetails") @GetMapping("/getUserDetails")
@ -153,6 +160,44 @@ public class OfficerAPIController {
return ResponseEntity.ok(book); return ResponseEntity.ok(book);
} }
@Operation(summary = "Booking History by Booking Id REST API", description = "REST API for Retrieving the Booking History records by Booking Id")
// Retrieving all Booking History records for a given booking
@GetMapping("/getBookingHistory")
public ResponseEntity<?> getBookingHistory(@RequestParam int bookingId) {
List<com.gcc.communityHall.entity.BookingHistory> historyList = bookingHistoryRepository
.findAllByBookingId(bookingId);
return ResponseEntity.ok(historyList);
}
@Operation(summary = "Acknowledge NOC Date-Change Notification REST API", description = "REST API to mark that the officer has seen the date-change alert for a rescheduled booking")
@PostMapping("/acknowledgeNocNotification")
@Transactional
public ResponseEntity<?> acknowledgeNocNotification(@RequestParam int bookingId) {
try {
// Fetch the officer's name from the login table using the session login ID
Integer loginId = (Integer) session.getAttribute("id");
String officerName = "Unknown";
if (loginId != null) {
com.gcc.communityHall.entity.Login login = loginRepository.findLoginById(loginId);
if (login != null && login.getName() != null) {
officerName = login.getName();
}
}
// Update the noc_acknowledged flag and the officer name in booking_details
bookingDetailsRepository.updateNocAcknowledged(bookingId, officerName);
Map<String, Object> response = new HashMap<>();
response.put("status", "success");
response.put("bookingId", bookingId);
response.put("acknowledgedBy", officerName);
return ResponseEntity.ok(response);
} catch (Exception e) {
Map<String, Object> error = new HashMap<>();
error.put("status", "error");
error.put("message", e.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(error);
}
}
@Operation(summary = "Settlement APPROVED REST API", description = "REST API for Updating the Refund Status to Approved by Settlement Id If the settlement is Approved") @Operation(summary = "Settlement APPROVED REST API", description = "REST API for Updating the Refund Status to Approved by Settlement Id If the settlement is Approved")
// Updating the Refund Status to Approved by Settlement Id If the settlement is // Updating the Refund Status to Approved by Settlement Id If the settlement is
// Approved // Approved
@ -653,6 +698,8 @@ public class OfficerAPIController {
@RequestParam(value = "document", required = false) MultipartFile[] documents, // Handle documents @RequestParam(value = "document", required = false) MultipartFile[] documents, // Handle documents
HttpSession session) { HttpSession session) {
System.out.println("selectedBookings...." + selectedBookings);
// Your existing logic // Your existing logic
String updatedBy = (String) session.getAttribute("employeeId"); String updatedBy = (String) session.getAttribute("employeeId");

118
src/main/java/com/gcc/communityHall/entity/BookingDetails.java

@ -1,6 +1,7 @@
package com.gcc.communityHall.entity; package com.gcc.communityHall.entity;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
@ -12,48 +13,52 @@ public class BookingDetails {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private int bookingId; private int bookingId;
public enum BookingStatus { public enum BookingStatus {
PENDING, APPROVED, REJECTED, CANCELED, PAYMENT_FAILURE, GCC_BLOCKED, REFUNDED ,COMPLETED, GCC_UNBLOCKED , WAITING_FOR_NOC , WAITING_FOR_NOC_APPROVAL
PENDING, APPROVED, REJECTED, CANCELED, PAYMENT_FAILURE, GCC_BLOCKED, REFUNDED, COMPLETED, GCC_UNBLOCKED,
WAITING_FOR_NOC, WAITING_FOR_NOC_APPROVAL
} }
public enum RefundStatus { public enum RefundStatus {
APPROVED, WAITING, INITIATED, REJECTED, COMPLETED, NA , FAILURE , CLOSED
APPROVED, WAITING, INITIATED, REJECTED, COMPLETED, NA, FAILURE, CLOSED
} }
public enum BookingType { public enum BookingType {
ONLINE,OFFLINE
ONLINE, OFFLINE
} }
@Column(name="booking_type")
@Column(name = "booking_type")
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
private BookingType bookingtype; private BookingType bookingtype;
@Column(name="no_of_days")
@Column(name = "no_of_days")
private double noOfDays; private double noOfDays;
@Column(name="start_date")
@Column(name = "start_date")
private String startDate; private String startDate;
@Column(name="end_date")
@Column(name = "end_date")
private String endDate; private String endDate;
@Column(name="starting_slot")
@Column(name = "starting_slot")
private int startingSlot; private int startingSlot;
@Column(name="ending_slot")
@Column(name = "ending_slot")
private int endingSlot; private int endingSlot;
@Column(name="booking_date")
@Column(name = "booking_date")
private LocalDate bookingDate; private LocalDate bookingDate;
@Column(name="booking_status")
@Column(name = "booking_status")
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
private BookingStatus bookingStatus = BookingStatus.PENDING; private BookingStatus bookingStatus = BookingStatus.PENDING;
@Column(name="deposit_amount")
@Column(name = "deposit_amount")
private double depositAmount; private double depositAmount;
@Column(name="hall_amount")
@Column(name = "hall_amount")
private double hallAmount; private double hallAmount;
@Column(name="amount_received")
@Column(name = "amount_received")
private double amountReceived; private double amountReceived;
private double gst; private double gst;
@Column(name="approved_by")
@Column(name = "approved_by")
private String approvedBy; private String approvedBy;
@Column(name="refund_status")
@Column(name = "refund_status")
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
private RefundStatus refundStatus; private RefundStatus refundStatus;
@Column(name="updated_date")
@Column(name = "updated_date")
private String updatedDate; private String updatedDate;
private String reason; private String reason;
private int scheduleCount; private int scheduleCount;
@ -61,46 +66,57 @@ public class BookingDetails {
private String relationship; private String relationship;
private String comments; private String comments;
//ak
@Column(name = "noc_acknowledged", columnDefinition = "INT DEFAULT 0")
private int nocAcknowledged;
@Column(name = "noc_acknowledged_by")
private String nocAcknowledgedBy;
// ak
@Column(name = "booking_ref_id") @Column(name = "booking_ref_id")
private String bookingRefId;
private String bookingRefId;
@OneToOne(cascade = CascadeType.ALL,fetch = FetchType.EAGER)
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinColumn(name = "counterdetails_counter_id") @JoinColumn(name = "counterdetails_counter_id")
private CounterDetails counterDetails; private CounterDetails counterDetails;
@ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.EAGER)
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private Users users; private Users users;
@ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.EAGER)
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private HallDetails hallDetails; private HallDetails hallDetails;
@OneToMany(cascade = CascadeType.ALL,fetch = FetchType.EAGER,mappedBy = "bookingDetails")
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "bookingDetails")
private List<BookingHistory> bookingHistories; private List<BookingHistory> bookingHistories;
@OneToMany(cascade = CascadeType.ALL,fetch = FetchType.LAZY,mappedBy = "bookingDetails")
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bookingDetails")
List<BookingDocuments> bookingDocumentsList; List<BookingDocuments> bookingDocumentsList;
@OneToOne(cascade = CascadeType.ALL,fetch = FetchType.EAGER,mappedBy = "bookingDetails")
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "bookingDetails")
private Settlement settlement; private Settlement settlement;
@OneToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY,mappedBy = "bookingDetails")
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bookingDetails")
private EbDetails ebDetails; private EbDetails ebDetails;
@OneToMany(cascade = CascadeType.ALL,fetch = FetchType.LAZY,mappedBy = "bookingDetails")
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bookingDetails")
private List<Damage> damageList; private List<Damage> damageList;
@OneToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY,mappedBy = "bookingDetails")
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bookingDetails")
private Payments payments; private Payments payments;
@OneToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY,mappedBy = "bookingDetails")
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bookingDetails")
private ExtraPayments extrapayments; private ExtraPayments extrapayments;
@OneToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY,mappedBy = "bookingDetails")
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bookingDetails")
private RefundTransaction refundTransaction; private RefundTransaction refundTransaction;
private String counterId; private String counterId;
@Column(name = "mail_sent", columnDefinition = "Boolean DEFAULT 0")
private boolean mailSent;
@Column(name = "mailsent_date")
private LocalDateTime mailSentDate;
public int getBookingId() { public int getBookingId() {
return bookingId; return bookingId;
@ -116,14 +132,16 @@ private String bookingRefId;
public void setNoOfDays(double days) { public void setNoOfDays(double days) {
this.noOfDays = days; this.noOfDays = days;
}//ak
}
// ak
public String getBookingRefId() { public String getBookingRefId() {
return bookingRefId; return bookingRefId;
}
}
public void setBookingRefId(String bookingRefId) {
public void setBookingRefId(String bookingRefId) {
this.bookingRefId = bookingRefId; this.bookingRefId = bookingRefId;
}
}
public String getStartDate() { public String getStartDate() {
return startDate; return startDate;
@ -349,6 +367,22 @@ public void setBookingRefId(String bookingRefId) {
this.comments = comments; this.comments = comments;
} }
public int getNocAcknowledged() {
return nocAcknowledged;
}
public void setNocAcknowledged(int nocAcknowledged) {
this.nocAcknowledged = nocAcknowledged;
}
public String getNocAcknowledgedBy() {
return nocAcknowledgedBy;
}
public void setNocAcknowledgedBy(String nocAcknowledgedBy) {
this.nocAcknowledgedBy = nocAcknowledgedBy;
}
public ExtraPayments getExtrapayments() { public ExtraPayments getExtrapayments() {
return extrapayments; return extrapayments;
} }
@ -365,4 +399,20 @@ public void setBookingRefId(String bookingRefId) {
this.counterId = counterId; this.counterId = counterId;
} }
public boolean getMailSent() {
return mailSent;
}
public void setMailSent(boolean mailSent) {
this.mailSent = mailSent;
}
public LocalDateTime getMailSentDate() {
return mailSentDate;
}
public void setMailSentDate(LocalDateTime mailSentDate) {
this.mailSentDate = mailSentDate;
}
} }

105
src/main/java/com/gcc/communityHall/entity/SixMonthMailLog.java

@ -0,0 +1,105 @@
package com.gcc.communityHall.entity;
import jakarta.persistence.*;
import java.time.LocalDateTime;
/**
* Audit log table that records every refund-follow-up mail dispatched
* for 6-month-old bookings from the /sixmonthold-transactions page.
*
* DDL (run once):
* CREATE TABLE six_month_mail_log (
* id BIGINT AUTO_INCREMENT PRIMARY KEY,
* booking_id INT NOT NULL,
* booking_status VARCHAR(50),
* transaction_id VARCHAR(100),
* tpsl_id VARCHAR(100),
* refund_amount DOUBLE,
* sent_by VARCHAR(100),
* sent_at DATETIME DEFAULT CURRENT_TIMESTAMP,
* mail_content TEXT
* );
*
* Also add to booking_details (run once):
* ALTER TABLE booking_details
* ADD COLUMN mail_sent TINYINT(1) DEFAULT 0,
* ADD COLUMN mail_sent_date DATETIME NULL;
*/
@Entity
@Table(name = "six_month_mail_log")
public class SixMonthMailLog {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "booking_id", nullable = false)
private int bookingId;
@Column(name = "booking_status", length = 50)
private String bookingStatus;
@Column(name = "transaction_id", length = 100)
private String transactionId;
@Column(name = "tpsl_id", length = 100)
private String tpslId;
@Column(name = "refund_amount")
private Double refundAmount;
@Column(name = "sent_by", length = 100)
private String sentBy;
@Column(name = "sent_at")
private LocalDateTime sentAt;
@Column(name = "mail_content", columnDefinition = "TEXT")
private String mailContent;
// ──── Constructors ────────────────────────────────────────────────────────
public SixMonthMailLog() {
}
public SixMonthMailLog(int bookingId, String bookingStatus, String transactionId,
String tpslId, Double refundAmount, String sentBy, String mailContent) {
this.bookingId = bookingId;
this.bookingStatus = bookingStatus;
this.transactionId = transactionId;
this.tpslId = tpslId;
this.refundAmount = refundAmount;
this.sentBy = sentBy;
this.sentAt = LocalDateTime.now();
this.mailContent = mailContent;
}
// ──── Getters & Setters ───────────────────────────────────────────────────
public Long getId() { return id; }
public void setId(Long id) { this.id = id; }
public int getBookingId() { return bookingId; }
public void setBookingId(int bookingId) { this.bookingId = bookingId; }
public String getBookingStatus() { return bookingStatus; }
public void setBookingStatus(String bookingStatus) { this.bookingStatus = bookingStatus; }
public String getTransactionId() { return transactionId; }
public void setTransactionId(String transactionId) { this.transactionId = transactionId; }
public String getTpslId() { return tpslId; }
public void setTpslId(String tpslId) { this.tpslId = tpslId; }
public Double getRefundAmount() { return refundAmount; }
public void setRefundAmount(Double refundAmount) { this.refundAmount = refundAmount; }
public String getSentBy() { return sentBy; }
public void setSentBy(String sentBy) { this.sentBy = sentBy; }
public LocalDateTime getSentAt() { return sentAt; }
public void setSentAt(LocalDateTime sentAt) { this.sentAt = sentAt; }
public String getMailContent() { return mailContent; }
public void setMailContent(String mailContent) { this.mailContent = mailContent; }
}

52
src/main/java/com/gcc/communityHall/paymentService/entity/RefundResponse.java

@ -1,6 +1,7 @@
package com.gcc.communityHall.paymentService.entity; package com.gcc.communityHall.paymentService.entity;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
@ -18,42 +19,60 @@ public class RefundResponse {
private int bookingId; private int bookingId;
private String txansactionId; private String txansactionId;
private String statusCode; private String statusCode;
// private String tpslTxnId;
// private String tpslTxnId;
@Column(name = "date") @Column(name = "date")
private LocalDate date; private LocalDate date;
@Column(length = 5000) @Column(length = 5000)
private String response; private String response;
private String Amount; private String Amount;
@Column(name = "arn_number", length = 100)
private String arnNumber;
@Column(name = "cdate")
private LocalDateTime cdate;
private String balaceAmount; private String balaceAmount;
@Column(name = "refunded_date")
private LocalDate refundedDate;
public Integer getId() { public Integer getId() {
return id; return id;
} }
public void setId(Integer id) { public void setId(Integer id) {
this.id = id; this.id = id;
} }
public String getUserId() { public String getUserId() {
return userId; return userId;
} }
public void setUserId(String userId) { public void setUserId(String userId) {
this.userId = userId; this.userId = userId;
} }
public int getBookingId() { public int getBookingId() {
return bookingId; return bookingId;
} }
public void setBookingId(int bookingId) { public void setBookingId(int bookingId) {
this.bookingId = bookingId; this.bookingId = bookingId;
} }
public String getTxansactionId() { public String getTxansactionId() {
return txansactionId; return txansactionId;
} }
public void setTxansactionId(String txansactionId) { public void setTxansactionId(String txansactionId) {
this.txansactionId = txansactionId; this.txansactionId = txansactionId;
} }
public String getStatusCode() { public String getStatusCode() {
return statusCode; return statusCode;
} }
public void setStatusCode(String statusCode) { public void setStatusCode(String statusCode) {
this.statusCode = statusCode; this.statusCode = statusCode;
} }
@ -61,26 +80,57 @@ public class RefundResponse {
public LocalDate getDate() { public LocalDate getDate() {
return date; return date;
} }
public void setDate(LocalDate date) { public void setDate(LocalDate date) {
this.date = date; this.date = date;
} }
public String getResponse() { public String getResponse() {
return response; return response;
} }
public void setResponse(String response) { public void setResponse(String response) {
this.response = response; this.response = response;
} }
public String getAmount() { public String getAmount() {
return Amount; return Amount;
} }
public void setAmount(String amount) { public void setAmount(String amount) {
Amount = amount; Amount = amount;
} }
public String getBalaceAmount() { public String getBalaceAmount() {
return balaceAmount; return balaceAmount;
} }
public void setBalaceAmount(String balaceAmount) { public void setBalaceAmount(String balaceAmount) {
this.balaceAmount = balaceAmount; this.balaceAmount = balaceAmount;
} }
public String getArnNumber() {
return arnNumber;
}
public void setArnNumber(String arnNumber) {
this.arnNumber = arnNumber;
}
public LocalDateTime getCdate() {
return cdate;
}
public void setCdate(LocalDateTime cdate) {
this.cdate = cdate;
}
public LocalDate getRefundedDate() {
return refundedDate;
}
public void setRefundedDate(LocalDate refundedDate) {
this.refundedDate = refundedDate;
}
} }

17
src/main/java/com/gcc/communityHall/paymentService/repository/TransRefundResRepository.java

@ -10,26 +10,27 @@ import org.springframework.stereotype.Repository;
import com.gcc.communityHall.entity.RefundTransaction; import com.gcc.communityHall.entity.RefundTransaction;
import com.gcc.communityHall.paymentService.entity.RefundResponse; import com.gcc.communityHall.paymentService.entity.RefundResponse;
@Repository @Repository
public interface TransRefundResRepository extends JpaRepository<RefundResponse,Integer>{
public interface TransRefundResRepository extends JpaRepository<RefundResponse, Integer> {
@Query(value = "SELECT * FROM refund_response where user_id=:userId", nativeQuery = true) @Query(value = "SELECT * FROM refund_response where user_id=:userId", nativeQuery = true)
List<RefundResponse> getRefundResponseByuserId(String userId); List<RefundResponse> getRefundResponseByuserId(String userId);
//List<Object[]> getRefundResponseByBookingId(String fromDate, String toDate, Long bookingId);
// List<Object[]> getRefundResponseByBookingId(String fromDate, String toDate,
// Long bookingId);
@Query(value = "SELECT rr.booking_id, bd.booking_date, bd.refund_status, rr.amount, rr.txansaction_id, rr.user_id, rr.balace_amount " +
@Query(value = "SELECT rr.booking_id, bd.booking_date, bd.refund_status, rr.amount, rr.txansaction_id, rr.user_id, rr.balace_amount "
+
"FROM refund_response rr " + "FROM refund_response rr " +
"JOIN booking_details bd ON rr.booking_id = bd.booking_id " + "JOIN booking_details bd ON rr.booking_id = bd.booking_id " +
"WHERE rr.date >= :fromDate " + "WHERE rr.date >= :fromDate " +
"AND rr.date <= :toDate " + "AND rr.date <= :toDate " +
"AND (rr.booking_id = :bookingId OR :bookingId IS NULL)", nativeQuery = true) "AND (rr.booking_id = :bookingId OR :bookingId IS NULL)", nativeQuery = true)
List<Object[]> getRefundResponseByBookingId(@Param("fromDate") String fromDate,
List<Object[]> getRefundResponseByBookingId(@Param("fromDate") String fromDate,
@Param("toDate") String toDate, @Param("toDate") String toDate,
@Param("bookingId") Long bookingId); @Param("bookingId") Long bookingId);
@Query(value = "SELECT * FROM refund_response WHERE booking_id = :bookingId LIMIT 1", nativeQuery = true)
RefundResponse findByBookingId(@Param("bookingId") int bookingId);
} }

2
src/main/java/com/gcc/communityHall/paymentService/repository/TransactionResponseRepository.java

@ -89,6 +89,6 @@ public interface TransactionResponseRepository extends JpaRepository<Transaction
+ +
"tr.user_id, bd.booking_date FROM transaction_response tr " + "tr.user_id, bd.booking_date FROM transaction_response tr " +
"INNER JOIN booking_details bd ON tr.booking_id = bd.booking_id " + "INNER JOIN booking_details bd ON tr.booking_id = bd.booking_id " +
"WHERE tr.status_code = 'temp' AND tr.cdate < DATE_SUB(NOW(), INTERVAL 1 HOUR);", nativeQuery = true)
"WHERE tr.status_code = 'temp' AND tr.cdate < DATE_SUB(NOW(), INTERVAL 1 HOUR)", nativeQuery = true)
List<Map<String, Object>> getTransResBycdateandStatus(String status); List<Map<String, Object>> getTransResBycdateandStatus(String status);
} }

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

@ -46,6 +46,10 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
@Query("UPDATE BookingDetails b SET b.bookingRefId = :refId WHERE b.bookingId = :bookingId") @Query("UPDATE BookingDetails b SET b.bookingRefId = :refId WHERE b.bookingId = :bookingId")
void updateRefId(@Param("refId") String refId, @Param("bookingId") int bookingId); void updateRefId(@Param("refId") String refId, @Param("bookingId") int bookingId);
@Modifying
@Query("UPDATE BookingDetails b SET b.nocAcknowledged = 1, b.nocAcknowledgedBy = :acknowledgedBy WHERE b.bookingId = :bookingId")
void updateNocAcknowledged(@Param("bookingId") int bookingId, @Param("acknowledgedBy") String acknowledgedBy);
// ak // ak
@Query("SELECT b FROM BookingDetails b WHERE b.bookingRefId = :refId") @Query("SELECT b FROM BookingDetails b WHERE b.bookingRefId = :refId")
BookingDetails findByRefId(@Param("refId") String refId); BookingDetails findByRefId(@Param("refId") String refId);
@ -256,10 +260,12 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"CONCAT(us.doorno, ', ', us.street, ', ', us.area, ', ', us.location, ', ', us.pin_code) AS address, " "CONCAT(us.doorno, ', ', us.street, ', ', us.area, ', ', us.location, ', ', us.pin_code) AS address, "
+ +
"us.usertype, bd.reason, bd.start_date, bd.end_date, " + "us.usertype, bd.reason, bd.start_date, bd.end_date, " +
"bd.deposit_amount, bd.hall_amount, bd.gst, bd.amount_received, bd.booking_status " +
"bd.deposit_amount, bd.hall_amount, bd.gst, bd.amount_received, bd.booking_status, " +
"hd.zone, hd.division, tr.txansaction_id, tr.tpsl_txn_id " +
"FROM booking_details bd " + "FROM booking_details bd " +
"JOIN hall_details hd ON bd.hall_details_hall_id = hd.hall_id " + "JOIN hall_details hd ON bd.hall_details_hall_id = hd.hall_id " +
"JOIN users us ON bd.users_user_id = us.user_id " + "JOIN users us ON bd.users_user_id = us.user_id " +
"JOIN transaction_response tr on bd.booking_id = tr.booking_id " +
"WHERE DATE(bd.booking_date) >= :fromDate " + "WHERE DATE(bd.booking_date) >= :fromDate " +
"AND DATE(bd.booking_date) <= :toDate " + "AND DATE(bd.booking_date) <= :toDate " +
"AND (:bookingId IS NULL OR bd.booking_id = :bookingId) order by bd.booking_id asc", nativeQuery = true) "AND (:bookingId IS NULL OR bd.booking_id = :bookingId) order by bd.booking_id asc", nativeQuery = true)
@ -271,10 +277,12 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"CONCAT(us.doorno, ', ', us.street, ', ', us.area, ', ', us.location, ', ', us.pin_code) AS address, " "CONCAT(us.doorno, ', ', us.street, ', ', us.area, ', ', us.location, ', ', us.pin_code) AS address, "
+ +
"us.usertype, bd.reason, bd.start_date, bd.end_date, " + "us.usertype, bd.reason, bd.start_date, bd.end_date, " +
"bd.deposit_amount, bd.hall_amount, bd.gst, bd.amount_received, bd.booking_status " +
"bd.deposit_amount, bd.hall_amount, bd.gst, bd.amount_received, bd.booking_status, " +
"hd.zone, hd.division, tr.txansaction_id, tr.tpsl_txn_id " +
"FROM booking_details bd " + "FROM booking_details bd " +
"JOIN hall_details hd ON bd.hall_details_hall_id = hd.hall_id " + "JOIN hall_details hd ON bd.hall_details_hall_id = hd.hall_id " +
"JOIN users us ON bd.users_user_id = us.user_id " + "JOIN users us ON bd.users_user_id = us.user_id " +
"JOIN transaction_response tr on bd.booking_id = tr.booking_id " +
"WHERE DATE(bd.booking_date) >= :fromDate " + "WHERE DATE(bd.booking_date) >= :fromDate " +
"AND DATE(bd.booking_date) <= :toDate " + "AND DATE(bd.booking_date) <= :toDate " +
"AND (:bookingId IS NULL OR bd.booking_id = :bookingId)" + "AND (:bookingId IS NULL OR bd.booking_id = :bookingId)" +
@ -1296,10 +1304,12 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"CONCAT(us.doorno, ', ', us.street, ', ', us.area, ', ', us.location, ', ', us.pin_code) AS address, " "CONCAT(us.doorno, ', ', us.street, ', ', us.area, ', ', us.location, ', ', us.pin_code) AS address, "
+ +
"us.usertype, bd.reason, bd.start_date, bd.end_date, " + "us.usertype, bd.reason, bd.start_date, bd.end_date, " +
"bd.deposit_amount, bd.hall_amount, bd.gst, bd.amount_received, bd.booking_status " +
"bd.deposit_amount, bd.hall_amount, bd.gst, bd.amount_received, bd.booking_status, " +
"hd.zone, hd.division, tr.txansaction_id, tr.tpsl_txn_id " +
"FROM booking_details bd " + "FROM booking_details bd " +
"JOIN hall_details hd ON bd.hall_details_hall_id = hd.hall_id " + "JOIN hall_details hd ON bd.hall_details_hall_id = hd.hall_id " +
"JOIN users us ON bd.users_user_id = us.user_id " + "JOIN users us ON bd.users_user_id = us.user_id " +
"JOIN transaction_response tr on bd.booking_id = tr.booking_id " +
"WHERE DATE(bd.booking_date) >= :fromDate " + "WHERE DATE(bd.booking_date) >= :fromDate " +
"AND DATE(bd.booking_date) <= :toDate " + "AND DATE(bd.booking_date) <= :toDate " +
"AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " + "AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
@ -1314,10 +1324,13 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"CONCAT(us.doorno, ', ', us.street, ', ', us.area, ', ', us.location, ', ', us.pin_code) AS address, " "CONCAT(us.doorno, ', ', us.street, ', ', us.area, ', ', us.location, ', ', us.pin_code) AS address, "
+ +
"us.usertype, bd.reason, bd.start_date, bd.end_date, " + "us.usertype, bd.reason, bd.start_date, bd.end_date, " +
"bd.deposit_amount, bd.hall_amount, bd.gst, bd.amount_received, bd.booking_status " +
"bd.deposit_amount, bd.hall_amount, bd.gst, bd.amount_received, bd.booking_status, "
+
"hd.zone, hd.division, tr.txansaction_id, tr.tpsl_txn_id " +
"FROM booking_details bd " + "FROM booking_details bd " +
"JOIN hall_details hd ON bd.hall_details_hall_id = hd.hall_id " + "JOIN hall_details hd ON bd.hall_details_hall_id = hd.hall_id " +
"JOIN users us ON bd.users_user_id = us.user_id " + "JOIN users us ON bd.users_user_id = us.user_id " +
"JOIN transaction_response tr on bd.booking_id = tr.booking_id " +
"WHERE DATE(bd.booking_date) >= :fromDate " + "WHERE DATE(bd.booking_date) >= :fromDate " +
"AND DATE(bd.booking_date) <= :toDate " + "AND DATE(bd.booking_date) <= :toDate " +
"AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " + "AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
@ -1333,10 +1346,12 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"CONCAT(us.doorno, ', ', us.street, ', ', us.area, ', ', us.location, ', ', us.pin_code) AS address, " "CONCAT(us.doorno, ', ', us.street, ', ', us.area, ', ', us.location, ', ', us.pin_code) AS address, "
+ +
"us.usertype, bd.reason, bd.start_date, bd.end_date, " + "us.usertype, bd.reason, bd.start_date, bd.end_date, " +
"bd.deposit_amount, bd.hall_amount, bd.gst, bd.amount_received, bd.booking_status " +
"bd.deposit_amount, bd.hall_amount, bd.gst, bd.amount_received, bd.booking_status, " +
"hd.zone, hd.division, tr.txansaction_id, tr.tpsl_txn_id " +
"FROM booking_details bd " + "FROM booking_details bd " +
"JOIN hall_details hd ON bd.hall_details_hall_id = hd.hall_id " + "JOIN hall_details hd ON bd.hall_details_hall_id = hd.hall_id " +
"JOIN users us ON bd.users_user_id = us.user_id " + "JOIN users us ON bd.users_user_id = us.user_id " +
"JOIN transaction_response tr on bd.booking_id = tr.booking_id " +
"WHERE DATE(bd.start_date) >= :fromDate " + "WHERE DATE(bd.start_date) >= :fromDate " +
"AND DATE(bd.end_date) <= :toDate " + "AND DATE(bd.end_date) <= :toDate " +
"AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " + "AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
@ -1351,10 +1366,12 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"CONCAT(us.doorno, ', ', us.street, ', ', us.area, ', ', us.location, ', ', us.pin_code) AS address, " "CONCAT(us.doorno, ', ', us.street, ', ', us.area, ', ', us.location, ', ', us.pin_code) AS address, "
+ +
"us.usertype, bd.reason, bd.start_date, bd.end_date, " + "us.usertype, bd.reason, bd.start_date, bd.end_date, " +
"bd.deposit_amount, bd.hall_amount, bd.gst, bd.amount_received, bd.booking_status " +
"bd.deposit_amount, bd.hall_amount, bd.gst, bd.amount_received, bd.booking_status, " +
"hd.zone, hd.division, tr.txansaction_id, tr.tpsl_txn_id " +
"FROM booking_details bd " + "FROM booking_details bd " +
"JOIN hall_details hd ON bd.hall_details_hall_id = hd.hall_id " + "JOIN hall_details hd ON bd.hall_details_hall_id = hd.hall_id " +
"JOIN users us ON bd.users_user_id = us.user_id " + "JOIN users us ON bd.users_user_id = us.user_id " +
"JOIN transaction_response tr on bd.booking_id = tr.booking_id " +
"WHERE DATE(bd.start_date) >= :fromDate " + "WHERE DATE(bd.start_date) >= :fromDate " +
"AND DATE(bd.end_date) <= :toDate " + "AND DATE(bd.end_date) <= :toDate " +
"AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " + "AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
@ -1719,6 +1736,113 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"GROUP BY bd.counter_id, bd.hall_details_hall_id ", nativeQuery = true) "GROUP BY bd.counter_id, bd.hall_details_hall_id ", nativeQuery = true)
List<Object> getCounterWiseBookingList(String fromDate, String toDate); List<Object> getCounterWiseBookingList(String fromDate, String toDate);
@Query("select bd from BookingDetails bd where DATE(bd.startDate) = :date and bd.hallDetails.hallId = :hallId and bd.bookingStatus in ('APPROVED','WAITING_FOR_NOC','WAITING_FOR_NOC_APPROVAL') ")
@Query("select bd from BookingDetails bd where (DATE(bd.startDate) = :date or DATE(bd.endDate) = :date) and bd.hallDetails.hallId = :hallId and bd.bookingStatus in ('APPROVED','WAITING_FOR_NOC','WAITING_FOR_NOC_APPROVAL') ")
List<BookingDetails> findByHallIdAndDate(@Param("date") LocalDate date, @Param("hallId") Integer hallId); List<BookingDetails> findByHallIdAndDate(@Param("date") LocalDate date, @Param("hallId") Integer hallId);
// ─────────────────────────────────────────────────────────────────────
// Six-month-old transactions page — 4 dedicated queries
// ─────────────────────────────────────────────────────────────────────
/**
* Tab 1 – 6-month-old bookings whose status is NOT PENDING / CANCELED /
* REJECTED.
* Uses LEFT JOIN settlement so bookings without a settlement record still
* appear
* (with NULL settlement columns → displayed as "Settlement Not Initiated").
* Excludes rows already marked mail_sent = 1.
*/
@Query(value = "SELECT hd.zone, hd.division, hd.hall_name, bd.booking_id, " +
"date_format(bd.booking_date,'%d-%m-%Y') AS booking_date, " +
"date_format(bd.start_date,'%d-%m-%Y') AS event_start_date, " +
"date_format(bd.end_date,'%d-%m-%Y') AS event_end_date, " +
"s.settlement_id, " +
"date_format(s.updated_date,'%d-%m-%Y %r') AS settlement_raised_date, " +
"s.refunded_amount, bd.refund_status AS refund_status, bd.booking_status, " +
"tr.txansaction_id, tr.tpsl_txn_id, " +
"date_format(tr.cdate,'%d-%m-%Y') AS transaction_date, " +
"bd.deposit_amount, bd.amount_received " +
"FROM booking_details bd " +
"LEFT JOIN hall_details hd ON bd.hall_details_hall_id = hd.hall_id " +
"LEFT JOIN settlement s ON bd.booking_id = s.booking_details_booking_id " +
"LEFT JOIN transaction_response tr ON bd.booking_id = tr.booking_id " +
"WHERE datediff(CURRENT_DATE, bd.booking_date) > 180 " +
"AND bd.booking_status NOT IN ('PENDING','CANCELED','REJECTED') " +
"AND (bd.mail_sent IS NULL OR bd.mail_sent = 0) " +
"ORDER BY bd.booking_id ASC", nativeQuery = true)
List<Map<String, Object>> findSixMonthOldNonCancelledRejectedBookings();
/**
* Tab 2 – 6-month-old CANCELLED bookings.
* Refund amount = deposit_amount.
* No settlement data needed.
*/
@Query(value = "SELECT hd.zone, hd.division, hd.hall_name, bd.booking_id, " +
"date_format(bd.booking_date,'%d-%m-%Y') AS booking_date, " +
"date_format(bd.start_date,'%d-%m-%Y') AS event_start_date, " +
"date_format(bd.end_date,'%d-%m-%Y') AS event_end_date, " +
"bd.booking_status, bd.deposit_amount AS refund_amount, " +
"tr.txansaction_id, tr.tpsl_txn_id, " +
"date_format(tr.cdate,'%d-%m-%Y') AS transaction_date, " +
"bd.deposit_amount, bd.amount_received " +
"FROM booking_details bd " +
"LEFT JOIN hall_details hd ON bd.hall_details_hall_id = hd.hall_id " +
"LEFT JOIN transaction_response tr ON bd.booking_id = tr.booking_id " +
"WHERE datediff(CURRENT_DATE, bd.booking_date) > 180 " +
"AND bd.booking_status = 'CANCELED' " +
"AND (bd.mail_sent IS NULL OR bd.mail_sent = 0) " +
"ORDER BY bd.booking_id ASC", nativeQuery = true)
List<Map<String, Object>> findSixMonthOldCancelledBookings();
/**
* Tab 3 – 6-month-old REJECTED bookings.
* Refund amount = amount_received (full amount paid).
* No settlement data needed.
*/
@Query(value = "SELECT hd.zone, hd.division, hd.hall_name, bd.booking_id, " +
"date_format(bd.booking_date,'%d-%m-%Y') AS booking_date, " +
"date_format(bd.start_date,'%d-%m-%Y') AS event_start_date, " +
"date_format(bd.end_date,'%d-%m-%Y') AS event_end_date, " +
"bd.booking_status, bd.amount_received AS refund_amount, " +
"tr.txansaction_id, tr.tpsl_txn_id, " +
"date_format(tr.cdate,'%d-%m-%Y') AS transaction_date, " +
"bd.deposit_amount, bd.amount_received " +
"FROM booking_details bd " +
"LEFT JOIN hall_details hd ON bd.hall_details_hall_id = hd.hall_id " +
"LEFT JOIN transaction_response tr ON bd.booking_id = tr.booking_id " +
"WHERE datediff(CURRENT_DATE, bd.booking_date) > 180 " +
"AND bd.booking_status = 'REJECTED' " +
"AND (bd.mail_sent IS NULL OR bd.mail_sent = 0) " +
"ORDER BY bd.booking_id ASC", nativeQuery = true)
List<Map<String, Object>> findSixMonthOldRejectedBookings();
/**
* Tab 4 – Bookings where mail_sent = 1 (mail already dispatched).
*/
@Query(value = "SELECT hd.zone, hd.division, hd.hall_name, bd.booking_id, " +
"date_format(bd.booking_date,'%d-%m-%Y') AS booking_date, " +
"date_format(bd.start_date,'%d-%m-%Y') AS event_start_date, " +
"date_format(bd.end_date,'%d-%m-%Y') AS event_end_date, " +
"bd.booking_status, bd.deposit_amount, bd.amount_received, " +
"date_format(bd.mailsent_date,'%d-%m-%Y %r') AS mail_sent_date, " +
"tr.txansaction_id, tr.tpsl_txn_id, " +
"date_format(tr.cdate,'%d-%m-%Y') AS transaction_date, " +
"s.settlement_id " +
"FROM booking_details bd " +
"LEFT JOIN hall_details hd ON bd.hall_details_hall_id = hd.hall_id " +
"LEFT JOIN transaction_response tr ON bd.booking_id = tr.booking_id " +
"LEFT JOIN settlement s ON s.booking_details_booking_id = bd.booking_id " +
"WHERE bd.mail_sent = 1 " +
"ORDER BY bd.mailsent_date DESC", nativeQuery = true)
List<Map<String, Object>> findMailSentBookings();
/**
* Stamp mail_sent = 1 and capture timestamp when mail is confirmed.
* Requires the two columns to exist in booking_details:
* ALTER TABLE booking_details
* ADD COLUMN mail_sent TINYINT(1) DEFAULT 0,
* ADD COLUMN mail_sent_date DATETIME NULL;
*/
@Modifying
@Query(value = "UPDATE booking_details SET mail_sent = 1, mailsent_date = NOW() WHERE booking_id = :bookingId", nativeQuery = true)
void markMailSent(@Param("bookingId") int bookingId);
} }

7
src/main/java/com/gcc/communityHall/repository/BookingHistoryRepository.java

@ -1,16 +1,21 @@
package com.gcc.communityHall.repository; package com.gcc.communityHall.repository;
import java.util.List;
import java.util.Optional; import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import com.gcc.communityHall.entity.BookingHistory; import com.gcc.communityHall.entity.BookingHistory;
@Repository @Repository
public interface BookingHistoryRepository extends JpaRepository<BookingHistory,Integer> {
public interface BookingHistoryRepository extends JpaRepository<BookingHistory, Integer> {
@Query(value = "SELECT * FROM booking_history where booking_details_booking_id= :bookingId", nativeQuery = true) @Query(value = "SELECT * FROM booking_history where booking_details_booking_id= :bookingId", nativeQuery = true)
BookingHistory findbybookingId(int bookingId); BookingHistory findbybookingId(int bookingId);
@Query(value = "SELECT * FROM booking_history WHERE booking_details_booking_id = :bookingId ORDER BY history_id ASC limit 1", nativeQuery = true)
List<BookingHistory> findAllByBookingId(@Param("bookingId") int bookingId);
} }

13
src/main/java/com/gcc/communityHall/repository/SixMonthMailLogRepository.java

@ -0,0 +1,13 @@
package com.gcc.communityHall.repository;
import com.gcc.communityHall.entity.SixMonthMailLog;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface SixMonthMailLogRepository extends JpaRepository<SixMonthMailLog, Long> {
List<SixMonthMailLog> findByBookingIdOrderBySentAtDesc(int bookingId);
}

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

@ -948,7 +948,7 @@ public class BookingServiceImpl implements BookingService {
double EB = governmentevents.getHalfdayEBcharges(); double EB = governmentevents.getHalfdayEBcharges();
double additionalcharges = cleaningCharges + PASystem + EB; double additionalcharges = cleaningCharges + PASystem + EB;
double gstAmount = Math.round(additionalcharges * hallDetails.getGst()) / 100.0; double gstAmount = Math.round(additionalcharges * hallDetails.getGst()) / 100.0;
double depositAmount = hallDetails.getDepositAmount() * daysrange;
double depositAmount = hallDetails.getHalfDepositAmount() * daysrange;
double totalAmount = additionalcharges + gstAmount + depositAmount; double totalAmount = additionalcharges + gstAmount + depositAmount;
double truncatedTotalAmount = Math.round(totalAmount * 100.0) / 100.0; double truncatedTotalAmount = Math.round(totalAmount * 100.0) / 100.0;
hs.put("actualhallamount", hallAmount); hs.put("actualhallamount", hallAmount);
@ -1024,7 +1024,7 @@ public class BookingServiceImpl implements BookingService {
double rentAmount = discountAmount; double rentAmount = discountAmount;
double netAmount = rentAmount + additionalcharges; double netAmount = rentAmount + additionalcharges;
double gstAmount = Math.round(netAmount * hallDetails.getGst()) / 100.0; double gstAmount = Math.round(netAmount * hallDetails.getGst()) / 100.0;
double depositAmount = hallDetails.getDepositAmount() * daysrange;
double depositAmount = hallDetails.getHalfDepositAmount() * daysrange;
double totalAmount = netAmount + gstAmount + depositAmount; double totalAmount = netAmount + gstAmount + depositAmount;
double truncatedTotalAmount = Math.round(totalAmount * 100.0) / 100.0; double truncatedTotalAmount = Math.round(totalAmount * 100.0) / 100.0;
hs.put("actualhallamount", hallAmount); hs.put("actualhallamount", hallAmount);
@ -2292,7 +2292,8 @@ public class BookingServiceImpl implements BookingService {
Optional<BookingDetails> book = bookingDetailsRepository.findById(bookingId); Optional<BookingDetails> book = bookingDetailsRepository.findById(bookingId);
BookingDetails bookingDetails = book.get(); BookingDetails bookingDetails = book.get();
bookingDetails.setScheduleCount(bookingDetails.getScheduleCount() + 1); bookingDetails.setScheduleCount(bookingDetails.getScheduleCount() + 1);
if (bookingDetails.getReason().equals("Commercial")) {
if (bookingDetails.getReason().equals("Commercial") || bookingDetails.getReason().equals("State Govt Event")
|| bookingDetails.getReason().equals("Central Govt Event")) {
bookingDetails.setBookingStatus(BookingStatus.WAITING_FOR_NOC); bookingDetails.setBookingStatus(BookingStatus.WAITING_FOR_NOC);
} }
// Updating Bookinghistory startDate and End Date // Updating Bookinghistory startDate and End Date
@ -2368,6 +2369,7 @@ public class BookingServiceImpl implements BookingService {
// slots) ── // slots) ──
for (String bookingIdStr : selectedBookings) { for (String bookingIdStr : selectedBookings) {
Integer bookingId = Integer.parseInt(bookingIdStr); Integer bookingId = Integer.parseInt(bookingIdStr);
System.out.println("bookingId..." + bookingId);
Optional<BookingDetails> optionalBooking = bookingDetailsRepository.findById(bookingId); Optional<BookingDetails> optionalBooking = bookingDetailsRepository.findById(bookingId);
if (optionalBooking.isPresent()) { if (optionalBooking.isPresent()) {
@ -2489,16 +2491,14 @@ public class BookingServiceImpl implements BookingService {
BookingCalendar data = getbyDates(aa, hallId.toString()); BookingCalendar data = getbyDates(aa, hallId.toString());
int userbookingbookingId = gccBookingIds.get(hallIdsList.indexOf(hallId)); int userbookingbookingId = gccBookingIds.get(hallIdsList.indexOf(hallId));
if (data != null) { if (data != null) {
System.out.println("uniqueId...1" + uniqueId);
data.setBookingId_1(String.valueOf(userbookingbookingId));
data.setBookingId_2(String.valueOf(userbookingbookingId));
data.setMorningSlot(true);
data.setEveningSlot(true);
// data.setBookingId_1(String.valueOf(userbookingbookingId));
// data.setBookingId_2(String.valueOf(userbookingbookingId));
// data.setMorningSlot(true);
// data.setEveningSlot(true);
data.setIs_blocked(true); data.setIs_blocked(true);
data.setUnique_id(uniqueId); data.setUnique_id(uniqueId);
updateBookingStatus(data); updateBookingStatus(data);
} else { } else {
System.out.println("uniqueId...2" + uniqueId);
BookingCalendar book = new BookingCalendar(); BookingCalendar book = new BookingCalendar();
book.setBdate(aa); book.setBdate(aa);
book.setBookingId_1(String.valueOf(userbookingbookingId)); book.setBookingId_1(String.valueOf(userbookingbookingId));

1
src/main/java/com/gcc/communityHall/service/Impl/HallDetailServiceImpl.java

@ -288,6 +288,7 @@ public class HallDetailServiceImpl implements HallDetailService {
// Update hall details // Update hall details
existingHall.setZone(hallDetails.getZone()); existingHall.setZone(hallDetails.getZone());
existingHall.setDivision(hallDetails.getDivision()); existingHall.setDivision(hallDetails.getDivision());
existingHall.setHallArea(hallDetails.getHallArea());
existingHall.setHallName(hallDetails.getHallName()); existingHall.setHallName(hallDetails.getHallName());
existingHall.setDoorNo(hallDetails.getDoorNo()); existingHall.setDoorNo(hallDetails.getDoorNo());
existingHall.setStreet(hallDetails.getStreet()); existingHall.setStreet(hallDetails.getStreet());

86
src/main/java/com/gcc/communityHall/service/MailService.java

@ -0,0 +1,86 @@
package com.gcc.communityHall.service;
import jakarta.mail.internet.InternetAddress;
import jakarta.mail.internet.MimeMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.stereotype.Service;
import java.text.DecimalFormat;
@Service
public class MailService {
@Autowired
private JavaMailSender mailSender;
@Value("${app.mail.from}")
private String fromAddress;
@Value("${app.mail.to}")
private String toAddresses;
@Value("${app.mail.cc}")
private String ccAddresses;
public String sendRefundFollowupMail(int bookingId, String bookingStatus,
String transactionId, String tpslId,
String transactionDate, Double refundAmount) throws Exception {
MimeMessage message = mailSender.createMimeMessage();
MimeMessageHelper helper = new MimeMessageHelper(message, true, "UTF-8");
helper.setFrom(new InternetAddress(fromAddress, "Community Hall Support"));
for (String addr : toAddresses.split(",")) {
if (!addr.trim().isEmpty()) {
helper.addTo(addr.trim());
}
}
for (String addr : ccAddresses.split(",")) {
if (!addr.trim().isEmpty()) {
helper.addCc(addr.trim());
}
}
helper.setSubject("Test Mail Refund Status Update Request - Community Hall Booking");
DecimalFormat df = new DecimalFormat("#,##0.00");
String amt = (refundAmount != null) ? "Rs. " + df.format(refundAmount) : "N/A";
String body = buildMailBody(bookingId, bookingStatus, transactionId, tpslId, transactionDate, amt);
helper.setText(body, true);
mailSender.send(message);
return body; // return body so caller can persist it in the audit log
}
private String buildMailBody(int bookingId, String bookingStatus,
String transactionId, String tpslId,
String transactionDate, String amt) {
return "Hi,<br><br>"
+ "Kindly update refund status for the below mentioned transaction made for Community Hall Booking.<br><br>"
+ "<b>Transaction Details:</b><br><br>"
+ "&nbsp;&nbsp;Booking ID &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: " +
bookingId + "<br>"
// + "&nbsp;&nbsp;Booking Status &nbsp;&nbsp;&nbsp;: " + nvl(bookingStatus) +
// "<br>"
+ "&nbsp;&nbsp;Transaction ID &nbsp;&nbsp;&nbsp;: " + nvl(transactionId) + "<br>"
+ "&nbsp;&nbsp;TPSL ID &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: "
+ nvl(tpslId) + "<br>"
+ "&nbsp;&nbsp;Transaction Date : " + nvl(transactionDate) + "<br>"
+ "&nbsp;&nbsp;<b>Refund Amount &nbsp;&nbsp;&nbsp;: " + amt + "</b><br><br>"
+ "If refund was not initiated, <b>kindly initiate the refund</b> and update refund status at the earliest. "
+ "Make sure that no duplicate refund was processed against this transaction.<br><br>"
+ "Regards,<br>"
+ "Community Hall Support<br>"
+ "Greater Chennai Corporation";
}
private String nvl(String val) {
return (val != null && !val.isEmpty()) ? val : "N/A";
}
}

21
src/main/resources/application-dev.properties

@ -72,3 +72,24 @@ app.manualRefundCode=8520
app.fullUrl=http://localhost:8062 app.fullUrl=http://localhost:8062
app.commErpUrl=http://coc-staging.egovernments.org:9980/pgr/external/mobileservice app.commErpUrl=http://coc-staging.egovernments.org:9980/pgr/external/mobileservice
# ── Mail / SMTP Configuration (NICeMail via mgovcloud.in) ──────────────────
spring.mail.host=smtp.mgovcloud.in
spring.mail.port=465
spring.mail.username=communityhallsupport@chennaicorporation.gov.in
# Replace the value below with the Application-Specific Password generated from mail.gov.in
spring.mail.password=XPe2JTFphMnN
spring.mail.protocol=smtps
spring.mail.properties.mail.smtp.ssl.enable=true
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.ssl.trust=smtp.mgovcloud.in
spring.mail.properties.mail.smtp.ssl.checkserveridentity=false
spring.mail.properties.mail.smtp.connectiontimeout=10000
spring.mail.properties.mail.smtp.timeout=10000
spring.mail.properties.mail.smtp.writetimeout=10000
# Mail recipient constants
app.mail.from=communityhallsupport@chennaicorporation.gov.in
app.mail.to=ranjithkumar@federal.bank.in, kanimozhi@bontonsoftwares.com, ramya@bontonsoftwares.com, wasiqueahsan@bontonsoftwares.com
#pgsupport@mail.in.worldline-solutions.com,megha.mattamana@federal.bank.in
app.mail.cc=arohqcc@gmail.com,it@chennaicorporation.gov.in

19
src/main/resources/application-prod.properties

@ -58,3 +58,22 @@ app.manualRefundCode=8520
app.fullUrl=https://gccservices.in/communityhall app.fullUrl=https://gccservices.in/communityhall
app.commErpUrl=https://erp.chennaicorporation.gov.in/pgr/external/mobileservice app.commErpUrl=https://erp.chennaicorporation.gov.in/pgr/external/mobileservice
# ── Mail / SMTP Configuration (NICeMail via mgovcloud.in) ──────────────────
spring.mail.host=smtp.mgovcloud.in
spring.mail.port=465
spring.mail.username=communityhallsupport@chennaicorporation.gov.in
spring.mail.password=XPe2JTFphMnN
spring.mail.protocol=smtps
spring.mail.properties.mail.smtp.ssl.enable=true
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.ssl.trust=smtp.mgovcloud.in
spring.mail.properties.mail.smtp.ssl.checkserveridentity=false
spring.mail.properties.mail.smtp.connectiontimeout=10000
spring.mail.properties.mail.smtp.timeout=10000
spring.mail.properties.mail.smtp.writetimeout=10000
# Mail recipient constants
app.mail.from=communityhallsupport@chennaicorporation.gov.in
app.mail.to=ranjithkumar@federal.bank.in,pgsupport@mail.in.worldline-solutions.com,megha.mattamana@federal.bank.in
app.mail.cc=arohqcc@gmail.com,it@chennaicorporation.gov.in

843
src/main/resources/resources/templates/headquarters/sixmonthold-transactions.html

@ -0,0 +1,843 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/head-headquarters :: head}"></head>
<style>
.nav-tabs .nav-link.active {
background: #1a73e8;
color: #fff !important;
border-color: #1a73e8;
border-radius: 6px 6px 0 0;
}
.nav-tabs .nav-link {
color: #444;
font-weight: 500;
}
.tab-badge {
background: #e8f0fe;
color: #1a73e8;
border-radius: 10px;
padding: 1px 8px;
font-size: 12px;
font-weight: 700;
margin-left: 4px;
}
.nav-tabs .nav-link.active .tab-badge {
background: rgba(255, 255, 255, 0.25);
color: #fff;
}
.table-responsive {
overflow-x: auto;
}
.card-body table {
width: 100%;
}
.card-body th,
td {
padding: 8px;
text-align: left;
}
.amount-cell {
text-align: right;
padding-right: 1rem;
}
.table {
width: 100% !important;
}
.btn-sendmail {
background: #1a73e8;
color: #fff;
border: none;
border-radius: 4px;
padding: 3px 10px;
cursor: pointer;
font-size: 12px;
}
.btn-sendmail:hover {
background: #1558b0;
}
.btn-viewdetails {
background: #f59e0b;
color: #fff;
border: none;
border-radius: 4px;
padding: 3px 10px;
cursor: pointer;
font-size: 12px;
margin-right: 4px;
}
.btn-viewdetails:hover {
background: #b45309;
}
.badge-cancelled {
background: #dc2626;
color: #fff;
padding: 3px 8px;
border-radius: 10px;
font-size: 11px;
}
.badge-rejected {
background: #7c3aed;
color: #fff;
padding: 3px 8px;
border-radius: 10px;
font-size: 11px;
}
.badge-approved {
background: #16a34a;
color: #fff;
padding: 3px 8px;
border-radius: 10px;
font-size: 11px;
}
.badge-other {
background: #64748b;
color: #fff;
padding: 3px 8px;
border-radius: 10px;
font-size: 11px;
}
.not-initiated {
color: #dc2626;
font-style: italic;
font-size: 12px;
}
/* Draft mail preview */
#draftMailBody {
background: #f8fafc;
border: 1px solid #cbd5e1;
border-radius: 6px;
padding: 16px;
font-family: Arial, sans-serif;
font-size: 14px;
white-space: pre-wrap;
line-height: 1.6;
}
.mail-header-row {
margin-bottom: 6px;
font-size: 13px;
}
.mail-header-row strong {
display: inline-block;
width: 50px;
color: #475569;
}
</style>
<body>
<!-- Page Container -->
<div id="page-container"
class="sidebar-o sidebar-dark enable-page-overlay side-scroll page-header-fixed page-header-dark">
<!-- Side Overlay aside (right)-->
<aside th:replace="~{fragments/aside-right :: aside}"></aside>
<!-- END Side Overlay (right)-->
<!-- Sidebar Nav-->
<nav th:replace="~{fragments/nav-headquarters :: nav}"></nav>
<!-- END Sidebar -->
<!-- Header -->
<header th:replace="~{fragments/header-headquarters :: header}"></header>
<!-- END Header -->
<!-- Main Container -->
<main id="main-container" class="container-fluid mt-4 px-4">
<div class="block block-rounded">
<div class="block-header block-header-default">
<h3 class="block-title">6 Months Old Transaction Details</h3>
</div>
<div class="block-content">
<!-- ── TABS ───────────────────────────────────────────── -->
<ul class="nav nav-tabs mb-0" id="sixMonthTab" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link active" id="tab-sixmonth-lnk" data-toggle="tab" href="#tab-sixmonth"
role="tab" aria-controls="tab-sixmonth" aria-selected="true">
6 Month Old Bookings
<span class="tab-badge"
th:text="${sixMonthOldBookings != null ? #lists.size(sixMonthOldBookings) : 0}">0</span>
</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" id="tab-cancelled-lnk" data-toggle="tab" href="#tab-cancelled"
role="tab" aria-controls="tab-cancelled" aria-selected="false">
Cancelled Bookings
<span class="tab-badge"
th:text="${cancelledBookings != null ? #lists.size(cancelledBookings) : 0}">0</span>
</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" id="tab-rejected-lnk" data-toggle="tab" href="#tab-rejected"
role="tab" aria-controls="tab-rejected" aria-selected="false">
Rejected Bookings
<span class="tab-badge"
th:text="${rejectedBookings != null ? #lists.size(rejectedBookings) : 0}">0</span>
</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" id="tab-mailsent-lnk" data-toggle="tab" href="#tab-mailsent"
role="tab" aria-controls="tab-mailsent" aria-selected="false">
Mail Sent Bookings
<span class="tab-badge"
th:text="${mailSentBookings != null ? #lists.size(mailSentBookings) : 0}">0</span>
</a>
</li>
</ul>
<div class="tab-content border border-top-0 p-3" id="sixMonthTabContent">
<!-- ══════════════════════════════════════════════════
TAB 1 – 6 Month Old Bookings (non-cancelled/rejected)
══════════════════════════════════════════════════ -->
<div class="tab-pane fade show active" id="tab-sixmonth" role="tabpanel" aria-labelledby="tab-sixmonth-lnk">
<div class="table-responsive">
<table class="table table-bordered table-striped table-vcenter js-dataTable-responsive"
id="tbl-sixmonth">
<thead class="thead-light">
<tr>
<th>S.No</th>
<th>Zone</th>
<th>Division</th>
<th>Hall Name</th>
<th>Booking Date</th>
<th>Event Date (Start – End)</th>
<th>Settlement Raised Date</th>
<th>Refund Amount (₹)</th>
<th>Refund Status</th>
<th>Booking Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr th:each="row, rowStat : ${sixMonthOldBookings}">
<td class="text-center" th:text="${rowStat.index + 1}"></td>
<td th:text="${row['zone'] != null ? row['zone'] : ''}"></td>
<td th:text="${row['division'] != null ? row['division'] : ''}"></td>
<td th:text="${row['hall_name'] != null ? row['hall_name'] : ''}"></td>
<td class="text-center"
th:text="${row['booking_date'] != null ? row['booking_date'] : ''}">
</td>
<td class="text-center"
th:text="(${row['event_start_date'] != null ? row['event_start_date'] : ''}) + ' – ' + (${row['event_end_date'] != null ? row['event_end_date'] : ''})">
</td>
<!-- Settlement Raised Date: N/A if no settlement -->
<td class="text-center">
<span th:if="${row['settlement_raised_date'] != null}"
th:text="${row['settlement_raised_date']}"></span>
<span th:if="${row['settlement_raised_date'] == null}"
class="not-initiated">Settlement Not Initiated</span>
</td>
<!-- Refund Amount: from settlement.refunded_amount -->
<td class="text-right">
<span th:if="${row['refunded_amount'] != null}"
th:text="'₹ ' + ${row['refunded_amount']}"></span>
<span th:if="${row['refunded_amount'] == null}"
class="not-initiated">—</span>
</td>
<td class="text-center"
th:text="${row['refund_status'] != null ? row['refund_status'] : ''}">
</td>
<td class="text-center">
<span th:classappend="${row['booking_status'] == 'CANCELED' || row['booking_status'] == 'CANCELLED'} ? 'badge-cancelled' :
(${row['booking_status'] == 'REJECTED'} ? 'badge-rejected' :
(${row['booking_status'] == 'APPROVED'} ? 'badge-approved' : 'badge-other'))"
th:text="${row['booking_status'] != null ? row['booking_status'] : ''}"></span>
</td>
<td class="text-center">
<!-- View Details: calls getSettlementList if settlement exists -->
<button th:if="${row['settlement_id'] != null}" class="btn-viewdetails"
th:onclick="|viewSettlement(${row['settlement_id']})|">
View Details
</button>
<span th:if="${row['settlement_id'] == null}"
class="not-initiated d-block mb-1">Settlement Not Initiated</span>
<button class="btn-sendmail"
th:onclick="|openSendMail(${row['booking_id'] != null ? row['booking_id'] : 0}, '${row['booking_status'] != null ? row['booking_status'] : ''}', '${row['txansaction_id'] != null ? row['txansaction_id'] : ''}', '${row['tpsl_txn_id'] != null ? row['tpsl_txn_id'] : ''}', '${row['transaction_date'] != null ? row['transaction_date'] : ''}', ${row['refunded_amount'] != null ? row['refunded_amount'] : 0})|">
Send Mail
</button>
</td>
</tr>
<tr
th:if="${sixMonthOldBookings == null || #lists.isEmpty(sixMonthOldBookings)}">
<td colspan="11" class="text-center text-muted py-3">No records found</td>
</tr>
</tbody>
</table>
</div>
</div><!-- /tab-sixmonth -->
<!-- ══════════════════════════════════════════════════
TAB 2 – Cancelled Bookings
Refund Amount = deposit_amount
No Settlement Raised Date column
══════════════════════════════════════════════════ -->
<div class="tab-pane fade" id="tab-cancelled" role="tabpanel" aria-labelledby="tab-cancelled-lnk">
<div class="table-responsive">
<table class="table table-bordered table-striped table-vcenter js-dataTable-responsive"
id="tbl-cancelled">
<thead class="thead-light">
<tr>
<th>S.No</th>
<th>Zone</th>
<th>Division</th>
<th>Hall Name</th>
<th>Booking Date</th>
<th>Event Date (Start – End)</th>
<th>Refund Amount (₹)</th>
<th>Booking Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr th:each="row, rowStat : ${cancelledBookings}">
<td class="text-center" th:text="${rowStat.index + 1}"></td>
<td th:text="${row['zone'] != null ? row['zone'] : ''}"></td>
<td th:text="${row['division'] != null ? row['division'] : ''}"></td>
<td th:text="${row['hall_name'] != null ? row['hall_name'] : ''}"></td>
<td class="text-center"
th:text="${row['booking_date'] != null ? row['booking_date'] : ''}">
</td>
<td class="text-center"
th:text="(${row['event_start_date'] != null ? row['event_start_date'] : ''}) + ' – ' + (${row['event_end_date'] != null ? row['event_end_date'] : ''})">
</td>
<td class="text-right"
th:text="${row['refund_amount'] != null ? '₹ ' + row['refund_amount'] : '—'}">
</td>
<td class="text-center">
<span class="badge-cancelled"
th:text="${row['booking_status'] != null ? row['booking_status'] : ''}"></span>
</td>
<td class="text-center">
<button class="btn-viewdetails"
th:onclick="|viewBookingDetails(${row['booking_id'] != null ? row['booking_id'] : 0})|">
View Details
</button>
<button class="btn-sendmail"
th:onclick="|openSendMail(${row['booking_id'] != null ? row['booking_id'] : 0}, '${row['booking_status'] != null ? row['booking_status'] : ''}', '${row['txansaction_id'] != null ? row['txansaction_id'] : ''}', '${row['tpsl_txn_id'] != null ? row['tpsl_txn_id'] : ''}', '${row['transaction_date'] != null ? row['transaction_date'] : ''}', ${row['refund_amount'] != null ? row['refund_amount'] : 0})|">
Send Mail
</button>
</td>
</tr>
<tr th:if="${cancelledBookings == null || #lists.isEmpty(cancelledBookings)}">
<td colspan="9" class="text-center text-muted py-3">No records found</td>
</tr>
</tbody>
</table>
</div>
</div><!-- /tab-cancelled -->
<!-- ══════════════════════════════════════════════════
TAB 3 – Rejected Bookings
Refund Amount = amount_received (full amount)
No Settlement Raised Date column
══════════════════════════════════════════════════ -->
<div class="tab-pane fade" id="tab-rejected" role="tabpanel" aria-labelledby="tab-rejected-lnk">
<div class="table-responsive">
<table class="table table-bordered table-striped table-vcenter js-dataTable-responsive"
id="tbl-rejected">
<thead class="thead-light">
<tr>
<th>S.No</th>
<th>Zone</th>
<th>Division</th>
<th>Hall Name</th>
<th>Booking Date</th>
<th>Event Date (Start – End)</th>
<th>Refund Amount (₹)</th>
<th>Booking Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr th:each="row, rowStat : ${rejectedBookings}">
<td class="text-center" th:text="${rowStat.index + 1}"></td>
<td th:text="${row['zone'] != null ? row['zone'] : ''}"></td>
<td th:text="${row['division'] != null ? row['division'] : ''}"></td>
<td th:text="${row['hall_name'] != null ? row['hall_name'] : ''}"></td>
<td class="text-center"
th:text="${row['booking_date'] != null ? row['booking_date'] : ''}">
</td>
<td class="text-center"
th:text="(${row['event_start_date'] != null ? row['event_start_date'] : ''}) + ' – ' + (${row['event_end_date'] != null ? row['event_end_date'] : ''})">
</td>
<td class="text-right"
th:text="${row['refund_amount'] != null ? '₹ ' + row['refund_amount'] : '—'}">
</td>
<td class="text-center">
<span class="badge-rejected"
th:text="${row['booking_status'] != null ? row['booking_status'] : ''}"></span>
</td>
<td class="text-center">
<button class="btn-viewdetails"
th:onclick="|viewBookingDetails(${row['booking_id'] != null ? row['booking_id'] : 0})|">
View Details
</button>
<button class="btn-sendmail"
th:onclick="|openSendMail(${row['booking_id'] != null ? row['booking_id'] : 0}, '${row['booking_status'] != null ? row['booking_status'] : ''}', '${row['txansaction_id'] != null ? row['txansaction_id'] : ''}', '${row['tpsl_txn_id'] != null ? row['tpsl_txn_id'] : ''}', '${row['transaction_date'] != null ? row['transaction_date'] : ''}', ${row['refund_amount'] != null ? row['refund_amount'] : 0})|">
Send Mail
</button>
</td>
</tr>
<tr th:if="${rejectedBookings == null || #lists.isEmpty(rejectedBookings)}">
<td colspan="9" class="text-center text-muted py-3">No records found</td>
</tr>
</tbody>
</table>
</div>
</div><!-- /tab-rejected -->
<!-- ══════════════════════════════════════════════════
TAB 4 – Mail Sent Bookings
══════════════════════════════════════════════════ -->
<div class="tab-pane fade" id="tab-mailsent" role="tabpanel" aria-labelledby="tab-mailsent-lnk">
<div class="table-responsive">
<table class="table table-bordered table-striped table-vcenter js-dataTable-responsive"
id="tbl-mailsent">
<thead class="thead-light">
<tr>
<th>S.No</th>
<th>Zone</th>
<th>Division</th>
<th>Hall Name</th>
<th>Booking Date</th>
<th>Event Date (Start – End)</th>
<th>Booking Status</th>
<th>Transaction ID</th>
<th>TPSL ID</th>
<th>Mail Sent Date</th>
</tr>
</thead>
<tbody>
<tr th:each="row, rowStat : ${mailSentBookings}">
<td class="text-center" th:text="${rowStat.index + 1}"></td>
<td th:text="${row['zone'] != null ? row['zone'] : ''}"></td>
<td th:text="${row['division'] != null ? row['division'] : ''}"></td>
<td th:text="${row['hall_name'] != null ? row['hall_name'] : ''}"></td>
<td class="text-center"
th:text="${row['booking_date'] != null ? row['booking_date'] : ''}">
</td>
<td class="text-center"
th:text="(${row['event_start_date'] != null ? row['event_start_date'] : ''}) + ' – ' + (${row['event_end_date'] != null ? row['event_end_date'] : ''})">
</td>
<td class="text-center">
<span th:classappend="${row['booking_status'] == 'CANCELED' || row['booking_status'] == 'CANCELLED'} ? 'badge-cancelled' :
(${row['booking_status'] == 'REJECTED'} ? 'badge-rejected' :
(${row['booking_status'] == 'APPROVED'} ? 'badge-approved' : 'badge-other'))"
th:text="${row['booking_status'] != null ? row['booking_status'] : ''}"></span>
</td>
<td class="text-center"
th:text="${row['txansaction_id'] != null ? row['txansaction_id'] : ''}">
</td>
<td class="text-center"
th:text="${row['tpsl_txn_id'] != null ? row['tpsl_txn_id'] : ''}"></td>
<td class="text-center"
th:text="${row['mail_sent_date'] != null ? row['mail_sent_date'] : ''}">
</td>
</tr>
<tr th:if="${mailSentBookings == null || #lists.isEmpty(mailSentBookings)}">
<td colspan="10" class="text-center text-muted py-3">No records found</td>
</tr>
</tbody>
</table>
</div>
</div><!-- /tab-mailsent -->
</div><!-- /tab-content -->
</div><!-- /block-content -->
</div><!-- /block -->
</main>
<!-- END Main Container -->
<!-- ══════════════════════════════════════════════════════════════════
MODAL – Settlement View Details (Tab 1 with settlement)
══════════════════════════════════════════════════════════════════ -->
<div class="modal fade" id="settlementModal" data-backdrop="static" tabindex="-1" role="dialog"
aria-labelledby="settlementModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="block block-rounded block-themed block-transparent mb-0">
<div class="block-header bg-primary-dark">
<h3 class="block-title" id="settlementModalLabel">Settlement Information</h3>
<div class="block-options">
<button type="button" class="btn-block-option" data-dismiss="modal" aria-label="Close">
<i class="fa fa-fw fa-times"></i>
</button>
</div>
</div>
<div class="block-content row p-3" id="settlementModalBody">
<!-- Populated by JS -->
</div>
<div class="block-content block-content-full text-right bg-body">
<button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
<!-- ══════════════════════════════════════════════════════════════════
MODAL – Booking View Details (Tab 2 & 3 – cancelled/rejected)
══════════════════════════════════════════════════════════════════ -->
<div class="modal fade" id="bookingModal" data-backdrop="static" tabindex="-1" role="dialog"
aria-labelledby="bookingModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="block block-rounded block-themed block-transparent mb-0">
<div class="block-header bg-primary-dark">
<h3 class="block-title" id="bookingModalLabel">Booking Information</h3>
<div class="block-options">
<button type="button" class="btn-block-option" data-dismiss="modal" aria-label="Close">
<i class="fa fa-fw fa-times"></i>
</button>
</div>
</div>
<div class="block-content row p-3" id="bookingModalBody">
<!-- Populated by JS -->
</div>
<div class="block-content block-content-full text-right bg-body">
<button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
<!-- ══════════════════════════════════════════════════════════════════
MODAL – Draft Mail Preview & Confirm
══════════════════════════════════════════════════════════════════ -->
<div class="modal fade" id="draftMailModal" data-backdrop="static" tabindex="-1" role="dialog"
aria-labelledby="draftMailModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header" style="background:#1a73e8; color:#fff;">
<h5 class="modal-title" id="draftMailModalLabel">
<i class="fa fa-envelope mr-2"></i>Draft Mail Preview
</h5>
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<!-- Mail Header Fields -->
<div class="mail-header-row"><strong>From:</strong>
communityhallsupport@chennaicorporation.gov.in</div>
<div class="mail-header-row">
<strong>To:</strong>
pgsupport@mail.in.worldline-solutions.com, ranjithkumar@federal.bank.in,
megha.mattamana@federal.bank.in
</div>
<div class="mail-header-row">
<strong>CC:</strong>
arohqcc@gmail.com, it@chennaicorporation.gov.in
</div>
<div class="mail-header-row"><strong>Sub:</strong> Refund Status Update Request – Community Hall
Booking</div>
<hr class="my-2">
<!-- Mail Body -->
<div id="draftMailBody"></div>
<!-- Hidden fields to carry data through to confirm step -->
<input type="hidden" id="dm_bookingId">
<input type="hidden" id="dm_bookingStatus">
<input type="hidden" id="dm_transactionId">
<input type="hidden" id="dm_tpslId">
<input type="hidden" id="dm_refundAmount">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">
<i class="fa fa-times mr-1"></i>Close
</button>
<button type="button" class="btn btn-primary" id="btn-confirm-mail" onclick="confirmMailSent()">
<i class="fa fa-check mr-1"></i>Confirm &amp; Mark as Mail Sent
</button>
</div>
</div>
</div>
</div>
<!-- File Preview Modal (for settlement images) -->
<div class="modal fade" id="fileModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">File Preview</h5>
<button type="button" class="close" data-dismiss="modal"><span>&times;</span></button>
</div>
<div class="modal-body">
<embed id="filePreview" src="" width="100%" height="600px">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<footer th:replace="~{fragments/footer2 :: footer}"></footer>
</div>
<!-- END Page Container -->
<div th:replace="~{fragments/resetpassword :: div}"></div>
<script th:replace="~{fragments/loginscript :: script}"></script>
<script>
// ─────────────────────────────────────────────────────────────────────
// DataTable initialisation & Tab Switch Handlers
// ─────────────────────────────────────────────────────────────────────
$(document).ready(function () {
var dtButtons = [
{ extend: 'pageLength', className: 'btn btn-primary' },
{ 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' }
];
var dtOpts = {
dom: 'Bftip',
columnDefs: [{ targets: 'no-sort', orderable: false }],
lengthMenu: [[50, 100, 200, 500, -1], ['50 rows', '100 rows', '200 rows', '500 rows', 'Show all']],
buttons: dtButtons,
responsive: true,
searching: true,
autoWidth: false
};
// Initialize DataTables
$('#tbl-sixmonth').DataTable(dtOpts);
$('#tbl-cancelled').DataTable(dtOpts);
$('#tbl-rejected').DataTable(dtOpts);
$('#tbl-mailsent').DataTable(dtOpts);
// Explicit click handler to guarantee tab activation
$('#sixMonthTab a').on('click', function (e) {
e.preventDefault();
$(this).tab('show');
});
// Recalculate columns and responsive layout whenever any tab is shown
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
var targetTab = $(e.target).attr('href');
if (targetTab && $.fn.dataTable) {
try {
$(targetTab).find('table').each(function () {
if ($.fn.dataTable.isDataTable(this)) {
$(this).DataTable().columns.adjust().responsive.recalc();
}
});
} catch (err) {
console.log('Error adjusting table columns on tab switch:', err);
}
}
});
});
// ─────────────────────────────────────────────────────────────────────
// View Settlement Details (Tab 1 – uses /getSettlementList by settlementId)
// ─────────────────────────────────────────────────────────────────────
function viewSettlement(settlementId) {
$.ajax({
type: 'GET',
url: '/communityhall/api/officer/getSettlementList',
data: { settlementsid: settlementId },
success: function (data) {
populateSettlementModal(data);
$('#settlementModal').modal('show');
},
error: function () {
Swal.fire('Error', 'Failed to fetch settlement details.', 'error');
}
});
}
function populateSettlementModal(d) {
var html = '<div class="col-12">';
html += '<table class="table table-sm table-bordered">';
html += '<tr><th colspan="4" style="background:#f2f2f2;">User Details</th></tr>';
html += '<tr><th style="font-weight:normal">User Name:</th><td>' + (d.users ? d.users.name : '') + '</td>';
html += '<th style="font-weight:normal">Mobile No:</th><td>' + (d.users ? d.users.mobileNo : '') + '</td></tr>';
html += '<tr><th style="font-weight:normal">User Type:</th><td colspan="3">' + (d.users ? d.users.usertype : '') + '</td></tr>';
html += '<tr><th colspan="4" style="background:#f2f2f2;">Hall Details</th></tr>';
html += '<tr><th style="font-weight:normal">Hall Name:</th><td colspan="3">' + (d.hallDetails ? d.hallDetails.hallName : '') + '</td></tr>';
html += '<tr><th colspan="4" style="background:#f2f2f2;">Booking Details (ID: ' + d.bookingId + ')</th></tr>';
html += '<tr><th style="font-weight:normal">Booking Date:</th><td>' + d.bookingDate + '</td>';
html += '<th style="font-weight:normal">Deposit Amount:</th><td>₹ ' + parseFloat(d.depositAmount).toFixed(2) + '</td></tr>';
html += '<tr><th style="font-weight:normal">Start Date:</th><td>' + d.startDate + '</td>';
html += '<th style="font-weight:normal">End Date:</th><td>' + d.endDate + '</td></tr>';
// Settlement
if (d.settlement) {
html += '<tr><th colspan="4" style="background:#f2f2f2;">Settlement Details</th></tr>';
html += '<tr><th style="font-weight:normal">Refunded Amount:</th><td>₹ ' + parseFloat(d.settlement.refundedAmount || 0).toFixed(2) + '</td>';
html += '<th style="font-weight:normal">Damage Amount:</th><td>₹ ' + parseFloat(d.settlement.damageAmount || 0).toFixed(2) + '</td></tr>';
} else {
html += '<tr><td colspan="4" class="text-danger text-center font-italic">Settlement Not Initiated</td></tr>';
}
html += '</table></div>';
$('#settlementModalBody').html(html);
}
// ─────────────────────────────────────────────────────────────────────
// View Booking Details (Tab 2 & 3 – uses /getBookingDetails by bookingId)
// ─────────────────────────────────────────────────────────────────────
function viewBookingDetails(bookingId) {
if (!bookingId || bookingId === 0) {
Swal.fire('Warning', 'Invalid Booking ID.', 'warning');
return;
}
$.ajax({
type: 'GET',
url: '/communityhall/api/officer/getBookingDetails',
data: { bookingsId: bookingId },
success: function (data) {
populateBookingModal(data);
$('#bookingModal').modal('show');
},
error: function () {
Swal.fire('Error', 'Failed to fetch booking details.', 'error');
}
});
}
function populateBookingModal(d) {
var html = '<div class="col-12">';
html += '<table class="table table-sm table-bordered">';
html += '<tr><th colspan="4" style="background:#f2f2f2;">User Details</th></tr>';
html += '<tr><th style="font-weight:normal">User Name:</th><td>' + (d.users ? d.users.name : '') + '</td>';
html += '<th style="font-weight:normal">Mobile No:</th><td>' + (d.users ? d.users.mobileNo : '') + '</td></tr>';
html += '<tr><th style="font-weight:normal">User Type:</th><td colspan="3">' + (d.users ? d.users.usertype : '') + '</td></tr>';
html += '<tr><th colspan="4" style="background:#f2f2f2;">Hall Details</th></tr>';
html += '<tr><th style="font-weight:normal">Hall Name:</th><td colspan="3">' + (d.hallDetails ? d.hallDetails.hallName : '') + '</td></tr>';
html += '<tr><th colspan="4" style="background:#f2f2f2;">Booking Details (ID: ' + d.bookingId + ')</th></tr>';
html += '<tr><th style="font-weight:normal">Booking Date:</th><td>' + d.bookingDate + '</td>';
html += '<th style="font-weight:normal">Booking Status:</th><td>' + d.bookingStatus + '</td></tr>';
html += '<tr><th style="font-weight:normal">Start Date:</th><td>' + d.startDate + '</td>';
html += '<th style="font-weight:normal">End Date:</th><td>' + d.endDate + '</td></tr>';
html += '<tr><th style="font-weight:normal">Deposit Amount:</th><td>₹ ' + parseFloat(d.depositAmount).toFixed(2) + '</td>';
html += '<th style="font-weight:normal">Total Amount:</th><td>₹ ' + parseFloat(d.amountReceived).toFixed(2) + '</td></tr>';
// Payment
if (d.payments) {
html += '<tr><th colspan="4" style="background:#f2f2f2;">Payment Details</th></tr>';
html += '<tr><th style="font-weight:normal">Transaction ID:</th><td colspan="3">' + d.payments.transactionId + '</td></tr>';
html += '<tr><th style="font-weight:normal">Amount Received:</th><td>₹ ' + d.payments.amountReceived + '</td>';
html += '<th style="font-weight:normal">Payment Status:</th><td>' + d.payments.paymentStatus + '</td></tr>';
}
html += '</table></div>';
$('#bookingModalBody').html(html);
}
// ─────────────────────────────────────────────────────────────────────
// Send Mail Flow
// ─────────────────────────────────────────────────────────────────────
function openSendMail(bookingId, bookingStatus, transactionId, tpslId, transactionDate, refundAmount) {
Swal.fire({
title: 'Send Refund Follow-up Mail?',
html: 'This will send a refund status request mail for Booking ID <strong>' + bookingId + '</strong>.<br>Do you want to proceed?',
icon: 'question',
showCancelButton: true,
confirmButtonText: 'Yes, Show Draft',
cancelButtonText: 'Cancel',
confirmButtonColor: '#1a73e8'
}).then(function (result) {
if (result.isConfirmed) {
showDraftMail(bookingId, bookingStatus, transactionId, tpslId, transactionDate, refundAmount);
}
});
}
function showDraftMail(bookingId, bookingStatus, transactionId, tpslId, transactionDate, refundAmount) {
document.getElementById('dm_bookingId').value = bookingId;
document.getElementById('dm_bookingStatus').value = bookingStatus;
document.getElementById('dm_transactionId').value = transactionId || '';
document.getElementById('dm_tpslId').value = tpslId || '';
document.getElementById('dm_refundAmount').value = refundAmount || 0;
var amt = parseFloat(refundAmount || 0).toLocaleString('en-IN', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
var body = 'Hi,\n\n';
body += 'Kindly update refund status for the foresaid transaction made for Community Hall Booking.\n\n';
body += 'Transaction Details:\n\n';
body += ' Transaction ID : ' + (transactionId || 'N/A') + '\n';
body += ' TPSL ID : ' + (tpslId || 'N/A') + '\n';
body += ' Transaction Date : ' + (transactionDate || 'N/A') + '\n';
body += ' Refund Amount : ₹ ' + amt + '\n\n';
body += 'If refund was not initiated, kindly initiate the refund and update refund status at the earliest. ';
body += 'Make sure that no duplicate refund was processed against this transaction.\n\n';
body += 'Regards,\n';
body += 'Community Hall Support\n';
body += 'Greater Chennai Corporation';
document.getElementById('draftMailBody').textContent = body;
$('#draftMailModal').modal('show');
}
function confirmMailSent() {
var bookingId = document.getElementById('dm_bookingId').value;
var bookingStatus = document.getElementById('dm_bookingStatus').value;
var transactionId = document.getElementById('dm_transactionId').value;
var tpslId = document.getElementById('dm_tpslId').value;
var refundAmount = document.getElementById('dm_refundAmount').value;
var mailTo = "pgsupport@mail.in.worldline-solutions.com,ranjithkumar@federal.bank.in,megha.mattamana@federal.bank.in";
var mailCc = "arohqcc@gmail.com,it@chennaicorporation.gov.in";
var mailSubject = "Refund Status Update Request – Community Hall Booking";
var mailBody = document.getElementById('draftMailBody').textContent;
var mailtoLink = "mailto:" + mailTo + "?cc=" + mailCc + "&subject=" + encodeURIComponent(mailSubject) + "&body=" + encodeURIComponent(mailBody);
window.location.href = mailtoLink;
document.getElementById('btn-confirm-mail').disabled = true;
$.ajax({
type: 'POST',
url: '/communityhall/headquarters/sixmonthold-transactions/markMailSent',
data: {
bookingId: bookingId,
bookingStatus: bookingStatus,
transactionId: transactionId,
tpslId: tpslId,
refundAmount: refundAmount
},
success: function (resp) {
$('#draftMailModal').modal('hide');
if (resp.status === 'success') {
Swal.fire({
icon: 'success',
title: 'Mail Recorded!',
text: 'Booking ID ' + bookingId + ' has been moved to "Mail Sent Bookings" tab.',
confirmButtonColor: '#1a73e8'
}).then(function () {
location.reload();
});
} else {
Swal.fire('Error', resp.message || 'An error occurred.', 'error');
document.getElementById('btn-confirm-mail').disabled = false;
}
},
error: function () {
Swal.fire('Error', 'Failed to mark mail as sent. Please try again.', 'error');
document.getElementById('btn-confirm-mail').disabled = false;
}
});
}
</script>
</body>
</html>

12
src/main/resources/templates/admin/gccblocking-new.html

@ -324,7 +324,7 @@
<th class="text-center"> <th class="text-center">
<input type="checkbox" id="selectAllBookings" <input type="checkbox" id="selectAllBookings"
title="Select / Deselect all cancellable bookings"> title="Select / Deselect all cancellable bookings">
&nbsp;Cancel?
&nbsp;Select All
</th> </th>
<th class="text-center">#</th> <th class="text-center">#</th>
<th class="text-center">Hall Name</th> <th class="text-center">Hall Name</th>
@ -781,10 +781,20 @@
// Wire select-all checkbox // Wire select-all checkbox
const selAll = document.getElementById('selectAllBookings'); const selAll = document.getElementById('selectAllBookings');
if (selAll) { if (selAll) {
// Select All → toggle every enabled row checkbox
selAll.onchange = function () { selAll.onchange = function () {
document.querySelectorAll('.booking-cb:not(:disabled)') document.querySelectorAll('.booking-cb:not(:disabled)')
.forEach(cb => { cb.checked = selAll.checked; }); .forEach(cb => { cb.checked = selAll.checked; });
}; };
// Individual row checkboxes → sync Select All state
document.querySelectorAll('.booking-cb:not(:disabled)').forEach(cb => {
cb.addEventListener('change', function () {
const total = document.querySelectorAll('.booking-cb:not(:disabled)').length;
const checked = document.querySelectorAll('.booking-cb:not(:disabled):checked').length;
selAll.checked = (total > 0 && checked === total);
});
});
} }
if (hasTodayBooking) { if (hasTodayBooking) {

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

@ -61,17 +61,19 @@
/* Ensure second modal is on top of the first modal */ /* Ensure second modal is on top of the first modal */
.modal-backdrop.show:nth-of-type(2) { .modal-backdrop.show:nth-of-type(2) {
z-index: 1055 !important; /* slightly above the first modal */
z-index: 1055 !important;
/* slightly above the first modal */
} }
#showBookingDetails.modal { #showBookingDetails.modal {
z-index: 1060 !important; /* higher than .modal-backdrop */
z-index: 1060 !important;
/* higher than .modal-backdrop */
} }
</style> </style>
<body> <body>
<!-- Page Container -->
<div id="page-container"
<!-- Page Container -->
<div id="page-container"
class="sidebar-o sidebar-dark enable-page-overlay side-scroll page-header-fixed page-header-dark"> class="sidebar-o sidebar-dark enable-page-overlay side-scroll page-header-fixed page-header-dark">
<!-- Side Overlay aside (right)--> <!-- Side Overlay aside (right)-->
<aside th:replace="~{fragments/aside-right :: aside}"></aside> <aside th:replace="~{fragments/aside-right :: aside}"></aside>
@ -99,18 +101,14 @@
<div class="col-sm-3 mb-2"> <div class="col-sm-3 mb-2">
<label class="form-label" for="fromdate">From:<span <label class="form-label" for="fromdate">From:<span
class="text-danger">*</span></label> <input type="date" class="text-danger">*</span></label> <input type="date"
th:value="${fromdate}"
class="form-control" name="FromDate"
id="fromdate"
placeholder="From Date"
required="required"
data-date-format="yyyy-mm-dd"/>
th:value="${fromdate}" class="form-control" name="FromDate" id="fromdate"
placeholder="From Date" required="required" data-date-format="yyyy-mm-dd" />
</div> </div>
<div class="col-sm-3 mb-2"> <div class="col-sm-3 mb-2">
<label class="form-label" for="todate">To:<span class="text-danger">*</span></label> <label class="form-label" for="todate">To:<span class="text-danger">*</span></label>
<input type="date" th:value="${todate}" class="form-control" name="ToDate" <input type="date" th:value="${todate}" class="form-control" name="ToDate"
id="todate" placeholder="To Date" required="required" id="todate" placeholder="To Date" required="required"
data-date-format="yyyy-mm-dd"/>
data-date-format="yyyy-mm-dd" />
</div> </div>
<div class="col-sm-3 mb-2"> <div class="col-sm-3 mb-2">
<label class="form-label" for="request">Get Info:<span <label class="form-label" for="request">Get Info:<span
@ -128,7 +126,8 @@
<option value="7" th:selected="${request=='7'}">Total Count</option> <option value="7" th:selected="${request=='7'}">Total Count</option>
<option value="9" th:selected="${request=='9'}">Counter Details</option> <option value="9" th:selected="${request=='9'}">Counter Details</option>
<option value="10" th:selected="${request=='10'}">Review Report</option> <option value="10" th:selected="${request=='10'}">Review Report</option>
<option value="11" th:selected="${request=='11'}">Settlement Initited Report</option>
<option value="11" th:selected="${request=='11'}">Settlement Initited Report
</option>
</select> </select>
</div> </div>
@ -248,7 +247,8 @@
</option> </option>
<option value="CANCELED" th:selected="${bookingStatus == 'CANCELED'}">CANCELLED <option value="CANCELED" th:selected="${bookingStatus == 'CANCELED'}">CANCELLED
</option> </option>
<option value="COMPLETED" th:selected="${bookingStatus == 'COMPLETED'}">COMPLETED
<option value="COMPLETED" th:selected="${bookingStatus == 'COMPLETED'}">
COMPLETED
</option> </option>
<option value="PAYMENT_FAILURE" <option value="PAYMENT_FAILURE"
th:selected="${bookingStatus == 'PAYMENT_FAILURE'}">PAYMENT_FAILURE th:selected="${bookingStatus == 'PAYMENT_FAILURE'}">PAYMENT_FAILURE
@ -258,7 +258,8 @@
</option> </option>
<option value="REFUNDED" th:selected="${bookingStatus == 'REFUNDED'}">REFUNDED <option value="REFUNDED" th:selected="${bookingStatus == 'REFUNDED'}">REFUNDED
</option> </option>
<option value="WAITING_FOR_NOC" th:selected="${bookingStatus == 'WAITING_FOR_NOC'}">
<option value="WAITING_FOR_NOC"
th:selected="${bookingStatus == 'WAITING_FOR_NOC'}">
WAITING FOR NOC WAITING FOR NOC
</option> </option>
<option value="WAITING_FOR_NOC_APPROVAL" <option value="WAITING_FOR_NOC_APPROVAL"
@ -274,8 +275,10 @@
<select class="form-control text-center" id="paymentStatus" name="paymentStatus" <select class="form-control text-center" id="paymentStatus" name="paymentStatus"
th:value="${paymentStatus}"> th:value="${paymentStatus}">
<option value="">Select Payment Status</option> <option value="">Select Payment Status</option>
<option value="SUCCESS" th:selected="${paymentStatus == 'SUCCESS'}">SUCCESS</option>
<option value="NOT COMPLETED" th:selected="${paymentStatus == 'NOT COMPLETED'}">NOT
<option value="SUCCESS" th:selected="${paymentStatus == 'SUCCESS'}">SUCCESS
</option>
<option value="NOT COMPLETED" th:selected="${paymentStatus == 'NOT COMPLETED'}">
NOT
COMPLETED COMPLETED
</option> </option>
</select> </select>
@ -314,7 +317,8 @@
<option value="">Select</option> <option value="">Select</option>
<option value="abstract" th:selected="${reporttype == 'abstract'}">Abstract <option value="abstract" th:selected="${reporttype == 'abstract'}">Abstract
</option> </option>
<option value="detailed" th:selected="${reporttype == 'detailed'}">Detailed Report
<option value="detailed" th:selected="${reporttype == 'detailed'}">Detailed
Report
</option> </option>
</select> </select>
<span id="reportTypeError" class="text-danger"></span> <span id="reportTypeError" class="text-danger"></span>
@ -371,6 +375,8 @@
<thead class="thead-dark"> <thead class="thead-dark">
<tr role="row"> <tr role="row">
<th>S.No</th> <th>S.No</th>
<th>Zone</th>
<th>Division</th>
<th>Booking Id</th> <th>Booking Id</th>
<th>Booking Date</th> <th>Booking Date</th>
<th>Hall Name</th> <th>Hall Name</th>
@ -385,12 +391,16 @@
<th>GST</th> <th>GST</th>
<th>Amount Paid</th> <th>Amount Paid</th>
<th>Booking Status</th> <th>Booking Status</th>
<th>Transaction Id</th>
<th>TPSL Id</th>
<th>Action</th> <th>Action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr th:each="booking, iterStat : ${bookings}"> <tr th:each="booking, iterStat : ${bookings}">
<td th:text="${iterStat.count}">0</td> <td th:text="${iterStat.count}">0</td>
<td th:text="${booking[15]}"></td>
<td th:text="${booking[16]}"></td>
<td th:text="${booking[0]}"></td> <td th:text="${booking[0]}"></td>
<td th:text="${booking[1]}"></td> <td th:text="${booking[1]}"></td>
<td th:text="${booking[2]}"></td> <td th:text="${booking[2]}"></td>
@ -406,6 +416,8 @@
<td th:text="${(T(java.lang.Math).round(booking[13] * 100.0) / 100.0)}"></td> <td th:text="${(T(java.lang.Math).round(booking[13] * 100.0) / 100.0)}"></td>
<!--<td th:text="${booking[10]}"></td>--> <!--<td th:text="${booking[10]}"></td>-->
<td th:text="${booking[14]}"></td> <td th:text="${booking[14]}"></td>
<td th:text="${booking[17]}"></td>
<td th:text="${booking[18]}"></td>
<td> <td>
<p> <p>
<span class="badge bg-warning" style="cursor: pointer;" <span class="badge bg-warning" style="cursor: pointer;"
@ -651,12 +663,9 @@
<td th:text="${iterstat.index + 1}"></td> <td th:text="${iterstat.index + 1}"></td>
<td th:text="${counterdata[0]}"></td> <td th:text="${counterdata[0]}"></td>
<td> <td>
<button href="#"
th:attr="data-counter-id=${counterdata[0]}"
data-bs-toggle="modal"
data-bs-target="#bookingModal"
<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;" style="background-color: #2a807f; color: white; border: none; padding: 6px 12px; border-radius: 4px;"
onclick="showCounterTable(this)"> onclick="showCounterTable(this)">
<span th:text="${counterdata[1]}"></span> <span th:text="${counterdata[1]}"></span>
</button> </button>
@ -666,8 +675,8 @@
</table> </table>
</div> </div>
<div th:if="${reporttype == 'detailed'}"> <div th:if="${reporttype == 'detailed'}">
<table id="detailedrequestTable" class="table table-striped table-bordered table-hover dataTable"
role="grid" width="99.5%">
<table id="detailedrequestTable"
class="table table-striped table-bordered table-hover dataTable" role="grid" width="99.5%">
<thead class="thead-dark"> <thead class="thead-dark">
<tr role="row"> <tr role="row">
<th>S.No</th> <th>S.No</th>
@ -737,9 +746,7 @@
<tr th:each="zoneList, iterStat : ${zoneWiseBookingList}"> <tr th:each="zoneList, iterStat : ${zoneWiseBookingList}">
<td th:text="${iterStat.count}">0</td> <td th:text="${iterStat.count}">0</td>
<td> <td>
<button href="#"
th:attr="data-zone-id=${zoneList[0]}"
data-bs-toggle="modal"
<button href="#" th:attr="data-zone-id=${zoneList[0]}" data-bs-toggle="modal"
data-bs-target="#hallModal" data-bs-target="#hallModal"
style="background-color: #2a807f; color: white; border: none; padding: 6px 12px; border-radius: 4px;" style="background-color: #2a807f; color: white; border: none; padding: 6px 12px; border-radius: 4px;"
onclick="showHallDetailsTable(this)"> onclick="showHallDetailsTable(this)">
@ -797,72 +804,61 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div>
</div>
</div> </div>
<div class="modal fade backdrop" id="showBookingDetails" data-backdrop="static"
tabindex="-1" role="dialog" aria-labelledby="staticBackdropLabel"
aria-hidden="true">
<div class="modal fade backdrop" id="showBookingDetails" data-backdrop="static" tabindex="-1" role="dialog"
aria-labelledby="staticBackdropLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document"> <div class="modal-dialog modal-lg" role="document">
<div class="modal-content" id="printableContent"> <div class="modal-content" id="printableContent">
<form id="regform" onsubmit="return rejectsubmit();"> <form id="regform" onsubmit="return rejectsubmit();">
<div
class="block block-rounded block-themed block-transparent mb-0">
<div class="block block-rounded block-themed block-transparent mb-0">
<div class="block-header bg-primary-dark"> <div class="block-header bg-primary-dark">
<h3 class="block-title" id="2mtitle">Booking <h3 class="block-title" id="2mtitle">Booking
Information</h3> Information</h3>
<div class="block-options"> <div class="block-options">
<button type="button" class="btn-block-option"
data-bs-dismiss="modal" aria-label="Close">
<button type="button" class="btn-block-option" data-bs-dismiss="modal"
aria-label="Close">
<i class="fa fa-fw fa-times"></i> <i class="fa fa-fw fa-times"></i>
</button> </button>
</div> </div>
</div> </div>
<div class="block-content row"
style="margin-right:0px;margin:0;padding:0;">
<div class="block-content row" style="margin-right:0px;margin:0;padding:0;">
<div class="col-md-12 col-lg-12 col-sm-12"> <div class="col-md-12 col-lg-12 col-sm-12">
<div class="card-body"> <div class="card-body">
<table> <table>
<tr> <tr>
<th colspan="10"
style="background-color: lightgrey;">
<th colspan="10" style="background-color: lightgrey;">
User Details User Details
</th> </th>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal;">
<th style="padding: 0.45rem 0.45rem;font-weight: normal;">
User Name: User Name:
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_userName"></td> id="td_userName"></td>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal;">
<th style="padding: 0.45rem 0.45rem;font-weight: normal;">
Mobile Number: Mobile Number:
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_mobileNumber"></td> id="td_mobileNumber"></td>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal;">
<th style="padding: 0.45rem 0.45rem;font-weight: normal;">
User Type: User Type:
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_usertype"></td> id="td_usertype"></td>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal;">
<th style="padding: 0.45rem 0.45rem;font-weight: normal;">
User Address: User Address:
</th> </th>
<td colspan="5" class="fw-semibold" <td colspan="5" class="fw-semibold"
@ -870,19 +866,16 @@
id="td_useraddress"></td> id="td_useraddress"></td>
</tr> </tr>
<input type="hidden"
class="form-control text-center"
name="bookingid" id="bookingid" disabled/>
<input type="hidden" class="form-control text-center" name="bookingid"
id="bookingid" disabled />
<tr> <tr>
<th colspan="10"
style="background-color: lightgrey;">
<th colspan="10" style="background-color: lightgrey;">
Hall Details Hall Details
</th> </th>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal;">
<th style="padding: 0.45rem 0.45rem;font-weight: normal;">
Hall Name: Hall Name:
</th> </th>
<td colspan="10" class="fw-semibold" <td colspan="10" class="fw-semibold"
@ -890,117 +883,89 @@
id="td_hallName"></td> id="td_hallName"></td>
</tr> </tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal;">
<tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal;">
Hall Address: Hall Address:
</th> </th>
<td colspan="10" class="fw-semibold" <td colspan="10" class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-wrap: pretty;" style="padding: 0.45rem 0.45rem;text-wrap: pretty;"
id="td_halladdress"></td> id="td_halladdress"></td>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal;">
<th style="padding: 0.45rem 0.45rem;font-weight: normal;">
Caretaker Name: Caretaker Name:
</th> </th>
<td colspan="2" class="fw-semibold" <td colspan="2" class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
id="td_caretakername"></td>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal;">
style="padding: 0.45rem 0.45rem;" id="td_caretakername"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal;">
Caretaker Mobile Number: Caretaker Mobile Number:
</th> </th>
<td colspan="2" class="fw-semibold" <td colspan="2" class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
id="td_caretakermobileNumber"></td>
style="padding: 0.45rem 0.45rem;" id="td_caretakermobileNumber">
</td>
</tr> </tr>
<tr> <tr>
<th colspan="10"
style="background-color: lightgrey;">
<th colspan="10" style="background-color: lightgrey;">
Booking Booking
Details (Booking Id:-<span
id="booking_id"
Details (Booking Id:-<span id="booking_id"
style="color:blue"></span>) style="color:blue"></span>)
</th> </th>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Booking Date: Booking Date:
</th> </th>
<td colspan="2" class="fw-semibold" <td colspan="2" class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
id="td_bookingDate"></td>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
style="padding: 0.45rem 0.45rem;" id="td_bookingDate"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Deposit Amount (in Rs): Deposit Amount (in Rs):
</th> </th>
<td colspan="2"
class="fw-semibold amount-cell"
style="padding: 0.45rem 0.45rem;"
id="td_depositeAmount"></td>
<td colspan="2" class="fw-semibold amount-cell"
style="padding: 0.45rem 0.45rem;" id="td_depositeAmount"></td>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Start Date: Start Date:
</th> </th>
<td colspan="2" class="fw-semibold" <td colspan="2" class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
id="td_startDate"></td>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
style="padding: 0.45rem 0.45rem;" id="td_startDate"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Hall Amount (in Rs): Hall Amount (in Rs):
</th> </th>
<td colspan="2"
class="fw-semibold amount-cell"
style="padding: 0.45rem 0.45rem;"
id="td_hallAmount"></td>
<td colspan="2" class="fw-semibold amount-cell"
style="padding: 0.45rem 0.45rem;" id="td_hallAmount"></td>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
END Date: END Date:
</th> </th>
<td colspan="2" class="fw-semibold" <td colspan="2" class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
id="td_endDate"></td>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
style="padding: 0.45rem 0.45rem;" id="td_endDate"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
GST @18% (in Rs): GST @18% (in Rs):
</th> </th>
<td colspan="2"
class="fw-semibold amount-cell"
style="padding: 0.45rem 0.45rem;"
id="td_gst"></td>
<td colspan="2" class="fw-semibold amount-cell"
style="padding: 0.45rem 0.45rem;" id="td_gst"></td>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Starting Slot: Starting Slot:
</th> </th>
<td colspan="2" class="fw-semibold" <td colspan="2" class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
id="td_startingSlot"></td>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
style="padding: 0.45rem 0.45rem;" id="td_startingSlot"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Total Amount (in Rs): Total Amount (in Rs):
</th> </th>
<td colspan="2"
class="fw-semibold amount-cell"
style="padding: 0.45rem 0.45rem;"
id="td_totalAmount"></td>
<td colspan="2" class="fw-semibold amount-cell"
style="padding: 0.45rem 0.45rem;" id="td_totalAmount"></td>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Ending Slot: Ending Slot:
</th> </th>
<td colspan="2" class="fw-semibold" <td colspan="2" class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
id="td_endingSlot"></td>
style="padding: 0.45rem 0.45rem;" id="td_endingSlot"></td>
<!--<th style="display:none;padding: 0.45rem 0.45rem;border:none" <!--<th style="display:none;padding: 0.45rem 0.45rem;border:none"
id="rejectionreasondiv">Rejection id="rejectionreasondiv">Rejection
Reason:</th> Reason:</th>
@ -1008,8 +973,7 @@
style="padding: 0.45rem 0.45rem;" style="padding: 0.45rem 0.45rem;"
id="reasonforrejection"></td>--> id="reasonforrejection"></td>-->
<th
style="padding: 0.45rem 0.45rem;border:none">
<th style="padding: 0.45rem 0.45rem;border:none">
Booking Status: Booking Status:
</th> </th>
<td colspan="2" class="fw-semibold" <td colspan="2" class="fw-semibold"
@ -1025,52 +989,45 @@
style="padding: 0.45rem 0.45rem;text-wrap: pretty;" style="padding: 0.45rem 0.45rem;text-wrap: pretty;"
id="reasonforrejection"></td> id="reasonforrejection"></td>
</tr> </tr>
</table>
</div>
</div>
<div class="row col-md-12 col-lg-12 col-sm-12">
<tr id="documentsRow">
<td colspan="10" style="padding: 0;">
<div class="documents" id="documents"></div> <div class="documents" id="documents"></div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12 mb-2"
id="paymentsdetails"
style="display:none; margin-top: -16px;">
<div class="card-body">
<table>
</td>
</tr>
<tr id="paymentsdetails" style="display:none;">
<td colspan="10" style="padding: 0;">
<table style="width:100%;">
<tr> <tr>
<th colspan="10"
style="background-color: lightgrey;">
<th colspan="10" style="background-color: lightgrey;">
Booking Payment Details Booking Payment Details
</th> </th>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal;">
<th style="padding: 0.45rem 0.45rem;font-weight: normal;">
Transaction ID: Transaction ID:
</th> </th>
<td colspan="10" class="fw-semibold" <td colspan="10" class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
id="td_transactionId"></td>
style="padding: 0.45rem 0.45rem;" id="td_transactionId"></td>
</tr> </tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal;">
<tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal;">
Amount Received (in Rs): Amount Received (in Rs):
</th> </th>
<td colspan="10" class="fw-semibold" <td colspan="10" class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
id="td_payamountReceived"></td>
style="padding: 0.45rem 0.45rem;" id="td_payamountReceived">
</td>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal;">
<th style="padding: 0.45rem 0.45rem;font-weight: normal;">
Transaction Status: Transaction Status:
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_paymentStatus"></td> id="td_paymentStatus"></td>
</tr> </tr>
</table> </table>
</td>
</tr>
</table>
</div> </div>
</div> </div>
@ -1118,87 +1075,70 @@
</div>--> </div>-->
<div class="row col-md-12 col-lg-12 col-sm-12"
id="ebdetails"
style="display:none;margin-left: 0px;margin-top: -10px">
<div class="row col-md-12 col-lg-12 col-sm-12" id="ebdetails"
style="display:none;margin-left: 0px;">
<div class="card-body"> <div class="card-body">
<table> <table>
<tr> <tr>
<th colspan="4"
style="background-color: lightgrey;">EB
<th colspan="4" style="background-color: lightgrey;">EB
Details Details
</th> </th>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Consumer Number: Consumer Number:
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_EBNumber"></td> id="td_EBNumber"></td>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
EB Amount Per Unit (in Rs): EB Amount Per Unit (in Rs):
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Start Reading: Start Reading:
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_startingReading"></td> id="td_startingReading"></td>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Unit Consumed: Unit Consumed:
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_usedunit"></td> id="td_usedunit"></td>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
END Reading: END Reading:
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td> id="td_endingReading"></td>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
EB Amount (in Rs): EB Amount (in Rs):
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<div class="row col-md-12 col-lg-12 col-sm-12"
id="damagelist" style="disaply:none">
<div class="row col-md-12 col-lg-12 col-sm-12" id="damagelist" style="display:none">
<div id="damageDetails"></div> <div id="damageDetails"></div>
</div> </div>
<div class="col-md-12 col-lg-12 col-sm-12"
id="refunddetails" style="margin-top:-1px">
<div class="col-md-12 col-lg-12 col-sm-12" id="refunddetails"
style="margin-top:-1px">
<div class="card-body"> <div class="card-body">
<table> <table>
<tr> <tr>
<th colspan="2"
style="background-color: lightgrey;">
<th colspan="2" style="background-color: lightgrey;">
Amount to be Refunded (in Rs) Amount to be Refunded (in Rs)
</th> </th>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Deposit Amount: Deposit Amount:
</th> </th>
<td class="fw-semibold amount-cell" <td class="fw-semibold amount-cell"
@ -1207,22 +1147,18 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
EB Amount: EB Amount:
</th> </th>
<td class="fw-semibold amount-cell" <td class="fw-semibold amount-cell"
style="padding: 0.45rem 0.45rem;"
id="td_ebAmount"></td>
style="padding: 0.45rem 0.45rem;" id="td_ebAmount"></td>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Damage Amount: Damage Amount:
</th> </th>
<td class="fw-semibold amount-cell" <td class="fw-semibold amount-cell"
style="padding: 0.45rem 0.45rem;"
id="td_damage"></td>
style="padding: 0.45rem 0.45rem;" id="td_damage"></td>
</tr> </tr>
<tr id="pendingcolumn"> <tr id="pendingcolumn">
<th id="th_settel_label" <th id="th_settel_label"
@ -1235,8 +1171,8 @@
</td> </td>
</tr> </tr>
<tr id="collectionstatuscolumn"> <tr id="collectionstatuscolumn">
<th id="label"
style="padding: 0.45rem 0.45rem;font-weight: normal">Collection
<th id="label" style="padding: 0.45rem 0.45rem;font-weight: normal">
Collection
Pending Status Pending Status
: :
</th> </th>
@ -1258,31 +1194,25 @@
</table> </table>
</div> </div>
</div> </div>
<div class="row col-md-12 col-lg-12 col-sm-12"
id="refundamountDetails"
style="display:none;margin-left: 0px;margin-top: -49px">
<div class="row col-md-12 col-lg-12 col-sm-12" id="refundamountDetails"
style="display:none;margin-left: 0px;">
<div class="card-body"> <div class="card-body">
<table> <table>
<tr> <tr>
<th colspan="4"
style="background-color: lightgrey;">
<th colspan="4" style="background-color: lightgrey;">
Refund Details Refund Details
</th> </th>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Booking Status: Booking Status:
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_bookingStatus"></td> id="td_bookingStatus"></td>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Refund Status: Refund Status:
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_refundStatus"></td> id="td_refundStatus"></td>
</tr> </tr>
<tr> <tr>
@ -1291,16 +1221,14 @@
Refund amount: Refund amount:
</th> </th>
<td class="fw-semibold" colspan="5" <td class="fw-semibold" colspan="5"
style="padding: 0.45rem 0.45rem;"
id="td_refundamount"></td>
style="padding: 0.45rem 0.45rem;" id="td_refundamount"></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<div id="refundMessage" style="display: none;"> <div id="refundMessage" style="display: none;">
<h1 id="refundText"
style="font-size: 17px;margin-left: 20px;color: darkgreen;">
<h1 id="refundText" style="font-size: 17px;margin-left: 20px;color: darkgreen;">
</h1> </h1>
</div> </div>
<div id="rejectrefundMessage" style="display: none;"> <div id="rejectrefundMessage" style="display: none;">
@ -1316,12 +1244,9 @@
</div> </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
<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> </button>
</div> </div>
</form> </form>
@ -1447,7 +1372,8 @@
</div> </div>
</div> </div>
<!-- Modal --> <!-- Modal -->
<div class="modal fade" id="bookingModal" tabindex="-1" aria-labelledby="bookingModalLabel" aria-hidden="true">
<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-dialog modal-xl modal-dialog-scrollable">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
@ -1458,8 +1384,9 @@
<!-- <!--
<table id="modalBookingTable" class="table table-bordered table-striped dataTable" style="width: 100%;"> <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%">
<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}"> <input type="hidden" id="hallBookingJsonInput" th:value="${hallBookingJson}">
<thead> <thead>
@ -1487,7 +1414,8 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<table id="hallDetailsTable" class="table table-bordered table-striped"> <table id="hallDetailsTable" class="table table-bordered table-striped">
<input type="hidden" id="hallBookingDetailsJsonInput" th:value="${hallBookingDetailsJson}">
<input type="hidden" id="hallBookingDetailsJsonInput"
th:value="${hallBookingDetailsJson}">
<thead> <thead>
<tr> <tr>
@ -1529,8 +1457,8 @@
<table id="modalBookingTable" class="table table-bordered table-striped dataTable" style="width: 100%;"> <table id="modalBookingTable" class="table table-bordered table-striped dataTable" style="width: 100%;">
--> -->
<table id="hallwiseBookingTable" <table id="hallwiseBookingTable"
class="table table-striped table-bordered table-hover dataTable"
role="grid" width="99.5%">
class="table table-striped table-bordered table-hover dataTable" role="grid"
width="99.5%">
<input type="hidden" id="hallWiseBookingList" th:value="${hallWiseBookingList}" /> <input type="hidden" id="hallWiseBookingList" th:value="${hallWiseBookingList}" />
<thead> <thead>
@ -1591,14 +1519,14 @@
</main> </main>
<footer th:replace="~{fragments/footer2 :: footer}"></footer> <footer th:replace="~{fragments/footer2 :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/resetpassword :: div}"></div>
<script th:replace="~{fragments/loginscript :: script}"></script>
<div th:replace="~{fragments/resetpassword :: div}"></div>
<script th:replace="~{fragments/loginscript :: script}"></script>
<script>
<script>
/*$(document).ready(function () { /*$(document).ready(function () {
// Common buttons configuration // Common buttons configuration
var buttons = [{ var buttons = [{
@ -1998,7 +1926,7 @@
$.ajax({ $.ajax({
url: '/communityhall/user/api/viewAllBookingDetails', url: '/communityhall/user/api/viewAllBookingDetails',
method: 'GET', method: 'GET',
data: {bookingId: bookingId},
data: { bookingId: bookingId },
success: function (response) { success: function (response) {
document.getElementById("td_userName").innerHTML = response.users.name; document.getElementById("td_userName").innerHTML = response.users.name;
document.getElementById("td_mobileNumber").innerHTML = response.users.mobileNo; document.getElementById("td_mobileNumber").innerHTML = response.users.mobileNo;
@ -2066,7 +1994,7 @@
showReasonDocuments(response); showReasonDocuments(response);
if (response.payments) { if (response.payments) {
document.getElementById("paymentsdetails").style.display = "block";
document.getElementById("paymentsdetails").style.display = "table-row";
document.getElementById("td_transactionId").innerHTML = response.payments.transactionId; document.getElementById("td_transactionId").innerHTML = response.payments.transactionId;
document.getElementById("td_payamountReceived").innerHTML = response.payments.amountReceived; document.getElementById("td_payamountReceived").innerHTML = response.payments.amountReceived;
document.getElementById("td_paymentStatus").innerHTML = response.payments.paymentStatus; document.getElementById("td_paymentStatus").innerHTML = response.payments.paymentStatus;
@ -2170,7 +2098,7 @@
damageFieldContainer.empty(); damageFieldContainer.empty();
// Create a div for table responsiveness // Create a div for table responsiveness
var tableResponsiveDiv = $('<div>').addClass('table-responsive').css({'width': '770px'});
var tableResponsiveDiv = $('<div>').addClass('table-responsive').css({ 'width': '770px' });
// Create table with similar classes and styles to the modal table // Create table with similar classes and styles to the modal table
var table = $('<table>').addClass('table table-bordered table-striped').css({ var table = $('<table>').addClass('table table-bordered table-striped').css({
@ -2267,7 +2195,7 @@
reasonFieldsContainer.empty(); reasonFieldsContainer.empty();
// Create a responsive table container // Create a responsive table container
var tableResponsiveDiv = $('<div>').addClass('table-responsive').css({'width': '770px', 'border': 'black'});
var tableResponsiveDiv = $('<div>').addClass('table-responsive').css({ 'width': '770px', 'border': 'black' });
// Create the table with Bootstrap classes and custom styles // Create the table with Bootstrap classes and custom styles
var table = $('<table>').addClass('table table-bordered table-striped table-vcenter js-dataTable-responsive').css({ var table = $('<table>').addClass('table table-bordered table-striped table-vcenter js-dataTable-responsive').css({
@ -2347,7 +2275,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/communityhall/admin/api/bookingdetailsByuserId', url: '/communityhall/admin/api/bookingdetailsByuserId',
data: {'userId': userId},
data: { 'userId': userId },
success: function (response) { success: function (response) {
// console.log(response); // console.log(response);
$("#bookingTableBody").empty(); // Ensure bookingTableBody is the correct ID of the table body $("#bookingTableBody").empty(); // Ensure bookingTableBody is the correct ID of the table body
@ -2384,7 +2312,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/communityhall/admin/api/bookingdetailsByzone', url: '/communityhall/admin/api/bookingdetailsByzone',
data: {'zone': zone},
data: { 'zone': zone },
success: function (response) { success: function (response) {
// console.log(response); // console.log(response);
@ -2481,7 +2409,7 @@
if (!hallsByDivision[item.division]) { if (!hallsByDivision[item.division]) {
hallsByDivision[item.division] = []; hallsByDivision[item.division] = [];
} }
hallsByDivision[item.division].push({hallName: item.hall_name, hallId: item.hall_id});
hallsByDivision[item.division].push({ hallName: item.hall_name, hallId: item.hall_id });
}); });
// Populate zones // Populate zones
@ -2769,7 +2697,7 @@
</script>
</script>
</body> </body>
</html> </html>

7
src/main/resources/templates/fragments/headquartersMenu.html

@ -114,6 +114,13 @@
<span class="nav-main-link-name">Refund Failed List</span> <span class="nav-main-link-name">Refund Failed List</span>
</a> </a>
</li> </li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/headquarters/sixmonthold-transactions">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">6 Months Old Transactions</span>
</a>
</li>
<!-- <li class="nav-main-item"> <!-- <li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/headquarters/Gccblocking"> <a class="nav-main-link" href="/communityhall/headquarters/Gccblocking">
<i class="nav-main-link-icon fa fa-location-arrow"></i> <i class="nav-main-link-icon fa fa-location-arrow"></i>

55
src/main/resources/templates/headquarters/bookingwaiting.html

@ -352,10 +352,63 @@
'bookingsId': bookingId 'bookingsId': bookingId
}, },
success: function (x) { success: function (x) {
//console.log(x);
// Check if the booking has been rescheduled (scheduleCount > 0)
if (x.scheduleCount > 0) {
// Fetch booking history to get the previously booked dates
$.ajax({
type: "GET",
url: '/communityhall/api/officer/getBookingHistory',
data: {
'bookingId': bookingId
},
success: function (historyList) {
if (historyList && historyList.length > 0) {
// The first history record holds the original (old) booking dates
var oldRecord = historyList[0];
var oldStartDate = oldRecord.startDate || 'N/A';
var oldEndDate = oldRecord.endDate || 'N/A';
var newStartDate = x.startDate || 'N/A';
var newEndDate = x.endDate || 'N/A';
Swal.fire({
icon: 'warning',
title: 'Date Change Notice',
html:
'<p>This booking was previously scheduled for:</p>' +
'<b>From: ' + oldStartDate + ' &nbsp; To: ' + oldEndDate + '</b>' +
'<br><br>' +
'<p>The date has since been changed to:</p>' +
'<b>From: ' + newStartDate + ' &nbsp; To: ' + newEndDate + '</b>',
confirmButtonText: 'OK, Proceed',
confirmButtonColor: '#3085d6'
}).then(function () {
// Record that the officer acknowledged this date-change notification
$.ajax({
type: 'POST',
url: '/communityhall/api/officer/acknowledgeNocNotification',
data: { 'bookingId': bookingId },
complete: function () {
// Open the modal whether the flag update succeeded or not
showBookingInfo(x);
}
});
});
} else {
// No history found — open modal directly
showBookingInfo(x);
}
},
error: function () {
// On history fetch error — open modal directly
showBookingInfo(x); showBookingInfo(x);
} }
}); });
} else {
// scheduleCount === 0 — no rescheduling, open modal directly
showBookingInfo(x);
}
}
});
} }

12
src/main/resources/templates/headquarters/gccblocking-new.html

@ -317,7 +317,7 @@
<th class="text-center"> <th class="text-center">
<input type="checkbox" id="selectAllBookings" <input type="checkbox" id="selectAllBookings"
title="Select / Deselect all cancellable bookings"> title="Select / Deselect all cancellable bookings">
&nbsp;Cancel?
&nbsp;Select All
</th> </th>
<th class="text-center">#</th> <th class="text-center">#</th>
<th class="text-center">Hall Name</th> <th class="text-center">Hall Name</th>
@ -791,10 +791,20 @@
// Wire select-all checkbox // Wire select-all checkbox
const selAll = document.getElementById('selectAllBookings'); const selAll = document.getElementById('selectAllBookings');
if (selAll) { if (selAll) {
// Select All → toggle every enabled row checkbox
selAll.onchange = function () { selAll.onchange = function () {
document.querySelectorAll('.booking-cb:not(:disabled)') document.querySelectorAll('.booking-cb:not(:disabled)')
.forEach(cb => { cb.checked = selAll.checked; }); .forEach(cb => { cb.checked = selAll.checked; });
}; };
// Individual row checkboxes → sync Select All state
document.querySelectorAll('.booking-cb:not(:disabled)').forEach(cb => {
cb.addEventListener('change', function () {
const total = document.querySelectorAll('.booking-cb:not(:disabled)').length;
const checked = document.querySelectorAll('.booking-cb:not(:disabled):checked').length;
selAll.checked = (total > 0 && checked === total);
});
});
} }
if (hasTodayBooking) { if (hasTodayBooking) {

2
src/main/resources/templates/headquarters/halldetailslist.html

@ -1319,6 +1319,7 @@
} }
var zoneLabel = $('#zone2 option:selected').text(); var zoneLabel = $('#zone2 option:selected').text();
var divisionLabel = $('#division2 option:selected').text(); var divisionLabel = $('#division2 option:selected').text();
var hallArea = document.getElementById("hallAreaEdit").value;
var doorNo = document.getElementById("doornoo").value; var doorNo = document.getElementById("doornoo").value;
var street = document.getElementById("street").value; var street = document.getElementById("street").value;
var pinCode = document.getElementById("pincod").value; var pinCode = document.getElementById("pincod").value;
@ -1390,6 +1391,7 @@
formData.append("hallName", hallName); formData.append("hallName", hallName);
formData.append("zone", zoneLabel); formData.append("zone", zoneLabel);
formData.append("division", divisionLabel); formData.append("division", divisionLabel);
formData.append("hallArea", hallArea);
formData.append("doorNo", doorNo); formData.append("doorNo", doorNo);
formData.append("street", street); formData.append("street", street);
formData.append("pinCode", pinCode); formData.append("pinCode", pinCode);

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

@ -58,18 +58,22 @@
width: 98%; width: 98%;
margin: 0 auto; margin: 0 auto;
} }
/* Ensure second modal is on top of the first modal */ /* Ensure second modal is on top of the first modal */
.modal-backdrop.show:nth-of-type(2) { .modal-backdrop.show:nth-of-type(2) {
z-index: 1055 !important; /* slightly above the first modal */
z-index: 1055 !important;
/* slightly above the first modal */
} }
#showBookingDetails.modal { #showBookingDetails.modal {
z-index: 1060 !important; /* higher than .modal-backdrop */
z-index: 1060 !important;
/* higher than .modal-backdrop */
} }
</style> </style>
<body> <body>
<!-- Page Container -->
<div id="page-container"
<!-- Page Container -->
<div id="page-container"
class="sidebar-o sidebar-dark enable-page-overlay side-scroll page-header-fixed page-header-dark"> class="sidebar-o sidebar-dark enable-page-overlay side-scroll page-header-fixed page-header-dark">
<!-- Side Overlay aside (right)--> <!-- Side Overlay aside (right)-->
<aside th:replace="~{fragments/aside-right :: aside}"></aside> <aside th:replace="~{fragments/aside-right :: aside}"></aside>
@ -87,8 +91,8 @@
<!-- Card Container --> <!-- Card Container -->
<div class="content"> <div class="content">
<div class="block block-rounded"> <div class="block block-rounded">
<form id="myForm" th:action="@{/communityhall/headquarters/getReport}" onsubmit="return validateme()"
method="post">
<form id="myForm" th:action="@{/communityhall/headquarters/getReport}"
onsubmit="return validateme()" method="post">
<div class="block-header bg-primary text-white"> <div class="block-header bg-primary text-white">
<h3 class="block-title">Community Hall Reports</h3> <h3 class="block-title">Community Hall Reports</h3>
</div> </div>
@ -97,18 +101,14 @@
<div class="col-sm-3 mb-2"> <div class="col-sm-3 mb-2">
<label class="form-label" for="fromdate">From:<span <label class="form-label" for="fromdate">From:<span
class="text-danger">*</span></label> <input type="date" class="text-danger">*</span></label> <input type="date"
th:value="${fromdate}"
class="form-control" name="FromDate"
id="fromdate"
placeholder="From Date"
required="required"
data-date-format="yyyy-mm-dd"/>
th:value="${fromdate}" class="form-control" name="FromDate" id="fromdate"
placeholder="From Date" required="required" data-date-format="yyyy-mm-dd" />
</div> </div>
<div class="col-sm-3 mb-2"> <div class="col-sm-3 mb-2">
<label class="form-label" for="todate">To:<span class="text-danger">*</span></label> <label class="form-label" for="todate">To:<span class="text-danger">*</span></label>
<input type="date" th:value="${todate}" class="form-control" name="ToDate" <input type="date" th:value="${todate}" class="form-control" name="ToDate"
id="todate" placeholder="To Date" required="required" id="todate" placeholder="To Date" required="required"
data-date-format="yyyy-mm-dd"/>
data-date-format="yyyy-mm-dd" />
</div> </div>
<div class="col-sm-3 mb-2"> <div class="col-sm-3 mb-2">
<label class="form-label" for="request">Get Info:<span <label class="form-label" for="request">Get Info:<span
@ -229,7 +229,8 @@
</option> </option>
<option value="CANCELED" th:selected="${bookingStatus == 'CANCELED'}">CANCELLED <option value="CANCELED" th:selected="${bookingStatus == 'CANCELED'}">CANCELLED
</option> </option>
<option value="COMPLETED" th:selected="${bookingStatus == 'COMPLETED'}">COMPLETED
<option value="COMPLETED" th:selected="${bookingStatus == 'COMPLETED'}">
COMPLETED
</option> </option>
<option value="PAYMENT_FAILURE" <option value="PAYMENT_FAILURE"
th:selected="${bookingStatus == 'PAYMENT_FAILURE'}">PAYMENT_FAILURE th:selected="${bookingStatus == 'PAYMENT_FAILURE'}">PAYMENT_FAILURE
@ -239,7 +240,8 @@
</option> </option>
<option value="REFUNDED" th:selected="${bookingStatus == 'REFUNDED'}">REFUNDED <option value="REFUNDED" th:selected="${bookingStatus == 'REFUNDED'}">REFUNDED
</option> </option>
<option value="WAITING_FOR_NOC" th:selected="${bookingStatus == 'WAITING_FOR_NOC'}">
<option value="WAITING_FOR_NOC"
th:selected="${bookingStatus == 'WAITING_FOR_NOC'}">
WAITING FOR NOC WAITING FOR NOC
</option> </option>
<option value="WAITING_FOR_NOC_APPROVAL" <option value="WAITING_FOR_NOC_APPROVAL"
@ -255,8 +257,10 @@
<select class="form-control text-center" id="paymentStatus" name="paymentStatus" <select class="form-control text-center" id="paymentStatus" name="paymentStatus"
th:value="${paymentStatus}"> th:value="${paymentStatus}">
<option value="">Select Payment Status</option> <option value="">Select Payment Status</option>
<option value="SUCCESS" th:selected="${paymentStatus == 'SUCCESS'}">SUCCESS</option>
<option value="NOT COMPLETED" th:selected="${paymentStatus == 'NOT COMPLETED'}">NOT
<option value="SUCCESS" th:selected="${paymentStatus == 'SUCCESS'}">SUCCESS
</option>
<option value="NOT COMPLETED" th:selected="${paymentStatus == 'NOT COMPLETED'}">
NOT
COMPLETED COMPLETED
</option> </option>
</select> </select>
@ -308,7 +312,8 @@
<option value="">Select</option> <option value="">Select</option>
<option value="abstract" th:selected="${reporttype == 'abstract'}">Abstract <option value="abstract" th:selected="${reporttype == 'abstract'}">Abstract
</option> </option>
<option value="detailed" th:selected="${reporttype == 'detailed'}">Detailed Report
<option value="detailed" th:selected="${reporttype == 'detailed'}">Detailed
Report
</option> </option>
</select> </select>
<span id="reportTypeError" class="text-danger"></span> <span id="reportTypeError" class="text-danger"></span>
@ -366,6 +371,8 @@
<thead class="thead-dark"> <thead class="thead-dark">
<tr role="row"> <tr role="row">
<th>S.No</th> <th>S.No</th>
<th>Zone</th>
<th>Division</th>
<th>Booking Id</th> <th>Booking Id</th>
<th>Booking Date</th> <th>Booking Date</th>
<th>Hall Name</th> <th>Hall Name</th>
@ -380,12 +387,16 @@
<th>GST</th> <th>GST</th>
<th>Amount Paid</th> <th>Amount Paid</th>
<th>Booking Status</th> <th>Booking Status</th>
<th>Transaction Id</th>
<th>TPSL Id</th>
<th>Action</th> <th>Action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr th:each="booking, iterStat : ${bookings}"> <tr th:each="booking, iterStat : ${bookings}">
<td th:text="${iterStat.count}">0</td> <td th:text="${iterStat.count}">0</td>
<td th:text="${booking[15]}"></td>
<td th:text="${booking[16]}"></td>
<td th:text="${booking[0]}"></td> <td th:text="${booking[0]}"></td>
<td th:text="${booking[1]}"></td> <td th:text="${booking[1]}"></td>
<td th:text="${booking[2]}"></td> <td th:text="${booking[2]}"></td>
@ -401,6 +412,8 @@
<td th:text="${(T(java.lang.Math).round(booking[13] * 100.0) / 100.0)}"></td> <td th:text="${(T(java.lang.Math).round(booking[13] * 100.0) / 100.0)}"></td>
<!--<td th:text="${booking[10]}"></td>--> <!--<td th:text="${booking[10]}"></td>-->
<td th:text="${booking[14]}"></td> <td th:text="${booking[14]}"></td>
<td th:text="${booking[17]}"></td>
<td th:text="${booking[18]}"></td>
<td> <td>
<p> <p>
<span class="badge bg-warning" style="cursor: pointer;" <span class="badge bg-warning" style="cursor: pointer;"
@ -645,12 +658,9 @@
<td th:text="${iterstat.index + 1}"></td> <td th:text="${iterstat.index + 1}"></td>
<td th:text="${counterdata[0]}"></td> <td th:text="${counterdata[0]}"></td>
<td> <td>
<button href="#"
th:attr="data-counter-id=${counterdata[0]}"
data-bs-toggle="modal"
data-bs-target="#bookingModal"
<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;" style="background-color: #2a807f; color: white; border: none; padding: 6px 12px; border-radius: 4px;"
onclick="showCounterTable(this)"> onclick="showCounterTable(this)">
<span th:text="${counterdata[1]}"></span> <span th:text="${counterdata[1]}"></span>
</button> </button>
@ -660,8 +670,8 @@
</table> </table>
</div> </div>
<div th:if="${reporttype == 'detailed'}"> <div th:if="${reporttype == 'detailed'}">
<table id="detailedrequestTable" class="table table-striped table-bordered table-hover dataTable"
role="grid" width="99.5%">
<table id="detailedrequestTable"
class="table table-striped table-bordered table-hover dataTable" role="grid" width="99.5%">
<thead class="thead-dark"> <thead class="thead-dark">
<tr role="row"> <tr role="row">
<th>S.No</th> <th>S.No</th>
@ -717,66 +727,55 @@
</div> </div>
<div class="modal fade backdrop" id="showBookingDetails" data-backdrop="static"
tabindex="-1" role="dialog" aria-labelledby="staticBackdropLabel"
aria-hidden="true">
<div class="modal fade backdrop" id="showBookingDetails" data-backdrop="static" tabindex="-1" role="dialog"
aria-labelledby="staticBackdropLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document"> <div class="modal-dialog modal-lg" role="document">
<div class="modal-content" id="printableContent"> <div class="modal-content" id="printableContent">
<form id="regform" onsubmit="return rejectsubmit();"> <form id="regform" onsubmit="return rejectsubmit();">
<div
class="block block-rounded block-themed block-transparent mb-0">
<div class="block block-rounded block-themed block-transparent mb-0">
<div class="block-header bg-primary-dark"> <div class="block-header bg-primary-dark">
<h3 class="block-title" id="2mtitle">Booking <h3 class="block-title" id="2mtitle">Booking
Information</h3> Information</h3>
<div class="block-options"> <div class="block-options">
<button type="button" class="btn-block-option"
data-bs-dismiss="modal" aria-label="Close">
<button type="button" class="btn-block-option" data-bs-dismiss="modal"
aria-label="Close">
<i class="fa fa-fw fa-times"></i> <i class="fa fa-fw fa-times"></i>
</button> </button>
</div> </div>
</div> </div>
<div class="block-content row"
style="margin-right:0px;margin:0;padding:0;">
<div class="block-content row" style="margin-right:0px;margin:0;padding:0;">
<div class="col-md-12 col-lg-12 col-sm-12"> <div class="col-md-12 col-lg-12 col-sm-12">
<div class="card-body"> <div class="card-body">
<table> <table>
<tr> <tr>
<th colspan="10"
style="background-color: lightgrey;">
<th colspan="10" style="background-color: lightgrey;">
User Details User Details
</th> </th>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal;">
<th style="padding: 0.45rem 0.45rem;font-weight: normal;">
User Name: User Name:
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_userName"></td> id="td_userName"></td>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal;">
<th style="padding: 0.45rem 0.45rem;font-weight: normal;">
Mobile Number: Mobile Number:
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_mobileNumber"></td> id="td_mobileNumber"></td>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal;">
<th style="padding: 0.45rem 0.45rem;font-weight: normal;">
User Type: User Type:
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_usertype"></td> id="td_usertype"></td>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal;">
<th style="padding: 0.45rem 0.45rem;font-weight: normal;">
User Address: User Address:
</th> </th>
<td colspan="5" class="fw-semibold" <td colspan="5" class="fw-semibold"
@ -784,19 +783,16 @@
id="td_useraddress"></td> id="td_useraddress"></td>
</tr> </tr>
<input type="hidden"
class="form-control text-center"
name="bookingid" id="bookingid" disabled/>
<input type="hidden" class="form-control text-center" name="bookingid"
id="bookingid" disabled />
<tr> <tr>
<th colspan="10"
style="background-color: lightgrey;">
<th colspan="10" style="background-color: lightgrey;">
Hall Details Hall Details
</th> </th>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal;">
<th style="padding: 0.45rem 0.45rem;font-weight: normal;">
Hall Name: Hall Name:
</th> </th>
<td colspan="10" class="fw-semibold" <td colspan="10" class="fw-semibold"
@ -804,8 +800,7 @@
id="td_hallName"></td> id="td_hallName"></td>
</tr> </tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal;">
<th style="padding: 0.45rem 0.45rem;font-weight: normal;">
Hall Address: Hall Address:
</th> </th>
<td colspan="10" class="fw-semibold" <td colspan="10" class="fw-semibold"
@ -814,107 +809,80 @@
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal;">
<th style="padding: 0.45rem 0.45rem;font-weight: normal;">
Caretaker Name: Caretaker Name:
</th> </th>
<td colspan="2" class="fw-semibold" <td colspan="2" class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
id="td_caretakername"></td>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal;">
style="padding: 0.45rem 0.45rem;" id="td_caretakername"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal;">
Caretaker Mobile Number: Caretaker Mobile Number:
</th> </th>
<td colspan="2" class="fw-semibold" <td colspan="2" class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
id="td_caretakermobileNumber"></td>
style="padding: 0.45rem 0.45rem;" id="td_caretakermobileNumber">
</td>
</tr> </tr>
<tr> <tr>
<th colspan="10"
style="background-color: lightgrey;">
<th colspan="10" style="background-color: lightgrey;">
Booking Booking
Details (Booking Id:-<span
id="booking_id"
Details (Booking Id:-<span id="booking_id"
style="color:blue"></span>) style="color:blue"></span>)
</th> </th>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Booking Date: Booking Date:
</th> </th>
<td colspan="2" class="fw-semibold" <td colspan="2" class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
id="td_bookingDate"></td>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
style="padding: 0.45rem 0.45rem;" id="td_bookingDate"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Deposit Amount (in Rs): Deposit Amount (in Rs):
</th> </th>
<td colspan="2"
class="fw-semibold amount-cell"
style="padding: 0.45rem 0.45rem;"
id="td_depositeAmount"></td>
<td colspan="2" class="fw-semibold amount-cell"
style="padding: 0.45rem 0.45rem;" id="td_depositeAmount"></td>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Start Date: Start Date:
</th> </th>
<td colspan="2" class="fw-semibold" <td colspan="2" class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
id="td_startDate"></td>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
style="padding: 0.45rem 0.45rem;" id="td_startDate"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Hall Amount (in Rs): Hall Amount (in Rs):
</th> </th>
<td colspan="2"
class="fw-semibold amount-cell"
style="padding: 0.45rem 0.45rem;"
id="td_hallAmount"></td>
<td colspan="2" class="fw-semibold amount-cell"
style="padding: 0.45rem 0.45rem;" id="td_hallAmount"></td>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
END Date: END Date:
</th> </th>
<td colspan="2" class="fw-semibold" <td colspan="2" class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
id="td_endDate"></td>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
style="padding: 0.45rem 0.45rem;" id="td_endDate"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
GST @18% (in Rs): GST @18% (in Rs):
</th> </th>
<td colspan="2"
class="fw-semibold amount-cell"
style="padding: 0.45rem 0.45rem;"
id="td_gst"></td>
<td colspan="2" class="fw-semibold amount-cell"
style="padding: 0.45rem 0.45rem;" id="td_gst"></td>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Starting Slot: Starting Slot:
</th> </th>
<td colspan="2" class="fw-semibold" <td colspan="2" class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
id="td_startingSlot"></td>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
style="padding: 0.45rem 0.45rem;" id="td_startingSlot"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Total Amount (in Rs): Total Amount (in Rs):
</th> </th>
<td colspan="2"
class="fw-semibold amount-cell"
style="padding: 0.45rem 0.45rem;"
id="td_totalAmount"></td>
<td colspan="2" class="fw-semibold amount-cell"
style="padding: 0.45rem 0.45rem;" id="td_totalAmount"></td>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Ending Slot: Ending Slot:
</th> </th>
<td colspan="2" class="fw-semibold" <td colspan="2" class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
id="td_endingSlot"></td>
style="padding: 0.45rem 0.45rem;" id="td_endingSlot"></td>
<!--<th style="display:none;padding: 0.45rem 0.45rem;border:none" <!--<th style="display:none;padding: 0.45rem 0.45rem;border:none"
id="rejectionreasondiv">Rejection id="rejectionreasondiv">Rejection
Reason:</th> Reason:</th>
@ -922,8 +890,7 @@
style="padding: 0.45rem 0.45rem;" style="padding: 0.45rem 0.45rem;"
id="reasonforrejection"></td>--> id="reasonforrejection"></td>-->
<th
style="padding: 0.45rem 0.45rem;border:none">
<th style="padding: 0.45rem 0.45rem;border:none">
Booking Status: Booking Status:
</th> </th>
<td colspan="2" class="fw-semibold" <td colspan="2" class="fw-semibold"
@ -945,129 +912,104 @@
<div class="row col-md-12 col-lg-12 col-sm-12"> <div class="row col-md-12 col-lg-12 col-sm-12">
<div class="documents" id="documents"></div> <div class="documents" id="documents"></div>
</div> </div>
<div class="col-md-12 col-lg-12 col-sm-12 mb-2"
id="paymentsdetails"
<div class="col-md-12 col-lg-12 col-sm-12 mb-2" id="paymentsdetails"
style="display:none; margin-top: -16px;"> style="display:none; margin-top: -16px;">
<div class="card-body"> <div class="card-body">
<table> <table>
<tr> <tr>
<th colspan="10"
style="background-color: lightgrey;">
<th colspan="10" style="background-color: lightgrey;">
Booking Payment Details Booking Payment Details
</th> </th>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal;">
<th style="padding: 0.45rem 0.45rem;font-weight: normal;">
Transaction ID: Transaction ID:
</th> </th>
<td colspan="10" class="fw-semibold" <td colspan="10" class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
id="td_transactionId"></td>
style="padding: 0.45rem 0.45rem;" id="td_transactionId"></td>
</tr> </tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal;">
<th style="padding: 0.45rem 0.45rem;font-weight: normal;">
Amount Received (in Rs): Amount Received (in Rs):
</th> </th>
<td colspan="10" class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
<td colspan="10" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_payamountReceived"></td> id="td_payamountReceived"></td>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal;">
<th style="padding: 0.45rem 0.45rem;font-weight: normal;">
Transaction Status: Transaction Status:
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_paymentStatus"></td> id="td_paymentStatus"></td>
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
<div class="row col-md-12 col-lg-12 col-sm-12"
id="ebdetails"
<div class="row col-md-12 col-lg-12 col-sm-12" id="ebdetails"
style="display:none;margin-left: 0px;margin-top: -10px"> style="display:none;margin-left: 0px;margin-top: -10px">
<div class="card-body"> <div class="card-body">
<table> <table>
<tr> <tr>
<th colspan="4"
style="background-color: lightgrey;">EB
<th colspan="4" style="background-color: lightgrey;">EB
Details Details
</th> </th>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Consumer Number: Consumer Number:
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_EBNumber"></td> id="td_EBNumber"></td>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
EB Amount Per Unit (in Rs): EB Amount Per Unit (in Rs):
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Start Reading: Start Reading:
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_startingReading"></td> id="td_startingReading"></td>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Unit Consumed: Unit Consumed:
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_usedunit"></td> id="td_usedunit"></td>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
END Reading: END Reading:
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td> id="td_endingReading"></td>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
EB Amount (in Rs): EB Amount (in Rs):
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<div class="row col-md-12 col-lg-12 col-sm-12"
id="damagelist" style="disaply:none">
<div class="row col-md-12 col-lg-12 col-sm-12" id="damagelist" style="disaply:none">
<div id="damageDetails"></div> <div id="damageDetails"></div>
</div> </div>
<div class="col-md-12 col-lg-12 col-sm-12"
id="refunddetails" style="margin-top:-1px">
<div class="col-md-12 col-lg-12 col-sm-12" id="refunddetails"
style="margin-top:-1px">
<div class="card-body"> <div class="card-body">
<table> <table>
<tr> <tr>
<th colspan="2"
style="background-color: lightgrey;">
<th colspan="2" style="background-color: lightgrey;">
Amount to be Refunded (in Rs) Amount to be Refunded (in Rs)
</th> </th>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Deposit Amount: Deposit Amount:
</th> </th>
<td class="fw-semibold amount-cell" <td class="fw-semibold amount-cell"
@ -1076,22 +1018,18 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
EB Amount: EB Amount:
</th> </th>
<td class="fw-semibold amount-cell" <td class="fw-semibold amount-cell"
style="padding: 0.45rem 0.45rem;"
id="td_ebAmount"></td>
style="padding: 0.45rem 0.45rem;" id="td_ebAmount"></td>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Damage Amount: Damage Amount:
</th> </th>
<td class="fw-semibold amount-cell" <td class="fw-semibold amount-cell"
style="padding: 0.45rem 0.45rem;"
id="td_damage"></td>
style="padding: 0.45rem 0.45rem;" id="td_damage"></td>
</tr> </tr>
<tr id="pendingcolumn"> <tr id="pendingcolumn">
<th id="th_settel_label" <th id="th_settel_label"
@ -1104,8 +1042,8 @@
</td> </td>
</tr> </tr>
<tr id="collectionstatuscolumn"> <tr id="collectionstatuscolumn">
<th id="label"
style="padding: 0.45rem 0.45rem;font-weight: normal">Collection
<th id="label" style="padding: 0.45rem 0.45rem;font-weight: normal">
Collection
Pending Status Pending Status
: :
</th> </th>
@ -1127,31 +1065,25 @@
</table> </table>
</div> </div>
</div> </div>
<div class="row col-md-12 col-lg-12 col-sm-12"
id="refundamountDetails"
<div class="row col-md-12 col-lg-12 col-sm-12" id="refundamountDetails"
style="display:none;margin-left: 0px;margin-top: -49px"> style="display:none;margin-left: 0px;margin-top: -49px">
<div class="card-body"> <div class="card-body">
<table> <table>
<tr> <tr>
<th colspan="4"
style="background-color: lightgrey;">
<th colspan="4" style="background-color: lightgrey;">
Refund Details Refund Details
</th> </th>
</tr> </tr>
<tr> <tr>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Booking Status: Booking Status:
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_bookingStatus"></td> id="td_bookingStatus"></td>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Refund Status: Refund Status:
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;"
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_refundStatus"></td> id="td_refundStatus"></td>
</tr> </tr>
<tr> <tr>
@ -1160,16 +1092,14 @@
Refund amount: Refund amount:
</th> </th>
<td class="fw-semibold" colspan="5" <td class="fw-semibold" colspan="5"
style="padding: 0.45rem 0.45rem;"
id="td_refundamount"></td>
style="padding: 0.45rem 0.45rem;" id="td_refundamount"></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<div id="refundMessage" style="display: none;"> <div id="refundMessage" style="display: none;">
<h1 id="refundText"
style="font-size: 17px;margin-left: 20px;color: darkgreen;">
<h1 id="refundText" style="font-size: 17px;margin-left: 20px;color: darkgreen;">
</h1> </h1>
</div> </div>
<div id="rejectrefundMessage" style="display: none;"> <div id="rejectrefundMessage" style="display: none;">
@ -1185,12 +1115,9 @@
</div> </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
<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> </button>
</div> </div>
</form> </form>
@ -1316,7 +1243,8 @@
</div> </div>
</div> </div>
<div class="modal fade" id="bookingModal" tabindex="-1" aria-labelledby="bookingModalLabel" aria-hidden="true">
<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-dialog modal-xl modal-dialog-scrollable">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
@ -1327,8 +1255,9 @@
<!-- <!--
<table id="modalBookingTable" class="table table-bordered table-striped dataTable" style="width: 100%;"> <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%">
<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}"> <input type="hidden" id="hallBookingJsonInput" th:value="${hallBookingJson}">
<thead> <thead>
@ -1356,7 +1285,8 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<table id="hallDetailsTable" class="table table-bordered table-striped"> <table id="hallDetailsTable" class="table table-bordered table-striped">
<input type="hidden" id="hallBookingDetailsJsonInput" th:value="${hallBookingDetailsJson}">
<input type="hidden" id="hallBookingDetailsJsonInput"
th:value="${hallBookingDetailsJson}">
<thead> <thead>
<tr> <tr>
@ -1404,14 +1334,14 @@
</main> </main>
<footer th:replace="~{fragments/footer2 :: footer}"></footer> <footer th:replace="~{fragments/footer2 :: footer}"></footer>
</div>
</div>
<div th:replace="~{fragments/resetpassword :: div}"></div>
<script th:replace="~{fragments/loginscript :: script}"></script>
<div th:replace="~{fragments/resetpassword :: div}"></div>
<script th:replace="~{fragments/loginscript :: script}"></script>
<script>
<script>
/*$(document).ready(function () { /*$(document).ready(function () {
// Common buttons configuration // Common buttons configuration
var buttons = [{ var buttons = [{
@ -1800,7 +1730,7 @@
$.ajax({ $.ajax({
url: '/communityhall/user/api/viewAllBookingDetails', url: '/communityhall/user/api/viewAllBookingDetails',
method: 'GET', method: 'GET',
data: {bookingId: bookingId},
data: { bookingId: bookingId },
success: function (response) { success: function (response) {
document.getElementById("td_userName").innerHTML = response.users.name; document.getElementById("td_userName").innerHTML = response.users.name;
document.getElementById("td_mobileNumber").innerHTML = response.users.mobileNo; document.getElementById("td_mobileNumber").innerHTML = response.users.mobileNo;
@ -1961,7 +1891,7 @@
damageFieldContainer.empty(); damageFieldContainer.empty();
// Create a div for table responsiveness // Create a div for table responsiveness
var tableResponsiveDiv = $('<div>').addClass('table-responsive').css({'width': '770px'});
var tableResponsiveDiv = $('<div>').addClass('table-responsive').css({ 'width': '770px' });
// Create table with similar classes and styles to the modal table // Create table with similar classes and styles to the modal table
var table = $('<table>').addClass('table table-bordered table-striped').css({ var table = $('<table>').addClass('table table-bordered table-striped').css({
@ -2058,7 +1988,7 @@
reasonFieldsContainer.empty(); reasonFieldsContainer.empty();
// Create a responsive table container // Create a responsive table container
var tableResponsiveDiv = $('<div>').addClass('table-responsive').css({'width': '770px', 'border': 'black'});
var tableResponsiveDiv = $('<div>').addClass('table-responsive').css({ 'width': '770px', 'border': 'black' });
// Create the table with Bootstrap classes and custom styles // Create the table with Bootstrap classes and custom styles
var table = $('<table>').addClass('table table-bordered table-striped table-vcenter js-dataTable-responsive').css({ var table = $('<table>').addClass('table table-bordered table-striped table-vcenter js-dataTable-responsive').css({
@ -2138,7 +2068,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/communityhall/admin/api/bookingdetailsByuserId', url: '/communityhall/admin/api/bookingdetailsByuserId',
data: {'userId': userId},
data: { 'userId': userId },
success: function (response) { success: function (response) {
// console.log(response); // console.log(response);
$("#bookingTableBody").empty(); // Ensure bookingTableBody is the correct ID of the table body $("#bookingTableBody").empty(); // Ensure bookingTableBody is the correct ID of the table body
@ -2175,7 +2105,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/communityhall/admin/api/bookingdetailsByzone', url: '/communityhall/admin/api/bookingdetailsByzone',
data: {'zone': zone},
data: { 'zone': zone },
success: function (response) { success: function (response) {
// console.log(response); // console.log(response);
@ -2272,7 +2202,7 @@
if (!hallsByDivision[item.division]) { if (!hallsByDivision[item.division]) {
hallsByDivision[item.division] = []; hallsByDivision[item.division] = [];
} }
hallsByDivision[item.division].push({hallName: item.hall_name, hallId: item.hall_id});
hallsByDivision[item.division].push({ hallName: item.hall_name, hallId: item.hall_id });
}); });
// Populate zones // Populate zones
@ -2478,7 +2408,7 @@ data-hall-name="${row[3]}">${row[4]}</button>`
viewDetails(bookingId); viewDetails(bookingId);
} }
</script>
</script>
</body> </body>
</html> </html>

80
src/main/resources/templates/headquarters/settlement-completed.html

@ -1,22 +1,26 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"> <html xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/head-headquarters :: head}"></head> <head th:replace="~{fragments/head-headquarters :: head}"></head>
<style> <style>
.card-body table { .card-body table {
width: 100%; width: 100%;
padding: 100px; padding: 100px;
} }
.card-body th, .card-body th,
td { td {
padding: 8px; padding: 8px;
text-align: left; text-align: left;
} }
.amount-cell { .amount-cell {
text-align: right; text-align: right;
padding-right: 1rem; padding-right: 1rem;
/* Adjust padding as needed */ /* Adjust padding as needed */
} }
.table { .table {
width: 100% !important; width: 100% !important;
} }
@ -30,6 +34,7 @@
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO"
crossorigin="anonymous"></script> crossorigin="anonymous"></script>
<body> <body>
<!-- Page Container --> <!-- Page Container -->
<div id="page-container" <div id="page-container"
@ -96,7 +101,8 @@
th:text="${settlements.hallDetails.hallName}"></td> th:text="${settlements.hallDetails.hallName}"></td>
<td class="text-center" th:text="${settlements.bookingId}"></td> <td class="text-center" th:text="${settlements.bookingId}"></td>
<td class="text-center" th:text="${settlements.bookingDate}"></td> <td class="text-center" th:text="${settlements.bookingDate}"></td>
<td class="text-center" th:text="${settlements.settlement.updatedDate}"></td>
<td class="text-center"
th:text="${settlements.settlement.updatedDate}"></td>
<td class="text-center" <td class="text-center"
th:text="${settlements.settlement.settlementId}"></td> th:text="${settlements.settlement.settlementId}"></td>
<td class="text-center" <td class="text-center"
@ -218,7 +224,8 @@
th:text="${rejectedbookings.users.usertype}"></td> th:text="${rejectedbookings.users.usertype}"></td>
<td class="text-center" th:text="${rejectedbookings.reason}"></td> <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.comments}"></td>
<td class="text-center" th:text="${rejectedbookings.amountReceived}">
<td class="text-center"
th:text="${rejectedbookings.amountReceived}">
</td> </td>
<td> <td>
<p> <p>
@ -371,7 +378,8 @@
Details</th> Details</th>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:</th>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer
Number:</th>
<td class="fw-semibold" <td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;" style="padding: 0.45rem 0.45rem;text-align:center;"
id="td_EBNumber"></td> id="td_EBNumber"></td>
@ -448,7 +456,8 @@
<tr id="pendingcolumn"> <tr id="pendingcolumn">
<th id="th_settel_label" <th id="th_settel_label"
style="padding: 0.45rem 0.45rem;font-weight: normal">Collected Amount:</th>
style="padding: 0.45rem 0.45rem;font-weight: normal">Collected
Amount:</th>
<td class="fw-semibold amount-cell" <td class="fw-semibold amount-cell"
style="padding: 0.45rem 0.45rem; color: green;" id="td_pending_amt"> style="padding: 0.45rem 0.45rem; color: green;" id="td_pending_amt">
0</td> 0</td>
@ -738,7 +747,7 @@
$('#SettlementCompletedListTable').DataTable({ $('#SettlementCompletedListTable').DataTable({
dom: 'Bftip', dom: 'Bftip',
columnDefs: [ columnDefs: [
{targets: 'no-sort', orderable: false}
{ targets: 'no-sort', orderable: false }
], ],
lengthMenu: [ lengthMenu: [
[50, 100, 200, 500, -1], [50, 100, 200, 500, -1],
@ -756,7 +765,7 @@
$('#cancelledcompletedListTable').DataTable({ $('#cancelledcompletedListTable').DataTable({
dom: 'Bftip', dom: 'Bftip',
columnDefs: [ columnDefs: [
{targets: 'no-sort', orderable: false}
{ targets: 'no-sort', orderable: false }
], ],
lengthMenu: [ lengthMenu: [
[50, 100, 200, 500, -1], [50, 100, 200, 500, -1],
@ -774,7 +783,7 @@
$('#rejectedcompletedListTable').DataTable({ $('#rejectedcompletedListTable').DataTable({
dom: 'Bftip', dom: 'Bftip',
columnDefs: [ columnDefs: [
{targets: 'no-sort', orderable: false}
{ targets: 'no-sort', orderable: false }
], ],
lengthMenu: [ lengthMenu: [
[50, 100, 200, 500, -1], [50, 100, 200, 500, -1],
@ -838,7 +847,7 @@
document.getElementById("td_depositeAmount").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2); document.getElementById("td_depositeAmount").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2);
document.getElementById("td_hallAmount").innerHTML = '₹ ' + parseFloat(list.hallAmount).toFixed(2); document.getElementById("td_hallAmount").innerHTML = '₹ ' + parseFloat(list.hallAmount).toFixed(2);
// Calculate GST and total amount // Calculate GST and total amount
var gstAmount = (parseFloat(list.hallAmount) * (list.hallDetails.gst/100)).toFixed(2);
var gstAmount = (parseFloat(list.hallAmount) * (list.hallDetails.gst / 100)).toFixed(2);
var totalAmount = parseFloat(list.amountReceived).toFixed(2); var totalAmount = parseFloat(list.amountReceived).toFixed(2);
document.getElementById("td_gst").innerHTML = '₹ ' + gstAmount; document.getElementById("td_gst").innerHTML = '₹ ' + gstAmount;
document.getElementById("td_totalAmount").innerHTML = '₹ ' + totalAmount; document.getElementById("td_totalAmount").innerHTML = '₹ ' + totalAmount;
@ -879,7 +888,7 @@
// Create a div for table responsiveness // Create a div for table responsiveness
var tableResponsiveDiv = $('<div>').addClass('table-responsive'); var tableResponsiveDiv = $('<div>').addClass('table-responsive');
// Create table with similar classes and styles to the modal table // Create table with similar classes and styles to the modal table
var table = $('<table>').addClass('table table-bordered table-striped').css({'width': '97%', 'border-color': 'black', 'border-top-color': 'white'});
var table = $('<table>').addClass('table table-bordered table-striped').css({ 'width': '97%', 'border-color': 'black', 'border-top-color': 'white' });
var thead = $('<thead>').addClass('thead-light'); var thead = $('<thead>').addClass('thead-light');
var tbody = $('<tbody>'); var tbody = $('<tbody>');
// Create Damage Details header row // Create Damage Details header row
@ -892,16 +901,16 @@
}).appendTo(headerRow); }).appendTo(headerRow);
// Create table header row // Create table header row
var columnHeadersRow = $('<tr>').css('background-color', '#f2f2f2').appendTo(thead); var columnHeadersRow = $('<tr>').css('background-color', '#f2f2f2').appendTo(thead);
$('<th>').text('S.No').css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(columnHeadersRow);
$('<th>').text('Asset Name').css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(columnHeadersRow);
$('<th>').text('Damage Img').css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(columnHeadersRow);
$('<th>').text('Cost').css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(columnHeadersRow);
$('<th>').text('Qty').css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(columnHeadersRow);
$('<th>').text('Amount').css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(columnHeadersRow);
$('<th>').text('S.No').css({ 'padding': '0.45rem 0.45rem', 'text-align': 'center' }).appendTo(columnHeadersRow);
$('<th>').text('Asset Name').css({ 'padding': '0.45rem 0.45rem', 'text-align': 'center' }).appendTo(columnHeadersRow);
$('<th>').text('Damage Img').css({ 'padding': '0.45rem 0.45rem', 'text-align': 'center' }).appendTo(columnHeadersRow);
$('<th>').text('Cost').css({ 'padding': '0.45rem 0.45rem', 'text-align': 'center' }).appendTo(columnHeadersRow);
$('<th>').text('Qty').css({ 'padding': '0.45rem 0.45rem', 'text-align': 'center' }).appendTo(columnHeadersRow);
$('<th>').text('Amount').css({ 'padding': '0.45rem 0.45rem', 'text-align': 'center' }).appendTo(columnHeadersRow);
var totalAmount = 0; var totalAmount = 0;
// Check if damageList is empty
if (data.damageList.length === 0) {
// Check if damageList is empty
if (data.damageList.length === 0) {
var row = $('<tr>').appendTo(tbody); var row = $('<tr>').appendTo(tbody);
$('<td>').attr('colspan', '6').text('No Damaged Items').css({ $('<td>').attr('colspan', '6').text('No Damaged Items').css({
'padding': '0.45rem 0.45rem', 'padding': '0.45rem 0.45rem',
@ -909,7 +918,7 @@ if (data.damageList.length === 0) {
'font-weight': 'bold', 'font-weight': 'bold',
'background-color': '#f2f2f2' 'background-color': '#f2f2f2'
}).appendTo(row); }).appendTo(row);
} else {
} else {
$.each(data.damageList, function (index, detail) { $.each(data.damageList, function (index, detail) {
var row = $('<tr>').appendTo(tbody); var row = $('<tr>').appendTo(tbody);
$('<td>').text(index + 1).css({ $('<td>').text(index + 1).css({
@ -961,7 +970,7 @@ if (data.damageList.length === 0) {
}).appendTo(totalRow); }).appendTo(totalRow);
$("#td_dam_amt").html('₹ ' + totalAmount.toFixed(2)); $("#td_dam_amt").html('₹ ' + totalAmount.toFixed(2));
}
}
// Append the table elements to the container div // Append the table elements to the container div
@ -998,7 +1007,7 @@ if (data.damageList.length === 0) {
var tableResponsiveDiv = $('<div>').addClass('table-responsive').css('margin-right', '-24px'); var tableResponsiveDiv = $('<div>').addClass('table-responsive').css('margin-right', '-24px');
// Create table with similar classes and styles to the modal table // Create table with similar classes and styles to the modal table
var table = $('<table>').addClass('table table-bordered table-striped').css({'width': '100%', 'border-color': 'black', 'border-top-color': 'white'});
var table = $('<table>').addClass('table table-bordered table-striped').css({ 'width': '100%', 'border-color': 'black', 'border-top-color': 'white' });
var thead = $('<thead>').addClass('thead-light'); var thead = $('<thead>').addClass('thead-light');
var tbody = $('<tbody>'); var tbody = $('<tbody>');
var headerRow = $('<tr>').appendTo(thead); var headerRow = $('<tr>').appendTo(thead);
@ -1011,20 +1020,20 @@ if (data.damageList.length === 0) {
var columnRow = $('<tr>').css('background-color', '#f2f2f2').appendTo(thead); var columnRow = $('<tr>').css('background-color', '#f2f2f2').appendTo(thead);
//$('<th>').text('DD Number').css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(columnRow); //$('<th>').text('DD Number').css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(columnRow);
//$('<th>').text('DD Date').css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(columnRow); //$('<th>').text('DD Date').css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(columnRow);
$('<th>').text('Challan Number').css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(columnRow);
$('<th>').text('Challan Amount').css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(columnRow);
$('<th>').text('Challan Image').css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(columnRow);
$('<th>').text('Challan Number').css({ 'padding': '0.45rem 0.45rem', 'text-align': 'center' }).appendTo(columnRow);
$('<th>').text('Challan Amount').css({ 'padding': '0.45rem 0.45rem', 'text-align': 'center' }).appendTo(columnRow);
$('<th>').text('Challan Image').css({ 'padding': '0.45rem 0.45rem', 'text-align': 'center' }).appendTo(columnRow);
var row = $('<tr>').appendTo(tbody); var row = $('<tr>').appendTo(tbody);
//$('<td>').text(data.settlement.ddnumber).css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(row); //$('<td>').text(data.settlement.ddnumber).css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(row);
//$('<td>').text(data.settlement.ddnumber).css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(row); //$('<td>').text(data.settlement.ddnumber).css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(row);
$('<td>').text(data.settlement.challonnumber).css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(row);
$('<td>').text(data.settlement.challonamount).css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(row);
$('<td>').text(data.settlement.challonnumber).css({ 'padding': '0.45rem 0.45rem', 'text-align': 'center' }).appendTo(row);
$('<td>').text(data.settlement.challonamount).css({ 'padding': '0.45rem 0.45rem', 'text-align': 'center' }).appendTo(row);
//$('<td>').text(data.settlement.dddate).css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(row); //$('<td>').text(data.settlement.dddate).css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(row);
var challanImgLink = $('<a>').attr('href', 'javascript:void(0)').text('View Image').on('click', function () { var challanImgLink = $('<a>').attr('href', 'javascript:void(0)').text('View Image').on('click', function () {
showchallonimage(data.settlement.challon); showchallonimage(data.settlement.challon);
}); });
$('<td>').css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).append(challanImgLink).appendTo(row);
$('<td>').css({ 'padding': '0.45rem 0.45rem', 'text-align': 'center' }).append(challanImgLink).appendTo(row);
table.append(thead, tbody); table.append(thead, tbody);
challonTableContainer.append(table); challonTableContainer.append(table);
@ -1047,7 +1056,7 @@ if (data.damageList.length === 0) {
var tableResponsiveDiv = $('<div>').addClass('table-responsive').css('margin-right', '-24px'); var tableResponsiveDiv = $('<div>').addClass('table-responsive').css('margin-right', '-24px');
// Create table with similar classes and styles to the modal table // Create table with similar classes and styles to the modal table
var table = $('<table>').addClass('table table-bordered table-striped').css({'width': '100%', 'border-color': 'black', 'border-top-color': 'white'});
var table = $('<table>').addClass('table table-bordered table-striped').css({ 'width': '100%', 'border-color': 'black', 'border-top-color': 'white' });
var thead = $('<thead>').addClass('thead-light'); var thead = $('<thead>').addClass('thead-light');
var tbody = $('<tbody>'); var tbody = $('<tbody>');
var headerRow = $('<tr>').appendTo(thead); var headerRow = $('<tr>').appendTo(thead);
@ -1058,15 +1067,15 @@ if (data.damageList.length === 0) {
'color': 'black', 'color': 'black',
}).appendTo(headerRow); }).appendTo(headerRow);
var columnRow = $('<tr>').css('background-color', '#f2f2f2').appendTo(thead); var columnRow = $('<tr>').css('background-color', '#f2f2f2').appendTo(thead);
$('<th>').text('DD Number').css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(columnRow);
$('<th>').text('DD Amount').css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(columnRow);
$('<th>').text('DD Date').css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(columnRow);
$('<th>').text('DD Number').css({ 'padding': '0.45rem 0.45rem', 'text-align': 'center' }).appendTo(columnRow);
$('<th>').text('DD Amount').css({ 'padding': '0.45rem 0.45rem', 'text-align': 'center' }).appendTo(columnRow);
$('<th>').text('DD Date').css({ 'padding': '0.45rem 0.45rem', 'text-align': 'center' }).appendTo(columnRow);
var row = $('<tr>').appendTo(tbody); var row = $('<tr>').appendTo(tbody);
$('<td>').text(data.settlement.ddnumber).css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(row);
$('<td>').text(data.settlement.ddamount).css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(row);
$('<td>').text(data.settlement.ddnumber).css({ 'padding': '0.45rem 0.45rem', 'text-align': 'center' }).appendTo(row);
$('<td>').text(data.settlement.ddamount).css({ 'padding': '0.45rem 0.45rem', 'text-align': 'center' }).appendTo(row);
$('<td>').text(data.settlement.dddate).css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).appendTo(row);
$('<td>').text(data.settlement.dddate).css({ 'padding': '0.45rem 0.45rem', 'text-align': 'center' }).appendTo(row);
table.append(thead, tbody); table.append(thead, tbody);
ddTableContainer.append(table); ddTableContainer.append(table);
@ -1084,7 +1093,7 @@ if (data.damageList.length === 0) {
document.getElementById('filePreview').src = damageImageUrl; document.getElementById('filePreview').src = damageImageUrl;
$('#fileModal').modal('show'); $('#fileModal').modal('show');
} }
function showchallonimage(challanImgLink){
function showchallonimage(challanImgLink) {
document.getElementById('filePreview').src = challanImgLink; document.getElementById('filePreview').src = challanImgLink;
$('#fileModal').modal('show'); $('#fileModal').modal('show');
} }
@ -1138,7 +1147,7 @@ if (data.damageList.length === 0) {
document.getElementById("depositeAmount").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2); document.getElementById("depositeAmount").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2);
document.getElementById("hallAmount").innerHTML = '₹ ' + parseFloat(list.hallAmount).toFixed(2); document.getElementById("hallAmount").innerHTML = '₹ ' + parseFloat(list.hallAmount).toFixed(2);
document.getElementById("totalAmount").innerHTML = '₹ ' + parseFloat(list.amountReceived).toFixed(2); document.getElementById("totalAmount").innerHTML = '₹ ' + parseFloat(list.amountReceived).toFixed(2);
var gstcl = (list.hallAmount * (list.hallDetails.gst/100));
var gstcl = (list.hallAmount * (list.hallDetails.gst / 100));
var formattedGst = gstcl.toFixed(2); var formattedGst = gstcl.toFixed(2);
document.getElementById("gst").innerHTML = formattedGst; document.getElementById("gst").innerHTML = formattedGst;
document.getElementById("startDate").innerHTML = list.startDate; document.getElementById("startDate").innerHTML = list.startDate;
@ -1242,4 +1251,5 @@ if (data.damageList.length === 0) {
} }
</script> </script>
</body> </body>
</html> </html>

1772
src/main/resources/templates/headquarters/sixmonthold-transactions.html
File diff suppressed because it is too large
View File

15
src/main/resources/templates/officer/gccblocking-new.html

@ -330,7 +330,7 @@
<th class="text-center"> <th class="text-center">
<input type="checkbox" id="selectAllBookings" <input type="checkbox" id="selectAllBookings"
title="Select / Deselect all cancellable bookings"> title="Select / Deselect all cancellable bookings">
&nbsp;Cancel?
&nbsp;Select All
</th> </th>
<th class="text-center">#</th> <th class="text-center">#</th>
<th class="text-center">Hall Name</th> <th class="text-center">Hall Name</th>
@ -804,10 +804,20 @@
// Wire select-all checkbox // Wire select-all checkbox
const selAll = document.getElementById('selectAllBookings'); const selAll = document.getElementById('selectAllBookings');
if (selAll) { if (selAll) {
// Select All → toggle every enabled row checkbox
selAll.onchange = function () { selAll.onchange = function () {
document.querySelectorAll('.booking-cb:not(:disabled)') document.querySelectorAll('.booking-cb:not(:disabled)')
.forEach(cb => { cb.checked = selAll.checked; }); .forEach(cb => { cb.checked = selAll.checked; });
}; };
// Individual row checkboxes → sync Select All state
document.querySelectorAll('.booking-cb:not(:disabled)').forEach(cb => {
cb.addEventListener('change', function () {
const total = document.querySelectorAll('.booking-cb:not(:disabled)').length;
const checked = document.querySelectorAll('.booking-cb:not(:disabled):checked').length;
selAll.checked = (total > 0 && checked === total);
});
});
} }
if (hasTodayBooking) { if (hasTodayBooking) {
@ -899,6 +909,8 @@
.forEach(cb => { if (cb.dataset.bookingId) selectedBookings.push(cb.dataset.bookingId); }); .forEach(cb => { if (cb.dataset.bookingId) selectedBookings.push(cb.dataset.bookingId); });
} }
console.log("selectedBookings...." + selectedBookings);
const fd = new FormData(); const fd = new FormData();
fd.append('fromDate', from); fd.append('fromDate', from);
fd.append('toDate', to); fd.append('toDate', to);
@ -908,6 +920,7 @@
if (fileEl.files && fileEl.files[0]) fd.append('document', fileEl.files[0]); if (fileEl.files && fileEl.files[0]) fd.append('document', fileEl.files[0]);
if (selectedBookings.length) fd.append('selectedBookings', selectedBookings.join(',')); if (selectedBookings.length) fd.append('selectedBookings', selectedBookings.join(','));
Swal.fire({ title: 'Processing…', allowOutsideClick: false, didOpen: () => Swal.showLoading() }); Swal.fire({ title: 'Processing…', allowOutsideClick: false, didOpen: () => Swal.showLoading() });
$.ajax({ $.ajax({

56
src/main/resources/templates/user/hallbookingform.html

@ -58,9 +58,16 @@
} }
.disabled { .disabled {
pointer-events: none;
cursor: not-allowed;
opacity: 1; opacity: 1;
/* Example: reduce opacity to indicate disabled state */
}
/* Move pointer-events:none to the inner anchor so the <td> can still receive
mouse events (needed for title-attribute tooltips and event delegation) */
.disabled a,
.disabled .ui-state-default {
pointer-events: none;
cursor: not-allowed;
} }
/* ── Custom datepicker tooltip (works even when .disabled has pointer-events:none) ── */ /* ── Custom datepicker tooltip (works even when .disabled has pointer-events:none) ── */
@ -974,7 +981,23 @@
.highlight-blue a { .highlight-blue a {
background-color: blue; background-color: blue;
color: white; color: white;
}
/* Override ui-state-disabled fading for GCC-blocked (highlight-blue) cells.
jQuery UI applies opacity:0.35 to the <td> itself via .ui-widget-content .ui-state-disabled.
Opacity on a parent cannot be overridden on children — it always multiplies.
So we must reset opacity on the <td> directly, then style the inner element. */
td.highlight-blue.ui-state-disabled {
opacity: 1 !important;
}
td.highlight-blue.ui-state-disabled .ui-state-default,
td.highlight-blue.ui-state-disabled a,
td.highlight-blue.ui-state-disabled span {
background: blue !important;
color: #fff !important;
cursor: not-allowed !important;
pointer-events: auto !important;
} }
/* css fror toast */ /* css fror toast */
@ -3242,12 +3265,12 @@
return handleAfter2PM(bookingStatus); return handleAfter2PM(bookingStatus);
} else { } else {
// Between 6 AM and 2 PM: Check status and disable morning slots // Between 6 AM and 2 PM: Check status and disable morning slots
return handleMorningSlots(bookingStatus);
return handleMorningSlots(bookingStatus, isToday);
} }
} }
return handleBookingStatus(bookingStatus, "Slot Available"); return handleBookingStatus(bookingStatus, "Slot Available");
},
}
}); });
// Show datepicker when hall is selected // Show datepicker when hall is selected
@ -3312,6 +3335,7 @@
} }
function handleBookingStatus(bookingStatus, defaultMessage) { function handleBookingStatus(bookingStatus, defaultMessage) {
if (bookingStatus[2] && bookingStatus[0] && !bookingStatus[1]) { if (bookingStatus[2] && bookingStatus[0] && !bookingStatus[1]) {
return [true, "highlight-yellow disabled", "GCC Blocked"]; return [true, "highlight-yellow disabled", "GCC Blocked"];
} else if (bookingStatus[2] && bookingStatus[1] && !bookingStatus[0]) { } else if (bookingStatus[2] && bookingStatus[1] && !bookingStatus[0]) {
@ -3319,9 +3343,9 @@
} else if (bookingStatus[2] && bookingStatus[1] && bookingStatus[0] && bookingStatus[3] != 'GCC_BLOCKED' && bookingStatus[4] != 'GCC_BLOCKED') { } else if (bookingStatus[2] && bookingStatus[1] && bookingStatus[0] && bookingStatus[3] != 'GCC_BLOCKED' && bookingStatus[4] != 'GCC_BLOCKED') {
return [true, "highlight-pink disabled", "GCC Blocked"]; return [true, "highlight-pink disabled", "GCC Blocked"];
} else if (bookingStatus[2] && bookingStatus[1] && bookingStatus[0] && bookingStatus[3] == 'GCC_BLOCKED' && bookingStatus[4] == 'GCC_BLOCKED') { } else if (bookingStatus[2] && bookingStatus[1] && bookingStatus[0] && bookingStatus[3] == 'GCC_BLOCKED' && bookingStatus[4] == 'GCC_BLOCKED') {
return [true, "highlight-blue disabled", "GCC Blocked"];
return [false, "highlight-blue disabled", "GCC Blocked"];
} else if (bookingStatus[2]) { } else if (bookingStatus[2]) {
return [true, "highlight-blue disabled", "GCC Blocked"];
return [false, "highlight-blue disabled", "GCC Blocked"];
} else if (bookingStatus[0] && bookingStatus[1]) { } else if (bookingStatus[0] && bookingStatus[1]) {
return [true, "highlight-pink disabled", "Slot Occupied"]; return [true, "highlight-pink disabled", "Slot Occupied"];
} else if (bookingStatus[0] && !bookingStatus[1]) { } else if (bookingStatus[0] && !bookingStatus[1]) {
@ -3334,9 +3358,6 @@
// Helper function: Handles logic after 2 PM // Helper function: Handles logic after 2 PM
function handleAfter2PM(bookingStatus) { function handleAfter2PM(bookingStatus) {
// if (bookingStatus[2]) {
// return [true, "highlight-blue disabled", "GCC Blocked"];
// }
if (bookingStatus[2] && bookingStatus[0] && !bookingStatus[1]) { if (bookingStatus[2] && bookingStatus[0] && !bookingStatus[1]) {
return [true, "highlight-yellow disabled", "GCC Blocked"]; return [true, "highlight-yellow disabled", "GCC Blocked"];
} else if (bookingStatus[2] && bookingStatus[1] && !bookingStatus[0]) { } else if (bookingStatus[2] && bookingStatus[1] && !bookingStatus[0]) {
@ -3344,9 +3365,9 @@
} else if (bookingStatus[2] && bookingStatus[1] && bookingStatus[0] && bookingStatus[3] != 'GCC_BLOCKED' && bookingStatus[4] != 'GCC_BLOCKED') { } else if (bookingStatus[2] && bookingStatus[1] && bookingStatus[0] && bookingStatus[3] != 'GCC_BLOCKED' && bookingStatus[4] != 'GCC_BLOCKED') {
return [true, "highlight-pink disabled", "GCC Blocked"]; return [true, "highlight-pink disabled", "GCC Blocked"];
} else if (bookingStatus[2] && bookingStatus[1] && bookingStatus[0] && bookingStatus[3] == 'GCC_BLOCKED' && bookingStatus[4] == 'GCC_BLOCKED') { } else if (bookingStatus[2] && bookingStatus[1] && bookingStatus[0] && bookingStatus[3] == 'GCC_BLOCKED' && bookingStatus[4] == 'GCC_BLOCKED') {
return [true, "highlight-blue disabled", "GCC Blocked"];
return [false, "highlight-blue disabled", "GCC Blocked"];
} else if (bookingStatus[2]) { } else if (bookingStatus[2]) {
return [true, "highlight-blue disabled", "GCC Blocked"];
return [false, "highlight-blue disabled", "GCC Blocked"];
} else if (bookingStatus[0] || bookingStatus[1]) { } else if (bookingStatus[0] || bookingStatus[1]) {
return [true, "highlight-pink disabled", "Slot Occupied"]; return [true, "highlight-pink disabled", "Slot Occupied"];
} }
@ -3354,20 +3375,21 @@
} }
// Helper function: Handles morning slots between 6 AM and 2 PM // Helper function: Handles morning slots between 6 AM and 2 PM
function handleMorningSlots(bookingStatus) {
// if (bookingStatus[2]) {
// return [true, "highlight-blue disabled", "GCC Blocked"];
// }
function handleMorningSlots(bookingStatus, isToday) {
console.log("isToday....." + isToday);
if (bookingStatus[2] && bookingStatus[0] && !bookingStatus[1]) { if (bookingStatus[2] && bookingStatus[0] && !bookingStatus[1]) {
return [true, "highlight-yellow disabled", "GCC Blocked"]; return [true, "highlight-yellow disabled", "GCC Blocked"];
} else if (bookingStatus[2] && bookingStatus[1] && !bookingStatus[0]) { } else if (bookingStatus[2] && bookingStatus[1] && !bookingStatus[0]) {
if (isToday) {
return [false, "highlight-disabled", "GCC Blocked"];
}
return [true, "highlight-violet disabled", "GCC Blocked"]; return [true, "highlight-violet disabled", "GCC Blocked"];
} else if (bookingStatus[2] && bookingStatus[1] && bookingStatus[0] && bookingStatus[3] != 'GCC_BLOCKED' && bookingStatus[4] != 'GCC_BLOCKED') { } else if (bookingStatus[2] && bookingStatus[1] && bookingStatus[0] && bookingStatus[3] != 'GCC_BLOCKED' && bookingStatus[4] != 'GCC_BLOCKED') {
return [true, "highlight-pink disabled", "GCC Blocked"]; return [true, "highlight-pink disabled", "GCC Blocked"];
} else if (bookingStatus[2] && bookingStatus[1] && bookingStatus[0] && bookingStatus[3] == 'GCC_BLOCKED' && bookingStatus[4] == 'GCC_BLOCKED') { } else if (bookingStatus[2] && bookingStatus[1] && bookingStatus[0] && bookingStatus[3] == 'GCC_BLOCKED' && bookingStatus[4] == 'GCC_BLOCKED') {
return [true, "highlight-blue disabled", "GCC Blocked"];
return [false, "highlight-blue disabled", "GCC Blocked"];
} else if (bookingStatus[2]) { } else if (bookingStatus[2]) {
return [true, "highlight-blue disabled", "GCC Blocked"];
return [false, "highlight-blue disabled", "GCC Blocked"];
} else if (bookingStatus[0] && bookingStatus[1]) { } else if (bookingStatus[0] && bookingStatus[1]) {
return [true, "highlight-pink disabled", "Slot Occupied"]; return [true, "highlight-pink disabled", "Slot Occupied"];
} else if (bookingStatus[0] && !bookingStatus[1]) { } else if (bookingStatus[0] && !bookingStatus[1]) {

19
src/main/resources/templates/user/viewhallform.html

@ -72,9 +72,16 @@
} }
.disabled { .disabled {
pointer-events: none;
cursor: not-allowed;
opacity: 1; opacity: 1;
/* Example: reduce opacity to indicate disabled state */
}
/* Move pointer-events:none to the inner anchor so the <td> can still receive
mouse events (needed for title-attribute tooltips and event delegation) */
.disabled a,
.disabled .ui-state-default {
pointer-events: none;
cursor: not-allowed;
} }
/* ── Custom datepicker tooltip (works even when .disabled has pointer-events:none) ── */ /* ── Custom datepicker tooltip (works even when .disabled has pointer-events:none) ── */
@ -1598,7 +1605,7 @@
return handleAfter2PM(bookingStatus); return handleAfter2PM(bookingStatus);
} else { } else {
// Between 6 AM and 2 PM: Check status and disable morning slots // Between 6 AM and 2 PM: Check status and disable morning slots
return handleMorningSlots(bookingStatus);
return handleMorningSlots(bookingStatus, isToday);
} }
} }
@ -1706,10 +1713,14 @@
} }
// Helper function: Handles morning slots between 6 AM and 2 PM // Helper function: Handles morning slots between 6 AM and 2 PM
function handleMorningSlots(bookingStatus) {
function handleMorningSlots(bookingStatus, isToday) {
console.log("isToday....." + isToday);
if (bookingStatus[2] && bookingStatus[0] && !bookingStatus[1]) { if (bookingStatus[2] && bookingStatus[0] && !bookingStatus[1]) {
return [true, "highlight-yellow disabled", "GCC Blocked"]; return [true, "highlight-yellow disabled", "GCC Blocked"];
} else if (bookingStatus[2] && bookingStatus[1] && !bookingStatus[0]) { } else if (bookingStatus[2] && bookingStatus[1] && !bookingStatus[0]) {
if (isToday) {
return [false, "highlight-disabled", "GCC Blocked"];
}
return [true, "highlight-violet disabled", "GCC Blocked"]; return [true, "highlight-violet disabled", "GCC Blocked"];
} else if (bookingStatus[2] && bookingStatus[1] && bookingStatus[0] && bookingStatus[3] != 'GCC_BLOCKED' && bookingStatus[4] != 'GCC_BLOCKED') { } else if (bookingStatus[2] && bookingStatus[1] && bookingStatus[0] && bookingStatus[3] != 'GCC_BLOCKED' && bookingStatus[4] != 'GCC_BLOCKED') {
return [true, "highlight-pink disabled", "GCC Blocked"]; return [true, "highlight-pink disabled", "GCC Blocked"];

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

@ -35,10 +35,35 @@
} }
.disabled { .disabled {
pointer-events: none;
cursor: not-allowed;
opacity: 1; opacity: 1;
} }
/* Move pointer-events:none to the inner anchor so the <td> can still receive
mouse events (needed for title-attribute tooltips and event delegation) */
.disabled a,
.disabled .ui-state-default {
pointer-events: none;
cursor: not-allowed;
}
/* ── Custom datepicker tooltip (works even when .disabled has pointer-events:none) ── */
#dp-tooltip {
position: fixed;
z-index: 9999;
background: rgba(30, 30, 30, 0.92);
color: #fff;
padding: 5px 11px;
border-radius: 6px;
font-size: 12px;
font-weight: 600;
pointer-events: none;
white-space: nowrap;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
display: none;
transition: opacity 0.15s;
}
.ui-widget { .ui-widget {
width: 40% width: 40%
} }
@ -704,14 +729,14 @@
Booking</span> Booking</span>
</a> </a>
<!-- <a class="reschedule-button"
<a class="reschedule-button"
th:if="${booking.booking_status == 'WAITING_FOR_NOC' and booking.schedule_count < 1}"> th:if="${booking.booking_status == 'WAITING_FOR_NOC' and booking.schedule_count < 1}">
<span class="badge bg-danger" <span class="badge bg-danger"
style="cursor: pointer;" style="cursor: pointer;"
th:onclick="openRescheduleModal([[${booking.booking_id}]], [[${booking.start_date}]], [[${booking.end_date}]],[[${booking.no_of_days}]], th:onclick="openRescheduleModal([[${booking.booking_id}]], [[${booking.start_date}]], [[${booking.end_date}]],[[${booking.no_of_days}]],
[[${booking.hall_details_hall_id}]],[[${booking.starting_slot}]],[[${booking.ending_slot}]],[[${booking.reason}]])">Reschedule [[${booking.hall_details_hall_id}]],[[${booking.starting_slot}]],[[${booking.ending_slot}]],[[${booking.reason}]])">Reschedule
Booking</span> Booking</span>
</a> -->
</a>
</p> </p>
<p th:case="'waitingfornocapproval'"> <p th:case="'waitingfornocapproval'">
@ -722,6 +747,14 @@
th:onclick="cancelBooking([[${booking.booking_id}]], [[${booking.mobile_no}]], [[${booking.booking_type}]])">Cancel th:onclick="cancelBooking([[${booking.booking_id}]], [[${booking.mobile_no}]], [[${booking.booking_type}]])">Cancel
Booking</span> Booking</span>
</a> </a>
<a class="reschedule-button"
th:if="${booking.booking_status == 'WAITING_FOR_NOC_APPROVAL' and booking.schedule_count < 1}">
<span class="badge bg-danger"
style="cursor: pointer;"
th:onclick="openRescheduleModal([[${booking.booking_id}]], [[${booking.start_date}]], [[${booking.end_date}]],[[${booking.no_of_days}]],
[[${booking.hall_details_hall_id}]],[[${booking.starting_slot}]],[[${booking.ending_slot}]],[[${booking.reason}]])">Reschedule
Booking</span>
</a>
</p> </p>
<!--<p th:case="'noaction'"> <!--<p th:case="'noaction'">
<a class="view-button"> <a class="view-button">
@ -753,8 +786,10 @@
th:onclick="cancelBooking([[${booking.booking_id}]], [[${booking.mobile_no}]], [[${booking.booking_type}]])">Cancel th:onclick="cancelBooking([[${booking.booking_id}]], [[${booking.mobile_no}]], [[${booking.booking_type}]])">Cancel
Booking</span> Booking</span>
</a> </a>
<!-- <a class="reschedule-button" th:if="${booking.booking_status == 'APPROVED' and booking.reason != 'Commercial'}"> -->
<a class="reschedule-button" <a class="reschedule-button"
th:if="${booking.booking_status == 'APPROVED'}">
th:if="${booking.booking_status == 'APPROVED'
and !#lists.contains({'Commercial', 'State Govt Event', 'Central Govt Event'}, booking.reason)}">
<span class="badge bg-danger" <span class="badge bg-danger"
style="cursor: pointer;" style="cursor: pointer;"
th:onclick="openRescheduleModal([[${booking.booking_id}]], [[${booking.start_date}]], [[${booking.end_date}]],[[${booking.no_of_days}]], th:onclick="openRescheduleModal([[${booking.booking_id}]], [[${booking.start_date}]], [[${booking.end_date}]],[[${booking.no_of_days}]],
@ -2458,7 +2493,7 @@
return handleAfter2PM(bookingStatus); return handleAfter2PM(bookingStatus);
} else { } else {
// Between 6 AM and 2 PM: Check status and disable morning slots // Between 6 AM and 2 PM: Check status and disable morning slots
return handleMorningSlots(bookingStatus);
return handleMorningSlots(bookingStatus, isToday);
} }
} }
@ -2475,44 +2510,35 @@
updateEndDate(selectedDate, noofdays, startingSlot, endingSlot); updateEndDate(selectedDate, noofdays, startingSlot, endingSlot);
}); });
// Handle changes in the start date input
// $("#startDateInput").on("change", function () {
// const selectedDate = $(this).val();
// const bookingStatus = window.bookingResponse[selectedDate] || {};
// const currentHours = new Date().getHours();
// const currentDateString = $("#serverDate").val();
// $("#startPeriodDropdown option").prop("disabled", false);
// $("#startPeriodDropdown").val(0).prop("disabled", false);
// $("#endPeriodDropdown").val(0).prop("disabled", false);
// $("#numDaysCount").val('');
// validateForm();
// // Disable Morning slot for today between 6 AM and 2 PM
// if (selectedDate === currentDateString && currentHours >= 6 && currentHours < 14) {
// $("#startPeriodDropdown option[value='1']").prop("disabled", true);
// Swal.fire({
// title: 'Morning Slot Not Available',
// text: 'You can only book Evening Slot for today between 6 AM and 2 PM.',
// icon: 'warning',
// confirmButtonText: 'OK'
// });
// } else {
// if ((selectedDate === currentDateString && currentHours >= 6) || bookingStatus[0]) {
// $("#startPeriodDropdown option[value='1']").prop("disabled", true);
// } else if (bookingStatus[1]) {
// $("#startPeriodDropdown option[value='2']").prop("disabled", true);
// }
// }
// updateEndDate(selectedDate);
// });
// ── Custom tooltip for calendar cells (handles pointer-events:none on .disabled) ──
// The <td> itself still receives mouse events even when its child has pointer-events:none.
// We read the title attribute that jQuery UI datepicker sets via beforeShowDay's 3rd return value.
if (!document.getElementById('dp-tooltip')) {
$('body').append('<div id="dp-tooltip"></div>');
}
$("#datepicker-container")
.off('mouseenter.dptt mouseleave.dptt mousemove.dptt', 'td[title]')
.on('mouseenter.dptt', 'td[title]', function (e) {
var tip = $(this).attr('title');
if (!tip) return;
$('#dp-tooltip').text(tip).css({
left: (e.clientX + 12) + 'px',
top: (e.clientY - 30) + 'px'
}).show();
})
.on('mousemove.dptt', 'td[title]', function (e) {
$('#dp-tooltip').css({
left: (e.clientX + 12) + 'px',
top: (e.clientY - 30) + 'px'
});
})
.on('mouseleave.dptt', 'td[title]', function () {
$('#dp-tooltip').hide();
});
} }
function handleBookingStatus(bookingStatus, defaultMessage) { function handleBookingStatus(bookingStatus, defaultMessage) {
console.log("bookingStatus.." + bookingStatus[0], bookingStatus[1], bookingStatus[2])
if (bookingStatus[2] && bookingStatus[0] && !bookingStatus[1]) { if (bookingStatus[2] && bookingStatus[0] && !bookingStatus[1]) {
return [true, "highlight-yellow disabled", "GCC Blocked"]; return [true, "highlight-yellow disabled", "GCC Blocked"];
} else if (bookingStatus[2] && bookingStatus[1] && !bookingStatus[0]) { } else if (bookingStatus[2] && bookingStatus[1] && !bookingStatus[0]) {
@ -2552,10 +2578,14 @@
} }
// Helper function: Handles morning slots between 6 AM and 2 PM // Helper function: Handles morning slots between 6 AM and 2 PM
function handleMorningSlots(bookingStatus) {
function handleMorningSlots(bookingStatus, isToday) {
console.log("isToday....." + isToday);
if (bookingStatus[2] && bookingStatus[0] && !bookingStatus[1]) { if (bookingStatus[2] && bookingStatus[0] && !bookingStatus[1]) {
return [true, "highlight-yellow disabled", "GCC Blocked"]; return [true, "highlight-yellow disabled", "GCC Blocked"];
} else if (bookingStatus[2] && bookingStatus[1] && !bookingStatus[0]) { } else if (bookingStatus[2] && bookingStatus[1] && !bookingStatus[0]) {
if (isToday) {
return [false, "highlight-disabled", "GCC Blocked"];
}
return [true, "highlight-violet disabled", "GCC Blocked"]; return [true, "highlight-violet disabled", "GCC Blocked"];
} else if (bookingStatus[2] && bookingStatus[1] && bookingStatus[0] && bookingStatus[3] != 'GCC_BLOCKED' && bookingStatus[4] != 'GCC_BLOCKED') { } else if (bookingStatus[2] && bookingStatus[1] && bookingStatus[0] && bookingStatus[3] != 'GCC_BLOCKED' && bookingStatus[4] != 'GCC_BLOCKED') {
return [true, "highlight-pink disabled", "GCC Blocked"]; return [true, "highlight-pink disabled", "GCC Blocked"];
@ -2573,6 +2603,14 @@
return [true, "highlight-yellow", "Evening Slot Available"]; return [true, "highlight-yellow", "Evening Slot Available"];
} }
// Helper: returns true if the given date string is GCC-blocked
function isGCCBlockedDate(dateStr) {
var status = window.bookingResponse[dateStr] || [];
return (status[2] == true || status[2] == 1 ||
status[3] === 'GCC_BLOCKED' ||
status[4] === 'GCC_BLOCKED');
}
function updateEndDate(startDate, noofdays, startingSlot, endingSlot) { function updateEndDate(startDate, noofdays, startingSlot, endingSlot) {
if (startDate && noofdays !== undefined) { if (startDate && noofdays !== undefined) {
var start = new Date(startDate); var start = new Date(startDate);
@ -2580,12 +2618,31 @@
var bookingStatus = window.bookingResponse[startFormatted] || [false, false]; var bookingStatus = window.bookingResponse[startFormatted] || [false, false];
var morningAvailable = !bookingStatus[0]; // false means available var morningAvailable = !bookingStatus[0]; // false means available
var eveningAvailable = !bookingStatus[1]; // false means available var eveningAvailable = !bookingStatus[1]; // false means available
var isgccBlock = bookingStatus[2];
var bookingStatus1 = bookingStatus[3];
var bookingStatus2 = bookingStatus[4];
var endDate; var endDate;
var isValid = true; // Flag to determine if all slots are available var isValid = true; // Flag to determine if all slots are available
// Convert noofdays to a number for accurate calculations // Convert noofdays to a number for accurate calculations
noofdays = parseFloat(noofdays); noofdays = parseFloat(noofdays);
// --- GCC Block checkpoint ---
// Block reschedule if the start date is GCC-blocked via any of the three status flags
if (isgccBlock == true || isgccBlock == 1 ||
bookingStatus1 === 'GCC_BLOCKED' ||
bookingStatus2 === 'GCC_BLOCKED') {
Swal.fire({
title: 'Date Not Available',
text: 'The selected start date is blocked by GCC. Please choose a different date.',
icon: 'warning',
confirmButtonText: 'OK'
});
document.getElementById('endDateInput').value = "";
return;
}
// --- End GCC Block checkpoint ---
// Handle slot availability and combinations // Handle slot availability and combinations
if (startingSlot === "2" && endingSlot === "2") { // Evening to Evening if (startingSlot === "2" && endingSlot === "2") { // Evening to Evening
//console.log("Handling Evening to Evening slot."); //console.log("Handling Evening to Evening slot.");
@ -2617,7 +2674,18 @@
if (eveningAvailable && morningAvailableOnEndDate && eveningAvailableOnEndDate) { if (eveningAvailable && morningAvailableOnEndDate && eveningAvailableOnEndDate) {
endDate = endDateCandidate.toISOString().split('T')[0]; endDate = endDateCandidate.toISOString().split('T')[0];
// --- GCC Block check for end date ---
if (isGCCBlockedDate(endDate)) {
Swal.fire({
title: 'End Date Not Available',
text: 'The end date is blocked by GCC. Please choose a different start date.',
icon: 'warning',
confirmButtonText: 'OK'
});
document.getElementById('endDateInput').value = "";
} else {
document.getElementById('endDateInput').value = endDate; document.getElementById('endDateInput').value = endDate;
}
//console.log("End Date (Morning to Evening with 2 days):", endDate); //console.log("End Date (Morning to Evening with 2 days):", endDate);
} else { } else {
Swal.fire({ Swal.fire({
@ -2669,7 +2737,18 @@
if (morningAvailable && eveningAvailable && morningAvailableOnEndDate) { if (morningAvailable && eveningAvailable && morningAvailableOnEndDate) {
endDate = endDateCandidate.toISOString().split('T')[0]; endDate = endDateCandidate.toISOString().split('T')[0];
// --- GCC Block check for end date ---
if (isGCCBlockedDate(endDate)) {
Swal.fire({
title: 'End Date Not Available',
text: 'The end date is blocked by GCC. Please choose a different start date.',
icon: 'warning',
confirmButtonText: 'OK'
});
document.getElementById('endDateInput').value = "";
} else {
document.getElementById('endDateInput').value = endDate; document.getElementById('endDateInput').value = endDate;
}
//console.log("End Date (Morning to Evening with 2 days):", endDate); //console.log("End Date (Morning to Evening with 2 days):", endDate);
} else { } else {
Swal.fire({ Swal.fire({
@ -2721,7 +2800,18 @@
if (morningAvailable && eveningAvailable && morningAvailableOnEndDate && eveningAvailableOnEndDate) { if (morningAvailable && eveningAvailable && morningAvailableOnEndDate && eveningAvailableOnEndDate) {
endDate = endDateCandidate.toISOString().split('T')[0]; endDate = endDateCandidate.toISOString().split('T')[0];
// --- GCC Block check for end date ---
if (isGCCBlockedDate(endDate)) {
Swal.fire({
title: 'End Date Not Available',
text: 'The end date is blocked by GCC. Please choose a different start date.',
icon: 'warning',
confirmButtonText: 'OK'
});
document.getElementById('endDateInput').value = "";
} else {
document.getElementById('endDateInput').value = endDate; document.getElementById('endDateInput').value = endDate;
}
//console.log("End Date (Morning to Evening with 2 days):", endDate); //console.log("End Date (Morning to Evening with 2 days):", endDate);
} else { } else {
Swal.fire({ Swal.fire({
@ -2755,7 +2845,18 @@
if (nextDayMorningAvailable) { if (nextDayMorningAvailable) {
endDate = nextDay.toISOString().split('T')[0]; endDate = nextDay.toISOString().split('T')[0];
// --- GCC Block check for end date ---
if (isGCCBlockedDate(endDate)) {
Swal.fire({
title: 'End Date Not Available',
text: 'The end date is blocked by GCC. Please choose a different start date.',
icon: 'warning',
confirmButtonText: 'OK'
});
document.getElementById('endDateInput').value = "";
} else {
document.getElementById('endDateInput').value = endDate; document.getElementById('endDateInput').value = endDate;
}
//console.log("End Date (Evening to Morning):", endDate); //console.log("End Date (Evening to Morning):", endDate);
} else { } else {
Swal.fire({ Swal.fire({

Loading…
Cancel
Save