Browse Source

MF DT unit added in the settlement and Reschedule, Booking status change and NOC document deletion option restriction for EB Reading

master
KaNi-04 2 months ago
parent
commit
8972937cfa
  1. 4
      src/main/java/com/gcc/communityHall/controller/AdminAPIController.java
  2. 6
      src/main/java/com/gcc/communityHall/controller/Admincontroller.java
  3. 504
      src/main/java/com/gcc/communityHall/controller/CROAPIController.java
  4. 4
      src/main/java/com/gcc/communityHall/controller/CROController.java
  5. 2
      src/main/java/com/gcc/communityHall/controller/HQAPIController.java
  6. 3
      src/main/java/com/gcc/communityHall/controller/HeadquartersController.java
  7. 25
      src/main/java/com/gcc/communityHall/controller/OfficerAPIController.java
  8. 75
      src/main/java/com/gcc/communityHall/controller/UserAPIController.java
  9. 41
      src/main/java/com/gcc/communityHall/controller/UserController.java
  10. 11
      src/main/java/com/gcc/communityHall/entity/HallDetails.java
  11. 2
      src/main/java/com/gcc/communityHall/repository/BookingDetailsRepository.java
  12. 17
      src/main/java/com/gcc/communityHall/repository/BookingDocumentsRepository.java
  13. 40
      src/main/java/com/gcc/communityHall/service/HallDetailService.java
  14. 187
      src/main/java/com/gcc/communityHall/service/Impl/BookingServiceImpl.java
  15. 54
      src/main/java/com/gcc/communityHall/service/Impl/HallDetailServiceImpl.java
  16. 423
      src/main/resources/templates/admin/refund-failedlist.html
  17. 25
      src/main/resources/templates/admin/reports.html
  18. 58
      src/main/resources/templates/admin/settlement-approved.html
  19. 252
      src/main/resources/templates/admin/settlement-completed.html
  20. 58
      src/main/resources/templates/admin/settlement-initiate.html
  21. 58
      src/main/resources/templates/admin/settlement-list.html
  22. 56
      src/main/resources/templates/admin/settlement-reject.html
  23. 31
      src/main/resources/templates/admin/settlementlist.html
  24. 294
      src/main/resources/templates/caretaker/caretakerpage.html
  25. 115
      src/main/resources/templates/caretaker/settlementlist.html
  26. 10
      src/main/resources/templates/cro/booking-list.html
  27. 751
      src/main/resources/templates/cro/booking-status.html
  28. 860
      src/main/resources/templates/cro/noc-details.html
  29. 37
      src/main/resources/templates/fragments/Details.html
  30. 171
      src/main/resources/templates/fragments/croMenu.html
  31. 2
      src/main/resources/templates/fragments/menuOfficer.html
  32. 24
      src/main/resources/templates/headquarters/halldetailslist.html
  33. 58
      src/main/resources/templates/headquarters/refund-failedlist.html
  34. 25
      src/main/resources/templates/headquarters/reports.html
  35. 58
      src/main/resources/templates/headquarters/settlement-approved.html
  36. 60
      src/main/resources/templates/headquarters/settlement-completed.html
  37. 58
      src/main/resources/templates/headquarters/settlement-initiate.html
  38. 58
      src/main/resources/templates/headquarters/settlement-list.html
  39. 56
      src/main/resources/templates/headquarters/settlement-reject.html
  40. 31
      src/main/resources/templates/headquarters/settlementlist.html
  41. 57
      src/main/resources/templates/headquarters/sixmonthold-transactions.html
  42. 58
      src/main/resources/templates/officer/refund-failedlist.html
  43. 27
      src/main/resources/templates/officer/report.html
  44. 56
      src/main/resources/templates/officer/settlement-approved.html
  45. 247
      src/main/resources/templates/officer/settlement-completed.html
  46. 58
      src/main/resources/templates/officer/settlement-list.html
  47. 56
      src/main/resources/templates/officer/settlement-reject.html
  48. 38
      src/main/resources/templates/user/viewhistory.html

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

