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.

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