diff --git a/WebContent/WEB-INF/view/purchaseOrder/purchaseOrderFormPopup_general.jsp b/WebContent/WEB-INF/view/purchaseOrder/purchaseOrderFormPopup_general.jsp index 5d6c727..adc4fc0 100644 --- a/WebContent/WEB-INF/view/purchaseOrder/purchaseOrderFormPopup_general.jsp +++ b/WebContent/WEB-INF/view/purchaseOrder/purchaseOrderFormPopup_general.jsp @@ -84,25 +84,7 @@ input.date_icon { letter-spacing: 20px; border: none !important; } -/* 결재란 */ -.approval-table { - border-collapse: collapse; - float: right; -} -.approval-table th, .approval-table td { - border: 1px solid #000; - text-align: center; - padding: 3px 10px; - font-size: 11px; - width: 55px; -} -.approval-table th { - background-color: #d9d9d9; - font-weight: normal; -} -.approval-table td { - height: 35px; -} + /* 기본정보 라벨 */ .info-label { font-weight: bold; @@ -163,34 +145,6 @@ input.date_icon { overflow-y: scroll !important; max-height: 350px !important; } -/* 합계 테이블 */ -.total-table { - width: 100%; - border-collapse: collapse; - margin-top: 10px; -} -.total-table td { - border: 1px solid #000; - padding: 8px; - font-size: 12px; -} -.total-table .label { - text-align: center; - font-weight: bold; - width: 60%; - letter-spacing: 5px; - -} -.total-table .currency { - width: 30px; - text-align: center; - font-weight: bold; - border-right: none !important; -} -.total-table .amount { - text-align: right; - font-weight: bold; -} /* 버튼 영역 */ .btn-area { text-align: left; @@ -199,6 +153,54 @@ input.date_icon { .graycolor { background-color: #d9d9d9; } +.total-section { + border: 1px solid #333; + width: 50%; +} +.total-section table { + width: 100%; + border-collapse: collapse; +} +.total-section td { + padding: 10px; + border: 1px solid #333; + font-size: 14px; +} +.total-section .label { + background-color: #e2efda; + font-weight: bold; + text-align: center; + width: 40%; + white-space: nowrap; +} +.total-section .amount { + text-align: right; + font-weight: bold; +} +.confidential-notice { + padding: 10px; + font-size: 12px; + text-align: right; + color: #cb3333; +} +/* jqGrid 내 Select2 스타일 */ +.ui-jqgrid .select2-container { + z-index: 9999; +} +.ui-jqgrid .select2-container--default .select2-selection--single { + height: 24px; + min-height: 24px; + border: none; + background: transparent; +} +.ui-jqgrid .select2-container--default .select2-selection--single .select2-selection__rendered { + line-height: 24px; + padding-left: 4px; + font-size: 12px; +} +.ui-jqgrid .select2-container--default .select2-selection--single .select2-selection__arrow { + height: 24px; +} @@ -218,25 +220,23 @@ $(document).ready(function(){ $(this).val(fnc_addComma($(this).val().replace(/[^0-9]/g,""))); }); - // 결재라인 가져오기 - fn_getApprLine(); - var unit_cd = $.parseJSON($("#unit_cd").val()); + var delivery_place_grid = $.parseJSON($("#delivery_place_grid").val()); // 그리드 초기화 grid = $("#grid1").jqGrid({ url: "" ,datatype: "local" ,data: $.parseJSON($("#gridDetailList").val()) - ,colNames: ["OBJID","PART_OBJID","PART_NO","No","품명","규격","수량","단위","배송지","단가","공급가액","비고"] + ,colNames: ["OBJID","PART_OBJID","PART_NO","No","품명","규격","수량","단위","배송지","단가","공급가액","비고","입고요청일"] ,colModel: [ {name:"OBJID" , hidden: true, sortable:false, editable:false} ,{name:"PART_OBJID" , hidden: true, sortable:false, editable:false} ,{name:"PART_NO" , hidden: true, sortable:false, editable:false} ,{name:"ROW_NUM" , width:40, align:"center", sortable:false, editable:false} - ,{name:"PART_NAME" , width:170, align:"left", sortable:false, editable:false} - ,{name:"SPEC" , width:180, align:"left", sortable:false, editable:<%= isModify %>} - ,{name:"ORDER_QTY" , width:60, align:"right", sortable:false, editable:<%= isModify %> + ,{name:"PART_NAME" , width:160, align:"left", sortable:false, editable:false} + ,{name:"SPEC" , width:120, align:"left", sortable:false, editable:false} + ,{name:"ORDER_QTY" , width:50, align:"right", sortable:false, editable:<%= isModify %> ,formatter:"integer", formatoptions:{thousandsSeparator:","} ,editoptions:{ dataInit: function(e){ e.style.textAlign = "right"; } @@ -247,18 +247,38 @@ $(document).ready(function(){ ,edittype:"select", formatter:"select" ,editoptions:{ value: unit_cd } } - ,{name:"PART_DELIVERY_PLACE" , width:80, align:"center", sortable:false, editable:<%= isModify %>} - ,{name:"PARTNER_PRICE" , width:90, align:"right", sortable:false, editable:<%= isModify %> - ,formatter:"integer", formatoptions:{thousandsSeparator:","} + ,{name:"PART_DELIVERY_PLACE", width:130, align:"center", sortable:false, editable:<%= isModify %> + ,edittype:"select", formatter:"select" + ,editoptions:{ + value: delivery_place_grid + ,defaultValue: "RPS" + ,dataInit: function(elem) { + var $el = $(elem); + if(!$el.val() || $el.val() === '') { + $el.val('RPS'); + } + setTimeout(function(){ + $el.select2({ + width: '100%' + ,dropdownAutoWidth: true + ,dropdownParent: $el.closest('.ui-jqgrid') + }); + }, 50); + } + } + } + ,{name:"PARTNER_PRICE" , width:80, align:"right", sortable:false, editable:<%= isModify %> + ,formatter:"number", formatoptions:{thousandsSeparator:",", decimalPlaces:2} ,editoptions:{ dataInit: function(e){ e.style.textAlign = "right"; } ,dataEvents: [{type:"change", fn:function(e){ gridFn.calcRowAll(e); }}] } } - ,{name:"SUPPLY_UNIT_PRICE", width:100, align:"right", sortable:false, editable:false - ,formatter:"integer", formatoptions:{thousandsSeparator:","} + ,{name:"SUPPLY_UNIT_PRICE", width:90, align:"right", sortable:false, editable:false + ,formatter:"number", formatoptions:{thousandsSeparator:",", decimalPlaces:2} } - ,{name:"REMARK" , width:120, align:"left", sortable:false, editable:<%= isModify %>} + ,{name:"REMARK" , width:100, align:"left", sortable:false, editable:<%= isModify %>} + ,{name:"DELIVERY_REQUEST_DATE", width:90, align:"center", sortable:false, editable:<%= isModify %>} ] ,rownumbers : false ,viewrecords : true @@ -346,17 +366,7 @@ $(document).ready(function(){ $("#btnAdd").click(function(){ fn_openPartMngListPopUp(); }); $("#btnDel").click(function(){ gridFn.delRow(); }); $("#btnSave").click(function(){ fn_save(); }); - $("#btnAppr").click(function(){ - if(fnc_valitate("form1")){ - var objId = "${objId}"; - if(""==grid.getRowData()){ - Swal.fire('저장할 품목이 존재 하지 않습니다'); - return; - } - var title = encodeURIComponent($("#TITLE").val()); - window.open("/approval/registApproval.do?targetType=PURCHASE_ORDER_GENERAL&targetObjId="+objId+"&approvalTitle="+title,"registApproval","width=700,height=700"); - } - }); + <% }else{ %> $("#btnDown").click(function(){ document.form1.action = "/purchaseOrder/purchaseOrderFormPopup_general.do?actType=DOWN&PURCHASE_ORDER_MASTER_OBJID=${objId}"; @@ -371,28 +381,6 @@ $(document).ready(function(){ gridFn.calcAllRows(); }); -// 결재라인 가져오기 -function fn_getApprLine(){ - if('${objId}'!=''){ - $.ajax({ - url:"/common/getApprovalLine.do", - type:"POST", - data:{"objId":"${objId}"}, - dataType:"json", - async:false, - success:function(data){ - $.each(data.RESULT, function(i,o){ - if(i==0){ - $("#appr_writer").html(o.WRITER); - } - if(i < 3){ - $("#appr"+(i+1)).html(o.TARGET_USER_NAME +"
"+ (o.PROC_DATE!=undefined?o.PROC_DATE:"")); - } - }); - } - }); - } -} // 행추가 팝업 function fn_openPartMngListPopUp(){ @@ -418,6 +406,7 @@ function fn_addRow(rowData){ ,"PARTNER_PRICE" : v2 ,"SUPPLY_UNIT_PRICE": _rowSum ,"REMARK" : "" + ,"DELIVERY_REQUEST_DATE" : "" }; grid.addRowData(newId, addData); @@ -538,12 +527,18 @@ var gridFn = { var vat = Math.floor(totalSupplyPrice * 0.1); var totalWithVat = totalSupplyPrice + vat; - $("#TOTAL_SUPPLY_PRICE").val(numberWithCommas(totalSupplyPrice)); - $("#TOTAL_VAT").val(numberWithCommas(vat)); - $("#TOTAL_PRICE_ALL").val(numberWithCommas(totalWithVat)); + $("#TOTAL_SUPPLY_PRICE").val(numberWithCommasDecimal(totalSupplyPrice)); + $("#TOTAL_VAT").val(numberWithCommasDecimal(vat)); + $("#TOTAL_PRICE_ALL").val(numberWithCommasDecimal(totalWithVat)); + $("#TOTAL_AMOUNT_DISPLAY").text(numberWithCommasDecimal(totalSupplyPrice) + " 원"); } } +function numberWithCommasDecimal(num) { + var n = Number(num); + return n.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ","); +} + // 라이브러리 로드 완료 후 dataLoaded 플래그 설정 $(window).on('load', function() { setTimeout(function() { @@ -762,18 +757,6 @@ function fn_generateAndUploadPdf(callback) { 발 주 서 - - - - - - - - - - - -
담당자부사장대표이사
전결전결
@@ -783,7 +766,7 @@ function fn_generateAndUploadPdf(callback) { - + - + + + + - + - - - - - +
1. 발 주 번 호 :1. 발 주 번 호 : @@ -804,7 +787,7 @@ function fn_generateAndUploadPdf(callback) {
4. 합 계 금 액(VAT별도) :
6. 결 제 방 식 :5. 결 제 방 식 :
7. 합 계 금 액 :
@@ -842,7 +825,7 @@ function fn_generateAndUploadPdf(callback) { 담 당 자 <% if(isModify){ %> - <% for(int u=0; u - (${info.MANAGER_PHONE} / ${info.MANAGER_EMAIL}) + (${info.MANAGER_PHONE} / ${info.MANAGER_EMAIL}) 직인 @@ -882,7 +865,7 @@ function fn_generateAndUploadPdf(callback) { <% if(isModify){ %> - <% for(int u=0; u - (${info.MANAGER_PHONE2} / ${info.MANAGER_EMAIL2}) + (${info.MANAGER_PHONE2} / ${info.MANAGER_EMAIL2}) - ㈜알피에스 대표이사 이 동 헌 + ㈜알피에스 대표이사 이 동 헌 - 대전광역시 유성구 국제과학10로8(둔곡동 402-4번지) + 대전광역시 유성구 국제과학10로8(둔곡동 402-4번지) + -
+ - -
-
- -
- - - - - - - - - - - - - - - - - - -
공 급 가 액
부 가 세
총 결 제 금 액 (VAT포함)
-
<% if(isModify){ %> @@ -969,8 +930,32 @@ function fn_generateAndUploadPdf(callback) { <% } %>
+ + +
+
+ +
+ + +
+ + + + + +
총 공 급 가 액 (VAT별도)
+
+ + + + +
+ ※ 보안문서(CONFIDENTIAL) : ㈜알피에스의 승인(APPROVAL) 없이 외부로 반출하거나 공유 할수 없습니다. +
+ diff --git a/src/com/pms/controller/PurchaseOrderController.java b/src/com/pms/controller/PurchaseOrderController.java index 4692ba8..4a164e7 100644 --- a/src/com/pms/controller/PurchaseOrderController.java +++ b/src/com/pms/controller/PurchaseOrderController.java @@ -757,24 +757,36 @@ public class PurchaseOrderController { detailRow.put("UNIT", "".equals(unit) ? "0001400" : unit); // 배송지 - detailRow.put("DELIVERY_PLACE", "RPS"); + detailRow.put("PART_DELIVERY_PLACE", "RPS"); // 단가 (대소문자 모두 체크) Object priceObj = partRow.get("UNIT_PRICE"); if(priceObj == null) priceObj = partRow.get("unit_price"); String priceStr = CommonUtils.checkNull(priceObj, "0").toString().replaceAll(",", ""); - int unitPrice = 0; - try { unitPrice = (int)Double.parseDouble(priceStr.equals("") ? "0" : priceStr); } catch(Exception e) { unitPrice = 0; } + double unitPrice = 0; + try { unitPrice = Double.parseDouble(priceStr.equals("") ? "0" : priceStr); } catch(Exception e) { unitPrice = 0; } detailRow.put("PARTNER_PRICE", unitPrice); // 공급가액 = 수량 * 단가 detailRow.put("SUPPLY_UNIT_PRICE", qty * unitPrice); - // 비고 (대소문자 모두 체크) - String remark = CommonUtils.checkNull(partRow.get("REMARK")); - if("".equals(remark)) remark = CommonUtils.checkNull(partRow.get("remark")); + // 비고: 제품명 / 부품명 형태 + String projectProductName = CommonUtils.checkNull(partRow.get("PROJECT_PRODUCT_NAME")); + String componentPartName = CommonUtils.checkNull(partRow.get("COMPONENT_PART_NAME")); + String remark = ""; + if(!"".equals(projectProductName) && !"".equals(componentPartName)) { + remark = projectProductName + " / " + componentPartName; + } else if(!"".equals(projectProductName)) { + remark = projectProductName; + } else if(!"".equals(componentPartName)) { + remark = componentPartName; + } detailRow.put("REMARK", remark); + // 입고요청일 + Object deliveryDateObj = partRow.get("DELIVERY_REQUEST_DATE"); + detailRow.put("DELIVERY_REQUEST_DATE", deliveryDateObj != null ? String.valueOf(deliveryDateObj).trim() : ""); + detailList.add(detailRow); } } @@ -793,6 +805,9 @@ public class PurchaseOrderController { param.put("code","0001399"); code_map.put("unit_cd", commonService.getJqGridSelectBoxJsonData2("common.getCodeselect", param, "선택", "CODE", "NAME")); + // 배송지 (jqGrid 셀렉트박스용 - 수신업체와 동일 데이터) + code_map.put("delivery_place_grid", commonService.getJqGridSelectBoxJsonData2("common.getClientMngSupplySelect", new HashMap(), "선택", "NAME", "NAME")); + // 결제조건 code_map.put("payment_terms_cd", commonService.bizMakeOptionList("0001074", (String)info.get("PAYMENT_TERMS"),"common.getCodeselect")); diff --git a/src/com/pms/mapper/purchaseOrder.xml b/src/com/pms/mapper/purchaseOrder.xml index 5b89b49..dbff7f5 100644 --- a/src/com/pms/mapper/purchaseOrder.xml +++ b/src/com/pms/mapper/purchaseOrder.xml @@ -890,6 +890,16 @@ COALESCE(NULLIF(SRP.UNIT, ''), PM.UNIT) AS UNIT, PM.MAKER, (SELECT PJ.PART_NAME FROM PROJECT_MGMT PJ WHERE PJ.OBJID::VARCHAR = SRM.PROJECT_NO) AS PROJECT_PRODUCT_NAME, + CASE WHEN COALESCE(SRP.MATERIAL_YN, 'N') = 'Y' AND SRM.MBOM_HEADER_OBJID IS NOT NULL THEN + COALESCE( + (SELECT MIN(PM2.PART_NAME) FROM MBOM_DETAIL MD2 + JOIN PART_MNG PM2 ON MD2.PART_OBJID::VARCHAR = PM2.OBJID::VARCHAR + WHERE MD2.RAW_MATERIAL_PART_NO = PM.PART_NO + AND MD2.MBOM_HEADER_OBJID::VARCHAR = SRM.MBOM_HEADER_OBJID::VARCHAR), + PM.PART_NAME + ) + ELSE PM.PART_NAME + END AS COMPONENT_PART_NAME, COALESCE(SRP.DELIVERY_REQUEST_DATE, CASE WHEN SRM.MBOM_HEADER_OBJID IS NOT NULL THEN CASE WHEN COALESCE(SRP.MATERIAL_YN, 'N') = 'Y' THEN diff --git a/src/com/pms/service/PurchaseOrderService.java b/src/com/pms/service/PurchaseOrderService.java index 99a1fd4..5b1d6be 100644 --- a/src/com/pms/service/PurchaseOrderService.java +++ b/src/com/pms/service/PurchaseOrderService.java @@ -1944,6 +1944,20 @@ public class PurchaseOrderService { partParam.put("PRODUCT_NAME", CommonUtils.checkNull(partMap.get("project_product_name"))); Object deliveryDateObj = partMap.get("delivery_request_date"); partParam.put("DELIVERY_REQUEST_DATE", deliveryDateObj != null ? String.valueOf(deliveryDateObj).trim() : ""); + + // 비고: 제품명 / 부품명 형태 + String projectProductName = CommonUtils.checkNull(partMap.get("project_product_name")); + String componentPartName = CommonUtils.checkNull(partMap.get("component_part_name")); + String remark = ""; + if(!"".equals(projectProductName) && !"".equals(componentPartName)) { + remark = projectProductName + " / " + componentPartName; + } else if(!"".equals(projectProductName)) { + remark = projectProductName; + } else if(!"".equals(componentPartName)) { + remark = componentPartName; + } + partParam.put("REMARK", remark); + partParam.put("WRITER", writer); partParam.put("STATUS", "create");