@ -200,7 +200,8 @@ public class AdminAPIController {
@RequestParam("ebCostPerUnit") float ebCostPerUnit, @RequestParam("ebCostPerUnit") float ebCostPerUnit,
@RequestParam("gst") float gst, @RequestParam("gst") float gst,
@RequestParam("city") String city, @RequestParam("city") String city,
@RequestParam("isActive") boolean isActive) {
@RequestParam("isActive") boolean isActive,
@RequestParam(value = "mfDtUnit", defaultValue = "1", required = false) int mfDtUnit) {
HallDetails hallDetails = new HallDetails(); HallDetails hallDetails = new HallDetails();
hallDetails.setHallId(Integer.parseInt(hallId)); hallDetails.setHallId(Integer.parseInt(hallId));
@ -227,6 +228,7 @@ public class AdminAPIController {
hallDetails.setGst(gst); hallDetails.setGst(gst);
hallDetails.setCity(city); hallDetails.setCity(city);
hallDetails.setActive(isActive); hallDetails.setActive(isActive);
hallDetails.setMfDtUnit(mfDtUnit);
hallDetailService.updateHallDetail(hallDetails, images); hallDetailService.updateHallDetail(hallDetails, images);
String adminname = (String) session.getAttribute("usertype"); String adminname = (String) session.getAttribute("usertype");

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

@ -450,12 +450,14 @@ public class Admincontroller {
@RequestParam(required = false) String longitude, @RequestParam(required = false) String longitude,
@RequestParam String hallInchargeName, @RequestParam String hallInchargeName,
@RequestParam long hallInchargeNo, @RequestParam long hallInchargeNo,
@RequestParam("hallImages") MultipartFile[] hallImages, HttpSession session) {
@RequestParam("hallImages") MultipartFile[] hallImages,
@RequestParam(value = "mfDtUnit", defaultValue = "1", required = false) int mfDtUnit,
HttpSession session) {
String updatedId = (String) session.getAttribute("employeeId"); String updatedId = (String) session.getAttribute("employeeId");
hallDetailService.saveHallByAdmin(hallName, depositAmount, halfDayAmt, fullDayAmt, gst, hallArea, ebNumber, hallDetailService.saveHallByAdmin(hallName, depositAmount, halfDayAmt, fullDayAmt, gst, hallArea, ebNumber,
ebCostPerUnit, parkingCapacity, seatingCapacity, doorNo, ebCostPerUnit, parkingCapacity, seatingCapacity, doorNo,
street, area, zone, division, landMark, city, pinCode, latitude, longitude, hallInchargeName, street, area, zone, division, landMark, city, pinCode, latitude, longitude, hallInchargeName,
hallInchargeNo, updatedId, hallImages, halfdepositAmt);
hallInchargeNo, updatedId, hallImages, halfdepositAmt, mfDtUnit);
String adminname = (String) session.getAttribute("usertype"); String adminname = (String) session.getAttribute("usertype");
Integer loginid = (Integer) session.getAttribute("id"); Integer loginid = (Integer) session.getAttribute("id");
ApplicationLogs logs = new ApplicationLogs(); ApplicationLogs logs = new ApplicationLogs();

504
src/main/java/com/gcc/communityHall/controller/CROAPIController.java

@ -1,18 +1,39 @@
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.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.gcc.communityHall.entity.ApplicationLogs;
import com.gcc.communityHall.entity.BookingCalendar;
import com.gcc.communityHall.entity.BookingDetails; import com.gcc.communityHall.entity.BookingDetails;
import com.gcc.communityHall.entity.BookingDocuments;
import com.gcc.communityHall.entity.BookingHistory;
import com.gcc.communityHall.repository.ApplicationLogsRepository;
import com.gcc.communityHall.repository.BookingCalendarRepository;
import com.gcc.communityHall.repository.BookingDetailsRepository;
import com.gcc.communityHall.repository.BookingDocumentsRepository;
import com.gcc.communityHall.repository.BookingHistoryRepository;
import com.gcc.communityHall.service.BookingService; import com.gcc.communityHall.service.BookingService;
import com.gcc.communityHall.service.Impl.WhatsappMsgServiceImpl;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpSession; import jakarta.servlet.http.HttpSession;
@RestController @RestController
@ -22,9 +43,27 @@ public class CROAPIController {
@Autowired @Autowired
private BookingService bookingService; private BookingService bookingService;
@Autowired
private BookingDetailsRepository bookingDetailsRepository;
@Autowired
private BookingHistoryRepository bookingHistoryRepository;
@Autowired
private BookingCalendarRepository bookingCalendarRepository;
@Autowired
private BookingDocumentsRepository bookingDocumentsRepository;
@Autowired
private ApplicationLogsRepository applicationLogsRepository;
@Autowired(required = false)
private WhatsappMsgServiceImpl whatsappMsgServiceImpl;
/** /**
* Get booking details by booking ID. * Get booking details by booking ID.
* Used by the CRO booking-list page to search and display
* Used by the CRO booking-list and booking-status pages to search and display
* full booking info for a given booking ID. * full booking info for a given booking ID.
* *
* @param bookingId the booking ID to search for * @param bookingId the booking ID to search for
@ -42,7 +81,6 @@ public class CROAPIController {
/** /**
* Returns the currently logged-in CRO's mobile number from the HTTP session. * Returns the currently logged-in CRO's mobile number from the HTTP session.
* Used by the CRO reschedule flow to send OTP to the CRO (not the user).
* *
* @param session the current HTTP session * @param session the current HTTP session
* @return JSON { "mobileNumber": <number> } or 401 if not authenticated * @return JSON { "mobileNumber": <number> } or 401 if not authenticated
@ -58,4 +96,466 @@ public class CROAPIController {
return ResponseEntity.ok(response); return ResponseEntity.ok(response);
} }
/**
* Sends OTP to the logged-in CRO's mobile number for booking status change
* verification.
*
* @param session current HTTP session
* @param request current HTTP request
* @return JSON response with success status and masked CRO mobile number
*/
@GetMapping("/sendCroStatusOtp")
public ResponseEntity<?> sendCroStatusOtp(HttpSession session, HttpServletRequest request) {
Object mobileObj = session.getAttribute("mobileno");
String userType = (String) session.getAttribute("usertype");
if (userType == null || !"cro".equalsIgnoreCase(userType) || mobileObj == null) {
Map<String, Object> err = new HashMap<>();
err.put("status", "error");
err.put("message", "CRO session not found or unauthorized");
return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(err);
}
long mobileNo;
try {
mobileNo = Long.parseLong(mobileObj.toString());
} catch (NumberFormatException e) {
Map<String, Object> err = new HashMap<>();
err.put("status", "error");
err.put("message", "Invalid CRO mobile number in session");
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(err);
}
int otp = 11111; // Standard OTP pattern used across project
// Trigger SMS if gateway is configured
try {
String smsText = "Welcome to GCC! Your OTP for GCC Community Centre booking status change is " + otp;
String urlString = "https://tmegov.onex-aura.com/api/sms?key=pfTEYN6H&to=" + mobileNo
+ "&from=GCCCRP&body=" + smsText
+ "&entityid=1401572690000011081&templateid=1407172346444550398";
if (whatsappMsgServiceImpl != null) {
whatsappMsgServiceImpl.sendSMS(urlString);
}
} catch (Exception e) {
System.out.println("Error sending OTP SMS to CRO: " + e.getMessage());
}
session.setAttribute("croStatusOtp", otp);
session.setAttribute("croStatusOtpMobile", mobileNo);
String mobileStr = String.valueOf(mobileNo);
String maskedMobile = mobileStr.length() >= 10
? mobileStr.substring(0, 2) + "XXXXXX" + mobileStr.substring(mobileStr.length() - 2)
: mobileStr;
Map<String, Object> resp = new HashMap<>();
resp.put("status", "success");
resp.put("maskedMobile", maskedMobile);
resp.put("message", "OTP sent successfully to CRO mobile number.");
return ResponseEntity.ok(resp);
}
/**
* Verifies OTP and updates booking status to REJECTED or GCC_BLOCKED.
* Records transition in BookingHistory, clears BookingCalendar slots, and
* writes ApplicationLogs.
*
* @param bookingId the booking ID
* @param newStatusStr target status (REJECTED or GCC_BLOCKED)
* @param comments remarks/reason entered by CRO
* @param otp entered OTP
* @param session HTTP session
* @param request HTTP request
* @return JSON status response
*/
@PostMapping("/updateBookingStatus")
public ResponseEntity<?> updateBookingStatus(
@RequestParam("bookingId") int bookingId,
@RequestParam("status") String newStatusStr,
@RequestParam(value = "comments", required = false) String comments,
@RequestParam("otp") String otp,
HttpSession session,
HttpServletRequest request) {
String userType = (String) session.getAttribute("usertype");
if (userType == null || !"cro".equalsIgnoreCase(userType)) {
Map<String, Object> err = new HashMap<>();
err.put("status", "error");
err.put("message", "CRO session not found or unauthorized");
return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(err);
}
Object sessionOtpObj = session.getAttribute("otp");
if (sessionOtpObj == null) {
sessionOtpObj = session.getAttribute("croStatusOtp");
}
if (sessionOtpObj == null) {
Map<String, Object> err = new HashMap<>();
err.put("status", "error");
err.put("message", "OTP expired or not requested. Please request a new OTP.");
return ResponseEntity.badRequest().body(err);
}
int sessionOtp = Integer.parseInt(sessionOtpObj.toString());
try {
int enteredOtp = Integer.parseInt(otp.trim());
if (enteredOtp != sessionOtp) {
Map<String, Object> err = new HashMap<>();
err.put("status", "error");
err.put("message", "Incorrect OTP. Please enter the valid OTP.");
return ResponseEntity.badRequest().body(err);
}
} catch (NumberFormatException e) {
Map<String, Object> err = new HashMap<>();
err.put("status", "error");
err.put("message", "Invalid OTP format.");
return ResponseEntity.badRequest().body(err);
}
// Validate target status
BookingDetails.BookingStatus targetStatus;
try {
targetStatus = BookingDetails.BookingStatus.valueOf(newStatusStr.toUpperCase().trim());
if (targetStatus != BookingDetails.BookingStatus.REJECTED
&& targetStatus != BookingDetails.BookingStatus.GCC_BLOCKED) {
Map<String, Object> err = new HashMap<>();
err.put("status", "error");
err.put("message", "Invalid target status. Only REJECTED or GCC_BLOCKED are allowed.");
return ResponseEntity.badRequest().body(err);
}
} catch (Exception e) {
Map<String, Object> err = new HashMap<>();
err.put("status", "error");
err.put("message", "Invalid status value: " + newStatusStr);
return ResponseEntity.badRequest().body(err);
}
Optional<BookingDetails> bookingOpt = bookingDetailsRepository.findById(bookingId);
if (!bookingOpt.isPresent()) {
Map<String, Object> err = new HashMap<>();
err.put("status", "error");
err.put("message", "Booking ID " + bookingId + " not found.");
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(err);
}
BookingDetails booking = bookingOpt.get();
BookingDetails.BookingStatus currentStatus = booking.getBookingStatus();
// Check if current status is APPROVED, WAITING_FOR_NOC, or
// WAITING_FOR_NOC_APPROVAL
if (currentStatus != BookingDetails.BookingStatus.APPROVED &&
currentStatus != BookingDetails.BookingStatus.WAITING_FOR_NOC &&
currentStatus != BookingDetails.BookingStatus.WAITING_FOR_NOC_APPROVAL) {
Map<String, Object> err = new HashMap<>();
err.put("status", "error");
err.put("message",
"Status change is only permitted for bookings in APPROVED, WAITING_FOR_NOC, or WAITING_FOR_NOC_APPROVAL status. Current status is: "
+ currentStatus);
return ResponseEntity.badRequest().body(err);
}
// Check if event is in the future: CRO is not allowed to change status for future dates.
// Only completed events (past/current completed dates) can be marked as REJECTED or GCC_BLOCKED.
LocalDate today = LocalDate.now();
if (booking.getStartDate() != null && !booking.getStartDate().trim().isEmpty()) {
try {
LocalDate startDate = LocalDate.parse(booking.getStartDate().trim());
LocalDate endDate = (booking.getEndDate() != null && !booking.getEndDate().trim().isEmpty())
? LocalDate.parse(booking.getEndDate().trim())
: startDate;
if (startDate.isAfter(today) || endDate.isAfter(today)) {
Map<String, Object> err = new HashMap<>();
err.put("status", "error");
err.put("message",
"Status change is not permitted for future events. Only completed events can be marked as REJECTED or GCC_BLOCKED.");
return ResponseEntity.badRequest().body(err);
}
} catch (Exception ignored) {
}
}
String safeComments = (comments != null && !comments.trim().isEmpty()) ? comments.trim()
: "Status updated by CRO";
// 1. Create BookingHistory record
BookingHistory history = new BookingHistory();
history.setBookingDetails(booking);
history.setBookingStatus(currentStatus); // record prior status
history.setStartDate(booking.getStartDate());
history.setEndDate(booking.getEndDate());
history.setStartingSlot(booking.getStartingSlot());
history.setEndingSlot(booking.getEndingSlot());
history.setRefundStatus(booking.getRefundStatus());
history.setComments(
"Status changed from " + currentStatus + " to " + targetStatus + " by CRO. Remarks: " + safeComments);
history.setUpdatedBy("CRO");
history.setCdate(new Date());
bookingHistoryRepository.save(history);
// 2. Update BookingDetails
booking.setBookingStatus(targetStatus);
booking.setComments(safeComments);
booking.setUpdatedDate(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
// 3. Clear/release BookingCalendar slots
try {
List<BookingCalendar> bookingCalendarList = bookingCalendarRepository
.getCancellingdata1(String.valueOf(booking.getBookingId()));
for (BookingCalendar calendar : bookingCalendarList) {
boolean isUpdated = false;
if (String.valueOf(booking.getBookingId()).equals(calendar.getBookingId_1())) {
calendar.setBookingId_1(null);
isUpdated = true;
}
if (String.valueOf(booking.getBookingId()).equals(calendar.getBookingId_2())) {
calendar.setBookingId_2(null);
isUpdated = true;
}
if (calendar.isMorningSlot()) {
calendar.setMorningSlot(false);
isUpdated = true;
}
if (calendar.isEveningSlot()) {
calendar.setEveningSlot(false);
isUpdated = true;
}
if (isUpdated) {
calendar.setIs_delete(true);
bookingCalendarRepository.save(calendar);
}
}
} catch (Exception e) {
System.out.println("Error updating booking calendar: " + e.getMessage());
}
bookingDetailsRepository.save(booking);
// 4. Log in ApplicationLogs
try {
ApplicationLogs appLog = new ApplicationLogs();
appLog.setBookingId(bookingId);
appLog.setLogType("CRO_STATUS_CHANGE: " + targetStatus);
appLog.setComments("Booking status changed from " + currentStatus + " to " + targetStatus
+ " by CRO. Remarks: " + safeComments);
Object sessionIdObj = session.getAttribute("id");
if (sessionIdObj instanceof Integer) {
appLog.setLoginId((Integer) sessionIdObj);
} else if (sessionIdObj != null) {
try {
appLog.setLoginId(Integer.parseInt(sessionIdObj.toString()));
} catch (Exception ignored) {
}
}
try {
InetAddress inetAddress = InetAddress.getLocalHost();
appLog.setIpaddress(inetAddress.getHostAddress());
appLog.setSystemName(inetAddress.getHostName());
} catch (UnknownHostException e) {
appLog.setIpaddress(request.getRemoteAddr());
}
appLog.setCdate(new Date());
applicationLogsRepository.save(appLog);
} catch (Exception e) {
System.out.println("Error saving application log: " + e.getMessage());
}
// Clear session OTP
session.removeAttribute("otp");
session.removeAttribute("croStatusOtp");
session.removeAttribute("croStatusOtpMobile");
Map<String, Object> response = new HashMap<>();
response.put("status", "success");
response.put("message", "Booking status successfully updated to " + targetStatus);
return ResponseEntity.ok(response);
}
/**
* Fetch all uploaded documents for a given booking ID.
*
* @param bookingId the booking ID
* @return list of BookingDocuments
*/
@GetMapping("/getBookingDocuments")
public ResponseEntity<?> getBookingDocuments(@RequestParam("bookingId") int bookingId) {
List<BookingDocuments> docs = bookingDocumentsRepository.findByBookingId(bookingId);
return ResponseEntity.ok(docs != null ? docs : List.of());
}
/**
* Delete an NOC document uploaded for Commercial / State Govt / Central Govt
* Event
* when booking status is WAITING_FOR_NOC_APPROVAL.
* Verifies CRO session and OTP, archives document to DeletedBookingDocuments,
* updates BookingDetails status back to WAITING_FOR_NOC, and writes
* ApplicationLogs.
*
* @param bookingId the booking ID
* @param bookingDocId the booking document ID to delete
* @param otp the OTP entered by CRO
* @param comments optional remarks
* @param session HTTP session
* @param request HTTP request
* @return JSON response
*/
@PostMapping("/deleteNocDocument")
public ResponseEntity<?> deleteNocDocument(
@RequestParam("bookingId") int bookingId,
@RequestParam("bookingDocId") int bookingDocId,
@RequestParam("otp") String otp,
@RequestParam(value = "comments", required = false) String comments,
HttpSession session,
HttpServletRequest request) {
String userType = (String) session.getAttribute("usertype");
if (userType == null || !"cro".equalsIgnoreCase(userType)) {
Map<String, Object> err = new HashMap<>();
err.put("status", "error");
err.put("message", "CRO session not found or unauthorized");
return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(err);
}
Object sessionOtpObj = session.getAttribute("otp");
if (sessionOtpObj == null) {
sessionOtpObj = session.getAttribute("croStatusOtp");
}
if (sessionOtpObj == null) {
Map<String, Object> err = new HashMap<>();
err.put("status", "error");
err.put("message", "OTP expired or not requested. Please request a new OTP.");
return ResponseEntity.badRequest().body(err);
}
int sessionOtp = Integer.parseInt(sessionOtpObj.toString());
try {
int enteredOtp = Integer.parseInt(otp.trim());
if (enteredOtp != sessionOtp) {
Map<String, Object> err = new HashMap<>();
err.put("status", "error");
err.put("message", "Incorrect OTP. Please enter the valid OTP.");
return ResponseEntity.badRequest().body(err);
}
} catch (NumberFormatException e) {
Map<String, Object> err = new HashMap<>();
err.put("status", "error");
err.put("message", "Invalid OTP format.");
return ResponseEntity.badRequest().body(err);
}
Optional<BookingDetails> bookingOpt = bookingDetailsRepository.findById(bookingId);
if (!bookingOpt.isPresent()) {
Map<String, Object> err = new HashMap<>();
err.put("status", "error");
err.put("message", "Booking ID " + bookingId + " not found.");
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(err);
}
BookingDetails booking = bookingOpt.get();
// Check status: must be WAITING_FOR_NOC_APPROVAL
if (booking.getBookingStatus() != BookingDetails.BookingStatus.WAITING_FOR_NOC_APPROVAL) {
Map<String, Object> err = new HashMap<>();
err.put("status", "error");
err.put("message",
"NOC document deletion is only permitted for bookings with status WAITING_FOR_NOC_APPROVAL. Current status is: "
+ booking.getBookingStatus());
return ResponseEntity.badRequest().body(err);
}
// Check reason: must be Commercial, State Govt Event, or Central Govt Event
String reason = booking.getReason() != null ? booking.getReason().trim() : "";
if (!"Commercial".equalsIgnoreCase(reason) && !"State Govt Event".equalsIgnoreCase(reason)
&& !"Central Govt Event".equalsIgnoreCase(reason)) {
Map<String, Object> err = new HashMap<>();
err.put("status", "error");
err.put("message",
"NOC document deletion is only permitted for Commercial, State Govt Event, or Central Govt Event bookings.");
return ResponseEntity.badRequest().body(err);
}
Optional<BookingDocuments> docOpt = bookingDocumentsRepository.findById(bookingDocId);
if (!docOpt.isPresent()) {
Map<String, Object> err = new HashMap<>();
err.put("status", "error");
err.put("message", "Document ID " + bookingDocId + " not found.");
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(err);
}
BookingDocuments doc = docOpt.get();
// Ensure this is an NOC document (bookingDocUrl contains
// /communityhall/images/NOC/ or /images/noc/)
String docUrl = doc.getBookingDocUrl() != null ? doc.getBookingDocUrl() : "";
if (!docUrl.toLowerCase().contains("/images/noc/")) {
Map<String, Object> err = new HashMap<>();
err.put("status", "error");
err.put("message", "Only NOC documents can be deleted. This document is not an NOC document.");
return ResponseEntity.badRequest().body(err);
}
String safeComments = (comments != null && !comments.trim().isEmpty()) ? comments.trim()
: "NOC document rejected/removed by CRO";
// 1. Update BookingDetails status back to WAITING_FOR_NOC and record in
// BookingHistory
BookingHistory history = new BookingHistory();
history.setBookingDetails(booking);
history.setBookingStatus(booking.getBookingStatus()); // prior status WAITING_FOR_NOC_APPROVAL
history.setStartDate(booking.getStartDate());
history.setEndDate(booking.getEndDate());
history.setStartingSlot(booking.getStartingSlot());
history.setEndingSlot(booking.getEndingSlot());
history.setRefundStatus(booking.getRefundStatus());
history.setComments(
"NOC Document (" + (doc.getDocumentName() != null ? doc.getDocumentName() : "ID:" + bookingDocId)
+ ") rejected/removed by CRO. Remarks: " + safeComments);
history.setUpdatedBy("CRO");
history.setCdate(new Date());
bookingHistoryRepository.save(history);
booking.setBookingStatus(BookingDetails.BookingStatus.WAITING_FOR_NOC);
booking.setComments("NOC document rejected/removed by CRO - Waiting for NOC");
booking.setUpdatedDate(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
bookingDetailsRepository.save(booking);
// 2. Log in ApplicationLogs table
try {
ApplicationLogs appLog = new ApplicationLogs();
appLog.setBookingId(bookingId);
appLog.setLogType("CRO_DELETE_NOC_DOCUMENT");
appLog.setComments("NOC Document (ID: " + bookingDocId + ", Name: " + doc.getDocumentName() + ", URL: "
+ doc.getBookingDocUrl() + ") rejected/removed by CRO. Remarks: " + safeComments);
Object sessionIdObj = session.getAttribute("id");
if (sessionIdObj instanceof Integer) {
appLog.setLoginId((Integer) sessionIdObj);
} else if (sessionIdObj != null) {
try {
appLog.setLoginId(Integer.parseInt(sessionIdObj.toString()));
} catch (Exception ignored) {
}
}
try {
InetAddress inetAddress = InetAddress.getLocalHost();
appLog.setIpaddress(inetAddress.getHostAddress());
appLog.setSystemName(inetAddress.getHostName());
} catch (UnknownHostException e) {
appLog.setIpaddress(request.getRemoteAddr());
}
appLog.setCdate(new Date());
applicationLogsRepository.save(appLog);
} catch (Exception e) {
System.out.println("Error saving application log for document deletion: " + e.getMessage());
}
// Clear session OTP
session.removeAttribute("otp");
session.removeAttribute("croStatusOtp");
session.removeAttribute("croStatusOtpMobile");
Map<String, Object> resp = new HashMap<>();
resp.put("status", "success");
resp.put("message", "NOC document rejected and booking status updated to WAITING_FOR_NOC.");
return ResponseEntity.ok(resp);
}
} }

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

@ -45,8 +45,6 @@ public class CROController {
long mobileno = (long) session.getAttribute("mobileno"); long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno); model.addAttribute("mobileno", mobileno);
model.addAttribute("croname", croname); model.addAttribute("croname", croname);
List<BookingDetails> bookingList = bookingDetailsRepository.getApprovedBookingListforReschedule();
model.addAttribute("bookingList", bookingList);
return "cro/booking-status"; return "cro/booking-status";
} else { } else {
session.invalidate(); // Invalidate the session to clear all session attributes session.invalidate(); // Invalidate the session to clear all session attributes
@ -62,8 +60,6 @@ public class CROController {
long mobileno = (long) session.getAttribute("mobileno"); long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno); model.addAttribute("mobileno", mobileno);
model.addAttribute("croname", croname); model.addAttribute("croname", croname);
List<BookingDetails> bookingList = bookingDetailsRepository.getApprovedBookingListforReschedule();
model.addAttribute("bookingList", bookingList);
return "cro/noc-details"; return "cro/noc-details";
} else { } else {
session.invalidate(); // Invalidate the session to clear all session attributes session.invalidate(); // Invalidate the session to clear all session attributes

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

@ -206,6 +206,7 @@ public class HQAPIController {
@RequestParam("gst") float gst, @RequestParam("gst") float gst,
@RequestParam("city") String city, @RequestParam("city") String city,
@RequestParam("isActive") boolean isActive, @RequestParam("isActive") boolean isActive,
@RequestParam(value = "mfDtUnit", defaultValue = "1") int mfDtUnit,
@RequestParam(value = "floorName", required = false) List<String> floorNames, @RequestParam(value = "floorName", required = false) List<String> floorNames,
@RequestParam(value = "floorCapacity", required = false) List<Double> floorCapacities) { @RequestParam(value = "floorCapacity", required = false) List<Double> floorCapacities) {
@ -235,6 +236,7 @@ public class HQAPIController {
hallDetails.setGst(gst); hallDetails.setGst(gst);
hallDetails.setCity(city); hallDetails.setCity(city);
hallDetails.setActive(isActive); hallDetails.setActive(isActive);
hallDetails.setMfDtUnit(mfDtUnit);
hallDetailService.updateHallDetail(hallDetails, images); hallDetailService.updateHallDetail(hallDetails, images);

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

@ -1101,13 +1101,14 @@ public class HeadquartersController {
@RequestParam("hallImages") MultipartFile[] hallImages, @RequestParam("hallImages") MultipartFile[] hallImages,
@RequestParam(value = "floorName", required = false) List<String> floorNames, @RequestParam(value = "floorName", required = false) List<String> floorNames,
@RequestParam(value = "floorCapacity", required = false) List<Double> floorCapacities, @RequestParam(value = "floorCapacity", required = false) List<Double> floorCapacities,
@RequestParam(value = "mfDtUnit", defaultValue = "1") int mfDtUnit,
HttpSession session) { HttpSession session) {
String updatedId = (String) session.getAttribute("employeeId"); String updatedId = (String) session.getAttribute("employeeId");
hallDetailService.saveHallByHQ(hallName, depositAmount, halfDayAmt, fullDayAmt, gst, hallArea, ebNumber, hallDetailService.saveHallByHQ(hallName, depositAmount, halfDayAmt, fullDayAmt, gst, hallArea, ebNumber,
ebCostPerUnit, parkingCapacity, seatingCapacity, doorNo, ebCostPerUnit, parkingCapacity, seatingCapacity, doorNo,
street, area, zone, division, landMark, city, pinCode, latitude, longitude, hallInchargeName, street, area, zone, division, landMark, city, pinCode, latitude, longitude, hallInchargeName,
hallInchargeNo, updatedId, hallImages, halfdepositAmt, floorNames, floorCapacities);
hallInchargeNo, updatedId, hallImages, halfdepositAmt, floorNames, floorCapacities, mfDtUnit);
return "redirect:/communityhall/headquarters/halldetailslist"; return "redirect:/communityhall/headquarters/halldetailslist";
} }

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

@ -1,7 +1,9 @@
package com.gcc.communityHall.controller; package com.gcc.communityHall.controller;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.URLEncoder;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.nio.charset.StandardCharsets;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
@ -471,10 +473,25 @@ public class OfficerAPIController {
+ "&entityid=1401572690000011081&templateid=1407172346485956648"; + "&entityid=1401572690000011081&templateid=1407172346485956648";
// String // String
// rejectedwhatsupmsg="https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="+bookingDetails.getUsers().getMobileNo()+"&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+booking+with+ID+"+bookingId+"+on+"+bookingDetails.getStartDate()+"+has+been+rejected+by+GCC+due+to+insufficient+details.+%0AThanks+for+using+GCC+Community+Hall+Booking+System."; // rejectedwhatsupmsg="https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="+bookingDetails.getUsers().getMobileNo()+"&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+booking+with+ID+"+bookingId+"+on+"+bookingDetails.getStartDate()+"+has+been+rejected+by+GCC+due+to+insufficient+details.+%0AThanks+for+using+GCC+Community+Hall+Booking+System.";
String rejectedwhatsupmsg = "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
+ bookingDetails.getUsers().getMobileNo()
+ "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+booking+with+ID+" + bookingId
+ "+on+" + bookingDetails.getStartDate() + "+has+been+rejected+by+GCC+due+to+insufficient+details.";
// String rejectedwhatsupmsg =
// "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
// + bookingDetails.getUsers().getMobileNo()
// +
// "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+booking+with+ID+"
// + bookingId
// + "+on+" + bookingDetails.getStartDate() +
// "+has+been+rejected+by+GCC+due+to+insufficient+details.";
String apikey = "5c995535-6244-11f0-98fc-02c8a5e042bd";
String from = "919445061913";
String placeholders = "";
placeholders = URLEncoder.encode(bookingId + "|~|" + bookingDetails.getStartDate(), StandardCharsets.UTF_8);
String rejectedwhatsupmsg = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?apikey=" + apikey + "&from="
+ from + "&to=91" + bookingDetails.getUsers().getMobileNo() + ""
+ "&type=template&templateid=3315271&placeholders=" + placeholders + "";
whatsappMsgServiceImpl.sendMsg(rejectedwhatsupmsg); whatsappMsgServiceImpl.sendMsg(rejectedwhatsupmsg);
whatsappMsgServiceImpl.sendSMS(rejectedurlString); whatsappMsgServiceImpl.sendSMS(rejectedurlString);
String adminname = (String) session.getAttribute("usertype"); String adminname = (String) session.getAttribute("usertype");

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

@ -3,6 +3,7 @@ package com.gcc.communityHall.controller;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.net.URLEncoder;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
@ -232,8 +233,8 @@ public class UserAPIController {
// System.out.println(purpose); // System.out.println(purpose);
// System.out.print("\n MobileNo---:"+mobileNo); // System.out.print("\n MobileNo---:"+mobileNo);
Random rand = new Random(); Random rand = new Random();
int otp = rand.nextInt(90000) + 10000;
// int otp = 11111;
// int otp = rand.nextInt(90000) + 10000;
int otp = 11111;
System.out.print("\n otp---:" + otp); System.out.print("\n otp---:" + otp);
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd-MMM-yyyy%20HH:mm"); DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd-MMM-yyyy%20HH:mm");
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
@ -247,28 +248,29 @@ public class UserAPIController {
System.out.println("\n urlString---: " + urlString); System.out.println("\n urlString---: " + urlString);
String bodyMessage = "" + otp; String bodyMessage = "" + otp;
try {
RestTemplate restTemplate = new RestTemplate();
String Response = restTemplate.getForObject(urlString, String.class);
bodyMessage = Response;
SmsSender sms = new SmsSender();
sms.setPhone(MobileNo);
sms.setCdate(new Date());
sms.setBodyMsg(bodyMessage);
sms.setPurpose(purpose);
smsSenderRepository.save(sms);
String whatsappMsg = "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
+ MobileNo
+
"&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Welcome+to+GCC%21+%0A%0AYour+OTP+for+GCC+Community+Centre+is+"
+ otp + "+.";
String sendMsg = whatsappMsgServiceImpl.sendMsg(whatsappMsg);
System.out.println("sendwhatsuprepsosne====" + sendMsg);
} catch (Exception e) {
// System.out.print("ERROR in Sending---: "+e);
bodyMessage = "Error";
}
// try {
// RestTemplate restTemplate = new RestTemplate();
// String Response = restTemplate.getForObject(urlString, String.class);
// bodyMessage = Response;
// SmsSender sms = new SmsSender();
// sms.setPhone(MobileNo);
// sms.setCdate(new Date());
// sms.setBodyMsg(bodyMessage);
// sms.setPurpose(purpose);
// smsSenderRepository.save(sms);
// String whatsappMsg =
// "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
// + MobileNo
// +
// "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Welcome+to+GCC%21+%0A%0AYour+OTP+for+GCC+Community+Centre+is+"
// + otp + "+.";
// String sendMsg = whatsappMsgServiceImpl.sendMsg(whatsappMsg);
// System.out.println("sendwhatsuprepsosne====" + sendMsg);
// } catch (Exception e) {
// // System.out.print("ERROR in Sending---: "+e);
// bodyMessage = "Error";
// }
HttpSession session = request.getSession(); HttpSession session = request.getSession();
session.setAttribute("otp", otp); session.setAttribute("otp", otp);
@ -1066,11 +1068,26 @@ public class UserAPIController {
String cancelledurlString = "https://tmegov.onex-aura.com/api/sms?key=pfTEYN6H&to=" String cancelledurlString = "https://tmegov.onex-aura.com/api/sms?key=pfTEYN6H&to="
+ bookingDetails.getUsers().getMobileNo() + "&from=GCCCRP&body=" + cancelledbookingsms + bookingDetails.getUsers().getMobileNo() + "&from=GCCCRP&body=" + cancelledbookingsms
+ "&entityid=1401572690000011081&templateid=1407172346829376988"; + "&entityid=1401572690000011081&templateid=1407172346829376988";
String cancelledwhatsupmsg = "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
+ bookingDetails.getUsers().getMobileNo()
+ "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+booking+with+ID+" + bookingId
+ "+on+" + bookingDetails.getStartDate()
+ "+has+been+cancelled+successfully.+%0AThe+deposit+amount+will+be+refunded+to+your+account+within+3+to+15+days.";
String apikey = "5c995535-6244-11f0-98fc-02c8a5e042bd";
String from = "919445061913";
String placeholders = "";
placeholders = URLEncoder.encode(bookingId + "|~|" + bookingDetails.getStartDate(), "UTF-8");
String cancelledwhatsupmsg = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?apikey=" + apikey + "&from="
+ from + "&to=91" + bookingDetails.getUsers().getMobileNo() +
"&type=template&templateid=3315277&placeholders=" + placeholders;
// String cancelledwhatsupmsg =
// "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
// + bookingDetails.getUsers().getMobileNo()
// +
// "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+booking+with+ID+"
// + bookingId
// + "+on+" + bookingDetails.getStartDate()
// +
// "+has+been+cancelled+successfully.+%0AThe+deposit+amount+will+be+refunded+to+your+account+within+3+to+15+days.";
whatsappMsgServiceImpl.sendMsg(cancelledwhatsupmsg); whatsappMsgServiceImpl.sendMsg(cancelledwhatsupmsg);
whatsappMsgServiceImpl.sendSMS(cancelledurlString); whatsappMsgServiceImpl.sendSMS(cancelledurlString);
Optional<BookingDetails> book = bookingDetailsRepository.findById(bookingDetails.getBookingId()); Optional<BookingDetails> book = bookingDetailsRepository.findById(bookingDetails.getBookingId());

41
src/main/java/com/gcc/communityHall/controller/UserController.java

@ -1,5 +1,7 @@
package com.gcc.communityHall.controller; package com.gcc.communityHall.controller;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
@ -241,14 +243,30 @@ public class UserController {
System.out.println("usetrtype==" + user.getUsertype().toString()); System.out.println("usetrtype==" + user.getUsertype().toString());
// System.out.println("employee id"+user.getGovernmentId()); // System.out.println("employee id"+user.getGovernmentId());
// System.out.println("employee id"+user.getDepartment()); // System.out.println("employee id"+user.getDepartment());
String apikey = "5c995535-6244-11f0-98fc-02c8a5e042bd";
String from = "919445061913";
String placeholders = "";
String mobileNo = String.valueOf(user.getMobileNo());
System.out.println("mobileNo>>>>>>>>>>>" + mobileNo);
if (user.getUsertype() == userType.PUBLIC) { if (user.getUsertype() == userType.PUBLIC) {
String registersms = "Welcome to GCC, Your User Registration for booking Community Centre is successful."; String registersms = "Welcome to GCC, Your User Registration for booking Community Centre is successful.";
String registerurlString = "https://tmegov.onex-aura.com/api/sms?key=pfTEYN6H&to=" + user.getMobileNo() String registerurlString = "https://tmegov.onex-aura.com/api/sms?key=pfTEYN6H&to=" + user.getMobileNo()
+ "&from=GCCCRP&body=" + registersms + "&from=GCCCRP&body=" + registersms
+ "&entityid=1401572690000011081&templateid=1407172346621223019"; + "&entityid=1401572690000011081&templateid=1407172346621223019";
String registerwhatsupmsg = "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
+ user.getMobileNo()
+ "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Welcome+to+GCC%2C+%0A%0AYour+User+Registration+for+booking+Community+Centre+is+successful.";
placeholders = URLEncoder.encode(mobileNo, StandardCharsets.UTF_8);
String registerwhatsupmsg = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?apikey=" + apikey + "&from="
+ from + "&to=91" + user.getMobileNo() + ""
+ "&type=template&templateid=3315165 ";
// String registerwhatsupmsg =
// "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
// + user.getMobileNo()
// +
// "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Welcome+to+GCC%2C+%0A%0AYour+User+Registration+for+booking+Community+Centre+is+successful.";
whatsappMsgServiceImpl.sendMsg(registerwhatsupmsg); whatsappMsgServiceImpl.sendMsg(registerwhatsupmsg);
whatsappMsgServiceImpl.sendSMS(registerurlString); whatsappMsgServiceImpl.sendSMS(registerurlString);
} else { } else {
@ -256,9 +274,20 @@ public class UserController {
String registerpendingurlString = "https://tmegov.onex-aura.com/api/sms?key=pfTEYN6H&to=" String registerpendingurlString = "https://tmegov.onex-aura.com/api/sms?key=pfTEYN6H&to="
+ user.getMobileNo() + "&from=GCCCRP&body=" + registerpendingsms + user.getMobileNo() + "&from=GCCCRP&body=" + registerpendingsms
+ "&entityid=1401572690000011081&templateid=1407172346629919381"; + "&entityid=1401572690000011081&templateid=1407172346629919381";
String registerpendingwhatsupmsg = "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
+ user.getMobileNo()
+ "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Welcome+to+GCC%2C+%0A%0AYour+User+Registration+request+for+booking+Community+Centre+submitted+successfully.";
placeholders = URLEncoder.encode(mobileNo, StandardCharsets.UTF_8);
String registerpendingwhatsupmsg = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?apikey=" + apikey
+ "&from="
+ from + "&to=91" + user.getMobileNo() + ""
+ "&type=template&templateid=3315168 ";
// String registerpendingwhatsupmsg =
// "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
// + user.getMobileNo()
// +
// "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Welcome+to+GCC%2C+%0A%0AYour+User+Registration+request+for+booking+Community+Centre+submitted+successfully.";
whatsappMsgServiceImpl.sendMsg(registerpendingwhatsupmsg); whatsappMsgServiceImpl.sendMsg(registerpendingwhatsupmsg);
whatsappMsgServiceImpl.sendSMS(registerpendingurlString); whatsappMsgServiceImpl.sendSMS(registerpendingurlString);
} }

11
src/main/java/com/gcc/communityHall/entity/HallDetails.java

@ -92,6 +92,9 @@ public class HallDetails {
@Column(name = "is_reason_restricted", nullable = false, columnDefinition = "BOOLEAN DEFAULT false") @Column(name = "is_reason_restricted", nullable = false, columnDefinition = "BOOLEAN DEFAULT false")
private boolean isReasonRestricted = false; private boolean isReasonRestricted = false;
@Column(name = "mf_dt_unit", columnDefinition = "INT DEFAULT 1")
private int MfDtUnit = 1;
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "hallDetails") @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "hallDetails")
@JsonIgnore @JsonIgnore
private List<HallReasonRestriction> hallReasonRestrictions; private List<HallReasonRestriction> hallReasonRestrictions;
@ -404,4 +407,12 @@ public class HallDetails {
this.halfDepositAmount = halfDepositAmount; this.halfDepositAmount = halfDepositAmount;
} }
public int getMfDtUnit() {
return MfDtUnit;
}
public void setMfDtUnit(int MfDtUnit) {
this.MfDtUnit = MfDtUnit;
}
} }

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

@ -398,7 +398,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
+ " WHEN bd.booking_status = 'WAITING_FOR_NOC' THEN 'waitingfornoc'\r" + " WHEN bd.booking_status = 'WAITING_FOR_NOC' THEN 'waitingfornoc'\r"
+ " WHEN bd.booking_status = 'WAITING_FOR_NOC_APPROVAL' THEN 'waitingfornocapproval'\r" + " WHEN bd.booking_status = 'WAITING_FOR_NOC_APPROVAL' THEN 'waitingfornocapproval'\r"
+ " WHEN bd.schedule_count = 0 AND bd.start_date > CURDATE() THEN 'Reschedule'\r" + " WHEN bd.schedule_count = 0 AND bd.start_date > CURDATE() THEN 'Reschedule'\r"
+ " WHEN bd.reason IN ('State Govt Event','Central Govt Event','Commericial & Others') AND bd.booking_status='APPROVED' THEN 'noaction'"
+ " WHEN bd.reason IN ('State Govt Event','Central Govt Event','Commericial & Others') AND bd.booking_status='APPROVED' THEN 'noaction'"
+ " ELSE 'Future' \r" + " ELSE 'Future' \r"
+ " END AS event_category,\r" + " END AS event_category,\r"
+ " users.*, \r" + " users.*, \r"

17
src/main/java/com/gcc/communityHall/repository/BookingDocumentsRepository.java

@ -1,19 +1,26 @@
package com.gcc.communityHall.repository; package com.gcc.communityHall.repository;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Modifying;
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 org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import com.gcc.communityHall.entity.BookingDetails;
import com.gcc.communityHall.entity.BookingDocuments; import com.gcc.communityHall.entity.BookingDocuments;
@Repository @Repository
public interface BookingDocumentsRepository extends JpaRepository<BookingDocuments,Integer> {
public interface BookingDocumentsRepository extends JpaRepository<BookingDocuments, Integer> {
@Transactional @Transactional
@Modifying @Modifying
@Query(value="delete from booking_documents where booking_details_booking_id = :bookingId",nativeQuery=true)
public void deleteByBookingId(int bookingId);
@Query(value = "delete from booking_documents where booking_details_booking_id = :bookingId", nativeQuery = true)
public void deleteByBookingId(@Param("bookingId") int bookingId);
@Query(value = "select * from booking_documents where booking_details_booking_id = :bookingId order by booking_doc_id asc", nativeQuery = true)
public List<BookingDocuments> findByBookingId(@Param("bookingId") int bookingId);
} }

40
src/main/java/com/gcc/communityHall/service/HallDetailService.java

@ -18,6 +18,22 @@ public interface HallDetailService {
HallDetails deActivateHallById(int hallId); HallDetails deActivateHallById(int hallId);
// HallDetails saveHallByAdmin(
// String hallName,
// float depositAmount,
// float halfDayAmt, float fullDayAmt,
// float gst, float hallArea, String ebNumber, float ebCostPerUnit,
// String parkingCapacity, int seatingCapacity,
// String doorNo, String street,
// String area, String zone,
// String division, String landMark,
// String city,
// int pinCode, String latitude,
// String longitude, String hallInchargeName,
// long hallInchargeNo,
// String updatedId,
// MultipartFile hallImages[], float halfDepositAmt);
HallDetails saveHallByAdmin( HallDetails saveHallByAdmin(
String hallName, String hallName,
float depositAmount, float depositAmount,
@ -32,9 +48,28 @@ public interface HallDetailService {
String longitude, String hallInchargeName, String longitude, String hallInchargeName,
long hallInchargeNo, long hallInchargeNo,
String updatedId, String updatedId,
MultipartFile hallImages[], float halfDepositAmt);
MultipartFile hallImages[], float halfDepositAmt,
int mfDtUnit);
/** HQ-specific overload that also persists floor details. */ /** HQ-specific overload that also persists floor details. */
// HallDetails saveHallByHQ(
// String hallName,
// float depositAmount,
// float halfDayAmt, float fullDayAmt,
// float gst, float hallArea, String ebNumber, float ebCostPerUnit,
// String parkingCapacity, int seatingCapacity,
// String doorNo, String street,
// String area, String zone,
// String division, String landMark,
// String city,
// int pinCode, String latitude,
// String longitude, String hallInchargeName,
// long hallInchargeNo,
// String updatedId,
// MultipartFile[] hallImages, float halfDepositAmt,
// List<String> floorNames, List<Double> floorCapacities);
/** HQ-specific overload that also persists floor details and mfDtUnit. */
HallDetails saveHallByHQ( HallDetails saveHallByHQ(
String hallName, String hallName,
float depositAmount, float depositAmount,
@ -50,7 +85,8 @@ public interface HallDetailService {
long hallInchargeNo, long hallInchargeNo,
String updatedId, String updatedId,
MultipartFile[] hallImages, float halfDepositAmt, MultipartFile[] hallImages, float halfDepositAmt,
List<String> floorNames, List<Double> floorCapacities);
List<String> floorNames, List<Double> floorCapacities,
int mfDtUnit);
/** Replaces floor details for an existing hall (delete-and-re-insert). */ /** Replaces floor details for an existing hall (delete-and-re-insert). */
void updateFloorDetails(int hallId, List<String> floorNames, List<Double> floorCapacities); void updateFloorDetails(int hallId, List<String> floorNames, List<Double> floorCapacities);

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

@ -5,6 +5,8 @@ import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDate; import java.time.LocalDate;
@ -480,6 +482,10 @@ public class BookingServiceImpl implements BookingService {
String bookingconfirmationmsg, urlString, whatsupmsg; String bookingconfirmationmsg, urlString, whatsupmsg;
String apikey = "5c995535-6244-11f0-98fc-02c8a5e042bd";
String from = "919445061913";
String placeholders = "";
if (reasonCode.equals("CGE") || reasonCode.equals("CAO") || reasonCode.equals("SGE")) { if (reasonCode.equals("CGE") || reasonCode.equals("CAO") || reasonCode.equals("SGE")) {
updateBookingStatusById(bookingDetails.getBookingId(), BookingDetails.BookingStatus.WAITING_FOR_NOC, updateBookingStatusById(bookingDetails.getBookingId(), BookingDetails.BookingStatus.WAITING_FOR_NOC,
"Waiting For NOC Documents"); "Waiting For NOC Documents");
@ -517,12 +523,21 @@ public class BookingServiceImpl implements BookingService {
"&from=GCCCRP&body=" + bookingconfirmationmsg "&from=GCCCRP&body=" + bookingconfirmationmsg
+ "&entityid=1401572690000011081&templateid=1407172346459428987"; + "&entityid=1401572690000011081&templateid=1407172346459428987";
whatsupmsg = "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
+
bookingDetails.getUsers().getMobileNo() +
"&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+booking+with+ID+" +
bookingDetails.getBookingId() + "+on+" + bookingDetails.getStartDate() +
"+has+been+successfully+confirmed.+%0AThanks+for+using+GCC+Community+Hall+Booking+System.";
placeholders = URLEncoder.encode(bookingDetails.getBookingId() + "|~|" + bookingDetails.getStartDate(),
"UTF-8");
whatsupmsg = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?apikey=" + apikey + "&from="
+ from + "&to=91" + bookingDetails.getUsers().getMobileNo() + ""
+ "&type=template&templateid=3315197&placeholders=" + placeholders + "";
// whatsupmsg =
// "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
// +
// bookingDetails.getUsers().getMobileNo() +
// "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+booking+with+ID+"
// +
// bookingDetails.getBookingId() + "+on+" + bookingDetails.getStartDate() +
// "+has+been+successfully+confirmed.+%0AThanks+for+using+GCC+Community+Hall+Booking+System.";
whatsappMsgServiceImpl.sendMsg(whatsupmsg); whatsappMsgServiceImpl.sendMsg(whatsupmsg);
whatsappMsgServiceImpl.sendSMS(urlString); whatsappMsgServiceImpl.sendSMS(urlString);
@ -1465,7 +1480,8 @@ public class BookingServiceImpl implements BookingService {
double usedUnit = Math.floor((endUnit - startReading) * 100) / 100.0; double usedUnit = Math.floor((endUnit - startReading) * 100) / 100.0;
ed.setUsedUnit(Float.parseFloat(usedUnit + "")); ed.setUsedUnit(Float.parseFloat(usedUnit + ""));
float costPerUnit = bd.getHallDetails().getEbCostPerUnit(); float costPerUnit = bd.getHallDetails().getEbCostPerUnit();
double ebAmount = Math.floor((usedUnit * costPerUnit) * 100) / 100.0;
int mfDtUnit = bd.getHallDetails().getMfDtUnit();
double ebAmount = Math.floor((usedUnit * mfDtUnit * costPerUnit) * 100) / 100.0;
ed.setEbAmount(ebAmount); ed.setEbAmount(ebAmount);
ed.setUpdatedDate(new Date()); ed.setUpdatedDate(new Date());
return ebDetailsRepository.save(ed); return ebDetailsRepository.save(ed);
@ -2024,12 +2040,29 @@ public class BookingServiceImpl implements BookingService {
String settlementrefundurlString = "https://tmegov.onex-aura.com/api/sms?key=pfTEYN6H&to=" String settlementrefundurlString = "https://tmegov.onex-aura.com/api/sms?key=pfTEYN6H&to="
+ bookings.getUsers().getMobileNo() + "&from=GCCCRP&body=" + settlementrefundsms + bookings.getUsers().getMobileNo() + "&from=GCCCRP&body=" + settlementrefundsms
+ "&entityid=1401572690000011081&templateid=1407172346804951524"; + "&entityid=1401572690000011081&templateid=1407172346804951524";
String settlementrefundwhatsupmsg = "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
+ bookingDetails.getUsers().getMobileNo()
+ "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+refund+of+Rs.+"
+ bookingDetails.getSettlement().getRefundedAmount() + "+for+Booking+ID+"
+ bookingDetails.getBookingId()
+ "+has+been+initiated.+%0AThe+amount+will+be+credited+to+your+account+within+3+to+15+days.";
String apikey = "5c995535-6244-11f0-98fc-02c8a5e042bd";
String from = "919445061913";
String placeholders = "";
placeholders = URLEncoder.encode(
bookingDetails.getBookingId() + "|~|" + bookingDetails.getSettlement().getRefundedAmount(),
"UTF-8");
String settlementrefundwhatsupmsg = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?apikey=" + apikey
+ "&from="
+ from + "&to=91" + bookingDetails.getUsers().getMobileNo() + ""
+ "&type=template&templateid=3315255&placeholders=" + placeholders + "";
// String settlementrefundwhatsupmsg =
// "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
// + bookingDetails.getUsers().getMobileNo()
// +
// "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+refund+of+Rs.+"
// + bookingDetails.getSettlement().getRefundedAmount() + "+for+Booking+ID+"
// + bookingDetails.getBookingId()
// +
// "+has+been+initiated.+%0AThe+amount+will+be+credited+to+your+account+within+3+to+15+days.";
whatsappMsgServiceImpl.sendMsg(settlementrefundwhatsupmsg); whatsappMsgServiceImpl.sendMsg(settlementrefundwhatsupmsg);
whatsappMsgServiceImpl.sendSMS(settlementrefundurlString); whatsappMsgServiceImpl.sendSMS(settlementrefundurlString);
return true; return true;
@ -2054,11 +2087,28 @@ public class BookingServiceImpl implements BookingService {
String rejectedrefundurlString = "https://tmegov.onex-aura.com/api/sms?key=pfTEYN6H&to=" String rejectedrefundurlString = "https://tmegov.onex-aura.com/api/sms?key=pfTEYN6H&to="
+ rejectedbookings.getUsers().getMobileNo() + "&from=GCCCRP&body=" + rejectedsms + rejectedbookings.getUsers().getMobileNo() + "&from=GCCCRP&body=" + rejectedsms
+ "&entityid=1401572690000011081&templateid=1407172346804951524"; + "&entityid=1401572690000011081&templateid=1407172346804951524";
String settlementrefundwhatsupmsg = "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
+ bookingDetails.getUsers().getMobileNo()
+ "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+refund+of+Rs.+"
+ bookingDetails.getAmountReceived() + "+for+Booking+ID+" + bookingDetails.getBookingId()
+ "+has+been+initiated.+%0AThe+amount+will+be+credited+to+your+account+within+3+to+15+days.";
String apikey = "5c995535-6244-11f0-98fc-02c8a5e042bd";
String from = "919445061913";
String placeholders = "";
placeholders = URLEncoder
.encode(bookingDetails.getBookingId() + "|~|" + bookingDetails.getAmountReceived(), "UTF-8");
String settlementrefundwhatsupmsg = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?apikey=" + apikey
+ "&from="
+ from + "&to=91" + bookingDetails.getUsers().getMobileNo() + ""
+ "&type=template&templateid=3315255&placeholders=" + placeholders + "";
// String settlementrefundwhatsupmsg =
// "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
// + bookingDetails.getUsers().getMobileNo()
// +
// "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+refund+of+Rs.+"
// + bookingDetails.getAmountReceived() + "+for+Booking+ID+" +
// bookingDetails.getBookingId()
// +
// "+has+been+initiated.+%0AThe+amount+will+be+credited+to+your+account+within+3+to+15+days.";
whatsappMsgServiceImpl.sendMsg(settlementrefundwhatsupmsg); whatsappMsgServiceImpl.sendMsg(settlementrefundwhatsupmsg);
whatsappMsgServiceImpl.sendSMS(rejectedrefundurlString); whatsappMsgServiceImpl.sendSMS(rejectedrefundurlString);
return true; return true;
@ -2085,11 +2135,28 @@ public class BookingServiceImpl implements BookingService {
String cancelledrefundurlString = "https://tmegov.onex-aura.com/api/sms?key=pfTEYN6H&to=" String cancelledrefundurlString = "https://tmegov.onex-aura.com/api/sms?key=pfTEYN6H&to="
+ cancelledbookings.getUsers().getMobileNo() + "&from=GCCCRP&body=" + cancelledsms + cancelledbookings.getUsers().getMobileNo() + "&from=GCCCRP&body=" + cancelledsms
+ "&entityid=1401572690000011081&templateid=1407172346804951524"; + "&entityid=1401572690000011081&templateid=1407172346804951524";
String settlementrefundwhatsupmsg = "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
+ bookingDetails.getUsers().getMobileNo()
+ "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+refund+of+Rs.+"
+ bookingDetails.getDepositAmount() + "+for+Booking+ID+" + bookingDetails.getBookingId()
+ "+has+been+initiated.+%0AThe+amount+will+be+credited+to+your+account+within+3+to+15+days.";
String apikey = "5c995535-6244-11f0-98fc-02c8a5e042bd";
String from = "919445061913";
String placeholders = "";
placeholders = URLEncoder
.encode(bookingDetails.getBookingId() + "|~|" + bookingDetails.getDepositAmount(), "UTF-8");
String settlementrefundwhatsupmsg = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?apikey=" + apikey
+ "&from="
+ from + "&to=91" + bookingDetails.getUsers().getMobileNo() + ""
+ "&type=template&templateid=3315255&placeholders=" + placeholders + "";
// String settlementrefundwhatsupmsg =
// "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
// + bookingDetails.getUsers().getMobileNo()
// +
// "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+refund+of+Rs.+"
// + bookingDetails.getDepositAmount() + "+for+Booking+ID+" +
// bookingDetails.getBookingId()
// +
// "+has+been+initiated.+%0AThe+amount+will+be+credited+to+your+account+within+3+to+15+days.";
whatsappMsgServiceImpl.sendMsg(settlementrefundwhatsupmsg); whatsappMsgServiceImpl.sendMsg(settlementrefundwhatsupmsg);
whatsappMsgServiceImpl.sendSMS(cancelledrefundurlString); whatsappMsgServiceImpl.sendSMS(cancelledrefundurlString);
return true; return true;
@ -2282,17 +2349,31 @@ public class BookingServiceImpl implements BookingService {
// transactionManager.rollback(status); // transactionManager.rollback(status);
updateResheduledBookingDetails(bookingId, startDat, endDat); updateResheduledBookingDetails(bookingId, startDat, endDat);
String apikey = "5c995535-6244-11f0-98fc-02c8a5e042bd";
String from = "919445061913";
String placeholders = "";
String rescheduledmsg = "Your booking ID " + bookingId + " on " + starting String rescheduledmsg = "Your booking ID " + bookingId + " on " + starting
+ " has been successfully rescheduled to " + startDate + " has been successfully rescheduled to " + startDate
+ ". Thanks for using the GCC Community Hall Booking System."; + ". Thanks for using the GCC Community Hall Booking System.";
String urlString = "https://tmegov.onex-aura.com/api/sms?key=pfTEYN6H&to=" String urlString = "https://tmegov.onex-aura.com/api/sms?key=pfTEYN6H&to="
+ bookingDetails.getUsers().getMobileNo() + "&from=GCCCRP&body=" + rescheduledmsg + bookingDetails.getUsers().getMobileNo() + "&from=GCCCRP&body=" + rescheduledmsg
+ "&entityid=1401572690000011081&templateid=1407172346565044999"; + "&entityid=1401572690000011081&templateid=1407172346565044999";
String rescheduleMsg = "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
+ bookingDetails.getUsers().getMobileNo()
+ "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+booking+with+ID+" + bookingId
+ "+on+" + starting + "+has+been+successfully+rescheduled+to+" + startDate
+ "+.+%0AThank+you+for+using+the+GCC+Community+Hall+Booking+System.";
placeholders = URLEncoder.encode(bookingId + "|~|" + starting + "|~|" + startDate, StandardCharsets.UTF_8);
String rescheduleMsg = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?apikey=" + apikey + "&from="
+ from + "&to=91" + bookingDetails.getUsers().getMobileNo() + ""
+ "&type=template&templateid=3315236&placeholders=" + placeholders + "";
// String rescheduleMsg =
// "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
// + bookingDetails.getUsers().getMobileNo()
// +
// "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+booking+with+ID+"
// + bookingId
// + "+on+" + starting + "+has+been+successfully+rescheduled+to+" + startDate
// + "+.+%0AThank+you+for+using+the+GCC+Community+Hall+Booking+System.";
whatsappMsgServiceImpl.sendMsg(rescheduleMsg); whatsappMsgServiceImpl.sendMsg(rescheduleMsg);
whatsappMsgServiceImpl.sendSMS(urlString); whatsappMsgServiceImpl.sendSMS(urlString);
return Optional.of("Booking dates updated successfully."); return Optional.of("Booking dates updated successfully.");
@ -2415,17 +2496,31 @@ public class BookingServiceImpl implements BookingService {
// Persist new dates and slots // Persist new dates and slots
updateResheduledBookingDetails(bookingId, startDat, endDat, startingSlot, endingSlot); updateResheduledBookingDetails(bookingId, startDat, endDat, startingSlot, endingSlot);
String apikey = "5c995535-6244-11f0-98fc-02c8a5e042bd";
String from = "919445061913";
String placeholders = "";
String rescheduledmsg = "Your booking ID " + bookingId + " on " + starting String rescheduledmsg = "Your booking ID " + bookingId + " on " + starting
+ " has been successfully rescheduled to " + startDate + " has been successfully rescheduled to " + startDate
+ ". Thanks for using the GCC Community Hall Booking System."; + ". Thanks for using the GCC Community Hall Booking System.";
String urlString = "https://tmegov.onex-aura.com/api/sms?key=pfTEYN6H&to=" String urlString = "https://tmegov.onex-aura.com/api/sms?key=pfTEYN6H&to="
+ bookingDetails.getUsers().getMobileNo() + "&from=GCCCRP&body=" + rescheduledmsg + bookingDetails.getUsers().getMobileNo() + "&from=GCCCRP&body=" + rescheduledmsg
+ "&entityid=1401572690000011081&templateid=1407172346565044999"; + "&entityid=1401572690000011081&templateid=1407172346565044999";
String rescheduleMsg = "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
+ bookingDetails.getUsers().getMobileNo()
+ "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+booking+with+ID+" + bookingId
+ "+on+" + starting + "+has+been+successfully+rescheduled+to+" + startDate
+ "+.+%0AThank+you+for+using+the+GCC+Community+Hall+Booking+System.";
placeholders = URLEncoder.encode(bookingId + "|~|" + starting + "|~|" + startDate, StandardCharsets.UTF_8);
String rescheduleMsg = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?apikey=" + apikey + "&from="
+ from + "&to=91" + bookingDetails.getUsers().getMobileNo() + ""
+ "&type=template&templateid=3315236&placeholders=" + placeholders + "";
// String rescheduleMsg =
// "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
// + bookingDetails.getUsers().getMobileNo()
// +
// "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+booking+with+ID+"
// + bookingId
// + "+on+" + starting + "+has+been+successfully+rescheduled+to+" + startDate
// + "+.+%0AThank+you+for+using+the+GCC+Community+Hall+Booking+System.";
whatsappMsgServiceImpl.sendMsg(rescheduleMsg); whatsappMsgServiceImpl.sendMsg(rescheduleMsg);
whatsappMsgServiceImpl.sendSMS(urlString); whatsappMsgServiceImpl.sendSMS(urlString);
return Optional.of("Booking dates updated successfully."); return Optional.of("Booking dates updated successfully.");
@ -2673,11 +2768,27 @@ public class BookingServiceImpl implements BookingService {
+ "&entityid=1401572690000011081&templateid=1407172346521513227"; + "&entityid=1401572690000011081&templateid=1407172346521513227";
// String // String
// gccblockedwhatsupmsg="https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="+booking.getUsers().getMobileNo()+"&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+booking+with+ID+"+booking.getBookingId()+"+on+"+booking.getBookingDate()+"+has+been+blocked+by+GCC+due+to+"+reasonforblocking+".+%0AThanks+for+using+GCC+Community+Hall+Booking+System."; // gccblockedwhatsupmsg="https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="+booking.getUsers().getMobileNo()+"&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+booking+with+ID+"+booking.getBookingId()+"+on+"+booking.getBookingDate()+"+has+been+blocked+by+GCC+due+to+"+reasonforblocking+".+%0AThanks+for+using+GCC+Community+Hall+Booking+System.";
String gccblockedwhatsupmsg = "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
+ booking.getUsers().getMobileNo()
+ "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+booking+with+ID+"
+ booking.getBookingId() + "+on+" + booking.getStartDate()
+ "+has+been+blocked+by+the+GCC+due+to+Goverment+event++.+%0AThe+entire+amount+paid+will+be+refunded+to+your+account+within+3+to+15+days.";
String apikey = "5c995535-6244-11f0-98fc-02c8a5e042bd";
String from = "919445061913";
String placeholders = "";
placeholders = URLEncoder.encode(booking.getBookingId() + "|~|" + booking.getStartDate(),
StandardCharsets.UTF_8);
String gccblockedwhatsupmsg = "https://sendapiv1.pinbot.ai/pinwa/sendMessage?apikey=" + apikey
+ "&from="
+ from + "&to=91" + booking.getUsers().getMobileNo() + ""
+ "&type=template&templateid=3315251&placeholders=" + placeholders + "";
// String gccblockedwhatsupmsg =
// "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to="
// + booking.getUsers().getMobileNo()
// +
// "&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+booking+with+ID+"
// + booking.getBookingId() + "+on+" + booking.getStartDate()
// +
// "+has+been+blocked+by+the+GCC+due+to+Goverment+event++.+%0AThe+entire+amount+paid+will+be+refunded+to+your+account+within+3+to+15+days.";
whatsappMsgServiceImpl.sendMsg(gccblockedwhatsupmsg); whatsappMsgServiceImpl.sendMsg(gccblockedwhatsupmsg);
whatsappMsgServiceImpl.sendSMS(gccblockedurlString); whatsappMsgServiceImpl.sendSMS(gccblockedurlString);
bookingDetailsRepository.save(booking); bookingDetailsRepository.save(booking);

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

@ -72,6 +72,25 @@ public class HallDetailServiceImpl implements HallDetailService {
return null; return null;
} }
// @Override
// public HallDetails saveHallByAdmin(
// String hallName, float depositAmount, float halfDayAmt,
// float fullDayAmt, float gst, float hallArea, String ebNumber, float
// ebCostPerUnit,
// String parkingCapacity, int seatingCapacity,
// String doorNo, String street, String area, String zone,
// String division, String landMark, String city, int pinCode,
// String latitude, String longitude, String hallInchargeName,
// long hallInchargeNo, String updatedId, MultipartFile[] hallImages, float
// halfDepositAmt) {
// return saveHallByAdmin(hallName, depositAmount, halfDayAmt, fullDayAmt, gst,
// hallArea, ebNumber, ebCostPerUnit,
// parkingCapacity, seatingCapacity, doorNo, street, area, zone, division,
// landMark, city, pinCode,
// latitude, longitude, hallInchargeName, hallInchargeNo, updatedId, hallImages,
// halfDepositAmt, 1);
// }
@Override @Override
public HallDetails saveHallByAdmin( public HallDetails saveHallByAdmin(
String hallName, float depositAmount, float halfDayAmt, String hallName, float depositAmount, float halfDayAmt,
@ -80,7 +99,8 @@ public class HallDetailServiceImpl implements HallDetailService {
String doorNo, String street, String area, String zone, String doorNo, String street, String area, String zone,
String division, String landMark, String city, int pinCode, String division, String landMark, String city, int pinCode,
String latitude, String longitude, String hallInchargeName, String latitude, String longitude, String hallInchargeName,
long hallInchargeNo, String updatedId, MultipartFile[] hallImages, float halfDepositAmt) {
long hallInchargeNo, String updatedId, MultipartFile[] hallImages, float halfDepositAmt,
int mfDtUnit) {
HallDetails hall = new HallDetails(); HallDetails hall = new HallDetails();
hall.setHallName(hallName); hall.setHallName(hallName);
hall.setDoorNo(doorNo); hall.setDoorNo(doorNo);
@ -107,6 +127,7 @@ public class HallDetailServiceImpl implements HallDetailService {
hall.setUpdatedId(updatedId); hall.setUpdatedId(updatedId);
hall.setCreateddate(LocalDate.now()); hall.setCreateddate(LocalDate.now());
hall.setHalfDepositAmount(halfDepositAmt); hall.setHalfDepositAmount(halfDepositAmt);
hall.setMfDtUnit(mfDtUnit);
HallDetails hallDetails = hallDetailsRepository.save(hall); HallDetails hallDetails = hallDetailsRepository.save(hall);
if (hallImages != null && hallImages.length > 0) { if (hallImages != null && hallImages.length > 0) {
int i = 0; int i = 0;
@ -136,6 +157,31 @@ public class HallDetailServiceImpl implements HallDetailService {
/** /**
* HQ-specific overload: saves hall details + floor details in one call. * HQ-specific overload: saves hall details + floor details in one call.
*/ */
// @Override
// public HallDetails saveHallByHQ(
// String hallName, float depositAmount, float halfDayAmt,
// float fullDayAmt, float gst, float hallArea, String ebNumber, float
// ebCostPerUnit,
// String parkingCapacity, int seatingCapacity,
// String doorNo, String street, String area, String zone,
// String division, String landMark, String city, int pinCode,
// String latitude, String longitude, String hallInchargeName,
// long hallInchargeNo, String updatedId, MultipartFile[] hallImages, float
// halfDepositAmt,
// List<String> floorNames, List<Double> floorCapacities) {
// return saveHallByHQ(hallName, depositAmount, halfDayAmt, fullDayAmt, gst,
// hallArea, ebNumber, ebCostPerUnit,
// parkingCapacity, seatingCapacity, doorNo, street, area, zone, division,
// landMark, city, pinCode,
// latitude, longitude, hallInchargeName, hallInchargeNo, updatedId, hallImages,
// halfDepositAmt,
// floorNames, floorCapacities, 1);
// }
/**
* HQ-specific overload: saves hall details + floor details + mfDtUnit in one
* call.
*/
@Override @Override
public HallDetails saveHallByHQ( public HallDetails saveHallByHQ(
String hallName, float depositAmount, float halfDayAmt, String hallName, float depositAmount, float halfDayAmt,
@ -145,14 +191,15 @@ public class HallDetailServiceImpl implements HallDetailService {
String division, String landMark, String city, int pinCode, String division, String landMark, String city, int pinCode,
String latitude, String longitude, String hallInchargeName, String latitude, String longitude, String hallInchargeName,
long hallInchargeNo, String updatedId, MultipartFile[] hallImages, float halfDepositAmt, long hallInchargeNo, String updatedId, MultipartFile[] hallImages, float halfDepositAmt,
List<String> floorNames, List<Double> floorCapacities) {
List<String> floorNames, List<Double> floorCapacities,
int mfDtUnit) {
// Reuse the existing saveHall to persist the hall + images // Reuse the existing saveHall to persist the hall + images
saveHallByAdmin(hallName, depositAmount, halfDayAmt, fullDayAmt, gst, hallArea, saveHallByAdmin(hallName, depositAmount, halfDayAmt, fullDayAmt, gst, hallArea,
ebNumber, ebCostPerUnit, parkingCapacity, seatingCapacity, ebNumber, ebCostPerUnit, parkingCapacity, seatingCapacity,
doorNo, street, area, zone, division, landMark, city, pinCode, doorNo, street, area, zone, division, landMark, city, pinCode,
latitude, longitude, hallInchargeName, hallInchargeNo, latitude, longitude, hallInchargeName, hallInchargeNo,
updatedId, hallImages, halfDepositAmt);
updatedId, hallImages, halfDepositAmt, mfDtUnit);
// Fetch the just-saved hall to get its generated ID // Fetch the just-saved hall to get its generated ID
// (the hall is the most recently inserted one with this name) // (the hall is the most recently inserted one with this name)
@ -310,6 +357,7 @@ public class HallDetailServiceImpl implements HallDetailService {
existingHall.setEbCostPerUnit(hallDetails.getEbCostPerUnit()); existingHall.setEbCostPerUnit(hallDetails.getEbCostPerUnit());
existingHall.setActive(hallDetails.isActive()); existingHall.setActive(hallDetails.isActive());
existingHall.setEbNumber(hallDetails.getEbNumber()); existingHall.setEbNumber(hallDetails.getEbNumber());
existingHall.setMfDtUnit(hallDetails.getMfDtUnit());
// Update images // Update images
if (images != null) { if (images != null) {

423
src/main/resources/templates/admin/refund-failedlist.html

@ -74,7 +74,8 @@
<div class="block-content p-0"> <div class="block-content p-0">
<div class="p-sm-4 p-0"> <div class="p-sm-4 p-0">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-bordered table-striped table-vcenter js-dataTable-responsive" id="SettlementApprovedListTable">
<table class="table table-bordered table-striped table-vcenter js-dataTable-responsive"
id="SettlementApprovedListTable">
<thead class="thead-light"> <thead class="thead-light">
<tr> <tr>
<th>S.no</th> <th>S.no</th>
@ -131,7 +132,8 @@
<div class="block-content p-0"> <div class="block-content p-0">
<div class="p-sm-4 p-0"> <div class="p-sm-4 p-0">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-bordered table-striped table-vcenter js-dataTable-responsive" id="cancelledApprovedListTable">
<table class="table table-bordered table-striped table-vcenter js-dataTable-responsive"
id="cancelledApprovedListTable">
<thead class="thead-light"> <thead class="thead-light">
<tr> <tr>
<th>S.no</th> <th>S.no</th>
@ -155,8 +157,7 @@
<td class="text-center" th:text="${cancelledbookings.users.name}"></td> <td class="text-center" th:text="${cancelledbookings.users.name}"></td>
<td class="text-center" th:text="${cancelledbookings.users.usertype}"></td> <td class="text-center" th:text="${cancelledbookings.users.usertype}"></td>
<td class="text-center" th:text="${cancelledbookings.reason}"></td> <td class="text-center" th:text="${cancelledbookings.reason}"></td>
<td class="text-center"
th:text="${cancelledbookings.depositAmount}"></td>
<td class="text-center" th:text="${cancelledbookings.depositAmount}"></td>
<td> <td>
<p> <p>
<span class="badge bg-warning" style="cursor: pointer;" <span class="badge bg-warning" style="cursor: pointer;"
@ -179,7 +180,8 @@
<div class="block-content p-0"> <div class="block-content p-0">
<div class="p-sm-4 p-0"> <div class="p-sm-4 p-0">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-bordered table-striped table-vcenter js-dataTable-responsive" id="rejectedApprovedListTable">
<table class="table table-bordered table-striped table-vcenter js-dataTable-responsive"
id="rejectedApprovedListTable">
<thead class="thead-light"> <thead class="thead-light">
<tr> <tr>
<th>S.no</th> <th>S.no</th>
@ -365,49 +367,53 @@
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot: <th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:
</th> </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
<td colspan="3" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingSlot"></td> id="td_endingSlot"></td>
</tr> </tr>
</table>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="card-body">
<table>
<tr> <tr>
<th colspan="4" style="background-color: #f2f2f2;">EB
Details</th>
<th colspan="6" style="background-color: #f2f2f2;">EB Details</th>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem; text-align:center"
id="td_EBNumber"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer
Number:
</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_EBNumber">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per <th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per
Unit:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right"
Unit:
</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">MF DT Unit:
</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_mfDtUnit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading: <th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center"
<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">END Reading:
</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Unit Consumed: <th style="padding: 0.45rem 0.45rem;font-weight: normal">Unit Consumed:
</th> </th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right" id="td_usedunit">
</td>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_usedunit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right"
<td colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</table> </table>
@ -795,7 +801,7 @@
<!-- Scripts --> <!-- Scripts -->
<div th:replace="~{fragments/resetpassword :: div}"></div>
<div th:replace="~{fragments/resetpassword :: div}"></div>
<script th:replace="~{fragments/loginscript :: script}"></script> <script th:replace="~{fragments/loginscript :: script}"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
@ -803,7 +809,7 @@
<script> <script>
$(document).ready(function () {
$(document).ready(function () {
// DataTables buttons configuration // DataTables buttons configuration
var buttons = [ var buttons = [
{ {
@ -847,7 +853,7 @@ $(document).ready(function () {
$('#SettlementApprovedListTable').DataTable({ $('#SettlementApprovedListTable').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],
@ -866,7 +872,7 @@ $(document).ready(function () {
$('#cancelledApprovedListTable').DataTable({ $('#cancelledApprovedListTable').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],
@ -885,7 +891,7 @@ $(document).ready(function () {
$('#rejectedApprovedListTable').DataTable({ $('#rejectedApprovedListTable').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],
@ -982,6 +988,7 @@ $(document).ready(function () {
document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading; document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading;
document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit; document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit;
document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2); document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2);
document.getElementById("td_mfDtUnit").innerHTML = '₹ ' + parseFloat(list.hallDetails.mfDtUnit).toFixed(2);
document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2); document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2);
document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);
document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);
@ -1002,7 +1009,7 @@ $(document).ready(function () {
var tableResponsiveDiv = $('<div>').addClass('table-responsive').css('margin-right', '0px'); var tableResponsiveDiv = $('<div>').addClass('table-responsive').css('margin-right', '0px');
// 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>');
@ -1017,12 +1024,12 @@ $(document).ready(function () {
// 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;
@ -1123,7 +1130,7 @@ $(document).ready(function () {
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);
@ -1136,20 +1143,20 @@ $(document).ready(function () {
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 () {
showchallonimage(data.settlement.challon);
});
$('<td>').css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).append(challanImgLink).appendTo(row);
var challanImgLink = $('<a>').attr('href', 'javascript:void(0)').text('View Image').on('click', function () {
showchallonimage(data.settlement.challon);
});
$('<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);
@ -1172,7 +1179,7 @@ $(document).ready(function () {
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);
@ -1183,15 +1190,15 @@ $(document).ready(function () {
'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);
@ -1209,7 +1216,7 @@ $(document).ready(function () {
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');
} }
@ -1293,76 +1300,76 @@ $(document).ready(function () {
function accept() {
let id = document.getElementById("settlementid").value;
const acceptButton = document.getElementById("approvebutton"); // Add an ID to your button in the HTML
Swal.fire({
title: 'Do you want to Approve this Settlement?',
showDenyButton: true,
showCancelButton: true,
confirmButtonText: 'YES',
denyButtonText: 'NO',
}).then((result) => {
if (result.isConfirmed) {
// Disable the button to prevent multiple clicks
acceptButton.disabled = true;
// Show the loading screen
const loadingSwal = Swal.fire({
title: 'Processing...',
text: 'Please wait while we approve the settlement.',
allowOutsideClick: false, // Prevent closing the popup
didOpen: () => {
Swal.showLoading(); // Show the loading spinner
},
showConfirmButton: false, // Hide the confirm button during loading
});
$.ajax({
type: "POST",
url: '/communityhall/api/officer/updateApprovedSettlementStatus/' + id,
data: {
'status': 'APPROVED',
'comments': 'Accepted',
'settlementId': id
},
success: function (data, textStatus, xhr) {
loadingSwal.close(); // Close the loading popup
if (xhr.status === 200) {
Swal.fire(
'Done',
'Successfully Accepted to the ID: ' + id,
'success'
).then(() => {
location.reload(); // Reload the page after success
});
} else {
Swal.fire(
'Error',
'Failed to accept the user',
'error'
);
}
},
error: function (xhr, textStatus, errorThrown) {
loadingSwal.close(); // Close the loading popup
Swal.fire(
'Error',
'Failed to accept the user',
'error'
);
},
complete: function() {
// Re-enable the button after request completes (success or error)
acceptButton.disabled = false;
}
});
} else if (result.isDenied) {
Swal.fire('Changes are not saved', '', 'info');
}
});
}
function accept() {
let id = document.getElementById("settlementid").value;
const acceptButton = document.getElementById("approvebutton"); // Add an ID to your button in the HTML
Swal.fire({
title: 'Do you want to Approve this Settlement?',
showDenyButton: true,
showCancelButton: true,
confirmButtonText: 'YES',
denyButtonText: 'NO',
}).then((result) => {
if (result.isConfirmed) {
// Disable the button to prevent multiple clicks
acceptButton.disabled = true;
// Show the loading screen
const loadingSwal = Swal.fire({
title: 'Processing...',
text: 'Please wait while we approve the settlement.',
allowOutsideClick: false, // Prevent closing the popup
didOpen: () => {
Swal.showLoading(); // Show the loading spinner
},
showConfirmButton: false, // Hide the confirm button during loading
});
$.ajax({
type: "POST",
url: '/communityhall/api/officer/updateApprovedSettlementStatus/' + id,
data: {
'status': 'APPROVED',
'comments': 'Accepted',
'settlementId': id
},
success: function (data, textStatus, xhr) {
loadingSwal.close(); // Close the loading popup
if (xhr.status === 200) {
Swal.fire(
'Done',
'Successfully Accepted to the ID: ' + id,
'success'
).then(() => {
location.reload(); // Reload the page after success
});
} else {
Swal.fire(
'Error',
'Failed to accept the user',
'error'
);
}
},
error: function (xhr, textStatus, errorThrown) {
loadingSwal.close(); // Close the loading popup
Swal.fire(
'Error',
'Failed to accept the user',
'error'
);
},
complete: function () {
// Re-enable the button after request completes (success or error)
acceptButton.disabled = false;
}
});
} else if (result.isDenied) {
Swal.fire('Changes are not saved', '', 'info');
}
});
}
@ -1430,7 +1437,7 @@ $(document).ready(function () {
let textContent = "This is the content of the text file."; let textContent = "This is the content of the text file.";
// Create a Blob containing the text // Create a Blob containing the text
let blob = new Blob([textContent], {type: "text/plain"});
let blob = new Blob([textContent], { type: "text/plain" });
// Create URL for the Blob // Create URL for the Blob
let url = URL.createObjectURL(blob); let url = URL.createObjectURL(blob);
@ -1635,78 +1642,78 @@ $(document).ready(function () {
const fileURL = $(this).data('url'); const fileURL = $(this).data('url');
openFileModal(fileURL); openFileModal(fileURL);
}); });
function openFileModal(fileURL) {
$('#filePreview').attr('src', fileURL);
$('#fileModal').modal('show');
}
function openFileModal(fileURL) {
$('#filePreview').attr('src', fileURL);
$('#fileModal').modal('show');
}
function approverefund() { function approverefund() {
let id = document.getElementById("booksId").value;
const approveButton = document.getElementById("approvedButton");
Swal.fire({
title: 'Do you want to Approve this Settlement?',
showDenyButton: true,
showCancelButton: true,
confirmButtonText: 'YES',
denyButtonText: 'NO',
}).then((result) => {
if (result.isConfirmed) {
// Disable the button after user confirms
approveButton.disabled = true;
// Show the loading popup
const loadingSwal = Swal.fire({
title: 'Processing...',
text: 'Please wait while we approve the settlement.',
allowOutsideClick: false, // Prevent closing the popup
didOpen: () => {
Swal.showLoading(); // Show the loading spinner
},
showConfirmButton: false, // Hide the confirm button during loading
});
$.ajax({
type: "POST",
url: '/communityhall/api/officer/approveCancelledBookingRefund/' + id,
data: {
'status': 'APPROVED',
},
success: function (data, textStatus, xhr) {
loadingSwal.close(); // Close the loading popup
if (xhr.status === 200) {
Swal.fire(
'Done',
'Successfully Accepted to the ID:' + id,
'success'
).then(() => {
location.reload(); // Reload page after success
});
} else {
Swal.fire(
'Error',
'Failed to Approve the Refund',
'error'
);
}
},
error: function (xhr, textStatus, errorThrown) {
loadingSwal.close(); // Close the loading popup
Swal.fire(
'Error',
'Failed to Approve the Refund',
'error'
);
},
complete: function() {
// Re-enable the button after request completes (success or error)
approveButton.disabled = false;
}
});
} else if (result.isDenied) {
Swal.fire('Changes are not saved', '', 'info');
}
});
}
let id = document.getElementById("booksId").value;
const approveButton = document.getElementById("approvedButton");
Swal.fire({
title: 'Do you want to Approve this Settlement?',
showDenyButton: true,
showCancelButton: true,
confirmButtonText: 'YES',
denyButtonText: 'NO',
}).then((result) => {
if (result.isConfirmed) {
// Disable the button after user confirms
approveButton.disabled = true;
// Show the loading popup
const loadingSwal = Swal.fire({
title: 'Processing...',
text: 'Please wait while we approve the settlement.',
allowOutsideClick: false, // Prevent closing the popup
didOpen: () => {
Swal.showLoading(); // Show the loading spinner
},
showConfirmButton: false, // Hide the confirm button during loading
});
$.ajax({
type: "POST",
url: '/communityhall/api/officer/approveCancelledBookingRefund/' + id,
data: {
'status': 'APPROVED',
},
success: function (data, textStatus, xhr) {
loadingSwal.close(); // Close the loading popup
if (xhr.status === 200) {
Swal.fire(
'Done',
'Successfully Accepted to the ID:' + id,
'success'
).then(() => {
location.reload(); // Reload page after success
});
} else {
Swal.fire(
'Error',
'Failed to Approve the Refund',
'error'
);
}
},
error: function (xhr, textStatus, errorThrown) {
loadingSwal.close(); // Close the loading popup
Swal.fire(
'Error',
'Failed to Approve the Refund',
'error'
);
},
complete: function () {
// Re-enable the button after request completes (success or error)
approveButton.disabled = false;
}
});
} else if (result.isDenied) {
Swal.fire('Changes are not saved', '', 'info');
}
});
}
document.addEventListener('DOMContentLoaded', function () { document.addEventListener('DOMContentLoaded', function () {
var ddDetailsCheckbox = document.getElementById('ddDetailsCheckbox'); var ddDetailsCheckbox = document.getElementById('ddDetailsCheckbox');
@ -1749,13 +1756,13 @@ $(document).ready(function () {
event.stopPropagation(); event.stopPropagation();
}); });
}); });
$('#challonDetails').on('hidden.bs.modal', function () {
// Clear all input fields
$(this).find('form')[0].reset();
$('#challonDetails').on('hidden.bs.modal', function () {
// Clear all input fields
$(this).find('form')[0].reset();
// Optionally, reset any custom styling or classes
$(this).find('input').removeClass('is-valid is-invalid');
});
// Optionally, reset any custom styling or classes
$(this).find('input').removeClass('is-valid is-invalid');
});
</script> </script>
</body> </body>

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

@ -1080,9 +1080,7 @@
<div class="card-body"> <div class="card-body">
<table> <table>
<tr> <tr>
<th colspan="4" style="background-color: lightgrey;">EB
Details
</th>
<th colspan="6" style="background-color: lightgrey;">EB Details</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">
@ -1093,8 +1091,11 @@
<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 amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">MF DT Unit:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_mfDtUnit"></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">
@ -1103,24 +1104,23 @@
<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:
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>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Unit Consumed:
</th>
<td class="fw-semibold amount-cell" 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">
END Reading:
</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
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 colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</tbody>
</table> </table>
</div> </div>
</div> </div>
@ -2008,6 +2008,7 @@
document.getElementById("td_endingReading").innerHTML = response.ebDetails.endingReading; document.getElementById("td_endingReading").innerHTML = response.ebDetails.endingReading;
document.getElementById("td_usedunit").innerHTML = response.ebDetails.usedUnit; document.getElementById("td_usedunit").innerHTML = response.ebDetails.usedUnit;
document.getElementById("td_ebamountperunit").innerHTML = parseFloat(response.hallDetails.ebCostPerUnit).toFixed(2); document.getElementById("td_ebamountperunit").innerHTML = parseFloat(response.hallDetails.ebCostPerUnit).toFixed(2);
document.getElementById("td_mfDtUnit").innerHTML = (response.hallDetails && response.hallDetails.mfDtUnit != null) ? parseFloat(response.hallDetails.mfDtUnit).toFixed(2) : "0.00";
document.getElementById("td_electricityamount").innerHTML = parseFloat(response.ebDetails.ebAmount).toFixed(2); document.getElementById("td_electricityamount").innerHTML = parseFloat(response.ebDetails.ebAmount).toFixed(2);
} else { } else {

58
src/main/resources/templates/admin/settlement-approved.html

@ -400,49 +400,46 @@
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot: <th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:
</th> </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
<td colspan="3" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingSlot"></td> id="td_endingSlot"></td>
</tr> </tr>
</table>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="card-body">
<table>
<tr> <tr>
<th colspan="4" style="background-color: lightgrey;">EB
Details</th>
<th colspan="6" style="background-color: #f2f2f2;">EB Details</th>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
id="td_EBNumber"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per
Unit:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:
</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;" id="td_EBNumber">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per Unit:
</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">MF DT Unit:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_mfDtUnit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:</th>
<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">Unit Consumed:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;" id="td_usedunit">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Unit Consumed:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_usedunit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;"
<td colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</table> </table>
@ -933,6 +930,7 @@
document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading; document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading;
document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit; document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit;
document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2); document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2);
document.getElementById("td_mfDtUnit").innerHTML = '₹ ' + parseFloat(list.hallDetails.mfDtUnit).toFixed(2);
document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2); document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2);
document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);
document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);

252
src/main/resources/templates/admin/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-admin :: head}"></head> <head th:replace="~{fragments/head-admin :: 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"
@ -87,7 +92,8 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr th:each="settlements, rowStat : ${completedlist}">
<tr th:each="settlements, rowStat : ${completedlist}"
th:if="${settlements.settlement != null}">
<td class="text-center" th:text="${rowStat.index + 1}"></td> <td class="text-center" th:text="${rowStat.index + 1}"></td>
<td class="text-center" <td class="text-center"
th:text="${settlements.hallDetails.zone + ' / ' + settlements.hallDetails.division}"> th:text="${settlements.hallDetails.zone + ' / ' + settlements.hallDetails.division}">
@ -96,7 +102,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 +225,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>
@ -363,45 +371,46 @@
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot: <th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:
</th> </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
<td colspan="3" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingSlot"></td> id="td_endingSlot"></td>
</tr> </tr>
</table>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="card-body">
<table>
<tr> <tr>
<th colspan="4" style="background-color: #f2f2f2;">EB
Details</th>
<th colspan="6" style="background-color: #f2f2f2;">EB Details</th>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
id="td_EBNumber"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per
Unit:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:
</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;" id="td_EBNumber">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per Unit:
</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">MF DT Unit:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_mfDtUnit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:</th>
<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">Unit Consumed:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;" id="td_usedunit">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Unit Consumed:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_usedunit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;"
<td colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</table> </table>
@ -448,7 +457,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 +748,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 +766,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 +784,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 +848,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;
@ -864,6 +874,7 @@
document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading; document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading;
document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit; document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit;
document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2); document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2);
document.getElementById("td_mfDtUnit").innerHTML = '₹ ' + parseFloat(list.hallDetails.mfDtUnit).toFixed(2);
document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2); document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2);
document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);
document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);
@ -879,7 +890,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,76 +903,76 @@
}).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) {
var row = $('<tr>').appendTo(tbody);
$('<td>').attr('colspan', '6').text('No Damaged Items').css({
'padding': '0.45rem 0.45rem',
'text-align': 'center',
'font-weight': 'bold',
'background-color': '#f2f2f2'
}).appendTo(row);
} else {
$.each(data.damageList, function (index, detail) {
var row = $('<tr>').appendTo(tbody);
$('<td>').text(index + 1).css({
'padding': '0.45rem 0.45rem',
'text-align': 'center'
}).appendTo(row);
$('<td>').text(detail.assetName).css({
'padding': '0.45rem 0.45rem',
'text-align': 'center'
}).appendTo(row);
// Check if damageList is empty
if (data.damageList.length === 0) {
var row = $('<tr>').appendTo(tbody);
$('<td>').attr('colspan', '6').text('No Damaged Items').css({
'padding': '0.45rem 0.45rem',
'text-align': 'center',
'font-weight': 'bold',
'background-color': '#f2f2f2'
}).appendTo(row);
} else {
$.each(data.damageList, function (index, detail) {
var row = $('<tr>').appendTo(tbody);
$('<td>').text(index + 1).css({
'padding': '0.45rem 0.45rem',
'text-align': 'center'
}).appendTo(row);
$('<td>').text(detail.assetName).css({
'padding': '0.45rem 0.45rem',
'text-align': 'center'
}).appendTo(row);
var viewLink = $('<a>').attr('href', 'javascript:void(0)').text('View').on('click', function () {
showDamageImage(detail.damageImageUrl);
});
$('<td>').css({
'padding': '0.45rem 0.45rem',
'text-align': 'center'
}).append(viewLink).appendTo(row);
var viewLink = $('<a>').attr('href', 'javascript:void(0)').text('View').on('click', function () {
showDamageImage(detail.damageImageUrl);
});
$('<td>').css({
'padding': '0.45rem 0.45rem',
'text-align': 'center'
}).append(viewLink).appendTo(row);
var assetamt = (detail.assetAmount / detail.quantity).toFixed(2);
$('<td>').text('₹ ' + assetamt).css({
'padding': '0.45rem 0.45rem',
'text-align': 'center'
}).appendTo(row);
var assetamt = (detail.assetAmount / detail.quantity).toFixed(2);
$('<td>').text('₹ ' + assetamt).css({
'padding': '0.45rem 0.45rem',
'text-align': 'center'
}).appendTo(row);
$('<td>').text(detail.quantity).css({
'padding': '0.45rem 0.45rem',
'text-align': 'center'
}).appendTo(row);
$('<td>').text(detail.quantity).css({
'padding': '0.45rem 0.45rem',
'text-align': 'center'
}).appendTo(row);
var amount = detail.assetAmount;
totalAmount += amount;
$('<td>').text('₹ ' + amount.toFixed(2)).css({
'padding': '0.45rem 0.45rem',
'text-align': 'right'
}).appendTo(row);
});
var amount = detail.assetAmount;
totalAmount += amount;
$('<td>').text('₹ ' + amount.toFixed(2)).css({
'padding': '0.45rem 0.45rem',
'text-align': 'right'
}).appendTo(row);
});
// Add row for total amount
var totalRow = $('<tr>').appendTo(tbody);
$('<td>').attr('colspan', '5').text('Total Amount').css({
'padding': '0.45rem 0.45rem',
'font-weight': 'bold',
'background-color': '#f2f2f2'
}).appendTo(totalRow);
$('<td>').text('₹ ' + totalAmount.toFixed(2)).css({
'padding': '0.45rem 0.45rem',
'text-align': 'right'
}).appendTo(totalRow);
// Add row for total amount
var totalRow = $('<tr>').appendTo(tbody);
$('<td>').attr('colspan', '5').text('Total Amount').css({
'padding': '0.45rem 0.45rem',
'font-weight': 'bold',
'background-color': '#f2f2f2'
}).appendTo(totalRow);
$('<td>').text('₹ ' + totalAmount.toFixed(2)).css({
'padding': '0.45rem 0.45rem',
'text-align': 'right'
}).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 +1009,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 +1022,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 () {
showchallonimage(data.settlement.challon);
});
$('<td>').css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).append(challanImgLink).appendTo(row);
var challanImgLink = $('<a>').attr('href', 'javascript:void(0)').text('View Image').on('click', function () {
showchallonimage(data.settlement.challon);
});
$('<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 +1058,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 +1069,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 +1095,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 +1149,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;
@ -1237,9 +1248,10 @@ if (data.damageList.length === 0) {
openFileModal(fileURL); openFileModal(fileURL);
}); });
function openFileModal(fileURL) { function openFileModal(fileURL) {
$('#filePreview').attr('src', fileURL);
$('#fileModal').modal('show');
}
$('#filePreview').attr('src', fileURL);
$('#fileModal').modal('show');
}
</script> </script>
</body> </body>
</html> </html>

58
src/main/resources/templates/admin/settlement-initiate.html

@ -427,49 +427,46 @@
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot: <th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:
</th> </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
<td colspan="3" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingSlot"></td> id="td_endingSlot"></td>
</tr> </tr>
</table>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="card-body">
<table>
<tr> <tr>
<th colspan="4" style="background-color: #f2f2f2;">EB
Details</th>
<th colspan="6" style="background-color: #f2f2f2;">EB Details</th>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
id="td_EBNumber"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per
Unit:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:
</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;" id="td_EBNumber">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per Unit:
</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">MF DT Unit:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_mfDtUnit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:</th>
<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">Unit Consumed:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;" id="td_usedunit">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Unit Consumed:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_usedunit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;"
<td colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</table> </table>
@ -1046,6 +1043,7 @@
document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading; document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading;
document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit; document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit;
document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2); document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2);
document.getElementById("td_mfDtUnit").innerHTML = '₹ ' + parseFloat(list.hallDetails.mfDtUnit).toFixed(2);
document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2); document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2);
document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);
document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);

58
src/main/resources/templates/admin/settlement-list.html

@ -438,49 +438,46 @@
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot: <th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:
</th> </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
<td colspan="3" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingSlot"></td> id="td_endingSlot"></td>
</tr> </tr>
</table>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="card-body">
<table>
<tr> <tr>
<th colspan="4" style="background-color: #f2f2f2;">EB
Details</th>
<th colspan="6" style="background-color: #f2f2f2;">EB Details</th>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem; text-align:center"
id="td_EBNumber"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per
Unit:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:
</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;" id="td_EBNumber">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per Unit:
</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">MF DT Unit:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_mfDtUnit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:</th>
<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">Unit Consumed:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right" id="td_usedunit">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Unit Consumed:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_usedunit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right"
<td colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</table> </table>
@ -1003,6 +1000,7 @@
document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading; document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading;
document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit; document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit;
document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2); document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2);
document.getElementById("td_mfDtUnit").innerHTML = '₹ ' + parseFloat(list.hallDetails.mfDtUnit).toFixed(2);
document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2); document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2);
document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);
document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);

56
src/main/resources/templates/admin/settlement-reject.html

@ -236,49 +236,46 @@
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot: <th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:
</th> </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
<td colspan="3" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingSlot"></td> id="td_endingSlot"></td>
</tr> </tr>
</table>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="card-body">
<table>
<tr> <tr>
<th colspan="4" style="background-color: #f2f2f2;">EB
Details</th>
<th colspan="6" style="background-color: #f2f2f2;">EB Details</th>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center" id="td_EBNumber">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:
</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;" id="td_EBNumber">
</td> </td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per
Unit:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per Unit:
</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">MF DT Unit:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_mfDtUnit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:</th>
<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">Unit Consumed:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;" id="td_usedunit">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Unit Consumed:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_usedunit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;"
<td colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</table> </table>
@ -522,6 +519,7 @@ $(document).ready(function () {
document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading; document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading;
document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit; document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit;
document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2); document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2);
document.getElementById("td_mfDtUnit").innerHTML = '₹ ' + parseFloat(list.hallDetails.mfDtUnit).toFixed(2);
document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2); document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2);
document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);
document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);

31
src/main/resources/templates/admin/settlementlist.html

@ -227,14 +227,18 @@
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
<td colspan="3" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingSlot"></td> id="td_endingSlot"></td>
</tr> </tr>
</table>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="card-body">
<table>
<tr> <tr>
<th colspan="4" style="background-color: #f2f2f2;">EB
Details</th>
<th colspan="6" style="background-color: #f2f2f2;">EB Details</th>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number: <th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:
@ -243,26 +247,26 @@
</td> </td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per Unit: <th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per Unit:
</th> </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;text-align:right"
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">MF DT Unit:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_mfDtUnit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:</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">END Reading:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Unit Consumed:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">Unit Consumed:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;text-align:right"
<td class="fw-semibold amount-cell" 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">END Reading:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;text-align:right"
<td colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</table> </table>
@ -519,6 +523,7 @@
document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading; document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading;
document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit; document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit;
document.getElementById("td_ebamountperunit").innerHTML = "₹ " + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2); document.getElementById("td_ebamountperunit").innerHTML = "₹ " + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2);
document.getElementById("td_mfDtUnit").innerHTML = "₹ " + parseFloat(list.hallDetails.mfDtUnit).toFixed(2);
document.getElementById("td_depositeamountforrefund").innerHTML = "₹ " + parseFloat(list.depositAmount).toFixed(2); document.getElementById("td_depositeamountforrefund").innerHTML = "₹ " + parseFloat(list.depositAmount).toFixed(2);
document.getElementById("td_ebAmount").innerHTML = "₹ " + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_ebAmount").innerHTML = "₹ " + parseFloat(list.ebDetails.ebAmount).toFixed(2);
document.getElementById("td_electricityamount").innerHTML = "₹ " + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_electricityamount").innerHTML = "₹ " + parseFloat(list.ebDetails.ebAmount).toFixed(2);

294
src/main/resources/templates/caretaker/caretakerpage.html

@ -64,8 +64,9 @@
<th colspan="4">Consumer Number</th> <th colspan="4">Consumer Number</th>
<th>Start Reading</th> <th>Start Reading</th>
<th>End Reading</th> <th>End Reading</th>
<th>EB Cost Per Unit</th>
<th>Total Units</th> <th>Total Units</th>
<th>MF_DT Units</th>
<th>EB Cost Per Unit</th>
<th>Total Amount</th> <th>Total Amount</th>
</tr> </tr>
</thead> </thead>
@ -87,15 +88,19 @@
class="form-control" class="form-control"
oninput="calculateEBAmount(); calculateUsedUnits();" required> oninput="calculateEBAmount(); calculateUsedUnits();" required>
</td> </td>
<td>
<span id="totalUsedUnits" class="form-control-static"
style="display: none;"></span>
</td>
<td>
<input type="number" id="mfDtUnit" name="mfDtUnit" class="form-control"
th:value="${booking.hallDetails.MfDtUnit}" readonly>
</td>
<td> <td>
<input type="number" id="ebCostPerUnit" name="ebCostPerUnit" <input type="number" id="ebCostPerUnit" name="ebCostPerUnit"
class="form-control" th:value="${booking.hallDetails.ebCostPerUnit}" class="form-control" th:value="${booking.hallDetails.ebCostPerUnit}"
readonly> readonly>
</td> </td>
<td>
<span id="totalUsedUnits" class="form-control-static"
style="display: none;"></span>
</td>
<td> <td>
<span id="totalEBAmount" class="form-control-static" <span id="totalEBAmount" class="form-control-static"
style="display: none;"></span> style="display: none;"></span>
@ -287,7 +292,8 @@
let startReading = parseFloat(document.getElementById("startReading").value) || 0; let startReading = parseFloat(document.getElementById("startReading").value) || 0;
let endReading = parseFloat(document.getElementById("endReading").value) || 0; let endReading = parseFloat(document.getElementById("endReading").value) || 0;
let ebCostPerUnit = parseFloat(document.getElementById("ebCostPerUnit").value) || 0; let ebCostPerUnit = parseFloat(document.getElementById("ebCostPerUnit").value) || 0;
let totalEBAmount = (endReading - startReading) * ebCostPerUnit; // Assuming rate per unit is 10
let mfDtUnit = parseFloat(document.getElementById("mfDtUnit").value) || 0;
let totalEBAmount = (endReading - startReading) * mfDtUnit * ebCostPerUnit; // Assuming rate per unit is 10
if (!isNaN(totalEBAmount)) { if (!isNaN(totalEBAmount)) {
document.getElementById("totalEBAmount").style.display = "block"; // Show the totalEBAmount document.getElementById("totalEBAmount").style.display = "block"; // Show the totalEBAmount
@ -300,28 +306,29 @@
function calculateUsedUnits() { function calculateUsedUnits() {
let startReading = parseFloat(document.getElementById("startReading").value) || 0; let startReading = parseFloat(document.getElementById("startReading").value) || 0;
let endReading = parseFloat(document.getElementById("endReading").value) || 0;
// Get the endReading input element
let endReadingInput = document.getElementById("endReading");
// Ensure end reading cannot be less than start reading
if (endReading < startReading) {
// Set custom validity message
endReadingInput.setCustomValidity("End reading cannot be less than start reading.");
endReadingInput.reportValidity();
} else {
// Clear any previous custom validity message
endReadingInput.setCustomValidity("");
}
let usedUnits = endReading - startReading;
let endReading = parseFloat(document.getElementById("endReading").value) || 0;
let mfDtUnit = parseFloat(document.getElementById("mfDtUnit").value) || 0;
// Get the endReading input element
let endReadingInput = document.getElementById("endReading");
// Ensure end reading cannot be less than start reading
if (endReading < startReading) {
// Set custom validity message
endReadingInput.setCustomValidity("End reading cannot be less than start reading.");
endReadingInput.reportValidity();
} else {
// Clear any previous custom validity message
endReadingInput.setCustomValidity("");
}
let usedUnits = endReading - startReading;
// Show total used units // Show total used units
document.getElementById("totalUsedUnits").style.display = "block"; document.getElementById("totalUsedUnits").style.display = "block";
document.getElementById("totalUsedUnits").innerText = usedUnits; document.getElementById("totalUsedUnits").innerText = usedUnits;
document.getElementById("hiddenTotalUsedUnits").value = usedUnits; document.getElementById("hiddenTotalUsedUnits").value = usedUnits;
let totalEBAmount = usedUnits * parseFloat(document.getElementById("ebCostPerUnit").value) || 0;
let totalEBAmount = usedUnits * mfDtUnit * parseFloat(document.getElementById("ebCostPerUnit").value) || 0;
// Show total EB amount // Show total EB amount
document.getElementById("totalEBAmount").style.display = "block"; document.getElementById("totalEBAmount").style.display = "block";
@ -365,6 +372,7 @@
var startReading = $("#startReading").val(); var startReading = $("#startReading").val();
var usedUnit = $("#totalUsedUnits").html(); var usedUnit = $("#totalUsedUnits").html();
var ebAmount = $("#totalEBAmount").html(); var ebAmount = $("#totalEBAmount").html();
console.log("ebAmount..." + ebAmount);
var formData = new FormData(); var formData = new FormData();
formData.append('bookingId', bookingId); formData.append('bookingId', bookingId);
formData.append('ebId', ebId); formData.append('ebId', ebId);
@ -420,132 +428,132 @@
return false; return false;
} }
let isCompressing = false;
// Attach the validation function to file input change event
$(document).on('change', '.damage-image', function () {
validateFile(this);
});
function validateFile(fileInput) {
const allowedExtensions = /(\.jpg|\.jpeg|\.pdf)$/i;
const file = fileInput.files[0];
const filePath = fileInput.value;
let errorMessage = '';
// Clear any previous error message
clearError(fileInput);
// Check for duplicate files
if (isDuplicateFile(file.name, fileInput)) {
errorMessage = 'This file has already been selected. Please choose a different file.';
fileInput.value = ''; // Clear the file input
displayError(fileInput, errorMessage);
return;
}
// Validate file type
if (!allowedExtensions.exec(filePath)) {
errorMessage = 'Only JPG, JPEG, and PDF files are allowed.';
fileInput.value = ''; // Clear the file input
displayError(fileInput, errorMessage);
}
// Handle image files separately
else if (/(\.jpg|\.jpeg)$/i.test(filePath) && file.size > 2097152) {
compressImage(file).then(compressedFile => {
const dataTransfer = new DataTransfer();
dataTransfer.items.add(compressedFile);
fileInput.files = dataTransfer.files;
// Validate file size after compression
validateFileSize(fileInput);
}).catch(error => {
errorMessage = 'Error compressing image.';
displayError(fileInput, errorMessage);
});
}
// Directly validate PDF file size
else if (/(\.pdf)$/i.test(filePath) && file.size > 2097152) {
errorMessage = 'PDF file size exceeds the 2MB limit.';
fileInput.value = ''; // Clear the file input
displayError(fileInput, errorMessage);
}
else {
// console.log('File size is within limit:', file.size, 'bytes');
clearError(fileInput);
}
}
let isCompressing = false;
// Attach the validation function to file input change event
$(document).on('change', '.damage-image', function () {
validateFile(this);
});
function validateFile(fileInput) {
const allowedExtensions = /(\.jpg|\.jpeg|\.pdf)$/i;
const file = fileInput.files[0];
const filePath = fileInput.value;
let errorMessage = '';
// Clear any previous error message
clearError(fileInput);
// Check for duplicate files
if (isDuplicateFile(file.name, fileInput)) {
errorMessage = 'This file has already been selected. Please choose a different file.';
fileInput.value = ''; // Clear the file input
displayError(fileInput, errorMessage);
return;
}
function isDuplicateFile(fileName, currentInput) {
const fileInputs = document.querySelectorAll('.file-upload-field');
for (let input of fileInputs) {
if (input !== currentInput && input.files.length > 0 && input.files[0].name === fileName) {
return true;
}
}
return false;
}
// Validate file type
if (!allowedExtensions.exec(filePath)) {
errorMessage = 'Only JPG, JPEG, and PDF files are allowed.';
fileInput.value = ''; // Clear the file input
displayError(fileInput, errorMessage);
}
// Handle image files separately
else if (/(\.jpg|\.jpeg)$/i.test(filePath) && file.size > 2097152) {
compressImage(file).then(compressedFile => {
const dataTransfer = new DataTransfer();
dataTransfer.items.add(compressedFile);
fileInput.files = dataTransfer.files;
// Validate file size after compression
validateFileSize(fileInput);
}).catch(error => {
errorMessage = 'Error compressing image.';
displayError(fileInput, errorMessage);
});
}
// Directly validate PDF file size
else if (/(\.pdf)$/i.test(filePath) && file.size > 2097152) {
errorMessage = 'PDF file size exceeds the 2MB limit.';
fileInput.value = ''; // Clear the file input
displayError(fileInput, errorMessage);
}
else {
// console.log('File size is within limit:', file.size, 'bytes');
clearError(fileInput);
}
}
function clearError(fileInput) {
const errorElements = fileInput.parentNode.getElementsByClassName('error-message');
while (errorElements.length > 0) {
errorElements[0].remove();
}
}
// Function to compress image using canvas
function compressImage(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = function (event) {
const img = new Image();
img.onload = function () {
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
const maxSize = 2097152; // 2MB in bytes
let scale = 1;
if (file.size > maxSize) {
scale = Math.sqrt(maxSize / file.size);
}
canvas.width = img.width * scale;
canvas.height = img.height * scale;
ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
// Convert canvas content to blob
canvas.toBlob(blob => {
resolve(new File([blob], file.name, {type: 'image/jpeg', lastModified: Date.now()}));
}, 'image/jpeg', 0.7); // Adjust JPEG quality as needed (0.7 is 70% quality)
};
img.src = event.target.result;
};
reader.readAsDataURL(file);
});
}
// Function to validate file size after compression
function validateFileSize(fileInput) {
const file = fileInput.files[0];
if (file && file.size > 2097152) {
//console.log('File size is still greater than 2MB after compression.');
// Handle the situation where the file size is still greater than 2MB
displayError(fileInput, 'File size is still greater than 2MB after compression.');
fileInput.value = ''; // Clear the file input
} else {
//console.log('File size is within limit after compression.');
// Handle the situation where the file size is within the limit
}
}
// Function to display error messages
function displayError(fileInput, errorMessage) {
// Example implementation: show error message near the file input
let errorContainer = fileInput.nextElementSibling;
if (!errorContainer || !errorContainer.classList.contains('error-message')) {
errorContainer = document.createElement('div');
errorContainer.classList.add('error-message');
fileInput.parentNode.insertBefore(errorContainer, fileInput.nextSibling);
function isDuplicateFile(fileName, currentInput) {
const fileInputs = document.querySelectorAll('.file-upload-field');
for (let input of fileInputs) {
if (input !== currentInput && input.files.length > 0 && input.files[0].name === fileName) {
return true;
}
}
return false;
}
function clearError(fileInput) {
const errorElements = fileInput.parentNode.getElementsByClassName('error-message');
while (errorElements.length > 0) {
errorElements[0].remove();
}
}
// Function to compress image using canvas
function compressImage(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = function (event) {
const img = new Image();
img.onload = function () {
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
const maxSize = 2097152; // 2MB in bytes
let scale = 1;
if (file.size > maxSize) {
scale = Math.sqrt(maxSize / file.size);
} }
errorContainer.textContent = errorMessage;
}
canvas.width = img.width * scale;
canvas.height = img.height * scale;
ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
// Convert canvas content to blob
canvas.toBlob(blob => {
resolve(new File([blob], file.name, { type: 'image/jpeg', lastModified: Date.now() }));
}, 'image/jpeg', 0.7); // Adjust JPEG quality as needed (0.7 is 70% quality)
};
img.src = event.target.result;
};
reader.readAsDataURL(file);
});
}
// Function to validate file size after compression
function validateFileSize(fileInput) {
const file = fileInput.files[0];
if (file && file.size > 2097152) {
//console.log('File size is still greater than 2MB after compression.');
// Handle the situation where the file size is still greater than 2MB
displayError(fileInput, 'File size is still greater than 2MB after compression.');
fileInput.value = ''; // Clear the file input
} else {
//console.log('File size is within limit after compression.');
// Handle the situation where the file size is within the limit
}
}
// Function to display error messages
function displayError(fileInput, errorMessage) {
// Example implementation: show error message near the file input
let errorContainer = fileInput.nextElementSibling;
if (!errorContainer || !errorContainer.classList.contains('error-message')) {
errorContainer = document.createElement('div');
errorContainer.classList.add('error-message');
fileInput.parentNode.insertBefore(errorContainer, fileInput.nextSibling);
}
errorContainer.textContent = errorMessage;
}
</script> </script>
</body> </body>

115
src/main/resources/templates/caretaker/settlementlist.html

@ -103,9 +103,9 @@
th:if="${#strings.trim(settlemetList.RefundStatus) == 'REJECTED'}" th:if="${#strings.trim(settlemetList.RefundStatus) == 'REJECTED'}"
th:onclick="settleTheAmount([[${settlemetList.bookingId}]])">Raise th:onclick="settleTheAmount([[${settlemetList.bookingId}]])">Raise
Again</span> Again</span>
<span class="badge bg-warning" style="cursor: pointer;"
th:if="${settlemetList.settlement.collectionPending > 0} and ${settlemetList.settlement.collectionStatus != 'paid'}"
th:onclick="|fetchQRCode(${settlemetList.bookingId})|">QR
<span class="badge bg-warning" style="cursor: pointer;"
th:if="${settlemetList.settlement.collectionPending > 0} and ${settlemetList.settlement.collectionStatus != 'paid'}"
th:onclick="|fetchQRCode(${settlemetList.bookingId})|">QR
</span> </span>
</td> </td>
</tr> </tr>
@ -227,14 +227,18 @@
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
<td colspan="3" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingSlot"></td> id="td_endingSlot"></td>
</tr> </tr>
</table>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="card-body">
<table>
<tr> <tr>
<th colspan="4" style="background-color: #f2f2f2;">EB
Details</th>
<th colspan="6" style="background-color: #f2f2f2;">EB Details</th>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number: <th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:
@ -243,26 +247,26 @@
</td> </td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per Unit: <th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per Unit:
</th> </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;text-align:right"
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">MF DT Unit:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_mfDtUnit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:</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">END Reading:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Unit Consumed:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">Unit Consumed:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;text-align:right"
<td class="fw-semibold amount-cell" 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">END Reading:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;text-align:right"
<td colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</table> </table>
@ -307,12 +311,13 @@
style="padding: 0.45rem 0.45rem; color: green;" id="td_pending_amt">0 style="padding: 0.45rem 0.45rem; color: green;" id="td_pending_amt">0
</td> </td>
</tr> </tr>
<tr id="collectionstatuscolumn">
<th id="label"
style="padding: 0.45rem 0.45rem;font-weight: normal">Collection Pending Status
<tr id="collectionstatuscolumn">
<th id="label" style="padding: 0.45rem 0.45rem;font-weight: normal">
Collection Pending Status
:</th> :</th>
<td class="fw-semibold amount-cell" <td class="fw-semibold amount-cell"
style="padding: 0.45rem 0.45rem; color: green;" id="td_collection_status">
style="padding: 0.45rem 0.45rem; color: green;"
id="td_collection_status">
</td> </td>
</tr> </tr>
<tr> <tr>
@ -360,19 +365,18 @@
</div> </div>
</div> </div>
</div> </div>
<div class="modal fade" id="qrview" tabindex="-1" role="dialog" aria-labelledby="fileModalLabel"
aria-hidden="true">
<div class="modal fade" id="qrview" tabindex="-1" role="dialog" aria-labelledby="fileModalLabel" aria-hidden="true">
<div class="modal-dialog modal-sm" role="document"> <div class="modal-dialog modal-sm" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="qrview">QR Code for Collection Pending</h5>
<h5 class="modal-title" id="qrview">QR Code for Collection Pending</h5>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div> <div>
<img style="border:4px solid #15455D;width: 256px; height: 260px;border-radius:10px;"
id="qrCodeImage" alt="QR Code">
</div>
<img style="border:4px solid #15455D;width: 256px; height: 260px;border-radius:10px;"
id="qrCodeImage" alt="QR Code">
</div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
@ -520,6 +524,7 @@
document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading; document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading;
document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit; document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit;
document.getElementById("td_ebamountperunit").innerHTML = "₹ " + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2); document.getElementById("td_ebamountperunit").innerHTML = "₹ " + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2);
document.getElementById("td_mfDtUnit").innerHTML = "₹ " + parseFloat(list.hallDetails.mfDtUnit).toFixed(2);
document.getElementById("td_depositeamountforrefund").innerHTML = "₹ " + parseFloat(list.depositAmount).toFixed(2); document.getElementById("td_depositeamountforrefund").innerHTML = "₹ " + parseFloat(list.depositAmount).toFixed(2);
document.getElementById("td_ebAmount").innerHTML = "₹ " + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_ebAmount").innerHTML = "₹ " + parseFloat(list.ebDetails.ebAmount).toFixed(2);
document.getElementById("td_electricityamount").innerHTML = "₹ " + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_electricityamount").innerHTML = "₹ " + parseFloat(list.ebDetails.ebAmount).toFixed(2);
@ -539,7 +544,7 @@
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': '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>');
@ -554,12 +559,12 @@
// 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;
@ -634,8 +639,8 @@
var temp_total = parseFloat($("#td_settel_amt").html()); var temp_total = parseFloat($("#td_settel_amt").html());
var settleAmount = temp_total - totalAmount; var settleAmount = temp_total - totalAmount;
if (settleAmount < 0) {
var pendingstatus = data.settlement.collectionStatus;
if (settleAmount < 0) {
var pendingstatus = data.settlement.collectionStatus;
$("#td_settel_amt").html(0); $("#td_settel_amt").html(0);
$("#pendingcolumn").show(); $("#pendingcolumn").show();
$("#collectionstatuscolumn").show(); $("#collectionstatuscolumn").show();
@ -656,7 +661,7 @@
function showDamageImage(damageImageUrl) { function showDamageImage(damageImageUrl) {
document.getElementById('filePreview').src = damageImageUrl; document.getElementById('filePreview').src = damageImageUrl;
$('#fileModal').modal('show'); $('#fileModal').modal('show');
}
}
function accept() { function accept() {
let id = document.getElementById("settlementid").value; let id = document.getElementById("settlementid").value;
@ -707,24 +712,24 @@
} }
}); });
} }
function fetchQRCode(bookingId) {
$.ajax({
url: '/communityhall/careTaker/api/generateQRCode',
type: 'GET',
data: { bookingId: bookingId },
success: function(data) {
// Set the QR code image source
$('#qrview').modal('show');
$('#qrCodeImage').attr('src', 'data:image/png;base64,' + data);
// console.log(data);
},
error: function(jqXHR, textStatus, errorThrown) {
console.error('Error fetching QR code:', textStatus, errorThrown);
}
});
}
function fetchQRCode(bookingId) {
$.ajax({
url: '/communityhall/careTaker/api/generateQRCode',
type: 'GET',
data: { bookingId: bookingId },
success: function (data) {
// Set the QR code image source
$('#qrview').modal('show');
$('#qrCodeImage').attr('src', 'data:image/png;base64,' + data);
// console.log(data);
},
error: function (jqXHR, textStatus, errorThrown) {
console.error('Error fetching QR code:', textStatus, errorThrown);
}
});
}
</script> </script>
</body> </body>

10
src/main/resources/templates/cro/booking-list.html

@ -243,7 +243,7 @@
<!-- ═══ Search Booking by ID ═══ --> <!-- ═══ Search Booking by ID ═══ -->
<div class="block block-rounded"> <div class="block block-rounded">
<div class="block-header block-header-default"> <div class="block-header block-header-default">
<h3 class="block-title">Search Booking by ID</h3>
<h3 class="block-title">Reschedule Bookings</h3>
</div> </div>
<div class="block-content p-4"> <div class="block-content p-4">
<div id="bookingSearchSection"> <div id="bookingSearchSection">
@ -1319,6 +1319,7 @@
var ud = list.users || {}; var ud = list.users || {};
var hd = list.hallDetails || {}; var hd = list.hallDetails || {};
var py = list.payments || {}; var py = list.payments || {};
var eb = list.ebDetails || {};
document.getElementById('res_userName').innerHTML = ud.name || 'N/A'; document.getElementById('res_userName').innerHTML = ud.name || 'N/A';
document.getElementById('res_mobileNumber').innerHTML = ud.mobileNo || 'N/A'; document.getElementById('res_mobileNumber').innerHTML = ud.mobileNo || 'N/A';
@ -1354,6 +1355,8 @@
var status = (list.bookingStatus || '').toString().trim(); var status = (list.bookingStatus || '').toString().trim();
var statusAllowed = (status === 'APPROVED' || status === 'WAITING_FOR_NOC'); var statusAllowed = (status === 'APPROVED' || status === 'WAITING_FOR_NOC');
var scheduleCount = list.scheduleCount || 0; var scheduleCount = list.scheduleCount || 0;
var hasEbDetails = list.ebDetails != null && (list.ebDetails.id != null || list.ebDetails.startingReading != null);
$('#rescheduleActionDiv').hide(); $('#rescheduleActionDiv').hide();
$('#rescheduleNotAllowedMsg').hide(); $('#rescheduleNotAllowedMsg').hide();
@ -1363,6 +1366,11 @@
$('#rescheduleNotAllowedMsg') $('#rescheduleNotAllowedMsg')
.html('<div class="alert alert-danger mb-0" style="color: #b02a37; background-color: #f8d7da; border: 1px solid #f5c2c7; font-weight: bold; font-size: 14px;"><i class="fa fa-exclamation-triangle me-1"></i><strong>Reschedule limit exceeds: this booking has already been rescheduled once.</strong></div>') .html('<div class="alert alert-danger mb-0" style="color: #b02a37; background-color: #f8d7da; border: 1px solid #f5c2c7; font-weight: bold; font-size: 14px;"><i class="fa fa-exclamation-triangle me-1"></i><strong>Reschedule limit exceeds: this booking has already been rescheduled once.</strong></div>')
.show(); .show();
} else if (hasEbDetails) {
// Already rescheduled once — block further reschedule
$('#rescheduleNotAllowedMsg')
.html('<div class="alert alert-danger mb-0" style="color: #b02a37; background-color: #f8d7da; border: 1px solid #f5c2c7; font-weight: bold; font-size: 14px;"><i class="fa fa-exclamation-triangle me-1"></i><strong>Reschedule Not Allowed: EB Details already entered for this booking.</strong></div>')
.show();
} else if (eventDate > today) { } else if (eventDate > today) {
// Future event: reschedule NOT allowed // Future event: reschedule NOT allowed
$('#rescheduleNotAllowedMsg') $('#rescheduleNotAllowedMsg')

751
src/main/resources/templates/cro/booking-status.html

@ -0,0 +1,751 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/head-cro :: head}"></head>
<style>
.card-body table {
width: 100%;
padding: 100px;
}
.card-body th,
td {
padding: 8px;
text-align: left;
}
.amount-cell {
text-align: right;
padding-right: 1rem;
}
.form-control[readonly] {
background-color: white;
}
.modal {
overflow-y: auto;
}
/* OTP inputs */
.otp-input-box {
display: flex;
justify-content: center;
gap: 10px;
}
.cro-otp-input {
width: 48px;
height: 52px;
text-align: center;
font-size: 22px;
font-weight: bold;
border: 2px solid #ced4da;
border-radius: 8px;
transition: all 0.2s ease-in-out;
}
.cro-otp-input:focus {
border-color: #0d6efd;
outline: none;
box-shadow: 0 0 0 4px rgba(13, 110, 253, .2);
}
#bookingSearchSection {
border: 1px solid #dee2e6;
border-radius: 8px;
padding: 20px;
background: #f8f9fa;
margin-bottom: 20px;
}
.detail-section th {
background-color: #f2f2f2;
font-weight: 600;
}
.detail-section td,
.detail-section th {
padding: 0.45rem 0.75rem;
border: 1px solid #dee2e6;
}
.detail-section table {
width: 100%;
border-collapse: collapse;
margin-bottom: 10px;
}
#bookingDetailResult {
display: none;
}
.status-change-card {
border: 2px solid #e2e8f0;
border-radius: 10px;
background: #ffffff;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
padding: 24px;
margin-top: 25px;
}
.status-badge-lg {
font-size: 0.95rem;
padding: 0.35rem 0.75rem;
border-radius: 6px;
font-weight: 600;
}
</style>
<body>
<!-- Page Container -->
<div id="page-container"
class="sidebar-o sidebar-dark enable-page-overlay side-scroll page-header-fixed page-header-dark">
<!-- Sidebar Nav-->
<aside th:replace="~{fragments/aside-right :: aside}"></aside>
<!-- END Side Overlay (right)-->
<!-- Sidebar Nav-->
<nav th:replace="~{fragments/nav-cro :: nav}"></nav>
<!-- END Sidebar -->
<!-- Header -->
<header th:replace="~{fragments/header-cro :: header}"></header>
<!-- Main Container -->
<main id="main-container">
<div class="content">
<!-- ═══ Search Booking by ID ═══ -->
<div class="block block-rounded">
<div class="block-header block-header-default">
<h3 class="block-title"><i class="fa fa-search me-2 text-primary"></i>Change Booking Status</h3>
</div>
<div class="block-content p-4">
<div id="bookingSearchSection">
<div class="row align-items-end">
<div class="col-md-4 mb-2">
<label class="form-label fw-semibold" for="searchBookingId">Booking ID <span
class="text-danger">*</span></label>
<input type="number" class="form-control" id="searchBookingId"
placeholder="Enter Booking ID" min="1" />
</div>
<div class="col-md-3 mb-2">
<button type="button" class="btn btn-primary" id="btnSearchBooking"
onclick="searchBookingById()">
<i class="fa fa-search me-1"></i> Search
</button>
<button type="button" class="btn btn-secondary ms-2" id="btnClearBookingSearch"
onclick="clearBookingSearch()">
<i class="fa fa-times me-1"></i> Clear
</button>
</div>
</div>
</div>
<!-- Booking Detail Result -->
<div id="bookingDetailResult">
<hr />
<div class="d-flex justify-content-between align-items-center mb-3">
<h5 class="mb-0">Booking Details <span class="text-primary" id="resultBookingId"></span>
</h5>
<span id="res_bookingStatusBadge" class="badge status-badge-lg bg-info"></span>
</div>
<div class="detail-section">
<!-- User Details -->
<table>
<tr>
<th colspan="6">User Details</th>
</tr>
<tr>
<th style="font-weight:normal;">User Name:</th>
<td id="res_userName"></td>
<th style="font-weight:normal;">Mobile Number:</th>
<td id="res_mobileNumber"></td>
<th style="font-weight:normal;">User Type:</th>
<td id="res_usertype"></td>
</tr>
<tr>
<th style="font-weight:normal;">User Address:</th>
<td colspan="5" id="res_useraddress"></td>
</tr>
</table>
<!-- Hall Details -->
<table>
<tr>
<th colspan="6">Hall Details</th>
</tr>
<tr>
<th style="font-weight:normal;">Hall Name:</th>
<td colspan="5" id="res_hallName"></td>
</tr>
<tr>
<th style="font-weight:normal;">Hall Address:</th>
<td colspan="5" id="res_halladdress"></td>
</tr>
<tr>
<th style="font-weight:normal;">Caretaker Name:</th>
<td id="res_caretakername"></td>
<th style="font-weight:normal;">Caretaker Mobile:</th>
<td colspan="3" id="res_caretakermobileNumber"></td>
</tr>
</table>
<!-- Booking Details -->
<table>
<tr>
<th colspan="4">Booking Details (Booking Id: <span id="res_booking_id"
style="color:blue;"></span>)</th>
</tr>
<tr>
<th style="font-weight:normal;">Booking Date:</th>
<td id="res_bookingDate"></td>
<th style="font-weight:normal;">Booking Status:</th>
<td id="res_bookingStatus" class="fw-bold"></td>
</tr>
<tr>
<th style="font-weight:normal;">Start Date:</th>
<td id="res_startDate"></td>
<th style="font-weight:normal;">Deposit Amount:</th>
<td class="amount-cell" id="res_depositeAmount"></td>
</tr>
<tr>
<th style="font-weight:normal;">End Date:</th>
<td id="res_endDate"></td>
<th style="font-weight:normal;">Hall Amount:</th>
<td class="amount-cell" id="res_hallAmount"></td>
</tr>
<tr>
<th style="font-weight:normal;">Starting Slot:</th>
<td id="res_startingSlot"></td>
<th style="font-weight:normal;">GST @18%:</th>
<td class="amount-cell" id="res_gst"></td>
</tr>
<tr>
<th style="font-weight:normal;">Ending Slot:</th>
<td id="res_endingSlot"></td>
<th style="font-weight:normal;">Total Amount:</th>
<td class="amount-cell" id="res_totalAmount"></td>
</tr>
<tr>
<th style="font-weight:normal;">Reason:</th>
<td colspan="3" id="res_reason"></td>
</tr>
</table>
<!-- Payment Details -->
<table>
<tr>
<th colspan="4">Booking Payment Details</th>
</tr>
<tr>
<th style="font-weight:normal;">Transaction ID:</th>
<td colspan="3" id="res_transactionId"></td>
</tr>
<tr>
<th style="font-weight:normal;">Amount Received:</th>
<td id="res_payamountReceived"></td>
<th style="font-weight:normal;">Transaction Status:</th>
<td id="res_paymentStatus"></td>
</tr>
</table>
</div>
<!-- ═══ Change Booking Status Section (CRO) ═══ -->
<div id="statusChangeSection" class="status-change-card" style="display: none;">
<div class="d-flex align-items-center mb-3">
<div class="bg-primary-light text-primary p-2 rounded-3 me-3"
style="background: rgba(13,110,253,0.1);">
<i class="fa fa-exchange-alt fa-lg text-primary"></i>
</div>
<div>
<h5 class="mb-0 fw-bold text-dark">Change Booking Status</h5>
<small class="text-muted">CRO can update booking status to REJECTED or
GCC_BLOCKED with OTP verification</small>
</div>
</div>
<div class="alert alert-warning py-2 mb-3">
<i class="fa fa-info-circle me-1"></i>
Status changes require OTP verification sent to your registered CRO mobile number.
</div>
<div class="row g-3">
<div class="col-md-5">
<label class="form-label fw-semibold" for="changeBookingStatusSelect">
Select New Booking Status <span class="text-danger">*</span>
</label>
<select class="form-select" id="changeBookingStatusSelect">
<option value="">-- Select New Status --</option>
<option value="REJECTED">REJECTED</option>
<option value="GCC_BLOCKED">GCC_BLOCKED</option>
</select>
</div>
<div class="col-md-7">
<label class="form-label fw-semibold" for="statusChangeRemarks">
Reason / Remarks <span class="text-danger">*</span>
</label>
<textarea class="form-control" id="statusChangeRemarks" rows="2"
placeholder="Enter reason or comments for changing status (required)..."></textarea>
</div>
<div class="col-12 text-end mt-3">
<button type="button" class="btn btn-danger px-4" id="btnInitiateStatusChange"
onclick="initiateStatusChange()">
<i class="fa fa-paper-plane me-1"></i> Submit Status Change
</button>
</div>
</div>
</div>
<!-- ═══ Not Allowed Info Box ═══ -->
<div id="statusChangeNotAllowedMsg" style="display: none; margin-top: 20px;">
<div class="alert alert-secondary mb-0">
<i class="fa fa-info-circle me-1"></i>
Status change is <strong>not permitted</strong> for this booking.
<span id="notAllowedDetailMsg">Status change is only permitted for <strong>Past
events</strong> with status <strong>APPROVED</strong>,
<strong>WAITING_FOR_NOC</strong>, or
<strong>WAITING_FOR_NOC_APPROVAL</strong>.</span>
<br />
<span class="small mt-1 d-inline-block">
Current status: <span class="badge bg-dark"
id="notAllowedCurrentStatusBadge"></span>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<!-- END Main Container -->
<!-- ════ CRO OTP MODAL (MATCHES cro/booking-list.html) ════ -->
<div class="modal fade" id="croStatusOtpModal" tabindex="-1" role="dialog"
aria-labelledby="croStatusOtpModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title m-0" id="croStatusOtpModalLabel">OTP Verification</h6>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="row">
<div class="mb-3 text-center">
<img src="media/images/mobileotp.png" width="50%" alt="OTP">
</div>
<div class="mb-0 text-center">
<h4>OTP Verification</h4>
<p class="text-mute">Enter the OTP sent to <b class="text-info"
id="croOtpMobileDisplay"></b></p>
<p class="text-danger" id="croOtpErrorAlert"></p>
</div>
<div class="mb-3 text-center">
<div class="otp-input-box">
<input type="text" maxlength="1" class="otp-input cro-otp-input" id="croOtp1"
required />
<input type="text" maxlength="1" class="otp-input cro-otp-input" id="croOtp2"
required />
<input type="text" maxlength="1" class="otp-input cro-otp-input" id="croOtp3"
required />
<input type="text" maxlength="1" class="otp-input cro-otp-input" id="croOtp4"
required />
<input type="text" maxlength="1" class="otp-input cro-otp-input" id="croOtp5"
required />
</div>
</div>
<div class="mb-3 text-center">
<p class="mb-0">Didn't receive OTP?</p>
<p class="mb-0 text-info">
<span id="croResendText">Please wait..</span>
<span id="croCountdown">60</span>s
</p>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary btn-sm" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary btn-sm" id="btnVerifyCroOtp"
onclick="verifyAndSubmitStatusChange()">Verify OTP</button>
</div>
</div>
</div>
</div>
<footer th:replace="~{fragments/footer2 :: footer}"></footer>
<div th:replace="~{fragments/resetpassword :: div}"></div>
<script th:replace="~{fragments/loginscript :: script}"></script>
<script>
var currentSearchedBooking = null;
var croResendTimer = null;
var croMobileNumber = [[${ mobileno }]];
// ─── SEARCH BOOKING BY ID ───
function searchBookingById() {
var input = document.getElementById('searchBookingId');
var bookingId = input ? input.value.trim() : '';
if (!bookingId || isNaN(bookingId) || parseInt(bookingId) <= 0) {
Swal.fire({ icon: 'warning', title: 'Invalid Input', text: 'Please enter a valid Booking ID.' });
return;
}
Swal.fire({
title: 'Fetching Booking...',
text: 'Please wait while booking details are retrieved.',
allowOutsideClick: false,
didOpen: () => { Swal.showLoading(); }
});
$.ajax({
type: 'GET',
url: '/communityhall/cro/api/getBookingById',
data: { bookingId: bookingId },
success: function (data) {
Swal.close();
if (data && data.bookingId) {
currentSearchedBooking = data;
populateBookingDetails(data);
$('#bookingDetailResult').show();
} else {
Swal.fire({ icon: 'error', title: 'Not Found', text: 'No booking found for ID: ' + bookingId });
$('#bookingDetailResult').hide();
}
},
error: function (xhr) {
Swal.close();
var msg = (xhr.status === 404) ? 'Booking ID ' + bookingId + ' does not exist.' : 'Error fetching booking.';
Swal.fire({ icon: 'error', title: 'Error', text: msg });
$('#bookingDetailResult').hide();
}
});
}
// ─── CLEAR BOOKING SEARCH ───
function clearBookingSearch() {
var input = document.getElementById('searchBookingId');
if (input) input.value = '';
$('#bookingDetailResult').hide();
currentSearchedBooking = null;
}
$(document).ready(function () {
$('#searchBookingId').on('keypress', function (e) {
if (e.key === 'Enter') searchBookingById();
});
// OTP input auto-advance and backspace handling
$('.cro-otp-input').on('keyup', function (e) {
var $this = $(this);
if (e.key === 'Backspace' || e.key === 'Delete') {
if ($this.val().length === 0) {
$this.prev('.cro-otp-input').focus();
}
} else if (e.key >= '0' && e.key <= '9') {
if ($this.val().length === 1) {
$this.next('.cro-otp-input').focus();
}
}
});
// Paste handling for OTP inputs
$('.cro-otp-input').first().on('paste', function (e) {
var pasteData = (e.originalEvent.clipboardData || window.clipboardData).getData('text').trim();
if (/^\d{5}$/.test(pasteData)) {
e.preventDefault();
for (var i = 0; i < 5; i++) {
$('#croOtp' + (i + 1)).val(pasteData[i]);
}
$('#croOtp5').focus();
}
});
});
// ─── POPULATE BOOKING DETAILS ───
function populateBookingDetails(list) {
var ud = list.users || {};
var hd = list.hallDetails || {};
var py = list.payments || {};
document.getElementById('res_userName').innerHTML = ud.name || 'N/A';
document.getElementById('res_mobileNumber').innerHTML = ud.mobileNo || 'N/A';
document.getElementById('res_usertype').innerHTML = ud.usertype || 'N/A';
document.getElementById('res_useraddress').innerHTML = ud.doorNo ? ud.doorNo + ', ' + ud.street + ', ' + ud.area + ', ' + ud.location + '- ' + ud.pinCode : 'N/A';
document.getElementById('res_hallName').innerHTML = hd.hallName || 'N/A';
document.getElementById('res_halladdress').innerHTML = hd.doorNo ? hd.doorNo + ', ' + hd.street + ', ' + hd.area + ', ' + hd.city + '- ' + hd.pinCode : 'N/A';
document.getElementById('res_caretakername').innerHTML = hd.hallInchargeName || 'N/A';
document.getElementById('res_caretakermobileNumber').innerHTML = hd.hallInchargeMobno || 'N/A';
document.getElementById('res_booking_id').innerHTML = list.bookingId;
document.getElementById('resultBookingId').innerHTML = ' #' + list.bookingId;
document.getElementById('res_bookingDate').innerHTML = list.bookingDate || 'N/A';
document.getElementById('res_bookingStatus').innerHTML = list.bookingStatus || 'N/A';
document.getElementById('res_startDate').innerHTML = list.startDate || 'N/A';
document.getElementById('res_endDate').innerHTML = list.endDate || 'N/A';
document.getElementById('res_depositeAmount').innerHTML = list.depositAmount ? '&#8377; ' + parseFloat(list.depositAmount).toFixed(2) : 'N/A';
document.getElementById('res_hallAmount').innerHTML = list.hallAmount ? '&#8377; ' + parseFloat(list.hallAmount).toFixed(2) : 'N/A';
document.getElementById('res_totalAmount').innerHTML = list.amountReceived ? '&#8377; ' + parseFloat(list.amountReceived).toFixed(2) : 'N/A';
var gst = (list.hallAmount && hd.gst) ? (parseFloat(list.hallAmount) * (hd.gst / 100)).toFixed(2) : '0.00';
document.getElementById('res_gst').innerHTML = '&#8377; ' + gst;
document.getElementById('res_startingSlot').innerHTML = getSlotLabel(list.startingSlot);
document.getElementById('res_endingSlot').innerHTML = getSlotLabel(list.endingSlot);
document.getElementById('res_reason').innerHTML = list.reason || 'N/A';
document.getElementById('res_transactionId').innerHTML = py.transactionId || 'NA';
document.getElementById('res_payamountReceived').innerHTML = py.amountReceived ? '&#8377; ' + py.amountReceived : 'NA';
document.getElementById('res_paymentStatus').innerHTML = py.paymentStatus || 'NA';
// Status Badge
var status = (list.bookingStatus || '').toUpperCase().trim();
var badgeEl = document.getElementById('res_bookingStatusBadge');
badgeEl.textContent = status;
badgeEl.className = 'badge status-badge-lg ' + getStatusBadgeClass(status);
// ─── Status Change Eligibility Check ───
// 1. Status must be APPROVED, WAITING_FOR_NOC, or WAITING_FOR_NOC_APPROVAL
// 2. Start date and End date must NOT be future dates (only completed events allowed)
var eligibleStatuses = ['APPROVED', 'WAITING_FOR_NOC', 'WAITING_FOR_NOC_APPROVAL'];
var isStatusEligible = (eligibleStatuses.indexOf(status) !== -1);
var hasEbDetails = list.ebDetails != null && (list.ebDetails.id != null || list.ebDetails.startingReading != null);
// Date checks:
var today = new Date();
var yyyy = today.getFullYear();
var mm = String(today.getMonth() + 1).padStart(2, '0');
var dd = String(today.getDate()).padStart(2, '0');
var todayStr = yyyy + '-' + mm + '-' + dd;
var startDateStr = (list.startDate || '').trim();
var endDateStr = (list.endDate || '').trim();
var isFutureEvent = false;
if (startDateStr && startDateStr > todayStr) {
isFutureEvent = true;
} else if (endDateStr && endDateStr > todayStr) {
isFutureEvent = true;
}
if (isStatusEligible && !isFutureEvent && !hasEbDetails) {
$('#statusChangeSection').show();
$('#statusChangeNotAllowedMsg').hide();
$('#changeBookingStatusSelect').val('');
$('#statusChangeRemarks').val('');
} else {
$('#statusChangeSection').hide();
$('#statusChangeNotAllowedMsg').show();
$('#notAllowedCurrentStatusBadge').text(status || 'UNKNOWN');
if (isFutureEvent) {
$('#notAllowedDetailMsg').html('Booking dates (<strong>' + (startDateStr || 'N/A') + ' to ' + (endDateStr || 'N/A') + '</strong>) are in the future. CRO is <strong>not permitted</strong> to change the status for future events. Only <strong>completed events</strong> can be marked as <strong>REJECTED</strong> or <strong>GCC_BLOCKED</strong>.');
} else {
$('#notAllowedDetailMsg').html('Status change is only permitted for <strong>Past events</strong> with status <strong>APPROVED</strong>, <strong>WAITING_FOR_NOC</strong>, or <strong>WAITING_FOR_NOC_APPROVAL</strong>. EB Details must not have been entered for the booking.');
}
}
}
function getStatusBadgeClass(status) {
switch (status) {
case 'APPROVED': return 'bg-success';
case 'WAITING_FOR_NOC':
case 'WAITING_FOR_NOC_APPROVAL': return 'bg-warning text-dark';
case 'REJECTED':
case 'GCC_BLOCKED':
case 'CANCELED': return 'bg-danger';
case 'COMPLETED': return 'bg-info text-dark';
case 'PENDING': return 'bg-secondary';
default: return 'bg-primary';
}
}
function getSlotLabel(v) {
var s = String(v).trim();
if (s === '1') return 'Morning';
if (s === '2') return 'Evening';
return 'Unknown';
}
// ─── INITIATE STATUS CHANGE (Trigger OTP) ───
function initiateStatusChange() {
if (!currentSearchedBooking || !currentSearchedBooking.bookingId) {
Swal.fire({ icon: 'warning', title: 'No Booking Selected', text: 'Please search and select a booking first.' });
return;
}
// Check future event restriction
var today = new Date();
var todayStr = today.getFullYear() + '-' + String(today.getMonth() + 1).padStart(2, '0') + '-' + String(today.getDate()).padStart(2, '0');
var sDate = (currentSearchedBooking.startDate || '').trim();
var eDate = (currentSearchedBooking.endDate || '').trim();
if ((sDate && sDate > todayStr) || (eDate && eDate > todayStr)) {
Swal.fire({
icon: 'warning',
title: 'Action Not Allowed',
text: 'Status change is not permitted for future events. Only past events can be marked as REJECTED or GCC_BLOCKED.'
});
return;
}
var newStatus = $('#changeBookingStatusSelect').val();
if (!newStatus || (newStatus !== 'REJECTED' && newStatus !== 'GCC_BLOCKED')) {
Swal.fire({ icon: 'warning', title: 'Status Required', text: 'Please select a new Booking Status (REJECTED or GCC_BLOCKED).' });
return;
}
var remarks = $('#statusChangeRemarks').val().trim();
if (!remarks) {
Swal.fire({ icon: 'warning', title: 'Remarks Required', text: 'Please enter reason / remarks for this status change.' });
$('#statusChangeRemarks').focus();
return;
}
Swal.fire({
title: 'Confirm Status Change',
html: 'Are you sure you want to change Booking <b>#' + currentSearchedBooking.bookingId + '</b> status to <b class="text-danger">' + newStatus + '</b>?<br/><small class="text-muted">An OTP will be sent to your CRO mobile number to authorize this change.</small>',
icon: 'question',
showCancelButton: true,
confirmButtonText: 'Yes, Send OTP',
cancelButtonText: 'Cancel',
confirmButtonColor: '#d33'
}).then((result) => {
if (result.isConfirmed) {
sendCroStatusOtp(newStatus, remarks);
}
});
}
// ─── SEND CRO OTP ───
function sendCroStatusOtp(newStatus, remarks) {
Swal.fire({
title: 'Sending OTP...',
text: 'Please wait while OTP is sent to your registered mobile number.',
allowOutsideClick: false,
didOpen: () => { Swal.showLoading(); }
});
$.ajax({
type: 'GET',
url: '/communityhall/user/api/sendOTP',
data: {
mobileNo: croMobileNumber,
purpose: 'CRO Status Change'
},
success: function (bodyMessage) {
Swal.close();
if (bodyMessage && bodyMessage !== 'Error') {
var mobStr = String(croMobileNumber);
var maskedMobile = mobStr.length >= 10
? mobStr.substring(0, 2) + 'XXXXXX' + mobStr.substring(mobStr.length - 2)
: mobStr;
$('#croOtpMobileDisplay').text(maskedMobile || 'Registered CRO Number');
$('#modalBookingIdText').text('#' + currentSearchedBooking.bookingId);
$('#modalNewStatusText').text(newStatus);
$('#croOtpErrorAlert').hide().text('');
// Clear OTP boxes
$('.cro-otp-input').val('');
// Show modal
$('#croStatusOtpModal').modal('show');
setTimeout(function () { $('#croOtp1').focus(); }, 500);
// Start countdown
startCroCountdown();
} else {
Swal.fire({ icon: 'error', title: 'OTP Failed', text: 'Failed to send OTP. Please try again.' });
}
},
error: function () {
Swal.close();
Swal.fire({ icon: 'error', title: 'Error', text: 'Failed to send OTP. Please check your network connection.' });
}
});
}
// ─── COUNTDOWN TIMER FOR RESEND OTP ───
function startCroCountdown() {
if (croResendTimer) clearInterval(croResendTimer);
var timeLeft = 60;
$('#croResendText').text('Please wait..');
$('#croCountdown').text(timeLeft);
croResendTimer = setInterval(function () {
timeLeft--;
$('#croCountdown').text(timeLeft);
if (timeLeft <= 0) {
clearInterval(croResendTimer);
$('#croResendText').html('<a href="javascript:void(0)" class="text-info" onclick="resendCroOtp()">Resend OTP</a>');
$('#croCountdown').text('');
}
}, 1000);
}
function resendCroOtp() {
var newStatus = $('#changeBookingStatusSelect').val();
var remarks = $('#statusChangeRemarks').val().trim();
sendCroStatusOtp(newStatus, remarks);
}
// ─── VERIFY OTP & SUBMIT STATUS CHANGE ───
function verifyAndSubmitStatusChange() {
var otpValue = '';
for (var i = 1; i <= 5; i++) {
otpValue += ($('#croOtp' + i).val() || '').trim();
}
if (otpValue.length !== 5 || isNaN(otpValue)) {
$('#croOtpErrorAlert').text('Please enter the complete 5-digit OTP.').show();
return;
}
var newStatus = $('#changeBookingStatusSelect').val();
var remarks = $('#statusChangeRemarks').val().trim();
var bookingId = currentSearchedBooking.bookingId;
$('#btnVerifyCroOtp').prop('disabled', true).html('<i class="fa fa-spinner fa-spin me-1"></i> Verifying...');
$('#croOtpErrorAlert').hide();
$.ajax({
type: 'POST',
url: '/communityhall/cro/api/updateBookingStatus',
data: {
bookingId: bookingId,
status: newStatus,
comments: remarks,
otp: otpValue
},
success: function (response) {
$('#btnVerifyCroOtp').prop('disabled', false).html('<i class="fa fa-check-circle me-1"></i> Verify & Update Status');
if (response && response.status === 'success') {
$('#croStatusOtpModal').modal('hide');
if (croResendTimer) clearInterval(croResendTimer);
Swal.fire({
icon: 'success',
title: 'Status Updated!',
html: 'Booking <b>#' + bookingId + '</b> status has been successfully changed to <b class="text-danger">' + newStatus + '</b>.',
confirmButtonText: 'OK'
}).then(() => {
// Re-fetch booking details to update view in real-time
searchBookingById();
});
} else {
var errMsg = (response && response.message) || 'Failed to update status.';
$('#croOtpErrorAlert').text(errMsg).show();
}
},
error: function (xhr) {
$('#btnVerifyCroOtp').prop('disabled', false).html('<i class="fa fa-check-circle me-1"></i> Verify & Update Status');
var errMsg = 'Verification failed. Please try again.';
if (xhr.responseJSON && xhr.responseJSON.message) {
errMsg = xhr.responseJSON.message;
} else if (xhr.responseText) {
try {
var parsed = JSON.parse(xhr.responseText);
if (parsed.message) errMsg = parsed.message;
} catch (e) { }
}
$('#croOtpErrorAlert').text(errMsg).show();
}
});
}
</script>
</div>
</body>
</html>

860
src/main/resources/templates/cro/noc-details.html

@ -0,0 +1,860 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/head-cro :: head}"></head>
<style>
.card-body table {
width: 100%;
padding: 100px;
}
.card-body th,
td {
padding: 8px;
text-align: left;
}
.amount-cell {
text-align: right;
padding-right: 1rem;
}
.form-control[readonly] {
background-color: white;
}
.modal {
overflow-y: auto;
}
/* OTP inputs */
.otp-input-box {
display: flex;
justify-content: center;
gap: 10px;
}
.cro-otp-input {
width: 48px;
height: 52px;
text-align: center;
font-size: 22px;
font-weight: bold;
border: 2px solid #ced4da;
border-radius: 8px;
transition: all 0.2s ease-in-out;
}
.cro-otp-input:focus {
border-color: #0d6efd;
outline: none;
box-shadow: 0 0 0 4px rgba(13, 110, 253, .2);
}
#bookingSearchSection {
border: 1px solid #dee2e6;
border-radius: 8px;
padding: 20px;
background: #f8f9fa;
margin-bottom: 20px;
}
.detail-section th {
background-color: #f2f2f2;
font-weight: 600;
}
.detail-section td,
.detail-section th {
padding: 0.45rem 0.75rem;
border: 1px solid #dee2e6;
}
.detail-section table {
width: 100%;
border-collapse: collapse;
margin-bottom: 10px;
}
#bookingDetailResult {
display: none;
}
.noc-section-card {
border: 2px solid #e2e8f0;
border-radius: 10px;
background: #ffffff;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
padding: 24px;
margin-top: 25px;
}
.status-badge-lg {
font-size: 0.95rem;
padding: 0.35rem 0.75rem;
border-radius: 6px;
font-weight: 600;
}
</style>
<body>
<!-- Page Container -->
<div id="page-container"
class="sidebar-o sidebar-dark enable-page-overlay side-scroll page-header-fixed page-header-dark">
<!-- Sidebar Nav-->
<aside th:replace="~{fragments/aside-right :: aside}"></aside>
<!-- END Side Overlay (right)-->
<!-- Sidebar Nav-->
<nav th:replace="~{fragments/nav-cro :: nav}"></nav>
<!-- END Sidebar -->
<!-- Header -->
<header th:replace="~{fragments/header-cro :: header}"></header>
<!-- Main Container -->
<main id="main-container">
<div class="content">
<!-- ═══ Search Booking by ID ═══ -->
<div class="block block-rounded">
<div class="block-header block-header-default">
<h3 class="block-title"><i class="fa fa-file-contract me-2 text-primary"></i>NOC Document
Management</h3>
</div>
<div class="block-content p-4">
<div id="bookingSearchSection">
<div class="row align-items-end">
<div class="col-md-4 mb-2">
<label class="form-label fw-semibold" for="searchBookingId">Booking ID <span
class="text-danger">*</span></label>
<input type="number" class="form-control" id="searchBookingId"
placeholder="Enter Booking ID" min="1" />
</div>
<div class="col-md-3 mb-2">
<button type="button" class="btn btn-primary" id="btnSearchBooking"
onclick="searchBookingById()">
<i class="fa fa-search me-1"></i> Search
</button>
<button type="button" class="btn btn-secondary ms-2" id="btnClearBookingSearch"
onclick="clearBookingSearch()">
<i class="fa fa-times me-1"></i> Clear
</button>
</div>
</div>
</div>
<!-- Booking Detail Result -->
<div id="bookingDetailResult">
<hr />
<div class="d-flex justify-content-between align-items-center mb-3">
<h5 class="mb-0">Booking Details <span class="text-primary" id="resultBookingId"></span>
</h5>
<div>
<span id="res_bookingReasonBadge"
class="badge status-badge-lg bg-primary me-2"></span>
<span id="res_bookingStatusBadge" class="badge status-badge-lg bg-info"></span>
</div>
</div>
<div class="detail-section">
<!-- User Details -->
<table>
<tr>
<th colspan="6">User Details</th>
</tr>
<tr>
<th style="font-weight:normal;">User Name:</th>
<td id="res_userName"></td>
<th style="font-weight:normal;">Mobile Number:</th>
<td id="res_mobileNumber"></td>
<th style="font-weight:normal;">User Type:</th>
<td id="res_usertype"></td>
</tr>
<tr>
<th style="font-weight:normal;">User Address:</th>
<td colspan="5" id="res_useraddress"></td>
</tr>
</table>
<!-- Hall Details -->
<table>
<tr>
<th colspan="6">Hall Details</th>
</tr>
<tr>
<th style="font-weight:normal;">Hall Name:</th>
<td colspan="5" id="res_hallName"></td>
</tr>
<tr>
<th style="font-weight:normal;">Hall Address:</th>
<td colspan="5" id="res_halladdress"></td>
</tr>
<tr>
<th style="font-weight:normal;">Caretaker Name:</th>
<td id="res_caretakername"></td>
<th style="font-weight:normal;">Caretaker Mobile:</th>
<td colspan="3" id="res_caretakermobileNumber"></td>
</tr>
</table>
<!-- Booking Details -->
<table>
<tr>
<th colspan="4">Booking Details (Booking Id: <span id="res_booking_id"
style="color:blue;"></span>)</th>
</tr>
<tr>
<th style="font-weight:normal;">Booking Date:</th>
<td id="res_bookingDate"></td>
<th style="font-weight:normal;">Booking Status:</th>
<td id="res_bookingStatus" class="fw-bold"></td>
</tr>
<tr>
<th style="font-weight:normal;">Start Date:</th>
<td id="res_startDate"></td>
<th style="font-weight:normal;">Deposit Amount:</th>
<td class="amount-cell" id="res_depositeAmount"></td>
</tr>
<tr>
<th style="font-weight:normal;">End Date:</th>
<td id="res_endDate"></td>
<th style="font-weight:normal;">Hall Amount:</th>
<td class="amount-cell" id="res_hallAmount"></td>
</tr>
<tr>
<th style="font-weight:normal;">Starting Slot:</th>
<td id="res_startingSlot"></td>
<th style="font-weight:normal;">GST @18%:</th>
<td class="amount-cell" id="res_gst"></td>
</tr>
<tr>
<th style="font-weight:normal;">Ending Slot:</th>
<td id="res_endingSlot"></td>
<th style="font-weight:normal;">Total Amount:</th>
<td class="amount-cell" id="res_totalAmount"></td>
</tr>
<tr>
<th style="font-weight:normal;">Reason:</th>
<td colspan="3" id="res_reason" class="fw-bold text-primary"></td>
</tr>
</table>
<!-- Payment Details -->
<table>
<tr>
<th colspan="4">Booking Payment Details</th>
</tr>
<tr>
<th style="font-weight:normal;">Transaction ID:</th>
<td colspan="3" id="res_transactionId"></td>
</tr>
<tr>
<th style="font-weight:normal;">Amount Received:</th>
<td id="res_payamountReceived"></td>
<th style="font-weight:normal;">Transaction Status:</th>
<td id="res_paymentStatus"></td>
</tr>
</table>
</div>
<!-- ═══ Uploaded NOC Documents Section (CRO) ═══ -->
<div id="nocDocumentsSection" class="noc-section-card" style="display: none;">
<div class="d-flex align-items-center justify-content-between mb-3">
<div class="d-flex align-items-center">
<div class="p-2 rounded-3 me-3" style="background: rgba(13,110,253,0.1);">
<i class="fa fa-file-pdf fa-lg text-primary"></i>
</div>
<div>
<h5 class="mb-0 fw-bold text-dark">Uploaded NOC Documents</h5>
<small class="text-muted">CRO can review and delete uploaded NOC documents
with OTP verification</small>
</div>
</div>
<button type="button" class="btn btn-sm btn-outline-primary"
onclick="refreshNocDocuments()">
<i class="fa fa-sync-alt me-1"></i> Refresh Documents
</button>
</div>
<div id="nocDocListContainer">
<!-- Dynamic NOC documents table loaded here -->
</div>
</div>
<!-- ═══ Not Allowed Info Box ═══ -->
<div id="nocNotAllowedMsg" style="display: none; margin-top: 20px;">
<div class="alert alert-secondary mb-0">
<i class="fa fa-info-circle me-2"></i>
NOC document view and deletion is only permitted for bookings with status
<strong>WAITING_FOR_NOC_APPROVAL</strong> and reason
<strong>Commercial</strong>, <strong>State Govt Event</strong>, or <strong>Central
Govt Event</strong>. EB Details must not have been entered.
<br />
<span class="small mt-1 d-inline-block">
Current Status: <span class="badge bg-dark" id="notAllowedStatusBadge"></span> |
Current Reason: <span class="badge bg-dark" id="notAllowedReasonBadge"></span>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<!-- END Main Container -->
<!-- ═══ NOC Document Preview Modal ═══ -->
<div class="modal fade" id="nocFilePreviewModal" tabindex="-1" role="dialog"
aria-labelledby="nocFilePreviewModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
<div class="modal-content border-0 shadow-lg">
<div class="modal-header bg-dark text-white">
<h5 class="modal-title m-0 text-white" id="nocFilePreviewModalLabel">
<i class="fa fa-file-alt me-2"></i>NOC Document Preview
</h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"
aria-label="Close"></button>
</div>
<div class="modal-body p-0 text-center" style="min-height: 480px; background: #525659;">
<div id="previewSpinner" class="p-5 text-white">
<i class="fa fa-spinner fa-spin fa-2x"></i>
<p class="mt-2">Loading document preview...</p>
</div>
<iframe id="nocPreviewFrame" src=""
style="width: 100%; height: 550px; border: none; display: none;"></iframe>
<img id="nocPreviewImage" src="" class="img-fluid p-2" style="max-height: 550px; display: none;"
alt="NOC Document" />
</div>
<div class="modal-footer bg-light justify-content-between">
<a id="nocDownloadLink" href="" target="_blank" class="btn btn-outline-primary btn-sm">
<i class="fa fa-external-link-alt me-1"></i> Open in New Tab
</a>
<button type="button" class="btn btn-secondary btn-sm" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- ════ CRO NOC DELETE OTP MODAL (MATCHES cro/booking-list.html) ════ -->
<div class="modal fade" id="croDeleteDocOtpModal" tabindex="-1" role="dialog"
aria-labelledby="croDeleteDocOtpModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title m-0" id="croDeleteDocOtpModalLabel">OTP Verification</h6>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="row">
<div class="mb-3 text-center">
<img src="media/images/mobileotp.png" width="50%" alt="OTP">
</div>
<div class="mb-0 text-center">
<h4>OTP Verification</h4>
<p class="text-mute">Enter the OTP sent to <b class="text-info"
id="croDeleteDocOtpMobileDisplay"></b></p>
<p class="text-danger" id="croDeleteDocOtpErrorAlert"></p>
</div>
<div class="mb-3 text-start px-4">
<label class="form-label fw-semibold small" for="croDeleteDocRemarks">
Reason for Deletion <span class="text-danger">*</span>
</label>
<input type="text" class="form-control form-control-sm" id="croDeleteDocRemarks"
placeholder="Enter reason for deleting NOC document..." />
</div>
<div class="mb-3 text-center">
<div class="otp-input-box">
<input type="text" maxlength="1" class="otp-input cro-otp-input" id="croDelOtp1"
required />
<input type="text" maxlength="1" class="otp-input cro-otp-input" id="croDelOtp2"
required />
<input type="text" maxlength="1" class="otp-input cro-otp-input" id="croDelOtp3"
required />
<input type="text" maxlength="1" class="otp-input cro-otp-input" id="croDelOtp4"
required />
<input type="text" maxlength="1" class="otp-input cro-otp-input" id="croDelOtp5"
required />
</div>
</div>
<div class="mb-3 text-center">
<p class="mb-0">Didn't receive OTP?</p>
<p class="mb-0 text-info">
<span id="croDeleteDocResendText">Please wait..</span>
<span id="croDeleteDocCountdown">60</span>s
</p>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary btn-sm" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary btn-sm" id="btnVerifyDeleteDocOtp"
onclick="verifyAndSubmitDocDelete()">Verify OTP</button>
</div>
</div>
</div>
</div>
<footer th:replace="~{fragments/footer2 :: footer}"></footer>
<div th:replace="~{fragments/resetpassword :: div}"></div>
<script th:replace="~{fragments/loginscript :: script}"></script>
<script>
var currentSearchedBooking = null;
var croMobileNumber = [[${ mobileno }]];
var pendingDeleteDocId = null;
var pendingDeleteDocName = null;
var croDeleteDocResendTimer = null;
// ─── SEARCH BOOKING BY ID ───
function searchBookingById() {
var input = document.getElementById('searchBookingId');
var bookingId = input ? input.value.trim() : '';
if (!bookingId || isNaN(bookingId) || parseInt(bookingId) <= 0) {
Swal.fire({ icon: 'warning', title: 'Invalid Input', text: 'Please enter a valid Booking ID.' });
return;
}
Swal.fire({
title: 'Fetching Booking...',
text: 'Please wait while booking details are retrieved.',
allowOutsideClick: false,
didOpen: () => { Swal.showLoading(); }
});
$.ajax({
type: 'GET',
url: '/communityhall/cro/api/getBookingById',
data: { bookingId: bookingId },
success: function (data) {
Swal.close();
if (data && data.bookingId) {
currentSearchedBooking = data;
populateBookingDetails(data);
$('#bookingDetailResult').show();
} else {
Swal.fire({ icon: 'error', title: 'Not Found', text: 'No booking found for ID: ' + bookingId });
$('#bookingDetailResult').hide();
}
},
error: function (xhr) {
Swal.close();
var msg = (xhr.status === 404) ? 'Booking ID ' + bookingId + ' does not exist.' : 'Error fetching booking.';
Swal.fire({ icon: 'error', title: 'Error', text: msg });
$('#bookingDetailResult').hide();
}
});
}
// ─── CLEAR BOOKING SEARCH ───
function clearBookingSearch() {
var input = document.getElementById('searchBookingId');
if (input) input.value = '';
$('#bookingDetailResult').hide();
currentSearchedBooking = null;
}
$(document).ready(function () {
$('#searchBookingId').on('keypress', function (e) {
if (e.key === 'Enter') searchBookingById();
});
// OTP inputs navigation
$('.cro-otp-input').on('keyup', function (e) {
var $this = $(this);
if (e.key === 'Backspace' || e.key === 'Delete') {
if ($this.val().length === 0) {
$this.prev('.cro-otp-input').focus();
}
} else if (e.key >= '0' && e.key <= '9') {
if ($this.val().length === 1) {
$this.next('.cro-otp-input').focus();
}
}
});
// Paste handling for OTP inputs
$('#croDelOtp1').on('paste', function (e) {
var pasteData = (e.originalEvent.clipboardData || window.clipboardData).getData('text').trim();
if (/^\d{5}$/.test(pasteData)) {
e.preventDefault();
for (var i = 0; i < 5; i++) {
$('#croDelOtp' + (i + 1)).val(pasteData[i]);
}
$('#croDelOtp5').focus();
}
});
});
// ─── POPULATE BOOKING DETAILS ───
function populateBookingDetails(list) {
var ud = list.users || {};
var hd = list.hallDetails || {};
var py = list.payments || {};
document.getElementById('res_userName').innerHTML = ud.name || 'N/A';
document.getElementById('res_mobileNumber').innerHTML = ud.mobileNo || 'N/A';
document.getElementById('res_usertype').innerHTML = ud.usertype || 'N/A';
document.getElementById('res_useraddress').innerHTML = ud.doorNo ? ud.doorNo + ', ' + ud.street + ', ' + ud.area + ', ' + ud.location + '- ' + ud.pinCode : 'N/A';
document.getElementById('res_hallName').innerHTML = hd.hallName || 'N/A';
document.getElementById('res_halladdress').innerHTML = hd.doorNo ? hd.doorNo + ', ' + hd.street + ', ' + hd.area + ', ' + hd.city + '- ' + hd.pinCode : 'N/A';
document.getElementById('res_caretakername').innerHTML = hd.hallInchargeName || 'N/A';
document.getElementById('res_caretakermobileNumber').innerHTML = hd.hallInchargeMobno || 'N/A';
document.getElementById('res_booking_id').innerHTML = list.bookingId;
document.getElementById('resultBookingId').innerHTML = ' #' + list.bookingId;
document.getElementById('res_bookingDate').innerHTML = list.bookingDate || 'N/A';
document.getElementById('res_bookingStatus').innerHTML = list.bookingStatus || 'N/A';
document.getElementById('res_startDate').innerHTML = list.startDate || 'N/A';
document.getElementById('res_endDate').innerHTML = list.endDate || 'N/A';
document.getElementById('res_depositeAmount').innerHTML = list.depositAmount ? '&#8377; ' + parseFloat(list.depositAmount).toFixed(2) : 'N/A';
document.getElementById('res_hallAmount').innerHTML = list.hallAmount ? '&#8377; ' + parseFloat(list.hallAmount).toFixed(2) : 'N/A';
document.getElementById('res_totalAmount').innerHTML = list.amountReceived ? '&#8377; ' + parseFloat(list.amountReceived).toFixed(2) : 'N/A';
var gst = (list.hallAmount && hd.gst) ? (parseFloat(list.hallAmount) * (hd.gst / 100)).toFixed(2) : '0.00';
document.getElementById('res_gst').innerHTML = '&#8377; ' + gst;
document.getElementById('res_startingSlot').innerHTML = getSlotLabel(list.startingSlot);
document.getElementById('res_endingSlot').innerHTML = getSlotLabel(list.endingSlot);
document.getElementById('res_reason').innerHTML = list.reason || 'N/A';
document.getElementById('res_transactionId').innerHTML = py.transactionId || 'NA';
document.getElementById('res_payamountReceived').innerHTML = py.amountReceived ? '&#8377; ' + py.amountReceived : 'NA';
document.getElementById('res_paymentStatus').innerHTML = py.paymentStatus || 'NA';
// Reason & Status Badges
var reason = (list.reason || '').trim();
var status = (list.bookingStatus || '').toUpperCase().trim();
var reasonBadge = document.getElementById('res_bookingReasonBadge');
reasonBadge.textContent = 'Reason: ' + (reason || 'N/A');
var statusBadge = document.getElementById('res_bookingStatusBadge');
statusBadge.textContent = status;
statusBadge.className = 'badge status-badge-lg ' + getStatusBadgeClass(status);
// ─── Check NOC Eligibility ───
// 1) Reason in ['Commercial', 'State Govt Event', 'Central Govt Event']
// 2) Status is WAITING_FOR_NOC_APPROVAL
var eligibleReasons = ['commercial', 'state govt event', 'central govt event'];
var isReasonEligible = eligibleReasons.indexOf(reason.toLowerCase()) !== -1;
var isStatusEligible = (status === 'WAITING_FOR_NOC_APPROVAL');
var hasEbDetails = list.ebDetails != null && (list.ebDetails.id != null || list.ebDetails.startingReading != null);
if (isReasonEligible && isStatusEligible && !hasEbDetails) {
$('#nocDocumentsSection').show();
$('#nocNotAllowedMsg').hide();
loadNocDocuments(list.bookingId);
} else {
$('#nocDocumentsSection').hide();
$('#nocNotAllowedMsg').show();
$('#notAllowedStatusBadge').text(status || 'UNKNOWN');
$('#notAllowedReasonBadge').text(reason || 'UNKNOWN');
}
}
function getStatusBadgeClass(status) {
switch (status) {
case 'APPROVED': return 'bg-success';
case 'WAITING_FOR_NOC':
case 'WAITING_FOR_NOC_APPROVAL': return 'bg-warning text-dark';
case 'REJECTED':
case 'GCC_BLOCKED':
case 'CANCELED': return 'bg-danger';
case 'COMPLETED': return 'bg-info text-dark';
case 'PENDING': return 'bg-secondary';
default: return 'bg-primary';
}
}
function getSlotLabel(v) {
var s = String(v).trim();
if (s === '1') return 'Morning';
if (s === '2') return 'Evening';
return 'Unknown';
}
function refreshNocDocuments() {
if (currentSearchedBooking && currentSearchedBooking.bookingId) {
loadNocDocuments(currentSearchedBooking.bookingId);
}
}
// ─── LOAD NOC DOCUMENTS ───
function loadNocDocuments(bookingId) {
$('#nocDocListContainer').html('<div class="text-center py-4 text-muted"><i class="fa fa-spinner fa-spin me-2"></i>Loading uploaded NOC documents...</div>');
$.ajax({
type: 'GET',
url: '/communityhall/cro/api/getBookingDocuments',
data: { bookingId: bookingId },
success: function (docs) {
if (!docs || !Array.isArray(docs) || docs.length === 0) {
$('#nocDocListContainer').html('<div class="alert alert-info mb-0"><i class="fa fa-info-circle me-2"></i>No documents uploaded for this booking.</div>');
return;
}
// Filter documents where bookingDocUrl contains /communityhall/images/NOC/ or /images/noc/
var nocDocs = docs.filter(function (doc) {
var url = (doc.bookingDocUrl || '').toLowerCase();
return url.indexOf('/images/noc/') !== -1;
});
if (nocDocs.length === 0) {
$('#nocDocListContainer').html('<div class="alert alert-warning mb-0"><i class="fa fa-exclamation-triangle me-2"></i>No NOC document uploaded for this booking yet (other general documents may exist).</div>');
return;
}
// Determine currently/latest uploaded NOC document by highest bookingDocId
var latestDocId = Math.max.apply(Math, nocDocs.map(function (d) { return d.bookingDocId; }));
var html = '<div class="table-responsive"><table class="table table-bordered table-striped align-middle mb-0">';
html += '<thead class="table-light"><tr>';
html += '<th style="width: 50px;">#</th>';
html += '<th>Document Name / File</th>';
html += '<th>Document Type</th>';
html += '<th style="width: 120px;" class="text-center">Preview</th>';
html += '<th style="width: 170px;" class="text-center">Action</th>';
html += '</tr></thead><tbody>';
nocDocs.forEach(function (doc, idx) {
var docName = doc.documentName || doc.name || ('NOC_Document_' + doc.bookingDocId);
var docType = doc.documentType || 'application/pdf';
var docUrl = doc.bookingDocUrl || '';
var isCurrent = (doc.bookingDocId === latestDocId);
html += '<tr>';
html += '<td>' + (idx + 1) + '</td>';
html += '<td><i class="fa fa-file-pdf text-danger me-2"></i><strong>' + escapeHtml(docName) + '</strong>';
if (isCurrent) {
html += ' <span class="badge bg-success ms-2">Current NOC</span>';
} else {
html += ' <span class="badge bg-secondary ms-2">Previous NOC</span>';
}
html += '</td>';
html += '<td><span class="badge bg-secondary">' + escapeHtml(docType) + '</span></td>';
html += '<td class="text-center">';
html += '<button type="button" class="btn btn-sm btn-info text-white" onclick="previewNocDoc(\'' + encodeURIComponent(docUrl) + '\', \'' + encodeURIComponent(docName) + '\')">';
html += '<i class="fa fa-eye me-1"></i> View';
html += '</button>';
html += '</td>';
html += '<td class="text-center">';
if (isCurrent) {
html += '<button type="button" class="btn btn-sm btn-danger" onclick="initiateDeleteNocDoc(' + doc.bookingDocId + ', \'' + escapeHtml(docName) + '\')">';
html += '<i class="fa fa-trash-alt me-1"></i> Delete Document';
html += '</button>';
} else {
html += '<span class="text-muted small"><i class="fa fa-lock me-1"></i>View Only</span>';
}
html += '</td>';
html += '</tr>';
});
html += '</tbody></table></div>';
$('#nocDocListContainer').html(html);
},
error: function () {
$('#nocDocListContainer').html('<div class="alert alert-danger mb-0"><i class="fa fa-times me-2"></i>Error loading documents. Please try again.</div>');
}
});
}
function escapeHtml(str) {
if (!str) return '';
return String(str)
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#039;');
}
// ─── PREVIEW NOC DOCUMENT ───
function previewNocDoc(encodedUrl, encodedName) {
var url = decodeURIComponent(encodedUrl);
var name = decodeURIComponent(encodedName);
$('#nocFilePreviewModalLabel').html('<i class="fa fa-file-pdf me-2 text-danger"></i>' + escapeHtml(name));
$('#nocDownloadLink').attr('href', url);
$('#previewSpinner').show();
$('#nocPreviewFrame').hide();
$('#nocPreviewImage').hide();
$('#nocFilePreviewModal').modal('show');
var isImage = url.match(/\.(jpeg|jpg|gif|png|webp)$/i);
if (isImage) {
$('#nocPreviewImage').attr('src', url).on('load', function () {
$('#previewSpinner').hide();
$('#nocPreviewImage').show();
});
} else {
$('#nocPreviewFrame').attr('src', url).on('load', function () {
$('#previewSpinner').hide();
$('#nocPreviewFrame').show();
});
setTimeout(function () {
$('#previewSpinner').hide();
$('#nocPreviewFrame').show();
}, 800);
}
}
// ─── INITIATE NOC DOCUMENT DELETE (TRIGGER OTP) ───
function initiateDeleteNocDoc(docId, docName) {
if (!currentSearchedBooking || !currentSearchedBooking.bookingId) {
Swal.fire({ icon: 'warning', title: 'No Booking Selected', text: 'Please search and select a booking first.' });
return;
}
pendingDeleteDocId = docId;
pendingDeleteDocName = docName;
Swal.fire({
title: 'Delete NOC Document?',
html: 'Are you sure you want to delete NOC Document <b>"' + escapeHtml(docName) + '"</b> for Booking <b>#' + currentSearchedBooking.bookingId + '</b>?<br/><small class="text-danger">An OTP will be sent to your CRO registered mobile number to authorize this deletion.</small>',
icon: 'warning',
showCancelButton: true,
confirmButtonText: 'Yes, Send OTP & Proceed',
cancelButtonText: 'Cancel',
confirmButtonColor: '#dc3545'
}).then((result) => {
if (result.isConfirmed) {
sendDeleteDocOtp();
}
});
}
// ─── SEND OTP FOR DOCUMENT DELETION ───
function sendDeleteDocOtp() {
Swal.fire({
title: 'Sending OTP...',
text: 'Please wait while OTP is sent to your registered CRO mobile number.',
allowOutsideClick: false,
didOpen: () => { Swal.showLoading(); }
});
$.ajax({
type: 'GET',
url: '/communityhall/user/api/sendOTP',
data: {
mobileNo: croMobileNumber,
purpose: 'Delete NOC Document'
},
success: function (bodyMessage) {
Swal.close();
if (bodyMessage && bodyMessage !== 'Error') {
var mobStr = String(croMobileNumber);
var maskedMobile = mobStr.length >= 10
? mobStr.substring(0, 2) + 'XXXXXX' + mobStr.substring(mobStr.length - 2)
: mobStr;
$('#croDeleteDocOtpMobileDisplay').text(maskedMobile || 'Registered CRO Number');
$('#modalDeleteBookingIdText').text('#' + currentSearchedBooking.bookingId);
$('#modalDeleteDocNameText').text(pendingDeleteDocName || ('ID: ' + pendingDeleteDocId));
$('#croDeleteDocRemarks').val('');
$('#croDeleteDocOtpErrorAlert').hide().text('');
// Clear OTP inputs
$('.cro-otp-input').val('');
// Show modal
$('#croDeleteDocOtpModal').modal('show');
setTimeout(function () { $('#croDelOtp1').focus(); }, 500);
// Start countdown
startDeleteDocCountdown();
} else {
Swal.fire({ icon: 'error', title: 'OTP Failed', text: 'Failed to send OTP. Please try again.' });
}
},
error: function () {
Swal.close();
Swal.fire({ icon: 'error', title: 'Error', text: 'Failed to send OTP. Please check your network connection.' });
}
});
}
function startDeleteDocCountdown() {
if (croDeleteDocResendTimer) clearInterval(croDeleteDocResendTimer);
var timeLeft = 60;
$('#croDeleteDocResendText').text('Please wait..');
$('#croDeleteDocCountdown').text(timeLeft);
croDeleteDocResendTimer = setInterval(function () {
timeLeft--;
$('#croDeleteDocCountdown').text(timeLeft);
if (timeLeft <= 0) {
clearInterval(croDeleteDocResendTimer);
$('#croDeleteDocResendText').html('<a href="javascript:void(0)" class="text-info" onclick="sendDeleteDocOtp()">Resend OTP</a>');
$('#croDeleteDocCountdown').text('');
}
}, 1000);
}
// ─── VERIFY OTP & SUBMIT DOCUMENT DELETE ───
function verifyAndSubmitDocDelete() {
var otpValue = '';
for (var i = 1; i <= 5; i++) {
otpValue += ($('#croDelOtp' + i).val() || '').trim();
}
if (otpValue.length !== 5 || isNaN(otpValue)) {
$('#croDeleteDocOtpErrorAlert').text('Please enter the complete 5-digit OTP.').show();
return;
}
var remarks = $('#croDeleteDocRemarks').val().trim();
if (!remarks) {
$('#croDeleteDocOtpErrorAlert').text('Please enter a reason for deletion.').show();
$('#croDeleteDocRemarks').focus();
return;
}
var bookingId = currentSearchedBooking.bookingId;
var bookingDocId = pendingDeleteDocId;
$('#btnVerifyDeleteDocOtp').prop('disabled', true).html('<i class="fa fa-spinner fa-spin me-1"></i> Deleting...');
$('#croDeleteDocOtpErrorAlert').hide();
$.ajax({
type: 'POST',
url: '/communityhall/cro/api/deleteNocDocument',
data: {
bookingId: bookingId,
bookingDocId: bookingDocId,
otp: otpValue,
comments: remarks
},
success: function (response) {
$('#btnVerifyDeleteDocOtp').prop('disabled', false).html('<i class="fa fa-trash-alt me-1"></i> Verify & Delete Document');
if (response && response.status === 'success') {
$('#croDeleteDocOtpModal').modal('hide');
if (croDeleteDocResendTimer) clearInterval(croDeleteDocResendTimer);
Swal.fire({
icon: 'success',
title: 'NOC Status Updated!',
html: 'NOC document rejected/removed successfully.<br/>Booking <b>#' + bookingId + '</b> status is now <b class="text-warning">WAITING_FOR_NOC</b>.',
confirmButtonText: 'OK'
}).then(() => {
// Re-fetch booking details to update view in real-time
searchBookingById();
});
} else {
var errMsg = (response && response.message) || 'Failed to delete NOC document.';
$('#croDeleteDocOtpErrorAlert').text(errMsg).show();
}
},
error: function (xhr) {
$('#btnVerifyDeleteDocOtp').prop('disabled', false).html('<i class="fa fa-trash-alt me-1"></i> Verify & Delete Document');
var errMsg = 'Verification failed. Please try again.';
if (xhr.responseJSON && xhr.responseJSON.message) {
errMsg = xhr.responseJSON.message;
} else if (xhr.responseText) {
try {
var parsed = JSON.parse(xhr.responseText);
if (parsed.message) errMsg = parsed.message;
} catch (e) { }
}
$('#croDeleteDocOtpErrorAlert').text(errMsg).show();
}
});
}
</script>
</div>
</body>
</html>

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

@ -46,8 +46,9 @@
style="font-weight: bold; background-color: #404E67; color: white; padding: 8px; border-radius: 5px;"> style="font-weight: bold; background-color: #404E67; color: white; padding: 8px; border-radius: 5px;">
Payment Details:</h6> Payment Details:</h6>
<!-- Check if payments is not null -->
<div th:if="${bookingsDetails.payments != null}">
<!-- Check if booking is APPROVED / WAITING_FOR_NOC and payment is Success -->
<div
th:if="${bookingsDetails.payments != null and (bookingsDetails.bookingStatus.name() == 'APPROVED' or bookingsDetails.bookingStatus.name() == 'WAITING_FOR_NOC') and bookingsDetails.payments.paymentStatus == 'Success'}">
<!-- Transaction Id --> <!-- Transaction Id -->
<p><strong>Transaction Id:</strong> <p><strong>Transaction Id:</strong>
<span <span
@ -69,11 +70,19 @@
</p> </p>
</div> </div>
<!-- Display NA if payments is null -->
<div th:if="${bookingsDetails.payments == null}">
<p><strong>Transaction Id:</strong> <span>NA</span></p>
<p><strong>Payment Status:</strong> <span>NA</span></p>
<p><strong>Total Amount Paid:</strong> <span>NA</span></p>
<!-- Display failure message otherwise -->
<div
th:unless="${bookingsDetails.payments != null and (bookingsDetails.bookingStatus.name() == 'APPROVED' or bookingsDetails.bookingStatus.name() == 'WAITING_FOR_NOC') and bookingsDetails.payments.paymentStatus == 'Success'}">
<p><strong>Transaction Id:</strong>
<span
th:text="${bookingsDetails.payments.transactionId != null ? bookingsDetails.payments.transactionId : 'NA'}"></span>
</p>
<p><strong>Payment Status:</strong>
<span class="text-danger fw-bold">Payment Not Confirmed.</span>
</p>
<p class="text-danger fw-bold" style="margin-top: 5px;">
If your amount is debited, it will be refunded with in 7 to 15 working days.
</p>
</div> </div>
</div> </div>
@ -139,18 +148,24 @@
<p <p
th:if="${bookingsDetails.bookingStatus.name() == 'REFUNDED' && bookingsDetails.refundStatus.name() == 'WAITING'}"> th:if="${bookingsDetails.bookingStatus.name() == 'REFUNDED' && bookingsDetails.refundStatus.name() == 'WAITING'}">
<strong>Booking Status:</strong> <strong>Booking Status:</strong>
<span style="background-color: red;font-weight: bold; padding: 2px 5px;color:white">FAILURE</span><br><br>
<span
style="background-color: red;font-weight: bold; padding: 2px 5px;color:white">FAILURE</span><br><br>
<strong>Refund Status:</strong> <strong>Refund Status:</strong>
<span style="background-color: yellow; font-weight: bold; padding: 2px 5px;">Refund has to be initiated.</span>
<span
style="background-color: yellow; font-weight: bold; padding: 2px 5px;">Refund
has to be initiated.</span>
</p> </p>
<!-- If booking status is 'Refunded' and refund status is 'Completed', display refund initiated message --> <!-- If booking status is 'Refunded' and refund status is 'Completed', display refund initiated message -->
<p <p
th:if="${bookingsDetails.bookingStatus.name() == 'REFUNDED' && bookingsDetails.refundStatus.name() == 'COMPLETED'}"> th:if="${bookingsDetails.bookingStatus.name() == 'REFUNDED' && bookingsDetails.refundStatus.name() == 'COMPLETED'}">
<strong>Booking Status:</strong> <strong>Booking Status:</strong>
<span style="background-color: red;font-weight: bold; padding: 2px 5px;color:white">FAILURE</span><br><br>
<span
style="background-color: red;font-weight: bold; padding: 2px 5px;color:white">FAILURE</span><br><br>
<strong>Refund Status:</strong> <strong>Refund Status:</strong>
<span style="background-color: green; font-weight: bold; padding: 2px 5px;color:white;">Refund Initiated.</span>
<span
style="background-color: green; font-weight: bold; padding: 2px 5px;color:white;">Refund
Initiated.</span>
</p> </p>

171
src/main/resources/templates/fragments/croMenu.html

@ -6,7 +6,7 @@
<span class="nav-main-link-name">Reschedule Booking</span> <span class="nav-main-link-name">Reschedule Booking</span>
</a> </a>
</li> </li>
<!-- <li class="nav-main-item">
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/cro/booking-status"> <a class="nav-main-link" href="/communityhall/cro/booking-status">
<i class="nav-main-link-icon fa fa-location-arrow"></i> <i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">Booking Status</span> <span class="nav-main-link-name">Booking Status</span>
@ -17,176 +17,7 @@
<i class="nav-main-link-icon fa fa-location-arrow"></i> <i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">NOC Details</span> <span class="nav-main-link-name">NOC Details</span>
</a> </a>
</li> -->
<!-- <li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/userdeactive">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">User Deactive</span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/approval-history">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">User Pending List</span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/user-approved">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">User Approval List</span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/user-reject">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">User Rejected List</span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/login-creation">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">Login Creation</span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/GccblockingNew">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">GCC Blocking (New)</span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/ongoingevents">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">Recent Events</span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/viewUploadNoc">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">Waiting For NOC </span>
</a>
</li> </li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/bookingwaitinglist">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">Waiting For NOC Approval</span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/booking-list">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">Booking Approved List</span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/rejected-list">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">Booking Rejected List</span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/halldetailslist">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">Hall Details List</span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/DiscountRange">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">Discount Range</span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/settlement-approved">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">Settlement Approved List</span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/settlement-initiatedlist">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">Settlement Initiated List</span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/settlement-list">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">Settlement Pending List</span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/settlementlist">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">Settlement List</span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/settlement-reject">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">Settlement Rejected List</span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/refundfailed-list">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">Refund Failed List</span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/settlement-completedlist">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">Settlement Completed List</span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/manualrefund">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">Manual Refund</span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/ReasonMaster">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">Reason Master</span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/notification">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">Notifications</span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/Gccblocking">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">Gcc Blocking</span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/Reports">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">Reports</span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/admin/developer">
<i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">Developers</span>
</a>
</li>-->
<li class="nav-main-item"> <li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/cro/logout"> <a class="nav-main-link" href="/communityhall/cro/logout">
<i class="nav-main-link-icon fa fa-location-arrow"></i> <i class="nav-main-link-icon fa fa-location-arrow"></i>

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

@ -63,7 +63,7 @@
<li class="nav-main-item"> <li class="nav-main-item">
<a class="nav-main-link" href="/communityhall/officer/GccblockingNew"> <a class="nav-main-link" href="/communityhall/officer/GccblockingNew">
<i class="nav-main-link-icon fa fa-location-arrow"></i> <i class="nav-main-link-icon fa fa-location-arrow"></i>
<span class="nav-main-link-name">GCC Blocking (New)</span>
<span class="nav-main-link-name">GCC Blocking</span>
</a> </a>
</li> </li>
<!-- <li class="nav-main-item"> <!-- <li class="nav-main-item">

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

@ -213,6 +213,11 @@
<input type="text" class="form-control text-center" name="ebCostPerUnit_view" <input type="text" class="form-control text-center" name="ebCostPerUnit_view"
id="ebCostPerUnit_view" disabled /> id="ebCostPerUnit_view" disabled />
</div> </div>
<div class="col-sm-4">
<label class="form-label" for="mfDtUnit_view">MF DT Unit:</label>
<input type="text" class="form-control text-center" name="mfDtUnit_view" id="mfDtUnit_view"
disabled />
</div>
<div class="col-sm-4"> <div class="col-sm-4">
<label class="form-label" for="gst_view">GST (%):</label> <label class="form-label" for="gst_view">GST (%):</label>
<input type="text" class="form-control text-center" name="gst_view" id="gst_view" <input type="text" class="form-control text-center" name="gst_view" id="gst_view"
@ -429,6 +434,12 @@
id="ebCostPerUnit" required id="ebCostPerUnit" required
oninput="this.value = this.value.replace(/[^0-9]/g, '');" /> oninput="this.value = this.value.replace(/[^0-9]/g, '');" />
</div> </div>
<div class="col-sm-4">
<label class="form-label" for="mfDtUnit">MF DT Unit:*<span
class="text-danger"></span></label>
<input type="text" class="form-control text-center" name="mfDtUnit" id="mfDtUnitEdit"
required oninput="this.value = this.value.replace(/[^0-9]/g, '');" />
</div>
<div class="col-sm-4"> <div class="col-sm-4">
<label class="form-label" for="gst">GST in %:*<span class="text-danger"></span></label> <label class="form-label" for="gst">GST in %:*<span class="text-danger"></span></label>
@ -627,6 +638,13 @@
oninput="this.value = this.value.replace(/[^0-9]/g, '');"> oninput="this.value = this.value.replace(/[^0-9]/g, '');">
</div> </div>
</div> </div>
<div class="col-md-4">
<div class="form-group">
<label for="mfDtUnit">MF DT Unit:*</label> <input type="text" class="form-control"
id="mfDtUnit" name="mfDtUnit" placeholder="MF DT Unit" value="1" required
oninput="this.value = this.value.replace(/[^0-9]/g, '');">
</div>
</div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label for="gst">GST in %:*</label> <input type="text" class="form-control" id="gst" <label for="gst">GST in %:*</label> <input type="text" class="form-control" id="gst"
@ -1218,6 +1236,7 @@
document.getElementById("city_view").value = list.city || ''; document.getElementById("city_view").value = list.city || '';
document.getElementById("ebNumber_view").value = list.ebNumber || ''; document.getElementById("ebNumber_view").value = list.ebNumber || '';
document.getElementById("ebCostPerUnit_view").value = list.ebCostPerUnit || ''; document.getElementById("ebCostPerUnit_view").value = list.ebCostPerUnit || '';
document.getElementById("mfDtUnit_view").value = (list.mfDtUnit !== undefined && list.mfDtUnit !== null) ? list.mfDtUnit : (list.MfDtUnit !== undefined && list.MfDtUnit !== null ? list.MfDtUnit : '');
document.getElementById("gst_view").value = list.gst || ''; document.getElementById("gst_view").value = list.gst || '';
// Floor details // Floor details
@ -1282,6 +1301,7 @@
$('#seatingCapaci').val(list.seatingCapacity); $('#seatingCapaci').val(list.seatingCapacity);
$('#ebNumber').val(list.ebNumber); $('#ebNumber').val(list.ebNumber);
$('#ebCostPerUnit').val(list.ebCostPerUnit); $('#ebCostPerUnit').val(list.ebCostPerUnit);
$('#mfDtUnitEdit').val((list.mfDtUnit !== undefined && list.mfDtUnit !== null) ? list.mfDtUnit : (list.MfDtUnit !== undefined && list.MfDtUnit !== null ? list.MfDtUnit : 1));
$('#city').val(list.city); $('#city').val(list.city);
$('#updatedgstpercentage').val(list.gst); $('#updatedgstpercentage').val(list.gst);
$('#hallStatus').val(list.active ? '1' : '0'); $('#hallStatus').val(list.active ? '1' : '0');
@ -1337,6 +1357,7 @@
var seatingCapacity = document.getElementById("seatingCapaci").value; var seatingCapacity = document.getElementById("seatingCapaci").value;
var ebNumber = document.getElementById("ebNumber").value; var ebNumber = document.getElementById("ebNumber").value;
var ebCostPerUnit = document.getElementById("ebCostPerUnit").value; var ebCostPerUnit = document.getElementById("ebCostPerUnit").value;
var mfDtUnit = document.getElementById("mfDtUnitEdit").value;
var city = document.getElementById("city").value; var city = document.getElementById("city").value;
var gst = document.getElementById("updatedgstpercentage").value; var gst = document.getElementById("updatedgstpercentage").value;
var isActive = document.getElementById("hallStatus").value; var isActive = document.getElementById("hallStatus").value;
@ -1354,6 +1375,7 @@
{ id: 'seatingCapaci', label: 'Seating Capacity' }, { id: 'seatingCapaci', label: 'Seating Capacity' },
{ id: 'ebNumber', label: 'Consumer Number' }, { id: 'ebNumber', label: 'Consumer Number' },
{ id: 'ebCostPerUnit', label: 'EB Cost Per Unit' }, { id: 'ebCostPerUnit', label: 'EB Cost Per Unit' },
{ id: 'mfDtUnitEdit', label: 'MF DT Unit' },
{ id: 'updatedgstpercentage', label: 'GST (%)' } { id: 'updatedgstpercentage', label: 'GST (%)' }
]; ];
for (var i = 0; i < zeroCheckFields.length; i++) { for (var i = 0; i < zeroCheckFields.length; i++) {
@ -1409,6 +1431,7 @@
formData.append("seatingCapacity", parseInt(seatingCapacity)); formData.append("seatingCapacity", parseInt(seatingCapacity));
formData.append("ebNumber", ebNumber); formData.append("ebNumber", ebNumber);
formData.append("ebCostPerUnit", ebCostPerUnit); formData.append("ebCostPerUnit", ebCostPerUnit);
formData.append("mfDtUnit", parseInt(mfDtUnit) || 1);
formData.append("city", city); formData.append("city", city);
formData.append("gst", gst); formData.append("gst", gst);
formData.append("isActive", isActive); formData.append("isActive", isActive);
@ -1631,6 +1654,7 @@
{ id: 'seatingCapacity', label: 'Seating Capacity' }, { id: 'seatingCapacity', label: 'Seating Capacity' },
{ id: 'ebNumber', label: 'Consumer Number' }, { id: 'ebNumber', label: 'Consumer Number' },
{ id: 'ebCostPerUnit', label: 'EB Cost Per Unit' }, { id: 'ebCostPerUnit', label: 'EB Cost Per Unit' },
{ id: 'mfDtUnit', label: 'MF DT Unit' },
{ id: 'gst', label: 'GST (%)' } { id: 'gst', label: 'GST (%)' }
]; ];
for (var ci = 0; ci < createZeroCheckFields.length; ci++) { for (var ci = 0; ci < createZeroCheckFields.length; ci++) {

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

@ -365,49 +365,46 @@
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot: <th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:
</th> </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
<td colspan="3" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingSlot"></td> id="td_endingSlot"></td>
</tr> </tr>
</table>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="card-body">
<table>
<tr> <tr>
<th colspan="4" style="background-color: #f2f2f2;">EB
Details</th>
<th colspan="6" style="background-color: #f2f2f2;">EB Details</th>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem; text-align:center"
id="td_EBNumber"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per
Unit:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:
</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;" id="td_EBNumber">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per Unit:
</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">MF DT Unit:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_mfDtUnit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:</th>
<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">Unit Consumed:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right" id="td_usedunit">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Unit Consumed:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_usedunit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right"
<td colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</table> </table>
@ -982,6 +979,7 @@ $(document).ready(function () {
document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading; document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading;
document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit; document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit;
document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2); document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2);
document.getElementById("td_mfDtUnit").innerHTML = '₹ ' + parseFloat(list.hallDetails.mfDtUnit).toFixed(2);
document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2); document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2);
document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);
document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);

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

@ -951,9 +951,7 @@
<div class="card-body"> <div class="card-body">
<table> <table>
<tr> <tr>
<th colspan="4" style="background-color: lightgrey;">EB
Details
</th>
<th colspan="6" style="background-color: lightgrey;">EB Details</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">
@ -964,8 +962,11 @@
<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 amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">MF DT Unit:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_mfDtUnit"></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">
@ -974,24 +975,23 @@
<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:
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>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Unit Consumed:
</th>
<td class="fw-semibold amount-cell" 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">
END Reading:
</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
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 colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</tbody>
</table> </table>
</div> </div>
</div> </div>
@ -1810,6 +1810,7 @@
document.getElementById("td_endingReading").innerHTML = response.ebDetails.endingReading; document.getElementById("td_endingReading").innerHTML = response.ebDetails.endingReading;
document.getElementById("td_usedunit").innerHTML = response.ebDetails.usedUnit; document.getElementById("td_usedunit").innerHTML = response.ebDetails.usedUnit;
document.getElementById("td_ebamountperunit").innerHTML = parseFloat(response.hallDetails.ebCostPerUnit).toFixed(2); document.getElementById("td_ebamountperunit").innerHTML = parseFloat(response.hallDetails.ebCostPerUnit).toFixed(2);
document.getElementById("td_mfDtUnit").innerHTML = (response.hallDetails && response.hallDetails.mfDtUnit != null) ? parseFloat(response.hallDetails.mfDtUnit).toFixed(2) : "0.00";
document.getElementById("td_electricityamount").innerHTML = parseFloat(response.ebDetails.ebAmount).toFixed(2); document.getElementById("td_electricityamount").innerHTML = parseFloat(response.ebDetails.ebAmount).toFixed(2);
} else { } else {

58
src/main/resources/templates/headquarters/settlement-approved.html

@ -400,49 +400,46 @@
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot: <th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:
</th> </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
<td colspan="3" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingSlot"></td> id="td_endingSlot"></td>
</tr> </tr>
</table>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="card-body">
<table>
<tr> <tr>
<th colspan="4" style="background-color: lightgrey;">EB
Details</th>
<th colspan="6" style="background-color: #f2f2f2;">EB Details</th>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
id="td_EBNumber"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per
Unit:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:
</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;" id="td_EBNumber">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per Unit:
</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">MF DT Unit:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_mfDtUnit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:</th>
<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">Unit Consumed:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;" id="td_usedunit">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Unit Consumed:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_usedunit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;"
<td colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</table> </table>
@ -933,6 +930,7 @@
document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading; document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading;
document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit; document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit;
document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2); document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2);
document.getElementById("td_mfDtUnit").innerHTML = '₹ ' + parseFloat(list.hallDetails.mfDtUnit).toFixed(2);
document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2); document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2);
document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);
document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);

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

