From 99862835e2cddd3fcaa4316b9d7267c77139a6e3 Mon Sep 17 00:00:00 2001 From: syc0123 Date: Wed, 25 Mar 2026 18:39:38 +0900 Subject: [PATCH 1/9] =?UTF-8?q?.gitignore=EC=97=90=20Claude=20Code=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20=ED=8C=8C=EC=9D=BC=20=EC=A0=9C=EC=99=B8=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index cd16182..7f2d560 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,8 @@ Thumbs.db # Cursor files .cursor/ + +# Claude Code +CLAUDE.md +.playwright-mcp/ +.omc/ From 5c76b3f5b8a814b4ab28b1c25be7a255c01d77ef Mon Sep 17 00:00:00 2001 From: syc0123 Date: Wed, 25 Mar 2026 18:51:25 +0900 Subject: [PATCH 2/9] Add .claude/ to .gitignore Co-Authored-By: Claude Opus 4.6 (1M context) --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7f2d560..431f5cf 100644 --- a/.gitignore +++ b/.gitignore @@ -36,5 +36,6 @@ Thumbs.db # Claude Code CLAUDE.md +.claude/ .playwright-mcp/ .omc/ From f8d938558f99def551ec021595929a76360030a8 Mon Sep 17 00:00:00 2001 From: syc0123 Date: Thu, 26 Mar 2026 11:15:46 +0900 Subject: [PATCH 3/9] =?UTF-8?q?[RAPID]=20=EC=88=98=EC=A3=BC=ED=86=B5?= =?UTF-8?q?=ED=95=A9=EB=93=B1=EB=A1=9D=20=ED=92=88=EB=AA=A9=20=EA=B7=B8?= =?UTF-8?q?=EB=A6=AC=EB=93=9C=20=ED=95=98=EB=8B=A8=20Total=20=ED=95=A9?= =?UTF-8?q?=EA=B3=84=20=ED=96=89=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - tfoot에 Total 행 추가 (No~반납사유 7컬럼 병합) - 수주수량/수주공급가액/수주부가세/수주총액 합계 자동 계산 - 품목 추가/삭제/금액 변경 시 합계 실시간 갱신 Co-Authored-By: Claude Opus 4.6 (1M context) --- .../estimateAndOrderRegistFormPopup.jsp | 57 +++++++++++++++---- 1 file changed, 47 insertions(+), 10 deletions(-) diff --git a/WebContent/WEB-INF/view/contractMgmt/estimateAndOrderRegistFormPopup.jsp b/WebContent/WEB-INF/view/contractMgmt/estimateAndOrderRegistFormPopup.jsp index 61d3cbf..0ae50cb 100644 --- a/WebContent/WEB-INF/view/contractMgmt/estimateAndOrderRegistFormPopup.jsp +++ b/WebContent/WEB-INF/view/contractMgmt/estimateAndOrderRegistFormPopup.jsp @@ -400,7 +400,8 @@ } else if($(this).hasClass("item-order-vat")) { fn_calculateTotalFromVat(itemId); } - // 총액 직접 수정시에는 재계산 안함 + // 총액 직접 수정시에도 합계는 갱신 + fn_calculateTotal(); }); // 품목 정보 저장 @@ -623,6 +624,8 @@ } else if($(this).hasClass("item-order-vat")) { fn_calculateTotalFromVat(itemId); } + // 총액 직접 수정시에도 합계는 갱신 + fn_calculateTotal(); }); // 품목 정보 저장 @@ -635,9 +638,11 @@ } } %> + // 기존 품목 로드 완료 후 합계 계산 + fn_calculateTotal(); } - - // 품목별 금액 계산 + + // 품목별 금액 계산 function fn_calculateItemAmount(itemId) { var quantity = parseFloat(removeComma($("#" + itemId + " .item-order-quantity").val())) || 0; var unitPrice = parseFloat(removeComma($("#" + itemId + " .item-order-unit-price").val())) || 0; @@ -653,8 +658,9 @@ // 총액 계산 var totalAmount = supplyPrice + vat; $("#" + itemId + " .item-order-total-amount").val(addComma(totalAmount)); + fn_calculateTotal(); } - + // 부가세 직접 입력 시 총액만 재계산 function fn_calculateTotalFromVat(itemId) { var supplyPrice = parseFloat(removeComma($("#" + itemId + " .item-order-supply-price").val())) || 0; @@ -663,19 +669,36 @@ // 총액 계산 var totalAmount = supplyPrice + vat; $("#" + itemId + " .item-order-total-amount").val(addComma(totalAmount)); + fn_calculateTotal(); } - + // 공급가액 직접 입력 시 부가세와 총액 재계산 function fn_calculateFromSupplyPrice(itemId) { var supplyPrice = parseFloat(removeComma($("#" + itemId + " .item-order-supply-price").val())) || 0; - + // 부가세 자동 계산 (공급가액의 10%) var vat = Math.round(supplyPrice * 0.1); $("#" + itemId + " .item-order-vat").val(addComma(vat)); - + // 총액 계산 var totalAmount = supplyPrice + vat; $("#" + itemId + " .item-order-total-amount").val(addComma(totalAmount)); + fn_calculateTotal(); + } + + // 품목 합계 계산 + function fn_calculateTotal() { + var totalQty = 0, totalSupply = 0, totalVat = 0, totalAmount = 0; + $(".item-row").each(function() { + totalQty += parseFloat(removeComma($(this).find(".item-order-quantity").val())) || 0; + totalSupply += parseFloat(removeComma($(this).find(".item-order-supply-price").val())) || 0; + totalVat += parseFloat(removeComma($(this).find(".item-order-vat").val())) || 0; + totalAmount += parseFloat(removeComma($(this).find(".item-order-total-amount").val())) || 0; + }); + $("#totalOrderQuantity").text(addCommaInt(totalQty)); + $("#totalOrderSupplyPrice").text(addComma(totalSupply)); + $("#totalOrderVat").text(addComma(totalVat)); + $("#totalOrderTotalAmount").text(addComma(totalAmount)); } // 품번/품명 셀렉트박스 옵션 채우기 (Select2 AJAX) @@ -1036,7 +1059,7 @@ if(confirm("해당 품목을 삭제하시겠습니까?")) { $("#" + itemId).remove(); - + // itemList에서 제거 for(var i = 0; i < itemList.length; i++) { if(itemList[i].id == itemId) { @@ -1044,10 +1067,13 @@ break; } } - + // 행 번호 재정렬 fn_reorderItemRows(); - + + // 합계 재계산 + fn_calculateTotal(); + // 모든 행이 삭제되면 안내 메시지 표시 if($(".item-row").length == 0) { $("#noItemRow").show(); @@ -1491,6 +1517,17 @@ + + + Total + 0 + + 0.00 + 0.00 + 0.00 + + + From a2b1405d2bceaf25a06c02fad30d5e16dfdcc57c Mon Sep 17 00:00:00 2001 From: hjjeong Date: Thu, 26 Mar 2026 11:18:17 +0900 Subject: [PATCH 4/9] =?UTF-8?q?=EC=98=81=EC=97=85=EA=B4=80=EB=A6=AC=5F?= =?UTF-8?q?=EA=B2=AC=EC=A0=81=EA=B4=80=EB=A6=AC=20pdf=20=EC=B2=A8=EB=B6=80?= =?UTF-8?q?=20=EA=B0=80=EB=8A=A5=ED=95=9C=20=EC=B6=94=EA=B0=80=EA=B2=AC?= =?UTF-8?q?=EC=A0=81=20=EC=BB=AC=EB=9F=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../view/contractMgmt/addEstimatePdfPopup.jsp | 150 ++++++++++++ .../view/contractMgmt/estimateList_new.jsp | 27 ++- .../controller/ContractMgmtController.java | 8 + src/com/pms/salesmgmt/mapper/contractMgmt.xml | 226 ++++++++++++++---- 4 files changed, 356 insertions(+), 55 deletions(-) create mode 100644 WebContent/WEB-INF/view/contractMgmt/addEstimatePdfPopup.jsp diff --git a/WebContent/WEB-INF/view/contractMgmt/addEstimatePdfPopup.jsp b/WebContent/WEB-INF/view/contractMgmt/addEstimatePdfPopup.jsp new file mode 100644 index 0000000..8661349 --- /dev/null +++ b/WebContent/WEB-INF/view/contractMgmt/addEstimatePdfPopup.jsp @@ -0,0 +1,150 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ page import="com.pms.common.utils.*"%> +<%@ page import="java.util.*" %> +<%@include file= "/init.jsp" %> + + + + +<%=Constants.SYSTEM_NAME%> + + + + +
+
+
+

