환종 컬럼 추가 : 구매리스트, M-BOM, 견적요청서, 품의서, 영문발주서, 발주서관리, 입고관리, 품목별 입고관리, 입고일별입고관리. 리스트 총액 컬럼에 총액앞 환종기호 추가.

This commit is contained in:
2026-03-18 09:58:11 +09:00
parent 64376ceb28
commit afb81d2b56
12 changed files with 260 additions and 26 deletions

View File

@@ -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";
}

View File

@@ -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";

View File

@@ -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";

View File

@@ -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') {

View File

@@ -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}

View File

@@ -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(){
<th style="width:110px;">품 명</th>
<th style="width:80px;">규 격</th>
<th style="width:80px;">업 체 명</th>
<th style="width:50px;">환 종</th>
<th style="width:90px;">입고요청일</th>
<th style="width:50px;">수량</th>
<th style="width:45px;">단위</th>
@@ -848,6 +851,15 @@ function fn_save(){
<td class="text-left">${item.DISPLAY_PART_NAME}</td>
<td class="text-left">${item.DISPLAY_SPEC}</td>
<td class="text-left">${item.VENDOR_NAME}</td>
<td class="text-center">
<select name="CURRENCY_${item.OBJID}" class="part-currency no-print-border" style="width:100%; box-sizing:border-box;">
<option value="">선택</option>
${code_map.currency_list}
</select>
<script>
$(function(){ $("select[name='CURRENCY_${item.OBJID}']").val("${item.CURRENCY}"); });
</script>
</td>
<td class="text-center">
<input type="text" name="DELIVERY_DATE_${item.OBJID}" class="part-delivery-date date_icon no-print-border" value="${item.DELIVERY_REQUEST_DATE_TITLE}" style="width:100%; box-sizing:border-box;" autocomplete="off"/>
</td>
@@ -868,7 +880,7 @@ function fn_save(){
</c:when>
<c:otherwise>
<tr>
<td colspan="12" style="height:100px;">등록된 품목이 없습니다.</td>
<td colspan="13" style="height:100px;">등록된 품목이 없습니다.</td>
</tr>
</c:otherwise>
</c:choose>
@@ -888,6 +900,7 @@ function fn_save(){
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</c:forEach>
</c:if>

View File

@@ -291,6 +291,15 @@ function fn_initGrid() {
field: 'VENDOR_NAME'
});
// 환종
columns.push({
headerHozAlign: 'center',
hozAlign: 'center',
width: 70,
title: '환종',
field: 'CURRENCY_NAME'
});
// 단가 (수정가능 - 클릭 시 전체 선택)
columns.push({
headerHozAlign: 'center',