@ -92,7 +92,8 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr th:each="settlements, rowStat : ${completedlist}">
<tr th:each="settlements, rowStat : ${completedlist}"
th:if="${settlements.settlement != null}">
<td class="text-center" th:text="${rowStat.index + 1}"></td> <td class="text-center" th:text="${rowStat.index + 1}"></td>
<td class="text-center" <td class="text-center"
th:text="${settlements.hallDetails.zone + ' / ' + settlements.hallDetails.division}"> th:text="${settlements.hallDetails.zone + ' / ' + settlements.hallDetails.division}">
@ -370,46 +371,46 @@
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot: <th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:
</th> </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
<td colspan="3" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingSlot"></td> id="td_endingSlot"></td>
</tr> </tr>
</table>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="card-body">
<table>
<tr> <tr>
<th colspan="4" style="background-color: #f2f2f2;">EB
Details</th>
<th colspan="6" style="background-color: #f2f2f2;">EB Details</th>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer
Number:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
id="td_EBNumber"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per
Unit:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:
</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;" id="td_EBNumber">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per Unit:
</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">MF DT Unit:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_mfDtUnit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:</th>
<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">Unit Consumed:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;" id="td_usedunit">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Unit Consumed:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_usedunit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;"
<td colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</table> </table>
@ -873,6 +874,7 @@
document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading; document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading;
document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit; document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit;
document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2); document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2);
document.getElementById("td_mfDtUnit").innerHTML = '₹ ' + parseFloat(list.hallDetails.mfDtUnit).toFixed(2);
document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2); document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2);
document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);
document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);

