Browse Source

updated files

master
yoganandhank 2 years ago
parent
commit
9c189b004b
  1. 8
      backend/pensioner/controller/DepartmentReceivedApiController.java
  2. 2
      backend/pensioner/controller/DeptPartiallyCompApiController.java
  3. 2
      backend/pensioner/controller/FileClosingApiController.java
  4. 49
      backend/pensioner/service/DepartmentReceivedService.java
  5. 2
      backend/pensioner/service/DeptPartiallyCompService.java
  6. 182
      backend/pensioner/service/NewEntryService.java
  7. 2
      backend/pensioner/service/PensionPartiallyCompService.java
  8. 11
      frontend/pensioner/department/audit/pendency.html
  9. 4
      frontend/pensioner/department/audit/retirement.html
  10. 2
      frontend/pensioner/department/closedList.html
  11. 2
      frontend/pensioner/department/completed/gis.html
  12. 2
      frontend/pensioner/department/completed/provisionalretirement.html
  13. 56
      frontend/pensioner/department/dashboard.html
  14. 94
      frontend/pensioner/department/fileclosing.html
  15. 10
      frontend/pensioner/department/newentry/familypension.html
  16. 47
      frontend/pensioner/department/newentry/pendency.html
  17. 4
      frontend/pensioner/department/partial/pendency.html
  18. 2
      frontend/pensioner/department/received/pendency.html
  19. 4
      frontend/pensioner/department/received/provisionalretirement.html
  20. 2
      frontend/pensioner/department/received/retirement.html
  21. 50
      frontend/pensioner/department/reports.html
  22. 12
      frontend/pensioner/department/return/pendency.html
  23. 2
      frontend/pensioner/department/return/retirement.html
  24. 9
      frontend/pensioner/pensioner/audit/pendency.html
  25. 2
      frontend/pensioner/pensioner/audit/retirement.html
  26. 2
      frontend/pensioner/pensioner/completed/gis.html
  27. 4
      frontend/pensioner/pensioner/completed/pendency.html
  28. 2
      frontend/pensioner/pensioner/completed/provisionalretirement.html
  29. 57
      frontend/pensioner/pensioner/dashboard.html
  30. 9
      frontend/pensioner/pensioner/forward/pendency.html
  31. 2
      frontend/pensioner/pensioner/forward/retirement.html
  32. 63
      frontend/pensioner/pensioner/received/familypension.html
  33. 2
      frontend/pensioner/pensioner/received/gis.html
  34. 74
      frontend/pensioner/pensioner/received/pendency.html
  35. 2
      frontend/pensioner/pensioner/received/provisionalretirement.html
  36. 65
      frontend/pensioner/pensioner/received/retirement.html
  37. 61
      frontend/pensioner/pensioner/reports.html

8
backend/pensioner/controller/DepartmentReceivedApiController.java

