diff --git a/WebContent/WEB-INF/view/purchaseOrder/purchaseOrderFormPopup_new.jsp b/WebContent/WEB-INF/view/purchaseOrder/purchaseOrderFormPopup_new.jsp
index 6684211..40479e6 100644
--- a/WebContent/WEB-INF/view/purchaseOrder/purchaseOrderFormPopup_new.jsp
+++ b/WebContent/WEB-INF/view/purchaseOrder/purchaseOrderFormPopup_new.jsp
@@ -91,7 +91,7 @@ $(document).ready(function(){
//상신된 결재라인 가져오기
fn_getApprLine();
//구매요청서 정보 가져오기
- fn_getSalesRequest();
+ //fn_getSalesRequest();
//grid.data = $.parseJSON($("#gridDetailList").val());
@@ -108,227 +108,38 @@ $(document).ready(function(){
,datatype: "local"
,data : $.parseJSON($("#gridDetailList").val())
,colNames: ["OBJID","PART_OBJID","LD_PART_OBJID"
- ,"품명"
- ,"품번"
- //,"품번2"
- ,"규격","메이커","단위","설계수량","수량","실발주수량"
- ,"공급단가"
- //,"레이져단가","용접단가","가공단가","후처리단가"
- ,"공급가","부가세","부가세포함공급가"
- ,"총발주수량","재고수량","재고수량(org)","총실발주수량","실공급가" //sum
+ ,"품명","품번","규격","메이커","단위"
+ ,"수량","단가","공급가"
]
,colModel: [
- {name:"OBJID" , index:"", width: 0, align:"center", hidden: true, sortable:false, editable:false}
- ,{name:"PART_OBJID" , index:"", width: 0, align:"center", hidden: true, sortable:false, editable:false}
- ,{name:"LD_PART_OBJID" , index:"", width: 0, align:"center", hidden: true, sortable:false, editable:false}
- ,{name:"PART_NAME" , index:"", width:200, align:"left", hidden:false, sortable:false, editable:false
+ {name:"OBJID" , hidden: true, sortable:false, editable:false}
+ ,{name:"PART_OBJID" , hidden: true, sortable:false, editable:false}
+ ,{name:"LD_PART_OBJID" , hidden: true, sortable:false, editable:false}
+ ,{name:"PART_NAME" , width:300, align:"left", sortable:false, editable:false}
+ ,{name:"PART_NO" , width:300, align:"left", sortable:false, editable:false, formatter:setLink}
+ ,{name:"SPEC" , width:180, align:"left", sortable:false, editable:false}
+ ,{name:"MAKER" , width:180, align:"left", sortable:false, editable:false}
+ ,{name:"UNIT" , width:60, align:"center", sortable:false, editable:true
+ ,edittype:"select", formatter:"select"
+ ,editoptions:{ value: unit_cd }
+ }
+ ,{name:"ORDER_QTY" , width:90, align:"right", sortable:false, editable:<%=isModify%>
+ ,formatter:"integer", formatoptions:{thousandsSeparator:","}
,editoptions:{
- dataInit: function(e){ e.style.textAlign = "left"; e.style.fontSize = 13; }
- ,dataEvents: [ {type:"change", fn:function(e) { }} ]
+ dataInit: function(e){ e.style.textAlign = "right"; }
+ ,dataEvents: [{type:"change", fn:function(e){ gridFn.calcRowAll(e); }}]
}
}
- ,{name:"PART_NO" , index:"", width:200, align:"left", hidden:false, sortable:false, editable:false
- <%--
- ,formatter:'showlink'
- ,formatoptions:{baseLinkUrl:'/partMng/partMngDetailPopUp.do', //?OBJID=
- //addParam: '&action=display&OBJID='
- //baseLinkUrl:'javascript:openPartMngPopup()',
- idName:'OBJID',
- addParam: function (options) {
- //console.log(options.rowData.PART_OBJID);
- //return "/partMng/partMngDetailPopUp.do?OBJID=" + options.rowData.PART_OBJID;
- //return 'openPartMngPopup(\"" + rowObject.PART_OBJID + "\");'
- //return 'openPartMngPopup(' + rowData.PART_OBJID + ')';
- return rowData.PART_OBJID;
- }
- }
- --%>
- ,formatter:setLink
+ ,{name:"PARTNER_PRICE" , width:110, align:"right", sortable:false, editable:true
+ ,formatter:"integer", formatoptions:{thousandsSeparator:","}
,editoptions:{
- dataInit: function(e){ e.style.textAlign = "left"; e.style.fontSize = 13; }
- ,dataEvents: [ {type:"change", fn:function(e) { }} ]
+ dataInit: function(e){ e.style.textAlign = "right"; }
+ ,dataEvents: [{type:"change", fn:function(e){ gridFn.calcRowAll(e); }}]
}
}
- <%--
- ,{name:"PART_OBJID" , index:"", width:110, align:"left", hidden:false, sortable:false, editable:false
- ,formatter:'showlink'
- ,formatoptions:{baseLinkUrl:'/partMng/partMngDetailPopUp.do', //?OBJID=
- //addParam: '&action=display&OBJID='
- //baseLinkUrl:'javascript:openPartMngPopup()',
- idName:'PART_OBJID',
- /*
- addParam: function (options) {
- //console.log(options.rowData.PART_OBJID);
- //return "/partMng/partMngDetailPopUp.do?OBJID=" + options.rowData.PART_OBJID;
- //return 'openPartMngPopup(\"" + rowObject.PART_OBJID + "\");'
- //return 'openPartMngPopup(' + rowData.PART_OBJID + ')';
- return rowData.PART_OBJID;
- }
- */
- }
- //,formatter:setLink
- ,editoptions:{
- dataInit: function(e){ e.style.textAlign = "left"; e.style.fontSize = 13; }
- ,dataEvents: [ {type:"change", fn:function(e) { }} ]
- }
+ ,{name:"SUPPLY_UNIT_PRICE", width:130, align:"right", sortable:false, editable:false
+ ,formatter:"integer", formatoptions:{thousandsSeparator:","}
}
- --%>
- ,{name:"SPEC" , index:"", width:140, align:"left", hidden:false, sortable:false, editable:false
- ,editoptions:{
- dataInit: function(e){ e.style.textAlign = "left"; e.style.fontSize = 13; }
- ,dataEvents: [ {type:"change", fn:function(e) { }} ]
- }
- }
- ,{name:"MAKER" , index:"", width:110, align:"left", hidden:false, sortable:false, editable:false
- ,editoptions:{
- dataInit: function(e){ e.style.textAlign = "left"; e.style.fontSize = 13; }
- ,dataEvents: [ {type:"change", fn:function(e) { }} ]
- }
- }
- ,{name:"UNIT" , index:"", width:52, align:"center", hidden:false, sortable:false, editable: true
- ,edittype :"select"
- ,formatter :"select"
- ,editoptions:{
- value: unit_cd
- ,dataInit : function(e){
- e.style.width = "92%";
- e.style.fontSize = 13;
- }
- }
- }
- ,{name:"BOM_QTY" , index:"", width:53, align: "right", hidden:true, sortable:false, editable: false
- ,formatter: "integer", formatoptions:{thousandsSeparator:","}
- ,editoptions:{
- dataInit: function(e){ e.style.textAlign = "right"; e.style.fontSize = 13; }
- ,dataEvents: [ {type:"change", fn:function(e) { gridFn.calcRowAll(e); }} ]
- }
- }
- ,{name:"QTY" , index:"", width:40, align: "right", hidden:false, sortable:false, editable: (<%=isModify%> && ('${info.TYPE}' == TYPE_BUY_ITEM ||'${info.TYPE}' == TYPE_ETC || '${info.TYPE}' == TYPE_LONG_DLV || '${info.TYPE}' == TYPE_SUBCONTRACT || "${info.ORDER_TYPE_CD}" == '0001408') ? true : false) <%--=isModify--%>
- //,formatter: "integer", formatoptions:{thousandsSeparator:","}
- ,editoptions:{
- dataInit: function(e){ e.style.textAlign = "right"; e.style.fontSize = 13; }
- ,dataEvents: [ {type:"change", fn:function(e) { gridFn.calcRowAll(e); }} ]
- }
- }
- ,{name:"ORDER_QTY" , index:"", width:53, align: "right", hidden:false, sortable:false, editable: false
- //,formatter: "integer", formatoptions:{thousandsSeparator:","}
- ,editoptions:{
- dataInit: function(e){ e.style.textAlign = "right"; e.style.fontSize = 13; }
- ,dataEvents: [ {type:"change", fn:function(e) { gridFn.calcRowAll(e); }} ]
- }
- }
- ,{name:"PARTNER_PRICE" , index:"", width:80, align: "right", hidden:false, sortable:false, editable: true
- ,formatter: "integer", formatoptions:{//decimalPlaces: 0, // 소수점 자리수 (0으로 설정하면 정수만 표시)
- thousandsSeparator:","}
- ,editoptions:{
- dataInit: function(e){ e.style.textAlign = "right"; e.style.fontSize = 13; }
- ,dataEvents: [ {type:"change", fn:function(e) { gridFn.calcRowAll(e); }
- }
- /*
- ,{type:"onclick", fn:function(e) {
- var rowid = this.id.replace("_PARTNER_PRICE","");
- var value = zero_to_null(this.value);
- grid.jqGrid('setCell', rowid, 'PARTNER_PRICE', value);
- }
- }
- */
- ]
- }
- }
- // ,{name:"PRICE1" , index:"", width:70, align: "right", hidden:false, sortable:false, editable: true
- // ,formatter: "integer", formatoptions:{thousandsSeparator:","}
- // ,editoptions:{
- // dataInit: function(e){ e.style.textAlign = "right"; e.style.fontSize = 13; }
- // ,dataEvents: [ {type:"change", fn:function(e) { gridFn.calcRowAll(e); }}
- /*
- ,
- {type:"focus", fn:function(e) {
- var rowid = this.id.replace("_PRICE1","");
- var value = zero_to_null(this.value);
- grid.jqGrid('setCell', rowid, 'PRICE1', value);
- }
- }
- */
- // ]
- // }
- // }
- // ,{name:"PRICE2" , index:"", width:60, align: "right", hidden:false, sortable:false, editable: true
- // ,formatter: "integer", formatoptions:{thousandsSeparator:","}
- // ,editoptions:{
- // dataInit: function(e){ e.style.textAlign = "right"; e.style.fontSize = 13; }
- // ,dataEvents: [ {type:"change", fn:function(e) { gridFn.calcRowAll(e); }} ]
- // }
- // }
- // ,{name:"PRICE3" , index:"", width:60, align: "right", hidden:false, sortable:false, editable: true
- // ,formatter: "integer", formatoptions:{thousandsSeparator:","}
- // ,editoptions:{
- // dataInit: function(e){ e.style.textAlign = "right"; e.style.fontSize = 13; }
- // ,dataEvents: [ {type:"change", fn:function(e) {
- // gridFn.calcRowAll(e); }} ]
- // }
- // }
- // ,{name:"PRICE4" , index:"", width:70, align: "right", hidden:false, sortable:false, editable: true
- // ,formatter: "integer", formatoptions:{thousandsSeparator:","}
- // ,editoptions:{
- // dataInit: function(e){ e.style.textAlign = "right"; e.style.fontSize = 13; }
- // ,dataEvents: [ {type:"change", fn:function(e) {
- // gridFn.calcRowAll(e); }} ]
- // }
- // }
- ,{name:"SUPPLY_UNIT_PRICE", index:"", width:100, align: "right", hidden:false, sortable:false, editable: true
- ,formatter: "integer", formatoptions:{thousandsSeparator:","}
- ,editoptions:{
- dataInit: function(e){ e.style.textAlign = "right"; e.style.fontSize = 13; }
- ,dataEvents: [ {type:"change", fn:function(e) { gridFn.calcRowAll(e); }} ]
- }
- }
- ,{name:"SUPPLY_UNIT_VAT_PRICE", index:"", /* width:70, */ align: "right", hidden:true, sortable:false, editable: true
- ,formatter: "integer", formatoptions:{thousandsSeparator:","}
- ,editoptions:{
- dataInit: function(e){ e.style.textAlign = "right"; e.style.fontSize = 13; }
- ,dataEvents: [ {type:"change", fn:function(e) { gridFn.calcRowAll(e); }} ]
- }
- }
- ,{name:"SUPPLY_UNIT_VAT_SUM_PRICE", index:"", width:110, align: "right", hidden:true, sortable:false, editable: true
- ,formatter: "integer", formatoptions:{thousandsSeparator:","}
- ,editoptions:{
- dataInit: function(e){ e.style.textAlign = "right"; e.style.fontSize = 13; }
- ,dataEvents: [ {type:"change", fn:function(e) { gridFn.calcRowAll(e);gridFn.calcRowAll(e); }} ]
- }
- }
- ,{name:"TOTAL_ORDER_QTY" , index:"", width:66, align: "right", hidden:false, sortable:false, editable: false
- ,formatter: "integer", formatoptions:{thousandsSeparator:","}
- ,editoptions:{
- dataInit: function(e){ e.style.textAlign = "right"; e.style.fontSize = 13; }
- ,dataEvents: [ {type:"change", fn:function(e) { gridFn.calcRowAll(e); }} ]
- }
- }
- ,{name:"STOCK_QTY" , index:"", width:55, align: "right", hidden:false, sortable:false, editable: <%=isModify%> //240426 임시로 수정 가능하게 반영 editable: editable
- ,formatter: "integer", formatoptions:{thousandsSeparator:","}
- ,editoptions:{
- dataInit: function(e){ e.style.textAlign = "right"; e.style.fontSize = 13; }
- ,dataEvents: [ {type:"change", fn:function(e) { gridFn.calcRowAll(e); }} ]
- }
- }
- ,{name:"STOCK_QTY_ORG" , index:"", width:55, align: "right", hidden:true, sortable:false, editable: false
- ,formatter: "integer", formatoptions:{thousandsSeparator:","}
- ,editoptions:{
- dataInit: function(e){ e.style.textAlign = "right"; e.style.fontSize = 13; }
- ,dataEvents: [ {type:"change", fn:function(e) { gridFn.calcRowAll(e); }} ]
- }
- }
- ,{name:"REAL_ORDER_QTY" , index:"", width:79, align: "right", hidden:false, sortable:false, editable: false //240501 입력으로 변경하려다 stop
- ,formatter: "integer", formatoptions:{thousandsSeparator:","}
- ,editoptions:{
- dataInit: function(e){ e.style.textAlign = "right"; e.style.fontSize = 13; }
- }
- }
- ,{name:"REAL_SUPPLY_PRICE" , index:"", width:96, align: "right", hidden:false, sortable:false, editable: false
- ,formatter: "integer", formatoptions:{thousandsSeparator:","}
- ,editoptions:{
- dataInit: function(e){ e.style.textAlign = "right"; e.style.fontSize = 13; }
- }
- }
]
,ignoreCase : true
,rownumbers : false
@@ -346,22 +157,12 @@ $(document).ready(function(){
,userDataOnFooter: true //바닥합계
//,caption :"제목"
,loadComplete: function(){
-
- /*
- var ids = $("#grid1").jqGrid('getDataIDs');
- //var arrNumColumNames = ['PARTNER_PRICE', 'PRICE1', 'PRICE2', 'PRICE3', 'PRICE4']
- for (var i = 0; i < ids.length; i++) {
- var rowId = ids[i];
- var cellValue = $("#grid").jqGrid('getCell', rowId, 'PARTNER_PRICE');
- //var formattedValue = cellValue.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
- $("#grid").jqGrid('setCell', rowId, 'PARTNER_PRICE', numberWithCommas(cellValue));
- }
- */
-
var gid = this.id;
var grid_wrap_div = $("#gbox_"+gid);
setTimeout("fn_jqGrid_init($('#"+gid+"'), false);", 50); //윈도우크기 비례 자동조절
+ // 디버깅: 데이터 확인
+
//footer 커스텀..
var $fr = $(this.grid.sDiv).find("tr.footrow");
var $frNew1;
@@ -415,6 +216,9 @@ $(document).ready(function(){
$("td", $(".footerRowNew1")).slice(0,_idx+1).css({"background-color":"#e4e4e4"});
$("td", $(".footerRowNew1")).slice(_idx+1).css({"background-color":"#e4e4e4"}); //(옅은핑크)
$("#TOTAL_SUPPLY_PRICE,#TOTAL_SUPPLY_UNIT_PRICE,#TOTAL_REAL_SUPPLY_PRICE").css({"background-color":"#fbead9"});
+
+ // 합계 계산
+ setTimeout(function(){ gridFn.footerSummary(); }, 100);
}
,beforeSubmitCell: function (rowid, cellname, value, iRow, iCol) {
// 'linkColumn' 컬럼에 대해서만 링크 태그를 제외하고 값만 전송
@@ -432,11 +236,27 @@ $(document).ready(function(){
},
});
- if("${info.PARTNER_OBJID}" != "" && ("${info.SALES_REQUEST_OBJID}" != "" || "${info.SALES_REQUEST_OBJID}" != null)){
- changelist("${info.PARTNER_OBJID}");
+ // 이미 저장된 발주서(OBJID가 있는 경우)는 그리드 데이터는 유지하고 공급처 정보만 가져옴
+ if("${info.OBJID}" != "" && "${info.PARTNER_OBJID}" != ""){
+ // 공급처 정보만 가져오기
+ var list = fnc_getJsonAllDataListBySqlId({"sqlId":"purchaseOrder.purchaseOrderAdminSupplyInfo", "PARTNER_OBJID":"${info.PARTNER_OBJID}"});
+ if(fnc_checkNull(list) != ""){
+ var row = list[0];
+ $("#SUPPLY_BUS_NO").val(row["SUPPLY_BUS_NO"]);
+ $("#SUPPLY_USER_NAME").val(row["SUPPLY_USER_NAME"]);
+ $("#SUPPLY_USER_HP").val(row["SUPPLY_USER_HP"]);
+ $("#SUPPLY_USER_TEL").val(row["SUPPLY_USER_TEL"]);
+ $("#SUPPLY_USER_FAX").val(row["SUPPLY_USER_FAX"]);
+ $("#SUPPLY_USER_EMAIL").val(row["SUPPLY_USER_EMAIL"]);
+ $("#SUPPLY_ADDR").val(row["SUPPLY_ADDR"]);
+ }
+ } else if("${info.PARTNER_OBJID}" != "" && "${info.SALES_REQUEST_OBJID}" != ""){
+ // 신규 작성시 changelist 호출
+ changelist("${info.PARTNER_OBJID}");
}
gridFn.opennEdit(); //수정가능
+ gridFn.footerSummary(); // 합계 계산
<% if(isModify){ %>
@@ -604,54 +424,55 @@ $(document).ready(function(){
fn_setMultiInfo(val); //동시적용 정보 셋팅
});
//발주구분,프로젝트,유닛명,공급업체 변경시 - 구매BOM에서 등록한 PART정보를 가져온다
- $("#TYPE,#CONTRACT_MGMT_OBJID,#UNIT_CODE,#PARTNER_OBJID").change(function(){
+ //$("#TYPE,#CONTRACT_MGMT_OBJID,#UNIT_CODE,#PARTNER_OBJID").change(function(){
//alert(_PRE_ORDER_TYPE_CD);
- var ORDER_TYPE_CD = $("#ORDER_TYPE_CD").val(); //발주구분
- if("${info.SALES_REQUEST_OBJID}"=="" || "${info.SALES_REQUEST_OBJID}" == null){
- if(ORDER_TYPE_CD == '0001407'){ //신규면 자동조회 //재발주(0001408)가 아니면 초기화(자동 조회)
- addBomPart(); //이전 발주 목록
- }
- }
- });
+ // var ORDER_TYPE_CD = $("#ORDER_TYPE_CD").val(); //발주구분
+ // if("${info.SALES_REQUEST_OBJID}"=="" || "${info.SALES_REQUEST_OBJID}" == null){
+ // if(ORDER_TYPE_CD == '0001407'){ //신규면 자동조회 //재발주(0001408)가 아니면 초기화(자동 조회)
+ // addBomPart(); //이전 발주 목록
+ // }
+ // }
+ //});
- $("#ORDER_TYPE_CD").change(function(){ //발주구분
- var ORDER_TYPE_CD = $("#PURCHASE_ORDER_NO_ORG").val("");
+ // $("#ORDER_TYPE_CD").change(function(){ //발주구분
+ // var ORDER_TYPE_CD = $("#PURCHASE_ORDER_NO_ORG").val("");
- //alert(_PRE_ORDER_TYPE_CD);
- if(!fnc_isEmpty(_PRE_ORDER_TYPE_CD) || fnc_isEmpty(ORDER_TYPE_CD)){ //이전이 선택이 아니거나 선택 선택하면 초기화
- getPartData(''); //품목 초기화
- }
- if($(this).val() == '0001408'){//재발주
- var partnerObjid = $("#PARTNER_OBJID").val();
- //alert("partnerObjid:"+partnerObjid);
- $("#PURCHASE_ORDER_NO_ORG").prop("disabled","");
- $("#PURCHASE_ORDER_NO_ORG").prop("required","required");
- fnc_getPurchaseOrderCdListAppend("PURCHASE_ORDER_NO_ORG","${info.PURCHASE_ORDER_NO_ORG}","",partnerObjid); //발주 정보목록
- }else{
- $("#PURCHASE_ORDER_NO_ORG").prop("disabled","disabled");
- $("#PURCHASE_ORDER_NO_ORG").prop("required","");
- if($(this).val() == '0001407'){//신규
- addBomPart();
- }
- }
- $("#PURCHASE_ORDER_NO_ORG").trigger("change");
- //$("#PARTNER_OBJID").trigger("change");
- _PRE_ORDER_TYPE_CD = $(this).val(); //이전 값 저장
- });
+ // //alert(_PRE_ORDER_TYPE_CD);
+ // // if(!fnc_isEmpty(_PRE_ORDER_TYPE_CD) || fnc_isEmpty(ORDER_TYPE_CD)){ //이전이 선택이 아니거나 선택 선택하면 초기화
+ // // getPartData(''); //품목 초기화
+ // // }
+ // if($(this).val() == '0001408'){//재발주
+ // var partnerObjid = $("#PARTNER_OBJID").val();
+ // //alert("partnerObjid:"+partnerObjid);
+ // $("#PURCHASE_ORDER_NO_ORG").prop("disabled","");
+ // $("#PURCHASE_ORDER_NO_ORG").prop("required","required");
+ // fnc_getPurchaseOrderCdListAppend("PURCHASE_ORDER_NO_ORG","${info.PURCHASE_ORDER_NO_ORG}","",partnerObjid); //발주 정보목록
+ // }else{
+ // $("#PURCHASE_ORDER_NO_ORG").prop("disabled","disabled");
+ // $("#PURCHASE_ORDER_NO_ORG").prop("required","");
+ // if($(this).val() == '0001407'){//신규
+ // addBomPart();
+ // }
+ // }
+ // $("#PURCHASE_ORDER_NO_ORG").trigger("change");
+ // //$("#PARTNER_OBJID").trigger("change");
+ // _PRE_ORDER_TYPE_CD = $(this).val(); //이전 값 저장
+ // });
- $("#PURCHASE_ORDER_NO_ORG").change(function(){
- var val = $(this).val();
- if(fnc_isNotEmpty(val)){
- getPartData(val);
- //changelist(val);
- }else{
- }
- });
+ // $("#PURCHASE_ORDER_NO_ORG").change(function(){
+ // var val = $(this).val();
+ // if(fnc_isNotEmpty(val)){
+ // getPartData(val);
+ // //changelist(val);
+ // }else{
+ // }
+ // });
fnc_datepick(); //달력
$(".select2").select2();
gridFn.opennEdit(); //수정가능
+ gridFn.footerSummary(); // 합계 계산
//버튼
$("#btnAdd" ).click(function(){ fn_openPartMngListPopUp(); }); //행추가
@@ -701,23 +522,23 @@ $(document).ready(function(){
});
//유닛명
- if("${info.CONTRACT_MGMT_OBJID}"!=""){
- fn_UnitCodeList("${info.CONTRACT_MGMT_OBJID}", "UNIT_CODE","");
- $("#UNIT_CODE").val("${info.UNIT_CODE}");
- }
+ // if("${info.CONTRACT_MGMT_OBJID}"!=""){
+ // fn_UnitCodeList("${info.CONTRACT_MGMT_OBJID}", "UNIT_CODE","");
+ // $("#UNIT_CODE").val("${info.UNIT_CODE}");
+ // }
//프로젝트번호 triggger로 동시적용 정보 셋팅(240109)
- $("#CONTRACT_MGMT_OBJID").val("${info.CONTRACT_MGMT_OBJID}");
+ //$("#CONTRACT_MGMT_OBJID").val("${info.CONTRACT_MGMT_OBJID}");
//$("#CONTRACT_MGMT_OBJID").trigger("change");
- fn_setMultiInfo("${info.CONTRACT_MGMT_OBJID}")
- fn_setMultiInfoForSaved("${info.CONTRACT_MGMT_OBJID}"); //동시적용 정보 셋팅
+ //fn_setMultiInfo("${info.CONTRACT_MGMT_OBJID}")
+ //fn_setMultiInfoForSaved("${info.CONTRACT_MGMT_OBJID}"); //동시적용 정보 셋팅
fnc_datepick(); //달력
$(".select2").select2();
//동시프로젝트 선택
- $(".APPLICATION_PROJECT_NO").on("change", function() {
- reCalculatePrice();
- });
+ // $(".APPLICATION_PROJECT_NO").on("change", function() {
+ // reCalculatePrice();
+ // });
addZeroEvtAtPriceInput();
@@ -1087,18 +908,17 @@ function zero_to_null(value){
}
}
function setLink(cellval, options, rowObject) {
-
if(typeof(cellval) == "undefined") {
- return "";
+ return "";
}
-
+
if(fnc_isEmpty(rowObject.PART_OBJID)){
- return rowObject.PART_NO
+ return rowObject.PART_NO;
}else{
if(rowObject.PART_NO.indexOf('openPartMngPopup') < 0){
return "" + rowObject.PART_NO + "";
}else{
- return rowObject.PART_NO
+ return rowObject.PART_NO;
}
}
}
@@ -1148,6 +968,7 @@ function fn_getApprLine(){
}
function fn_getSalesRequest(){
+ //alert("1234")
if('${param.sales_request_objid}'!=''){
$.ajax({
url:"/salesMng/getSalesRequest.do",
@@ -1513,65 +1334,24 @@ function fn_save(){
function fn_checkQty(){
var isValid = true;
var $g = $("#grid1");
- //var rowId = $g.jqGrid('getGridParam', 'selrow'); //선택된행 번호
- var isValid = true;
var ids = grid.jqGrid("getDataIDs");
for (var i = 0; i < ids.length; i++) {
- var rowId = ids[i]; //수정중인 행번호 (행선택은 안될수있음)
- var v1 = Number( fnc_checkNullDefaultValue($g.find("#"+rowId+"_ORDER_QTY").val(), grid.jqGrid('getCell', rowId, "ORDER_QTY")).replace(/,/gi,"") );
- var v2 = Number( $g.find("#"+rowId+"_PARTNER_PRICE").val().replace(/,/gi,"") );
- var v3 = Number( $g.find("#"+rowId+"_PRICE1").val().replace(/,/gi,"") );
- var v4 = Number( $g.find("#"+rowId+"_PRICE2").val().replace(/,/gi,"") );
- var v5 = Number( $g.find("#"+rowId+"_PRICE3").val().replace(/,/gi,"") );
- var v6 = Number( $g.find("#"+rowId+"_PRICE4").val().replace(/,/gi,"") );
- //var q1 = Number( $g.find("#"+rowId+"_TOTAL_ORDER_QTY").val().replace(/,/gi,"") );
- var q1 = grid.jqGrid('getCell', rowId, "TOTAL_ORDER_QTY").replace(/,/gi,"");
- var q2 = Number( fnc_checkNullDefaultValue($g.find("#"+rowId+"_STOCK_QTY").val(), grid.jqGrid('getCell', rowId, "STOCK_QTY")).replace(/,/gi,"") );
- var q3 = grid.jqGrid('getCell', rowId, "REAL_ORDER_QTY").replace(/,/gi,"");
- //var q3 = Number( $g.find("#"+rowId+"_REAL_ORDER_QTY").val().replace(/,/gi,"") );
- //var v6 = Number( $g.find("#"+rowId+"_SUPPLY_UNIT_PRICE").val() );
-
- var sameProjectCount = fn_getProjectCount();
- //alert(v1);
- /*
- if(!$.isNumeric( fnc_checkNullDefaultValue(eVal,"0")) ){
- Swal.fire("숫자를 입력해주세요."); $(e.target).select(); return;
- }
- else if(v1<=q2){
- Swal.fire("재고수량은 마지막 동시발주건의 수량이 입력되도록 수량보다 작아야 합니다."); $(e.target).select(); return;
- }
- */
+ var rowId = ids[i];
+ // 수량
+ var qtyVal = fnc_checkNullDefaultValue($g.find("#"+rowId+"_ORDER_QTY").val(), grid.jqGrid('getCell', rowId, "ORDER_QTY"));
+ var v1 = Number((qtyVal || "0").toString().replace(/,/gi,""));
+ // 단가
+ var priceVal = fnc_checkNullDefaultValue($g.find("#"+rowId+"_PARTNER_PRICE").val(), grid.jqGrid('getCell', rowId, "PARTNER_PRICE"));
+ var v2 = Number((priceVal || "0").toString().replace(/,/gi,""));
- if( !$.isNumeric(v1)
- || !$.isNumeric(v2)
- || !$.isNumeric(v3)
- || !$.isNumeric(v4)
- || !$.isNumeric(v5)
- || !$.isNumeric(v6)
- || !$.isNumeric(q1)
- || !$.isNumeric(q2)
- || !$.isNumeric(q3)
- ){
- Swal.fire("단가와 수량은 숫자로 입력해 주세요."); $(e.target).select(); return;
+ if(!$.isNumeric(v1) || !$.isNumeric(v2)){
+ Swal.fire("단가와 수량은 숫자로 입력해 주세요.");
+ isValid = false;
+ break;
} else if(v1 < 1){
- Swal.fire("실발주수량은 0보다 커야합니다.");
+ Swal.fire("수량은 0보다 커야합니다.");
isValid = false;
break;
- }else if(q3 < 1){
- Swal.fire("총실발주수량이 0보다 커야합니다.");
- isValid = false;
- break;
- /*
- }else if(sameProjectCount > 1 && q1 - q2 < v1){
- Swal.fire("총 발주수량이 수량만큼은 확보되도록 재고수량을 입력해 주세요.");
- isValid = false;
- break;
- */
- }else if(q1){
- //$("#"+rowId+"_QTY").val(numberWithCommas( ORDER_QTY ));
- $("#"+rowId+"_ORDER_QTY").val(numberWithCommas( ORDER_QTY ));
- }else{
- //$g.jqGrid('setCell', rowId, "QTY", numberWithCommas( ORDER_QTY ));
- $g.jqGrid('setCell', rowId, "ORDER_QTY", numberWithCommas( ORDER_QTY ));
- }
- $g.jqGrid('setCell', rowId, "ORDER_QTY", numberWithCommas( ORDER_QTY ));
- }
-
- if(v1 < 1){
- Swal.fire("실발주수량은 0보다 커야합니다."); $(e.target).select(); return;
- }else if(realQ < 1){
- Swal.fire("총실발주수량이 0보다 커야합니다."); $(e.target).select(); return;
- /*
- }else if(sameProjectCount > 1 && q1 - q2 < v1){
- Swal.fire("총 발주수량이 수량만큼은 확보되도록 재고수량을 입력해 주세요."); $(e.target).select(); return;
- */
- }else if(q1
- | 유닛명 |
+
발 주 서
(Purchase Order) |
@@ -2124,7 +1774,7 @@ function fn_price_save(){
|
- | 발주서 No. |
+
+ 제목 |
+ |
+ 부가세포함 발주금액(원) |
+
|
<%--
@@ -2212,7 +1862,7 @@ function fn_price_save(){
-