58
src/main/resources/templates/headquarters/settlement-initiate.html

@ -427,49 +427,46 @@
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot: <th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:
</th> </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
<td colspan="3" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingSlot"></td> id="td_endingSlot"></td>
</tr> </tr>
</table>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="card-body">
<table>
<tr> <tr>
<th colspan="4" style="background-color: #f2f2f2;">EB
Details</th>
<th colspan="6" style="background-color: #f2f2f2;">EB Details</th>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
id="td_EBNumber"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per
Unit:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:
</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;" id="td_EBNumber">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per Unit:
</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">MF DT Unit:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_mfDtUnit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:</th>
<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">Unit Consumed:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;" id="td_usedunit">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Unit Consumed:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_usedunit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;"
<td colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</table> </table>
@ -1046,6 +1043,7 @@
document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading; document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading;
document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit; document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit;
document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2); document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2);
document.getElementById("td_mfDtUnit").innerHTML = '₹ ' + parseFloat(list.hallDetails.mfDtUnit).toFixed(2);
document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2); document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2);
document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);
document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);

58
src/main/resources/templates/headquarters/settlement-list.html

@ -439,49 +439,46 @@
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot: <th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:
</th> </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
<td colspan="3" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingSlot"></td> id="td_endingSlot"></td>
</tr> </tr>
</table>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="card-body">
<table>
<tr> <tr>
<th colspan="4" style="background-color: #f2f2f2;">EB
Details</th>
<th colspan="6" style="background-color: #f2f2f2;">EB Details</th>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem; text-align:center"
id="td_EBNumber"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per
Unit:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:
</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;" id="td_EBNumber">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per Unit:
</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">MF DT Unit:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_mfDtUnit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:</th>
<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">Unit Consumed:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right" id="td_usedunit">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Unit Consumed:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_usedunit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right"
<td colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</table> </table>
@ -1007,6 +1004,7 @@
document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading; document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading;
document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit; document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit;
document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2); document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2);
document.getElementById("td_mfDtUnit").innerHTML = '₹ ' + parseFloat(list.hallDetails.mfDtUnit).toFixed(2);
document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2); document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2);
document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);
document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);

