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.

1229 lines
51 KiB

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