From c1314e9f28d51d12d36754e21df4393a9b4c3085 Mon Sep 17 00:00:00 2001 From: KaNi-04 <136799210+KaNi-04@users.noreply.github.com> Date: Mon, 27 Jul 2026 10:51:40 +0530 Subject: [PATCH] Six month old transactions option created for HQ login and mail integration implemented. --- pom.xml | 6 + .../controller/HQAPIController.java | 93 + .../controller/HeadquartersController.java | 304 ++ .../controller/OfficerAPIController.java | 47 + .../communityHall/entity/BookingDetails.java | 186 +- .../communityHall/entity/SixMonthMailLog.java | 105 + .../paymentService/entity/RefundResponse.java | 54 +- .../repository/TransRefundResRepository.java | 41 +- .../TransactionResponseRepository.java | 2 +- .../repository/BookingDetailsRepository.java | 138 +- .../repository/BookingHistoryRepository.java | 9 +- .../repository/SixMonthMailLogRepository.java | 13 + .../service/Impl/BookingServiceImpl.java | 18 +- .../service/Impl/HallDetailServiceImpl.java | 1 + .../communityHall/service/MailService.java | 86 + src/main/resources/application-dev.properties | 21 + .../resources/application-prod.properties | 21 +- .../sixmonthold-transactions.html | 843 +++ .../templates/admin/gccblocking-new.html | 12 +- .../resources/templates/admin/reports.html | 4728 ++++++++--------- .../templates/fragments/headquartersMenu.html | 7 + .../headquarters/bookingwaiting.html | 57 +- .../headquarters/gccblocking-new.html | 12 +- .../headquarters/halldetailslist.html | 2 + .../templates/headquarters/reports.html | 4336 ++++++++------- .../headquarters/settlement-completed.html | 196 +- .../sixmonthold-transactions.html | 1772 ++++++ .../templates/officer/gccblocking-new.html | 27 +- .../templates/user/hallbookingform.html | 56 +- .../templates/user/viewhallform.html | 19 +- .../resources/templates/user/viewhistory.html | 197 +- 31 files changed, 8523 insertions(+), 4886 deletions(-) create mode 100644 src/main/java/com/gcc/communityHall/entity/SixMonthMailLog.java create mode 100644 src/main/java/com/gcc/communityHall/repository/SixMonthMailLogRepository.java create mode 100644 src/main/java/com/gcc/communityHall/service/MailService.java create mode 100644 src/main/resources/resources/templates/headquarters/sixmonthold-transactions.html create mode 100644 src/main/resources/templates/headquarters/sixmonthold-transactions.html diff --git a/pom.xml b/pom.xml index 157dff15..c3eae789 100644 --- a/pom.xml +++ b/pom.xml @@ -97,6 +97,12 @@ runtime true + + + + org.springframework.boot + spring-boot-starter-mail + diff --git a/src/main/java/com/gcc/communityHall/controller/HQAPIController.java b/src/main/java/com/gcc/communityHall/controller/HQAPIController.java index c780e854..53760b4a 100644 --- a/src/main/java/com/gcc/communityHall/controller/HQAPIController.java +++ b/src/main/java/com/gcc/communityHall/controller/HQAPIController.java @@ -170,6 +170,9 @@ public class HQAPIController { @Autowired private HallReasonRestrictionRepository hallReasonRestrictionRepository; + @Autowired + private BookingServiceImpl bookingServiceImpl; + @Operation(summary = "Update HallDetails REST API", description = "REST API to update the Hall Details") @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"))), @@ -181,6 +184,7 @@ public class HQAPIController { @RequestParam("zone") String zone, @RequestParam("division") String division, @RequestParam("hallName") String hallName, + @RequestParam("hallArea") String hallArea, @RequestParam("doorNo") String doorNo, @RequestParam("street") String street, @RequestParam("area") String area, @@ -210,6 +214,7 @@ public class HQAPIController { hallDetails.setZone(zone); hallDetails.setDivision(division); hallDetails.setHallName(hallName); + hallDetails.setHallArea(Float.parseFloat(hallArea)); hallDetails.setDoorNo(doorNo); hallDetails.setStreet(street); hallDetails.setArea(area); @@ -1499,4 +1504,92 @@ public class HQAPIController { .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 updateApprovedSettlementStatus( + @PathVariable("bookingId") int bookingId, + @RequestParam("status") BookingDetails.RefundStatus status, + @RequestParam("comments") String comments) { + Map 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 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); + } + } } diff --git a/src/main/java/com/gcc/communityHall/controller/HeadquartersController.java b/src/main/java/com/gcc/communityHall/controller/HeadquartersController.java index 3a24ef78..153ac4b4 100644 --- a/src/main/java/com/gcc/communityHall/controller/HeadquartersController.java +++ b/src/main/java/com/gcc/communityHall/controller/HeadquartersController.java @@ -1,5 +1,9 @@ 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.function.Function; import java.util.function.Predicate; @@ -7,13 +11,27 @@ import java.util.stream.Collectors; import com.fasterxml.jackson.core.JsonProcessingException; 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.Login; 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.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.LoginHallIdRepository; 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.format.annotation.DateTimeFormat; 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.service.BookingService; import com.gcc.communityHall.service.HallDetailService; +import com.gcc.communityHall.service.MailService; import com.gcc.communityHall.service.ReasonMasterService; import com.gcc.communityHall.service.UserService; @@ -76,6 +95,30 @@ public class HeadquartersController { @Autowired 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") public String viewDashboard( @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> sixMonthOldBookings = normalizeMapKeys( + bookingDetailsRepository.findSixMonthOldNonCancelledRejectedBookings()); + List> cancelledBookings = normalizeMapKeys( + bookingDetailsRepository.findSixMonthOldCancelledBookings()); + List> rejectedBookings = normalizeMapKeys( + bookingDetailsRepository.findSixMonthOldRejectedBookings()); + List> 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> normalizeMapKeys(List> list) { + if (list == null) + return new ArrayList<>(); + List> result = new ArrayList<>(); + for (Map map : list) { + Map newMap = new HashMap<>(); + for (Map.Entry 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 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 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 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 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 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; + } + } diff --git a/src/main/java/com/gcc/communityHall/controller/OfficerAPIController.java b/src/main/java/com/gcc/communityHall/controller/OfficerAPIController.java index 944a75e3..ba848344 100644 --- a/src/main/java/com/gcc/communityHall/controller/OfficerAPIController.java +++ b/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.CounterRefundListRepository; import com.gcc.communityHall.repository.GccBlockingDateRepository; +import com.gcc.communityHall.repository.LoginRepository; import com.gcc.communityHall.repository.SettlementRepository; import com.gcc.communityHall.repository.UsersRepository; 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 jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpSession; +import jakarta.transaction.Transactional; 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") @@ -99,6 +101,8 @@ public class OfficerAPIController { @Autowired private HallDetailService hallDetailService; @Autowired + private BookingHistoryRepository bookingHistoryRepository; + @Autowired private WhatsappMsgServiceImpl whatsappMsgServiceImpl; @Autowired private PaymentsService paymentsService; @@ -112,6 +116,9 @@ public class OfficerAPIController { @Autowired 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") // Getting User Details by User Id @GetMapping("/getUserDetails") @@ -153,6 +160,44 @@ public class OfficerAPIController { 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 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 response = new HashMap<>(); + response.put("status", "success"); + response.put("bookingId", bookingId); + response.put("acknowledgedBy", officerName); + return ResponseEntity.ok(response); + } catch (Exception e) { + Map 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") // Updating the Refund Status to Approved by Settlement Id If the settlement is // Approved @@ -653,6 +698,8 @@ public class OfficerAPIController { @RequestParam(value = "document", required = false) MultipartFile[] documents, // Handle documents HttpSession session) { + System.out.println("selectedBookings...." + selectedBookings); + // Your existing logic String updatedBy = (String) session.getAttribute("employeeId"); diff --git a/src/main/java/com/gcc/communityHall/entity/BookingDetails.java b/src/main/java/com/gcc/communityHall/entity/BookingDetails.java index 2911c1aa..7f42a4af 100644 --- a/src/main/java/com/gcc/communityHall/entity/BookingDetails.java +++ b/src/main/java/com/gcc/communityHall/entity/BookingDetails.java @@ -1,6 +1,7 @@ package com.gcc.communityHall.entity; import java.time.LocalDate; +import java.time.LocalDateTime; import java.util.List; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -12,48 +13,52 @@ public class BookingDetails { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int bookingId; + 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 { - APPROVED, WAITING, INITIATED, REJECTED, COMPLETED, NA , FAILURE , CLOSED + APPROVED, WAITING, INITIATED, REJECTED, COMPLETED, NA, FAILURE, CLOSED } + public enum BookingType { - ONLINE,OFFLINE + ONLINE, OFFLINE } - @Column(name="booking_type") + @Column(name = "booking_type") @Enumerated(EnumType.STRING) private BookingType bookingtype; - @Column(name="no_of_days") + @Column(name = "no_of_days") private double noOfDays; - @Column(name="start_date") + @Column(name = "start_date") private String startDate; - @Column(name="end_date") + @Column(name = "end_date") private String endDate; - @Column(name="starting_slot") + @Column(name = "starting_slot") private int startingSlot; - @Column(name="ending_slot") + @Column(name = "ending_slot") private int endingSlot; - @Column(name="booking_date") + @Column(name = "booking_date") private LocalDate bookingDate; - @Column(name="booking_status") + @Column(name = "booking_status") @Enumerated(EnumType.STRING) private BookingStatus bookingStatus = BookingStatus.PENDING; - @Column(name="deposit_amount") + @Column(name = "deposit_amount") private double depositAmount; - @Column(name="hall_amount") + @Column(name = "hall_amount") private double hallAmount; - @Column(name="amount_received") + @Column(name = "amount_received") private double amountReceived; private double gst; - @Column(name="approved_by") + @Column(name = "approved_by") private String approvedBy; - @Column(name="refund_status") + @Column(name = "refund_status") @Enumerated(EnumType.STRING) private RefundStatus refundStatus; - @Column(name="updated_date") + @Column(name = "updated_date") private String updatedDate; private String reason; private int scheduleCount; @@ -61,46 +66,57 @@ public class BookingDetails { private String relationship; 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") -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") private CounterDetails counterDetails; - @ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.EAGER) + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER) private Users users; - @ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.EAGER) + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER) private HallDetails hallDetails; - @OneToMany(cascade = CascadeType.ALL,fetch = FetchType.EAGER,mappedBy = "bookingDetails") + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "bookingDetails") private List bookingHistories; - @OneToMany(cascade = CascadeType.ALL,fetch = FetchType.LAZY,mappedBy = "bookingDetails") + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bookingDetails") List bookingDocumentsList; - @OneToOne(cascade = CascadeType.ALL,fetch = FetchType.EAGER,mappedBy = "bookingDetails") + @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "bookingDetails") private Settlement settlement; - @OneToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY,mappedBy = "bookingDetails") + @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bookingDetails") private EbDetails ebDetails; - @OneToMany(cascade = CascadeType.ALL,fetch = FetchType.LAZY,mappedBy = "bookingDetails") + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bookingDetails") private List damageList; - @OneToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY,mappedBy = "bookingDetails") + @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bookingDetails") private Payments payments; - - @OneToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY,mappedBy = "bookingDetails") + + @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bookingDetails") 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 String counterId; + @Column(name = "mail_sent", columnDefinition = "Boolean DEFAULT 0") + private boolean mailSent; + + @Column(name = "mailsent_date") + private LocalDateTime mailSentDate; public int getBookingId() { return bookingId; @@ -116,14 +132,16 @@ private String bookingRefId; public void setNoOfDays(double days) { this.noOfDays = days; - }//ak + } + + // ak public String getBookingRefId() { - return bookingRefId; -} + return bookingRefId; + } -public void setBookingRefId(String bookingRefId) { - this.bookingRefId = bookingRefId; -} + public void setBookingRefId(String bookingRefId) { + this.bookingRefId = bookingRefId; + } public String getStartDate() { return startDate; @@ -317,45 +335,61 @@ public void setBookingRefId(String bookingRefId) { this.bookingtype = bookingtype; } - public List getBookingHistories() { - return bookingHistories; - } + public List getBookingHistories() { + return bookingHistories; + } + + public void setBookingHistories(List bookingHistories) { + this.bookingHistories = bookingHistories; + } + + public int getScheduleCount() { + return scheduleCount; + } + + public void setScheduleCount(int scheduleCount) { + this.scheduleCount = scheduleCount; + } + + public String getRelationship() { + return relationship; + } - public void setBookingHistories(List bookingHistories) { - this.bookingHistories = bookingHistories; - } + public void setRelationship(String relationship) { + this.relationship = relationship; + } - public int getScheduleCount() { - return scheduleCount; - } + public String getComments() { + return comments; + } - public void setScheduleCount(int scheduleCount) { - this.scheduleCount = scheduleCount; - } + public void setComments(String comments) { + this.comments = comments; + } - public String getRelationship() { - return relationship; - } + public int getNocAcknowledged() { + return nocAcknowledged; + } - public void setRelationship(String relationship) { - this.relationship = relationship; - } + public void setNocAcknowledged(int nocAcknowledged) { + this.nocAcknowledged = nocAcknowledged; + } - public String getComments() { - return comments; - } + public String getNocAcknowledgedBy() { + return nocAcknowledgedBy; + } - public void setComments(String comments) { - this.comments = comments; - } + public void setNocAcknowledgedBy(String nocAcknowledgedBy) { + this.nocAcknowledgedBy = nocAcknowledgedBy; + } - public ExtraPayments getExtrapayments() { - return extrapayments; - } + public ExtraPayments getExtrapayments() { + return extrapayments; + } - public void setExtrapayments(ExtraPayments extrapayments) { - this.extrapayments = extrapayments; - } + public void setExtrapayments(ExtraPayments extrapayments) { + this.extrapayments = extrapayments; + } public String getCounterId() { return counterId; @@ -364,5 +398,21 @@ public void setBookingRefId(String bookingRefId) { public void setCounterId(String 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; + } + } \ No newline at end of file diff --git a/src/main/java/com/gcc/communityHall/entity/SixMonthMailLog.java b/src/main/java/com/gcc/communityHall/entity/SixMonthMailLog.java new file mode 100644 index 00000000..3201631d --- /dev/null +++ b/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; } +} diff --git a/src/main/java/com/gcc/communityHall/paymentService/entity/RefundResponse.java b/src/main/java/com/gcc/communityHall/paymentService/entity/RefundResponse.java index 014e9ce2..28d0d141 100644 --- a/src/main/java/com/gcc/communityHall/paymentService/entity/RefundResponse.java +++ b/src/main/java/com/gcc/communityHall/paymentService/entity/RefundResponse.java @@ -1,6 +1,7 @@ package com.gcc.communityHall.paymentService.entity; import java.time.LocalDate; +import java.time.LocalDateTime; import jakarta.persistence.Column; import jakarta.persistence.Entity; @@ -18,69 +19,118 @@ public class RefundResponse { private int bookingId; private String txansactionId; private String statusCode; -// private String tpslTxnId; + // private String tpslTxnId; @Column(name = "date") private LocalDate date; @Column(length = 5000) private String response; private String Amount; + + @Column(name = "arn_number", length = 100) + private String arnNumber; + + @Column(name = "cdate") + private LocalDateTime cdate; private String balaceAmount; + @Column(name = "refunded_date") + private LocalDate refundedDate; + public Integer getId() { return id; } + public void setId(Integer id) { this.id = id; } + public String getUserId() { return userId; } + public void setUserId(String userId) { this.userId = userId; } + public int getBookingId() { return bookingId; } + public void setBookingId(int bookingId) { this.bookingId = bookingId; } + public String getTxansactionId() { return txansactionId; } + public void setTxansactionId(String txansactionId) { this.txansactionId = txansactionId; } + public String getStatusCode() { return statusCode; } + public void setStatusCode(String statusCode) { this.statusCode = statusCode; } - + public LocalDate getDate() { return date; } + public void setDate(LocalDate date) { this.date = date; } + public String getResponse() { return response; } + public void setResponse(String response) { this.response = response; } + public String getAmount() { return Amount; } + public void setAmount(String amount) { Amount = amount; } + public String getBalaceAmount() { return balaceAmount; } + public void setBalaceAmount(String 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; + } + } diff --git a/src/main/java/com/gcc/communityHall/paymentService/repository/TransRefundResRepository.java b/src/main/java/com/gcc/communityHall/paymentService/repository/TransRefundResRepository.java index 51ed25cf..a14d9831 100644 --- a/src/main/java/com/gcc/communityHall/paymentService/repository/TransRefundResRepository.java +++ b/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.paymentService.entity.RefundResponse; - - - - @Repository -public interface TransRefundResRepository extends JpaRepository{ - - @Query(value = "SELECT * FROM refund_response where user_id=:userId", nativeQuery = true) - List getRefundResponseByuserId(String userId); - - //List 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 " + - "FROM refund_response rr " + - "JOIN booking_details bd ON rr.booking_id = bd.booking_id " + - "WHERE rr.date >= :fromDate " + - "AND rr.date <= :toDate " + - "AND (rr.booking_id = :bookingId OR :bookingId IS NULL)", nativeQuery = true) -List getRefundResponseByBookingId(@Param("fromDate") String fromDate, - @Param("toDate") String toDate, - @Param("bookingId") Long bookingId); +public interface TransRefundResRepository extends JpaRepository { + + @Query(value = "SELECT * FROM refund_response where user_id=:userId", nativeQuery = true) + List getRefundResponseByuserId(String userId); + + // List 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 " + + + "FROM refund_response rr " + + "JOIN booking_details bd ON rr.booking_id = bd.booking_id " + + "WHERE rr.date >= :fromDate " + + "AND rr.date <= :toDate " + + "AND (rr.booking_id = :bookingId OR :bookingId IS NULL)", nativeQuery = true) + List getRefundResponseByBookingId(@Param("fromDate") String fromDate, + @Param("toDate") String toDate, + @Param("bookingId") Long bookingId); + + @Query(value = "SELECT * FROM refund_response WHERE booking_id = :bookingId LIMIT 1", nativeQuery = true) + RefundResponse findByBookingId(@Param("bookingId") int bookingId); } diff --git a/src/main/java/com/gcc/communityHall/paymentService/repository/TransactionResponseRepository.java b/src/main/java/com/gcc/communityHall/paymentService/repository/TransactionResponseRepository.java index 32173985..12c23ef5 100644 --- a/src/main/java/com/gcc/communityHall/paymentService/repository/TransactionResponseRepository.java +++ b/src/main/java/com/gcc/communityHall/paymentService/repository/TransactionResponseRepository.java @@ -89,6 +89,6 @@ public interface TransactionResponseRepository extends JpaRepository> getTransResBycdateandStatus(String status); } diff --git a/src/main/java/com/gcc/communityHall/repository/BookingDetailsRepository.java b/src/main/java/com/gcc/communityHall/repository/BookingDetailsRepository.java index ffd27ee6..57f12193 100644 --- a/src/main/java/com/gcc/communityHall/repository/BookingDetailsRepository.java +++ b/src/main/java/com/gcc/communityHall/repository/BookingDetailsRepository.java @@ -46,6 +46,10 @@ public interface BookingDetailsRepository extends JpaRepository= :fromDate " + "AND DATE(bd.booking_date) <= :toDate " + "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= :fromDate " + "AND DATE(bd.booking_date) <= :toDate " + "AND (:bookingId IS NULL OR bd.booking_id = :bookingId)" + @@ -1296,10 +1304,12 @@ public interface BookingDetailsRepository extends JpaRepository= :fromDate " + "AND DATE(bd.booking_date) <= :toDate " + "AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " + @@ -1314,10 +1324,13 @@ public interface BookingDetailsRepository extends JpaRepository= :fromDate " + "AND DATE(bd.booking_date) <= :toDate " + "AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " + @@ -1333,10 +1346,12 @@ public interface BookingDetailsRepository extends JpaRepository= :fromDate " + "AND DATE(bd.end_date) <= :toDate " + "AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " + @@ -1351,10 +1366,12 @@ public interface BookingDetailsRepository extends JpaRepository= :fromDate " + "AND DATE(bd.end_date) <= :toDate " + "AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " + @@ -1719,6 +1736,113 @@ public interface BookingDetailsRepository extends JpaRepository 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 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> 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> 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> 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> 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); } diff --git a/src/main/java/com/gcc/communityHall/repository/BookingHistoryRepository.java b/src/main/java/com/gcc/communityHall/repository/BookingHistoryRepository.java index e3b1b981..72efcead 100644 --- a/src/main/java/com/gcc/communityHall/repository/BookingHistoryRepository.java +++ b/src/main/java/com/gcc/communityHall/repository/BookingHistoryRepository.java @@ -1,16 +1,21 @@ package com.gcc.communityHall.repository; +import java.util.List; import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; import com.gcc.communityHall.entity.BookingHistory; @Repository -public interface BookingHistoryRepository extends JpaRepository { - +public interface BookingHistoryRepository extends JpaRepository { + @Query(value = "SELECT * FROM booking_history where booking_details_booking_id= :bookingId", nativeQuery = true) 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 findAllByBookingId(@Param("bookingId") int bookingId); } diff --git a/src/main/java/com/gcc/communityHall/repository/SixMonthMailLogRepository.java b/src/main/java/com/gcc/communityHall/repository/SixMonthMailLogRepository.java new file mode 100644 index 00000000..475f8a8e --- /dev/null +++ b/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 { + + List findByBookingIdOrderBySentAtDesc(int bookingId); +} diff --git a/src/main/java/com/gcc/communityHall/service/Impl/BookingServiceImpl.java b/src/main/java/com/gcc/communityHall/service/Impl/BookingServiceImpl.java index 96a15c90..a886454a 100644 --- a/src/main/java/com/gcc/communityHall/service/Impl/BookingServiceImpl.java +++ b/src/main/java/com/gcc/communityHall/service/Impl/BookingServiceImpl.java @@ -948,7 +948,7 @@ public class BookingServiceImpl implements BookingService { double EB = governmentevents.getHalfdayEBcharges(); double additionalcharges = cleaningCharges + PASystem + EB; 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 truncatedTotalAmount = Math.round(totalAmount * 100.0) / 100.0; hs.put("actualhallamount", hallAmount); @@ -1024,7 +1024,7 @@ public class BookingServiceImpl implements BookingService { double rentAmount = discountAmount; double netAmount = rentAmount + additionalcharges; 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 truncatedTotalAmount = Math.round(totalAmount * 100.0) / 100.0; hs.put("actualhallamount", hallAmount); @@ -2292,7 +2292,8 @@ public class BookingServiceImpl implements BookingService { Optional book = bookingDetailsRepository.findById(bookingId); BookingDetails bookingDetails = book.get(); 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); } // Updating Bookinghistory startDate and End Date @@ -2368,6 +2369,7 @@ public class BookingServiceImpl implements BookingService { // slots) ── for (String bookingIdStr : selectedBookings) { Integer bookingId = Integer.parseInt(bookingIdStr); + System.out.println("bookingId..." + bookingId); Optional optionalBooking = bookingDetailsRepository.findById(bookingId); if (optionalBooking.isPresent()) { @@ -2489,16 +2491,14 @@ public class BookingServiceImpl implements BookingService { BookingCalendar data = getbyDates(aa, hallId.toString()); int userbookingbookingId = gccBookingIds.get(hallIdsList.indexOf(hallId)); 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.setUnique_id(uniqueId); updateBookingStatus(data); } else { - System.out.println("uniqueId...2" + uniqueId); BookingCalendar book = new BookingCalendar(); book.setBdate(aa); book.setBookingId_1(String.valueOf(userbookingbookingId)); diff --git a/src/main/java/com/gcc/communityHall/service/Impl/HallDetailServiceImpl.java b/src/main/java/com/gcc/communityHall/service/Impl/HallDetailServiceImpl.java index a37058d7..41a08840 100644 --- a/src/main/java/com/gcc/communityHall/service/Impl/HallDetailServiceImpl.java +++ b/src/main/java/com/gcc/communityHall/service/Impl/HallDetailServiceImpl.java @@ -288,6 +288,7 @@ public class HallDetailServiceImpl implements HallDetailService { // Update hall details existingHall.setZone(hallDetails.getZone()); existingHall.setDivision(hallDetails.getDivision()); + existingHall.setHallArea(hallDetails.getHallArea()); existingHall.setHallName(hallDetails.getHallName()); existingHall.setDoorNo(hallDetails.getDoorNo()); existingHall.setStreet(hallDetails.getStreet()); diff --git a/src/main/java/com/gcc/communityHall/service/MailService.java b/src/main/java/com/gcc/communityHall/service/MailService.java new file mode 100644 index 00000000..44851c4b --- /dev/null +++ b/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," + + "Kindly update refund status for the below mentioned transaction made for Community Hall Booking." + + "Transaction Details:" + + " Booking ID : " + + bookingId + "" + // + " Booking Status : " + nvl(bookingStatus) + + // "" + + " Transaction ID : " + nvl(transactionId) + "" + + " TPSL ID : " + + nvl(tpslId) + "" + + " Transaction Date : " + nvl(transactionDate) + "" + + " Refund Amount : " + amt + "" + + "If refund was not initiated, kindly initiate the refund and update refund status at the earliest. " + + "Make sure that no duplicate refund was processed against this transaction." + + "Regards," + + "Community Hall Support" + + "Greater Chennai Corporation"; + } + + private String nvl(String val) { + return (val != null && !val.isEmpty()) ? val : "N/A"; + } +} \ No newline at end of file diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index 97b1c244..8ff84e66 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -72,3 +72,24 @@ app.manualRefundCode=8520 app.fullUrl=http://localhost:8062 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 diff --git a/src/main/resources/application-prod.properties b/src/main/resources/application-prod.properties index be83116c..56d68611 100644 --- a/src/main/resources/application-prod.properties +++ b/src/main/resources/application-prod.properties @@ -57,4 +57,23 @@ app.getOtpUrl=https://tmegov.onex-aura.com/api/sms? app.manualRefundCode=8520 app.fullUrl=https://gccservices.in/communityhall -app.commErpUrl=https://erp.chennaicorporation.gov.in/pgr/external/mobileservice \ No newline at end of file +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 diff --git a/src/main/resources/resources/templates/headquarters/sixmonthold-transactions.html b/src/main/resources/resources/templates/headquarters/sixmonthold-transactions.html new file mode 100644 index 00000000..62d79e72 --- /dev/null +++ b/src/main/resources/resources/templates/headquarters/sixmonthold-transactions.html @@ -0,0 +1,843 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + 6 Months Old Transaction Details + + + + + + + + 6 Month Old Bookings + 0 + + + + + Cancelled Bookings + 0 + + + + + Rejected Bookings + 0 + + + + + Mail Sent Bookings + 0 + + + + + + + + + + + + + S.No + Zone + Division + Hall Name + Booking Date + Event Date (Start – End) + Settlement Raised Date + Refund Amount (₹) + Refund Status + Booking Status + Action + + + + + + + + + + + + + + + + Settlement Not Initiated + + + + + — + + + + + + + + + + View Details + + Settlement Not Initiated + + Send Mail + + + + + No records found + + + + + + + + + + + + + S.No + Zone + Division + Hall Name + Booking Date + Event Date (Start – End) + Refund Amount (₹) + Booking Status + Action + + + + + + + + + + + + + + + + + + + + View Details + + + Send Mail + + + + + No records found + + + + + + + + + + + + + S.No + Zone + Division + Hall Name + Booking Date + Event Date (Start – End) + Refund Amount (₹) + Booking Status + Action + + + + + + + + + + + + + + + + + + + + View Details + + + Send Mail + + + + + No records found + + + + + + + + + + + + + S.No + Zone + Division + Hall Name + Booking Date + Event Date (Start – End) + Booking Status + Transaction ID + TPSL ID + Mail Sent Date + + + + + + + + + + + + + + + + + + + + + + + No records found + + + + + + + + + + + + + + + + + + + Settlement Information + + + + + + + + + + + Close + + + + + + + + + + + + + Booking Information + + + + + + + + + + + Close + + + + + + + + + + + + + Draft Mail Preview + + + × + + + + + From: + communityhallsupport@chennaicorporation.gov.in + + To: + pgsupport@mail.in.worldline-solutions.com, ranjithkumar@federal.bank.in, + megha.mattamana@federal.bank.in + + + CC: + arohqcc@gmail.com, it@chennaicorporation.gov.in + + Sub: Refund Status Update Request – Community Hall + Booking + + + + + + + + + + + + + + + + + + + + + + File Preview + × + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/templates/admin/gccblocking-new.html b/src/main/resources/templates/admin/gccblocking-new.html index 23c969e8..c274f892 100644 --- a/src/main/resources/templates/admin/gccblocking-new.html +++ b/src/main/resources/templates/admin/gccblocking-new.html @@ -324,7 +324,7 @@ - Cancel? + Select All # Hall Name @@ -781,10 +781,20 @@ // Wire select-all checkbox const selAll = document.getElementById('selectAllBookings'); if (selAll) { + // Select All → toggle every enabled row checkbox selAll.onchange = function () { document.querySelectorAll('.booking-cb:not(:disabled)') .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) { diff --git a/src/main/resources/templates/admin/reports.html b/src/main/resources/templates/admin/reports.html index b336914b..453eab54 100644 --- a/src/main/resources/templates/admin/reports.html +++ b/src/main/resources/templates/admin/reports.html @@ -61,1697 +61,1601 @@ /* Ensure second modal is on top of the first modal */ .modal-backdrop.show:nth-of-type(2) { - z-index: 1055 !important; /* slightly above the first modal */ + z-index: 1055 !important; + /* slightly above the first modal */ } #showBookingDetails.modal { - z-index: 1060 !important; /* higher than .modal-backdrop */ + z-index: 1060 !important; + /* higher than .modal-backdrop */ } - - - - - - - - - - - - - - - - - - - - - Community Hall Reports - - - - - From:* - - - To:* - - - - Get Info:* - + + + + + + + + + + + + + + + + + + + + Community Hall Reports + + + + + From:* + + + To:* + + + + Get Info:* + - Select - Users - Booking Details - Payment Info - Extra Payments Info - Users Booking List - Hall Booking List - Refund Details - Total Count - Counter Details - Review Report - Settlement Initited Report - - + Select + Users + Booking Details + Payment Info + Extra Payments Info + Users Booking List + Hall Booking List + Refund Details + Total Count + Counter Details + Review Report + Settlement Initited Report + + + - - Based On: * - + Based On: * + - Select - Zone - - Division - - - - + Select + Zone + + Division + + + + - - - User Type: - + + User Type: + - Select User Type - PENSIONER - - GCC - EMPLOYEE - - COUNCILLOR - - PUBLIC - - - - - - User Status: - Select User Type + PENSIONER + + GCC + EMPLOYEE + + COUNCILLOR + + PUBLIC + + + + + + User Status: + - Select a User Status - PENDING - - APPROVED - - REJECTED - - - - + Select a User Status + PENDING + + APPROVED + + REJECTED + + + + - - - Booking Id: - - + + + Booking Id: + + - - Select Zone: - - --Select Zone-- - + Select Zone: + + --Select Zone-- + - - + + - - Select division: - - --Select division-- - + Select division: + + --Select division-- + - + - - + + - - Select Hall: - - --Select Hall-- - + Select Hall: + + --Select Hall-- + - - + + - - - Filter by: - + + Filter by: + - Select Filterby - Booking Date - Event Date - - - + Select Filterby + Booking Date + Event Date + + + - - - Booking Status: - + + Booking Status: + - Select Booking Status - PENDING - - APPROVED - - REJECTED - - CANCELLED - - COMPLETED - - Select Booking Status + PENDING + + APPROVED + + REJECTED + + CANCELLED + + + COMPLETED + + PAYMENT_FAILURE - - - GCC_BLOCKED - - REFUNDED - - - WAITING FOR NOC - - + + GCC_BLOCKED + + REFUNDED + + + WAITING FOR NOC + + WAITING FOR NOC - APPROVAL - - - + APPROVAL + + + - - - Payment Status: - + + Payment Status: + - Select Payment Status - SUCCESS - NOT - COMPLETED - - - + Select Payment Status + SUCCESS + + + NOT + COMPLETED + + + - - Refund Status: - + Refund Status: + - Select Refund Status - WAITING - - APPROVED - - INITIATED - - REJECTED - - COMPLETED - - NA - - CLOSED - - FAILURE - - - - + Select Refund Status + WAITING + + APPROVED + + INITIATED + + REJECTED + + COMPLETED + + NA + + CLOSED + + FAILURE + + + + - - Report Type: * - + Report Type: * + - Select - Abstract - - Detailed Report - - - - + Select + Abstract + + Detailed + Report + + + + - - - + + Submit - - + Reset - + + - - - - - - - - - S.No - User Id - Name - Mobile - Address - UserType - UserStatus - - - - 0 - - - - + + + + + + + S.No + User Id + Name + Mobile + Address + UserType + UserStatus + + + + 0 + + + + - - - - + + + + - - + + - - - - - S.No - Booking Id - Booking Date - Hall Name - User Name - Mobile - Address - User type - Reason - Startdate_Enddate - Deposit Amount - Hall Amount - GST - Amount Paid - Booking Status - Action - - - - - 0 - - - - - - - - - - - - - - - - - - View - - - - - - + + + + + S.No + Zone + Division + Booking Id + Booking Date + Hall Name + User Name + Mobile + Address + User type + Reason + Startdate_Enddate + Deposit Amount + Hall Amount + GST + Amount Paid + Booking Status + Transaction Id + TPSL Id + Action + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + View + + + + + + - - - - - S.No - Booking Id - Booking Date - Hall Name - User Name - User type - Transaction ID - Payment Type - Deposit Amount - Hall Amount - GST - Amount received - Reason - Start date & end Date - status - - - - 0 - - - - - - - - - - - - - - - - - - + + + + + S.No + Booking Id + Booking Date + Hall Name + User Name + User type + Transaction ID + Payment Type + Deposit Amount + Hall Amount + GST + Amount received + Reason + Start date & end Date + status + + + + 0 + + + + + + + + + + + + + + + - - - - - S.No - Booking Id - Booking Date - Hall Name - User Name - User type - Transaction ID - Payment Type - Deposit Amount - Hall Amount - GST - Amount received - Reason - Start date & end Date - status - - - - 0 - - - - - - - - - - - - - - - - - - + + - - - - - S.No - User Id - Name - Mobile - Address - Total Bookings - - - - - 0 - - - - - - - - - + + + + + S.No + Booking Id + Booking Date + Hall Name + User Name + User type + Transaction ID + Payment Type + Deposit Amount + Hall Amount + GST + Amount received + Reason + Start date & end Date + status + + + + 0 + + + + + + + + + + + + + + + - - - - - S.No - Hall Id - Hall Name - Zone/Division - Caretaker Name - Caretaker Mobile - Total Bookings - Deposit Amount - Hall Amount - GST - Amount Received - Amount Refund - Net Revenue - - - - - 0 - - - - - - - - - - - - - - - - + + - - - - - S.No - Name - Mobile - Booking Id - Booked Hall - Reason - Booking Date - Event Date - No of Days - User type - Refund Status - Booking Status - - - - - 0 - - - - - - - - - - - - - - - - - - - - S.No - - Bookings Count - - - - - - - - - - - - - Total Bookings : - - - - - - - - - + + - - S.No - Counter ID - Total Bookings + + S.No + User Id + Name + Mobile + Address + Total Bookings + + + + + 0 + + + + + + + + + + + + + + S.No + Hall Id + Hall Name + Zone/Division + Caretaker Name + Caretaker Mobile + Total Bookings + Deposit Amount + Hall Amount + GST + Amount Received + Amount Refund + Net Revenue + - - - - - - - - - + + 0 + + + + + + + + + + + + + - - + + + - - S.No - Booking ID - Hall Name - Booking Date - Start Date - End Date - Starting Slot - Ending Slot - No.of.Days - Reason for Booking - Hall Amount - Deposit Amount - GSt - Amount Received - Booking Status - Booking Type - Counter Id - View + + S.No + Name + Mobile + Booking Id + Booked Hall + Reason + Booking Date + Event Date + No of Days + User type + Refund Status + Booking Status + + + + + 0 + + + + + + + + + + + + + + + + + + + S.No + + Bookings Count + - - - - - - - - - - - - - - - - - - - - - View - - - + + + + + + + + + Total Bookings : + + + - + + + + + + + S.No + Counter ID + Total Bookings + + + + + + + + + + + + + + + + + + + + S.No + Booking ID + Hall Name + Booking Date + Start Date + End Date + Starting Slot + Ending Slot + No.of.Days + Reason for Booking + Hall Amount + Deposit Amount + GSt + Amount Received + Booking Status + Booking Type + Counter Id + View + + + + + + + + + + + + + + + + + + + + + + + + View + + + + + + + - - - - - S.No - Zone - Hall Count - Online Booking Count - Counter Booking Count - Total Count - - - - 0 - - + + + + S.No + Zone + Hall Count + Online Booking Count + Counter Booking Count + Total Count + + + + 0 + + - - - - - - - - - + + + + + + + + + + + + + + + + S.No + Booking ID + Booking Date + Settlement Initated + User Name + Mobile + Hall Name + Start Date + End Date + Amount Received + Refunded Amount + Refund Transaction ID + Action + + + + + + + + + + + + + + + + + + + + View + + + + + + + + - - - - - - S.No - Booking ID - Booking Date - Settlement Initated - User Name - Mobile - Hall Name - Start Date - End Date - Amount Received - Refunded Amount - Refund Transaction ID - Action - - - - - - - - - - - - - - - - - - - - View - - - - - - - - - - - - - - - - - - - Booking - Information - - - - + + + + + + + + + + Booking + Information + + + + + - - - + + + + + + + User Details + + + + + User Name: + + + + Mobile Number: + + + + + User Type: + + + + + + + User Address: + + + + + + + + Hall Details + + + + + + Hall Name: + + + + + + + Hall Address: + + + + + + Caretaker Name: + + + + Caretaker Mobile Number: + + + + + + + + Booking + Details (Booking Id:-) + + + + + Booking Date: + + + + Deposit Amount (in Rs): + + + + + + Start Date: + + + + Hall Amount (in Rs): + + + + + + END Date: + + + + GST @18% (in Rs): + + + + + + Starting Slot: + + + + Total Amount (in Rs): + + + + + + Ending Slot: + + + + + + Booking Status: + + + + + Rejection + Reason: + + + + + + + + + + + + + + Booking Payment Details + + + + + Transaction ID: + + + + + + Amount Received (in Rs): + + + + + + + Transaction Status: + + + + + + + + + + + + + - - - Hall Name: - - - - - Hall Address: - - + + + + + EB + Details + + + + + Consumer Number: + + + + EB Amount Per Unit (in Rs): + + + + + + Start Reading: + + + + Unit Consumed: + + + + + + END Reading: + + + + EB Amount (in Rs): + + + + + + + + + + - - - - Caretaker Name: - - - - Caretaker Mobile Number: - - - - - - - Booking - Details (Booking Id:-) - - - - - Booking Date: - - - - Deposit Amount (in Rs): - - - - - - Start Date: - - - - Hall Amount (in Rs): - - - - - - END Date: - - - - GST @18% (in Rs): - - - - - - Starting Slot: - - - - Total Amount (in Rs): - - - - - - Ending Slot: - - - - - - Booking Status: - - - - - Rejection - Reason: - - - - - - - - - - - - - - - Booking Payment Details - - - - - Transaction ID: - - - - - - Amount Received (in Rs): - - - - - - - Transaction Status: - - - - + + + + + + Amount to be Refunded (in Rs) + + + + + Deposit Amount: + + 0 + + + + + EB Amount: + + + + + + Damage Amount: + + + + + + Collection Pending Amount: + + 0 + + + + + Collection + Pending Status + : + + + + + + + Actual refundable Amount: + + 0 + + + + - - - - - - - - - - - - EB - Details - - - - - Consumer Number: - - - - EB Amount Per Unit (in Rs): - - - - - - Start Reading: - - - - Unit Consumed: - - - - - - END Reading: - - - - EB Amount (in Rs): - - - - - + + + - - - - - - - - - - - Amount to be Refunded (in Rs) - - - - - Deposit Amount: - - 0 - - - - - EB Amount: - - - - - - Damage Amount: - - - - - - Collection Pending Amount: - - 0 - - - - Collection - Pending Status - : - - - - - - - Actual refundable Amount: - - 0 - - - + + + - - - - - - - Refund Details - - - - - Booking Status: - - - - Refund Status: - - - - - - Refund amount: - - - - - + + + - - - - - - - - - - - - + + + + Close + + + + + - - - Close + + + + + File Preview + + × - - - - - - - - - - File Preview - - × - - - - - - - - - - - - - - List of Bookings - × - - - - - - - - - - - - S.No - Booking Id - Booking Date - Start Date - End Date - Starting Slot - Ending Slot - Reason For Booking - No of days - Booking Status - Hall Amount - Total Amount Paid - - - - + + + + + + + List of Bookings + × + + + + + + + + + + + + S.No + Booking Id + Booking Date + Start Date + End Date + Starting Slot + Ending Slot + Reason For Booking + No of days + Booking Status + Hall Amount + Total Amount Paid + + + + + - - - - - - - - - - - List of Bookings Based on Zone - × - - - - - - - - - - - - S.No - Booking Id - Booking Date - Start Date - End Date - Starting Slot - Ending Slot - Reason For Booking - No of Days - Booking Status - Hall Amount - Total Amount Paid - - - - + + + + + + + List of Bookings Based on Zone + × + + + + + + + + + + + + S.No + Booking Id + Booking Date + Start Date + End Date + Starting Slot + Ending Slot + Reason For Booking + No of Days + Booking Status + Hall Amount + Total Amount Paid + + + + + - - - - - - - - - - Hall-wise Booking Details - - - - + + + + + Hall-wise Booking Details + + + + - - - - - - S.No - Zone - Division - Hall Name - Total Bookings - - - - + + + + + + S.No + Zone + Division + Hall Name + Total Bookings + + + + + - - - - - - - Booking Details for Hall - - - - - - - - S.No - Booking ID - Hall Name - Booking Date - Start Date - End Date - Starting Slot - Ending Slot - No.of.Days - Reason for Booking - Hall Amount - Deposit Amount - GSt - Amount Received - Booking Status - Booking Type - View - - - - + + + + + Booking Details for Hall + + + + + + + + + S.No + Booking ID + Hall Name + Booking Date + Start Date + End Date + Starting Slot + Ending Slot + No.of.Days + Reason for Booking + Hall Amount + Deposit Amount + GSt + Amount Received + Booking Status + Booking Type + View + + + + + - - - - - - - Hall-wise Booking Details - - - - + + + + + Hall-wise Booking Details + + + + - - - - - - S.No - Hall Name - Online Booking Count - Counter Booking Count - Total Count - - - - - - - - - - - - - - Booking Details for Hall - - - - - - - - - S.No - Counter ID - No.of Booking - - - - + + + + + + S.No + Hall Name + Online Booking Count + Counter Booking Count + Total Count + + + + + - - - - - - - Booking Information - + + + + + + Booking Details for Hall + + + + + + + + + S.No + Counter ID + No.of Booking + + + + + - - + + + + + + + + Booking Information + + + + + - - - - - - - - - - - - + + + +
- View -
+ View +