56
src/main/resources/templates/headquarters/settlement-reject.html

@ -236,49 +236,46 @@
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot: <th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:
</th> </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
<td colspan="3" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingSlot"></td> id="td_endingSlot"></td>
</tr> </tr>
</table>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="card-body">
<table>
<tr> <tr>
<th colspan="4" style="background-color: #f2f2f2;">EB
Details</th>
<th colspan="6" style="background-color: #f2f2f2;">EB Details</th>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center" id="td_EBNumber">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:
</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;" id="td_EBNumber">
</td> </td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per
Unit:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per Unit:
</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">MF DT Unit:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_mfDtUnit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:</th>
<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">Unit Consumed:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;" id="td_usedunit">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Unit Consumed:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_usedunit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;"
<td colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</table> </table>
@ -522,6 +519,7 @@ $(document).ready(function () {
document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading; document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading;
document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit; document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit;
document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2); document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2);
document.getElementById("td_mfDtUnit").innerHTML = '₹ ' + parseFloat(list.hallDetails.mfDtUnit).toFixed(2);
document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2); document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2);
document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);
document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);

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

@ -227,14 +227,18 @@
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
<td colspan="3" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingSlot"></td> id="td_endingSlot"></td>
</tr> </tr>
</table>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="card-body">
<table>
<tr> <tr>
<th colspan="4" style="background-color: #f2f2f2;">EB
Details</th>
<th colspan="6" style="background-color: #f2f2f2;">EB Details</th>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number: <th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:
@ -243,26 +247,26 @@
</td> </td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per Unit: <th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per Unit:
</th> </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;text-align:right"
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">MF DT Unit:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_mfDtUnit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:</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">END Reading:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Unit Consumed:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">Unit Consumed:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;text-align:right"
<td class="fw-semibold amount-cell" 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">END Reading:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;text-align:right"
<td colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</table> </table>
@ -519,6 +523,7 @@
document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading; document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading;
document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit; document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit;
document.getElementById("td_ebamountperunit").innerHTML = "₹ " + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2); document.getElementById("td_ebamountperunit").innerHTML = "₹ " + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2);
document.getElementById("td_mfDtUnit").innerHTML = "₹ " + parseFloat(list.hallDetails.mfDtUnit).toFixed(2);
document.getElementById("td_depositeamountforrefund").innerHTML = "₹ " + parseFloat(list.depositAmount).toFixed(2); document.getElementById("td_depositeamountforrefund").innerHTML = "₹ " + parseFloat(list.depositAmount).toFixed(2);
document.getElementById("td_ebAmount").innerHTML = "₹ " + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_ebAmount").innerHTML = "₹ " + parseFloat(list.ebDetails.ebAmount).toFixed(2);
document.getElementById("td_electricityamount").innerHTML = "₹ " + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_electricityamount").innerHTML = "₹ " + parseFloat(list.ebDetails.ebAmount).toFixed(2);

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