@ -70,9 +70,13 @@ public class DepartmentReceivedApiController {
if (updated && file_Status != 0) { if (updated && file_Status != 0) {
if (file_Status == 11) { if (file_Status == 11) {
return ResponseEntity.ok("File Completed successfully!"); return ResponseEntity.ok("File Completed successfully!");
} else {
} else if(file_Status == 9) {
//return ResponseEntity.ok("File Moved Department to Complete Pending fields!");
return ResponseEntity.ok("File Moved to Department Partially Completed!");
}
else {
//return ResponseEntity.ok("File Moved Department to Complete Pending fields!"); //return ResponseEntity.ok("File Moved Department to Complete Pending fields!");
return ResponseEntity.ok("File Moved to Partially Completed!");
return ResponseEntity.ok("File Moved to Pension Partially Completed!");
} }
} else { } else {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)

2
backend/pensioner/controller/DeptPartiallyCompApiController.java

@ -86,7 +86,7 @@ public class DeptPartiallyCompApiController {
return ResponseEntity.ok("File Partially Completed!"); return ResponseEntity.ok("File Partially Completed!");
} }
else if(fs1==10 && fs1!=0){ else if(fs1==10 && fs1!=0){
return ResponseEntity.ok("File Moved to Pension for Complete!");
return ResponseEntity.ok("File Moved to Pension Partially Completed!");
} }
else { else {
return ResponseEntity.ok("File Status is 0!"); return ResponseEntity.ok("File Status is 0!");

2
backend/pensioner/controller/FileClosingApiController.java

@ -86,7 +86,7 @@ public class FileClosingApiController {
if(updated) if(updated)
{ {
return ResponseEntity.ok("File moved to Return from Audit successfully!");
return ResponseEntity.ok("File Closed successfully!");
} }
else { else {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("Failed to save details in history."); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("Failed to save details in history.");

49
backend/pensioner/service/DepartmentReceivedService.java

@ -75,30 +75,38 @@ public class DepartmentReceivedService {
String benefit_dcrg = requestData.get("benefit_dcrg") != null ? requestData.get("benefit_dcrg").toString() : null; String benefit_dcrg = requestData.get("benefit_dcrg") != null ? requestData.get("benefit_dcrg").toString() : null;
String benefit_commutation = (String) requestData.get("benefit_commutation"); String benefit_commutation = (String) requestData.get("benefit_commutation");
String benefit_pension_amount = (String) requestData.get("benefit_pension_amount");
String benefit_pension_amount = (String) requestData.get("benefit_pension_amount")!= null ? requestData.get("benefit_pension_amount").toString() : null;
String benefit_dcrg_amount = requestData.get("benefit_dcrg_amount") != null ? requestData.get("benefit_dcrg_amount").toString() : null; String benefit_dcrg_amount = requestData.get("benefit_dcrg_amount") != null ? requestData.get("benefit_dcrg_amount").toString() : null;
String benefit_commutation_amount = (String) requestData.get("benefit_commutation_amount");
String benefit_commutation_amount = (String) requestData.get("benefit_commutation_amount") != null ? requestData.get("benefit_commutation_amount").toString() : null;
int deptId = Integer.parseInt(dept_Id); int deptId = Integer.parseInt(dept_Id);
int filestatus;
int filestatus=0;
String file_entry_type=""; String file_entry_type="";
boolean check = checkTempPresent(tempId); boolean check = checkTempPresent(tempId);
if ("yes".equalsIgnoreCase(benefit_dcrg)) { if ("yes".equalsIgnoreCase(benefit_dcrg)) {
filestatus = CheckFieldsInDept(tempId) ? 11 : 9; //noted
// filestatus = CheckFieldsInDept(tempId) ? 11 : 9; //noted
filestatus = CheckFieldsInDept(tempId) ? (CheckFieldsInPensioner(tempId) ? 11 : 10 ) : 9;
file_entry_type="FILE_COMPLETED"; file_entry_type="FILE_COMPLETED";
}
}
else if("no".equalsIgnoreCase(benefit_pension) || "no".equalsIgnoreCase(benefit_dcrg)){
filestatus = 10;
file_entry_type="PENSION_PARTIAL";
}
else if(benefit_dcrg==null) else if(benefit_dcrg==null)
{ {
filestatus = 9; filestatus = 9;
file_entry_type="DEPARTMENT_PARTIAL"; file_entry_type="DEPARTMENT_PARTIAL";
} }
else {
filestatus = 9;
file_entry_type="DEPARTMENT_PARTIAL";
}
String updateQuery = "UPDATE pensioner_details SET file_entry_type=?,file_status = ?, file_moved_date = ?, remarks = ?, updated_date = CURRENT_TIMESTAMP WHERE temp_id = ? LIMIT 1"; String updateQuery = "UPDATE pensioner_details SET file_entry_type=?,file_status = ?, file_moved_date = ?, remarks = ?, updated_date = CURRENT_TIMESTAMP WHERE temp_id = ? LIMIT 1";
int rowsUpdated = jdbcTemplate.update(updateQuery,file_entry_type, filestatus, dateToAudit, remarks, tempId); int rowsUpdated = jdbcTemplate.update(updateQuery,file_entry_type, filestatus, dateToAudit, remarks, tempId);
@ -149,6 +157,27 @@ public class DepartmentReceivedService {
"WHERE temp_id = ?"; "WHERE temp_id = ?";
try {
// Use queryForObject to get a single boolean result
Boolean result = jdbcTemplate.queryForObject(sql, Boolean.class, tempId);
return result != null && result; // Return the result if not null
} catch (Exception e) {
e.printStackTrace(); // Log the exception if needed
}
return false; // Return false if an exception occurs
}
private boolean CheckFieldsInPensioner(String tempId) {
// Define the SQL query
String sql = "SELECT CASE " +
"WHEN benefit_pension = 'yes' AND benefit_dcrg = 'yes' THEN true " +
"ELSE false END AS allYes " +
"FROM pension_benefits " +
"WHERE temp_id = ?";
try { try {
// Use queryForObject to get a single boolean result // Use queryForObject to get a single boolean result
Boolean result = jdbcTemplate.queryForObject(sql, Boolean.class, tempId); Boolean result = jdbcTemplate.queryForObject(sql, Boolean.class, tempId);

2
backend/pensioner/service/DeptPartiallyCompService.java

@ -307,7 +307,7 @@ public class DeptPartiallyCompService {
String sql = "SELECT \r\n" String sql = "SELECT \r\n"
+ " CASE \r\n" + " CASE \r\n"
+ " WHEN zb.gpf = 'yes' AND zb.spfgs = 'yes' AND zb.private_affairs = 'yes' AND zb.dcrg = 'yes' \r\n" + " WHEN zb.gpf = 'yes' AND zb.spfgs = 'yes' AND zb.private_affairs = 'yes' AND zb.dcrg = 'yes' \r\n"
+ " AND pb.benefit_pension = 'yes' AND pb.benefit_dcrg = 'yes' AND pb.benefit_commutation = 'yes' THEN 1 ELSE 0 \r\n"
+ " AND pb.benefit_pension = 'yes' AND pb.benefit_dcrg = 'yes' THEN 1 ELSE 0 \r\n"
+ " END AS allYes \r\n" + " END AS allYes \r\n"
+ "FROM zone_benefits AS zb\r\n" + "FROM zone_benefits AS zb\r\n"
+ "JOIN pension_benefits AS pb ON zb.temp_id = pb.temp_id \r\n" + "JOIN pension_benefits AS pb ON zb.temp_id = pb.temp_id \r\n"

182
backend/pensioner/service/NewEntryService.java

@ -52,7 +52,73 @@ public class NewEntryService {
this.jdbcTemplate = new JdbcTemplate(dataSource); this.jdbcTemplate = new JdbcTemplate(dataSource);
} }
// old retiment list getting method
// public Map<String, Object> fetchEmplyeeDetails(String fromDate, String toDate, Integer deptId) {
// Map<String, Object> response = new HashMap<>();
//
// String apiUrl = appconfig.qaqcurl + "serviceId=common_api"
// + "&jsonResp=Yes"
// + "&subService=getEmpPenDetDuration"
// + "&fromDate=" + fromDate
// + "&toDate=" + toDate
// + "&deptId=" + deptId;
//
// System.out.println("url: " + apiUrl);
// System.out.println("deptId:" + deptId);
// try {
// String rawResponse = restTemplate.getForObject(apiUrl, String.class);
// System.out.println("Raw Response: " + rawResponse); // Debugging step
//
// if (isValidJson(rawResponse)) {
// JsonNode jsonResponse = objectMapper.readTree(rawResponse);
//
// // Extract the "ListResult" array
// JsonNode details = jsonResponse.path("ListResult");
//
// if (details.isArray() && details.size() > 0) {
// List<Map<String, String>> list = new ArrayList<>();
// for (JsonNode detail : details) {
// Map<String, String> listResult = new HashMap<>();
//
// listResult.put("RETIREMENT_DATE", getNonNullValue(detail.path("RETIREMENT_DATE")));
// listResult.put("DEATH_DATE", getNonNullValue(detail.path("DEATH_DATE")));
// listResult.put("COMMUNITY_NAME", getNonNullValue(detail.path("COMMUNITY_NAME")));
// listResult.put("GROUP_TYPE", getNonNullValue(detail.path("GROUP_TYPE")));
// listResult.put("ID_DEPT", getNonNullValue(detail.path("ID_DEPT")));
// listResult.put("EMPLOYEE_CODE", getNonNullValue(detail.path("EMPLOYEE_CODE")));
// listResult.put("FUNCTIONARY", getNonNullValue(detail.path("FUNCTIONARY")));
// listResult.put("IS_HANDICAPPED", getNonNullValue(detail.path("IS_HANDICAPPED")));
// listResult.put("GENDER", getNonNullValue(detail.path("GENDER")));
// listResult.put("DATE_OF_BIRTH", getNonNullValue(detail.path("DATE_OF_BIRTH")));
// listResult.put("DATE_OF_APPOINTMENT", getNonNullValue(detail.path("DATE_OF_APPOINTMENT")));
// listResult.put("DESIGNATION", getNonNullValue(detail.path("DESIGNATION")));
// listResult.put("EMPLOYEE_NAME", getNonNullValue(detail.path("EMPLOYEE_NAME")));
// listResult.put("DEPARTMENT", getNonNullValue(detail.path("DEPARTMENT")));
// list.add(listResult);
// }
// // Sort the list by RETIREMENT_DATE in ascending order
// list.sort(Comparator.comparing(map -> parseDate(((Map<String, String>) map).get("RETIREMENT_DATE"))));
//
// response.put("list", list);
//
// } else {
// response.put("list", Collections.emptyList());
// }
// } else {
// System.err.println("Invalid JSON Response: " + rawResponse);
// response.put("list", Collections.emptyList());
// }
//
// } catch (Exception e) {
// e.printStackTrace();
// response.put("list", Collections.emptyList());
// }
// return response;
// }
// new retirement list getting method with condition
public Map<String, Object> fetchEmplyeeDetails(String fromDate, String toDate, Integer deptId) { public Map<String, Object> fetchEmplyeeDetails(String fromDate, String toDate, Integer deptId) {
Map<String, Object> response = new HashMap<>(); Map<String, Object> response = new HashMap<>();
@ -65,41 +131,48 @@ public class NewEntryService {
System.out.println("url: " + apiUrl); System.out.println("url: " + apiUrl);
System.out.println("deptId:" + deptId); System.out.println("deptId:" + deptId);
try { try {
String rawResponse = restTemplate.getForObject(apiUrl, String.class); String rawResponse = restTemplate.getForObject(apiUrl, String.class);
System.out.println("Raw Response: " + rawResponse); // Debugging step System.out.println("Raw Response: " + rawResponse); // Debugging step
if (isValidJson(rawResponse)) { if (isValidJson(rawResponse)) {
JsonNode jsonResponse = objectMapper.readTree(rawResponse); JsonNode jsonResponse = objectMapper.readTree(rawResponse);
// Extract the "ListResult" array
JsonNode details = jsonResponse.path("ListResult"); JsonNode details = jsonResponse.path("ListResult");
if (details.isArray() && details.size() > 0) { if (details.isArray() && details.size() > 0) {
List<Map<String, String>> list = new ArrayList<>(); List<Map<String, String>> list = new ArrayList<>();
LocalDate currentDate = LocalDate.now(); // Get today's date
for (JsonNode detail : details) { for (JsonNode detail : details) {
Map<String, String> listResult = new HashMap<>();
listResult.put("RETIREMENT_DATE", getNonNullValue(detail.path("RETIREMENT_DATE")));
listResult.put("DEATH_DATE", getNonNullValue(detail.path("DEATH_DATE")));
listResult.put("COMMUNITY_NAME", getNonNullValue(detail.path("COMMUNITY_NAME")));
listResult.put("GROUP_TYPE", getNonNullValue(detail.path("GROUP_TYPE")));
listResult.put("ID_DEPT", getNonNullValue(detail.path("ID_DEPT")));
listResult.put("EMPLOYEE_CODE", getNonNullValue(detail.path("EMPLOYEE_CODE")));
listResult.put("FUNCTIONARY", getNonNullValue(detail.path("FUNCTIONARY")));
listResult.put("IS_HANDICAPPED", getNonNullValue(detail.path("IS_HANDICAPPED")));
listResult.put("GENDER", getNonNullValue(detail.path("GENDER")));
listResult.put("DATE_OF_BIRTH", getNonNullValue(detail.path("DATE_OF_BIRTH")));
listResult.put("DATE_OF_APPOINTMENT", getNonNullValue(detail.path("DATE_OF_APPOINTMENT")));
listResult.put("DESIGNATION", getNonNullValue(detail.path("DESIGNATION")));
listResult.put("EMPLOYEE_NAME", getNonNullValue(detail.path("EMPLOYEE_NAME")));
listResult.put("DEPARTMENT", getNonNullValue(detail.path("DEPARTMENT")));
list.add(listResult);
String retirementDateStr = getNonNullValue(detail.path("RETIREMENT_DATE"));
LocalDate retirementDate = parseDate(retirementDateStr);
// Only add to the list if RETIREMENT_DATE is today or in the future
if (retirementDate != null && !retirementDate.isBefore(currentDate)) {
Map<String, String> listResult = new HashMap<>();
listResult.put("RETIREMENT_DATE", retirementDateStr);
listResult.put("DEATH_DATE", getNonNullValue(detail.path("DEATH_DATE")));
listResult.put("COMMUNITY_NAME", getNonNullValue(detail.path("COMMUNITY_NAME")));
listResult.put("GROUP_TYPE", getNonNullValue(detail.path("GROUP_TYPE")));
listResult.put("ID_DEPT", getNonNullValue(detail.path("ID_DEPT")));
listResult.put("EMPLOYEE_CODE", getNonNullValue(detail.path("EMPLOYEE_CODE")));
listResult.put("FUNCTIONARY", getNonNullValue(detail.path("FUNCTIONARY")));
listResult.put("IS_HANDICAPPED", getNonNullValue(detail.path("IS_HANDICAPPED")));
listResult.put("GENDER", getNonNullValue(detail.path("GENDER")));
listResult.put("DATE_OF_BIRTH", getNonNullValue(detail.path("DATE_OF_BIRTH")));
listResult.put("DATE_OF_APPOINTMENT", getNonNullValue(detail.path("DATE_OF_APPOINTMENT")));
listResult.put("DESIGNATION", getNonNullValue(detail.path("DESIGNATION")));
listResult.put("EMPLOYEE_NAME", getNonNullValue(detail.path("EMPLOYEE_NAME")));
listResult.put("DEPARTMENT", getNonNullValue(detail.path("DEPARTMENT")));
list.add(listResult);
}
} }
// Sort the list by RETIREMENT_DATE in ascending order
list.sort(Comparator.comparing(map -> parseDate(((Map<String, String>) map).get("RETIREMENT_DATE"))));
response.put("list", list);
// Sort the list by RETIREMENT_DATE in ascending order
list.sort(Comparator.comparing(map -> parseDate(map.get("RETIREMENT_DATE"))));
response.put("list", list);
} else { } else {
response.put("list", Collections.emptyList()); response.put("list", Collections.emptyList());
} }
@ -107,15 +180,16 @@ public class NewEntryService {
System.err.println("Invalid JSON Response: " + rawResponse); System.err.println("Invalid JSON Response: " + rawResponse);
response.put("list", Collections.emptyList()); response.put("list", Collections.emptyList());
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
response.put("list", Collections.emptyList()); response.put("list", Collections.emptyList());
} }
return response; return response;
} }
public Map<String, Object> fetchEmplyeeDetailsbyCode(String empCode) { public Map<String, Object> fetchEmplyeeDetailsbyCode(String empCode) {
@ -123,7 +197,7 @@ public class NewEntryService {
String apiUrl = appconfig.qaqcurl + "serviceId=common_api" String apiUrl = appconfig.qaqcurl + "serviceId=common_api"
+ "&jsonResp=Yes" + "&jsonResp=Yes"
+ "&subService=getEmpPenDet"
+ "&subService=getEmpWorkDet"
+ "&empCode=" + empCode; + "&empCode=" + empCode;
System.out.println("url: " + apiUrl); System.out.println("url: " + apiUrl);
@ -143,6 +217,7 @@ public class NewEntryService {
for (JsonNode detail : details) { for (JsonNode detail : details) {
Map<String, String> listResult = new HashMap<>(); Map<String, String> listResult = new HashMap<>();
listResult.put("RETIREMENT_DATE", formatToISODate(getNonNullValue(detail.path("RETIREMENT_DATE")))); listResult.put("RETIREMENT_DATE", formatToISODate(getNonNullValue(detail.path("RETIREMENT_DATE"))));
listResult.put("TO_DATE", parseDate(getNonNullValue(detail.path("TO_DATE"))).toString());
listResult.put("DEATH_DATE", getNonNullValue(detail.path("DEATH_DATE"))); listResult.put("DEATH_DATE", getNonNullValue(detail.path("DEATH_DATE")));
listResult.put("COMMUNITY_NAME", getNonNullValue(detail.path("COMMUNITY_NAME"))); listResult.put("COMMUNITY_NAME", getNonNullValue(detail.path("COMMUNITY_NAME")));
listResult.put("GROUP_TYPE", getNonNullValue(detail.path("GROUP_TYPE"))); listResult.put("GROUP_TYPE", getNonNullValue(detail.path("GROUP_TYPE")));
@ -161,6 +236,7 @@ public class NewEntryService {
// Sort the list by RETIREMENT_DATE in ascending order // Sort the list by RETIREMENT_DATE in ascending order
list.sort(Comparator.comparing(map -> parseDate(((Map<String, String>) map).get("RETIREMENT_DATE")))); list.sort(Comparator.comparing(map -> parseDate(((Map<String, String>) map).get("RETIREMENT_DATE"))));
response.put("list", list); response.put("list", list);
System.out.println("listresult: "+list);
} else { } else {
response.put("list", Collections.emptyList()); response.put("list", Collections.emptyList());
@ -208,21 +284,49 @@ public class NewEntryService {
} }
} }
private LocalDate parseDate(String date) {
if (date == null || date.isEmpty()) {
return LocalDate.MIN; // Use a minimum value for invalid or empty dates
}
try {
// Remove time part if present
if (date.contains(" ")) {
date = date.split(" ")[0]; // Extract only the date part before space
}
DateTimeFormatter formatter;
if (date.matches("\\d{4}-\\d{2}-\\d{2}")) { // yyyy-MM-dd
formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
} else if (date.matches("\\d{2}-\\d{2}-\\d{4}")) { // dd-MM-yyyy
formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy");
} else {
System.err.println("Unknown date format: " + date);
return LocalDate.MIN;
}
return LocalDate.parse(date, formatter);
} catch (DateTimeParseException e) {
e.printStackTrace();
return LocalDate.MIN; // Fallback for invalid dates
}
}
private LocalDate parseDate(String date) {
if (date == null || date.isEmpty()) {
return LocalDate.MIN; // Use a minimum value for invalid or empty dates
}
try {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy"); // Adjust format as needed
return LocalDate.parse(date, formatter);
} catch (DateTimeParseException e) {
e.printStackTrace();
return LocalDate.MIN; // Fallback for invalid dates
}
}
// private LocalDate parseDate(String date) {
// if (date == null || date.isEmpty()) {
// return LocalDate.MIN; // Use a minimum value for invalid or empty dates
// }
// try {
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy"); // Adjust format as needed
// return LocalDate.parse(date, formatter);
// } catch (DateTimeParseException e) {
// e.printStackTrace();
// return LocalDate.MIN; // Fallback for invalid dates
// }
// }
private boolean isValidJson(String json) { private boolean isValidJson(String json) {

2
backend/pensioner/service/PensionPartiallyCompService.java

@ -304,7 +304,7 @@ public class PensionPartiallyCompService {
// Define the SQL query // Define the SQL query
String sql = "SELECT " + String sql = "SELECT " +
"CASE " + "CASE " +
"WHEN pb.benefit_pension = 'yes' AND pb.benefit_dcrg = 'yes' AND pb.benefit_commutation = 'yes' " +
"WHEN pb.benefit_pension = 'yes' AND pb.benefit_dcrg = 'yes' " +
"THEN 1 ELSE 0 " + "THEN 1 ELSE 0 " +
"END AS allYes " + "END AS allYes " +
"FROM pension_benefits AS pb " + "FROM pension_benefits AS pb " +

11
frontend/pensioner/department/audit/pendency.html

@ -313,7 +313,7 @@ margin-top: 10px;
<input type="text" id="classes" class="form-control" readonly> <input type="text" id="classes" class="form-control" readonly>
</div> </div>
<div class="col-sm-6">
<div class="col-md-6">
<label for="retirementdate" class="form-label fw-bold">Retirement Date </label> <label for="retirementdate" class="form-label fw-bold">Retirement Date </label>
<input type="date" id="retirementdate" class="form-control" readonly> <input type="date" id="retirementdate" class="form-control" readonly>
</div> </div>
@ -355,7 +355,7 @@ margin-top: 10px;
<!-- Remarks --> <!-- Remarks -->
<div class="col-md-12"> <div class="col-md-12">
<label for="remarks_modal" class="form-label fw-bold">Remarks </label>
<label for="remarks_modal" class="form-label fw-bold">Comments/Remarks</label>
<textarea id="remarks_modal" class="form-control" rows="4" placeholder="Enter your remarks here" readonly></textarea> <textarea id="remarks_modal" class="form-control" rows="4" placeholder="Enter your remarks here" readonly></textarea>
</div> </div>
@ -546,6 +546,11 @@ margin-top: 10px;
// $('#datefile').val(''); // $('#datefile').val('');
$('#remarks').val(''); $('#remarks').val('');
document.getElementById("receivedcard").style.display = "block"; document.getElementById("receivedcard").style.display = "block";
// Scroll the receivedcard section into view
document.getElementById("receivedcard").scrollIntoView({
behavior: "smooth", // Smooth scrolling effect
block: "center" // Aligns the element to the center of the viewport
});
}); });
@ -663,7 +668,7 @@ margin-top: 10px;
function saveEntryDetails(tempId,empNo) { function saveEntryDetails(tempId,empNo) {
//console.log("emp_no inside=="+empCode); //console.log("emp_no inside=="+empCode);
let entryDetails = { let entryDetails = {
empNo: empNo,
empNo: $('#employeeno').val(),
tempId: tempId, tempId: tempId,
dateToAudit:convertDateFormat($('#datefile').val()?.trim()), dateToAudit:convertDateFormat($('#datefile').val()?.trim()),
remarks: $('#remarks').val(), remarks: $('#remarks').val(),

4
frontend/pensioner/department/audit/retirement.html

@ -249,7 +249,7 @@ margin-top: 10px;
<input type="text" id="designation" class="form-control" readonly> <input type="text" id="designation" class="form-control" readonly>
</div> </div>
<div class="col-sm-6">
<div class="col-md-6">
<label for="retirementdate" class="form-label fw-bold">Retirement Date </label> <label for="retirementdate" class="form-label fw-bold">Retirement Date </label>
<input type="date" id="retirementdate" class="form-control" readonly> <input type="date" id="retirementdate" class="form-control" readonly>
</div> </div>
@ -304,7 +304,7 @@ margin-top: 10px;
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<label for="remarks" class="form-label fw-bold">Remarks<span class="text-danger">*</span></label>
<label for="remarks" class="form-label fw-bold">Comments/Remarks<span class="text-danger">*</span></label>
<textarea id="remarks" class="form-control" rows="4" placeholder="Enter your remarks here"></textarea> <textarea id="remarks" class="form-control" rows="4" placeholder="Enter your remarks here"></textarea>
</div> </div>

2
frontend/pensioner/department/closedList.html

@ -628,7 +628,7 @@ margin-top: 10px;
Swal.fire({ Swal.fire({
icon: "warning", icon: "warning",
title: "No Data Found", title: "No Data Found",
text: "No details found for this employee number.",
text: "No details found.",
confirmButtonText: "OK", confirmButtonText: "OK",
customClass: { customClass: {
confirmButton: "btn btn-primary" confirmButton: "btn btn-primary"

2
frontend/pensioner/department/completed/gis.html

@ -237,7 +237,7 @@ margin-top: 10px;
<input type="text" id="designation" class="form-control" readonly> <input type="text" id="designation" class="form-control" readonly>
</div> </div>
<div class="col-sm-6">
<div class="col-md-6">
<label for="retirementdate" class="form-label fw-bold">While in service Death </label> <label for="retirementdate" class="form-label fw-bold">While in service Death </label>
<input type="date" id="retirementdate" class="form-control" readonly> <input type="date" id="retirementdate" class="form-control" readonly>
</div> </div>

2
frontend/pensioner/department/completed/provisionalretirement.html

@ -309,7 +309,7 @@ margin-top: 10px;
<input type="text" id="typeofretirement" class="form-control" readonly> <input type="text" id="typeofretirement" class="form-control" readonly>
</div> </div>
<div class="col-sm-6">
<div class="col-md-6">
<label for="retirementdate" class="form-label fw-bold">Retirement Date <span class="text-danger">*</span></label> <label for="retirementdate" class="form-label fw-bold">Retirement Date <span class="text-danger">*</span></label>
<input type="date" id="retirementdate" class="form-control" readonly> <input type="date" id="retirementdate" class="form-control" readonly>
</div> </div>

56
frontend/pensioner/department/dashboard.html

@ -680,7 +680,7 @@ margin-top: 10px;
}); });
// Function to validate and set min-date for endDate // Function to validate and set min-date for endDate
function validateEndDate() {
/* function validateEndDate() {
const startDate = document.getElementById('startDate').value; const startDate = document.getElementById('startDate').value;
const endDateInput = document.getElementById('endDate'); const endDateInput = document.getElementById('endDate');
@ -697,7 +697,7 @@ margin-top: 10px;
} }
document.getElementById('startDate').addEventListener('change', validateEndDate); document.getElementById('startDate').addEventListener('change', validateEndDate);
*/
function renderCharts(startDate = null, endDate = null) { function renderCharts(startDate = null, endDate = null) {
const deptId = $('#deptId').text().trim(); const deptId = $('#deptId').text().trim();
@ -926,6 +926,58 @@ $.ajax({
}); });
}) })
$('#startDate').on('change', function () {
const fromDate = $(this).val();
$('#endDate').attr('min', fromDate); // Update min attribute for To Date
// If To Date is earlier than the new From Date, adjust it
const toDate = $('#endDate').val();
if (new Date(toDate) < new Date(fromDate)) {
$('#endDate').val(fromDate);
}
});
// Update From Date's max attribute when To Date changes
$('#endDate').on('change', function () {
const toDate = $(this).val();
$('#startDate').attr('max', toDate); // Update max attribute for From Date
// If From Date is later than the new To Date, adjust it
const fromDate = $('#startDate').val();
if (new Date(fromDate) > new Date(toDate)) {
$('#startDate').val(toDate);
}
});
//disable future dates
document.addEventListener("DOMContentLoaded", function () {
let today = new Date().toISOString().split("T")[0]; // Get today's date in YYYY-MM-DD format
let startdateInput = document.getElementById("startDate");
let enddateInput = document.getElementById("endDate");
// Set max attribute to disable future dates
startdateInput.setAttribute("max", today);
enddateInput.setAttribute("max", today);
// Prevent manual future date entry
startdateInput.addEventListener("change", function () {
if (this.value > today) {
Swal.fire({
icon: 'warning',
title: 'Invalid Date',
text: 'Future dates are not allowed.',
confirmButtonText: 'OK'
});
this.value = ""; // Clear the invalid input
}
});
});
</script> </script>

94
frontend/pensioner/department/fileclosing.html

@ -580,7 +580,7 @@ margin-top: 10px;
<div class="col-md-3"> <div class="col-md-3">
<label for="deathdate" class="form-label fw-bold">Employee Death Date<span class="text-danger">*</span></label> <label for="deathdate" class="form-label fw-bold">Employee Death Date<span class="text-danger">*</span></label>
<input type="date" id="deathdate" class="form-control" >
<input type="date" id="deathdate" class="form-control" onclick="this.showPicker()">
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
@ -649,6 +649,31 @@ margin-top: 10px;
// Call once on page load // Call once on page load
initializeDataTable(); initializeDataTable();
// Trigger search on pressing Enter key
$('#empCode').on('keydown', function (event) {
if (event.key === 'Enter') {
event.preventDefault(); // Prevent default form submission or page reload
const empCode = $('#empCode').val(); // Get the value of empCode
if (!empCode) {
// Show Swal alert if the employee number is missing
Swal.fire({
icon: "warning", // Display a warning icon
title: "Missing Employee Number",
text: "Please enter an employee number to proceed.",
confirmButtonText: "OK",
customClass: {
confirmButton: "btn btn-primary" // Optional styling for the button
}
});
return; // Stop further execution
}
$('#searchButton').click(); // Trigger the click event of the search button
}
});
// Handle Search button click // Handle Search button click
@ -726,7 +751,7 @@ margin-top: 10px;
<td class="text-center">${audit.emp_name || 'N/A'}</td> <td class="text-center">${audit.emp_name || 'N/A'}</td>
<td class="text-center">${audit.dept_name || 'N/A'}</td> <td class="text-center">${audit.dept_name || 'N/A'}</td>
<td class="text-center">${audit.designation || 'N/A'}</td> <td class="text-center">${audit.designation || 'N/A'}</td>
<td class="text-center">${audit.file_moved_date ? formatDate(audit['file_moved_date'],'dd-MM-yyyy') : 'N/A'}</td>
<td class="text-center">${audit.file_moved_date ? formatDate(audit.file_moved_date, 'dd-MM-yyyy') : 'N/A'}</td>
<td class="text-center">${audit.file_entry_type || 'N/A'}</td> <td class="text-center">${audit.file_entry_type || 'N/A'}</td>
<td class="text-center"> <td class="text-center">
<button class="btn btn-primary btn-sm view-btn" data-id="${audit.emp_no}" data-temp-id="${audit.temp_id}"> <button class="btn btn-primary btn-sm view-btn" data-id="${audit.emp_no}" data-temp-id="${audit.temp_id}">
@ -745,11 +770,24 @@ margin-top: 10px;
initializeDataTable(); initializeDataTable();
} }
function formatDate(dateString) {
function formatDate(dateString, format = 'dd-MM-yyyy') {
if (!dateString) return 'N/A'; if (!dateString) return 'N/A';
let date = new Date(dateString);
return date.toISOString().split('T')[0]; // Format: YYYY-MM-DD
// Handle case where date might have time part (e.g., "2024-05-31 00:00:00.0")
let parts = dateString.split(' ')[0].split('-'); // Extract only the date part
if (parts.length !== 3) return 'N/A';
let [year, month, day] = parts; // Assuming date format is "YYYY-MM-DD"
if (format === 'dd-MM-yyyy') {
return `${day}-${month}-${year}`;
} else if (format === 'MM-dd-yyyy') {
return `${month}-${day}-${year}`;
} else {
return dateString; // Default case (return original format)
}
} }
}); });
@ -1114,13 +1152,13 @@ margin-top: 10px;
// Function to format date and time // Function to format date and time
function formatDateTime(dateString) { function formatDateTime(dateString) {
const options = {
day: '2-digit',
month: '2-digit',
year: 'numeric',
};
return new Date(dateString).toLocaleDateString('en-GB', options); // Formats as dd-mm-yyyy
}
const options = {
day: '2-digit',
month: '2-digit',
year: 'numeric',
};
return new Date(dateString).toLocaleDateString('en-GB', options); // Formats as dd-mm-yyyy
}
@ -1138,8 +1176,8 @@ margin-top: 10px;
// Set the value of the input field to the current date (in DD-MM-YYYY format for display) // Set the value of the input field to the current date (in DD-MM-YYYY format for display)
document.getElementById("datefile").value = formattedDateDisplay; document.getElementById("datefile").value = formattedDateDisplay;
document.getElementById("datefilereceived").value = formattedDateDisplay;
document.getElementById("datefileyes").value = formattedDateDisplay;
//document.getElementById("datefilereceived").value = formattedDateDisplay;
//document.getElementById("datefileyes").value = formattedDateDisplay;
}); });
@ -1223,6 +1261,34 @@ margin-top: 10px;
}); });
} }
//disable future dates
document.addEventListener("DOMContentLoaded", function () {
let today = new Date().toISOString().split("T")[0]; // Get today's date in YYYY-MM-DD format
let deathdate = document.getElementById("deathdate");
// Set max attribute to disable future dates
deathdate.setAttribute("max", today);
// Prevent manual future date entry
deathdate.addEventListener("change", function () {
if (this.value > today) {
Swal.fire({
icon: 'warning',
title: 'Invalid Date',
text: 'Future dates are not allowed.',
confirmButtonText: 'OK'
});
this.value = ""; // Clear the invalid input
}
});
});
</script> </script>

10
frontend/pensioner/department/newentry/familypension.html

@ -225,9 +225,7 @@ padding-top: 2%;
<!-- pending duration--> <!-- pending duration-->
<div class="col-md-6"> <div class="col-md-6">
<label for="pendingDuration" class="form-label fw-bold"> <label for="pendingDuration" class="form-label fw-bold">
Pending Duration Pending Duration
@ -714,9 +712,9 @@ function convertDateFormat(dateString) {
remarks: $('#remarks').val(), remarks: $('#remarks').val(),
pendingDuration: pendingDuration, pendingDuration: pendingDuration,
reasonPending: pendingDurationReason, reasonPending: pendingDurationReason,
deptId:$('#deptId').text().trim(),
filemovedby:$('#userId').text().trim(),
filecategory:$('#filecategory').text().trim()
deptId:$('#deptId').text().trim(),
filemovedby:$('#userId').text().trim(),
filecategory:$('#filecategory').text().trim()
}; };

47
frontend/pensioner/department/newentry/pendency.html

@ -404,21 +404,42 @@ $(document).ready(function (){
// Optional: Validate department ID if needed. // Optional: Validate department ID if needed.
const loggedInDeptId = $('#deptId').text().trim(); const loggedInDeptId = $('#deptId').text().trim();
const currentDate = $('#filesentdate').val().trim(); const currentDate = $('#filesentdate').val().trim();
if(employeeDetails.RETIREMENT_DATE >= currentDate){
Swal.fire({
icon: "warning",
title: "Not Applicable",
text: "This employee not applicable for this pendency.",
confirmButtonText: "OK",
customClass: {
confirmButton: "btn btn-primary"
}
});
return;
const retirementDateStr = employeeDetails.RETIREMENT_DATE.trim();
// Convert input date from "dd-MM-yyyy" to "yyyy-MM-dd"
function parseInputDate(dateStr) {
let parts = dateStr.split('-'); // Assuming input is "dd-MM-yyyy"
if (parts.length === 3) {
return new Date(parts[2], parts[1] - 1, parts[0]); // Convert to "YYYY, MM-1, DD"
}
return null;
}
// Convert RETIREMENT_DATE from "YYYY-MM-DD" to Date object
const retirementDate = new Date(retirementDateStr);
const currentDateObj = parseInputDate(currentDate);
if (!retirementDate || !currentDateObj) {
console.error("Invalid date format", retirementDate, currentDateObj);
return;
} }
// Compare retirement date with current date
if (retirementDate >= currentDateObj) {
Swal.fire({
icon: "warning",
title: "Not Applicable",
text: "This employee is not applicable for this pendency.",
confirmButtonText: "OK",
customClass: {
confirmButton: "btn btn-primary"
}
});
return;
}
// If the returned data is invalid, show a warning. // If the returned data is invalid, show a warning.
if (!employeeDetails || !employeeDetails.EMPLOYEE_CODE) { if (!employeeDetails || !employeeDetails.EMPLOYEE_CODE) {
Swal.fire({ Swal.fire({

4
frontend/pensioner/department/partial/pendency.html

@ -263,12 +263,12 @@ margin-top: 10px;
<input type="text" id="designation" class="form-control" readonly> <input type="text" id="designation" class="form-control" readonly>
</div> </div>
<div class="col-sm-6">
<div class="col-md-6">
<label for="classes" class="form-label fw-bold">Class</label> <label for="classes" class="form-label fw-bold">Class</label>
<input type="text" id="classes" class="form-control" readonly> <input type="text" id="classes" class="form-control" readonly>
</div> </div>
<div class="col-sm-6">
<div class="col-md-6">
<label for="retirementdate" class="form-label fw-bold">Retirement Date </label> <label for="retirementdate" class="form-label fw-bold">Retirement Date </label>
<input type="date" id="retirementdate" class="form-control" readonly> <input type="date" id="retirementdate" class="form-control" readonly>
</div> </div>

2
frontend/pensioner/department/received/pendency.html

@ -223,7 +223,7 @@ margin-top: 10px;
<input type="text" id="designation" class="form-control" readonly> <input type="text" id="designation" class="form-control" readonly>
</div> </div>
<div class="col-sm-4">
<div class="col-md-4">
<label for="retirementdate" class="form-label fw-bold">Retirement Date </label> <label for="retirementdate" class="form-label fw-bold">Retirement Date </label>
<input type="date" id="retirementdate" class="form-control" readonly> <input type="date" id="retirementdate" class="form-control" readonly>
</div> </div>

4
frontend/pensioner/department/received/provisionalretirement.html

@ -302,13 +302,13 @@ margin-top: 10px;
<input type="text" id="classes" class="form-control" readonly> <input type="text" id="classes" class="form-control" readonly>
</div> </div>
<div class="col-sm-6">
<div class="col-md-6">
<label for="retirementdate" class="form-label fw-bold">Retirement Date <span class="text-danger">*</span></label> <label for="retirementdate" class="form-label fw-bold">Retirement Date <span class="text-danger">*</span></label>
<input type="date" id="retirementdate" class="form-control" readonly> <input type="date" id="retirementdate" class="form-control" readonly>
</div> </div>
<!-- Type Of Retirement typeofretirement--> <!-- Type Of Retirement typeofretirement-->
<div class="col-sm-6">
<div class="col-md-6">
<label for="typeofretirement" class="form-label fw-bold">Type Of Retirement<span class="text-danger">*</span></label> <label for="typeofretirement" class="form-label fw-bold">Type Of Retirement<span class="text-danger">*</span></label>
<select id="typeofretirement" class="form-select" style="width: 100%; height:34px;" required> <select id="typeofretirement" class="form-select" style="width: 100%; height:34px;" required>
<option value="" selected>-- Select Option --</option> <option value="" selected>-- Select Option --</option>

2
frontend/pensioner/department/received/retirement.html

@ -223,7 +223,7 @@ margin-top: 10px;
<input type="text" id="designation" class="form-control" readonly> <input type="text" id="designation" class="form-control" readonly>
</div> </div>
<div class="col-sm-4">
<div class="col-md-4">
<label for="retirementdate" class="form-label fw-bold">Retirement Date </label> <label for="retirementdate" class="form-label fw-bold">Retirement Date </label>
<input type="date" id="retirementdate" class="form-control" readonly> <input type="date" id="retirementdate" class="form-control" readonly>
</div> </div>

50
frontend/pensioner/department/reports.html

@ -296,7 +296,7 @@ td, th {
<th class="text-center">File Status</th> <th class="text-center">File Status</th>
<th class="text-center">File category</th> <th class="text-center">File category</th>
<th class="text-center">File Moved Date</th> <th class="text-center">File Moved Date</th>
<th class="text-center">Remarks</th>
<th class="text-center">Comments/Remarks</th>
</tr> </tr>
</thead> </thead>
<tbody id="fileDetailsTableBody" style="text-align:center;"> <tbody id="fileDetailsTableBody" style="text-align:center;">
@ -321,7 +321,7 @@ td, th {
<th class="text-center">File Status</th> <th class="text-center">File Status</th>
<th class="text-center">File Category</th> <th class="text-center">File Category</th>
<th class="text-center">File Moved Date</th> <th class="text-center">File Moved Date</th>
<th class="text-center">Remarks</th>
<th class="text-center">Comments/Remarks</th>
</tr> </tr>
</thead> </thead>
<tbody id="fileRetireTableBody" style="text-align:center;"> <tbody id="fileRetireTableBody" style="text-align:center;">
@ -348,7 +348,7 @@ td, th {
<th class="text-center">File Status</th> <th class="text-center">File Status</th>
<th class="text-center">File Category</th> <th class="text-center">File Category</th>
<th class="text-center">File Moved Date</th> <th class="text-center">File Moved Date</th>
<th class="text-center">Remarks</th>
<th class="text-center">Comments/Remarks</th>
</tr> </tr>
</thead> </thead>
<tbody id="fileFamilyTableBody" style="text-align:center;"> <tbody id="fileFamilyTableBody" style="text-align:center;">
@ -374,7 +374,7 @@ td, th {
<th class="text-center">File Status</th> <th class="text-center">File Status</th>
<th class="text-center">File Category</th> <th class="text-center">File Category</th>
<th class="text-center">File Moved Date</th> <th class="text-center">File Moved Date</th>
<th class="text-center">Remarks</th>
<th class="text-center">Comments/Remarks</th>
</tr> </tr>
</thead> </thead>
<tbody id="filePendencyTableBody" style="text-align:center;"> <tbody id="filePendencyTableBody" style="text-align:center;">
@ -399,7 +399,7 @@ td, th {
<th class="text-center">File Status</th> <th class="text-center">File Status</th>
<th class="text-center">File category</th> <th class="text-center">File category</th>
<th class="text-center">File Moved Date</th> <th class="text-center">File Moved Date</th>
<th class="text-center">Remarks</th>
<th class="text-center">Comments/Remarks</th>
</tr> </tr>
</thead> </thead>
<tbody id="fileGisTableBody" style="text-align:center;"> <tbody id="fileGisTableBody" style="text-align:center;">
@ -425,7 +425,7 @@ td, th {
<th class="text-center">File Status</th> <th class="text-center">File Status</th>
<th class="text-center">File category</th> <th class="text-center">File category</th>
<th class="text-center">File Moved Date</th> <th class="text-center">File Moved Date</th>
<th class="text-center">Remarks</th>
<th class="text-center">Comments/Remarks</th>
</tr> </tr>
</thead> </thead>
<tbody id="fileProvisionalTableBody" style="text-align:center;"> <tbody id="fileProvisionalTableBody" style="text-align:center;">
@ -592,7 +592,7 @@ td, th {
{ title: "File Status", data: "fst", className: "text-center" }, { title: "File Status", data: "fst", className: "text-center" },
{ title: "File Category", data: "file_category_name", className: "text-center" }, { title: "File Category", data: "file_category_name", className: "text-center" },
{ title: "File Moved Date", data: "created_date", className: "text-center" }, { title: "File Moved Date", data: "created_date", className: "text-center" },
{ title: "Remarks", data: "remarks", className: "text-center" },
{ title: "Comments/Remarks", data: "remarks", className: "text-center" },
] ]
}); });
@ -633,7 +633,7 @@ td, th {
{ title: "File Status", data: "fst", className: "text-center" }, { title: "File Status", data: "fst", className: "text-center" },
{ title: "File Category", data: "file_category_name", className: "text-center" }, { title: "File Category", data: "file_category_name", className: "text-center" },
{ title: "File Moved Date", data: "file_moved_date", className: "text-center" }, { title: "File Moved Date", data: "file_moved_date", className: "text-center" },
{ title: "Remarks", data: "remarks", className: "text-center" },
{ title: "Comments/Remarks", data: "remarks", className: "text-center" },
] ]
}); });
@ -675,7 +675,7 @@ td, th {
{ title: "File Status", data: "fst", className: "text-center" }, { title: "File Status", data: "fst", className: "text-center" },
{ title: "File Category", data: "file_category_name", className: "text-center" }, { title: "File Category", data: "file_category_name", className: "text-center" },
{ title: "File Moved Date", data: "file_moved_date", className: "text-center" }, { title: "File Moved Date", data: "file_moved_date", className: "text-center" },
{ title: "Remarks", data: "remarks", className: "text-center" },
{ title: "Comments/Remarks", data: "remarks", className: "text-center" },
] ]
}); });
@ -717,7 +717,7 @@ td, th {
{ title: "File Status", data: "fst", className: "text-center" }, { title: "File Status", data: "fst", className: "text-center" },
{ title: "File Category", data: "file_category_name", className: "text-center" }, { title: "File Category", data: "file_category_name", className: "text-center" },
{ title: "File Moved Date", data: "file_moved_date", className: "text-center" }, { title: "File Moved Date", data: "file_moved_date", className: "text-center" },
{ title: "Remarks", data: "remarks", className: "text-center" },
{ title: "Comments/Remarks", data: "remarks", className: "text-center" },
] ]
}); });
@ -758,7 +758,7 @@ td, th {
{ title: "File Status", data: "fst", className: "text-center" }, { title: "File Status", data: "fst", className: "text-center" },
{ title: "File Category", data: "file_category_name", className: "text-center" }, { title: "File Category", data: "file_category_name", className: "text-center" },
{ title: "File Moved Date", data: "file_moved_date", className: "text-center" }, { title: "File Moved Date", data: "file_moved_date", className: "text-center" },
{ title: "Remarks", data: "remarks", className: "text-center" },
{ title: "Comments/Remarks", data: "remarks", className: "text-center" },
] ]
}); });
@ -799,7 +799,7 @@ td, th {
{ title: "File Category", data: "file_category_name", className: "text-center" }, { title: "File Category", data: "file_category_name", className: "text-center" },
{ title: "File Status", data: "fst", className: "text-center" }, { title: "File Status", data: "fst", className: "text-center" },
{ title: "File Moved Date", data: "file_moved_date", className: "text-center" }, { title: "File Moved Date", data: "file_moved_date", className: "text-center" },
{ title: "Remarks", data: "remarks", className: "text-center" },
{ title: "Comments/Remarks", data: "remarks", className: "text-center" },
] ]
}); });
@ -1143,6 +1143,32 @@ td, th {
}); });
}); });
//disable future dates
document.addEventListener("DOMContentLoaded", function () {
let today = new Date().toISOString().split("T")[0]; // Get today's date in YYYY-MM-DD format
let startdateInput = document.getElementById("startdate");
let enddateInput = document.getElementById("enddate");
// Set max attribute to disable future dates
startdateInput.setAttribute("max", today);
enddateInput.setAttribute("max", today);
// Prevent manual future date entry
startdateInput.addEventListener("change", function () {
if (this.value > today) {
Swal.fire({
icon: 'warning',
title: 'Invalid Date',
text: 'Future dates are not allowed.',
confirmButtonText: 'OK'
});
this.value = ""; // Clear the invalid input
}
});
});
</script> </script>

