You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1157 lines
48 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html lang="en" dir="">
  3. <html xmlns:th="http://www.thymeleaf.org">
  4. <head th:replace="~{fragments/modules/base/head :: head}"></head>
  5. <style>
  6. .required{
  7. color: red;
  8. }
  9. #modalBody p {
  10. margin: 5px 0;
  11. }
  12. #modalBody hr {
  13. margin: 15px 0;
  14. }
  15. hr {
  16. border: 1px solid #ccc;
  17. margin-top: 20px;
  18. margin-bottom: 20px;
  19. }
  20. h5 {
  21. font-size: bold;
  22. }
  23. #returnretrieddetailsModal .modal-body{
  24. max-height:80vh;
  25. overflow-y:auto;
  26. }
  27. #returnretrieddetailsModal .col-md-6{
  28. padding-bottom: 10px;
  29. }
  30. .file-history-list {
  31. margin-top: 10px;
  32. padding-left: 0;
  33. }
  34. .file-history-item {
  35. display: flex;
  36. padding: 5px 10px;
  37. font-family: Arial, sans-serif;
  38. align-items: flex-start;
  39. position: relative; /* For vertical line positioning */
  40. margin-bottom: 1px; /* Add space between items */
  41. }
  42. .file-history-item::before {
  43. content: '';
  44. position: absolute;
  45. top: 0;
  46. bottom: 0;
  47. left: 120px; /* Position of the vertical line */
  48. width: 1px;
  49. background-color: #ddd;
  50. }
  51. .file-history-date {
  52. margin-top: 10px;
  53. flex: 0 0 100px;
  54. font-weight: bold;
  55. font-size: 0.8rem;
  56. color: #333;
  57. text-align: center;
  58. white-space: nowrap; /* Prevent wrapping */
  59. }
  60. .file-history-content {
  61. flex: 5;
  62. padding-left: 20px; /* Adds space after the vertical line */
  63. display: flex;
  64. flex-direction: column;
  65. gap: 5px; /* Adds spacing between status and remarks */
  66. white-space: pre-wrap; /* Prevents wrapping */
  67. overflow: visible; /* Prevents content overflow */
  68. text-overflow: ellipsis; /* Adds ellipsis if content exceeds container width */
  69. }
  70. .file-history-status {
  71. font-size: 0.8rem;
  72. font-weight: bold;
  73. color: #555;
  74. white-space:pre-wrap; /* Prevent wrapping */
  75. overflow: visible;
  76. text-overflow: ellipsis;
  77. }
  78. .file-history-remarks {
  79. font-size: 0.8rem;
  80. color: #777;
  81. white-space: pre-wrap; /* Prevent wrapping */
  82. overflow: visible;
  83. text-overflow: ellipsis;
  84. }
  85. #sec1 .col-md-4,.col-md-12{
  86. padding-top: 1%;
  87. }
  88. .col-md-4 .form-check{
  89. width: 25%;
  90. }
  91. .col-md-6 .form-check{
  92. width: 25%;
  93. }
  94. </style>
  95. <body>
  96. <!--[if lt IE 8]>
  97. <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
  98. <![endif]-->
  99. <div class="wrapper">
  100. <!-- header top menu Start -->
  101. <header th:replace="~{fragments/modules/base/header :: header}"></header>
  102. <!-- header top menu end -->
  103. <div class="page-wrap">
  104. <!--=============== Left Menu side Start ================-->
  105. <div th:replace="~{fragments/modules/base/menu :: menu}"></div>
  106. <!--=============== Left side End ================-->
  107. <div class="main-content">
  108. <div class="container-fluid">
  109. <div class="page-header mb-2">
  110. <div class="row align-items-end">
  111. <div class="col-lg-8">
  112. <div class="page-header-title">
  113. <i class="fa fa-list-alt bg-blue"></i>
  114. <div class="d-inline">
  115. <h5>Retirement</h5>
  116. <span>Department Entries</span>
  117. </div>
  118. </div>
  119. </div>
  120. <div class="col-lg-4">
  121. <nav class="breadcrumb-container" aria-label="breadcrumb">
  122. <ol class="breadcrumb">
  123. <li class="breadcrumb-item"><a href="/gcc/index"><i class="ik ik-home"></i></a></li>
  124. <li class="breadcrumb-item" aria-current="page">Department Entries</li>
  125. <li class="breadcrumb-item" aria-current="page">Partially Completed</li>
  126. <li class="breadcrumb-item active" aria-current="page">Retirement</li>
  127. </ol>
  128. </nav>
  129. </div>
  130. </div>
  131. </div>
  132. <div class="row mt-4">
  133. <div class="col-md-12">
  134. <div class="card">
  135. <div class="card-block">
  136. <h5 style="font-weight:bold;"> <span th:text="${deptname}" id="deptname"></span>&nbsp;Department</h5>
  137. <h5 style="font-weight:bold;">Partially Completed - Retirement</h5>
  138. <h5 style="font-weight:bold;"><span th:text="${deptId}" id="deptId" style="display:none"></span></h5>
  139. <span th:text="${userId}" id="userId" style="display:none"></span>
  140. <div id="audittable">
  141. <table id="AuditDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid">
  142. <thead class="thead-dark">
  143. <tr role="row">
  144. <th class="text-center">S.No</th>
  145. <th class="text-center">Employee Code</th>
  146. <th class="text-center">Name </th>
  147. <th class="text-center">Department</th>
  148. <th class="text-center">Designation</th>
  149. <th class="text-center">File Sent Date</th>
  150. <th class="text-center">File Type</th>
  151. <th class="text-center">View</th>
  152. </tr>
  153. </thead>
  154. <tbody style="text-align:center;">
  155. <!-- Thymeleaf loop to populate data -->
  156. <tr th:each="audit, iterStat : ${auditlist}">
  157. <td th:text="${iterStat.index + 1}" class="text-center"></td>
  158. <td th:text="${audit['emp_no']}" class="text-center"></td>
  159. <td th:text="${audit['emp_name']}" class="text-center"></td>
  160. <td th:text="${audit['dept_name']}" class="text-center"></td>
  161. <td th:text="${audit['designation']}" class="text-center"></td>
  162. <td th:text="${audit['file_moved_date'] != null ? #dates.format(audit['file_moved_date'], 'dd-MM-yyyy') : 'N/A'}" class="text-center"></td>
  163. <td th:text="${audit['file_entry_type']}" class="text-center"></td>
  164. <td class="text-center">
  165. <button class="btn btn-primary btn-sm view-btn" th:attr="data-id=${audit['emp_no']}, data-temp-id=${audit['temp_id']}">
  166. View
  167. </button>
  168. </td>
  169. </tr>
  170. </tbody>
  171. </table>
  172. </div>
  173. </div>
  174. </div>
  175. </div>
  176. </div>
  177. </div>
  178. </div>
  179. <!-- page loader-->
  180. <div id="pageLoader" style="display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.8); z-index: 9999; text-align: center;">
  181. <div style="position: relative; top: 50%; transform: translateY(-50%);">
  182. <div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;">
  183. <span class="sr-only">Loading...</span>
  184. </div>
  185. <!-- Add the 'Please wait' text below the spinner -->
  186. <p style="margin-top: 1rem; font-size: 1.2rem; color: #007bff;">Please wait...</p>
  187. </div>
  188. </div>
  189. <footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
  190. </div>
  191. </div>
  192. <!-- Modal Box -->
  193. <div class="modal fade" id="returnretrieddetailsModal" tabindex="-1" role="dialog" aria-labelledby="detailsModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">
  194. <div class="modal-dialog modal-xl" role="document">
  195. <div class="modal-content">
  196. <div class="modal-header">
  197. <h5 class="modal-title" id="detailsModalLabel">
  198. Partially Completed - Retirement (<span id="modalEmployeeCode"></span>)
  199. </h5>
  200. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  201. <span aria-hidden="true">&times;</span>
  202. </button>
  203. </div>
  204. <div class="modal-body">
  205. <div class="row" id="sec1">
  206. <!-- Employee No -->
  207. <div class="col-md-4">
  208. <label for="employeenomodel" class="form-label fw-bold">Employee No </label>
  209. <input type="number" id="employeenomodel" class="form-control" readonly>
  210. </div>
  211. <!-- Employee Name -->
  212. <div class="col-md-4">
  213. <label for="employeename" class="form-label fw-bold">Employee Name </label>
  214. <input type="text" id="employeename" class="form-control" readonly>
  215. </div>
  216. <!-- Department -->
  217. <div class="col-md-4">
  218. <label for="department" class="form-label fw-bold">Department </label>
  219. <input type="text" id="department" class="form-control" readonly>
  220. </div>
  221. <!-- Designation -->
  222. <div class="col-md-4">
  223. <label for="designation" class="form-label fw-bold">Designation </label>
  224. <input type="text" id="designation" class="form-control" readonly>
  225. </div>
  226. <div class="col-md-4">
  227. <label for="retirementdate" class="form-label fw-bold">Retirement Date </label>
  228. <input type="date" id="retirementdate" class="form-control" readonly>
  229. </div>
  230. <!-- Class -->
  231. <div class="col-md-4">
  232. <label for="classes" class="form-label fw-bold">Class </label>
  233. <input type="text" id="classes" class="form-control" readonly>
  234. </div>
  235. <!-- Type of Retirement -->
  236. <div class="col-md-4">
  237. <label for="typeofretirement" class="form-label fw-bold">Type of Retirement </label>
  238. <input type="text" id="typeofretirement" class="form-control" readonly>
  239. </div>
  240. <!-- Date File Sent to Audit -->
  241. <div class="col-md-4">
  242. <label for="datefile_modal" class="form-label fw-bold">Date File Received From Department</label>
  243. <input type="date" id="datefile_modal" class="form-control" readonly>
  244. </div>
  245. <!-- Remarks -->
  246. <div class="col-md-12">
  247. <label for="remarks_modal" class="form-label fw-bold">Comments/Remarks </label>
  248. <textarea id="remarks_modal" class="form-control" rows="4" readonly></textarea>
  249. </div>
  250. <!-- new -->
  251. <div class="col-md-12 mt-4">
  252. <h5>File History</h5>
  253. <div id="fileHistoryContainer" class="file-history-list">
  254. <!-- File History will be dynamically loaded here -->
  255. </div>
  256. </div>
  257. </div>
  258. <div class="row mb-2 mt-2">
  259. <div class="col-md-12 d-flex justify-content-center">
  260. <button type="button" class="btn btn-primary mx-2" id="submitbutton">Edit Benefits</button>
  261. <button type="button" class="btn btn-secondary" data-dismiss="modal" id="back">Back</button>
  262. </div>
  263. </div>
  264. <div style="display :none" id="receivedcard">
  265. <p style="font-weight: bold;font-size: medium;text-decoration: underline;">Department Benefits</p>
  266. <div class="row mt-2" id="sec2">
  267. <!-- GPF -->
  268. <div class="col-md-4 mb-2">
  269. <label class="form-label fw-bold">GPF<span class="text-danger">*</span></label>
  270. <div class="d-flex align-items-center gap-5">
  271. <div class="form-check">
  272. <input class="form-check-input" type="radio" id="gpfYes" name="gpf" value="yes">
  273. <label class="form-check-label" for="gpfYes">Yes</label>
  274. </div>
  275. <div class="form-check">
  276. <input class="form-check-input" type="radio" id="gpfNo" name="gpf" value="no">
  277. <label class="form-check-label" for="gpfNo">No</label>
  278. </div>
  279. <div class="form-check">
  280. <input class="form-check-input" type="radio" id="gpf50" name="gpf" value="90">
  281. <label class="form-check-label" for="gpf50">90%</label>
  282. </div>
  283. </div>
  284. <!-- Placeholder for dynamically added input -->
  285. <div id="gpfAmountDiv" class="mt-3" style="display: none;">
  286. <label for="gpfAmount" class="form-label">Enter GPF Amount<span class="text-danger">*</span></label>
  287. <input type="number" id="gpfAmount" class="form-control" placeholder="Enter GPF amount" min="1" oninput="validatePositiveNumber(this)">
  288. </div>
  289. </div>
  290. <!-- Earned Leave & Leave on Private Affairs -->
  291. <div class="col-md-4 mb-2">
  292. <label class="form-label fw-bold">Earned Leave & Leave on Private Affairs<span class="text-danger">*</span></label>
  293. <div class="d-flex align-items-center gap-5">
  294. <div class="form-check">
  295. <input class="form-check-input" type="radio" id="earnedleaveYes" name="earnedleave" value="yes">
  296. <label class="form-check-label" for="earnedleaveYes">Yes</label>
  297. </div>
  298. <div class="form-check">
  299. <input class="form-check-input" type="radio" id="earnedleaveNo" name="earnedleave" value="no">
  300. <label class="form-check-label" for="earnedleaveNo">No</label>
  301. </div>
  302. </div>
  303. <!-- Placeholder for dynamically added input -->
  304. <div id="earnedleaveAmountDiv" class="mt-3" style="display: none;">
  305. <label for="earnedleaveAmount" class="form-label">Enter EL and LPA Amount<span class="text-danger">*</span></label>
  306. <input type="number" id="earnedleaveAmount" class="form-control" placeholder="Enter Amount" min="1" oninput="validatePositiveNumber(this)">
  307. </div>
  308. </div>
  309. <!-- SPFGS -->
  310. <div class="col-md-4 mb-2">
  311. <label class="form-label fw-bold">SPFGS<span class="text-danger">*</span></label>
  312. <div class="d-flex align-items-center gap-5">
  313. <div class="form-check">
  314. <input class="form-check-input" type="radio" id="spfgsYes" name="spfgs" value="yes">
  315. <label class="form-check-label" for="spfgsYes">Yes</label>
  316. </div>
  317. <div class="form-check">
  318. <input class="form-check-input" type="radio" id="spfgsNo" name="spfgs" value="no">
  319. <label class="form-check-label" for="spfgsNo">No</label>
  320. </div>
  321. </div>
  322. <!-- Placeholder for dynamically added input -->
  323. <div id="spfgsAmountDiv" class="mt-3" style="display: none;">
  324. <label for="spfgsAmount" class="form-label">Enter SPFGS Amount<span class="text-danger">*</span></label>
  325. <input type="number" id="spfgsAmount" class="form-control" placeholder="Enter spfgs Amount" min="1" oninput="validatePositiveNumber(this)">
  326. </div>
  327. </div>
  328. <div class="col-md-4 mb-2">
  329. <label for="recoveryemployeevalue" class="form-label fw-bold">Recovery From Employee</label>
  330. <input type="text" id="recoveryemployeevalue" class="form-control" placeholder="Enter Recovery From Employee">
  331. </div>
  332. <!-- DCRF File is Ready -->
  333. <div class="col-md-4">
  334. <label class="form-label fw-bold">DCRG File is Ready<span class="text-danger">*</span></label>
  335. <div class="d-flex align-items-center gap-5">
  336. <div class="form-check">
  337. <input class="form-check-input" type="radio" id="dcrgYes" name="dcrg" value="yes">
  338. <label class="form-check-label" for="dcrgYes">Yes</label>
  339. </div>
  340. <div class="form-check">
  341. <input class="form-check-input" type="radio" id="dcrgNo" name="dcrg" value="no">
  342. <label class="form-check-label" for="dcrgNo">No</label>
  343. </div>
  344. </div>
  345. </div>
  346. </div>
  347. <hr>
  348. <p style="font-weight: bold;font-size: medium;text-decoration: underline;">Pension Benefits</p>
  349. <div class="row" id="sec3">
  350. <div class="col-md-4 mt-2 mb-2">
  351. <label for="pensionNumber" class="form-label">Pension Number</label>
  352. <input type="number" id="pensionNumber" class="form-control" placeholder="Enter Employee Pension Number" >
  353. </div>
  354. <div class="col-md-4 mt-2 mb-2">
  355. <label for="ledgerNumber" class="form-label">Ledger Number</label>
  356. <input type="text" id="ledgerNumber" class="form-control" placeholder="Enter Ledger Number">
  357. </div>
  358. </div>
  359. <div class="row mt-2">
  360. <div class="col-md-4 mb-2">
  361. <label class="form-label fw-bold">Sanctions Pensions Benefit-Pension</label>
  362. <div class="d-flex align-items-center gap-5">
  363. <div class="form-check">
  364. <input class="form-check-input" type="radio" id="bpYes" name="benefit_pension" value="yes">
  365. <label class="form-check-label" for="bpYes">Yes</label>
  366. </div>
  367. <div class="form-check">
  368. <input class="form-check-input" type="radio" id="bpNo" name="benefit_pension" value="no">
  369. <label class="form-check-label" for="bpNo">No</label>
  370. </div>
  371. </div>
  372. <!-- Placeholder for dynamically added input -->
  373. <div id="PbAmountDiv" class="mt-3" style="display: none;">
  374. <label for="benefit_pension_amount" class="form-label">Enter Pensions Benefit Amount</label>
  375. <input type="number" id="benefit_pension_amount" class="form-control" placeholder="Enter Pensions Benefit Amount" min="1" oninput="validatePositiveNumber(this)">
  376. </div>
  377. </div>
  378. <div class="col-md-4 mb-2" id="dcrgCard" style="display: none;">
  379. <label class="form-label fw-bold">Sanctions Pensions Benefit-DCRG</label>
  380. <div class="d-flex align-items-center gap-5">
  381. <div class="form-check">
  382. <input class="form-check-input" type="radio" id="DcrgYes" name="benefit_dcrg" value="yes">
  383. <label class="form-check-label" for="DcrgYes">Yes</label>
  384. </div>
  385. <div class="form-check">
  386. <input class="form-check-input" type="radio" id="DcrgNo" name="benefit_dcrg" value="no">
  387. <label class="form-check-label" for="DcrgNo">No</label>
  388. </div>
  389. </div>
  390. <!-- Placeholder for dynamically added input -->
  391. <div id="dcrgAmountDiv" class="mt-3" style="display: none;">
  392. <label for="benefit_dcrg_amount" class="form-label">Enter Benefit DCRG Amount</label>
  393. <input type="number" id="benefit_dcrg_amount" class="form-control" placeholder="Enter Pensions Benefit DCRG Amount" min="1" oninput="validatePositiveNumber(this)">
  394. </div>
  395. </div>
  396. <div class="col-md-4 mb-2">
  397. <label class="form-label fw-bold">Sanctions Pensions Benefit-Commutation</label>
  398. <div class="d-flex align-items-center gap-5">
  399. <div class="form-check">
  400. <input class="form-check-input" type="radio" id="commutationYes" name="benefit_commutation" value="yes">
  401. <label class="form-check-label" for="commutationYes">Yes</label>
  402. </div>
  403. <div class="form-check">
  404. <input class="form-check-input" type="radio" id="commutationNo" name="benefit_commutation" value="no">
  405. <label class="form-check-label" for="commutationNo">No</label>
  406. </div>
  407. </div>
  408. <!-- Placeholder for dynamically added input -->
  409. <div id="CommutationAmountDiv" class="mt-3" style="display: none;">
  410. <label for="benefit_commutation_amount" class="form-label">Enter Benefit Commutation Amount</label>
  411. <input type="number" id="benefit_commutation_amount" class="form-control" placeholder="Enter Pensions Benefit Commutation Amount" min="1" oninput="validatePositiveNumber(this)">
  412. </div>
  413. </div>
  414. </div>
  415. <hr>
  416. <div class="row">
  417. <div class="col-md-6">
  418. <label for="datefile" class="form-label fw-bold">Date File Completed <span class="text-danger">*</span></label>
  419. <input type="text" id="datefile" class="form-control" readonly="readonly">
  420. </div>
  421. <div class="col-md-12">
  422. <label for="remarks" class="form-label fw-bold">Comments/Remarks<span class="text-danger">*</span></label>
  423. <textarea id="remarks" class="form-control" rows="4" placeholder="Enter your remarks here"></textarea>
  424. </div>
  425. </div>
  426. <div class="row mb-2 mt-2">
  427. <div class="col-md-12 d-flex justify-content-center">
  428. <button type="button" class="btn btn-primary" id="auditsubmit">Mark as Completed</button>
  429. </div>
  430. </div>
  431. </div>
  432. </div>
  433. </div>
  434. </div>
  435. </div>
  436. <div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
  437. <script th:replace="~{fragments/modules/base/script :: script}"></script>
  438. <script src="node_modules/tempusdominus-bootstrap-4/build/js/tempusdominus-bootstrap-4.min.js"></script>
  439. <!-- Bootstrap 5 JS -->
  440. <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
  441. <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
  442. <script>
  443. $(document).ready(function () {
  444. // Initialize the DataTable
  445. const dataTable = $('#AuditDatatable').DataTable({
  446. dom: 'Bftip',
  447. columnDefs: [
  448. { targets: 'no-sort', orderable: false }
  449. ],
  450. lengthMenu: [
  451. [50, 100, 200, 500, -1],
  452. ['50 rows', '100 rows', '200 rows', 'Show all']
  453. ],
  454. scrollY: '50vh',
  455. buttons: [
  456. { extend: 'pageLength', className: 'btn btn-warning' },
  457. { title: 'Data export', extend: 'copyHtml5', text: 'Copy', className: 'btn btn-secondary' },
  458. { extend: 'excelHtml5', text: 'Excel', className: 'btn btn-secondary' },
  459. { extend: 'csvHtml5', text: 'CSV', className: 'btn btn-secondary' },
  460. { extend: 'pdfHtml5', text: 'PDF', className: 'btn btn-secondary' }
  461. ],
  462. fixedHeader: true,
  463. autoWidth: true,
  464. responsive: true,
  465. searching: true,
  466. paging: true,
  467. info: true,
  468. ordering: false,
  469. });
  470. });
  471. document.addEventListener("DOMContentLoaded", function() {
  472. // Get today's date
  473. const today = new Date();
  474. // Format the date as DD-MM-YYYY for display
  475. const day = String(today.getDate()).padStart(2, '0');
  476. const month = String(today.getMonth() + 1).padStart(2, '0'); // Months are 0-based
  477. const year = today.getFullYear();
  478. // Combine into DD-MM-YYYY format for display
  479. const formattedDateDisplay = `${day}-${month}-${year}`;
  480. // Set the value of the input field to the current date (in DD-MM-YYYY format for display)
  481. document.getElementById("datefile").value = formattedDateDisplay;
  482. });
  483. function convertDateFormat(dateString) {
  484. if (!dateString) return '';
  485. let [day, month, year] = dateString.split('-');
  486. return `${year}-${month}-${day}`;
  487. }
  488. document.getElementById("submitbutton").addEventListener("click", function () {
  489. // Clear the inputs in the receivedcard section
  490. //$('#datefile').val('');
  491. $('#remarks').val('');
  492. // Make the receivedcard section visible
  493. document.getElementById("receivedcard").style.display = "block";
  494. // Scroll the receivedcard section into view
  495. document.getElementById("receivedcard").scrollIntoView({
  496. behavior: "smooth", // Smooth scrolling effect
  497. block: "center" // Aligns the element to the center of the viewport
  498. });
  499. });
  500. //model function
  501. function fetchEmployeeDetails(tempId) {
  502. $.ajax({
  503. url: '/gcc/api/department/audit/getpartialdetails', // API to fetch employee details
  504. type: 'GET',
  505. data: { tempId: tempId }, // Pass EMPLOYEE_CODE as a parameter
  506. success: function (response) {
  507. if (response && response.length > 0) {
  508. let employeeDetails = response[0]; // Access the first object in the array
  509. console.log("response:",response);
  510. // Populate modal fields
  511. $('#employeenomodel').val(employeeDetails.emp_no);
  512. $('#employeename').val(employeeDetails.emp_name);
  513. $('#department').val(employeeDetails.dept_name);
  514. $('#designation').val(employeeDetails.designation);
  515. $('#typeofretirement').val(employeeDetails.type_of_retirement);
  516. $('#classes').val(employeeDetails.retirement_class);
  517. $('#datefile_modal').val(employeeDetails.file_moved_date);
  518. $('#remarks_modal').val(employeeDetails.remarks);
  519. $('#retirementdate').val(employeeDetails.retirement_date);
  520. // Update the modal title with the employee code
  521. $('#modalEmployeeCode').text(employeeDetails.emp_no);
  522. // Show the modal
  523. $('#returnretrieddetailsModal').modal('show');
  524. //additional card display function
  525. document.getElementById("submitbutton").addEventListener("click", function() {
  526. $('input[name="gpf"][value="' + employeeDetails.gpf + '"]').prop('checked', true);
  527. if (employeeDetails.gpf === "yes" || employeeDetails.gpf === "90") {
  528. $('#gpfAmountDiv').show();
  529. $('#gpfAmount').val(employeeDetails.gpf_amount);
  530. } else {
  531. $('#gpfAmountDiv').hide();
  532. }
  533. // Earned Leave & Leave on Private Affairs
  534. $('input[name="earnedleave"][value="' + employeeDetails.private_affairs + '"]').prop('checked', true);
  535. if (employeeDetails.private_affairs === "yes") {
  536. $('#earnedleaveAmountDiv').show();
  537. $('#earnedleaveAmount').val(employeeDetails.private_affairs_amount);
  538. } else {
  539. $('#earnedleaveAmountDiv').hide();
  540. }
  541. // SPFGS
  542. $('input[name="spfgs"][value="' + employeeDetails.spfgs + '"]').prop('checked', true);
  543. if (employeeDetails.spfgs === "yes") {
  544. $('#spfgsAmountDiv').show();
  545. $('#spfgsAmount').val(employeeDetails.spfgs_amount);
  546. } else {
  547. $('#spfgsAmountDiv').hide();
  548. }
  549. // DCRG File
  550. $('input[name="dcrg"][value="' + employeeDetails.dcrg + '"]').prop('checked', true);
  551. if(employeeDetails.dcrg ==="yes"){
  552. $('#dcrgCard').show();
  553. }else{
  554. $('#dcrgCard').hide();
  555. }
  556. $('#pensionNumber').val(employeeDetails.pension_number).prop('readonly',true);
  557. $('#ledgerNumber').val(employeeDetails.ledger_number).prop('readonly',true);
  558. $('input[name="benefit_pension"][value="' + employeeDetails.benefit_pension + '"]').prop('checked', true);
  559. if (employeeDetails.benefit_pension === "yes") {
  560. $('#PbAmountDiv').show();
  561. $('#benefit_pension_amount').val(employeeDetails.benefit_pension_amount).prop('readonly',true);
  562. // bpYes bpNo PbAmountDiv benefit_pension_amount
  563. $('#bpYes').prop('checked', true);
  564. $('#bpNo').prop('disabled', true);
  565. } else {
  566. $('#PbAmountDiv').hide();
  567. $('#bpNo').prop('checked', true);
  568. $('#bpYes').prop('disabled', true);
  569. }
  570. $('input[name="benefit_dcrg"][value="' + employeeDetails.benefit_dcrg + '"]').prop('checked', true);
  571. if (employeeDetails.benefit_dcrg === "yes") {
  572. $('#dcrgAmountDiv').show();
  573. $('#benefit_dcrg_amount').val(employeeDetails.benefit_dcrg_amount).prop('readonly',true);
  574. // DcrgYes DcrgNo dcrgAmountDiv benefit_dcrg_amount
  575. $('#DcrgYes').prop('checked', true);
  576. $('#DcrgNo').prop('disabled', true);
  577. } else {
  578. $('#dcrgAmountDiv').hide();
  579. $('#DcrgNo').prop('checked', true);
  580. $('#DcrgYes').prop('disabled', true);
  581. }
  582. $('input[name="benefit_commutation"][value="' + employeeDetails.benefit_commutation + '"]').prop('checked', true);
  583. if (employeeDetails.benefit_commutation === "yes") {
  584. $('#CommutationAmountDiv').show();
  585. $('#benefit_commutation_amount').val(employeeDetails.benefit_commutation_amount).prop('readonly',true);
  586. // commutationYes commutationNo CommutationAmountDiv benefit_commutation_amount
  587. $('#commutationYes').prop('checked', true);
  588. $('#commutationNo').prop('disabled', true);
  589. } else {
  590. $('#CommutationAmountDiv').hide();
  591. $('#commutationNo').prop('checked', true);
  592. $('#commutationYes').prop('disabled', true);
  593. }
  594. //$('#datefile').val('');
  595. //$('#remarks').val('');
  596. document.getElementById("receivedcard").style.display = "block";
  597. });
  598. /* document.getElementById('auditsubmit').addEventListener('click', function () {
  599. let employeeNo = $('#employeenomodel').val(); // Using jQuery to get the value
  600. // Trigger the save function and pass the value
  601. saveEntryDetails(tempId,employeeNo);
  602. }); */
  603. $('#auditsubmit').off('click').on('click', function () {
  604. let employeeNo = $('#employeenomodel').val(); // Get the employee number
  605. saveEntryDetails(tempId, employeeNo); // Call function with parameters
  606. });
  607. } else {
  608. Swal.fire({
  609. icon: 'info',
  610. title: 'No Data',
  611. text: 'No details found for the selected employee.',
  612. confirmButtonText: 'OK',
  613. });
  614. }
  615. },
  616. error: function () {
  617. Swal.fire({
  618. icon: 'error',
  619. title: 'Error',
  620. text: 'Failed to fetch employee details. Please try again.',
  621. confirmButtonText: 'OK',
  622. });
  623. },
  624. });
  625. }
  626. $(document).ready(function () {
  627. $(document).on('click', '.view-btn', function () {
  628. const empCode = $(this).data('id'); // Fetch `data-id` value
  629. const tempId = $(this).data('temp-id'); // Fetch `data-temp-id` value
  630. console.log("empCode====="+empCode);
  631. // Hide the receivedcard section before showing the modal
  632. $("#receivedcard").hide();
  633. fetchEmployeeDetails(tempId); // Call the function to fetch employee details
  634. loadFileHistory(tempId); // Load the file history for the selected employee
  635. });
  636. // Initialize the modal with static backdrop and disabled keyboard closing
  637. $('#returnretrieddetailsModal').modal({
  638. backdrop: 'static',
  639. keyboard: false,
  640. show: false // Ensure it doesn't auto-show on page load
  641. });
  642. // Handle close button click
  643. $('#back').click(function () {
  644. $('#returnretrieddetailsModal').modal('hide');
  645. });
  646. $('.close').click(function () {
  647. $('#returnretrieddetailsModal').modal('hide');
  648. });
  649. // Listen for changes on the GPF radio buttons
  650. document.querySelectorAll('input[name="gpf"]').forEach(radio => {
  651. radio.addEventListener('change', function () {
  652. const gpfAmountDiv = document.getElementById('gpfAmountDiv');
  653. if (this.value === 'yes' || this.value === '90') {
  654. gpfAmountDiv.style.display = 'block'; // Show the input field
  655. } else {
  656. gpfAmountDiv.style.display = 'none'; // Hide the input field
  657. document.getElementById('gpfAmount').value = ''; // Clear the input field
  658. }
  659. });
  660. });
  661. // Listen for changes on the private affaires radio buttons
  662. document.querySelectorAll('input[name="earnedleave"]').forEach(radio => {
  663. radio.addEventListener('change', function () {
  664. const earnedleaveAmountDiv = document.getElementById('earnedleaveAmountDiv');
  665. if (this.value === 'yes') {
  666. earnedleaveAmountDiv.style.display = 'block'; // Show the input field
  667. } else {
  668. earnedleaveAmountDiv.style.display = 'none'; // Hide the input field
  669. document.getElementById('earnedleaveAmount').value = ''; // Clear the input field
  670. }
  671. });
  672. });
  673. // Listen for changes on the spfgs radio buttons
  674. document.querySelectorAll('input[name="spfgs"]').forEach(radio => {
  675. radio.addEventListener('change', function () {
  676. const spfgsAmountDiv = document.getElementById('spfgsAmountDiv');
  677. if (this.value === 'yes') {
  678. spfgsAmountDiv.style.display = 'block'; // Show the input field
  679. } else {
  680. spfgsAmountDiv.style.display = 'none'; // Hide the input field
  681. document.getElementById('spfgsAmount').value = ''; // Clear the input field
  682. }
  683. });
  684. });
  685. document.querySelectorAll('input[name="benefit_pension"]').forEach(radio => {
  686. radio.addEventListener('change', function () {
  687. const PbAmountDiv = document.getElementById('PbAmountDiv');
  688. if (this.value === 'yes') {
  689. PbAmountDiv.style.display = 'block'; // Show the input field
  690. } else {
  691. PbAmountDiv.style.display = 'none'; // Hide the input field
  692. document.getElementById('benefit_pension_amount').value = ''; // Clear the input field
  693. }
  694. });
  695. });
  696. document.querySelectorAll('input[name="benefit_dcrg"]').forEach(radio => {
  697. radio.addEventListener('change', function () {
  698. const dcrgAmountDiv = document.getElementById('dcrgAmountDiv');
  699. if (this.value === 'yes') {
  700. dcrgAmountDiv.style.display = 'block'; // Show the input field
  701. } else {
  702. dcrgAmountDiv.style.display = 'none'; // Hide the input field
  703. document.getElementById('benefit_dcrg_amount').value = ''; // Clear the input field
  704. }
  705. });
  706. });
  707. document.querySelectorAll('input[name="benefit_commutation"]').forEach(radio => {
  708. radio.addEventListener('change', function () {
  709. const CommutationAmountDiv = document.getElementById('CommutationAmountDiv');
  710. if (this.value === 'yes') {
  711. CommutationAmountDiv.style.display = 'block'; // Show the input field
  712. } else {
  713. CommutationAmountDiv.style.display = 'none'; // Hide the input field
  714. document.getElementById('benefit_commutation_amount').value = ''; // Clear the input field
  715. }
  716. });
  717. });
  718. });
  719. function loadFileHistory(tempId) {
  720. $.ajax({
  721. url: '/gcc/api/department/audit/fileMovementhistory', // API endpoint
  722. type: 'GET',
  723. data: { tempId: tempId }, // Pass empCode as a parameter
  724. success: function (response) {
  725. if (response.length > 0) {
  726. let historyHtml = '';
  727. response.forEach(item => {
  728. historyHtml += `
  729. <div class="file-history-item">
  730. <div class="file-history-date">${formatDateTime(item.fileMovedDateHistory)}</div>
  731. <div class="file-history-content">
  732. <div class="file-history-status">${item.fileStatusHistory}</div>
  733. <div class="file-history-remarks">Comments/Remarks: ${item.remarksHistory || 'N/A'}</div>
  734. </div>
  735. </div>
  736. `;
  737. });
  738. $('#fileHistoryContainer').html(historyHtml);
  739. } else {
  740. $('#fileHistoryContainer').html('<p>No file history available.</p>');
  741. }
  742. },
  743. error: function () {
  744. $('#fileHistoryContainer').html('<p>Failed to load file history. Please try again later.</p>');
  745. }
  746. });
  747. }
  748. // Function to format date and time
  749. function formatDateTime(dateString) {
  750. const options = {
  751. day: '2-digit',
  752. month: '2-digit',
  753. year: 'numeric',
  754. };
  755. return new Date(dateString).toLocaleDateString('en-GB', options); // Formats as dd-mm-yyyy
  756. }
  757. function saveEntryDetails(tempId,empNo) {
  758. //console.log("emp_no inside=="+empCode);
  759. let selectedGpfValue = $('input[name="gpf"]:checked').val(); // Get the selected radio button value
  760. let gpfAmount = null;
  761. // Check if GPF Amount input is visible and get its value
  762. if (selectedGpfValue === 'yes' || selectedGpfValue === '90') {
  763. gpfAmount = $('#gpfAmount').val(); // Retrieve the amount if available, else null
  764. if (!gpfAmount) {
  765. Swal.fire({
  766. icon: 'warning',
  767. title: 'Validation Error',
  768. text: 'Please Enter GPF Amount',
  769. confirmButtonText: 'OK'
  770. });
  771. return; // Stop further execution if validation fails
  772. }
  773. }
  774. let selectedElValue = $('input[name="earnedleave"]:checked').val();
  775. let earnedleaveAmount=null;
  776. if (selectedElValue === 'yes') {
  777. earnedleaveAmount = $('#earnedleaveAmount').val(); // Retrieve the amount if available, else null
  778. if (!earnedleaveAmount) {
  779. Swal.fire({
  780. icon: 'warning',
  781. title: 'Validation Error',
  782. text: 'Please Enter EL/LPA Amount',
  783. confirmButtonText: 'OK'
  784. });
  785. return; // Stop further execution if validation fails
  786. }
  787. }
  788. let selectedspfgsValue = $('input[name="spfgs"]:checked').val();
  789. let spfgsAmount=null;
  790. if (selectedspfgsValue === 'yes') {
  791. spfgsAmount = $('#spfgsAmount').val(); // Retrieve the amount if available, else null
  792. if (!spfgsAmount) {
  793. Swal.fire({
  794. icon: 'warning',
  795. title: 'Validation Error',
  796. text: 'Please Enter SPFGS Amount',
  797. confirmButtonText: 'OK'
  798. });
  799. return; // Stop further execution if validation fails
  800. }
  801. }
  802. //dcrf
  803. let selecteddcrgValue = $('input[name="dcrg"]:checked').val();
  804. let selectedPd = $('input[name="benefit_pension"]:checked').val();
  805. let selectedPdAmount=null;
  806. if (selectedPd === 'yes') {
  807. selectedPdAmount = $('#benefit_pension_amount').val();
  808. if (!selectedPdAmount) {
  809. Swal.fire({
  810. icon: 'warning',
  811. title: 'Validation Error',
  812. text: 'Please Enter Pension Benefit Amount',
  813. confirmButtonText: 'OK'
  814. });
  815. return; // Stop further execution if validation fails
  816. }
  817. }
  818. let selecteddcrg = $('input[name="benefit_dcrg"]:checked').val();
  819. let seldcrgAmount=null;
  820. if (selecteddcrg === 'yes') {
  821. seldcrgAmount = $('#benefit_dcrg_amount').val();
  822. if (!seldcrgAmount) {
  823. Swal.fire({
  824. icon: 'warning',
  825. title: 'Validation Error',
  826. text: 'Please Enter DCRG Benefit Amount',
  827. confirmButtonText: 'OK'
  828. });
  829. return; // Stop further execution if validation fails
  830. }
  831. }
  832. let selectedcom = $('input[name="benefit_commutation"]:checked').val();
  833. let selectedcomAmount=null;
  834. if (selectedcom === 'yes') {
  835. selectedcomAmount = $('#benefit_commutation_amount').val();
  836. if (!selectedcomAmount) {
  837. Swal.fire({
  838. icon: 'warning',
  839. title: 'Validation Error',
  840. text: 'Please Enter Commutation Benefit Amount',
  841. confirmButtonText: 'OK'
  842. });
  843. return; // Stop further execution if validation fails
  844. }
  845. }
  846. let entryDetails = {
  847. empNo:empNo,
  848. tempId: tempId, // Pass the stored tempId value
  849. dateToAudit: convertDateFormat($('#datefile').val()?.trim()),
  850. remarks: $('#remarks').val(),
  851. deptId:$('#deptId').text().trim(),
  852. filemovedby:$('#userId').text().trim(),
  853. gpf: selectedGpfValue, // Add GPF value (null if none selected)
  854. gpfAmount: gpfAmount, // Include the GPF amount
  855. private_affairs:selectedElValue,
  856. private_affairs_amount:earnedleaveAmount,
  857. spfgs:selectedspfgsValue,
  858. spfgs_amount:spfgsAmount,
  859. recovery_emp:$('#recoveryemployeevalue').val()|| null,
  860. dcrg:selecteddcrgValue,
  861. pension_number:$('#pensionNumber').val(),
  862. ledger_number:$('#ledgerNumber').val(),
  863. benefit_pension:selectedPd,
  864. benefit_dcrg:selecteddcrg,
  865. benefit_commutation:selectedcom,
  866. benefit_pension_amount:selectedPdAmount,
  867. benefit_dcrg_amount:seldcrgAmount,
  868. benefit_commutation_amount:selectedcomAmount
  869. };
  870. console.log("entryDetails:",entryDetails);
  871. if (!entryDetails.dcrg) {
  872. Swal.fire({
  873. icon: 'warning',
  874. title: 'Validation Error!',
  875. text: 'DCRG are required.',
  876. confirmButtonText: 'OK'
  877. });
  878. return;
  879. }
  880. if (!entryDetails.spfgs) {
  881. Swal.fire({
  882. icon: 'warning',
  883. title: 'Validation Error!',
  884. text: 'SPFGS are required.',
  885. confirmButtonText: 'OK'
  886. });
  887. return;
  888. }
  889. if (!entryDetails.private_affairs) {
  890. Swal.fire({
  891. icon: 'warning',
  892. title: 'Validation Error!',
  893. text: 'Private affairs are required.',
  894. confirmButtonText: 'OK'
  895. });
  896. return;
  897. }
  898. if (!entryDetails.gpf) {
  899. Swal.fire({
  900. icon: 'warning',
  901. title: 'Validation Error!',
  902. text: 'GPF are required.',
  903. confirmButtonText: 'OK'
  904. });
  905. return;
  906. }
  907. if (!entryDetails.remarks) {
  908. Swal.fire({
  909. icon: 'warning',
  910. title: 'Validation Error!',
  911. text: 'Remarks are required.',
  912. confirmButtonText: 'OK'
  913. });
  914. return;
  915. }
  916. // Disable the button to prevent multiple submissions
  917. $('#auditsubmit').prop('disabled', true).text('Processing...');
  918. $.ajax({
  919. url: '/gcc/api/department/partial/updateEmployeeDetails',
  920. type: 'POST',
  921. contentType: 'application/json',
  922. data: JSON.stringify(entryDetails),
  923. success: function (response) {
  924. $('#auditsubmit').prop('disabled', false).text('Mark as Completed');
  925. Swal.fire({
  926. icon: 'success',
  927. title: 'Success',
  928. text: response,
  929. allowOutsideClick: false,
  930. allowEscapeKey: false,
  931. allowEnterKey: false,
  932. confirmButtonText: 'OK'
  933. }).then((result) => {
  934. if (result.isConfirmed) {
  935. $('#auditsubmit').prop('disabled', false).text('Mark as Completed');
  936. window.location.href = "/gcc/department/partial/retirement";
  937. console.log("Continue clicked");
  938. }
  939. });
  940. },
  941. error: function (xhr, status, error) {
  942. $('#auditsubmit').prop('disabled', false).text('Mark as Completed');
  943. Swal.fire({
  944. icon: 'error',
  945. title: 'Error',
  946. text: 'Failed to save details. Please try again.',
  947. confirmButtonText: 'OK'
  948. });
  949. console.error('Error:', xhr.responseText);
  950. }
  951. });
  952. }
  953. //amount field validation
  954. function validatePositiveNumber(input) {
  955. if (input.value < 1) {
  956. input.value = "";
  957. }
  958. }
  959. </script>
  960. </body>
  961. </html>