@ -690,46 +690,46 @@
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot: <th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:
</th> </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
<td colspan="3" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingSlot"></td> id="td_endingSlot"></td>
</tr> </tr>
</table>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12" id="ebDetailsSection">
<div class="card-body">
<table>
<tr> <tr>
<th colspan="4" style="background-color: #f2f2f2;">EB
Details</th>
<th colspan="6" style="background-color: #f2f2f2;">EB Details</th>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer
Number:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
id="td_EBNumber"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per
Unit:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:
</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;" id="td_EBNumber">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per Unit:
</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">MF DT Unit:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_mfDtUnit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:</th>
<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">Unit Consumed:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;" id="td_usedunit">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Unit Consumed:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_usedunit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;"
<td colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</table> </table>
@ -1197,6 +1197,7 @@
document.getElementById("td_endingReading").innerHTML = hasEb ? list.ebDetails.endingReading : 'N/A'; document.getElementById("td_endingReading").innerHTML = hasEb ? list.ebDetails.endingReading : 'N/A';
document.getElementById("td_usedunit").innerHTML = hasEb ? list.ebDetails.usedUnit : 'N/A'; document.getElementById("td_usedunit").innerHTML = hasEb ? list.ebDetails.usedUnit : 'N/A';
document.getElementById("td_ebamountperunit").innerHTML = list.hallDetails ? '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2) : 'N/A'; document.getElementById("td_ebamountperunit").innerHTML = list.hallDetails ? '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2) : 'N/A';
document.getElementById("td_mfDtUnit").innerHTML = (list.hallDetails && list.hallDetails.mfDtUnit != null) ? '₹ ' + parseFloat(list.hallDetails.mfDtUnit).toFixed(2) : 'N/A';
document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2); document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2);
document.getElementById("td_electricityamount").innerHTML = hasEb ? '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2) : 'N/A'; document.getElementById("td_electricityamount").innerHTML = hasEb ? '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2) : 'N/A';
document.getElementById("td_ebAmount").innerHTML = hasEb ? '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2) : 'N/A'; document.getElementById("td_ebAmount").innerHTML = hasEb ? '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2) : 'N/A';

