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.

1192 lines
50 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
2 years ago
2 years ago
​
​
2 years ago
2 years ago
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
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>Family Pension</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">Family Pension</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 - Family Pension</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 - Family Pension (<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. <!-- pending duration-->
  227. <div class="col-md-4">
  228. <label for="pendingDuration" class="form-label fw-bold">
  229. Pending Duration
  230. </label>
  231. <div class="d-flex align-items-center">
  232. <div class="form-check" style="padding-right:10px;">
  233. <input type="radio" id="yes" name="pendingDuration" value="yes"class="form-check-input" disabled>
  234. <label for="yes" class="form-check-label">Yes</label>
  235. </div>
  236. <div class="form-check">
  237. <input type="radio" id="no" name="pendingDuration" value="no"class="form-check-input" disabled>
  238. <label for="no" class="form-check-label">No</label>
  239. </div>
  240. </div>
  241. <div class="dropdown" id="pendingDurationInputContainer" style="display: none; margin-top: 10px;">
  242. <input type="text" id="pendingDurationInput" name="pendingDurationValue" class="form-control" placeholder="Enter details for pending duration" readonly>
  243. </div>
  244. </div>
  245. <!-- While in Service Death -->
  246. <div class="col-md-4">
  247. <label for="servicedeath" class="form-label fw-bold">While in Service Death </label>
  248. <input type="date" id="servicedeath" class="form-control" readonly>
  249. </div>
  250. <!-- Relationship of Deceased -->
  251. <div class="col-md-4">
  252. <label for="relationship" class="form-label fw-bold">Relationship of Deceased </label>
  253. <input type="text" id="relationship" class="form-control" readonly>
  254. </div>
  255. <div class="col-md-4">
  256. <label for="sanctionedgis" class="form-label fw-bold">Sanctioned GIS</label>
  257. <input type="text" id="sanctionedgis" class="form-control" readonly>
  258. </div>
  259. <!-- Date File Sent to Audit -->
  260. <div class="col-md-4">
  261. <label for="datefile_modal" class="form-label fw-bold">Date File Received From Department </label>
  262. <input type="date" id="datefile_modal" class="form-control" readonly>
  263. </div>
  264. <!-- Remarks -->
  265. <div class="col-md-12">
  266. <label for="remarks_modal" class="form-label fw-bold">Comments/Remarks </label>
  267. <textarea id="remarks_modal" class="form-control" rows="4" readonly></textarea>
  268. </div>
  269. <!-- new -->
  270. <div class="col-md-12 mt-4">
  271. <h5>File History</h5>
  272. <div id="fileHistoryContainer" class="file-history-list">
  273. <!-- File History will be dynamically loaded here -->
  274. </div>
  275. </div>
  276. </div>
  277. <div class="row mb-2 mt-2">
  278. <div class="col-md-12 d-flex justify-content-center">
  279. <button type="button" class="btn btn-primary mx-2" id="submitbutton">Edit Benefits</button>
  280. <button type="button" class="btn btn-secondary" data-dismiss="modal" id="back">Back</button>
  281. </div>
  282. </div>
  283. <div style="display :none" id="receivedcard">
  284. <p style="font-weight: bold;font-size: medium;text-decoration: underline;">Department Benefits</p>
  285. <div class="row mt-2" id="sec2">
  286. <!-- GPF -->
  287. <div class="col-md-4 mb-2">
  288. <label class="form-label fw-bold">GPF<span class="text-danger">*</span></label>
  289. <div class="d-flex align-items-center gap-5">
  290. <div class="form-check">
  291. <input class="form-check-input" type="radio" id="gpfYes" name="gpf" value="yes">
  292. <label class="form-check-label" for="gpfYes">Yes</label>
  293. </div>
  294. <div class="form-check">
  295. <input class="form-check-input" type="radio" id="gpfNo" name="gpf" value="no">
  296. <label class="form-check-label" for="gpfNo">No</label>
  297. </div>
  298. <div class="form-check">
  299. <input class="form-check-input" type="radio" id="gpf50" name="gpf" value="90">
  300. <label class="form-check-label" for="gpf50">90%</label>
  301. </div>
  302. </div>
  303. <!-- Placeholder for dynamically added input -->
  304. <div id="gpfAmountDiv" class="mt-3" style="display: none;">
  305. <label for="gpfAmount" class="form-label">Enter GPF Amount<span class="text-danger">*</span></label>
  306. <input type="number" id="gpfAmount" class="form-control" placeholder="Enter GPF amount" min="1" oninput="validatePositiveNumber(this)" >
  307. </div>
  308. </div>
  309. <!-- Earned Leave & Leave on Private Affairs -->
  310. <div class="col-md-4 mb-2">
  311. <label class="form-label fw-bold">Earned Leave & Leave on Private Affairs<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="earnedleaveYes" name="earnedleave" value="yes">
  315. <label class="form-check-label" for="earnedleaveYes">Yes</label>
  316. </div>
  317. <div class="form-check">
  318. <input class="form-check-input" type="radio" id="earnedleaveNo" name="earnedleave" value="no">
  319. <label class="form-check-label" for="earnedleaveNo">No</label>
  320. </div>
  321. </div>
  322. <!-- Placeholder for dynamically added input -->
  323. <div id="earnedleaveAmountDiv" class="mt-3" style="display: none;">
  324. <label for="earnedleaveAmount" class="form-label">Enter EL and LPA Amount<span class="text-danger">*</span></label>
  325. <input type="number" id="earnedleaveAmount" class="form-control" placeholder="Enter Amount" min="1" oninput="validatePositiveNumber(this)">
  326. </div>
  327. </div>
  328. <!-- SPFGS -->
  329. <div class="col-md-4 mb-2">
  330. <label class="form-label fw-bold">SPFGS<span class="text-danger">*</span></label>
  331. <div class="d-flex align-items-center gap-5">
  332. <div class="form-check">
  333. <input class="form-check-input" type="radio" id="spfgsYes" name="spfgs" value="yes">
  334. <label class="form-check-label" for="spfgsYes">Yes</label>
  335. </div>
  336. <div class="form-check">
  337. <input class="form-check-input" type="radio" id="spfgsNo" name="spfgs" value="no">
  338. <label class="form-check-label" for="spfgsNo">No</label>
  339. </div>
  340. </div>
  341. <!-- Placeholder for dynamically added input -->
  342. <div id="spfgsAmountDiv" class="mt-3" style="display: none;">
  343. <label for="spfgsAmount" class="form-label">Enter SPFGS Amount<span class="text-danger">*</span></label>
  344. <input type="number" id="spfgsAmount" class="form-control" placeholder="Enter spfgs Amount" min="1" oninput="validatePositiveNumber(this)">
  345. </div>
  346. </div>
  347. <div class="col-md-4 mb-2">
  348. <label for="recoveryemployeevalue" class="form-label fw-bold">Recovery From Employee</label>
  349. <input type="text" id="recoveryemployeevalue" class="form-control" placeholder="Enter Recovery From Employee">
  350. </div>
  351. <!-- DCRF File is Ready -->
  352. <div class="col-md-4">
  353. <label class="form-label fw-bold">DCRG File is Ready<span class="text-danger">*</span></label>
  354. <div class="d-flex align-items-center gap-5">
  355. <div class="form-check">
  356. <input class="form-check-input" type="radio" id="dcrgYes" name="dcrg" value="yes">
  357. <label class="form-check-label" for="dcrgYes">Yes</label>
  358. </div>
  359. <div class="form-check">
  360. <input class="form-check-input" type="radio" id="dcrgNo" name="dcrg" value="no">
  361. <label class="form-check-label" for="dcrgNo">No</label>
  362. </div>
  363. </div>
  364. </div>
  365. </div>
  366. <hr>
  367. <p style="font-weight: bold;font-size: medium;text-decoration: underline;">Pension Benefits</p>
  368. <div class="row" id="sec3">
  369. <div class="col-md-4 mt-2 mb-2">
  370. <label for="pensionNumber" class="form-label">Pension Number</label>
  371. <input type="number" id="pensionNumber" class="form-control" placeholder="Enter Employee Pension Number">
  372. </div>
  373. <div class="col-md-4 mt-2 mb-2">
  374. <label for="ledgerNumber" class="form-label">Ledger Number</label>
  375. <input type="text" id="ledgerNumber" class="form-control" placeholder="Enter Ledger Number">
  376. </div>
  377. </div>
  378. <div class="row mt-2">
  379. <div class="col-md-4 mb-2">
  380. <label class="form-label fw-bold">Sanctions Pensions Benefit-Pension</label>
  381. <div class="d-flex align-items-center gap-5">
  382. <div class="form-check">
  383. <input class="form-check-input" type="radio" id="bpYes" name="benefit_pension" value="yes">
  384. <label class="form-check-label" for="bpYes">Yes</label>
  385. </div>
  386. <div class="form-check">
  387. <input class="form-check-input" type="radio" id="bpNo" name="benefit_pension" value="no">
  388. <label class="form-check-label" for="bpNo">No</label>
  389. </div>
  390. </div>
  391. <!-- Placeholder for dynamically added input -->
  392. <div id="PbAmountDiv" class="mt-3" style="display: none;">
  393. <label for="benefit_pension_amount" class="form-label">Enter Pensions Benefit Amount</label>
  394. <input type="number" id="benefit_pension_amount" class="form-control" placeholder="Enter Pensions Benefit Amount" min="1" oninput="validatePositiveNumber(this)">
  395. </div>
  396. </div>
  397. <div class="col-md-4 mb-2" id="dcrgCard" style="display: none;">
  398. <label class="form-label fw-bold">Sanctions Pensions Benefit-DCRG</label>
  399. <div class="d-flex align-items-center gap-5">
  400. <div class="form-check">
  401. <input class="form-check-input" type="radio" id="DcrgYes" name="benefit_dcrg" value="yes">
  402. <label class="form-check-label" for="DcrgYes">Yes</label>
  403. </div>
  404. <div class="form-check">
  405. <input class="form-check-input" type="radio" id="DcrgNo" name="benefit_dcrg" value="no">
  406. <label class="form-check-label" for="DcrgNo">No</label>
  407. </div>
  408. </div>
  409. <!-- Placeholder for dynamically added input -->
  410. <div id="dcrgAmountDiv" class="mt-3" style="display: none;">
  411. <label for="benefit_dcrg_amount" class="form-label">Enter Benefit DCRG Amount</label>
  412. <input type="number" id="benefit_dcrg_amount" class="form-control" placeholder="Enter Pensions Benefit DCRG Amount" min="1" oninput="validatePositiveNumber(this)">
  413. </div>
  414. </div>
  415. <div class="col-md-4 mb-2">
  416. <label class="form-label fw-bold">Sanctions Pensions Benefit-Commutation</label>
  417. <div class="d-flex align-items-center gap-5">
  418. <div class="form-check">
  419. <input class="form-check-input" type="radio" id="commutationYes" name="benefit_commutation" value="yes">
  420. <label class="form-check-label" for="commutationYes">Yes</label>
  421. </div>
  422. <div class="form-check">
  423. <input class="form-check-input" type="radio" id="commutationNo" name="benefit_commutation" value="no">
  424. <label class="form-check-label" for="commutationNo">No</label>
  425. </div>
  426. </div>
  427. <!-- Placeholder for dynamically added input -->
  428. <div id="CommutationAmountDiv" class="mt-3" style="display: none;">
  429. <label for="benefit_commutation_amount" class="form-label">Enter Benefit Commutation Amount</label>
  430. <input type="number" id="benefit_commutation_amount" class="form-control" placeholder="Enter Pensions Benefit Commutation Amount" min="1" oninput="validatePositiveNumber(this)">
  431. </div>
  432. </div>
  433. </div>
  434. <hr>
  435. <div class="row">
  436. <div class="col-md-6">
  437. <label for="datefile " class="form-label fw-bold">Date File Completed <span class="text-danger">*</span></label>
  438. <input type="text" id="datefile" class="form-control" readonly>
  439. </div>
  440. <div class="col-md-12">
  441. <label for="remarks" class="form-label fw-bold">Comments/Remarks<span class="text-danger">*</span></label>
  442. <textarea id="remarks" class="form-control" rows="4" placeholder="Enter your remarks here"></textarea>
  443. </div>
  444. </div>
  445. <div class="row mb-2 mt-2">
  446. <div class="col-md-12 d-flex justify-content-center">
  447. <button type="button" class="btn btn-primary" id="auditsubmit">Mark as Completed</button>
  448. </div>
  449. </div>
  450. </div>
  451. </div>
  452. </div>
  453. </div>
  454. </div>
  455. <div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
  456. <script th:replace="~{fragments/modules/base/script :: script}"></script>
  457. <script src="node_modules/tempusdominus-bootstrap-4/build/js/tempusdominus-bootstrap-4.min.js"></script>
  458. <!-- Bootstrap 5 JS -->
  459. <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
  460. <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
  461. <script>
  462. $(document).ready(function () {
  463. // Initialize the DataTable
  464. const dataTable = $('#AuditDatatable').DataTable({
  465. dom: 'Bftip',
  466. columnDefs: [
  467. { targets: 'no-sort', orderable: false }
  468. ],
  469. lengthMenu: [
  470. [50, 100, 200, 500, -1],
  471. ['50 rows', '100 rows', '200 rows', 'Show all']
  472. ],
  473. scrollY: '50vh',
  474. buttons: [
  475. { extend: 'pageLength', className: 'btn btn-warning' },
  476. { title: 'Data export', extend: 'copyHtml5', text: 'Copy', className: 'btn btn-secondary' },
  477. { extend: 'excelHtml5', text: 'Excel', className: 'btn btn-secondary' },
  478. { extend: 'csvHtml5', text: 'CSV', className: 'btn btn-secondary' },
  479. { extend: 'pdfHtml5', text: 'PDF', className: 'btn btn-secondary' }
  480. ],
  481. fixedHeader: true,
  482. autoWidth: true,
  483. responsive: true,
  484. searching: true,
  485. paging: true,
  486. info: true,
  487. ordering: false,
  488. });
  489. });
  490. document.addEventListener("DOMContentLoaded", function() {
  491. // Get today's date
  492. const today = new Date();
  493. // Format the date as DD-MM-YYYY for display
  494. const day = String(today.getDate()).padStart(2, '0');
  495. const month = String(today.getMonth() + 1).padStart(2, '0'); // Months are 0-based
  496. const year = today.getFullYear();
  497. // Combine into DD-MM-YYYY format for display
  498. const formattedDateDisplay = `${day}-${month}-${year}`;
  499. // Set the value of the input field to the current date (in DD-MM-YYYY format for display)
  500. document.getElementById("datefile").value = formattedDateDisplay;
  501. document.getElementById("servicedeath").value = formattedDateDisplay;
  502. });
  503. function convertDateFormat(dateString) {
  504. if (!dateString) return '';
  505. let [day, month, year] = dateString.split('-');
  506. return `${year}-${month}-${day}`;
  507. }
  508. document.getElementById("submitbutton").addEventListener("click", function () {
  509. // Clear the inputs in the receivedcard section
  510. //$('#datefile').val('');
  511. $('#remarks').val('');
  512. // Make the receivedcard section visible
  513. document.getElementById("receivedcard").style.display = "block";
  514. // Scroll the receivedcard section into view
  515. document.getElementById("receivedcard").scrollIntoView({
  516. behavior: "smooth", // Smooth scrolling effect
  517. block: "center" // Aligns the element to the center of the viewport
  518. });
  519. });
  520. //model function
  521. function fetchEmployeeDetails(tempId) {
  522. $.ajax({
  523. url: '/gcc/api/department/audit/getpartialdetails', // API to fetch employee details
  524. type: 'GET',
  525. data: { tempId: tempId }, // Pass EMPLOYEE_CODE as a parameter
  526. success: function (response) {
  527. if (response && response.length > 0) {
  528. let employeeDetails = response[0]; // Access the first object in the array
  529. console.log("response:",response);
  530. // Populate modal fields
  531. $('#employeenomodel').val(employeeDetails.emp_no);
  532. $('#employeename').val(employeeDetails.emp_name);
  533. $('#department').val(employeeDetails.dept_name);
  534. $('#designation').val(employeeDetails.designation);
  535. $('#servicedeath').val(employeeDetails.service_death);
  536. $('#relationship').val(employeeDetails.relationship_deceased);
  537. //$('#typeofretirement').val(employeeDetails.type_of_retirement);
  538. $('#sanctionedgis').val(employeeDetails.sanctioned_gis_amount);
  539. // $('#classes').val(employeeDetails.retirement_class);
  540. $('#datefile_modal').val(employeeDetails.file_moved_date);
  541. $('#remarks_modal').val(employeeDetails.remarks);
  542. //$('#retirementdate').val(employeeDetails.retirement_date);
  543. let pendingDuration = employeeDetails.pending_duration; // Assuming this comes from the response
  544. let pendingReason = employeeDetails.reason_for_pending; // Assuming this comes from the response
  545. if (pendingDuration === "yes") {
  546. $('#pendingDurationInputContainer').show(); // Show the text box
  547. $('#pendingDurationInput').val(pendingReason); // Populate the input field
  548. } else {
  549. $('#pendingDurationInputContainer').hide(); // Hide the text box
  550. }
  551. // Update radio button selection
  552. if (pendingDuration === "yes") {
  553. $('#yes').prop('checked', true);
  554. } else {
  555. $('#no').prop('checked', true);
  556. }
  557. // Update the modal title with the employee code
  558. $('#modalEmployeeCode').text(employeeDetails.emp_no);
  559. // Show the modal
  560. $('#returnretrieddetailsModal').modal('show');
  561. //additional card display function
  562. document.getElementById("submitbutton").addEventListener("click", function() {
  563. $('input[name="gpf"][value="' + employeeDetails.gpf + '"]').prop('checked', true);
  564. if (employeeDetails.gpf === "yes" || employeeDetails.gpf === "90") {
  565. $('#gpfAmountDiv').show();
  566. $('#gpfAmount').val(employeeDetails.gpf_amount);
  567. } else {
  568. $('#gpfAmountDiv').hide();
  569. }
  570. // Earned Leave & Leave on Private Affairs
  571. $('input[name="earnedleave"][value="' + employeeDetails.private_affairs + '"]').prop('checked', true);
  572. if (employeeDetails.private_affairs === "yes") {
  573. $('#earnedleaveAmountDiv').show();
  574. $('#earnedleaveAmount').val(employeeDetails.private_affairs_amount);
  575. } else {
  576. $('#earnedleaveAmountDiv').hide();
  577. }
  578. // SPFGS
  579. $('input[name="spfgs"][value="' + employeeDetails.spfgs + '"]').prop('checked', true);
  580. if (employeeDetails.spfgs === "yes") {
  581. $('#spfgsAmountDiv').show();
  582. $('#spfgsAmount').val(employeeDetails.spfgs_amount);
  583. } else {
  584. $('#spfgsAmountDiv').hide();
  585. }
  586. // DCRG File
  587. $('input[name="dcrg"][value="' + employeeDetails.dcrg + '"]').prop('checked', true);
  588. if(employeeDetails.dcrg ==="yes"){
  589. $('#dcrgCard').show();
  590. }else{
  591. $('#dcrgCard').hide();
  592. }
  593. $('#pensionNumber').val(employeeDetails.pension_number).prop('readonly',true);
  594. $('#ledgerNumber').val(employeeDetails.ledger_number).prop('readonly',true);
  595. $('input[name="benefit_pension"][value="' + employeeDetails.benefit_pension + '"]').prop('checked', true);
  596. if (employeeDetails.benefit_pension === "yes") {
  597. $('#PbAmountDiv').show();
  598. $('#benefit_pension_amount').val(employeeDetails.benefit_pension_amount).prop('readonly',true);
  599. // bpYes bpNo PbAmountDiv benefit_pension_amount
  600. $('#bpYes').prop('checked', true);
  601. $('#bpNo').prop('disabled', true);
  602. } else {
  603. $('#PbAmountDiv').hide();
  604. $('#bpNo').prop('checked', true);
  605. $('#bpYes').prop('disabled', true);
  606. }
  607. $('input[name="benefit_dcrg"][value="' + employeeDetails.benefit_dcrg + '"]').prop('checked', true);
  608. if (employeeDetails.benefit_dcrg === "yes") {
  609. $('#dcrgAmountDiv').show();
  610. $('#benefit_dcrg_amount').val(employeeDetails.benefit_dcrg_amount).prop('readonly',true);
  611. // DcrgYes DcrgNo dcrgAmountDiv benefit_dcrg_amount
  612. $('#DcrgYes').prop('checked', true);
  613. $('#DcrgNo').prop('disabled', true);
  614. } else {
  615. $('#dcrgAmountDiv').hide();
  616. $('#DcrgNo').prop('checked', true);
  617. $('#DcrgYes').prop('disabled', true);
  618. }
  619. $('input[name="benefit_commutation"][value="' + employeeDetails.benefit_commutation + '"]').prop('checked', true);
  620. if (employeeDetails.benefit_commutation === "yes") {
  621. $('#CommutationAmountDiv').show();
  622. $('#benefit_commutation_amount').val(employeeDetails.benefit_commutation_amount).prop('readonly',true);
  623. // commutationYes commutationNo CommutationAmountDiv benefit_commutation_amount
  624. $('#commutationYes').prop('checked', true);
  625. $('#commutationNo').prop('disabled', true);
  626. } else {
  627. $('#CommutationAmountDiv').hide();
  628. $('#commutationNo').prop('checked', true);
  629. $('#commutationYes').prop('disabled', true);
  630. }
  631. //$('#datefile').val('');
  632. //$('#remarks').val('');
  633. document.getElementById("receivedcard").style.display = "block";
  634. });
  635. /* document.getElementById('auditsubmit').addEventListener('click', function () {
  636. let employeeNo = $('#employeenomodel').val(); // Using jQuery to get the value
  637. // Trigger the save function and pass the value
  638. saveEntryDetails(tempId,employeeNo);
  639. }); */
  640. $('#auditsubmit').off('click').on('click', function () {
  641. let employeeNo = $('#employeenomodel').val(); // Get the employee number
  642. saveEntryDetails(tempId, employeeNo); // Call function with parameters
  643. });
  644. } else {
  645. Swal.fire({
  646. icon: 'info',
  647. title: 'No Data',
  648. text: 'No details found for the selected employee.',
  649. confirmButtonText: 'OK',
  650. });
  651. }
  652. },
  653. error: function () {
  654. Swal.fire({
  655. icon: 'error',
  656. title: 'Error',
  657. text: 'Failed to fetch employee details. Please try again.',
  658. confirmButtonText: 'OK',
  659. });
  660. },
  661. });
  662. }
  663. $(document).ready(function () {
  664. $(document).on('click', '.view-btn', function () {
  665. const empCode = $(this).data('id'); // Fetch `data-id` value
  666. const tempId = $(this).data('temp-id'); // Fetch `data-temp-id` value
  667. console.log("empCode====="+empCode);
  668. // Hide the receivedcard section before showing the modal
  669. $("#receivedcard").hide();
  670. fetchEmployeeDetails(tempId); // Call the function to fetch employee details
  671. loadFileHistory(tempId); // Load the file history for the selected employee
  672. });
  673. // Initialize the modal with static backdrop and disabled keyboard closing
  674. $('#returnretrieddetailsModal').modal({
  675. backdrop: 'static',
  676. keyboard: false,
  677. show: false // Ensure it doesn't auto-show on page load
  678. });
  679. // Handle close button click
  680. $('#back').click(function () {
  681. $('#returnretrieddetailsModal').modal('hide');
  682. });
  683. $('.close').click(function () {
  684. $('#returnretrieddetailsModal').modal('hide');
  685. });
  686. // Listen for changes on the GPF radio buttons
  687. document.querySelectorAll('input[name="gpf"]').forEach(radio => {
  688. radio.addEventListener('change', function () {
  689. const gpfAmountDiv = document.getElementById('gpfAmountDiv');
  690. if (this.value === 'yes' || this.value === '90') {
  691. gpfAmountDiv.style.display = 'block'; // Show the input field
  692. } else {
  693. gpfAmountDiv.style.display = 'none'; // Hide the input field
  694. document.getElementById('gpfAmount').value = ''; // Clear the input field
  695. }
  696. });
  697. });
  698. // Listen for changes on the private affaires radio buttons
  699. document.querySelectorAll('input[name="earnedleave"]').forEach(radio => {
  700. radio.addEventListener('change', function () {
  701. const earnedleaveAmountDiv = document.getElementById('earnedleaveAmountDiv');
  702. if (this.value === 'yes') {
  703. earnedleaveAmountDiv.style.display = 'block'; // Show the input field
  704. } else {
  705. earnedleaveAmountDiv.style.display = 'none'; // Hide the input field
  706. document.getElementById('earnedleaveAmount').value = ''; // Clear the input field
  707. }
  708. });
  709. });
  710. // Listen for changes on the spfgs radio buttons
  711. document.querySelectorAll('input[name="spfgs"]').forEach(radio => {
  712. radio.addEventListener('change', function () {
  713. const spfgsAmountDiv = document.getElementById('spfgsAmountDiv');
  714. if (this.value === 'yes') {
  715. spfgsAmountDiv.style.display = 'block'; // Show the input field
  716. } else {
  717. spfgsAmountDiv.style.display = 'none'; // Hide the input field
  718. document.getElementById('spfgsAmount').value = ''; // Clear the input field
  719. }
  720. });
  721. });
  722. document.querySelectorAll('input[name="benefit_pension"]').forEach(radio => {
  723. radio.addEventListener('change', function () {
  724. const PbAmountDiv = document.getElementById('PbAmountDiv');
  725. if (this.value === 'yes') {
  726. PbAmountDiv.style.display = 'block'; // Show the input field
  727. } else {
  728. PbAmountDiv.style.display = 'none'; // Hide the input field
  729. document.getElementById('benefit_pension_amount').value = ''; // Clear the input field
  730. }
  731. });
  732. });
  733. document.querySelectorAll('input[name="benefit_dcrg"]').forEach(radio => {
  734. radio.addEventListener('change', function () {
  735. const dcrgAmountDiv = document.getElementById('dcrgAmountDiv');
  736. if (this.value === 'yes') {
  737. dcrgAmountDiv.style.display = 'block'; // Show the input field
  738. } else {
  739. dcrgAmountDiv.style.display = 'none'; // Hide the input field
  740. document.getElementById('benefit_dcrg_amount').value = ''; // Clear the input field
  741. }
  742. });
  743. });
  744. document.querySelectorAll('input[name="benefit_commutation"]').forEach(radio => {
  745. radio.addEventListener('change', function () {
  746. const CommutationAmountDiv = document.getElementById('CommutationAmountDiv');
  747. if (this.value === 'yes') {
  748. CommutationAmountDiv.style.display = 'block'; // Show the input field
  749. } else {
  750. CommutationAmountDiv.style.display = 'none'; // Hide the input field
  751. document.getElementById('benefit_commutation_amount').value = ''; // Clear the input field
  752. }
  753. });
  754. });
  755. });
  756. function loadFileHistory(tempId) {
  757. $.ajax({
  758. url: '/gcc/api/department/audit/fileMovementhistory', // API endpoint
  759. type: 'GET',
  760. data: { tempId: tempId }, // Pass empCode as a parameter
  761. success: function (response) {
  762. if (response.length > 0) {
  763. let historyHtml = '';
  764. response.forEach(item => {
  765. historyHtml += `
  766. <div class="file-history-item">
  767. <div class="file-history-date">${formatDateTime(item.fileMovedDateHistory)}</div>
  768. <div class="file-history-content">
  769. <div class="file-history-status">${item.fileStatusHistory}</div>
  770. <div class="file-history-remarks">Comments/Remarks: ${item.remarksHistory || 'N/A'}</div>
  771. </div>
  772. </div>
  773. `;
  774. });
  775. $('#fileHistoryContainer').html(historyHtml);
  776. } else {
  777. $('#fileHistoryContainer').html('<p>No file history available.</p>');
  778. }
  779. },
  780. error: function () {
  781. $('#fileHistoryContainer').html('<p>Failed to load file history. Please try again later.</p>');
  782. }
  783. });
  784. }
  785. // Function to format date and time
  786. function formatDateTime(dateString) {
  787. const options = {
  788. day: '2-digit',
  789. month: '2-digit',
  790. year: 'numeric',
  791. };
  792. return new Date(dateString).toLocaleDateString('en-GB', options); // Formats as dd-mm-yyyy
  793. }
  794. function saveEntryDetails(tempId,empNo) {
  795. //console.log("emp_no inside=="+empCode);
  796. let selectedGpfValue = $('input[name="gpf"]:checked').val(); // Get the selected radio button value
  797. let gpfAmount = null;
  798. // Check if GPF Amount input is visible and get its value
  799. if (selectedGpfValue === 'yes' || selectedGpfValue === '90') {
  800. gpfAmount = $('#gpfAmount').val(); // Retrieve the amount if available, else null
  801. if (!gpfAmount) {
  802. Swal.fire({
  803. icon: 'warning',
  804. title: 'Validation Error',
  805. text: 'Please Enter GPF Amount',
  806. confirmButtonText: 'OK'
  807. });
  808. return; // Stop further execution if validation fails
  809. }
  810. }
  811. let selectedElValue = $('input[name="earnedleave"]:checked').val();
  812. let earnedleaveAmount=null;
  813. if (selectedElValue === 'yes') {
  814. earnedleaveAmount = $('#earnedleaveAmount').val(); // Retrieve the amount if available, else null
  815. if (!earnedleaveAmount) {
  816. Swal.fire({
  817. icon: 'warning',
  818. title: 'Validation Error',
  819. text: 'Please Enter EL/LPA Amount',
  820. confirmButtonText: 'OK'
  821. });
  822. return; // Stop further execution if validation fails
  823. }
  824. }
  825. let selectedspfgsValue = $('input[name="spfgs"]:checked').val();
  826. let spfgsAmount=null;
  827. if (selectedspfgsValue === 'yes') {
  828. spfgsAmount = $('#spfgsAmount').val(); // Retrieve the amount if available, else null
  829. if (!spfgsAmount) {
  830. Swal.fire({
  831. icon: 'warning',
  832. title: 'Validation Error',
  833. text: 'Please Enter SPFGS Amount',
  834. confirmButtonText: 'OK'
  835. });
  836. return; // Stop further execution if validation fails
  837. }
  838. }
  839. //dcrf
  840. let selecteddcrgValue = $('input[name="dcrg"]:checked').val();
  841. let selectedPd = $('input[name="benefit_pension"]:checked').val();
  842. let selectedPdAmount=null;
  843. if (selectedPd === 'yes') {
  844. selectedPdAmount = $('#benefit_pension_amount').val();
  845. if (!selectedPdAmount) {
  846. Swal.fire({
  847. icon: 'warning',
  848. title: 'Validation Error',
  849. text: 'Please Enter Pension Benefit Amount',
  850. confirmButtonText: 'OK'
  851. });
  852. return; // Stop further execution if validation fails
  853. }
  854. }
  855. let selecteddcrg = $('input[name="benefit_dcrg"]:checked').val();
  856. let seldcrgAmount=null;
  857. if (selecteddcrg === 'yes') {
  858. seldcrgAmount = $('#benefit_dcrg_amount').val();
  859. if (!seldcrgAmount) {
  860. Swal.fire({
  861. icon: 'warning',
  862. title: 'Validation Error',
  863. text: 'Please Enter DCRG Benefit Amount',
  864. confirmButtonText: 'OK'
  865. });
  866. return; // Stop further execution if validation fails
  867. }
  868. }
  869. let selectedcom = $('input[name="benefit_commutation"]:checked').val();
  870. let selectedcomAmount=null;
  871. if (selectedcom === 'yes') {
  872. selectedcomAmount = $('#benefit_commutation_amount').val();
  873. if (!selectedcomAmount) {
  874. Swal.fire({
  875. icon: 'warning',
  876. title: 'Validation Error',
  877. text: 'Please Enter Commutation Benefit Amount',
  878. confirmButtonText: 'OK'
  879. });
  880. return; // Stop further execution if validation fails
  881. }
  882. }
  883. let entryDetails = {
  884. empNo:empNo,
  885. tempId: tempId, // Pass the stored tempId value
  886. dateToAudit: convertDateFormat($('#datefile').val()?.trim()),
  887. remarks: $('#remarks').val(),
  888. deptId:$('#deptId').text().trim(),
  889. filemovedby:$('#userId').text().trim(),
  890. gpf: selectedGpfValue, // Add GPF value (null if none selected)
  891. gpfAmount: gpfAmount, // Include the GPF amount
  892. private_affairs:selectedElValue,
  893. private_affairs_amount:earnedleaveAmount,
  894. spfgs:selectedspfgsValue,
  895. spfgs_amount:spfgsAmount,
  896. recovery_emp:$('#recoveryemployeevalue').val()|| null,
  897. dcrg:selecteddcrgValue,
  898. pension_number:$('#pensionNumber').val(),
  899. ledger_number:$('#ledgerNumber').val(),
  900. benefit_pension:selectedPd,
  901. benefit_dcrg:selecteddcrg,
  902. benefit_commutation:selectedcom,
  903. benefit_pension_amount:selectedPdAmount,
  904. benefit_dcrg_amount:seldcrgAmount,
  905. benefit_commutation_amount:selectedcomAmount
  906. };
  907. console.log("entryDetails:",entryDetails);
  908. if (!entryDetails.dcrg) {
  909. Swal.fire({
  910. icon: 'warning',
  911. title: 'Validation Error!',
  912. text: 'DCRG are required.',
  913. confirmButtonText: 'OK'
  914. });
  915. return;
  916. }
  917. if (!entryDetails.spfgs) {
  918. Swal.fire({
  919. icon: 'warning',
  920. title: 'Validation Error!',
  921. text: 'SPFGS are required.',
  922. confirmButtonText: 'OK'
  923. });
  924. return;
  925. }
  926. if (!entryDetails.private_affairs) {
  927. Swal.fire({
  928. icon: 'warning',
  929. title: 'Validation Error!',
  930. text: 'Private affairs are required.',
  931. confirmButtonText: 'OK'
  932. });
  933. return;
  934. }
  935. if (!entryDetails.gpf) {
  936. Swal.fire({
  937. icon: 'warning',
  938. title: 'Validation Error!',
  939. text: 'GPF are required.',
  940. confirmButtonText: 'OK'
  941. });
  942. return;
  943. }
  944. if (!entryDetails.remarks) {
  945. Swal.fire({
  946. icon: 'warning',
  947. title: 'Validation Error!',
  948. text: 'Remarks are required.',
  949. confirmButtonText: 'OK'
  950. });
  951. return;
  952. }
  953. // Disable the button to prevent multiple submissions
  954. $('#auditsubmit').prop('disabled', true).text('Processing...');
  955. $.ajax({
  956. url: '/gcc/api/department/partial/updateEmployeeDetails',
  957. type: 'POST',
  958. contentType: 'application/json',
  959. data: JSON.stringify(entryDetails),
  960. success: function (response) {
  961. $('#auditsubmit').prop('disabled', false).text('Mark as Completed');
  962. Swal.fire({
  963. icon: 'success',
  964. title: 'Success',
  965. text: response,
  966. allowOutsideClick: false,
  967. allowEscapeKey: false,
  968. allowEnterKey: false,
  969. confirmButtonText: 'OK'
  970. }).then((result) => {
  971. if (result.isConfirmed) {
  972. $('#auditsubmit').prop('disabled', false).text('Mark as Completed');
  973. window.location.href = "/gcc/department/partial/familypension";
  974. console.log("Continue clicked");
  975. }
  976. });
  977. },
  978. error: function (xhr, status, error) {
  979. $('#auditsubmit').prop('disabled', false).text('Mark as Completed');
  980. Swal.fire({
  981. icon: 'error',
  982. title: 'Error',
  983. text: 'Failed to save details. Please try again.',
  984. confirmButtonText: 'OK'
  985. });
  986. console.error('Error:', xhr.responseText);
  987. }
  988. });
  989. }
  990. //amount field validation
  991. function validatePositiveNumber(input) {
  992. if (input.value < 1) {
  993. input.value = "";
  994. }
  995. }
  996. </script>
  997. </body>
  998. </html>