From 5bf7d76bc88e949890d69f12810d874c7bbe71f4 Mon Sep 17 00:00:00 2001 From: yoganandhank Date: Mon, 12 Oct 2026 12:13:33 +0530 Subject: [PATCH] new changes in adjustemnt project, toner management project, rental management project api's and pages --- .../controller/AdjustmentController.java | 2 + .../service/AdjustmentService.java | 8 +- .../controller/RentalController.java | 224 +- .../service/RentalService.java | 374 ++- .../controller/TonerController.java | 172 + .../service/TonerService.java | 144 +- .../gccadjustmentmanagement/dashboard.html | 11 + .../gccadjustmentmanagement/details.html | 19 +- .../gccrentalmanagement/dashboard.html | 2844 ++++++++++++++--- .../templates/gcctonermanagement/details.html | 1637 ++++++++++ .../templates/gcctonermanagement/login.html | 2 + .../templates/gcctonermanagement/upload.html | 2534 ++++++++++++--- 12 files changed, 6874 insertions(+), 1097 deletions(-) create mode 100644 src/main/resources/templates/gcctonermanagement/details.html diff --git a/src/main/java/com/gcc_manpower/gccadjustmentmanagement/controller/AdjustmentController.java b/src/main/java/com/gcc_manpower/gccadjustmentmanagement/controller/AdjustmentController.java index 450d72e..1c92390 100644 --- a/src/main/java/com/gcc_manpower/gccadjustmentmanagement/controller/AdjustmentController.java +++ b/src/main/java/com/gcc_manpower/gccadjustmentmanagement/controller/AdjustmentController.java @@ -218,6 +218,7 @@ public class AdjustmentController { @RequestParam(value = "fund_type_id", required = false) String fundTypeId, @RequestParam(value = "bal_amt", required = false) Double balAmt, @RequestParam(value = "file_remark", required = false) String fileRemark, + @RequestParam(value = "review_remark", required = false) String reviewRemark, @RequestParam(value = "file_data_num", required = false) String fileDataNum, @RequestParam(value = "pi_amt", required = false) Double piAmt, @RequestParam(value = "pi_file_gen_date", required = false) String piFileGenDate, @@ -308,6 +309,7 @@ public class AdjustmentController { data.put("fund_type_id", fundTypeId); data.put("bal_amt", balAmt); data.put("file_remark", fileRemark); + data.put("review_remark", reviewRemark); data.put("file_data_num", fileDataNum); data.put("pi_amt", piAmt); data.put("pi_file_gen_date", piFileGenDate); diff --git a/src/main/java/com/gcc_manpower/gccadjustmentmanagement/service/AdjustmentService.java b/src/main/java/com/gcc_manpower/gccadjustmentmanagement/service/AdjustmentService.java index 06eff07..d56600d 100644 --- a/src/main/java/com/gcc_manpower/gccadjustmentmanagement/service/AdjustmentService.java +++ b/src/main/java/com/gcc_manpower/gccadjustmentmanagement/service/AdjustmentService.java @@ -219,7 +219,7 @@ public class AdjustmentService { "as_file_gen_date = ?, as_file_path = ?, as_final_file_gen_date = ?, as_final_file_path = ?, " + "bal_amt = ?, dc_file_path = ?, ejv_num = ?, ejv_num_file_gen_date = ?, ejv_num_file_path = ?, " + "fi_amt = ?, fi_file_gen_date = ?, fi_file_path = ?, file_data_num = ?, file_path = ?, " + - "file_remark = ?, fin_year = ?, subject = ?, ir_file_path = ?, pi_amt = ?, pi_file_gen_date = ?, " + + "file_remark = ?, review_remark = ?, fin_year = ?, subject = ?, ir_file_path = ?, pi_amt = ?, pi_file_gen_date = ?, " + "pi_file_path = ?, po_file_path = ?, rtgs_file_path = ?, sr_filepath = ?, tc_file_gen_date = ?, " + "tc_file_path = ?, vend_name = ?, adv_type_id = ?, fund_type_id = ?, ac_code = ?, " + "file_available_status = ?, dc_completed_date = ?, rtgs_date = ?, file_status_id = ?, updated_date = ?, updated_by = ? WHERE id = ?"; @@ -240,6 +240,7 @@ public class AdjustmentService { data.get("file_data_num"), data.get("file_path"), data.get("file_remark"), + data.get("review_remark"), data.get("fin_year"), data.get("subject"), data.get("ir_file_path"), @@ -274,12 +275,12 @@ public class AdjustmentService { "as_file_gen_date, as_file_path, as_final_file_gen_date, as_final_file_path, " + "bal_amt, dc_file_path, ejv_num, ejv_num_file_gen_date, ejv_num_file_path, " + "fi_amt, fi_file_gen_date, fi_file_path, file_data_num, file_path, " + - "file_remark, fin_year, subject, ir_file_path, pi_amt, pi_file_gen_date, " + + "file_remark, review_remark, fin_year, subject, ir_file_path, pi_amt, pi_file_gen_date, " + "pi_file_path, po_file_path, rtgs_file_path, sr_filepath, tc_file_gen_date, " + "tc_file_path, vend_name, adv_type_id, fund_type_id, ac_code, file_available_status, " + "dc_completed_date, rtgs_date, file_status_id, cdate, updated_date, updated_by, is_active, is_delete) VALUES " + - "(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, 0)"; + "(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, 0)"; try { int rows = jdbcTemplate.update(sql, parseDate(data.get("as_file_gen_date")), @@ -297,6 +298,7 @@ public class AdjustmentService { data.get("file_data_num"), data.get("file_path"), data.get("file_remark"), + data.get("review_remark"), data.get("fin_year"), data.get("subject"), data.get("ir_file_path"), diff --git a/src/main/java/com/gcc_manpower/gccrentalmanagement/controller/RentalController.java b/src/main/java/com/gcc_manpower/gccrentalmanagement/controller/RentalController.java index 190395e..0711c10 100644 --- a/src/main/java/com/gcc_manpower/gccrentalmanagement/controller/RentalController.java +++ b/src/main/java/com/gcc_manpower/gccrentalmanagement/controller/RentalController.java @@ -5,6 +5,7 @@ import java.io.FileOutputStream; import java.io.InputStream; import java.io.OutputStream; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -87,7 +88,8 @@ public class RentalController { Map response = new HashMap<>(); try { - UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(usrName, usrPass); + UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(usrName, + usrPass); Authentication authentication = authenticationManager.authenticate(authenticationToken); SecurityContextHolder.getContext().setAuthentication(authentication); @@ -146,6 +148,12 @@ public class RentalController { return rentalService.getActiveZones(); } + @GetMapping("/api/categories") + @ResponseBody + public List> getCategories(HttpSession session) { + return rentalService.getActiveCategories(); + } + @GetMapping("/api/vendors") @ResponseBody public List> getVendors(HttpSession session) { @@ -178,12 +186,9 @@ public class RentalController { @RequestParam("periodFromDate") String periodFromDate, @RequestParam("periodToDate") String periodToDate, @RequestParam("vendorName") String vendorName, - @RequestParam(value = "systemsQty", defaultValue = "0") Integer systemsQty, - @RequestParam(value = "systemsModel", defaultValue = "") String systemsModel, - @RequestParam(value = "printersQty", defaultValue = "0") Integer printersQty, - @RequestParam(value = "printersModel", defaultValue = "") String printersModel, - @RequestParam(value = "laptopsQty", defaultValue = "0") Integer laptopsQty, - @RequestParam(value = "laptopsModel", defaultValue = "") String laptopsModel, + @RequestParam(value = "cid", required = false) List cids, + @RequestParam(value = "categoryQty", required = false) List categoryQtys, + @RequestParam(value = "categoryModelName", required = false) List categoryModelNames, @RequestParam(value = "woCopyFile", required = false) MultipartFile woCopyFile, @RequestParam(value = "remarks", defaultValue = "") String remarks, HttpSession session) { @@ -196,23 +201,81 @@ public class RentalController { return response; } + if (cids == null || cids.isEmpty()) { + response.put("success", false); + response.put("error", "Please add at least one Asset Category."); + return response; + } + + List> categoryItems = new ArrayList<>(); + for (int i = 0; i < cids.size(); i++) { + String cidStr = cids.get(i); + String qtyStr = (categoryQtys != null && i < categoryQtys.size()) ? categoryQtys.get(i) : "0"; + String model = (categoryModelNames != null && i < categoryModelNames.size()) ? categoryModelNames.get(i) + : ""; + + Integer cid = null; + try { + if (cidStr != null && !cidStr.trim().isEmpty()) { + cid = Integer.parseInt(cidStr.trim()); + } + } catch (Exception ignored) { + } + + Integer qty = null; + try { + if (qtyStr != null && !qtyStr.trim().isEmpty()) { + qty = Integer.parseInt(qtyStr.trim()); + } + } catch (Exception ignored) { + } + + if (cid == null || cid <= 0) { + response.put("success", false); + response.put("error", "Please select a valid Asset Category for all items."); + return response; + } + + if (qty == null || qty <= 0) { + response.put("success", false); + response.put("error", "Category Quantity must be greater than 0 for all items."); + return response; + } + + if (model == null || model.trim().isEmpty()) { + response.put("success", false); + response.put("error", "Asset Model Name / Specifications is mandatory for all items."); + return response; + } + + Map item = new HashMap<>(); + item.put("cid", cid); + item.put("categoryQty", qty); + item.put("categoryModelName", model.trim()); + categoryItems.add(item); + } + + if (woCopyFile == null || woCopyFile.isEmpty()) { + response.put("success", false); + response.put("error", "Upload Work Order Copy (PDF / Doc) is mandatory."); + return response; + } + try { File uploadDir = new File(rentalUploadPathConfig).getAbsoluteFile(); - if (!uploadDir.exists()) uploadDir.mkdirs(); + if (!uploadDir.exists()) + uploadDir.mkdirs(); - String woCopyPath = null; - if (woCopyFile != null && !woCopyFile.isEmpty()) { - woCopyPath = saveUploadedFile(woCopyFile, "wo", uploadDir); - } + String woCopyPath = saveUploadedFile(woCopyFile, "wo", uploadDir); - boolean saved = rentalService.saveWorkOrder( + boolean saved = rentalService.saveWorkOrders( woFileNo, fileSubject, periodFromDate, periodToDate, vendorName, - systemsQty, systemsModel, printersQty, printersModel, - laptopsQty, laptopsModel, woCopyPath, remarks, username); + categoryItems, woCopyPath, remarks, username); if (saved) { response.put("success", true); - response.put("message", "Work order registered successfully."); + response.put("message", + "Work order registered successfully with " + categoryItems.size() + " category item(s)."); } else { response.put("success", false); response.put("error", "Failed to save work order to database."); @@ -241,9 +304,9 @@ public class RentalController { @RequestParam("tapalDate") String tapalDate, @RequestParam("deptId") Integer deptId, @RequestParam(value = "zoneId", required = false) Integer zoneId, - @RequestParam(value = "reqSystemsQty", defaultValue = "0") Integer reqSystemsQty, - @RequestParam(value = "reqPrintersQty", defaultValue = "0") Integer reqPrintersQty, - @RequestParam(value = "reqLaptopsQty", defaultValue = "0") Integer reqLaptopsQty, + @RequestParam(value = "cid", required = false) List cids, + @RequestParam(value = "categoryQty", required = false) List categoryQtys, + @RequestParam(value = "categoryModelName", required = false) List categoryModelNames, @RequestParam("requiredFromDate") String requiredFromDate, @RequestParam("requiredToDate") String requiredToDate, @RequestParam(value = "mailCopyFile", required = false) MultipartFile mailCopyFile, @@ -261,24 +324,65 @@ public class RentalController { return response; } + if (cids == null || cids.isEmpty()) { + response.put("success", false); + response.put("error", "Please add at least one requested asset category."); + return response; + } + + List> categoryItems = new ArrayList<>(); + for (int i = 0; i < cids.size(); i++) { + Integer cid = cids.get(i); + Integer qty = (categoryQtys != null && i < categoryQtys.size()) ? categoryQtys.get(i) : 1; + String model = (categoryModelNames != null && i < categoryModelNames.size()) ? categoryModelNames.get(i) : ""; + + if (cid == null || cid <= 0) { + response.put("success", false); + response.put("error", "Please select a valid Requested Asset Category for all items."); + return response; + } + + if (qty == null || qty <= 0) { + response.put("success", false); + response.put("error", "Requested Category Quantity must be greater than 0 for all items."); + return response; + } + + if (model == null || model.trim().isEmpty()) { + response.put("success", false); + response.put("error", "Requested Model Name / Specifications is mandatory for all items."); + return response; + } + + Map item = new HashMap<>(); + item.put("cid", cid); + item.put("categoryQty", qty); + item.put("categoryModelName", model.trim()); + categoryItems.add(item); + } + + if (mailCopyFile == null || mailCopyFile.isEmpty()) { + response.put("success", false); + response.put("error", "Please upload the Mail Copy (PDF / Scan)."); + return response; + } + try { File uploadDir = new File(rentalUploadPathConfig).getAbsoluteFile(); - if (!uploadDir.exists()) uploadDir.mkdirs(); + if (!uploadDir.exists()) + uploadDir.mkdirs(); - String mailCopyPath = null; - if (mailCopyFile != null && !mailCopyFile.isEmpty()) { - mailCopyPath = saveUploadedFile(mailCopyFile, "request_mail", uploadDir); - } + String mailCopyPath = saveUploadedFile(mailCopyFile, "request_mail", uploadDir); - boolean saved = rentalService.saveUserRequest( + boolean saved = rentalService.saveUserRequests( tapalNo, tapalDate, deptId, zoneId, - reqSystemsQty, reqPrintersQty, reqLaptopsQty, + categoryItems, requiredFromDate, requiredToDate, mailCopyPath, reqStatusId, requestingOfficer, contactNo, purpose, username); if (saved) { response.put("success", true); - response.put("message", "Department request registered successfully."); + response.put("message", "Department request registered successfully with " + categoryItems.size() + " category item(s)."); } else { response.put("success", false); response.put("error", "Failed to save department request."); @@ -310,6 +414,8 @@ public class RentalController { @RequestParam(value = "inSystemsQty", defaultValue = "0") Integer inSystemsQty, @RequestParam(value = "inPrintersQty", defaultValue = "0") Integer inPrintersQty, @RequestParam(value = "inLaptopsQty", defaultValue = "0") Integer inLaptopsQty, + @RequestParam(value = "inUpsQty", defaultValue = "0") Integer inUpsQty, + @RequestParam(value = "inDongleQty", defaultValue = "0") Integer inDongleQty, @RequestParam(value = "dcFile", required = false) MultipartFile dcFile, @RequestParam(value = "vehicleNo", defaultValue = "") String vehicleNo, @RequestParam(value = "receivedBy", defaultValue = "") String receivedBy, @@ -326,7 +432,8 @@ public class RentalController { try { File uploadDir = new File(rentalUploadPathConfig).getAbsoluteFile(); - if (!uploadDir.exists()) uploadDir.mkdirs(); + if (!uploadDir.exists()) + uploadDir.mkdirs(); String dcFilePath = null; if (dcFile != null && !dcFile.isEmpty()) { @@ -335,7 +442,7 @@ public class RentalController { boolean saved = rentalService.saveInwardChallan( woId, dcNo, dcDate, vendorName, - inSystemsQty, inPrintersQty, inLaptopsQty, + inSystemsQty, inPrintersQty, inLaptopsQty, inUpsQty, inDongleQty, dcFilePath, vehicleNo, receivedBy, remarks, username); if (saved) { @@ -369,6 +476,10 @@ public class RentalController { @RequestParam(value = "inwardDcId", required = false) Integer inwardDcId, @RequestParam(value = "woId", required = false) Integer woId, @RequestParam("issuedDate") String issuedDate, + @RequestParam(value = "cid", required = false) List cids, + @RequestParam(value = "categoryModelName", required = false) List categoryModelNames, + @RequestParam(value = "requestedQty", required = false) List requestedQtys, + @RequestParam(value = "issuedQty", required = false) List issuedQtys, @RequestParam(value = "issuedSystemsQty", defaultValue = "0") Integer issuedSystemsQty, @RequestParam(value = "issuedPrintersQty", defaultValue = "0") Integer issuedPrintersQty, @RequestParam(value = "issuedLaptopsQty", defaultValue = "0") Integer issuedLaptopsQty, @@ -391,15 +502,57 @@ public class RentalController { try { File uploadDir = new File(rentalUploadPathConfig).getAbsoluteFile(); - if (!uploadDir.exists()) uploadDir.mkdirs(); + if (!uploadDir.exists()) + uploadDir.mkdirs(); - String stockCopyPath = null; - if (stockCopyFile != null && !stockCopyFile.isEmpty()) { - stockCopyPath = saveUploadedFile(stockCopyFile, "issue_stock", uploadDir); + if (stockCopyFile == null || stockCopyFile.isEmpty()) { + response.put("success", false); + response.put("error", "Upload Stock Issue Copy (Acknowledgment / Handover Slip) is mandatory."); + return response; + } + String stockCopyPath = saveUploadedFile(stockCopyFile, "issue_stock", uploadDir); + + List> itemDetails = new ArrayList<>(); + if (cids != null && !cids.isEmpty()) { + for (int i = 0; i < cids.size(); i++) { + String cidStr = cids.get(i); + Integer cid = null; + try { + if (cidStr != null && !cidStr.trim().isEmpty()) { + cid = Integer.parseInt(cidStr.trim()); + } + } catch (Exception ignored) { + } + + Integer reqQty = 0; + try { + if (requestedQtys != null && i < requestedQtys.size() && requestedQtys.get(i) != null) { + reqQty = Integer.parseInt(requestedQtys.get(i).trim()); + } + } catch (Exception ignored) { + } + + Integer issQty = 0; + try { + if (issuedQtys != null && i < issuedQtys.size() && issuedQtys.get(i) != null) { + issQty = Integer.parseInt(issuedQtys.get(i).trim()); + } + } catch (Exception ignored) { + } + + String model = (categoryModelNames != null && i < categoryModelNames.size()) ? categoryModelNames.get(i) : ""; + + Map item = new HashMap<>(); + item.put("cid", cid); + item.put("categoryModelName", model != null ? model.trim() : ""); + item.put("requestedQty", reqQty); + item.put("issuedQty", issQty); + itemDetails.add(item); + } } boolean saved = rentalService.saveIssuedDetails( - requestId, inwardDcId, woId, issuedDate, + requestId, inwardDcId, woId, itemDetails, issuedDate, issuedSystemsQty, issuedPrintersQty, issuedLaptopsQty, assetSerialDetails, issuedFromDate, issuedToDate, stockCopyPath, custodianOfficer, contactNo, issuedBy, username); @@ -455,7 +608,8 @@ public class RentalController { try { File uploadDir = new File(rentalUploadPathConfig).getAbsoluteFile(); - if (!uploadDir.exists()) uploadDir.mkdirs(); + if (!uploadDir.exists()) + uploadDir.mkdirs(); String stockCopyPath = null; if (stockCopyFile != null && !stockCopyFile.isEmpty()) { diff --git a/src/main/java/com/gcc_manpower/gccrentalmanagement/service/RentalService.java b/src/main/java/com/gcc_manpower/gccrentalmanagement/service/RentalService.java index f12289f..4f4a23a 100644 --- a/src/main/java/com/gcc_manpower/gccrentalmanagement/service/RentalService.java +++ b/src/main/java/com/gcc_manpower/gccrentalmanagement/service/RentalService.java @@ -27,16 +27,58 @@ public class RentalService { @Autowired public void setDataSource(@Qualifier("mysqlItcellManagementDataSource") DataSource dataSource) { this.jdbcTemplate = new JdbcTemplate(dataSource); - } - public JdbcTemplate getJdbcTemplate() { - return this.jdbcTemplate; } // ========================================================================= - // 1. MASTER LOOKUPS (Departments, Zones, Vendors, Master Statuses) + // 1. MASTER LOOKUPS (Categories, Departments, Zones, Vendors, Master Statuses) // ========================================================================= + public List> getActiveCategories() { + String sql = "SELECT id, category_type, category_type AS category_name, order_by, is_active " + + "FROM rental_category_master " + + "WHERE (is_active IS NULL OR is_active = 1) AND (is_delete IS NULL OR is_delete = 0) " + + "ORDER BY COALESCE(order_by, id) ASC, id ASC"; + try { + return jdbcTemplate.queryForList(sql); + } catch (Exception e1) { + try { + return jdbcTemplate.queryForList( + "SELECT id, category_type, category_type AS category_name FROM rental_category_master WHERE (is_active IS NULL OR is_active = 1) AND (is_delete IS NULL OR is_delete = 0) ORDER BY id ASC"); + } catch (Exception e2) { + try { + return jdbcTemplate + .queryForList( + "SELECT id, category_type, category_type AS category_name FROM rental_category_master ORDER BY id ASC"); + } catch (Exception e3) { + try { + List> rows = jdbcTemplate + .queryForList("SELECT * FROM rental_category_master"); + List> result = new ArrayList<>(); + for (Map r : rows) { + Map map = new HashMap<>(); + map.put("id", r.get("id")); + Object catType = r.get("category_type") != null ? r.get("category_type") + : (r.get("category_name") != null ? r.get("category_name") + : (r.get("name") != null ? r.get("name") + : (r.get("category") != null ? r.get("category") + : (r.get("cat_name") != null ? r.get("cat_name") + : "Category " + r.get("id"))))); + String catStr = catType != null ? catType.toString() : "Category " + r.get("id"); + map.put("category_type", catStr); + map.put("category_name", catStr); + result.add(map); + } + return result; + } catch (Exception e4) { + e4.printStackTrace(); + return new ArrayList<>(); + } + } + } + } + } + public List> getActiveDepartments() { String sql = "SELECT id, dept_name FROM toner_department_list WHERE (is_active IS NULL OR is_active = 1) AND (is_delete IS NULL OR is_delete = 0) ORDER BY dept_name ASC"; try { @@ -110,43 +152,98 @@ public class RentalService { // ========================================================================= @Transactional - public boolean saveWorkOrder(String woFileNo, String fileSubject, String fromDate, String toDate, - String vendorName, Integer systemsQty, String systemsModel, - Integer printersQty, String printersModel, Integer laptopsQty, - String laptopsModel, String woCopyPath, String remarks, String updatedBy) { + public boolean saveWorkOrders(String woFileNo, String fileSubject, String fromDate, String toDate, + String vendorName, List> categoryItems, + String woCopyPath, String remarks, String updatedBy) { String sql = "INSERT INTO rental_workorder_register " + "(wo_file_no, file_subject, period_from_date, period_to_date, vendor_name, " + - "systems_qty, systems_model_name, printers_qty, printers_model_name, " + - "laptops_qty, laptops_model_name, wo_copy_file, status, remarks, created_by, is_active, is_delete) " + - "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'Active', ?, ?, 1, 0)"; + "cid, category_qty, category_model_name, wo_copy_file, status, remarks, created_by, is_active, is_delete) " + + + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, 'Active', ?, ?, 1, 0)"; try { - int rows = jdbcTemplate.update(sql, - woFileNo != null ? woFileNo.trim() : null, - fileSubject != null ? fileSubject.trim() : null, - fromDate, toDate, - vendorName != null ? vendorName.trim() : null, - systemsQty != null ? systemsQty : 0, - systemsModel != null ? systemsModel.trim() : "", - printersQty != null ? printersQty : 0, - printersModel != null ? printersModel.trim() : "", - laptopsQty != null ? laptopsQty : 0, - laptopsModel != null ? laptopsModel.trim() : "", - woCopyPath, remarks, updatedBy); - return rows > 0; + if (categoryItems == null || categoryItems.isEmpty()) { + return false; + } + for (Map item : categoryItems) { + Integer cid = item.get("cid") != null ? Integer.valueOf(item.get("cid").toString()) : null; + Integer qty = item.get("categoryQty") != null ? Integer.valueOf(item.get("categoryQty").toString()) : 0; + String model = item.get("categoryModelName") != null ? item.get("categoryModelName").toString() : ""; + jdbcTemplate.update(sql, + woFileNo != null ? woFileNo.trim() : null, + fileSubject != null ? fileSubject.trim() : null, + fromDate, toDate, + vendorName != null ? vendorName.trim() : null, + cid, + qty, + model != null ? model.trim() : "", + woCopyPath, remarks, updatedBy); + } + return true; } catch (Exception e) { + String msg = e.getMessage() != null ? e.getMessage().toLowerCase() : ""; + if (msg.contains("idx_wo_file_no") || msg.contains("duplicate entry") || msg.contains("constraint")) { + try { + for (Map item : categoryItems) { + Integer cid = item.get("cid") != null ? Integer.valueOf(item.get("cid").toString()) : null; + Integer qty = item.get("categoryQty") != null + ? Integer.valueOf(item.get("categoryQty").toString()) + : 0; + String model = item.get("categoryModelName") != null ? item.get("categoryModelName").toString() + : ""; + jdbcTemplate.update(sql, + woFileNo != null ? woFileNo.trim() : null, + fileSubject != null ? fileSubject.trim() : null, + fromDate, toDate, + vendorName != null ? vendorName.trim() : null, + cid, + qty, + model != null ? model.trim() : "", + woCopyPath, remarks, updatedBy); + } + return true; + } catch (Exception retryEx) { + retryEx.printStackTrace(); + } + } e.printStackTrace(); return false; } } + @Transactional + public boolean saveWorkOrder(String woFileNo, String fileSubject, String fromDate, String toDate, + String vendorName, Integer cid, Integer categoryQty, String categoryModelName, + String woCopyPath, String remarks, String updatedBy) { + List> list = new ArrayList<>(); + Map map = new HashMap<>(); + map.put("cid", cid); + map.put("categoryQty", categoryQty); + map.put("categoryModelName", categoryModelName); + list.add(map); + return saveWorkOrders(woFileNo, fileSubject, fromDate, toDate, vendorName, list, woCopyPath, remarks, + updatedBy); + } + public List> getAllWorkOrders() { - String sql = "SELECT id, wo_file_no, file_subject, period_from_date, period_to_date, vendor_name, " + - "systems_qty, systems_model_name, printers_qty, printers_model_name, " + - "laptops_qty, laptops_model_name, (systems_qty + printers_qty + laptops_qty) AS total_units, " + - "wo_copy_file, status, remarks, created_by, created_at " + - "FROM rental_workorder_register " + - "WHERE (is_active IS NULL OR is_active = 1) AND (is_delete IS NULL OR is_delete = 0) " + - "ORDER BY id DESC"; + String sql = "SELECT w.id, w.wo_file_no, w.file_subject, w.period_from_date, w.period_to_date, w.vendor_name, " + + + "w.cid, COALESCE(c.category_type, 'General') AS category_name, c.category_type, " + + "w.category_qty, w.category_model_name, " + + "COALESCE(w.category_qty, 0) AS total_units, " + + "COALESCE(dc.inwarded_qty, 0) AS total_inwarded_qty, " + + "w.wo_copy_file, w.status, w.remarks, w.created_by, w.created_at " + + "FROM rental_workorder_register w " + + "LEFT JOIN rental_category_master c ON w.cid = c.id " + + "LEFT JOIN (" + + " SELECT wo_id, " + + " SUM(COALESCE(inward_systems_qty, 0) + COALESCE(inward_printers_qty, 0) + COALESCE(inward_laptops_qty, 0) + COALESCE(inward_ups_qty, 0) + COALESCE(inward_dongle_qty, 0)) AS inwarded_qty " + + + " FROM rental_inward_delivery_challan " + + " WHERE (is_active IS NULL OR is_active = 1) AND (is_delete IS NULL OR is_delete = 0) " + + " GROUP BY wo_id" + + ") dc ON w.id = dc.wo_id " + + "WHERE (w.is_active IS NULL OR w.is_active = 1) AND (w.is_delete IS NULL OR w.is_delete = 0) " + + "ORDER BY w.id DESC"; try { return jdbcTemplate.queryForList(sql); } catch (Exception e) { @@ -155,7 +252,24 @@ public class RentalService { } public Map getWorkOrderById(int id) { - String sql = "SELECT * FROM rental_workorder_register WHERE id = ?"; + String sql = "SELECT w.id, w.wo_file_no, w.file_subject, w.period_from_date, w.period_to_date, w.vendor_name, " + + + "w.cid, COALESCE(c.category_type, 'General') AS category_name, c.category_type, " + + "w.category_qty, w.category_model_name, " + + "COALESCE(w.category_qty, 0) AS total_units, " + + "COALESCE(dc.inwarded_qty, 0) AS total_inwarded_qty, " + + "w.wo_copy_file, w.status, w.remarks, w.created_by, w.created_at " + + "FROM rental_workorder_register w " + + "LEFT JOIN rental_category_master c ON w.cid = c.id " + + "LEFT JOIN (" + + " SELECT wo_id, " + + " SUM(COALESCE(inward_systems_qty, 0) + COALESCE(inward_printers_qty, 0) + COALESCE(inward_laptops_qty, 0) + COALESCE(inward_ups_qty, 0) + COALESCE(inward_dongle_qty, 0)) AS inwarded_qty " + + + " FROM rental_inward_delivery_challan " + + " WHERE (is_active IS NULL OR is_active = 1) AND (is_delete IS NULL OR is_delete = 0) " + + " GROUP BY wo_id" + + ") dc ON w.id = dc.wo_id " + + "WHERE w.id = ?"; try { return jdbcTemplate.queryForMap(sql, id); } catch (Exception e) { @@ -168,8 +282,8 @@ public class RentalService { // ========================================================================= @Transactional - public boolean saveUserRequest(String tapalNo, String tapalDate, Integer deptId, Integer zoneId, - Integer reqSystemsQty, Integer reqPrintersQty, Integer reqLaptopsQty, + public boolean saveUserRequests(String tapalNo, String tapalDate, Integer deptId, Integer zoneId, + List> categoryItems, String fromDate, String toDate, String mailCopyPath, Integer statusId, String requestingOfficer, String contactNo, String purpose, String updatedBy) { @@ -178,42 +292,96 @@ public class RentalService { String sql = "INSERT INTO rental_user_request " + "(tapal_no, tapal_date, department_id, zone_id, " + - "req_systems_qty, req_printers_qty, req_laptops_qty, " + "required_from_date, required_to_date, calculated_days, " + + "cid, category_qty, category_model_name, " + "mail_copy_file, req_status_id, requesting_officer, contact_no, purpose, " + "created_by, is_active, is_delete) " + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, 0)"; try { - int rows = jdbcTemplate.update(sql, - tapalNo != null ? tapalNo.trim() : null, - tapalDate, - deptId, zoneId, - reqSystemsQty != null ? reqSystemsQty : 0, - reqPrintersQty != null ? reqPrintersQty : 0, - reqLaptopsQty != null ? reqLaptopsQty : 0, - fromDate, toDate, calculatedDays, - mailCopyPath, finalStatusId, - requestingOfficer != null ? requestingOfficer.trim() : null, - contactNo != null ? contactNo.trim() : null, - purpose, updatedBy); - return rows > 0; + for (Map item : categoryItems) { + Integer cid = item.get("cid") != null ? Integer.valueOf(item.get("cid").toString()) : null; + Integer qty = item.get("categoryQty") != null ? Integer.valueOf(item.get("categoryQty").toString()) : 0; + String model = item.get("categoryModelName") != null ? item.get("categoryModelName").toString() : ""; + + jdbcTemplate.update(sql, + tapalNo != null ? tapalNo.trim() : null, + tapalDate, + deptId, zoneId, + fromDate, toDate, calculatedDays, + cid, + qty, + model != null ? model.trim() : "", + mailCopyPath, finalStatusId, + requestingOfficer != null ? requestingOfficer.trim() : null, + contactNo != null ? contactNo.trim() : null, + purpose, updatedBy); + } + return true; } catch (Exception e) { + String msg = e.getMessage() != null ? e.getMessage().toLowerCase() : ""; + if (msg.contains("idx_tapal_no") || msg.contains("duplicate entry") || msg.contains("constraint")) { + try { + for (Map item : categoryItems) { + Integer cid = item.get("cid") != null ? Integer.valueOf(item.get("cid").toString()) : null; + Integer qty = item.get("categoryQty") != null + ? Integer.valueOf(item.get("categoryQty").toString()) + : 0; + String model = item.get("categoryModelName") != null ? item.get("categoryModelName").toString() + : ""; + + jdbcTemplate.update(sql, + tapalNo != null ? tapalNo.trim() : null, + tapalDate, + deptId, zoneId, + fromDate, toDate, calculatedDays, + cid, + qty, + model != null ? model.trim() : "", + mailCopyPath, finalStatusId, + requestingOfficer != null ? requestingOfficer.trim() : null, + contactNo != null ? contactNo.trim() : null, + purpose, updatedBy); + } + return true; + } catch (Exception retryEx) { + retryEx.printStackTrace(); + } + } e.printStackTrace(); return false; } } + @Transactional + public boolean saveUserRequest(String tapalNo, String tapalDate, Integer deptId, Integer zoneId, + Integer cid, Integer categoryQty, String categoryModelName, + String fromDate, String toDate, String mailCopyPath, Integer statusId, + String requestingOfficer, String contactNo, String purpose, String updatedBy) { + List> list = new ArrayList<>(); + Map map = new HashMap<>(); + map.put("cid", cid); + map.put("categoryQty", categoryQty); + map.put("categoryModelName", categoryModelName); + list.add(map); + return saveUserRequests(tapalNo, tapalDate, deptId, zoneId, list, fromDate, toDate, mailCopyPath, statusId, + requestingOfficer, contactNo, purpose, updatedBy); + } + public List> getAllUserRequests() { String sql = "SELECT r.id, r.tapal_no, r.tapal_date, r.department_id, d.dept_name, " + - "r.zone_id, z.zone_name, r.req_systems_qty, r.req_printers_qty, r.req_laptops_qty, " + - "(r.req_systems_qty + r.req_printers_qty + r.req_laptops_qty) AS total_req_qty, " + - "r.required_from_date, r.required_to_date, r.calculated_days, r.mail_copy_file, " + + "r.zone_id, z.zone_name, " + + "r.required_from_date, r.required_to_date, r.calculated_days, " + + "r.cid, COALESCE(c.category_type, 'General') AS category_name, c.category_type, " + + "r.category_qty, r.category_model_name, " + + "COALESCE(r.category_qty, 0) AS total_req_qty, " + + "r.mail_copy_file, " + "r.req_status_id, COALESCE(s.status_name, 'Pending') AS status_name, " + "COALESCE(s.badge_color, 'warning') AS badge_color, " + "r.requesting_officer, r.contact_no, r.purpose, r.created_by, r.created_at " + "FROM rental_user_request r " + "LEFT JOIN toner_department_list d ON r.department_id = d.id " + "LEFT JOIN toner_zone_list z ON r.zone_id = z.id " + + "LEFT JOIN rental_category_master c ON r.cid = c.id " + "LEFT JOIN rental_master_status_list s ON r.req_status_id = s.id " + "WHERE (r.is_active IS NULL OR r.is_active = 1) AND (r.is_delete IS NULL OR r.is_delete = 0) " + "ORDER BY r.id DESC"; @@ -241,13 +409,14 @@ public class RentalService { @Transactional public boolean saveInwardChallan(Integer woId, String dcNo, String dcDate, String vendorName, Integer inSystemsQty, Integer inPrintersQty, Integer inLaptopsQty, + Integer inUpsQty, Integer inDongleQty, String dcFilePath, String vehicleNo, String receivedBy, String remarks, String updatedBy) { String sql = "INSERT INTO rental_inward_delivery_challan " + "(wo_id, dc_no, dc_date, vendor_name, " + - "inward_systems_qty, inward_printers_qty, inward_laptops_qty, " + + "inward_systems_qty, inward_printers_qty, inward_laptops_qty, inward_ups_qty, inward_dongle_qty, " + "dc_file_path, vehicle_no, received_by, remarks, created_by, is_active, is_delete) " + - "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, 0)"; + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, 0)"; try { int rows = jdbcTemplate.update(sql, woId, @@ -257,6 +426,8 @@ public class RentalService { inSystemsQty != null ? inSystemsQty : 0, inPrintersQty != null ? inPrintersQty : 0, inLaptopsQty != null ? inLaptopsQty : 0, + inUpsQty != null ? inUpsQty : 0, + inDongleQty != null ? inDongleQty : 0, dcFilePath, vehicleNo != null ? vehicleNo.trim() : null, receivedBy != null ? receivedBy.trim() : null, @@ -268,11 +439,23 @@ public class RentalService { } } + public boolean saveInwardChallan(Integer woId, String dcNo, String dcDate, String vendorName, + Integer inSystemsQty, Integer inPrintersQty, Integer inLaptopsQty, + String dcFilePath, String vehicleNo, String receivedBy, + String remarks, String updatedBy) { + return saveInwardChallan(woId, dcNo, dcDate, vendorName, inSystemsQty, inPrintersQty, inLaptopsQty, 0, 0, + dcFilePath, vehicleNo, receivedBy, remarks, updatedBy); + } + public List> getAllInwardChallans() { String sql = "SELECT c.id, c.wo_id, w.wo_file_no, w.file_subject, c.dc_no, c.dc_date, " + "COALESCE(c.vendor_name, w.vendor_name) AS vendor_name, " + - "c.inward_systems_qty, c.inward_printers_qty, c.inward_laptops_qty, " + - "(c.inward_systems_qty + c.inward_printers_qty + c.inward_laptops_qty) AS total_inward_qty, " + + "COALESCE(c.inward_systems_qty, 0) AS inward_systems_qty, " + + "COALESCE(c.inward_printers_qty, 0) AS inward_printers_qty, " + + "COALESCE(c.inward_laptops_qty, 0) AS inward_laptops_qty, " + + "COALESCE(c.inward_ups_qty, 0) AS inward_ups_qty, " + + "COALESCE(c.inward_dongle_qty, 0) AS inward_dongle_qty, " + + "(COALESCE(c.inward_systems_qty, 0) + COALESCE(c.inward_printers_qty, 0) + COALESCE(c.inward_laptops_qty, 0) + COALESCE(c.inward_ups_qty, 0) + COALESCE(c.inward_dongle_qty, 0)) AS total_inward_qty, " + "c.dc_file_path, c.vehicle_no, c.received_by, c.remarks, c.created_by, c.created_at " + "FROM rental_inward_delivery_challan c " + "LEFT JOIN rental_workorder_register w ON c.wo_id = w.id " + @@ -291,6 +474,7 @@ public class RentalService { @Transactional public boolean saveIssuedDetails(Integer requestId, Integer inwardDcId, Integer woId, + List> itemDetails, String issuedDate, Integer issuedSystemsQty, Integer issuedPrintersQty, Integer issuedLaptopsQty, String assetSerialDetails, String issuedFromDate, String issuedToDate, String stockCopyPath, @@ -299,28 +483,58 @@ public class RentalService { int periodDays = calculateDaysBetween(issuedFromDate, issuedToDate); String sql = "INSERT INTO rental_issued_details " + - "(request_id, inward_dc_id, wo_id, issued_date, " + - "issued_systems_qty, issued_printers_qty, issued_laptops_qty, " + + "(request_id, inward_dc_id, wo_id, cid, category_model_name, requested_qty, issued_qty, " + + "issued_date, issued_systems_qty, issued_printers_qty, issued_laptops_qty, " + "asset_serial_details, issued_from_date, issued_to_date, issued_period_days, " + "stock_copy_path, custodian_officer, contact_no, issued_by, status, " + "created_by, is_active, is_delete) " + - "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'Issued', ?, 1, 0)"; + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'Issued', ?, 1, 0)"; try { - int rows = jdbcTemplate.update(sql, - requestId, inwardDcId, woId, issuedDate, - issuedSystemsQty != null ? issuedSystemsQty : 0, - issuedPrintersQty != null ? issuedPrintersQty : 0, - issuedLaptopsQty != null ? issuedLaptopsQty : 0, - assetSerialDetails, issuedFromDate, issuedToDate, periodDays, - stockCopyPath, - custodianOfficer != null ? custodianOfficer.trim() : null, - contactNo != null ? contactNo.trim() : null, - issuedBy != null ? issuedBy.trim() : null, - updatedBy); + int rows = 0; + if (itemDetails != null && !itemDetails.isEmpty()) { + for (Map it : itemDetails) { + Integer cid = it.get("cid") != null && !it.get("cid").toString().trim().isEmpty() + ? Integer.valueOf(it.get("cid").toString().trim()) : null; + String model = it.get("categoryModelName") != null ? it.get("categoryModelName").toString().trim() : ""; + Integer reqQty = it.get("requestedQty") != null ? Integer.valueOf(it.get("requestedQty").toString()) : 0; + Integer issQty = it.get("issuedQty") != null ? Integer.valueOf(it.get("issuedQty").toString()) : 0; + + rows += jdbcTemplate.update(sql, + requestId, inwardDcId, woId, cid, model, reqQty, issQty, + issuedDate, + issQty, 0, 0, + assetSerialDetails, issuedFromDate, issuedToDate, periodDays, + stockCopyPath, + custodianOfficer != null ? custodianOfficer.trim() : null, + contactNo != null ? contactNo.trim() : null, + issuedBy != null ? issuedBy.trim() : null, + updatedBy); + } + } else { + rows = jdbcTemplate.update(sql, + requestId, inwardDcId, woId, null, "", 0, + (issuedSystemsQty != null ? issuedSystemsQty : 0) + (issuedPrintersQty != null ? issuedPrintersQty : 0) + (issuedLaptopsQty != null ? issuedLaptopsQty : 0), + issuedDate, + issuedSystemsQty != null ? issuedSystemsQty : 0, + issuedPrintersQty != null ? issuedPrintersQty : 0, + issuedLaptopsQty != null ? issuedLaptopsQty : 0, + assetSerialDetails, issuedFromDate, issuedToDate, periodDays, + stockCopyPath, + custodianOfficer != null ? custodianOfficer.trim() : null, + contactNo != null ? contactNo.trim() : null, + issuedBy != null ? issuedBy.trim() : null, + updatedBy); + } if (rows > 0 && requestId != null) { - // Automatically update request status to 'Issued' (status_id = 3) - jdbcTemplate.update("UPDATE rental_user_request SET req_status_id = 3 WHERE id = ?", requestId); + // Automatically update request status to 'Issued' (status_id = 3) for all items under this tapal_no + try { + jdbcTemplate.update( + "UPDATE rental_user_request SET req_status_id = 3 WHERE tapal_no = (SELECT tapal_no FROM (SELECT tapal_no FROM rental_user_request WHERE id = ?) t) OR id = ?", + requestId, requestId); + } catch (Exception eStatus) { + jdbcTemplate.update("UPDATE rental_user_request SET req_status_id = 3 WHERE id = ?", requestId); + } } return rows > 0; } catch (Exception e) { @@ -329,11 +543,26 @@ public class RentalService { } } + @Transactional + public boolean saveIssuedDetails(Integer requestId, Integer inwardDcId, Integer woId, + String issuedDate, Integer issuedSystemsQty, Integer issuedPrintersQty, + Integer issuedLaptopsQty, String assetSerialDetails, + String issuedFromDate, String issuedToDate, String stockCopyPath, + String custodianOfficer, String contactNo, String issuedBy, String updatedBy) { + return saveIssuedDetails(requestId, inwardDcId, woId, null, issuedDate, issuedSystemsQty, issuedPrintersQty, + issuedLaptopsQty, assetSerialDetails, issuedFromDate, issuedToDate, stockCopyPath, + custodianOfficer, contactNo, issuedBy, updatedBy); + } + public List> getAllIssuedDetails() { String sql = "SELECT i.id, i.request_id, r.tapal_no, d.dept_name, z.zone_name, " + "i.inward_dc_id, dc.dc_no, i.wo_id, w.wo_file_no, i.issued_date, " + + "i.cid, COALESCE(cat.category_type, 'General') AS category_name, " + + "COALESCE(i.category_model_name, r.category_model_name, '-') AS category_model_name, " + + "COALESCE(i.requested_qty, r.category_qty, 0) AS requested_qty, " + + "COALESCE(NULLIF(i.issued_qty, 0), (i.issued_systems_qty + i.issued_printers_qty + i.issued_laptops_qty)) AS issued_qty, " + "i.issued_systems_qty, i.issued_printers_qty, i.issued_laptops_qty, " + - "(i.issued_systems_qty + i.issued_printers_qty + i.issued_laptops_qty) AS total_issued_qty, " + + "COALESCE(NULLIF(i.issued_qty, 0), (i.issued_systems_qty + i.issued_printers_qty + i.issued_laptops_qty)) AS total_issued_qty, " + "i.asset_serial_details, i.issued_from_date, i.issued_to_date, i.issued_period_days, " + "i.stock_copy_path, i.custodian_officer, i.contact_no, i.issued_by, i.status, " + "i.created_by, i.created_at, " + @@ -342,6 +571,7 @@ public class RentalService { "LEFT JOIN rental_user_request r ON i.request_id = r.id " + "LEFT JOIN toner_department_list d ON r.department_id = d.id " + "LEFT JOIN toner_zone_list z ON r.zone_id = z.id " + + "LEFT JOIN rental_category_master cat ON (i.cid = cat.id OR (i.cid IS NULL AND r.cid = cat.id)) " + "LEFT JOIN rental_inward_delivery_challan dc ON i.inward_dc_id = dc.id " + "LEFT JOIN rental_workorder_register w ON i.wo_id = w.id " + "LEFT JOIN (SELECT issue_id, SUM(returned_systems_qty + returned_printers_qty + returned_laptops_qty) AS total_returned_qty " diff --git a/src/main/java/com/gcc_manpower/gcctonermanagement/controller/TonerController.java b/src/main/java/com/gcc_manpower/gcctonermanagement/controller/TonerController.java index e43c098..57bdc38 100644 --- a/src/main/java/com/gcc_manpower/gcctonermanagement/controller/TonerController.java +++ b/src/main/java/com/gcc_manpower/gcctonermanagement/controller/TonerController.java @@ -69,6 +69,24 @@ public class TonerController { return "gcctonermanagement/upload"; } + @GetMapping("/details") + public String viewDetails(Model model, HttpSession session) { + String username = (String) session.getAttribute("toner_usrName"); + if (username == null) { + return "redirect:/gcctonermanagement/login"; + } + + String usrRole = (String) session.getAttribute("toner_usrRole"); + boolean isAdmin = "ADMIN".equalsIgnoreCase(usrRole); + + model.addAttribute("isLoggedIn", true); + model.addAttribute("isAdmin", isAdmin); + model.addAttribute("usrName", username); + model.addAttribute("curPage", "gcctonermanagement"); + + return "gcctonermanagement/details"; + } + @GetMapping("/login") public String login(HttpSession session) { return "gcctonermanagement/login"; @@ -102,6 +120,8 @@ public class TonerController { session.setMaxInactiveInterval(1800); // 30 minutes session timeout response.put("result", true); response.put("usrName", usrName); + response.put("usrRole", role); + response.put("isAdmin", "ADMIN".equalsIgnoreCase(role)); } catch (AuthenticationException e) { response.put("result", false); response.put("error", e.getMessage() != null ? e.getMessage() : "Invalid username or password!"); @@ -190,6 +210,18 @@ public class TonerController { if (updatedBy == null) updatedBy = username; + if (dcNo == null || dcNo.trim().isEmpty()) { + response.put("success", false); + response.put("error", "Delivery Challan (DC) Number is required."); + return response; + } + + if (dcDate == null || dcDate.trim().isEmpty()) { + response.put("success", false); + response.put("error", "Delivery Challan (DC) Date is required."); + return response; + } + if (dcFile == null || dcFile.isEmpty()) { response.put("success", false); response.put("error", "Delivery Challan (DC) PDF file is required."); @@ -240,6 +272,146 @@ public class TonerController { return response; } + @PostMapping("/api/inward/update-dc") + @ResponseBody + public Map updateInwardDc( + @RequestParam("ids") String idsStr, + @RequestParam("dcNo") String dcNo, + @RequestParam("dcDate") String dcDate, + @RequestParam(value = "dcFile", required = false) MultipartFile dcFile, + HttpSession session) { + + Map response = new HashMap<>(); + String username = (String) session.getAttribute("toner_usrName"); + if (username == null) { + response.put("success", false); + response.put("error", "Unauthorized access. Please log in."); + return response; + } + + String updatedBy = appUserService.getUserIdByName(username); + if (updatedBy == null) + updatedBy = username; + + if (idsStr == null || idsStr.trim().isEmpty()) { + response.put("success", false); + response.put("error", "Record IDs are required."); + return response; + } + + if (dcNo == null || dcNo.trim().isEmpty()) { + response.put("success", false); + response.put("error", "Delivery Challan (DC) Number is required."); + return response; + } + + if (dcDate == null || dcDate.trim().isEmpty()) { + response.put("success", false); + response.put("error", "Delivery Challan (DC) Date is required."); + return response; + } + + if (dcFile != null && !dcFile.isEmpty() && !isPdfFile(dcFile)) { + response.put("success", false); + response.put("error", "Delivery Challan file must be a PDF."); + return response; + } + + try { + List ids = java.util.Arrays.stream(idsStr.split(",")) + .map(String::trim) + .filter(s -> !s.isEmpty()) + .map(Integer::parseInt) + .collect(java.util.stream.Collectors.toList()); + + if (ids.isEmpty()) { + response.put("success", false); + response.put("error", "No valid record IDs provided."); + return response; + } + + File uploadDir = new File(tonerUploadPathConfig).getAbsoluteFile(); + if (!uploadDir.exists()) { + uploadDir.mkdirs(); + } + + String dcPath = null; + if (dcFile != null && !dcFile.isEmpty()) { + dcPath = saveUploadedFile(dcFile, "dc", uploadDir); + } + + boolean updated = tonerService.updateInwardDc(ids, dcNo.trim(), dcDate.trim(), dcPath, updatedBy); + if (updated) { + response.put("success", true); + response.put("message", "Delivery Challan details updated successfully."); + } else { + if (dcPath != null) { + deleteFileIfExists(dcPath, uploadDir); + } + response.put("success", false); + response.put("error", "Failed to update Delivery Challan details in the database."); + } + } catch (Exception e) { + response.put("success", false); + response.put("error", "An error occurred: " + e.getMessage()); + e.printStackTrace(); + } + return response; + } + + @PostMapping("/api/inward/delete-dc") + @ResponseBody + public Map deleteInwardDc( + @RequestParam("ids") String idsStr, + HttpSession session) { + + Map response = new HashMap<>(); + String username = (String) session.getAttribute("toner_usrName"); + if (username == null) { + response.put("success", false); + response.put("error", "Unauthorized access. Please log in."); + return response; + } + + String updatedBy = appUserService.getUserIdByName(username); + if (updatedBy == null) + updatedBy = username; + + if (idsStr == null || idsStr.trim().isEmpty()) { + response.put("success", false); + response.put("error", "Record IDs are required."); + return response; + } + + try { + List ids = java.util.Arrays.stream(idsStr.split(",")) + .map(String::trim) + .filter(s -> !s.isEmpty()) + .map(Integer::parseInt) + .collect(java.util.stream.Collectors.toList()); + + if (ids.isEmpty()) { + response.put("success", false); + response.put("error", "No valid record IDs provided."); + return response; + } + + boolean deleted = tonerService.deleteInwardDc(ids, updatedBy); + if (deleted) { + response.put("success", true); + response.put("message", "Delivery Challan and inward stock entry deleted successfully."); + } else { + response.put("success", false); + response.put("error", "Failed to delete Delivery Challan details from database."); + } + } catch (Exception e) { + response.put("success", false); + response.put("error", "An error occurred: " + e.getMessage()); + e.printStackTrace(); + } + return response; + } + @PostMapping("/api/request") @ResponseBody public Map uploadRequest( diff --git a/src/main/java/com/gcc_manpower/gcctonermanagement/service/TonerService.java b/src/main/java/com/gcc_manpower/gcctonermanagement/service/TonerService.java index 21d3028..176425c 100644 --- a/src/main/java/com/gcc_manpower/gcctonermanagement/service/TonerService.java +++ b/src/main/java/com/gcc_manpower/gcctonermanagement/service/TonerService.java @@ -66,10 +66,16 @@ public class TonerService { Map map = new HashMap<>(); try { List> list = jdbcTemplate.queryForList( - "SELECT id, part_code FROM toner_model_list WHERE (is_active IS NULL OR is_active = 1) AND (is_delete IS NULL OR is_delete = 0)"); + "SELECT id, model_name, part_code FROM toner_model_list WHERE (is_delete IS NULL OR is_delete = 0)"); for (Map row : list) { - if (row.get("id") != null && row.get("part_code") != null) { - map.put(String.valueOf(row.get("id")).trim(), String.valueOf(row.get("part_code")).trim()); + String code = row.get("part_code") != null ? String.valueOf(row.get("part_code")).trim() : ""; + if (!code.isEmpty() && !"null".equalsIgnoreCase(code) && !"n/a".equalsIgnoreCase(code)) { + if (row.get("id") != null) { + map.put(String.valueOf(row.get("id")).trim(), code); + } + if (row.get("model_name") != null) { + map.put(String.valueOf(row.get("model_name")).trim().toLowerCase(), code); + } } } } catch (Exception ignored) { @@ -179,6 +185,25 @@ public class TonerService { return map; } + private Map getTotalWorkorderRegisteredMap() { + Map map = new HashMap<>(); + try { + List> list = jdbcTemplate.queryForList( + "SELECT pid, tid, SUM(CAST(qty_registered AS SIGNED)) AS total_qty FROM toner_workorder_printermodel_qty WHERE (is_active IS NULL OR is_active = 1) AND (is_delete IS NULL OR is_delete = 0) GROUP BY pid, tid"); + for (Map row : list) { + if (row.get("pid") != null && row.get("tid") != null) { + String pid = String.valueOf(row.get("pid")).trim(); + String tid = String.valueOf(row.get("tid")).trim(); + Integer qty = parseIntegerSafely(row.get("total_qty")); + map.put(pid + "_" + tid, qty != null ? qty : 0); + map.put(tid, map.getOrDefault(tid, 0) + (qty != null ? qty : 0)); + } + } + } catch (Exception ignored) { + } + return map; + } + private Map getInwardStockMap() { Map map = new HashMap<>(); try { @@ -620,6 +645,55 @@ public class TonerService { return saveInwardRegister(refNo, companyName, items, dcUpload, null, null, username); } + @Transactional + public boolean updateInwardDc(List ids, String dcNo, String dcDate, String newDcUpload, String updatedBy) { + if (ids == null || ids.isEmpty()) { + return false; + } + Timestamp now = new Timestamp(System.currentTimeMillis()); + String inSql = ids.stream().map(i -> "?").collect(java.util.stream.Collectors.joining(",")); + String finalDcNo = (dcNo != null && !dcNo.trim().isEmpty()) ? dcNo.trim() : null; + String finalDcDate = (dcDate != null && !dcDate.trim().isEmpty()) ? dcDate.trim() : null; + + if (newDcUpload != null && !newDcUpload.trim().isEmpty()) { + String sql = "UPDATE toner_stock_register_details SET dc_no = ?, dc_date = ?, dc_upload = ?, updated_date = ?, updated_by = ? WHERE id IN (" + inSql + ")"; + List params = new ArrayList<>(); + params.add(finalDcNo); + params.add(finalDcDate); + params.add(newDcUpload.trim()); + params.add(now); + params.add(updatedBy); + params.addAll(ids); + jdbcTemplate.update(sql, params.toArray()); + } else { + String sql = "UPDATE toner_stock_register_details SET dc_no = ?, dc_date = ?, updated_date = ?, updated_by = ? WHERE id IN (" + inSql + ")"; + List params = new ArrayList<>(); + params.add(finalDcNo); + params.add(finalDcDate); + params.add(now); + params.add(updatedBy); + params.addAll(ids); + jdbcTemplate.update(sql, params.toArray()); + } + return true; + } + + @Transactional + public boolean deleteInwardDc(List ids, String updatedBy) { + if (ids == null || ids.isEmpty()) { + return false; + } + Timestamp now = new Timestamp(System.currentTimeMillis()); + String inSql = ids.stream().map(i -> "?").collect(java.util.stream.Collectors.joining(",")); + String sql = "UPDATE toner_stock_register_details SET is_active = 0, is_delete = 1, updated_date = ?, updated_by = ? WHERE id IN (" + inSql + ")"; + List params = new ArrayList<>(); + params.add(now); + params.add(updatedBy); + params.addAll(ids); + jdbcTemplate.update(sql, params.toArray()); + return true; + } + public List> getInwardHistory() { try { String sql = "SELECT * FROM toner_stock_register_details WHERE (is_active IS NULL OR is_active = 1) AND (is_delete IS NULL OR is_delete = 0) ORDER BY id DESC"; @@ -630,6 +704,7 @@ public class TonerService { Map printerMap = getPrinterMap(); Map tonerMap = getTonerMap(); + Map partCodeMap = getTonerPartCodeMap(); Map userMap = getUserMap(); Map vendorMap = getVendorMap(); Map fileNumberMap = getWorkorderFileNumberMap(); @@ -651,9 +726,16 @@ public class TonerService { String companyName = raw.get("company_name") != null ? String.valueOf(raw.get("company_name")).trim() : ""; + String tonerModelName = tonerMap.getOrDefault(tid, tid); + String partCode = partCodeMap.get(tid); + if (partCode == null || partCode.isEmpty()) { + partCode = partCodeMap.get(tonerModelName != null ? tonerModelName.trim().toLowerCase() : ""); + } + Map row = new HashMap<>(raw); row.put("printer_name", printerMap.getOrDefault(pid, pid)); - row.put("model_name", tonerMap.getOrDefault(tid, tid)); + row.put("model_name", tonerModelName); + row.put("part_code", partCode != null && !partCode.isEmpty() ? partCode : "-"); row.put("order_by", userMap.getOrDefault(updatedBy, updatedBy)); row.put("file_number", fileNumberMap.getOrDefault(refNo, "")); row.put("vendor_name", vendorMap.getOrDefault(companyName, companyName)); @@ -837,6 +919,7 @@ public class TonerService { Map printerMap = getPrinterMap(); Map tonerMap = getTonerMap(); + Map partCodeMap = getTonerPartCodeMap(); Map deptMap = getDepartmentMap(); Map zoneMap = getZoneMap(); Map userMap = getUserMap(); @@ -853,8 +936,15 @@ public class TonerService { String requestDate = raw.get("request_date") != null ? String.valueOf(raw.get("request_date")).trim() : ""; + String tonerModelName = tonerMap.getOrDefault(tid, tid); + String partCode = partCodeMap.get(tid); + if (partCode == null || partCode.isEmpty()) { + partCode = partCodeMap.get(tonerModelName != null ? tonerModelName.trim().toLowerCase() : ""); + } + row.put("printer_name", printerMap.getOrDefault(pid, pid)); - row.put("model_name", tonerMap.getOrDefault(tid, tid)); + row.put("model_name", tonerModelName); + row.put("part_code", partCode != null && !partCode.isEmpty() ? partCode : "-"); row.put("dept_name", deptMap.getOrDefault(deptId, deptId)); row.put("zone_name", zoneMap.getOrDefault(zoneId, zoneId)); row.put("updated_by", userMap.getOrDefault(updatedBy, updatedBy)); @@ -906,6 +996,7 @@ public class TonerService { Map deptMap = getDepartmentMap(); Map zoneMap = getZoneMap(); Map availStockMap = getAvailableStockMap(); + Map totalWoMap = getTotalWorkorderRegisteredMap(); List> result = new ArrayList<>(); for (Map raw : list) { @@ -921,6 +1012,7 @@ public class TonerService { String pid = raw.get("pid") != null ? String.valueOf(raw.get("pid")).trim() : ""; String tid = raw.get("tid") != null ? String.valueOf(raw.get("tid")).trim() : ""; int availStock = availStockMap.getOrDefault(pid + "_" + tid, 0); + int woQty = totalWoMap.getOrDefault(pid + "_" + tid, totalWoMap.getOrDefault(tid, 0)); Map row = new HashMap<>(raw); String deptId = raw.get("dept_id") != null ? String.valueOf(raw.get("dept_id")).trim() : ""; @@ -932,6 +1024,8 @@ public class TonerService { row.put("dept_name", deptMap.getOrDefault(deptId, deptId)); row.put("zone_name", zoneMap.getOrDefault(zoneId, zoneId)); row.put("available_stock", availStock); + row.put("qty_workorder_registered", woQty); + row.put("workorder_qty", woQty); result.add(row); } @@ -1256,6 +1350,7 @@ public class TonerService { Map printerMap = getPrinterMap(); Map tonerMap = getTonerMap(); + Map partCodeMap = getTonerPartCodeMap(); Map vendorMap = getVendorMap(); Map fileNumberMap = getWorkorderFileNumberMap(); Map inStockMap = getInwardStockMap(); @@ -1275,8 +1370,15 @@ public class TonerService { String pid = raw.get("pid") != null ? String.valueOf(raw.get("pid")).trim() : ""; String tid = raw.get("tid") != null ? String.valueOf(raw.get("tid")).trim() : ""; + String tonerModelName = tonerMap.getOrDefault(tid, tid); + String partCode = partCodeMap.get(tid); + if (partCode == null || partCode.isEmpty()) { + partCode = partCodeMap.get(tonerModelName != null ? tonerModelName.trim().toLowerCase() : ""); + } + row.put("printer_name", printerMap.getOrDefault(pid, pid)); - row.put("model_name", tonerMap.getOrDefault(tid, tid)); + row.put("model_name", tonerModelName); + row.put("part_code", partCode != null && !partCode.isEmpty() ? partCode : "-"); row.put("vendor_name", vendorMap.getOrDefault(vendorId, vendorId)); row.put("vendor_id", vendorId); row.put("file_number", fileNumberMap.getOrDefault(cleanRef, "")); @@ -1300,6 +1402,7 @@ public class TonerService { Map printerMap = getPrinterMap(); Map tonerMap = getTonerMap(); + Map partCodeMap = getTonerPartCodeMap(); Map userMap = getUserMap(); Map vendorMap = getVendorMap(); Map fileNumberMap = getWorkorderFileNumberMap(); @@ -1339,8 +1442,15 @@ public class TonerService { row.put("file_number", fileNumberMap.getOrDefault(refNo, "")); } + String tonerModelName = tonerMap.getOrDefault(tid, tid); + String partCode = partCodeMap.get(tid); + if (partCode == null || partCode.isEmpty()) { + partCode = partCodeMap.get(tonerModelName != null ? tonerModelName.trim().toLowerCase() : ""); + } + row.put("printer_name", printerMap.getOrDefault(pid, pid)); - row.put("model_name", tonerMap.getOrDefault(tid, tid)); + row.put("model_name", tonerModelName); + row.put("part_code", partCode != null && !partCode.isEmpty() ? partCode : "-"); row.put("updated_by", userMap.getOrDefault(updatedBy, updatedBy)); row.put("vendor_name", vendorMap.getOrDefault(vendorStr, vendorStr)); row.put("total_qty_registered", raw.get("qty_registered")); @@ -1436,6 +1546,7 @@ public class TonerService { Map printerMap = getPrinterMap(); Map tonerMap = getTonerMap(); + Map partCodeMap = getTonerPartCodeMap(); Map userMap = getUserMap(); Map inByReqMap = getInwardStockByRequestMap(); @@ -1449,8 +1560,15 @@ public class TonerService { String updatedBy = raw.get("updated_by") != null ? String.valueOf(raw.get("updated_by")).trim() : ""; String mrId = raw.get("id") != null ? String.valueOf(raw.get("id")).trim() : ""; + String tonerModelName = tonerMap.getOrDefault(tid, tid); + String partCode = partCodeMap.get(tid); + if (partCode == null || partCode.isEmpty()) { + partCode = partCodeMap.get(tonerModelName != null ? tonerModelName.trim().toLowerCase() : ""); + } + row.put("printer_name", printerMap.getOrDefault(pid, pid)); - row.put("model_name", tonerMap.getOrDefault(tid, tid)); + row.put("model_name", tonerModelName); + row.put("part_code", partCode != null && !partCode.isEmpty() ? partCode : "-"); row.put("updated_by", userMap.getOrDefault(updatedBy, updatedBy)); row.put("qty_requested", raw.get("qty_registered")); row.put("qty_inward_received", @@ -1474,6 +1592,7 @@ public class TonerService { Map printerMap = getPrinterMap(); Map tonerMap = getTonerMap(); + Map partCodeMap = getTonerPartCodeMap(); Map userMap = getUserMap(); Map woRegisteredQtyMap = getWorkorderRegisteredQtyMap(); @@ -1486,8 +1605,15 @@ public class TonerService { String updatedBy = raw.get("updated_by") != null ? String.valueOf(raw.get("updated_by")).trim() : ""; String refNo = raw.get("ref_no") != null ? String.valueOf(raw.get("ref_no")).trim() : ""; + String tonerModelName = tonerMap.getOrDefault(tid, tid); + String partCode = partCodeMap.get(tid); + if (partCode == null || partCode.isEmpty()) { + partCode = partCodeMap.get(tonerModelName != null ? tonerModelName.trim().toLowerCase() : ""); + } + row.put("printer_name", printerMap.getOrDefault(pid, pid)); - row.put("model_name", tonerMap.getOrDefault(tid, tid)); + row.put("model_name", tonerModelName); + row.put("part_code", partCode != null && !partCode.isEmpty() ? partCode : "-"); row.put("order_by", userMap.getOrDefault(updatedBy, updatedBy)); row.put("qty_requested", raw.get("qty_registered")); diff --git a/src/main/resources/templates/gccadjustmentmanagement/dashboard.html b/src/main/resources/templates/gccadjustmentmanagement/dashboard.html index a4a8fc0..19e32d3 100644 --- a/src/main/resources/templates/gccadjustmentmanagement/dashboard.html +++ b/src/main/resources/templates/gccadjustmentmanagement/dashboard.html @@ -1979,6 +1979,13 @@ + + +
+ + +
@@ -4295,6 +4302,9 @@
File Remarks: ${escapeHtml(r.file_remark || 'No remarks provided.')}
+
+ Review Remarks: ${escapeHtml(r.review_remark || 'No review remarks provided.')} +