58
src/main/resources/templates/officer/refund-failedlist.html

@ -354,49 +354,46 @@
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot: <th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:
</th> </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
<td colspan="3" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingSlot"></td> id="td_endingSlot"></td>
</tr> </tr>
</table>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="card-body">
<table>
<tr> <tr>
<th colspan="4" style="background-color: #f2f2f2;">EB
Details</th>
<th colspan="6" style="background-color: #f2f2f2;">EB Details</th>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem; text-align:center"
id="td_EBNumber"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per
Unit:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:
</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;" id="td_EBNumber">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per Unit:
</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">MF DT Unit:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_mfDtUnit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:</th>
<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">Unit Consumed:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right" id="td_usedunit">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Unit Consumed:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_usedunit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right"
<td colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</table> </table>
@ -971,6 +968,7 @@ $(document).ready(function () {
document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading; document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading;
document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit; document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit;
document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2); document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2);
document.getElementById("td_mfDtUnit").innerHTML = '₹ ' + parseFloat(list.hallDetails.mfDtUnit).toFixed(2);
document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2); document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2);
document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);
document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);

27
src/main/resources/templates/officer/report.html

@ -518,43 +518,41 @@
<div class="card-body"> <div class="card-body">
<table> <table>
<tr> <tr>
<th colspan="4" style="background-color: #f2f2f2;">EB
Details</th>
<th colspan="6" style="background-color: #f2f2f2;">EB Details</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">
EB Number:</th>
Consumer Number:</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):</th> EB Amount Per Unit (in Rs):</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">MF DT Unit:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_mfDtUnit"></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:</th> Start Reading:</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:</th>
END Reading:</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>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">
Unit Consumed:</th>
<td class="fw-semibold amount-cell" 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">
END Reading:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
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):</th> EB Amount (in Rs):</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
<td colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</tbody>
</table> </table>
</div> </div>
</div> </div>
@ -971,6 +969,7 @@ document.addEventListener("DOMContentLoaded", function () {
document.getElementById("td_endingReading").innerHTML = response.ebDetails.endingReading; document.getElementById("td_endingReading").innerHTML = response.ebDetails.endingReading;
document.getElementById("td_usedunit").innerHTML = response.ebDetails.usedUnit; document.getElementById("td_usedunit").innerHTML = response.ebDetails.usedUnit;
document.getElementById("td_ebamountperunit").innerHTML = parseFloat(response.hallDetails.ebCostPerUnit).toFixed(2); document.getElementById("td_ebamountperunit").innerHTML = parseFloat(response.hallDetails.ebCostPerUnit).toFixed(2);
document.getElementById("td_mfDtUnit").innerHTML = (response.hallDetails && response.hallDetails.mfDtUnit != null) ? parseFloat(response.hallDetails.mfDtUnit).toFixed(2) : "0.00";
document.getElementById("td_electricityamount").innerHTML = parseFloat(response.ebDetails.ebAmount).toFixed(2); document.getElementById("td_electricityamount").innerHTML = parseFloat(response.ebDetails.ebAmount).toFixed(2);
} else { } else {

56
src/main/resources/templates/officer/settlement-approved.html

@ -358,49 +358,46 @@
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot: <th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:
</th> </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
<td colspan="3" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingSlot"></td> id="td_endingSlot"></td>
</tr> </tr>
</table>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="card-body">
<table>
<tr> <tr>
<th colspan="4" style="background-color: #f2f2f2;">EB
Details</th>
<th colspan="6" style="background-color: #f2f2f2;">EB Details</th>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align: center;"
id="td_EBNumber"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per
Unit:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align: right;"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:
</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;" id="td_EBNumber">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per Unit:
</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">MF DT Unit:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_mfDtUnit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align: center;"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:</th>
<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">Unit Consumed:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align: right;"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Unit Consumed:</th>
<td class="fw-semibold amount-cell" 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">END Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align: center;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem; text-align: right;"
<td colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</table> </table>
@ -878,6 +875,7 @@
document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading; document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading;
document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit; document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit;
document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2); document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2);
document.getElementById("td_mfDtUnit").innerHTML = '₹ ' + parseFloat(list.hallDetails.mfDtUnit).toFixed(2);
document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2); document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2);
document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);
document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);