12
frontend/pensioner/department/return/pendency.html

@ -217,6 +217,7 @@ margin-top: 10px;
<th class="text-center">Name </th> <th class="text-center">Name </th>
<th class="text-center">Department</th> <th class="text-center">Department</th>
<th class="text-center">Designation</th> <th class="text-center">Designation</th>
<th class="text-center">File Sent Date</th>
<th class="text-center">File Type</th> <th class="text-center">File Type</th>
<th class="text-center">File Category Type</th> <th class="text-center">File Category Type</th>
<th class="text-center">View</th> <th class="text-center">View</th>
@ -303,7 +304,7 @@ margin-top: 10px;
<input type="text" id="classes" class="form-control" readonly> <input type="text" id="classes" class="form-control" readonly>
</div> </div>
<div class="col-sm-6">
<div class="col-md-6">
<label for="retirementdate" class="form-label fw-bold">Retirement Date </label> <label for="retirementdate" class="form-label fw-bold">Retirement Date </label>
<input type="date" id="retirementdate" class="form-control" readonly> <input type="date" id="retirementdate" class="form-control" readonly>
</div> </div>
@ -345,7 +346,7 @@ margin-top: 10px;
<!-- Remarks --> <!-- Remarks -->
<div class="col-md-12"> <div class="col-md-12">
<label for="remarks_modal" class="form-label fw-bold">Comments/Remarks <span class="text-danger">*</span></label> <label for="remarks_modal" class="form-label fw-bold">Comments/Remarks <span class="text-danger">*</span></label>
<textarea id="remarks_modal" class="form-control" rows="4" placeholder="Enter your remarks here" readonly></textarea>
<textarea id="remarks_modal" class="form-control" rows="4" placeholder="Enter your remarks here"></textarea>
</div> </div>
@ -530,6 +531,11 @@ function convertDateFormat(dateString) {
//$('#datefile').val(''); //$('#datefile').val('');
$('#remarks').val(''); $('#remarks').val('');
document.getElementById("receivedcard").style.display = "block"; document.getElementById("receivedcard").style.display = "block";
// Scroll the receivedcard section into view
document.getElementById("receivedcard").scrollIntoView({
behavior: "smooth", // Smooth scrolling effect
block: "center" // Aligns the element to the center of the viewport
});
@ -652,7 +658,7 @@ function convertDateFormat(dateString) {
function saveEntryDetails(tempId,empNo) { function saveEntryDetails(tempId,empNo) {
//console.log("emp_no inside=="+empCode); //console.log("emp_no inside=="+empCode);
let entryDetails = { let entryDetails = {
empNo: empNo,
empNo: $('#employeeno').val(),
tempId: tempId, tempId: tempId,
dateToAudit: convertDateFormat($('#datefile').val()?.trim()), dateToAudit: convertDateFormat($('#datefile').val()?.trim()),
remarks: $('#remarks').val(), remarks: $('#remarks').val(),

2
frontend/pensioner/department/return/retirement.html

@ -235,7 +235,7 @@ margin-top: 10px;
<input type="text" id="designation" class="form-control" readonly> <input type="text" id="designation" class="form-control" readonly>
</div> </div>
<div class="col-sm-6">
<div class="col-md-6">
<label for="retirementdate" class="form-label fw-bold">Retirement Date </label> <label for="retirementdate" class="form-label fw-bold">Retirement Date </label>
<input type="date" id="retirementdate" class="form-control" readonly> <input type="date" id="retirementdate" class="form-control" readonly>
</div> </div>

9
frontend/pensioner/pensioner/audit/pendency.html

@ -314,7 +314,7 @@ margin-top: 10px;
</div> </div>
<div class="col-sm-6">
<div class="col-md-6">
<label for="retirementdate" class="form-label fw-bold">Retirement Date </label> <label for="retirementdate" class="form-label fw-bold">Retirement Date </label>
<input type="date" id="retirementdate" class="form-control" readonly> <input type="date" id="retirementdate" class="form-control" readonly>
</div> </div>
@ -535,6 +535,11 @@ function convertDateFormat(dateString) {
//$('#datefile').val(''); //$('#datefile').val('');
$('#remarks').val(''); $('#remarks').val('');
document.getElementById("receivedcard").style.display = "block"; document.getElementById("receivedcard").style.display = "block";
// Scroll the receivedcard section into view
document.getElementById("receivedcard").scrollIntoView({
behavior: "smooth", // Smooth scrolling effect
block: "center" // Aligns the element to the center of the viewport
});
}); });
@ -654,7 +659,7 @@ function convertDateFormat(dateString) {
function saveEntryDetails(tempId,empNo) { function saveEntryDetails(tempId,empNo) {
//console.log("emp_no inside=="+empCode); //console.log("emp_no inside=="+empCode);
let entryDetails = { let entryDetails = {
empNo: empNo,
empNo: $('#employeeno').val(),
tempId: tempId, tempId: tempId,
dateToAudit: convertDateFormat($('#datefile').val()?.trim()), dateToAudit: convertDateFormat($('#datefile').val()?.trim()),
remarks: $('#remarks').val(), remarks: $('#remarks').val(),

2
frontend/pensioner/pensioner/audit/retirement.html

@ -236,7 +236,7 @@ margin-top: 10px;
<input type="text" id="designation" class="form-control" readonly> <input type="text" id="designation" class="form-control" readonly>
</div> </div>
<div class="col-sm-6">
<div class="col-md-6">
<label for="retirementdate" class="form-label fw-bold">Retirement Date </label> <label for="retirementdate" class="form-label fw-bold">Retirement Date </label>
<input type="date" id="retirementdate" class="form-control" readonly> <input type="date" id="retirementdate" class="form-control" readonly>
</div> </div>

2
frontend/pensioner/pensioner/completed/gis.html

@ -236,7 +236,7 @@ margin-top: 10px;
<input type="text" id="designation" class="form-control" readonly> <input type="text" id="designation" class="form-control" readonly>
</div> </div>
<div class="col-sm-6">
<div class="col-md-6">
<label for="retirementdate" class="form-label fw-bold">While in service Death </label> <label for="retirementdate" class="form-label fw-bold">While in service Death </label>
<input type="date" id="retirementdate" class="form-control" readonly> <input type="date" id="retirementdate" class="form-control" readonly>
</div> </div>

4
frontend/pensioner/pensioner/completed/pendency.html

@ -306,12 +306,12 @@ margin-top: 10px;
<input type="text" id="designation" class="form-control" readonly> <input type="text" id="designation" class="form-control" readonly>
</div> </div>
<div class="col-sm-6">
<div class="col-md-6">
<label for="classes" class="form-label fw-bold">Class<span class="text-danger">*</span></label> <label for="classes" class="form-label fw-bold">Class<span class="text-danger">*</span></label>
<input type="text" id="classes" class="form-control" readonly> <input type="text" id="classes" class="form-control" readonly>
</div> </div>
<div class="col-sm-6">
<div class="col-md-6">
<label for="retirementdate" class="form-label fw-bold">Retirement Date <span class="text-danger">*</span></label> <label for="retirementdate" class="form-label fw-bold">Retirement Date <span class="text-danger">*</span></label>
<input type="date" id="retirementdate" class="form-control" readonly> <input type="date" id="retirementdate" class="form-control" readonly>
</div> </div>

2
frontend/pensioner/pensioner/completed/provisionalretirement.html

@ -302,7 +302,7 @@ margin-top: 10px;
<input type="text" id="classes" class="form-control" readonly> <input type="text" id="classes" class="form-control" readonly>
</div> </div>
<div class="col-sm-6">
<div class="col-md-6">
<label for="retirementdate" class="form-label fw-bold">Retirement Date <span class="text-danger">*</span></label> <label for="retirementdate" class="form-label fw-bold">Retirement Date <span class="text-danger">*</span></label>
<input type="date" id="retirementdate" class="form-control" readonly> <input type="date" id="retirementdate" class="form-control" readonly>
</div> </div>

57
frontend/pensioner/pensioner/dashboard.html

@ -664,7 +664,7 @@ table.dataTable td {
}); });
// Function to validate and set min-date for endDate // Function to validate and set min-date for endDate
function validateEndDate() {
/* function validateEndDate() {
const startDate = document.getElementById('startDate').value; const startDate = document.getElementById('startDate').value;
const endDateInput = document.getElementById('endDate'); const endDateInput = document.getElementById('endDate');
@ -681,8 +681,10 @@ table.dataTable td {
} }
} }
document.getElementById('startDate').addEventListener('change', validateEndDate);
function renderCharts(startDate = null, endDate = null) {
document.getElementById('startDate').addEventListener('change', validateEndDate); */
function renderCharts(startDate = null, endDate = null) {
const deptId= document.getElementById('deptId').value; const deptId= document.getElementById('deptId').value;
const dataParams = deptId ? { deptId, startDate, endDate } : { startDate, endDate }; const dataParams = deptId ? { deptId, startDate, endDate } : { startDate, endDate };
console.log("deptId",deptId); console.log("deptId",deptId);
@ -908,6 +910,55 @@ table.dataTable td {
// Initial chart rendering // Initial chart rendering
}) })
$('#startDate').on('change', function () {
const fromDate = $(this).val();
$('#endDate').attr('min', fromDate); // Update min attribute for To Date
// If To Date is earlier than the new From Date, adjust it
const toDate = $('#endDate').val();
if (new Date(toDate) < new Date(fromDate)) {
$('#endDate').val(fromDate);
}
});
// Update From Date's max attribute when To Date changes
$('#endDate').on('change', function () {
const toDate = $(this).val();
$('#startDate').attr('max', toDate); // Update max attribute for From Date
// If From Date is later than the new To Date, adjust it
const fromDate = $('#startDate').val();
if (new Date(fromDate) > new Date(toDate)) {
$('#startDate').val(toDate);
}
});
//disable future dates
document.addEventListener("DOMContentLoaded", function () {
let today = new Date().toISOString().split("T")[0]; // Get today's date in YYYY-MM-DD format
let startdateInput = document.getElementById("startDate");
let enddateInput = document.getElementById("endDate");
// Set max attribute to disable future dates
startdateInput.setAttribute("max", today);
enddateInput.setAttribute("max", today);
// Prevent manual future date entry
startdateInput.addEventListener("change", function () {
if (this.value > today) {
Swal.fire({
icon: 'warning',
title: 'Invalid Date',
text: 'Future dates are not allowed.',
confirmButtonText: 'OK'
});
this.value = ""; // Clear the invalid input
}
});
});
</script> </script>
</body> </body>

9
frontend/pensioner/pensioner/forward/pendency.html

@ -314,7 +314,7 @@ margin-top: 10px;
</div> </div>
<div class="col-sm-6">
<div class="col-md-6">
<label for="retirementdate" class="form-label fw-bold">Retirement Date </label> <label for="retirementdate" class="form-label fw-bold">Retirement Date </label>
<input type="date" id="retirementdate" class="form-control" readonly> <input type="date" id="retirementdate" class="form-control" readonly>
</div> </div>
@ -535,6 +535,11 @@ function convertDateFormat(dateString) {
//$('#datefile').val(''); //$('#datefile').val('');
$('#remarks').val(''); $('#remarks').val('');
document.getElementById("receivedcard").style.display = "block"; document.getElementById("receivedcard").style.display = "block";
// Scroll the receivedcard section into view
document.getElementById("receivedcard").scrollIntoView({
behavior: "smooth", // Smooth scrolling effect
block: "center" // Aligns the element to the center of the viewport
});
}); });
@ -654,7 +659,7 @@ function convertDateFormat(dateString) {
function saveEntryDetails(tempId,empNo) { function saveEntryDetails(tempId,empNo) {
//console.log("emp_no inside=="+empCode); //console.log("emp_no inside=="+empCode);
let entryDetails = { let entryDetails = {
empNo: empNo,
empNo: $('#employeeno').val(),
tempId: tempId, tempId: tempId,
dateToAudit: convertDateFormat($('#datefile').val()?.trim()), dateToAudit: convertDateFormat($('#datefile').val()?.trim()),
remarks: $('#remarks').val(), remarks: $('#remarks').val(),

2
frontend/pensioner/pensioner/forward/retirement.html

@ -215,7 +215,7 @@ margin-top: 10px;
<input type="text" id="designation" class="form-control" readonly> <input type="text" id="designation" class="form-control" readonly>
</div> </div>
<div class="col-sm-6">
<div class="col-md-6">
<label for="retirementdate" class="form-label fw-bold">Retirement Date </label> <label for="retirementdate" class="form-label fw-bold">Retirement Date </label>
<input type="date" id="retirementdate" class="form-control" readonly> <input type="date" id="retirementdate" class="form-control" readonly>
</div> </div>

63
frontend/pensioner/pensioner/received/familypension.html

@ -753,7 +753,7 @@ margin-top: 10px;
document.getElementById("commonbenefitcard").style.display = "none"; document.getElementById("commonbenefitcard").style.display = "none";
document.getElementById("receivedcard").style.display = "block"; document.getElementById("receivedcard").style.display = "block";
document.getElementById("receivedcard").scrollIntoView({
document.getElementById("returndisplaybutton").scrollIntoView({
behavior: "smooth", // Smooth scrolling effect behavior: "smooth", // Smooth scrolling effect
block: "center" // Aligns the element to the center of the viewport block: "center" // Aligns the element to the center of the viewport
}); });
@ -763,7 +763,7 @@ margin-top: 10px;
}); });
$('#benefitbutton').off('click').on('click', function() {
/* $('#benefitbutton').off('click').on('click', function() {
if(file_Pending==='yes'){ if(file_Pending==='yes'){
$('input[name="filepending"][value="' + BenefitDetails.file_pending + '"]').prop('checked', true); $('input[name="filepending"][value="' + BenefitDetails.file_pending + '"]').prop('checked', true);
$('#commonbenefitcard').show(); $('#commonbenefitcard').show();
@ -771,7 +771,10 @@ margin-top: 10px;
$('#datefileyes').val(BenefitDetails.file_moved_date); $('#datefileyes').val(BenefitDetails.file_moved_date);
$('#remarksyes').val(BenefitDetails.remarks); $('#remarksyes').val(BenefitDetails.remarks);
document.getElementById("benefitbutton").scrollIntoView({
behavior: "smooth", // Smooth scrolling effect
block: "center" // Aligns the element to the center of the viewport
});
$('#pendingbutton').prop('disabled', true); $('#pendingbutton').prop('disabled', true);
} }
@ -783,7 +786,59 @@ margin-top: 10px;
$('#pendingbutton').prop('disabled', false); $('#pendingbutton').prop('disabled', false);
} }
});
}); */
$('#benefitbutton').off('click').on('click', function() {
// Show the required elements first
$('#commonbenefitcard').show();
// Delay scroll to ensure elements are fully rendered
setTimeout(() => {
document.getElementById("benefitbutton").scrollIntoView({
behavior: "smooth",
block: "center"
});
}, 100); // Small delay
if (file_Pending === 'yes') {
$('input[name="filepending"][value="' + BenefitDetails.file_pending + '"]').prop('checked', true);
$('#filependingContainer').show();
$('#datefileyes').val(BenefitDetails.file_moved_date);
$('#remarksyes').val(BenefitDetails.remarks);
$('#pendingbutton').prop('disabled', true);
} else {
$('input[name="filepending"]').prop('checked', false);
document.getElementById("receivedcard").style.display = "none";
$('#pendingbutton').prop('disabled', false);
}
});
// Function to scroll inside the modal
function scrollToElement(targetElement) {
var modalBody = $('#returnretrieddetailsModal .modal-body');
// Ensure the modal content is fully loaded before scrolling
setTimeout(function () {
modalBody.animate({
scrollTop: $(targetElement).offset().top - modalBody.offset().top + modalBody.scrollTop()
}, 'fast');
}, 200);
}
//Scroll when "PendingYes" is clicked
$('input[name="filepending"]').on('change', function () {
if ($(this).val() === "yes") {
$("#filependingContainer").show(); // Show before scrolling
scrollToElement("#filependingContainer");
} else {
$("#filependingContainer").hide();
$("#benefitContainer").show(); // Ensure benefitContainer is visible
scrollToElement("#benefitContainer"); // Scroll to benefitContainer
}
});
/* document.getElementById("benefitbutton").addEventListener("click", function() { /* document.getElementById("benefitbutton").addEventListener("click", function() {
$('input[name="filepending"]').prop('checked', false); $('input[name="filepending"]').prop('checked', false);

2
frontend/pensioner/pensioner/received/gis.html

@ -236,7 +236,7 @@ margin-top: 10px;
<input type="text" id="designation" class="form-control" readonly> <input type="text" id="designation" class="form-control" readonly>
</div> </div>
<div class="col-sm-6">
<div class="col-md-6">
<label for="retirementdate" class="form-label fw-bold">While in service Death </label> <label for="retirementdate" class="form-label fw-bold">While in service Death </label>
<input type="date" id="retirementdate" class="form-control" readonly> <input type="date" id="retirementdate" class="form-control" readonly>
</div> </div>

74
frontend/pensioner/pensioner/received/pendency.html

@ -224,12 +224,12 @@ margin-top: 10px;
<input type="text" id="designation" class="form-control" readonly> <input type="text" id="designation" class="form-control" readonly>
</div> </div>
<div class="col-sm-6">
<div class="col-md-6">
<label for="classes" class="form-label fw-bold">Class</label> <label for="classes" class="form-label fw-bold">Class</label>
<input type="text" id="classes" class="form-control" readonly> <input type="text" id="classes" class="form-control" readonly>
</div> </div>
<div class="col-sm-6">
<div class="col-md-6">
<label for="retirementdate" class="form-label fw-bold">Retirement Date </label> <label for="retirementdate" class="form-label fw-bold">Retirement Date </label>
<input type="date" id="retirementdate" class="form-control" readonly> <input type="date" id="retirementdate" class="form-control" readonly>
</div> </div>
@ -748,9 +748,19 @@ margin-top: 10px;
document.getElementById("receivedcard").style.display = "block"; document.getElementById("receivedcard").style.display = "block";
document.getElementById("benefitContainer").style.display = "none"; document.getElementById("benefitContainer").style.display = "none";
document.getElementById("filependingContainer").style.display = "none"; document.getElementById("filependingContainer").style.display = "none";
document.getElementById("returndisplaybutton").scrollIntoView({
behavior: "smooth", // Smooth scrolling effect
block: "center" // Aligns the element to the center of the viewport
});
}); });
$('#benefitbutton').off('click').on('click', function() {
/* $('#benefitbutton').off('click').on('click', function() {
document.getElementById("benefitbutton").scrollIntoView({
behavior: "smooth", // Smooth scrolling effect
block: "center" // Aligns the element to the center of the viewport
});
if(file_Pending==='yes'){ if(file_Pending==='yes'){
$('input[name="filepending"][value="' + BenefitDetails.file_pending + '"]').prop('checked', true); $('input[name="filepending"][value="' + BenefitDetails.file_pending + '"]').prop('checked', true);
$('#commonbenefitcard').show(); $('#commonbenefitcard').show();
@ -760,6 +770,8 @@ margin-top: 10px;
$('#pendingbutton').prop('disabled', true); $('#pendingbutton').prop('disabled', true);
} }
else{ else{
@ -770,7 +782,61 @@ margin-top: 10px;
$('#pendingbutton').prop('disabled', false); $('#pendingbutton').prop('disabled', false);
} }
});
}); */
$('#benefitbutton').off('click').on('click', function() {
// Show the required elements first
$('#commonbenefitcard').show();
// Delay scroll to ensure elements are fully rendered
setTimeout(() => {
document.getElementById("benefitbutton").scrollIntoView({
behavior: "smooth",
block: "center"
});
}, 100); // Small delay
if (file_Pending === 'yes') {
$('input[name="filepending"][value="' + BenefitDetails.file_pending + '"]').prop('checked', true);
$('#filependingContainer').show();
$('#datefileyes').val(BenefitDetails.file_moved_date);
$('#remarksyes').val(BenefitDetails.remarks);
$('#pendingbutton').prop('disabled', true);
} else {
$('input[name="filepending"]').prop('checked', false);
document.getElementById("receivedcard").style.display = "none";
$('#pendingbutton').prop('disabled', false);
}
});
// Function to scroll inside the modal
function scrollToElement(targetElement) {
var modalBody = $('#returnretrieddetailsModal .modal-body');
// Ensure the modal content is fully loaded before scrolling
setTimeout(function () {
modalBody.animate({
scrollTop: $(targetElement).offset().top - modalBody.offset().top + modalBody.scrollTop()
}, 'fast');
}, 200);
}
//Scroll when "PendingYes" is clicked
$('input[name="filepending"]').on('change', function () {
if ($(this).val() === "yes") {
$("#filependingContainer").show(); // Show before scrolling
scrollToElement("#filependingContainer");
} else {
$("#filependingContainer").hide();
$("#benefitContainer").show(); // Ensure benefitContainer is visible
scrollToElement("#benefitContainer"); // Scroll to benefitContainer
}
});
/* document.getElementById("benefitbutton").addEventListener("click", function() { /* document.getElementById("benefitbutton").addEventListener("click", function() {
$('input[name="filepending"]').prop('checked', false); $('input[name="filepending"]').prop('checked', false);

2
frontend/pensioner/pensioner/received/provisionalretirement.html

@ -309,7 +309,7 @@ margin-top: 10px;
</div> </div>
<div class="col-sm-6">
<div class="col-md-6">
<label for="retirementdate" class="form-label fw-bold">Retirement Date <span class="text-danger">*</span></label> <label for="retirementdate" class="form-label fw-bold">Retirement Date <span class="text-danger">*</span></label>
<input type="date" id="retirementdate" class="form-control" readonly> <input type="date" id="retirementdate" class="form-control" readonly>
</div> </div>

65
frontend/pensioner/pensioner/received/retirement.html

@ -224,7 +224,7 @@ margin-top: 10px;
<input type="text" id="designation" class="form-control" readonly> <input type="text" id="designation" class="form-control" readonly>
</div> </div>
<div class="col-sm-4">
<div class="col-md-4">
<label for="retirementdate" class="form-label fw-bold">Retirement Date </label> <label for="retirementdate" class="form-label fw-bold">Retirement Date </label>
<input type="date" id="retirementdate" class="form-control" readonly> <input type="date" id="retirementdate" class="form-control" readonly>
</div> </div>
@ -689,7 +689,7 @@ margin-top: 10px;
/* $('#DcrgYes').prop('disabled', true); /* $('#DcrgYes').prop('disabled', true);
$('#DcrgNo').prop('disabled', true); */ $('#DcrgNo').prop('disabled', true); */
$('#dcrgCard').hide(); $('#dcrgCard').hide();
s
} }
@ -708,10 +708,15 @@ margin-top: 10px;
document.getElementById("receivedcard").style.display = "block"; document.getElementById("receivedcard").style.display = "block";
document.getElementById("benefitContainer").style.display = "none"; document.getElementById("benefitContainer").style.display = "none";
document.getElementById("filependingContainer").style.display = "none"; document.getElementById("filependingContainer").style.display = "none";
document.getElementById("returndisplaybutton").scrollIntoView({
behavior: "smooth", // Smooth scrolling effect
block: "center" // Aligns the element to the center of the viewport
});
}); });
$('#benefitbutton').off('click').on('click', function() {
/* $('#benefitbutton').off('click').on('click', function() {
if(file_Pending==='yes'){ if(file_Pending==='yes'){
$('input[name="filepending"][value="' + BenefitDetails.file_pending + '"]').prop('checked', true); $('input[name="filepending"][value="' + BenefitDetails.file_pending + '"]').prop('checked', true);
$('#commonbenefitcard').show(); $('#commonbenefitcard').show();
@ -730,7 +735,59 @@ margin-top: 10px;
$('#pendingbutton').prop('disabled', false); $('#pendingbutton').prop('disabled', false);
} }
});
}); */
$('#benefitbutton').off('click').on('click', function() {
// Show the required elements first
$('#commonbenefitcard').show();
// Delay scroll to ensure elements are fully rendered
setTimeout(() => {
document.getElementById("benefitbutton").scrollIntoView({
behavior: "smooth",
block: "center"
});
}, 100); // Small delay
if (file_Pending === 'yes') {
$('input[name="filepending"][value="' + BenefitDetails.file_pending + '"]').prop('checked', true);
$('#filependingContainer').show();
$('#datefileyes').val(BenefitDetails.file_moved_date);
$('#remarksyes').val(BenefitDetails.remarks);
$('#pendingbutton').prop('disabled', true);
} else {
$('input[name="filepending"]').prop('checked', false);
document.getElementById("receivedcard").style.display = "none";
$('#pendingbutton').prop('disabled', false);
}
});
// Function to scroll inside the modal
function scrollToElement(targetElement) {
var modalBody = $('#returnretrieddetailsModal .modal-body');
// Ensure the modal content is fully loaded before scrolling
setTimeout(function () {
modalBody.animate({
scrollTop: $(targetElement).offset().top - modalBody.offset().top + modalBody.scrollTop()
}, 'fast');
}, 200);
}
//Scroll when "PendingYes" is clicked
$('input[name="filepending"]').on('change', function () {
if ($(this).val() === "yes") {
$("#filependingContainer").show(); // Show before scrolling
scrollToElement("#filependingContainer");
} else {
$("#filependingContainer").hide();
$("#benefitContainer").show(); // Ensure benefitContainer is visible
scrollToElement("#benefitContainer"); // Scroll to benefitContainer
}
});
/* document.getElementById("benefitbutton").addEventListener("click", function() { /* document.getElementById("benefitbutton").addEventListener("click", function() {
$('input[name="filepending"]').prop('checked', false); $('input[name="filepending"]').prop('checked', false);

61
frontend/pensioner/pensioner/reports.html

@ -326,11 +326,11 @@ td, th {
<th class="text-center">Designation</th> <th class="text-center">Designation</th>
<th class="text-center">Department</th> <th class="text-center">Department</th>
<th class="text-center">Type of Retirement</th> <th class="text-center">Type of Retirement</th>
<th class="text-center">Date of Retire</th>
<th class="text-center">Date of Retirement</th>
<th class="text-center">File Status</th> <th class="text-center">File Status</th>
<th class="text-center">File Category</th> <th class="text-center">File Category</th>
<th class="text-center">File Moved Date</th> <th class="text-center">File Moved Date</th>
<th class="text-center">Remarks</th>
<th class="text-center">Comments/Remarks</th>
</tr> </tr>
</thead> </thead>
<tbody id="fileRetireTableBody" style="text-align:center;"> <tbody id="fileRetireTableBody" style="text-align:center;">
@ -358,7 +358,7 @@ td, th {
<th class="text-center">File Status</th> <th class="text-center">File Status</th>
<th class="text-center">File Category</th> <th class="text-center">File Category</th>
<th class="text-center">File Moved Date</th> <th class="text-center">File Moved Date</th>
<th class="text-center">Remarks</th>
<th class="text-center">Comments/Remarks</th>
</tr> </tr>
</thead> </thead>
<tbody id="fileFamilyTableBody" style="text-align:center;"> <tbody id="fileFamilyTableBody" style="text-align:center;">
@ -380,12 +380,12 @@ td, th {
<th class="text-center">Department</th> <th class="text-center">Department</th>
<th class="text-center">Designation</th> <th class="text-center">Designation</th>
<th class="text-center">Type of Retirement</th> <th class="text-center">Type of Retirement</th>
<th class="text-center">Date of Retire</th>
<th class="text-center">Date of Retirement</th>
<th class="text-center">Pending Duration</th> <th class="text-center">Pending Duration</th>
<th class="text-center">File Status</th> <th class="text-center">File Status</th>
<th class="text-center">File Category</th> <th class="text-center">File Category</th>
<th class="text-center">File Moved Date</th> <th class="text-center">File Moved Date</th>
<th class="text-center">Remarks</th>
<th class="text-center">Comments/Remarks</th>
</tr> </tr>
</thead> </thead>
<tbody id="filePendencyTableBody" style="text-align:center;"> <tbody id="filePendencyTableBody" style="text-align:center;">
@ -411,7 +411,7 @@ td, th {
<th class="text-center">File Status</th> <th class="text-center">File Status</th>
<th class="text-center">File category</th> <th class="text-center">File category</th>
<th class="text-center">File Moved Date</th> <th class="text-center">File Moved Date</th>
<th class="text-center">Remarks</th>
<th class="text-center">Comments/Remarks</th>
</tr> </tr>
</thead> </thead>
<tbody id="fileGisTableBody" style="text-align:center;"> <tbody id="fileGisTableBody" style="text-align:center;">
@ -434,11 +434,11 @@ td, th {
<th class="text-center">Department</th> <th class="text-center">Department</th>
<th class="text-center">Designation</th> <th class="text-center">Designation</th>
<th class="text-center">Type of Retirement</th> <th class="text-center">Type of Retirement</th>
<th class="text-center">Date of Retire</th>
<th class="text-center">Date of Retirement</th>
<th class="text-center">File Status</th> <th class="text-center">File Status</th>
<th class="text-center">File category</th> <th class="text-center">File category</th>
<th class="text-center">File Moved Date</th> <th class="text-center">File Moved Date</th>
<th class="text-center">Remarks</th>
<th class="text-center">Comments/Remarks</th>
</tr> </tr>
</thead> </thead>
<tbody id="fileProvisionalTableBody" style="text-align:center;"> <tbody id="fileProvisionalTableBody" style="text-align:center;">
@ -758,7 +758,7 @@ td, th {
{ title: "File Status", data: "fst", className: "text-center" }, { title: "File Status", data: "fst", className: "text-center" },
{ title: "File Category", data: "file_category_name", className: "text-center" }, { title: "File Category", data: "file_category_name", className: "text-center" },
{ title: "File Moved Date", data: "created_date", className: "text-center" }, { title: "File Moved Date", data: "created_date", className: "text-center" },
{ title: "Remarks", data: "remarks", className: "text-center" },
{ title: "Comments/Remarks", data: "remarks", className: "text-center" },
] ]
}); });
@ -832,11 +832,11 @@ td, th {
{ title: "Department", data: "dept_name", className: "text-center" }, { title: "Department", data: "dept_name", className: "text-center" },
{ title: "Designation", data: "designation", className: "text-center" }, { title: "Designation", data: "designation", className: "text-center" },
{ title: "Type of Retirement", data: "type_of_retirement", className: "text-center" }, { title: "Type of Retirement", data: "type_of_retirement", className: "text-center" },
{ title: "Date of Retire", data: "retirement_date", className: "text-center" },
{ title: "Date of Retirement", data: "retirement_date", className: "text-center" },
{ title: "File Status", data: "fst", className: "text-center" }, { title: "File Status", data: "fst", className: "text-center" },
{ title: "File Category", data: "file_category_name", className: "text-center" }, { title: "File Category", data: "file_category_name", className: "text-center" },
{ title: "File Moved Date", data: "file_moved_date", className: "text-center" }, { title: "File Moved Date", data: "file_moved_date", className: "text-center" },
{ title: "Remarks", data: "remarks", className: "text-center" },
{ title: "Comments/Remarks", data: "remarks", className: "text-center" },
] ]
}); });
@ -915,7 +915,7 @@ td, th {
{ title: "File Status", data: "fst", className: "text-center" }, { title: "File Status", data: "fst", className: "text-center" },
{ title: "File Category", data: "file_category_name", className: "text-center" }, { title: "File Category", data: "file_category_name", className: "text-center" },
{ title: "File Moved Date", data: "file_moved_date", className: "text-center" }, { title: "File Moved Date", data: "file_moved_date", className: "text-center" },
{ title: "Remarks", data: "remarks", className: "text-center" },
{ title: "Comments/Remarks", data: "remarks", className: "text-center" },
] ]
}); });
@ -989,12 +989,12 @@ td, th {
{ title: "Department", data: "dept_name", className: "text-center" }, { title: "Department", data: "dept_name", className: "text-center" },
{ title: "Designation", data: "designation", className: "text-center" }, { title: "Designation", data: "designation", className: "text-center" },
{ title: "Type of Retirement", data: "type_of_retirement", className: "text-center" }, { title: "Type of Retirement", data: "type_of_retirement", className: "text-center" },
{ title: "Date of Retire", data: "retirement_date", className: "text-center" },
{ title: "Date of Retirement", data: "retirement_date", className: "text-center" },
{ title: "Pending Duration", data: "reason_for_pending", className: "text-center" }, { title: "Pending Duration", data: "reason_for_pending", className: "text-center" },
{ title: "File Status", data: "fst", className: "text-center" }, { title: "File Status", data: "fst", className: "text-center" },
{ title: "File Category", data: "file_category_name", className: "text-center" }, { title: "File Category", data: "file_category_name", className: "text-center" },
{ title: "File Moved Date", data: "file_moved_date", className: "text-center" }, { title: "File Moved Date", data: "file_moved_date", className: "text-center" },
{ title: "Remarks", data: "remarks", className: "text-center" },
{ title: "Comments/Remarks", data: "remarks", className: "text-center" },
] ]
}); });
@ -1072,7 +1072,7 @@ td, th {
{ title: "File Status", data: "fst", className: "text-center" }, { title: "File Status", data: "fst", className: "text-center" },
{ title: "File Category", data: "file_category_name", className: "text-center" }, { title: "File Category", data: "file_category_name", className: "text-center" },
{ title: "File Moved Date", data: "file_moved_date", className: "text-center" }, { title: "File Moved Date", data: "file_moved_date", className: "text-center" },
{ title: "Remarks", data: "remarks", className: "text-center" },
{ title: "Comments/Remarks", data: "remarks", className: "text-center" },
] ]
}); });
@ -1146,11 +1146,11 @@ td, th {
{ title: "Department", data: "dept_name", className: "text-center" }, { title: "Department", data: "dept_name", className: "text-center" },
{ title: "Designation", data: "designation", className: "text-center" }, { title: "Designation", data: "designation", className: "text-center" },
{ title: "Type of Retirement", data: "type_of_retirement", className: "text-center" }, { title: "Type of Retirement", data: "type_of_retirement", className: "text-center" },
{ title: "Date of Retire", data: "retirement_date", className: "text-center" },
{ title: "Date of Retirement", data: "retirement_date", className: "text-center" },
{ title: "File Category", data: "file_category_name", className: "text-center" }, { title: "File Category", data: "file_category_name", className: "text-center" },
{ title: "File Status", data: "fst", className: "text-center" }, { title: "File Status", data: "fst", className: "text-center" },
{ title: "File Moved Date", data: "file_moved_date", className: "text-center" }, { title: "File Moved Date", data: "file_moved_date", className: "text-center" },
{ title: "Remarks", data: "remarks", className: "text-center" },
{ title: "Comments/Remarks", data: "remarks", className: "text-center" },
] ]
}); });
@ -1548,6 +1548,33 @@ td, th {
}); });
}); });
//disable future dates
document.addEventListener("DOMContentLoaded", function () {
let today = new Date().toISOString().split("T")[0]; // Get today's date in YYYY-MM-DD format
let startdateInput = document.getElementById("startdate");
let enddateInput = document.getElementById("enddate");
// Set max attribute to disable future dates
startdateInput.setAttribute("max", today);
enddateInput.setAttribute("max", today);
// Prevent manual future date entry
startdateInput.addEventListener("change", function () {
if (this.value > today) {
Swal.fire({
icon: 'warning',
title: 'Invalid Date',
text: 'Future dates are not allowed.',
confirmButtonText: 'OK'
});
this.value = ""; // Clear the invalid input
}
});
});
</script> </script>

Loading…
Cancel
Save