diff --git a/WebContent/WEB-INF/view/purchaseOrder/deliveryMngAcceptanceList.jsp b/WebContent/WEB-INF/view/purchaseOrder/deliveryMngAcceptanceList.jsp index 8e6254f..5521539 100644 --- a/WebContent/WEB-INF/view/purchaseOrder/deliveryMngAcceptanceList.jsp +++ b/WebContent/WEB-INF/view/purchaseOrder/deliveryMngAcceptanceList.jsp @@ -111,6 +111,7 @@ var columns = [ {headerHozAlign : 'center', hozAlign : 'left', minWidth : 140, widthGrow : 2, title : '품번', field : 'PART_NO' }, {headerHozAlign : 'center', hozAlign : 'left', minWidth : 180, widthGrow : 3, title : '품명', field : 'PART_NAME' }, {headerHozAlign : 'center', hozAlign : 'left', minWidth : 150, widthGrow : 2, title : '공급업체', field : 'PARTNER_NAME' }, + {headerHozAlign : 'center', hozAlign : 'center', minWidth : 60, widthGrow : 0.6, title : '환종', field : 'CURRENCY_NAME' }, {headerHozAlign : 'center', hozAlign : 'center', minWidth : 90, widthGrow : 1, title : '구매담당자', field : 'WRITER_NAME' }, {headerHozAlign : 'center', hozAlign : 'right', minWidth : 90, widthGrow : 1, title : '발주수량', field : 'TOTAL_PO_QTY', formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false } @@ -122,13 +123,46 @@ var columns = [ formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false } }, {headerHozAlign : 'center', hozAlign : 'right', minWidth : 90, widthGrow : 1, title : '발주금액', field : 'TOTAL_SUPPLY_PRICE', - formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false } + formatter: function(cell) { + var value = cell.getValue(); + if(!value || value === '' || value === '0') return ''; + var cn = cell.getRow().getData().CURRENCY_NAME || ''; + var s = ''; + if(cn.includes('원') || cn === 'KRW') s = '₩'; + else if(cn.includes('달러') || cn === 'USD') s = '$'; + else if(cn.includes('유로') || cn === 'EUR') s = '€'; + else if(cn.includes('엔') || cn === 'JPY') s = '¥'; + else if(cn.includes('위안') || cn === 'CNY') s = '¥'; + return s + Number(value).toLocaleString(); + } }, {headerHozAlign : 'center', hozAlign : 'right', minWidth : 90, widthGrow : 1, title : '입고금액', field : 'TOTAL_DELIVERY_PRICE', - formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false } + formatter: function(cell) { + var value = cell.getValue(); + if(!value || value === '' || value === '0') return ''; + var cn = cell.getRow().getData().CURRENCY_NAME || ''; + var s = ''; + if(cn.includes('원') || cn === 'KRW') s = '₩'; + else if(cn.includes('달러') || cn === 'USD') s = '$'; + else if(cn.includes('유로') || cn === 'EUR') s = '€'; + else if(cn.includes('엔') || cn === 'JPY') s = '¥'; + else if(cn.includes('위안') || cn === 'CNY') s = '¥'; + return s + Number(value).toLocaleString(); + } }, {headerHozAlign : 'center', hozAlign : 'right', minWidth : 90, widthGrow : 1, title : '미입고금액', field : 'TOTAL_NOT_DELIVERY_PRICE', - formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false } + formatter: function(cell) { + var value = cell.getValue(); + if(!value || value === '' || value === '0') return ''; + var cn = cell.getRow().getData().CURRENCY_NAME || ''; + var s = ''; + if(cn.includes('원') || cn === 'KRW') s = '₩'; + else if(cn.includes('달러') || cn === 'USD') s = '$'; + else if(cn.includes('유로') || cn === 'EUR') s = '€'; + else if(cn.includes('엔') || cn === 'JPY') s = '¥'; + else if(cn.includes('위안') || cn === 'CNY') s = '¥'; + return s + Number(value).toLocaleString(); + } }, {headerHozAlign : 'center', hozAlign : 'center', minWidth : 100, widthGrow : 1, title : '업체성적서', field : 'INSPECTION_FILE_CNT', formatter:fnc_subInfoValueFormatter, @@ -382,19 +416,21 @@ function fn_formPopUp(objId, formType){ var url = ""; if(formType == 'outsourcing'){ - // 외주가공 발주서 양식 target = "purchaseOrderFormPopup_outsourcing"; url = "/purchaseOrder/purchaseOrderFormPopup_outsourcing.do"; popup_width = 1200; popup_height = 900; + } else if(formType == 'english'){ + target = "purchaseOrderFormPopup_english"; + url = "/purchaseOrder/purchaseOrderFormPopup_english.do"; + popup_width = 1100; + popup_height = 900; } else if(formType == 'general'){ - // 일반 발주서 양식 target = "purchaseOrderFormPopup_general"; url = "/purchaseOrder/purchaseOrderFormPopup_general.do"; popup_width = 1000; popup_height = 900; } else { - // 기존 발주서 양식 (FORM_TYPE이 없거나 기존 데이터) target = "purchaseOrderFormPopup_new"; url = "/purchaseOrder/purchaseOrderFormPopup_new.do"; } diff --git a/WebContent/WEB-INF/view/purchaseOrder/deliveryMngAcceptancePartList.jsp b/WebContent/WEB-INF/view/purchaseOrder/deliveryMngAcceptancePartList.jsp index 1234f82..f76b09d 100644 --- a/WebContent/WEB-INF/view/purchaseOrder/deliveryMngAcceptancePartList.jsp +++ b/WebContent/WEB-INF/view/purchaseOrder/deliveryMngAcceptancePartList.jsp @@ -128,6 +128,7 @@ var columns = [ {headerHozAlign:'center', hozAlign:'left', minWidth:120, widthGrow:1.5, title:'품번', field:'PART_NO'}, {headerHozAlign:'center', hozAlign:'left', minWidth:150, widthGrow:2, title:'품명', field:'PART_NAME'}, {headerHozAlign:'center', hozAlign:'left', minWidth:120, widthGrow:1.2, title:'공급업체', field:'PARTNER_NAME'}, + {headerHozAlign:'center', hozAlign:'center', minWidth:60, widthGrow:0.6, title:'환종', field:'CURRENCY_NAME'}, {headerHozAlign:'center', hozAlign:'center', minWidth:100, widthGrow:0.8, title:'입고요청일', field:'DELIVERY_REQUEST_DATE'}, {headerHozAlign : 'center', hozAlign : 'center', minWidth : 90, widthGrow : 1, title : '구매담당자', field : 'WRITER_NAME' }, {headerHozAlign:'center', hozAlign:'right', minWidth:80, widthGrow:0.8, title:'발주수량', field:'ORDER_QTY', @@ -140,13 +141,46 @@ var columns = [ formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false} }, {headerHozAlign : 'center', hozAlign : 'right', minWidth : 90, widthGrow : 1, title : '발주금액', field : 'TOTAL_SUPPLY_PRICE', - formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false } + formatter: function(cell) { + var value = cell.getValue(); + if(!value || value === '' || value === '0') return ''; + var cn = cell.getRow().getData().CURRENCY_NAME || ''; + var s = ''; + if(cn.includes('원') || cn === 'KRW') s = '₩'; + else if(cn.includes('달러') || cn === 'USD') s = '$'; + else if(cn.includes('유로') || cn === 'EUR') s = '€'; + else if(cn.includes('엔') || cn === 'JPY') s = '¥'; + else if(cn.includes('위안') || cn === 'CNY') s = '¥'; + return s + Number(value).toLocaleString(); + } }, {headerHozAlign : 'center', hozAlign : 'right', minWidth : 90, widthGrow : 1, title : '입고금액', field : 'TOTAL_DELIVERY_PRICE', - formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false } + formatter: function(cell) { + var value = cell.getValue(); + if(!value || value === '' || value === '0') return ''; + var cn = cell.getRow().getData().CURRENCY_NAME || ''; + var s = ''; + if(cn.includes('원') || cn === 'KRW') s = '₩'; + else if(cn.includes('달러') || cn === 'USD') s = '$'; + else if(cn.includes('유로') || cn === 'EUR') s = '€'; + else if(cn.includes('엔') || cn === 'JPY') s = '¥'; + else if(cn.includes('위안') || cn === 'CNY') s = '¥'; + return s + Number(value).toLocaleString(); + } }, {headerHozAlign : 'center', hozAlign : 'right', minWidth : 90, widthGrow : 1, title : '미입고금액', field : 'TOTAL_NOT_DELIVERY_PRICE', - formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false } + formatter: function(cell) { + var value = cell.getValue(); + if(!value || value === '' || value === '0') return ''; + var cn = cell.getRow().getData().CURRENCY_NAME || ''; + var s = ''; + if(cn.includes('원') || cn === 'KRW') s = '₩'; + else if(cn.includes('달러') || cn === 'USD') s = '$'; + else if(cn.includes('유로') || cn === 'EUR') s = '€'; + else if(cn.includes('엔') || cn === 'JPY') s = '¥'; + else if(cn.includes('위안') || cn === 'CNY') s = '¥'; + return s + Number(value).toLocaleString(); + } }, {headerHozAlign:'center', hozAlign:'center', minWidth:90, widthGrow:1.1, title:'수입검사 검사현황', field:'INSPECTION_STATUS'}, {headerHozAlign:'center', hozAlign:'right', minWidth:80, widthGrow:1.1, title:'처리결과 폐기수량', field:'DEFECT_QTY', @@ -253,6 +287,11 @@ function fn_formPopUp(objId, formType){ url = "/purchaseOrder/purchaseOrderFormPopup_outsourcing.do"; popup_width = 1200; popup_height = 900; + } else if(formType == 'english'){ + target = "purchaseOrderFormPopup_english"; + url = "/purchaseOrder/purchaseOrderFormPopup_english.do"; + popup_width = 1100; + popup_height = 900; } else if(formType == 'general'){ target = "purchaseOrderFormPopup_general"; url = "/purchaseOrder/purchaseOrderFormPopup_general.do"; diff --git a/WebContent/WEB-INF/view/purchaseOrder/purchaseCloseList.jsp b/WebContent/WEB-INF/view/purchaseOrder/purchaseCloseList.jsp index 24603c5..5f03c2a 100644 --- a/WebContent/WEB-INF/view/purchaseOrder/purchaseCloseList.jsp +++ b/WebContent/WEB-INF/view/purchaseOrder/purchaseCloseList.jsp @@ -99,6 +99,7 @@ var columns = [ {headerHozAlign:'center', hozAlign:'left', minWidth:120, widthGrow:1.5, title:'품번', field:'PART_NO', frozen:true}, {headerHozAlign:'center', hozAlign:'left', minWidth:150, widthGrow:2, title:'품명', field:'PART_NAME', frozen:true}, {headerHozAlign:'center', hozAlign:'left', minWidth:120, widthGrow:1.2, title:'공급업체', field:'PARTNER_NAME'}, + {headerHozAlign:'center', hozAlign:'center', minWidth:60, widthGrow:0.6, title:'환종', field:'CURRENCY_NAME'}, {headerHozAlign:'center', hozAlign:'center', minWidth:90, widthGrow:0.7, title:'입고일', field:'RECEIPT_DATE'}, //{headerHozAlign:'center', hozAlign:'center', minWidth:100, widthGrow:0.8, title:'입고요청일', field:'DELIVERY_REQUEST_DATE'}, {headerHozAlign:'center', hozAlign:'center', minWidth:90, widthGrow:1, title:'구매담당자', field:'WRITER_NAME'}, @@ -115,7 +116,18 @@ var columns = [ // formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false} // }, {headerHozAlign:'center', hozAlign:'right', minWidth:90, widthGrow:1, title:'입고금액', field:'TOTAL_DELIVERY_PRICE', - formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false} + formatter: function(cell) { + var value = cell.getValue(); + if(!value || value === '' || value === '0') return ''; + var cn = cell.getRow().getData().CURRENCY_NAME || ''; + var s = ''; + if(cn.includes('원') || cn === 'KRW') s = '₩'; + else if(cn.includes('달러') || cn === 'USD') s = '$'; + else if(cn.includes('유로') || cn === 'EUR') s = '€'; + else if(cn.includes('엔') || cn === 'JPY') s = '¥'; + else if(cn.includes('위안') || cn === 'CNY') s = '¥'; + return s + Number(value).toLocaleString(); + } }, // {headerHozAlign:'center', hozAlign:'right', minWidth:90, widthGrow:1, title:'미입고금액', field:'TOTAL_NOT_DELIVERY_PRICE', // formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false} @@ -183,6 +195,11 @@ function fn_formPopUp(objId, formType){ url = "/purchaseOrder/purchaseOrderFormPopup_outsourcing.do"; popup_width = 1200; popup_height = 900; + } else if(formType == 'english'){ + target = "purchaseOrderFormPopup_english"; + url = "/purchaseOrder/purchaseOrderFormPopup_english.do"; + popup_width = 1100; + popup_height = 900; } else if(formType == 'general'){ target = "purchaseOrderFormPopup_general"; url = "/purchaseOrder/purchaseOrderFormPopup_general.do"; diff --git a/WebContent/WEB-INF/view/purchaseOrder/purchaseOrderFormPopup_english.jsp b/WebContent/WEB-INF/view/purchaseOrder/purchaseOrderFormPopup_english.jsp index 41a3f73..432d1f1 100644 --- a/WebContent/WEB-INF/view/purchaseOrder/purchaseOrderFormPopup_english.jsp +++ b/WebContent/WEB-INF/view/purchaseOrder/purchaseOrderFormPopup_english.jsp @@ -191,11 +191,14 @@ $(document).ready(function(){ var unit_cd = $.parseJSON($("#unit_cd").val()); var currency_cd = $.parseJSON($("#currency_cd").val()); + var _gridData = $.parseJSON($("#gridDetailList").val()); + console.log("=== gridDetailList ===", JSON.stringify(_gridData)); + console.log("=== currency_cd ===", JSON.stringify(currency_cd)); grid = $("#grid1").jqGrid({ url: "" ,datatype: "local" - ,data: $.parseJSON($("#gridDetailList").val()) + ,data: _gridData ,colNames: ["OBJID","PART_OBJID","Item No.","Commodity & Description","Spec","Unit","Q'ty","Currency","Unit Price","Amount","Delivery"] ,colModel: [ {name:"OBJID" , hidden: true, sortable:false, editable:false} @@ -216,7 +219,7 @@ $(document).ready(function(){ } ,{name:"CURRENCY" , width:65, align:"center", sortable:false, editable:<%= isModify %> ,edittype:"select", formatter:"select" - ,editoptions:{ value: currency_cd, defaultValue: "USD" } + ,editoptions:{ value: currency_cd, defaultValue: "0001534" } } ,{name:"PARTNER_PRICE" , width:80, align:"right", sortable:false, editable:<%= isModify %> ,formatter:"number", formatoptions:{thousandsSeparator:",", decimalPlaces:2} @@ -343,7 +346,7 @@ function fn_addRow(rowData){ ,"SPEC" : rowData.map.SPEC ,"ORDER_QTY" : v1 ,"UNIT" : fnc_checkNullDefaultValue(rowData.map.UNIT, '0001400') - ,"CURRENCY" : "USD" + ,"CURRENCY" : "0001534" ,"PARTNER_PRICE" : v2 ,"SUPPLY_UNIT_PRICE": _rowSum ,"DELIVERY_REQUEST_DATE" : "" @@ -464,11 +467,19 @@ var gridFn = { var vat = Math.floor(totalAmount * 0.1); var totalWithVat = totalAmount + vat; + var ids = grid.jqGrid('getDataIDs'); + var currencyCode = '0001534'; + if(ids.length > 0) { + var $sel = $("#grid1").find("#" + ids[0] + "_CURRENCY"); + currencyCode = $sel.length > 0 ? $sel.val() : (grid.jqGrid('getCell', ids[0], 'CURRENCY') || '0001534'); + } + var currencySymbol = getCurrencySymbol(currencyCode); + $("#TOTAL_AMOUNT").val(numberWithCommasDecimal(totalAmount)); $("#TOTAL_SUPPLY_PRICE").val(numberWithCommasDecimal(totalAmount)); $("#TOTAL_VAT").val(numberWithCommasDecimal(vat)); $("#TOTAL_PRICE_ALL").val(numberWithCommasDecimal(totalWithVat)); - $("#TOTAL_AMOUNT_DISPLAY").text("US$" + numberWithCommasDecimal(totalAmount)); + $("#TOTAL_AMOUNT_DISPLAY").text(currencySymbol + numberWithCommasDecimal(totalAmount)); } } @@ -477,6 +488,11 @@ function numberWithCommasDecimal(num) { return n.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ","); } +function getCurrencySymbol(currencyCode) { + var symbolMap = { '0001534': 'US$', '0001535': '€', '0001536': '¥', '0001537': '¥', '0001566': '₩' }; + return symbolMap[currencyCode] || 'US$'; +} + $(window).on('load', function() { setTimeout(function() { if(typeof html2canvas !== 'undefined' && typeof jspdf !== 'undefined') { diff --git a/WebContent/WEB-INF/view/purchaseOrder/purchaseOrderList_new.jsp b/WebContent/WEB-INF/view/purchaseOrder/purchaseOrderList_new.jsp index 93e4b89..c0ac38f 100644 --- a/WebContent/WEB-INF/view/purchaseOrder/purchaseOrderList_new.jsp +++ b/WebContent/WEB-INF/view/purchaseOrder/purchaseOrderList_new.jsp @@ -348,8 +348,20 @@ var columns = [ {headerHozAlign:'center', hozAlign:'left', widthGrow:1.5, title:'품번', field:'PART_NO'}, {headerHozAlign:'center', hozAlign:'left', widthGrow:2, title:'품명', field:'PART_NAME'}, {headerHozAlign:'center', hozAlign:'left', widthGrow:1.5, title:'공급업체', field:'PARTNER_NAME'}, + {headerHozAlign:'center', hozAlign:'center', widthGrow:0.6, title:'환종', field:'CURRENCY_NAME'}, {headerHozAlign:'center', hozAlign:'right', widthGrow:1.2, title:'총액', field:'TOTAL_SUPPLY_PRICE', - formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false} + formatter: function(cell) { + var value = cell.getValue(); + if(!value || value === '' || value === '0') return ''; + var currencyName = cell.getRow().getData().CURRENCY_NAME || ''; + var s = ''; + if(currencyName.includes('원') || currencyName === 'KRW') s = '₩'; + else if(currencyName.includes('달러') || currencyName === 'USD') s = '$'; + else if(currencyName.includes('유로') || currencyName === 'EUR') s = '€'; + else if(currencyName.includes('엔') || currencyName === 'JPY') s = '¥'; + else if(currencyName.includes('위안') || currencyName === 'CNY') s = '¥'; + return s + Number(value).toLocaleString(); + } }, // {headerHozAlign:'center', hozAlign:'right', widthGrow:1.2, title:'총액', field:'TOTAL_PRICE_ALL', // formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false} diff --git a/WebContent/WEB-INF/view/salesMng/proposalFormPopUp.jsp b/WebContent/WEB-INF/view/salesMng/proposalFormPopUp.jsp index a6c0aa2..821a5e6 100644 --- a/WebContent/WEB-INF/view/salesMng/proposalFormPopUp.jsp +++ b/WebContent/WEB-INF/view/salesMng/proposalFormPopUp.jsp @@ -396,7 +396,6 @@ var proposalStatus = "${resultMap.STATUS}"; var amaranthStatus = "${resultMap.AMARANTH_STATUS}"; var isReadOnly = (proposalStatus == "approvalComplete" || proposalStatus == "approvalRequest" || amaranthStatus == "complete" || amaranthStatus == "inProcess"); - $(document).ready(function(){ // 결재완료/결재중이면 수정 불가 처리 if(isReadOnly){ @@ -430,6 +429,7 @@ $(document).ready(function(){ changeYear: true }); } + }); // 숫자 포맷팅 @@ -452,12 +452,14 @@ function fn_save(){ var remark = $(this).find(".part-remark").val(); var deliveryDate = $(this).find(".part-delivery-date").val(); var unit = $(this).find(".part-unit").val(); + var currency = $(this).find(".part-currency").val(); partList.push({ PART_OBJID: String(partObjId), REMARK: remark, DELIVERY_REQUEST_DATE: deliveryDate, - UNIT: unit + UNIT: unit, + CURRENCY: currency }); }); @@ -827,6 +829,7 @@ function fn_save(){