247
src/main/resources/templates/officer/settlement-completed.html

@ -84,7 +84,8 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr th:each="settlements, rowStat : ${completedlist}">
<tr th:each="settlements, rowStat : ${completedlist}"
th:if="${settlements.settlement != null}">
<td class="text-center" th:text="${rowStat.index + 1}"></td> <td class="text-center" th:text="${rowStat.index + 1}"></td>
<td class="text-center" <td class="text-center"
th:text="${settlements.hallDetails.zone + ' / ' + settlements.hallDetails.division}"> th:text="${settlements.hallDetails.zone + ' / ' + settlements.hallDetails.division}">
@ -93,7 +94,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"
@ -215,7 +217,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>
@ -360,45 +363,46 @@
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot: <th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:
</th> </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
<td colspan="3" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingSlot"></td> id="td_endingSlot"></td>
</tr> </tr>
</table>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="card-body">
<table>
<tr> <tr>
<th colspan="4" style="background-color: #f2f2f2;">EB
Details</th>
<th colspan="6" style="background-color: #f2f2f2;">EB Details</th>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
id="td_EBNumber"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per
Unit:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:
</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;" id="td_EBNumber">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per Unit:
</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">MF DT Unit:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_mfDtUnit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:</th>
<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">Unit Consumed:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;" id="td_usedunit">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Unit Consumed:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_usedunit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;"
<td colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</table> </table>
@ -445,7 +449,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>
@ -735,7 +740,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],
@ -753,7 +758,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],
@ -771,7 +776,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],
@ -835,7 +840,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;
@ -861,6 +866,7 @@
document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading; document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading;
document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit; document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit;
document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2); document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2);
document.getElementById("td_mfDtUnit").innerHTML = '₹ ' + parseFloat(list.hallDetails.mfDtUnit).toFixed(2);
document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2); document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2);
document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);
document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);
@ -876,7 +882,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
@ -889,76 +895,76 @@
}).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) {
var row = $('<tr>').appendTo(tbody);
$('<td>').attr('colspan', '6').text('No Damaged Items').css({
'padding': '0.45rem 0.45rem',
'text-align': 'center',
'font-weight': 'bold',
'background-color': '#f2f2f2'
}).appendTo(row);
} else {
$.each(data.damageList, function (index, detail) {
var row = $('<tr>').appendTo(tbody);
$('<td>').text(index + 1).css({
'padding': '0.45rem 0.45rem',
'text-align': 'center'
}).appendTo(row);
$('<td>').text(detail.assetName).css({
'padding': '0.45rem 0.45rem',
'text-align': 'center'
}).appendTo(row);
// Check if damageList is empty
if (data.damageList.length === 0) {
var row = $('<tr>').appendTo(tbody);
$('<td>').attr('colspan', '6').text('No Damaged Items').css({
'padding': '0.45rem 0.45rem',
'text-align': 'center',
'font-weight': 'bold',
'background-color': '#f2f2f2'
}).appendTo(row);
} else {
$.each(data.damageList, function (index, detail) {
var row = $('<tr>').appendTo(tbody);
$('<td>').text(index + 1).css({
'padding': '0.45rem 0.45rem',
'text-align': 'center'
}).appendTo(row);
$('<td>').text(detail.assetName).css({
'padding': '0.45rem 0.45rem',
'text-align': 'center'
}).appendTo(row);
var viewLink = $('<a>').attr('href', 'javascript:void(0)').text('View').on('click', function () {
showDamageImage(detail.damageImageUrl);
});
$('<td>').css({
'padding': '0.45rem 0.45rem',
'text-align': 'center'
}).append(viewLink).appendTo(row);
var viewLink = $('<a>').attr('href', 'javascript:void(0)').text('View').on('click', function () {
showDamageImage(detail.damageImageUrl);
});
$('<td>').css({
'padding': '0.45rem 0.45rem',
'text-align': 'center'
}).append(viewLink).appendTo(row);
var assetamt = (detail.assetAmount / detail.quantity).toFixed(2);
$('<td>').text('₹ ' + assetamt).css({
'padding': '0.45rem 0.45rem',
'text-align': 'center'
}).appendTo(row);
var assetamt = (detail.assetAmount / detail.quantity).toFixed(2);
$('<td>').text('₹ ' + assetamt).css({
'padding': '0.45rem 0.45rem',
'text-align': 'center'
}).appendTo(row);
$('<td>').text(detail.quantity).css({
'padding': '0.45rem 0.45rem',
'text-align': 'center'
}).appendTo(row);
$('<td>').text(detail.quantity).css({
'padding': '0.45rem 0.45rem',
'text-align': 'center'
}).appendTo(row);
var amount = detail.assetAmount;
totalAmount += amount;
$('<td>').text('₹ ' + amount.toFixed(2)).css({
'padding': '0.45rem 0.45rem',
'text-align': 'right'
}).appendTo(row);
});
var amount = detail.assetAmount;
totalAmount += amount;
$('<td>').text('₹ ' + amount.toFixed(2)).css({
'padding': '0.45rem 0.45rem',
'text-align': 'right'
}).appendTo(row);
});
// Add row for total amount
var totalRow = $('<tr>').appendTo(tbody);
$('<td>').attr('colspan', '5').text('Total Amount').css({
'padding': '0.45rem 0.45rem',
'font-weight': 'bold',
'background-color': '#f2f2f2'
}).appendTo(totalRow);
$('<td>').text('₹ ' + totalAmount.toFixed(2)).css({
'padding': '0.45rem 0.45rem',
'text-align': 'right'
}).appendTo(totalRow);
// Add row for total amount
var totalRow = $('<tr>').appendTo(tbody);
$('<td>').attr('colspan', '5').text('Total Amount').css({
'padding': '0.45rem 0.45rem',
'font-weight': 'bold',
'background-color': '#f2f2f2'
}).appendTo(totalRow);
$('<td>').text('₹ ' + totalAmount.toFixed(2)).css({
'padding': '0.45rem 0.45rem',
'text-align': 'right'
}).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
@ -995,7 +1001,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);
@ -1008,20 +1014,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 () {
showchallonimage(data.settlement.challon);
});
$('<td>').css({'padding': '0.45rem 0.45rem', 'text-align': 'center'}).append(challanImgLink).appendTo(row);
var challanImgLink = $('<a>').attr('href', 'javascript:void(0)').text('View Image').on('click', function () {
showchallonimage(data.settlement.challon);
});
$('<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);
@ -1044,7 +1050,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);
@ -1055,15 +1061,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);
@ -1081,7 +1087,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');
} }
@ -1135,7 +1141,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;
@ -1234,9 +1240,10 @@ if (data.damageList.length === 0) {
openFileModal(fileURL); openFileModal(fileURL);
}); });
function openFileModal(fileURL) { function openFileModal(fileURL) {
$('#filePreview').attr('src', fileURL);
$('#fileModal').modal('show');
}
$('#filePreview').attr('src', fileURL);
$('#fileModal').modal('show');
}
</script> </script>
</body> </body>
</html> </html>

58
src/main/resources/templates/officer/settlement-list.html

@ -429,49 +429,46 @@
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot: <th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:
</th> </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
<td colspan="3" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingSlot"></td> id="td_endingSlot"></td>
</tr> </tr>
</table>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="card-body">
<table>
<tr> <tr>
<th colspan="4" style="background-color: #f2f2f2;">EB
Details</th>
<th colspan="6" style="background-color: #f2f2f2;">EB Details</th>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem; text-align:center"
id="td_EBNumber"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per
Unit:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:
</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;" id="td_EBNumber">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per Unit:
</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">MF DT Unit:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_mfDtUnit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:</th>
<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">Unit Consumed:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right" id="td_usedunit">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Unit Consumed:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_usedunit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right"
<td colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</table> </table>
@ -994,6 +991,7 @@
document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading; document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading;
document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit; document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit;
document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2); document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2);
document.getElementById("td_mfDtUnit").innerHTML = '₹ ' + parseFloat(list.hallDetails.mfDtUnit).toFixed(2);
document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2); document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2);
document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);
document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);

56
src/main/resources/templates/officer/settlement-reject.html

@ -236,49 +236,46 @@
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot: <th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:
</th> </th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
<td colspan="3" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingSlot"></td> id="td_endingSlot"></td>
</tr> </tr>
</table>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="card-body">
<table>
<tr> <tr>
<th colspan="4" style="background-color: #f2f2f2;">EB
Details</th>
<th colspan="6" style="background-color: #f2f2f2;">EB Details</th>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center" id="td_EBNumber">
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Consumer Number:
</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;" id="td_EBNumber">
</td> </td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per
Unit:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount Per Unit:
</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">MF DT Unit:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_mfDtUnit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Reading:</th>
<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">Unit Consumed:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;" id="td_usedunit">
</td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:</th>
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">Unit Consumed:</th>
<td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
id="td_usedunit"></td>
</tr> </tr>
<tr> <tr>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">END Reading:
</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:center;"
id="td_endingReading"></td>
<th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th> <th style="padding: 0.45rem 0.45rem;font-weight: normal">EB Amount:</th>
<td class="fw-semibold"
style="padding: 0.45rem 0.45rem;text-align:right;"
<td colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</table> </table>
@ -522,6 +519,7 @@ $(document).ready(function () {
document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading; document.getElementById("td_endingReading").innerHTML = list.ebDetails.endingReading;
document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit; document.getElementById("td_usedunit").innerHTML = list.ebDetails.usedUnit;
document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2); document.getElementById("td_ebamountperunit").innerHTML = '₹ ' + parseFloat(list.hallDetails.ebCostPerUnit).toFixed(2);
document.getElementById("td_mfDtUnit").innerHTML = '₹ ' + parseFloat(list.hallDetails.mfDtUnit).toFixed(2);
document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2); document.getElementById("td_depositeamountforrefund").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2);
document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_electricityamount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);
document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2); document.getElementById("td_ebAmount").innerHTML = '₹ ' + parseFloat(list.ebDetails.ebAmount).toFixed(2);

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

@ -813,8 +813,9 @@
</a> </a>
<!-- <a class="reschedule-button" th:if="${booking.booking_status == 'APPROVED' and booking.reason != 'Commercial'}"> --> <!-- <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'
and !#lists.contains({'Commercial', 'State Govt Event', 'Central Govt Event'}, booking.reason)}">
th:if="${booking.booking_status == 'APPROVED' and booking.schedule_count < 1}">
<!-- 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}]],
@ -1152,10 +1153,8 @@
<div class="card-body"> <div class="card-body">
<table> <table>
<tr> <tr>
<th colspan="4"
style="background-color: lightgrey;">EB
Details
</th>
<th colspan="6"
style="background-color: lightgrey;">EB Details</th>
</tr> </tr>
<tr> <tr>
<th <th
@ -1169,9 +1168,16 @@
style="padding: 0.45rem 0.45rem;font-weight: normal"> 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"
<td class="fw-semibold amount-cell"
style="padding: 0.45rem 0.45rem;" style="padding: 0.45rem 0.45rem;"
id="td_ebamountperunit"></td> id="td_ebamountperunit"></td>
<th
style="padding: 0.45rem 0.45rem;font-weight: normal">
MF DT Unit:
</th>
<td class="fw-semibold amount-cell"
style="padding: 0.45rem 0.45rem;"
id="td_mfDtUnit"></td>
</tr> </tr>
<tr> <tr>
<th <th
@ -1183,29 +1189,28 @@
id="td_startingReading"></td> id="td_startingReading"></td>
<th <th
style="padding: 0.45rem 0.45rem;font-weight: normal"> style="padding: 0.45rem 0.45rem;font-weight: normal">
Unit Consumed:
END Reading:
</th> </th>
<td class="fw-semibold" <td class="fw-semibold"
style="padding: 0.45rem 0.45rem;" style="padding: 0.45rem 0.45rem;"
id="td_usedunit"></td>
</tr>
<tr>
id="td_endingReading"></td>
<th <th
style="padding: 0.45rem 0.45rem;font-weight: normal"> style="padding: 0.45rem 0.45rem;font-weight: normal">
END Reading:
Unit Consumed:
</th> </th>
<td class="fw-semibold"
<td class="fw-semibold amount-cell"
style="padding: 0.45rem 0.45rem;" style="padding: 0.45rem 0.45rem;"
id="td_endingReading"></td>
id="td_usedunit"></td>
</tr>
<tr>
<th <th
style="padding: 0.45rem 0.45rem;font-weight: normal"> style="padding: 0.45rem 0.45rem;font-weight: normal">
EB Amount (in Rs): EB Amount (in Rs):
</th> </th>
<td class="fw-semibold"
<td colspan="5" class="fw-semibold"
style="padding: 0.45rem 0.45rem;" style="padding: 0.45rem 0.45rem;"
id="td_electricityamount"></td> id="td_electricityamount"></td>
</tr> </tr>
</tbody>
</table> </table>
</div> </div>
</div> </div>
@ -2036,6 +2041,7 @@
document.getElementById("td_endingReading").innerHTML = response.ebDetails.endingReading; document.getElementById("td_endingReading").innerHTML = response.ebDetails.endingReading;
document.getElementById("td_usedunit").innerHTML = response.ebDetails.usedUnit; document.getElementById("td_usedunit").innerHTML = response.ebDetails.usedUnit;
document.getElementById("td_ebamountperunit").innerHTML = parseFloat(response.hallDetails.ebCostPerUnit).toFixed(2); document.getElementById("td_ebamountperunit").innerHTML = parseFloat(response.hallDetails.ebCostPerUnit).toFixed(2);
document.getElementById("td_mfDtUnit").innerHTML = (response.hallDetails && response.hallDetails.mfDtUnit != null) ? parseFloat(response.hallDetails.mfDtUnit).toFixed(2) : "0.00";
document.getElementById("td_electricityamount").innerHTML = parseFloat(response.ebDetails.ebAmount).toFixed(2); document.getElementById("td_electricityamount").innerHTML = parseFloat(response.ebDetails.ebAmount).toFixed(2);
} else { } else {

Loading…
Cancel
Save