Document Checklist Lifecycle
@@ -4370,6 +4380,7 @@ document.getElementById('form-file-available-status').value = r.file_available_status || ''; document.getElementById('form-bal-amt').value = r.bal_amt || ''; document.getElementById('form-file-remark').value = r.file_remark || ''; + document.getElementById('form-review-remark').value = r.review_remark || ''; document.getElementById('form-file-data-num').value = r.file_data_num || ''; document.getElementById('form-pi-amt').value = r.pi_amt || ''; document.getElementById('form-pi-gen-date').value = r.pi_file_gen_date || ''; diff --git a/src/main/resources/templates/gccadjustmentmanagement/details.html b/src/main/resources/templates/gccadjustmentmanagement/details.html index de8e78e..d70e098 100644 --- a/src/main/resources/templates/gccadjustmentmanagement/details.html +++ b/src/main/resources/templates/gccadjustmentmanagement/details.html @@ -525,6 +525,7 @@ Days Flow Remarks + Review Remarks Updated Date Updated By Actions @@ -908,6 +909,13 @@ + + +
+ + +
@@ -1459,6 +1467,7 @@ document.getElementById('form-file-status').value = r.file_status_id || ''; document.getElementById('form-bal-amt').value = r.bal_amt || ''; document.getElementById('form-file-remark').value = r.file_remark || ''; + document.getElementById('form-review-remark').value = r.review_remark || ''; document.getElementById('form-file-data-num').value = r.file_data_num || ''; document.getElementById('form-pi-amt').value = r.pi_amt || ''; document.getElementById('form-pi-gen-date').value = r.pi_file_gen_date || ''; @@ -1769,7 +1778,7 @@ finalRecords = finalRecords.filter(r => { const fileNum = String(r.file_num || r.file_data_num || '').toLowerCase(); const advType = String(r.adv_type || '').toLowerCase(); - const remarks = String(r.file_remark || r.remarks || '').toLowerCase(); + const remarks = String(r.file_remark || r.review_remark || r.remarks || '').toLowerCase(); const fileStatus = String(r.file_status || '').toLowerCase(); return fileNum.includes(query) || advType.includes(query) || remarks.includes(query) || fileStatus.includes(query); }); @@ -2093,6 +2102,7 @@ ${daysFlowHtml} ${r.file_remark || '-'} + ${r.review_remark || '-'} ${formatDate(r.updated_date || r.cdate)} ${r.updated_by_name || r.updated_by || '-'} @@ -2359,10 +2369,14 @@
-
+