추가견적 PDF 첨부

+
+
+ + + + + +
PDF 파일 +
+

* PDF 파일만 첨부 가능합니다. (추후 메일 발송 시 견적서 PDF와 합쳐 발송될 예정입니다)

+
+ Drag & Drop PDF Files Here +
+
+ + +
+
+
+ + + + + + + + + + + + + + + + +
No파일명등록일Size
+
+
+
+
+
+
+ +
+
+
+
+
+ + diff --git a/WebContent/WEB-INF/view/contractMgmt/estimateList_new.jsp b/WebContent/WEB-INF/view/contractMgmt/estimateList_new.jsp index a7a0369..8ac36df 100644 --- a/WebContent/WEB-INF/view/contractMgmt/estimateList_new.jsp +++ b/WebContent/WEB-INF/view/contractMgmt/estimateList_new.jsp @@ -414,7 +414,22 @@ var columns = [ var objid = fnc_checkNull(cell.getData().OBJID); fn_showEstimateList(objid); } - }, + }, + // 11-1. 추가견적 PDF 첨부 + {headerHozAlign : 'center', hozAlign : 'center', minWidth: 55, widthGrow: 0.7, title : '추가견적', field : 'ADD_EST_CNT', + formatter: function(cell, formatterParams, onRendered){ + var cnt = fnc_checkNull(cell.getValue()); + var icon = '📎'; + if(cnt !== '' && parseInt(cnt) > 0){ + return icon + ' ' + cnt + ''; + } + return icon; + }, + cellClick:function(e, cell){ + var objid = fnc_checkNull(cell.getData().OBJID); + fn_openAddEstimatePdf(objid); + } + }, // 12. 아마란스 결재상태 (hidden) {title:'AMARANTH_STATUS', field:'AMARANTH_STATUS', visible: false}, // 13. 결재상태 (아마란스 전자결재) @@ -556,7 +571,7 @@ function fn_search(){ console.log("품목 검색 조건 설정됨:", partObjId); } - _tabulGrid = fnc_tabul_search(_tabul_layout_fitColumns, _tabulGrid, "/contractMgmt/contractGridList.do", columns, true); + _tabulGrid = fnc_tabul_search(_tabul_layout_fitColumns, _tabulGrid, "/contractMgmt/estimateGridList.do", columns, true); } function _fnc_datepick(){ @@ -635,6 +650,14 @@ function fn_delete(){ } +// 추가견적 PDF 첨부 팝업 +function fn_openAddEstimatePdf(objId){ + var popup_width = 700; + var popup_height = 400; + var url = '/contractMgmt/addEstimatePdfPopup.do?targetObjId=' + objId; + fn_centerPopup(popup_width, popup_height, url); +} + function fn_FileRegist(objId, docType, docTypeName){ var popup_width = 800; var popup_height = 300; diff --git a/src/com/pms/salesmgmt/controller/ContractMgmtController.java b/src/com/pms/salesmgmt/controller/ContractMgmtController.java index 2854520..bcfc7e5 100644 --- a/src/com/pms/salesmgmt/controller/ContractMgmtController.java +++ b/src/com/pms/salesmgmt/controller/ContractMgmtController.java @@ -2899,6 +2899,14 @@ public class ContractMgmtController { request.setAttribute("docTypeName", CommonUtils.checkNull(paramMap.get("docTypeName"))); return "/contractMgmt/FileRegistPopup"; } + + /** + * 추가견적 PDF 첨부 팝업 + */ + @RequestMapping("/contractMgmt/addEstimatePdfPopup.do") + public String addEstimatePdfPopup(HttpServletRequest request, @RequestParam Map paramMap){ + return "/contractMgmt/addEstimatePdfPopup"; + } /** * 영업정보의 품목 목록 조회 (견적서 작성 시 사용) diff --git a/src/com/pms/salesmgmt/mapper/contractMgmt.xml b/src/com/pms/salesmgmt/mapper/contractMgmt.xml index d680e10..a57a65f 100644 --- a/src/com/pms/salesmgmt/mapper/contractMgmt.xml +++ b/src/com/pms/salesmgmt/mapper/contractMgmt.xml @@ -739,6 +739,8 @@ AND CANCEL_QTY != '' AND CANCEL_QTY != '0' ) AS CANCEL_QTY_SUM + -- 추가견적 PDF 첨부 건수 + ,(SELECT COUNT(1) FROM ATTACH_FILE_INFO WHERE TARGET_OBJID = T.OBJID AND DOC_TYPE = 'estimate02' AND UPPER(STATUS) = 'ACTIVE') AS ADD_EST_CNT FROM CONTRACT_MGMT AS T LEFT OUTER JOIN @@ -1014,9 +1016,134 @@ AND COALESCE(IS_DIRECT_ORDER, 'N') != 'Y' - ORDER BY REGDATE DESC + ORDER BY REGDATE DESC + + + @@ -3302,13 +3422,13 @@ SELECT , #{qty } , #{warranty } - , #{product_price }::NUMERIC + , #{product_price }::NUMERIC - , #{other_price }::NUMERIC + , #{other_price }::NUMERIC - , #{total_price }::NUMERIC + , #{total_price }::NUMERIC , #{contract_user_id } , #{contract_date } @@ -3317,20 +3437,20 @@ SELECT , #{contract_office_no} , #{contract_fax_no } - ,#{est_release_date} + ,#{est_release_date} , NOW() , #{userId} ,(SELECT TO_CHAR(NOW(),'yy')::VARCHAR ||'E-'||LPAD((SELECT NEXTVAL('estimate_mgmt_seq'))::VARCHAR ,4,'0')) - ,#{contract_product_price}::NUMERIC + ,#{contract_product_price}::NUMERIC ,#{sale} ,#{final_total_price}::NUMERIC ,#{contract_type} ,#{note} - ,#{cus_request_date} + ,#{cus_request_date} ,#{delivery_place} ,#{product_code} From 9c30adb0f7d7872c59d16c5980ea03323c71815e Mon Sep 17 00:00:00 2001 From: hjjeong Date: Thu, 26 Mar 2026 11:48:34 +0900 Subject: [PATCH 5/9] =?UTF-8?q?=EC=B6=94=EA=B0=80=EA=B2=AC=EC=A0=81=20pdf?= =?UTF-8?q?=20=EB=AC=B6=EC=96=B4=EC=84=9C=20=EB=A9=94=EC=9D=BC=EB=B0=9C?= =?UTF-8?q?=EC=86=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../view/contractMgmt/estimateTemplate1.jsp | 10 +-- .../view/contractMgmt/estimateTemplate2.jsp | 2 +- .../service/ContractMgmtService.java | 69 +++++++++++++++++-- 3 files changed, 69 insertions(+), 12 deletions(-) diff --git a/WebContent/WEB-INF/view/contractMgmt/estimateTemplate1.jsp b/WebContent/WEB-INF/view/contractMgmt/estimateTemplate1.jsp index b5474d7..166724f 100644 --- a/WebContent/WEB-INF/view/contractMgmt/estimateTemplate1.jsp +++ b/WebContent/WEB-INF/view/contractMgmt/estimateTemplate1.jsp @@ -1662,14 +1662,14 @@ function fn_generatePdf() { pdf.addImage(imgData, 'JPEG', 0, position, imgWidth, imgHeight, undefined, 'FAST'); heightLeft -= pageHeight; - // 페이지가 넘어가면 추가 페이지 생성 - while (heightLeft >= 0) { + // 페이지가 넘어가면 추가 페이지 생성 (1mm 이상 넘칠 때만) + while (heightLeft > 1) { position = heightLeft - imgHeight; pdf.addPage(); pdf.addImage(imgData, 'JPEG', 0, position, imgWidth, imgHeight, undefined, 'FAST'); heightLeft -= pageHeight; } - + // 파일명 생성 var estimateNo = $("#estimate_no").val() || "견적서"; var fileName = estimateNo + '.pdf'; @@ -1782,13 +1782,13 @@ function fn_generateAndUploadPdf(callback) { pdf.addImage(imgData, 'JPEG', 0, position, imgWidth, imgHeight, undefined, 'FAST'); heightLeft -= pageHeight; - while (heightLeft >= 0) { + while (heightLeft > 1) { position = heightLeft - imgHeight; pdf.addPage(); pdf.addImage(imgData, 'JPEG', 0, position, imgWidth, imgHeight, undefined, 'FAST'); heightLeft -= pageHeight; } - + console.log('PDF 생성 완료'); // PDF를 Base64로 변환 diff --git a/WebContent/WEB-INF/view/contractMgmt/estimateTemplate2.jsp b/WebContent/WEB-INF/view/contractMgmt/estimateTemplate2.jsp index c3dd8a7..2573c81 100644 --- a/WebContent/WEB-INF/view/contractMgmt/estimateTemplate2.jsp +++ b/WebContent/WEB-INF/view/contractMgmt/estimateTemplate2.jsp @@ -1158,7 +1158,7 @@ function fn_generateAndUploadPdf(callback) { pdf.addImage(imgData, 'JPEG', 0, position, imgWidth, imgHeight, undefined, 'FAST'); heightLeft -= pageHeight; - while (heightLeft >= 0) { + while (heightLeft > 1) { position = heightLeft - imgHeight; pdf.addPage(); pdf.addImage(imgData, 'JPEG', 0, position, imgWidth, imgHeight, undefined, 'FAST'); diff --git a/src/com/pms/salesmgmt/service/ContractMgmtService.java b/src/com/pms/salesmgmt/service/ContractMgmtService.java index 72288d3..6763b25 100644 --- a/src/com/pms/salesmgmt/service/ContractMgmtService.java +++ b/src/com/pms/salesmgmt/service/ContractMgmtService.java @@ -25,6 +25,8 @@ import org.apache.ibatis.session.SqlSession; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; +import org.apache.pdfbox.multipdf.PDFMergerUtility; +import org.apache.pdfbox.pdmodel.PDDocument; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -3406,6 +3408,42 @@ private String encodeImageToBase64(String imagePath) { * @param estimateTemplate * @return */ + /** + * 견적서 PDF + 추가견적(estimate02) PDF 파일들을 하나로 병합 + */ + private File mergePdfWithAddEstimate(File estimatePdf, List addEstFiles) throws Exception { + String tempDir = System.getProperty("java.io.tmpdir"); + String mergedFileName = estimatePdf.getName().replace(".pdf", "_merged.pdf"); + File mergedFile = new File(tempDir + File.separator + mergedFileName); + + PDFMergerUtility merger = new PDFMergerUtility(); + merger.setDestinationFileName(mergedFile.getAbsolutePath()); + + // 1. 견적서 PDF 추가 + merger.addSource(estimatePdf); + + // 2. 추가견적 PDF 파일들 추가 + for(Map fileInfo : addEstFiles) { + String filePath = CommonUtils.checkNull(fileInfo.get("FILE_PATH")); + if("".equals(filePath)) filePath = CommonUtils.checkNull(fileInfo.get("file_path")); + String savedName = CommonUtils.checkNull(fileInfo.get("SAVED_FILE_NAME")); + if("".equals(savedName)) savedName = CommonUtils.checkNull(fileInfo.get("saved_file_name")); + if("".equals(savedName)) savedName = CommonUtils.checkNull(fileInfo.get("FILE_SAVED_NAME")); + if("".equals(filePath)) filePath = Constants.FILE_STORAGE; + + File addFile = new File(filePath + File.separator + savedName); + if(addFile.exists() && addFile.getName().toLowerCase().endsWith(".pdf")) { + merger.addSource(addFile); + System.out.println("추가견적 PDF 병합 추가: " + addFile.getName()); + } + } + + merger.mergeDocuments(null); + mergedFile.deleteOnExit(); + + return mergedFile; + } + private File getPdfFromSession(String sessionId, Map estimateTemplate) { try { String tempDir = System.getProperty("java.io.tmpdir"); @@ -3539,18 +3577,37 @@ private String encodeImageToBase64(String imagePath) { } } - // 5. PDF 파일 처리 + // 5. PDF 파일 처리 (견적서 + 추가견적 PDF 병합) ArrayList attachFileList = new ArrayList(); if(!"".equals(pdfSessionId)) { File pdfFile = getPdfFromSession(pdfSessionId, estimateTemplate); if(pdfFile != null && pdfFile.exists()) { + // 추가견적(estimate02) PDF 파일 조회 + Map fileParam = new HashMap(); + fileParam.put("targetObjId", objId); + fileParam.put("docType", "estimate02"); + List addEstFiles = sqlSession.selectList("common.getFileList", fileParam); + + File finalPdf = pdfFile; + + // 추가견적 PDF가 있으면 병합 + if(addEstFiles != null && !addEstFiles.isEmpty()) { + try { + finalPdf = mergePdfWithAddEstimate(pdfFile, addEstFiles); + System.out.println("PDF 병합 완료: 견적서 + 추가견적 " + addEstFiles.size() + "건"); + } catch(Exception mergeEx) { + System.out.println("PDF 병합 실패, 견적서만 첨부: " + mergeEx.getMessage()); + finalPdf = pdfFile; + } + } + HashMap fileMap = new HashMap(); - fileMap.put(Constants.Db.COL_FILE_REAL_NAME, pdfFile.getName()); - fileMap.put(Constants.Db.COL_FILE_SAVED_NAME, pdfFile.getName()); - fileMap.put(Constants.Db.COL_FILE_PATH, pdfFile.getParent()); + fileMap.put(Constants.Db.COL_FILE_REAL_NAME, finalPdf.getName()); + fileMap.put(Constants.Db.COL_FILE_SAVED_NAME, finalPdf.getName()); + fileMap.put(Constants.Db.COL_FILE_PATH, finalPdf.getParent()); attachFileList.add(fileMap); - - System.out.println("PDF 파일 첨부 완료: " + pdfFile.getAbsolutePath()); + + System.out.println("PDF 파일 첨부 완료: " + finalPdf.getAbsolutePath()); } else { System.out.println("PDF 파일을 찾을 수 없습니다: " + pdfSessionId); } From 03f243dddd34775cb070afbc5f4849c7126a70c1 Mon Sep 17 00:00:00 2001 From: syc0123 Date: Thu, 26 Mar 2026 12:00:50 +0900 Subject: [PATCH 6/9] =?UTF-8?q?[RAPID-fix]=20addCommaInt=20=ED=95=A8?= =?UTF-8?q?=EC=88=98=20=EB=88=84=EB=9D=BD=20=EC=B6=94=EA=B0=80=20-=20Total?= =?UTF-8?q?=20=ED=96=89=20=ED=95=A9=EA=B3=84=20=EA=B3=84=EC=82=B0=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- .../view/contractMgmt/estimateAndOrderRegistFormPopup.jsp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/WebContent/WEB-INF/view/contractMgmt/estimateAndOrderRegistFormPopup.jsp b/WebContent/WEB-INF/view/contractMgmt/estimateAndOrderRegistFormPopup.jsp index 0ae50cb..bbac628 100644 --- a/WebContent/WEB-INF/view/contractMgmt/estimateAndOrderRegistFormPopup.jsp +++ b/WebContent/WEB-INF/view/contractMgmt/estimateAndOrderRegistFormPopup.jsp @@ -133,6 +133,13 @@ function addComma(data) { return formatMoney(data); } + + function addCommaInt(data) { + if(!data && data !== 0) return ''; + var num = Math.round(Number(String(data).replace(/,/g, ''))); + if(isNaN(num)) return ''; + return num.toLocaleString(); + } function removeComma(data) { if(!data) return ''; From adf2d3eab32d1831f1bd4b8697c0db786fd7ac1c Mon Sep 17 00:00:00 2001 From: syc0123 Date: Thu, 26 Mar 2026 12:12:29 +0900 Subject: [PATCH 7/9] =?UTF-8?q?[RAPID]=20=EC=88=98=EC=A3=BC=ED=86=B5?= =?UTF-8?q?=ED=95=A9=EB=93=B1=EB=A1=9D=20=ED=92=88=EB=AA=A9=20=ED=95=84?= =?UTF-8?q?=EB=93=9C=20=EC=86=8C=EC=88=98=EC=A0=90=202=EC=9E=90=EB=A6=AC?= =?UTF-8?q?=20=ED=8F=AC=EB=A7=B7=20=EB=B0=8F=20=EC=9A=B0=EC=B8=A1=EC=A0=95?= =?UTF-8?q?=EB=A0=AC=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- .../estimateAndOrderRegistFormPopup.jsp | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/WebContent/WEB-INF/view/contractMgmt/estimateAndOrderRegistFormPopup.jsp b/WebContent/WEB-INF/view/contractMgmt/estimateAndOrderRegistFormPopup.jsp index 5ee83ec..4956b59 100644 --- a/WebContent/WEB-INF/view/contractMgmt/estimateAndOrderRegistFormPopup.jsp +++ b/WebContent/WEB-INF/view/contractMgmt/estimateAndOrderRegistFormPopup.jsp @@ -68,7 +68,7 @@ // 숫자만 입력 처리 $("input:text[numberOnly]").on("keyup", function() { - if($(this).hasClass("item-order-quantity") || $(this).attr("id") === "facility_qty") { + if($(this).attr("id") === "facility_qty") { $(this).val(formatInteger($(this).val().replace(/[^0-9]/g, ""))); } else { $(this).val(fnc_addComma($(this).val().replace(/[^0-9.]/g, ""))); @@ -77,7 +77,7 @@ $("input:text[numberOnly]").on("blur", function() { var val = $(this).val(); if(val && val !== '') { - if($(this).hasClass("item-order-quantity") || $(this).attr("id") === "facility_qty") { + if($(this).attr("id") === "facility_qty") { $(this).val(formatInteger(removeComma(val))); } else { $(this).val(formatMoney(removeComma(val))); @@ -338,30 +338,30 @@ // 수주수량 (Machine이고 프로젝트가 있으면 readonly) html += ''; if(isMachine && hasProject) { - html += ''; + html += ''; } else { - html += ''; + html += ''; } html += ''; - + // 수주단가 html += ''; - html += ''; + html += ''; html += ''; - + // 수주공급가액 (자동계산 + 수정가능) html += ''; - html += ''; + html += ''; html += ''; - + // 수주부가세 (자동계산 + 수정가능) html += ''; - html += ''; + html += ''; html += ''; - + // 수주총액 (자동계산 + 수정가능) html += ''; - html += ''; + html += ''; html += ''; // 삭제 버튼 @@ -450,7 +450,7 @@ } // 수주 정보 설정 - if(existingData.orderQuantity) $("#" + itemId + " .item-order-quantity").val(formatInteger(existingData.orderQuantity)); + if(existingData.orderQuantity) $("#" + itemId + " .item-order-quantity").val(addComma(existingData.orderQuantity)); if(existingData.orderUnitPrice) $("#" + itemId + " .item-order-unit-price").val(addComma(existingData.orderUnitPrice)); if(existingData.orderSupplyPrice) $("#" + itemId + " .item-order-supply-price").val(addComma(existingData.orderSupplyPrice)); if(existingData.orderVat) $("#" + itemId + " .item-order-vat").val(addComma(existingData.orderVat)); @@ -551,22 +551,22 @@ // 수주 정보 (Machine이고 프로젝트가 있으면 수량 readonly) html += ''; if(isMachine && hasProject) { - html += ''; + html += ''; } else { - html += ''; + html += ''; } html += ''; html += ''; - html += ''; + html += ''; html += ''; html += ''; - html += ''; + html += ''; html += ''; html += ''; - html += ''; + html += ''; html += ''; html += ''; - html += ''; + html += ''; html += ''; html += ''; @@ -703,7 +703,7 @@ totalVat += parseFloat(removeComma($(this).find(".item-order-vat").val())) || 0; totalAmount += parseFloat(removeComma($(this).find(".item-order-total-amount").val())) || 0; }); - $("#totalOrderQuantity").text(addCommaInt(totalQty)); + $("#totalOrderQuantity").text(addComma(totalQty)); $("#totalOrderSupplyPrice").text(addComma(totalSupply)); $("#totalOrderVat").text(addComma(totalVat)); $("#totalOrderTotalAmount").text(addComma(totalAmount)); From d04227e8f024a7ed0915ccdfcb3547073ad5706b Mon Sep 17 00:00:00 2001 From: hjjeong Date: Thu, 26 Mar 2026 12:14:22 +0900 Subject: [PATCH 8/9] =?UTF-8?q?=EA=B0=9C=EB=B0=9C=EA=B4=80=EB=A6=AC=5Fpart?= =?UTF-8?q?=20=EC=A1=B0=ED=9A=8C=20=ED=92=88=EB=B2=88&=ED=92=88=EB=AA=85?= =?UTF-8?q?=20=EC=84=A0=ED=83=9D=20=EB=B0=A9=EC=8B=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebContent/WEB-INF/view/partMng/partMngList.jsp | 14 +++++++------- src/com/pms/mapper/partMng.xml | 2 ++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/WebContent/WEB-INF/view/partMng/partMngList.jsp b/WebContent/WEB-INF/view/partMng/partMngList.jsp index 321a6c4..d248cc8 100644 --- a/WebContent/WEB-INF/view/partMng/partMngList.jsp +++ b/WebContent/WEB-INF/view/partMng/partMngList.jsp @@ -125,7 +125,7 @@ String connector = person.getUserId(); $('.select2').select2(); // 품번/품명 Select2 AJAX 초기화 - initPartSelect2Ajax("#SEARCH_PART_NO", "#SEARCH_PART_NAME", "#SEARCH_PART_OBJID"); + // initPartSelect2Ajax("#SEARCH_PART_NO", "#SEARCH_PART_NAME", "#SEARCH_PART_OBJID"); //첨부팝업 $(".File").click(function(){ @@ -760,16 +760,16 @@ function fn_deleteErp(){ - + + + - + + diff --git a/src/com/pms/mapper/partMng.xml b/src/com/pms/mapper/partMng.xml index 23dec61..5b3d2b3 100644 --- a/src/com/pms/mapper/partMng.xml +++ b/src/com/pms/mapper/partMng.xml @@ -2001,9 +2001,11 @@ SELECT T1.LEV, T1.BOM_REPORT_OBJID, T1.ROOT_PART_NO, T1.PATH, T1.LEAF, T2.* AND UPPER(T.PART_NO) LIKE UPPER('%${SEARCH_PART_NO}%') + AND UPPER(T.PART_NAME) LIKE UPPER('%${SEARCH_PART_NAME}%') From f04466f367adf2bf7eb459cd1caa3108e7d4086d Mon Sep 17 00:00:00 2001 From: syc0123 Date: Thu, 26 Mar 2026 12:17:41 +0900 Subject: [PATCH 9/9] =?UTF-8?q?[RAPID-fix]=20=EC=88=98=EC=A3=BC=ED=86=B5?= =?UTF-8?q?=ED=95=A9=EB=93=B1=EB=A1=9D=20=EC=88=98=EB=9F=89=20=EC=A0=95?= =?UTF-8?q?=EC=88=98=ED=8F=AC=EB=A7=B7=20=EB=B3=B5=EC=9B=90,=20=EA=B8=88?= =?UTF-8?q?=EC=95=A1=ED=95=84=EB=93=9C=20blur=EC=8B=9C=20=EC=86=8C?= =?UTF-8?q?=EC=88=98=EC=A0=902=EC=9E=90=EB=A6=AC=20=ED=8F=AC=EB=A7=B7=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 수주수량: 정수 포맷(formatInteger) 유지, 우측정렬 - 공급가액/부가세/총액: blur 시 formatMoney로 .00 포맷 복원 - blur 이벤트를 이벤트 위임 방식으로 변경하여 동적 행에도 적용 Co-Authored-By: Claude Opus 4.6 (1M context) --- .../estimateAndOrderRegistFormPopup.jsp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/WebContent/WEB-INF/view/contractMgmt/estimateAndOrderRegistFormPopup.jsp b/WebContent/WEB-INF/view/contractMgmt/estimateAndOrderRegistFormPopup.jsp index 4956b59..c927c8d 100644 --- a/WebContent/WEB-INF/view/contractMgmt/estimateAndOrderRegistFormPopup.jsp +++ b/WebContent/WEB-INF/view/contractMgmt/estimateAndOrderRegistFormPopup.jsp @@ -68,16 +68,16 @@ // 숫자만 입력 처리 $("input:text[numberOnly]").on("keyup", function() { - if($(this).attr("id") === "facility_qty") { + if($(this).hasClass("item-order-quantity") || $(this).attr("id") === "facility_qty") { $(this).val(formatInteger($(this).val().replace(/[^0-9]/g, ""))); } else { $(this).val(fnc_addComma($(this).val().replace(/[^0-9.]/g, ""))); } }); - $("input:text[numberOnly]").on("blur", function() { + $(document).on("blur", "input:text[numberOnly]", function() { var val = $(this).val(); if(val && val !== '') { - if($(this).attr("id") === "facility_qty") { + if($(this).hasClass("item-order-quantity") || $(this).attr("id") === "facility_qty") { $(this).val(formatInteger(removeComma(val))); } else { $(this).val(formatMoney(removeComma(val))); @@ -450,7 +450,7 @@ } // 수주 정보 설정 - if(existingData.orderQuantity) $("#" + itemId + " .item-order-quantity").val(addComma(existingData.orderQuantity)); + if(existingData.orderQuantity) $("#" + itemId + " .item-order-quantity").val(formatInteger(existingData.orderQuantity)); if(existingData.orderUnitPrice) $("#" + itemId + " .item-order-unit-price").val(addComma(existingData.orderUnitPrice)); if(existingData.orderSupplyPrice) $("#" + itemId + " .item-order-supply-price").val(addComma(existingData.orderSupplyPrice)); if(existingData.orderVat) $("#" + itemId + " .item-order-vat").val(addComma(existingData.orderVat)); @@ -551,9 +551,9 @@ // 수주 정보 (Machine이고 프로젝트가 있으면 수량 readonly) html += ''; if(isMachine && hasProject) { - html += ''; + html += ''; } else { - html += ''; + html += ''; } html += ''; html += ''; @@ -703,7 +703,7 @@ totalVat += parseFloat(removeComma($(this).find(".item-order-vat").val())) || 0; totalAmount += parseFloat(removeComma($(this).find(".item-order-total-amount").val())) || 0; }); - $("#totalOrderQuantity").text(addComma(totalQty)); + $("#totalOrderQuantity").text(addCommaInt(totalQty)); $("#totalOrderSupplyPrice").text(addComma(totalSupply)); $("#totalOrderVat").text(addComma(totalVat)); $("#totalOrderTotalAmount").text(addComma(totalAmount));