From bed767994e3c2a5c89105e8febe77e122d3a7eba Mon Sep 17 00:00:00 2001 From: hjjeong Date: Wed, 22 Oct 2025 20:53:46 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EC=98=81=EC=97=85=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?=EC=BB=A4=EB=B0=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../view/contractMgmt/estimateList_new.jsp | 32 +- .../view/contractMgmt/estimateTemplate1.jsp | 6 +- .../view/contractMgmt/orderMgmtList.jsp | 8 +- .../salesmgmt/salesMgmt/revenueMgmtList.jsp | 291 ++++++++++++------ .../SalesNcollectMgmtController.java | 36 ++- .../salesmgmt/mapper/salesNcollectMgmt.xml | 13 +- .../service/SalesNcollectMgmtService.java | 45 +++ 7 files changed, 302 insertions(+), 129 deletions(-) diff --git a/WebContent/WEB-INF/view/contractMgmt/estimateList_new.jsp b/WebContent/WEB-INF/view/contractMgmt/estimateList_new.jsp index 74fd096..1c95d2b 100644 --- a/WebContent/WEB-INF/view/contractMgmt/estimateList_new.jsp +++ b/WebContent/WEB-INF/view/contractMgmt/estimateList_new.jsp @@ -310,20 +310,24 @@ var columns = [ } }, // {headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '견적단가', field : 'EST_PRICE' }, - {headerHozAlign : 'center', hozAlign : 'center', width : '130', title : '견적공급가액', field : 'EST_TOTAL_AMOUNT', - formatter: function(cell, formatterParams, onRendered){ - var value = fnc_checkNull(cell.getValue()); - if(value === '' || value === '0') return ''; - return addComma(value); - } - }, - {headerHozAlign : 'center', hozAlign : 'center', width : '150', title : '견적원화환산공급가액', field : 'EST_TOTAL_AMOUNT_KRW', - formatter: function(cell, formatterParams, onRendered){ - var value = fnc_checkNull(cell.getValue()); - if(value === '' || value === '0') return ''; - return addComma(value); - } - }, + {headerHozAlign : 'center', hozAlign : 'right', width : '130', title : '견적공급가액', field : 'EST_TOTAL_AMOUNT', + formatter: function(cell, formatterParams, onRendered){ + var value = fnc_checkNull(cell.getValue()); + if(value === '' || value === '0') return ''; + // 통화 기호 제거 후 콤마 추가 + var numericValue = String(value).replace(/[^0-9.]/g, ''); + return addComma(numericValue); + } + }, + {headerHozAlign : 'center', hozAlign : 'right', width : '150', title : '견적원화환산공급가액', field : 'EST_TOTAL_AMOUNT_KRW', + formatter: function(cell, formatterParams, onRendered){ + var value = fnc_checkNull(cell.getValue()); + if(value === '' || value === '0') return ''; + // 통화 기호 제거 후 콤마 추가 + var numericValue = String(value).replace(/[^0-9.]/g, ''); + return addComma(numericValue); + } + }, {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '견적환종', field : 'CONTRACT_CURRENCY_NAME' }, {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '견적환율', field : 'EXCHANGE_RATE' }, diff --git a/WebContent/WEB-INF/view/contractMgmt/estimateTemplate1.jsp b/WebContent/WEB-INF/view/contractMgmt/estimateTemplate1.jsp index 99ba1c4..361887f 100644 --- a/WebContent/WEB-INF/view/contractMgmt/estimateTemplate1.jsp +++ b/WebContent/WEB-INF/view/contractMgmt/estimateTemplate1.jsp @@ -1054,9 +1054,9 @@ function fn_save() { return; } - // 합계 계산 (콤마 제거한 순수 숫자) - var totalAmount = $("#totalAmount").text().replace(/,/g, ""); - var totalAmountKRW = $("#totalAmountKRW").text().replace(/,/g, ""); + // 합계 계산 (통화 기호와 콤마 제거한 순수 숫자) + var totalAmount = $("#totalAmount").text().replace(/[^0-9.]/g, ""); + var totalAmountKRW = $("#totalAmountKRW").text().replace(/[^0-9.]/g, ""); // 디버깅: 품목 데이터 확인 console.log("저장할 품목 데이터:", items); diff --git a/WebContent/WEB-INF/view/contractMgmt/orderMgmtList.jsp b/WebContent/WEB-INF/view/contractMgmt/orderMgmtList.jsp index a491d77..ef7cea3 100644 --- a/WebContent/WEB-INF/view/contractMgmt/orderMgmtList.jsp +++ b/WebContent/WEB-INF/view/contractMgmt/orderMgmtList.jsp @@ -169,16 +169,16 @@ var columns = [ // {headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '단가', field : 'ORDER_UNIT_PRICE', // formatter:"money", formatterParams:{thousand:",", symbolAfter:"", precision:false,}, // }, - {headerHozAlign : 'center', hozAlign : 'center', width : '120', title : '수주공급가액', field : 'ORDER_SUPPLY_PRICE_SUM', + {headerHozAlign : 'center', hozAlign : 'right', width : '120', title : '수주공급가액', field : 'ORDER_SUPPLY_PRICE_SUM', formatter:"money", formatterParams:{thousand:",", symbolAfter:"", precision:false,}, }, - {headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '수주부가세', field : 'ORDER_VAT_SUM', + {headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '수주부가세', field : 'ORDER_VAT_SUM', formatter:"money", formatterParams:{thousand:",", symbolAfter:"", precision:false,}, }, - {headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '수주총액', field : 'ORDER_TOTAL_AMOUNT_SUM', + {headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '수주총액', field : 'ORDER_TOTAL_AMOUNT_SUM', formatter:"money", formatterParams:{thousand:",", symbolAfter:"", precision:false,}, }, - {headerHozAlign : 'center', hozAlign : 'center', width : '120', title : '수주원화총액', field : 'ORDER_TOTAL_AMOUNT_KRW', + {headerHozAlign : 'center', hozAlign : 'right', width : '120', title : '수주원화총액', field : 'ORDER_TOTAL_AMOUNT_KRW', formatter:"money", formatterParams:{thousand:",", symbolAfter:"", precision:false,}, }, {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '견적환종', field : 'CONTRACT_CURRENCY_NAME' }, diff --git a/WebContent/WEB-INF/view/salesmgmt/salesMgmt/revenueMgmtList.jsp b/WebContent/WEB-INF/view/salesmgmt/salesMgmt/revenueMgmtList.jsp index a2f2ac8..adbbec7 100644 --- a/WebContent/WEB-INF/view/salesmgmt/salesMgmt/revenueMgmtList.jsp +++ b/WebContent/WEB-INF/view/salesmgmt/salesMgmt/revenueMgmtList.jsp @@ -27,7 +27,21 @@ } $(document).ready(function(){ - fnc_datepick(); + _fnc_datepick(); + + // select2가 로드되었을 때만 초기화 + if(typeof $.fn !== 'undefined' && typeof $.fn.select2 === 'function') { + $('.select2').select2(); + + // 품번/품명 Select2 AJAX 초기화 (common.js의 새 함수 사용) + initPartSelect2Ajax("#search_partNo", "#search_partName", "#search_partObjId", { + debug: true // 디버깅 모드 활성화 + }); + } else { + console.error('select2 라이브러리가 로드되지 않았습니다.'); + console.error('$.fn:', $.fn); + } + //엔터키로 조회 $("input").keyup(function(e){ if(e.keyCode == 13){ @@ -40,22 +54,78 @@ $("#page").val("1"); fn_search(); }); + + $("#btnDeadline").click(function(){ + var targetObj = _tabulGrid.getSelectedData(); + + if(1 == targetObj.length){ + var OBJID = fnc_checkNull(targetObj[0].OBJID); + var status = fnc_checkNull(targetObj[0].SALES_STATUS); + //var settleAmount = fnc_checkNull(targetObj[0].SETTLE_AMOUNT); + + if(status == '' || status == null || status == '매출마감'){ + Swal.fire({ + title: '선택된 데이터를 매출마감 처리하시겠습니까?', + text: '', + icon: 'warning', + + showCancelButton: true, // cancel버튼 보이기. 기본은 원래 없음 + confirmButtonColor: '#3085d6', // confrim 버튼 색깔 지정 + cancelButtonColor: '#d33', // cancel 버튼 색깔 지정 + confirmButtonText: '확인', // confirm 버튼 텍스트 지정 + cancelButtonText: '취소', // cancel 버튼 텍스트 지정 + reverseButtons: false, // 버튼 순서 거꾸로 + + }).then(result => { + // 만약 Promise리턴을 받으면, + if (result.isConfirmed) { // 만약 모달창에서 confirm 버튼을 눌렀다면 + $.ajax({ + url:"/salesNcollectMgmt/salesDeadlineConfirm.do", + type:"POST", + data: {"OBJID" : OBJID}, + dataType:"json", + success:function(data){ + Swal.fire(data.msg); + fn_search(); + }, + error: function(jqxhr, status, error){ + } + }); + } + }); + }else{ + alert("매출마감 전 데이터만 매출마감 가능합니다."); + return false; + } + //var productGroup = fnc_checkNull(targetObj[0].PRODUCT_GROUP); + //var product = fnc_checkNull(targetObj[0].PRODUCT); + //var releaseObjId = fnc_checkNull(targetObj[0].RELEASE_OBJID); + }else if(0 == targetObj.length){ + Swal.fire("선택된 내용이 없습니다."); + return false; + }else if(1 < targetObj.length){ + Swal.fire("한번에 1개의 내용만 등록 가능합니다. "); + return false; + } + //fn_confirm(); + }); fn_search(); });