Remarks:

${fileObj.file_remark || '-'}

+
+

Review Remarks:

+

${fileObj.review_remark || '-'}

+
`; } @@ -2428,6 +2442,7 @@ 'TC Date': formatDateForExcel(r.tc_file_gen_date), 'Status': isAdjusted(r) ? 'Adjusted' : 'Pending', 'Remarks': r.file_remark || '', + 'Review Remarks': r.review_remark || '', 'Last Updated Date': formatDateForExcel(r.updated_date), 'PI File Path': r.pi_file_path || '', 'AS File Path': r.as_file_path || '', diff --git a/src/main/resources/templates/gccrentalmanagement/dashboard.html b/src/main/resources/templates/gccrentalmanagement/dashboard.html index 605b81f..106789e 100644 --- a/src/main/resources/templates/gccrentalmanagement/dashboard.html +++ b/src/main/resources/templates/gccrentalmanagement/dashboard.html @@ -226,13 +226,13 @@ .nav-tab-item:hover { color: var(--brand-accent); - background: #f8fafc; + background: #e9ecef; } .nav-tab-item.active { color: var(--brand-primary); border-bottom-color: var(--brand-accent); - background: #f0f9ff; + background: #a8bdcc; } .nav-tab-item .badge-count { @@ -535,6 +535,7 @@ border-collapse: collapse; margin-bottom: 0; font-size: 0.84rem; + border: 1px solid #e2e8f0; } .custom-table thead th { @@ -546,11 +547,16 @@ letter-spacing: 0.5px; padding: 13px 15px; border-bottom: 1.5px solid var(--border-color); + border-right: 1px solid #e2e8f0; white-space: nowrap; } + .custom-table thead th:last-child { + border-right: none; + } + .custom-table tbody tr { - border-bottom: 1px solid #f1f5f9; + border-bottom: 1px solid #e2e8f0; transition: background 0.2s; } @@ -562,6 +568,11 @@ padding: 12px 15px; vertical-align: middle; color: #1e293b; + border-right: 1px solid #e2e8f0; + } + + .custom-table tbody td:last-child { + border-right: none; } /* Status & Alert Badges */ @@ -618,6 +629,58 @@ color: #334155; } + /* Pagination Controls Styling */ + .pagination { + display: flex; + align-items: center; + gap: 4px; + list-style: none; + padding: 0; + margin: 0; + } + + .pagination .page-item { + margin: 0; + } + + .pagination .page-item .page-link { + border-radius: 8px; + border: 1px solid #e2e8f0; + color: var(--brand-primary); + font-weight: 600; + font-size: 0.82rem; + padding: 5px 12px; + transition: all 0.2s ease; + background: #ffffff; + cursor: pointer; + text-decoration: none; + display: inline-flex; + align-items: center; + gap: 4px; + user-select: none; + } + + .pagination .page-item .page-link:hover { + background: var(--brand-accent-light); + border-color: var(--brand-accent); + color: var(--brand-primary); + } + + .pagination .page-item.active .page-link { + background: var(--brand-primary); + border-color: var(--brand-primary); + color: #ffffff; + box-shadow: 0 2px 6px rgba(13, 75, 104, 0.25); + } + + .pagination .page-item.disabled .page-link { + background: #f8fafc; + border-color: #e2e8f0; + color: #94a3b8; + cursor: not-allowed; + pointer-events: none; + } + /* Overdue Alert Banner */ .overdue-alert-banner { background: linear-gradient(135deg, #fff1f2, #ffe4e6); @@ -841,7 +904,7 @@
Rental Asset & Material Management - Hub + System
@@ -869,16 +932,17 @@ 1. Work Orders (WO) 0 - + +
+
+ + +
+ +
+
+ Showing 0 to 0 of 0 entries +
+
    + +
+
@@ -1059,8 +1139,8 @@
- +
+ +
+
+ Showing 0 to 0 of 0 entries +
+
    + +
+
@@ -1106,7 +1195,7 @@
-

2. Department User Request Creation

+

3. Department User Request Creation

Tapal No & Date, Department & Zone Dropdowns, Requested Qty (Systems, Printers, Laptops), Required Period (Days Calculated), Mail Copy Upload & Dynamic Status
@@ -1114,8 +1203,8 @@
- +
+ +
+
+ Showing 0 to 0 of 0 entries +
+
    + +
+
@@ -1162,7 +1263,7 @@
-

3. Delivery Challan (DC) Upload for Inward Stock

+

2. Delivery Challan (DC) Upload for Inward Stock

Inward stock entry against registered Work Order, DC No, DC Date, Inward Qty (Systems, Printers, Laptops) & DC File Upload
@@ -1170,7 +1271,7 @@
-
+ +
+
+ Showing 0 to 0 of 0 entries +
+
    + +
+
@@ -1225,7 +1339,7 @@
-
+ +
+
+ Showing 0 to 0 of 0 entries +
+
    + +
+
@@ -1281,8 +1406,8 @@
- +
+ +
+
+ Showing 0 to 0 of 0 entries +
+
    + +
+
@@ -1335,6 +1471,11 @@
+
+ + +
@@ -1350,6 +1491,7 @@ + @@ -1364,6 +1506,16 @@
S.No Department & Zone Custodian Officer & Phone Issued Items
+ +
+
+ Showing 0 to 0 of 0 entries +
+
    + +
+
@@ -1382,6 +1534,11 @@
+
+ + +
+ +
+
+ Showing 0 to 0 of 0 entries +
+
    + +
+
@@ -1463,47 +1631,24 @@ onchange="calculateWODuration()"> - -
-
Quantities & Model Names
-
-
- - -
-
- - -
- -
- - + +
+
+ Asset Categories, Quantities & Model Specifications
+
-
- - -
- -
- - -
-
- - +
+
- - Upload Work Order Copy (PDF / Doc) * +
@@ -1534,6 +1679,69 @@
+ + + +