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.

770 lines
32 KiB

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 h4 {
  10. font-weight: bold;
  11. margin-top: 15px;
  12. margin-bottom: 10px;
  13. }
  14. #modalBody p {
  15. margin: 5px 0;
  16. }
  17. #modalBody hr {
  18. margin: 15px 0;
  19. }
  20. .comment {
  21. margin-bottom: 20px;
  22. }
  23. .comment p {
  24. margin: 0;
  25. }
  26. hr {
  27. border: 1px solid #ccc;
  28. margin-top: 20px;
  29. margin-bottom: 20px;
  30. }
  31. h5 {
  32. font-size: bold;
  33. }
  34. /* Limit the height of the dropdown menu and make it scrollable */
  35. .dropdown-menu {
  36. max-height: 200px; /* Adjust this value as needed */
  37. overflow-y: auto;
  38. }
  39. .col-4 {
  40. font-weight: bold;
  41. text-align: right;
  42. }
  43. .col-8 {
  44. padding-left: 20px;
  45. }
  46. .comment {
  47. padding: 10px 0;
  48. }
  49. .comment .text-muted {
  50. font-size: 0.9em;
  51. color: #6c757d;
  52. }
  53. .comment hr {
  54. border-top: 1px solid #ccc;
  55. }
  56. .comment .btn-link {
  57. font-size: 0.9em;
  58. text-decoration: underline;
  59. color: #007bff;
  60. }
  61. /* Make the modal body scrollable */
  62. #detailsModal .modal-body {
  63. max-height: 70vh; /* Limit the height to 70% of the viewport */
  64. overflow-y: auto; /* Enable vertical scrolling */
  65. }
  66. .card-box {
  67. border-radius: 20px;
  68. box-shadow: rgba(0, 0, 0, 0.5) 0px 3px 8px;
  69. }
  70. #followupCard {
  71. transition: transform 0.2s ease; /* Smooth scaling transition */
  72. cursor: pointer; /* Default cursor change */
  73. }
  74. #followupCard:hover {
  75. transform: scale(1.05); /* Slightly scale up on hover */
  76. cursor: pointer; /* Change cursor to hand symbol */
  77. }
  78. #receivedprovisionalModal .modal-body{
  79. max-height:80vh;
  80. overflow-y:auto;
  81. }
  82. .file-history-list {
  83. margin-top: 10px;
  84. padding-left: 0;
  85. }
  86. .file-history-item {
  87. display: flex;
  88. padding: 5px 10px;
  89. align-items: flex-start;
  90. position: relative; /* For vertical line positioning */
  91. margin-bottom: 1px; /* Add space between items */
  92. }
  93. .file-history-item::before {
  94. content: '';
  95. position: absolute;
  96. top: 0;
  97. bottom: 0;
  98. left: 120px; /* Position of the vertical line */
  99. width: 1px;
  100. background-color: #ddd;
  101. }
  102. .file-history-date {
  103. margin-top: 10px;
  104. flex: 0 0 100px;
  105. font-weight: bold;
  106. font-size: 0.8rem;
  107. color: #333;
  108. text-align: center;
  109. white-space: nowrap; /* Prevent wrapping */
  110. }
  111. .file-history-content {
  112. flex: 5;
  113. padding-left: 20px; /* Adds space after the vertical line */
  114. display: flex;
  115. flex-direction: column;
  116. gap: 5px; /* Adds spacing between status and remarks */
  117. white-space: pre-wrap; /* Prevents wrapping */
  118. overflow: visible; /* Prevents content overflow */
  119. text-overflow: ellipsis; /* Adds ellipsis if content exceeds container width */
  120. }
  121. .file-history-status {
  122. font-size: 0.8rem;
  123. font-weight: bold;
  124. color: #555;
  125. white-space:pre-wrap; /* Prevent wrapping */
  126. overflow: visible;
  127. text-overflow: ellipsis;
  128. }
  129. .file-history-remarks {
  130. font-size: 0.8rem;
  131. color: #777;
  132. white-space: pre-wrap; /* Prevent wrapping */
  133. overflow: visible;
  134. text-overflow: ellipsis;
  135. }
  136. #sec1 .col-md-4,.col-md-12{
  137. padding-top: 1%;
  138. }
  139. .col-md-4 .form-check{
  140. width: 25%;
  141. }
  142. .col-md-6 .form-check{
  143. width: 25%;
  144. }
  145. </style>
  146. <body>
  147. <!--[if lt IE 8]>
  148. <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>
  149. <![endif]-->
  150. <div class="wrapper">
  151. <!-- header top menu Start -->
  152. <header th:replace="~{fragments/modules/base/header :: header}"></header>
  153. <!-- header top menu end -->
  154. <div class="page-wrap">
  155. <!--=============== Left Menu side Start ================-->
  156. <div th:replace="~{fragments/modules/base/menu :: menu}"></div>
  157. <!--=============== Left side End ================-->
  158. <div class="main-content">
  159. <div class="container-fluid">
  160. <div class="page-header mb-2">
  161. <div class="row align-items-end">
  162. <div class="col-lg-8">
  163. <div class="page-header-title">
  164. <i class="fa fa-list-alt bg-blue"></i>
  165. <div class="d-inline">
  166. <h5> Retirement</h5>
  167. <span>Department Entries</span>
  168. </div>
  169. </div>
  170. </div>
  171. <div class="col-lg-4">
  172. <nav class="breadcrumb-container" aria-label="breadcrumb">
  173. <ol class="breadcrumb">
  174. <li class="breadcrumb-item"><a href="/gcc/index"><i class="ik ik-home"></i></a></li>
  175. <li class="breadcrumb-item" aria-current="page">Department Entries</li>
  176. <li class="breadcrumb-item" aria-current="page">Completed</li>
  177. <li class="breadcrumb-item active" aria-current="page">Retirement</li>
  178. </ol>
  179. </nav>
  180. </div>
  181. </div>
  182. </div>
  183. <div class="row mt-4">
  184. <div class="col-md-12">
  185. <div class="card">
  186. <div class="card-block">
  187. <span th:text="${filecategory}" id="filecategory" style="display:none"></span>
  188. <h5 style="font-weight:bold;"> <span th:text="${deptname}" id="deptname"></span>&nbsp;Department</h5>
  189. <h5 style="font-weight:bold;"><span th:text="${deptId}" id="deptId" style="display:none"></span>Completed - Retirement</h5>
  190. <span th:text="${userId}" id="userId" style="display:none"></span>
  191. <div id="audittable">
  192. <table id="AuditDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid">
  193. <thead class="thead-dark">
  194. <tr role="row">
  195. <th class="text-center">S.No</th>
  196. <th class="text-center">Employee Code</th>
  197. <th class="text-center">Name </th>
  198. <th class="text-center">Department</th>
  199. <th class="text-center">Designation</th>
  200. <th class="text-center">File Sent Date</th>
  201. <th class="text-center">File Type</th>
  202. <th class="text-center">View</th>
  203. </tr>
  204. </thead>
  205. <tbody style="text-align:center;">
  206. <!-- Thymeleaf loop to populate data -->
  207. <tr th:each="provisional, iterStat : ${provisionallist}">
  208. <td th:text="${iterStat.index + 1}" class="text-center"></td>
  209. <td th:text="${provisional['emp_no']}" class="text-center"></td>
  210. <td th:text="${provisional['emp_name']}" class="text-center"></td>
  211. <td th:text="${provisional['dept_name']}" class="text-center"></td>
  212. <td th:text="${provisional['designation']}" class="text-center"></td>
  213. <td th:text="${provisional['file_moved_date'] != null ? #dates.format(provisional['file_moved_date'], 'dd-MM-yyyy') : 'N/A'}" class="text-center"></td>
  214. <td th:text="${provisional['file_entry_type']}" class="text-center"></td>
  215. <td class="text-center">
  216. <button class="btn btn-primary btn-sm view-btn" th:attr="data-id=${provisional['emp_no']}, data-temp-id=${provisional['temp_id']}">
  217. View
  218. </button>
  219. </td>
  220. </tr>
  221. </tbody>
  222. </table>
  223. </div>
  224. </div>
  225. </div>
  226. </div>
  227. </div>
  228. </div>
  229. </div>
  230. <footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
  231. </div>
  232. </div>
  233. <!-- Modal Box -->
  234. <div class="modal fade" id="returnretrieddetailsModal" tabindex="-1" role="dialog" aria-labelledby="detailsModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">
  235. <div class="modal-dialog modal-xl" role="document">
  236. <div class="modal-content">
  237. <div class="modal-header">
  238. <h5 class="modal-title" id="detailsModalLabel">
  239. Completed - Retirement (<span id="modalEmployeeCode"></span>)
  240. </h5>
  241. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  242. <span aria-hidden="true">&times;</span>
  243. </button>
  244. </div>
  245. <div class="modal-body">
  246. <div class="row" id="sec1">
  247. <!-- Employee No -->
  248. <div class="col-md-4">
  249. <label for="employeenomodel" class="form-label fw-bold">Employee No </label>
  250. <input type="number" id="employeenomodel" class="form-control" readonly>
  251. </div>
  252. <!-- Employee Name -->
  253. <div class="col-md-4">
  254. <label for="employeename" class="form-label fw-bold">Employee Name </label>
  255. <input type="text" id="employeename" class="form-control" readonly>
  256. </div>
  257. <!-- Department -->
  258. <div class="col-md-4">
  259. <label for="department" class="form-label fw-bold">Department </label>
  260. <input type="text" id="department" class="form-control" readonly>
  261. </div>
  262. <!-- Designation -->
  263. <div class="col-md-4">
  264. <label for="designation" class="form-label fw-bold">Designation </label>
  265. <input type="text" id="designation" class="form-control" readonly>
  266. </div>
  267. <div class="col-md-4">
  268. <label for="retirementdate" class="form-label fw-bold">Retirement Date </label>
  269. <input type="date" id="retirementdate" class="form-control" readonly>
  270. </div>
  271. <!-- Class -->
  272. <div class="col-md-4">
  273. <label for="classes" class="form-label fw-bold">Class </label>
  274. <input type="text" id="classes" class="form-control" readonly>
  275. </div>
  276. <!-- Type of Retirement -->
  277. <div class="col-md-4">
  278. <label for="typeofretirement" class="form-label fw-bold">Type of Retirement </label>
  279. <input type="text" id="typeofretirement" class="form-control" readonly>
  280. </div>
  281. <!-- Date File Sent to Audit -->
  282. <div class="col-md-4">
  283. <label for="datefile_modal" class="form-label fw-bold">Date File Completed </label>
  284. <input type="date" id="datefile_modal" class="form-control" readonly>
  285. </div>
  286. <!-- Remarks -->
  287. <div class="col-md-12">
  288. <label for="remarks_modal" class="form-label fw-bold">Comments/Remarks </label>
  289. <textarea id="remarks_modal" class="form-control" rows="4" placeholder="Enter your remarks here" readonly></textarea>
  290. </div>
  291. <!-- new -->
  292. <div class="col-md-12 mt-4">
  293. <h5>File History</h5>
  294. <div id="fileHistoryContainer" class="file-history-list">
  295. <!-- File History will be dynamically loaded here -->
  296. </div>
  297. </div>
  298. <div class="col-md-12 ">
  299. <span style="font-weight: bold;font-size: medium;text-decoration: underline;">Department Benefits</span>
  300. </div>
  301. <!-- GPF -->
  302. <div class="col-md-4 mb-2">
  303. <label class="form-label fw-bold">GPF</label>
  304. <div class="d-flex align-items-center gap-5">
  305. <div class="form-check">
  306. <input class="form-check-input" type="radio" id="gpfYes" name="gpf" value="yes" disabled>
  307. <label class="form-check-label" for="gpfYes">Yes</label>
  308. </div>
  309. <div class="form-check">
  310. <input class="form-check-input" type="radio" id="gpfNo" name="gpf" value="no" disabled>
  311. <label class="form-check-label" for="gpfNo">No</label>
  312. </div>
  313. <div class="form-check">
  314. <input class="form-check-input" type="radio" id="gpf50" name="gpf" value="90" disabled>
  315. <label class="form-check-label" for="gpf50">90%</label>
  316. </div>
  317. </div>
  318. <!-- Placeholder for dynamically added input -->
  319. <div id="gpfAmountDiv" class="mt-3" style="display: none;">
  320. <label for="gpfAmount" class="form-label">Enter GPF Amount</label>
  321. <input type="number" id="gpfAmount" class="form-control" placeholder="Enter GPF amount" readonly>
  322. </div>
  323. </div>
  324. <!-- Earned Leave & Leave on Private Affairs -->
  325. <div class="col-md-4 mb-2">
  326. <label class="form-label fw-bold">Earned Leave & Leave on Private Affairs</label>
  327. <div class="d-flex align-items-center gap-5">
  328. <div class="form-check">
  329. <input class="form-check-input" type="radio" id="earnedleaveYes" name="earnedleave" value="yes" disabled>
  330. <label class="form-check-label" for="earnedleaveYes">Yes</label>
  331. </div>
  332. <div class="form-check">
  333. <input class="form-check-input" type="radio" id="earnedleaveNo" name="earnedleave" value="no" disabled>
  334. <label class="form-check-label" for="earnedleaveNo">No</label>
  335. </div>
  336. </div>
  337. <!-- Placeholder for dynamically added input -->
  338. <div id="earnedleaveAmountDiv" class="mt-3" style="display: none;">
  339. <label for="earnedleaveAmount" class="form-label">Enter EL and LPA Amount</label>
  340. <input type="number" id="earnedleaveAmount" class="form-control" placeholder="Enter Amount" readonly>
  341. </div>
  342. </div>
  343. <!-- SPFGS -->
  344. <div class="col-md-4 mb-2">
  345. <label class="form-label fw-bold">SPFGS</label>
  346. <div class="d-flex align-items-center gap-5">
  347. <div class="form-check">
  348. <input class="form-check-input" type="radio" id="spfgsYes" name="spfgs" value="yes" disabled>
  349. <label class="form-check-label" for="spfgsYes">Yes</label>
  350. </div>
  351. <div class="form-check">
  352. <input class="form-check-input" type="radio" id="spfgsNo" name="spfgs" value="no" disabled>
  353. <label class="form-check-label" for="spfgsNo">No</label>
  354. </div>
  355. </div>
  356. <!-- Placeholder for dynamically added input -->
  357. <div id="spfgsAmountDiv" class="mt-3" style="display: none;">
  358. <label for="spfgsAmount" class="form-label">Enter SPFGS Amount</label>
  359. <input type="number" id="spfgsAmount" class="form-control" placeholder="Enter spfgs Amount" readonly>
  360. </div>
  361. </div>
  362. <div class="col-md-4 mb-2">
  363. <label for="recoveryemployeevalue" class="form-label fw-bold">Recovery From Employee</label>
  364. <input type="text" id="recoveryemployeevalue" class="form-control" placeholder="Enter Recovery From Employee" readonly>
  365. </div>
  366. <!-- DCRF File is Ready -->
  367. <div class="col-md-4">
  368. <label class="form-label fw-bold">DCRG File is Ready</label>
  369. <div class="d-flex align-items-center gap-5">
  370. <div class="form-check">
  371. <input class="form-check-input" type="radio" id="dcrgYes" name="dcrg" value="yes" disabled>
  372. <label class="form-check-label" for="dcrgYes">Yes</label>
  373. </div>
  374. <div class="form-check">
  375. <input class="form-check-input" type="radio" id="dcrgNo" name="dcrg" value="no" disabled>
  376. <label class="form-check-label" for="dcrgNo">No</label>
  377. </div>
  378. </div>
  379. </div>
  380. <div class="col-md-12 ">
  381. <span style="font-weight: bold;font-size: medium;text-decoration: underline;">Pension Benefits</span>
  382. </div>
  383. <div class="col-md-6 mt-2 mb-2">
  384. <label for="pensionNumber" class="form-label">Pension Number</label>
  385. <input type="number" id="pensionNumber" class="form-control" placeholder="Enter Employee Pension Number" readonly>
  386. </div>
  387. <div class="col-md-6 mt-2 mb-2">
  388. <label for="ledgerNumber" class="form-label">Ledger Number</label>
  389. <input type="number" id="ledgerNumber" class="form-control" placeholder="Enter Ledger Number" readonly>
  390. </div>
  391. <div class="col-md-4 mb-2">
  392. <label class="form-label fw-bold">Sanctions Pensions Benefit-Pension</label>
  393. <div class="d-flex align-items-center gap-5">
  394. <div class="form-check">
  395. <input class="form-check-input" type="radio" id="bpYes" name="benefit_pension" value="yes" disabled>
  396. <label class="form-check-label" for="bpYes">Yes</label>
  397. </div>
  398. <div class="form-check">
  399. <input class="form-check-input" type="radio" id="bpNo" name="benefit_pension" value="no" disabled>
  400. <label class="form-check-label" for="bpNo">No</label>
  401. </div>
  402. </div>
  403. <!-- Placeholder for dynamically added input -->
  404. <div id="PbAmountDiv" class="mt-3" style="display: none;">
  405. <label for="benefit_pension_amount" class="form-label">Enter Pensions Benefit Amount</label>
  406. <input type="number" id="benefit_pension_amount" class="form-control" placeholder="Enter Pensions Benefit Amount" readonly>
  407. </div>
  408. </div>
  409. <div class="col-md-4 mb-2">
  410. <label class="form-label fw-bold">Sanctions Pensions Benefit-DCRG</label>
  411. <div class="d-flex align-items-center gap-5">
  412. <div class="form-check">
  413. <input class="form-check-input" type="radio" id="DcrgYes" name="benefit_dcrg" value="yes" disabled>
  414. <label class="form-check-label" for="DcrgYes">Yes</label>
  415. </div>
  416. <div class="form-check">
  417. <input class="form-check-input" type="radio" id="DcrgNo" name="benefit_dcrg" value="no" disabled>
  418. <label class="form-check-label" for="DcrgNo">No</label>
  419. </div>
  420. </div>
  421. <!-- Placeholder for dynamically added input -->
  422. <div id="dcrgAmountDiv" class="mt-3" style="display: none;">
  423. <label for="benefit_dcrg_amount" class="form-label">Enter Benefit DCRG Amount</label>
  424. <input type="number" id="benefit_dcrg_amount" class="form-control" placeholder="Enter Pensions Benefit DCRG Amount" readonly>
  425. </div>
  426. </div>
  427. <div class="col-md-4 mb-2">
  428. <label class="form-label fw-bold">Sanctions Pensions Benefit-Commutation</label>
  429. <div class="d-flex align-items-center gap-5">
  430. <div class="form-check">
  431. <input class="form-check-input" type="radio" id="commutationYes" name="benefit_commutation" value="yes" disabled>
  432. <label class="form-check-label" for="commutationYes">Yes</label>
  433. </div>
  434. <div class="form-check">
  435. <input class="form-check-input" type="radio" id="commutationNo" name="benefit_commutation" value="no" disabled>
  436. <label class="form-check-label" for="commutationNo">No</label>
  437. </div>
  438. </div>
  439. <!-- Placeholder for dynamically added input -->
  440. <div id="CommutationAmountDiv" class="mt-3" style="display: none;">
  441. <label for="benefit_commutation_amount" class="form-label">Enter Benefit Commutation Amount</label>
  442. <input type="number" id="benefit_commutation_amount" class="form-control" placeholder="Enter Pensions Benefit Commutation Amount" readonly>
  443. </div>
  444. </div>
  445. </div>
  446. <div class="row mb-2 mt-2">
  447. <div class="col-md-12 d-flex justify-content-center">
  448. <button type="button" class="btn btn-secondary" data-dismiss="modal" id="back">Back</button>
  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. // Initialize DataTable
  463. const table = $('#AuditDatatable').DataTable({
  464. dom: 'Bftip',
  465. columnDefs: [
  466. { targets: 'no-sort', orderable: false }
  467. ],
  468. lengthMenu: [
  469. [50, 100, 200, 500, -1],
  470. ['50 rows', '100 rows', '200 rows', 'Show all']
  471. ],
  472. scrollY: '50vh',
  473. buttons: [
  474. { extend: 'pageLength', className: 'btn btn-warning' },
  475. { title: 'Data export', extend: 'copyHtml5', text: 'Copy', className: 'btn btn-secondary' },
  476. { extend: 'excelHtml5', text: 'Excel', className: 'btn btn-secondary' },
  477. { extend: 'csvHtml5', text: 'CSV', className: 'btn btn-secondary' },
  478. { extend: 'pdfHtml5', text: 'PDF', className: 'btn btn-secondary' }
  479. ],
  480. fixedHeader: true,
  481. autoWidth: true,
  482. responsive: true,
  483. searching: true,
  484. select: false,
  485. processing: false
  486. });
  487. //model function
  488. function fetchEmployeeDetails(tempId) {
  489. $.ajax({
  490. url: '/gcc/api/department/audit/getpartialdetails', // API to fetch employee details
  491. type: 'GET',
  492. data: { tempId: tempId }, // Pass EMPLOYEE_CODE as a parameter
  493. success: function (response) {
  494. if (response && response.length > 0) {
  495. let employeeDetails = response[0]; // Access the first object in the array
  496. console.log("response:",response);
  497. // Populate modal fields
  498. $('#employeenomodel').val(employeeDetails.emp_no);
  499. $('#employeename').val(employeeDetails.emp_name);
  500. $('#department').val(employeeDetails.dept_name);
  501. $('#designation').val(employeeDetails.designation);
  502. $('#typeofretirement').val(employeeDetails.type_of_retirement);
  503. $('#classes').val(employeeDetails.retirement_class);
  504. $('#datefile_modal').val(employeeDetails.file_moved_date);
  505. $('#remarks_modal').val(employeeDetails.remarks);
  506. $('#retirementdate').val(employeeDetails.retirement_date);
  507. // Update the modal title with the employee code
  508. $('#modalEmployeeCode').text(employeeDetails.emp_no);
  509. // Show the modal
  510. $('#returnretrieddetailsModal').modal('show');
  511. $('input[name="gpf"][value="' + employeeDetails.gpf + '"]').prop('checked', true);
  512. if (employeeDetails.gpf === "yes" || employeeDetails.gpf === "90") {
  513. $('#gpfAmountDiv').show();
  514. $('#gpfAmount').val(employeeDetails.gpf_amount);
  515. } else {
  516. $('#gpfAmountDiv').hide();
  517. }
  518. // Earned Leave & Leave on Private Affairs
  519. $('input[name="earnedleave"][value="' + employeeDetails.private_affairs + '"]').prop('checked', true);
  520. if (employeeDetails.private_affairs === "yes") {
  521. $('#earnedleaveAmountDiv').show();
  522. $('#earnedleaveAmount').val(employeeDetails.private_affairs_amount);
  523. } else {
  524. $('#earnedleaveAmountDiv').hide();
  525. }
  526. // SPFGS
  527. $('input[name="spfgs"][value="' + employeeDetails.spfgs + '"]').prop('checked', true);
  528. if (employeeDetails.spfgs === "yes") {
  529. $('#spfgsAmountDiv').show();
  530. $('#spfgsAmount').val(employeeDetails.spfgs_amount);
  531. } else {
  532. $('#spfgsAmountDiv').hide();
  533. }
  534. // DCRG File
  535. $('input[name="dcrg"][value="' + employeeDetails.dcrg + '"]').prop('checked', true);
  536. $('#pensionNumber').val(employeeDetails.pension_number);
  537. $('#ledgerNumber').val(employeeDetails.ledger_number);
  538. $('input[name="benefit_pension"][value="' + employeeDetails.benefit_pension + '"]').prop('checked', true);
  539. if (employeeDetails.benefit_pension === "yes") {
  540. $('#PbAmountDiv').show();
  541. $('#benefit_pension_amount').val(employeeDetails.benefit_pension_amount);
  542. } else {
  543. $('#PbAmountDiv').hide();
  544. }
  545. $('input[name="benefit_dcrg"][value="' + employeeDetails.benefit_dcrg + '"]').prop('checked', true);
  546. if (employeeDetails.benefit_dcrg === "yes") {
  547. $('#dcrgAmountDiv').show();
  548. $('#benefit_dcrg_amount').val(employeeDetails.benefit_dcrg_amount);
  549. } else {
  550. $('#dcrgAmountDiv').hide();
  551. }
  552. $('input[name="benefit_commutation"][value="' + employeeDetails.benefit_commutation + '"]').prop('checked', true);
  553. if (employeeDetails.benefit_commutation === "yes") {
  554. $('#CommutationAmountDiv').show();
  555. $('#benefit_commutation_amount').val(employeeDetails.benefit_commutation_amount);
  556. } else {
  557. $('#CommutationAmountDiv').hide();
  558. }
  559. } else {
  560. Swal.fire({
  561. icon: 'info',
  562. title: 'No Data',
  563. text: 'No details found for the selected employee.',
  564. confirmButtonText: 'OK',
  565. });
  566. }
  567. },
  568. error: function () {
  569. Swal.fire({
  570. icon: 'error',
  571. title: 'Error',
  572. text: 'Failed to fetch employee details. Please try again.',
  573. confirmButtonText: 'OK',
  574. });
  575. },
  576. });
  577. }
  578. $(document).ready(function () {
  579. $(document).on('click', '.view-btn', function () {
  580. const empCode = $(this).data('id'); // Fetch `data-id` value
  581. const tempId = $(this).data('temp-id'); // Fetch `data-temp-id` value
  582. console.log("empCode====="+empCode);
  583. // Hide the receivedcard section before showing the modal
  584. $("#receivedcard").hide();
  585. fetchEmployeeDetails(tempId); // Call the function to fetch employee details
  586. loadFileHistory(tempId); // Load the file history for the selected employee
  587. });
  588. // Initialize the modal with static backdrop and disabled keyboard closing
  589. $('#returnretrieddetailsModal').modal({
  590. backdrop: 'static',
  591. keyboard: false,
  592. show: false // Ensure it doesn't auto-show on page load
  593. });
  594. // Handle close button click
  595. $('#back').click(function () {
  596. $('#returnretrieddetailsModal').modal('hide');
  597. });
  598. $('.close').click(function () {
  599. $('#returnretrieddetailsModal').modal('hide');
  600. });
  601. });
  602. function loadFileHistory(tempId) {
  603. $.ajax({
  604. url: '/gcc/api/department/audit/fileMovementhistory', // API endpoint
  605. type: 'GET',
  606. data: { tempId: tempId }, // Pass empCode as a parameter
  607. success: function (response) {
  608. if (response.length > 0) {
  609. let historyHtml = '';
  610. response.forEach(item => {
  611. historyHtml += `
  612. <div class="file-history-item">
  613. <div class="file-history-date">${formatDateTime(item.fileMovedDateHistory)}</div>
  614. <div class="file-history-content">
  615. <div class="file-history-status">${item.fileStatusHistory}</div>
  616. <div class="file-history-remarks">Comments/Remarks: ${item.remarksHistory || 'N/A'}</div>
  617. </div>
  618. </div>
  619. `;
  620. });
  621. $('#fileHistoryContainer').html(historyHtml);
  622. } else {
  623. $('#fileHistoryContainer').html('<p>No file history available.</p>');
  624. }
  625. },
  626. error: function () {
  627. $('#fileHistoryContainer').html('<p>Failed to load file history. Please try again later.</p>');
  628. }
  629. });
  630. }
  631. // Function to format date and time
  632. function formatDateTime(dateString) {
  633. const options = {
  634. day: '2-digit',
  635. month: '2-digit',
  636. year: 'numeric',
  637. };
  638. return new Date(dateString).toLocaleDateString('en-GB', options); // Formats as dd-mm-yyyy
  639. }
  640. </script>
  641. </body>
  642. </html>