/* --------------------------------------------------------------------- ±¸¸Å°è¾à°ü¸® °øÅë - Version : 1) : Ver.1.00.01 : Create By Chungpd : 2010.10.06 ---------------------------------------------------------------------- */ // ÃʱâÈ­Çϱâ function fInitialize(teamflag) { // ±ÝÀÏ ³¯ÀÚ ¼³Á¤ var curdate = getCurrentDate(); var cvtdate = curdate.toDate("YYYYMMDD"); misfComboComCdList("030M0005",cmb_teamflag); misfComboComCdList("030M0013",cmb_conflag); misfComboComCdList("030M0001",cmb_wareflag_search); misfComboComCdList("030M0008",cmb_deftconratecd); addComboItem( "cmb_wareflag_search", "Àüü", "", "above"); //misfComboCopyItemSet(cmb_wareflag ,"" , cmb_wareflag_search, ""); //â°í±¸ºÐ misfComboComCdListMulti("Z0007","cmb_instcd"); model.setValue("/root/send/search/instcd", getUserInfo("dutplceinstcd")); // ±â°ü ¼³Á¤ // º´¿øÁ¤º¸¸¦ °¡Á®¿À±â rszfRscsysinftLists(getUserInfo("dutplceinstcd")); //model.setValue(ipt_windtfrom.attribute("ref") ,cvtdate.getAddDate(-10,"D").getDateFormat("YYYYMMDD")); model.setValue(cal_purccondd_search.attribute("ref") , curdate); model.setValue("/root/send/nosearch/instcd" , model.getValue(cmb_instcd.attribute("ref"))); model.setValue("/root/send/nosearch/purccondd" , model.getValue(cal_purccondd_search.attribute("ref"))); if (submit("TRRSP00102")){ var purcconno = model.getValue("/root/main/list/purcconnoinfo/maxpurcconno/purcconno"); model.setValue(ipt_purcconno_search.attribute("ref"), purcconno); } model.setValue("/root/send/nosearch/instcd" , ""); model.setValue("/root/send/nosearch/purccondd" , ""); model.setValue(ipt_teamflag.attribute("ref"), teamflag); btn_search.dispatch("DOMActivate"); model.refresh(); } // Á¶È¸Çϱâ function fSearch() { var spath = "/root/main/list/purcconinfo" model.removeNodeset(spath); if (submit("TRRSP00101")){ model.removeNodeset("/root/submain/list/purcconinfo"); model.makeNode("/root/submain/list/purcconinfo"); model.copyNode("/root/submain/list/purcconinfo", "/root/main/list/purcconinfo"); } var vInstance = document.models(0).instances(0); var cnt = vInstance.selectNodes("/root/main/list/purcconinfo/purcconmainlist").length; if (cnt == 0){ var spath = "/root/main/list/purcconinfo/purcconmainlist"; model.makeNode(spath+"/purccondd" ); model.makeNode(spath+"/purcconno" ); model.makeNode(spath+"/goodkindcnt" ); model.makeNode(spath+"/teamflag" ); model.makeNode(spath+"/acntcd" ); model.makeNode(spath+"/acntnm" ); model.makeNode(spath+"/notino" ); model.makeNode(spath+"/suplplcecd" ); model.makeNode(spath+"/suplplcenm" ); model.makeNode(spath+"/supdd" ); model.makeNode(spath+"/chrgid" ); model.makeNode(spath+"/chrgnm" ); model.makeNode(spath+"/flwrpirtermyy"); model.makeNode(spath+"/flwrpirper" ); model.makeNode(spath+"/suppos" ); model.makeNode(spath+"/conflag" ); model.makeNode(spath+"/totconamt" ); model.makeNode(spath+"/goodcntnm" ); model.makeNode(spath+"/congrntamt" ); model.makeNode(spath+"/grntexchrate" ); model.makeNode(spath+"/expsschedate" ); model.makeNode(spath+"/deftconratecd"); model.makeNode(spath+"/cmt" ); model.makeNode(spath+"/contermfromdd"); model.makeNode(spath+"/contermtodd" ); model.makeNode(spath+"/newyn" ); model.makeNode(spath+"/updtgoodcntyn"); model.makeNode(spath+"/titlecd"); } if (model.getValue(cal_purccondd.attribute("ref")).getTrim() == ""){ fConDisabledControl(true); }else{ fConDisabledControl(false); } fDisabledControl(true); ipt_goodcntnm.disabled = true; fCalcAmt(); fDispSumAmt(); model.refresh(); } // Çະ »èÁ¦ function fRowDel(){ var prestatus = grd_purccon.valueMatrix(grd_purccon.row,grd_purccon.colRef("prestatus")); if (prestatus == "U"){ if (grd_purccon.valueMatrix(grd_purccon.row, grd_purccon.colRef("lastwindd")) != ""){ messageBox(grd_purccon.row+"¹øÂ°´Â ÀÔ°í 󸮵È", "I009"); }else{ grd_purccon.rowStatus(grd_purccon.row) = "4"; } }else{ grd_purccon.deleteRow(grd_purccon.row); } fGetGoodcntnm(); } // (½Å±Ô °è¾à°Ç) ÀÔ·ÂÇϱâ function fInpt(teamflag) { // ±ÝÀÏ ³¯ÀÚ ¼³Á¤ var curdate = getCurrentDate(); var cvtdate = curdate.toDate("YYYYMMDD"); ipt_acntcd.disabled = false; btn_acntcd.disabled = false; fConDisabledControl(false); fDisabledControl(false); model.resetInstanceNode("/root/main/list/purcconinfo/purcconmainlist"); model.makeValue(ipt_newyn.attribute("ref"), "Y"); model.removeNodeset("/root/main/list/purcconinfo/purcconsublist"); model.setValue(cmb_teamflag.attribute("ref") , teamflag); model.refresh(); model.setValue(cal_purccondd.attribute("ref") , curdate); model.setValue(ipt_chrgid.attribute("ref") , getUserInfo("userid")); model.setValue(ipt_chrgnm.attribute("ref") , getUserInfo("usernm")); model.setValue(cmb_deftconratecd.attribute("ref") , "2"); model.setValue(cal_supdd.attribute("ref") , curdate); model.setValue(cal_contermfromdd.attribute("ref") , curdate); model.setValue(cal_contermtodd.attribute("ref") , cvtdate.getAddDate(1,"M").getDateFormat("YYYYMMDD")); cal_purccondd.dispatch("xforms-value-changed"); } // °è¾à ¼¼ºÎ ³»¿ª¿¡¼­ ƯÁ¤ °è¾à±Ý ȤÀº °è¾à¼ö·® º¯°æ½Ã ÇØ´ç °è¾à±ÝÀÌ ÀÚµ¿À¸·Î ¿¬»ê µÇ´Â ±â´É function fCalcAmt() { if( grd_purccon.col == grd_purccon.colRef("conqty") || grd_purccon.col == grd_purccon.colRef("congoodunitcost")){ var conamt; var congoodunitcost = grd_purccon.valueMatrix(grd_purccon.row, grd_purccon.colRef("congoodunitcost")); var conqty = grd_purccon.valueMatrix(grd_purccon.row, grd_purccon.colRef("conqty")); conamt = parseFloat(congoodunitcost) * parseFloat(conqty); grd_purccon.valueMatrix(grd_purccon.row, grd_purccon.colRef("conamt")) = parseFloat(conamt); } model.refresh(); } // °øÅë¿¡ º¯°æµÈ »çÇ×ÀÌ ÀÖ´ÂÁö¸¦ ÀÎÁöÇϱâ À§ÇÑ ÇÔ¼ö (ºÒÇÊ¿äÇÑ transactionÀ» ÁÙÀ̰íÀÚÇÏ´Â Àǵµ·Î ÀÛ¼ºÇßÀ½) function fCmprChngVal() { var bfpath = "/root/submain/list/purcconinfo/purcconmainlist"; var prestpath = "/root/main/list/purcconinfo/purcconmainlist"; var chngflag = false; if ( model.getValue(bfpath+"/purccondd" ) != model.getValue(prestpath+"/purccondd" ) // °è¾à³â¿ùÀÏ || model.getValue(bfpath+"/purcconno" ) != model.getValue(prestpath+"/purcconno" ) // °è¾à¹øÈ£ || model.getValue(bfpath+"/goodkindcnt" ) != model.getValue(prestpath+"/goodkindcnt" ) // Á¦Á¾ || model.getValue(bfpath+"/teamflag" ) != model.getValue(prestpath+"/teamflag" ) // ÆÀ±¸ºÐ || model.getValue(bfpath+"/acntcd" ) != model.getValue(prestpath+"/acntcd" ) // °èÁ¤ÄÚµå || model.getValue(bfpath+"/acntnm" ) != model.getValue(prestpath+"/acntnm" ) // °èÁ¤ÄÚµå¸í || model.getValue(bfpath+"/notino" ) != model.getValue(prestpath+"/notino" ) // °ø°í¹øÈ£ || model.getValue(bfpath+"/suplplcecd" ) != model.getValue(prestpath+"/suplplcecd" ) // ³³Ç°Ã³ÄÚµå || model.getValue(bfpath+"/suplplcenm" ) != model.getValue(prestpath+"/suplplcenm" ) // ³³Ç°Ã³¸í || model.getValue(bfpath+"/supdd" ) != model.getValue(prestpath+"/supdd" ) // ³³Ç°ÀÏ || model.getValue(bfpath+"/chrgid" ) != model.getValue(prestpath+"/chrgid" ) // ´ã´çÀÚid || model.getValue(bfpath+"/chrgnm" ) != model.getValue(prestpath+"/chrgnm" ) // ´ã´çÀÚ || model.getValue(bfpath+"/flwrpirtermyy") != model.getValue(prestpath+"/flwrpirtermyy") // ÇÏÀÚº¸¼ö³â¼ö || model.getValue(bfpath+"/flwrpirper" ) != model.getValue(prestpath+"/flwrpirper" ) // ÇÏÀÚº¸¼öÆÛ¼¾Æ® || model.getValue(bfpath+"/suppos" ) != model.getValue(prestpath+"/suppos" ) // ³³Ç°Àå¼Ò || model.getValue(bfpath+"/conflag" ) != model.getValue(prestpath+"/conflag" ) // °è¾à±¸ºÐ || model.getValue(bfpath+"/totconamt" ) != model.getValue(prestpath+"/totconamt" ) // ÃѰè¾à±Ý¾× || model.getValue(bfpath+"/goodcntnm" ) != model.getValue(prestpath+"/goodcntnm" ) // ǰ°Ç¸í || model.getValue(bfpath+"/congrntamt" ) != model.getValue(prestpath+"/congrntamt" ) // º¸Áõ±Ý || model.getValue(bfpath+"/grntexchrate" ) != model.getValue(prestpath+"/grntexchrate" ) // º¸Áõ±ÝȯÀ² || model.getValue(bfpath+"/expsschedate" ) != model.getValue(prestpath+"/expsschedate" ) // ÁöÃ⿹Á¤ÀÏ || model.getValue(bfpath+"/deftconratecd") != model.getValue(prestpath+"/deftconratecd") // Áöü»ó±ÝÄÚµå || model.getValue(bfpath+"/cmt" ) != model.getValue(prestpath+"/cmt" ) // ±âŸÁ¶°Ç || model.getValue(bfpath+"/contermfromdd") != model.getValue(prestpath+"/contermfromdd") // °è¾à±â°£(from) || model.getValue(bfpath+"/contermtodd" ) != model.getValue(prestpath+"/contermtodd" )){ // °è¾à±â°£(to) chngflag = true; } return chngflag; } // ÀúÀå - °øÅëÇ׸ñÀ¸·Î GroupingµÈ °ÍÀ» ÇÏÀ§´Ü¿¡ Ç®¾îÁÖ¸ç Ç®¸° µ¥ÀÌŸ¸¦ ¼­¹ö PGMÀ¸·Î ³Ñ±â´Â ±â´ÉÀÌ ÇÔ¼ö¿¡ ³ì¾ÆÀÖÀ½. function fSave(){ var updtdata = "", rowno = ""; if (fSaveValiChk() == false) return; for(i=1;i 0) { var selectedRows = Array(pGrid.selectedRows); for(i=0;i< pGrid.selectedRows;i++) { selectedRows[i] = pGrid.selectedRow(i); } }else{ messageBox("»èÁ¦ÇÒ µ¥ÀÌŸ°¡ ","E014"); return; } for ( var i= 0; i < selectedRows.length; i++){ rowIdx = selectedRows[i]; if (pGrid.valueMatrix(rowIdx, pGrid.colRef("purcconno")) == ""){ pGrid.rowStatus(rowIdx) = "4"; }else{ rowInval += rowIdx + "," } } if (rowInval != ""){ messageBox(rowInval.substr(0, rowInval.length-1)+"¹øÂ°´Â °è¾à󸮵È", "I009"); } model.refresh(); } // µ¥ÀÌŸÀÇ ¹«°á¼ºÀ» À§ÇØ ¼öÁ¤½Ã ±âº»Å°·Î ÀâÇô ÀÖ´Â °è¾àÀÏÀÚ¿Í ¹øÈ£´Â Àý´ë ¼öÁ¤ ºÒ°¡´É »óÅ·Π¸¸µå´Â ±â´É function fDisabledControl(state) { cal_purccondd.disabled = state; ipt_purcconno.disabled = state; } // µ¥ÀÌŸ°¡ ¾øÀ¸¸é ÀԷ°ú °ü·ÃµÈ ¹öưµéÀ» ºÒ´É »óÅ·Π¸¸µå´Â ±â´É function fConDisabledControl(state) { btn_purccon.disabled = state; btn_choidel.disabled = state; btn_save.disabled = state; } // °è¾à¿¡ ´ëÇÑ Ãâ·ÂÈ­¸éÀÏ °æ¿ì, Á¶È¸¹öưÀ» Á¦¿ÜÇÑ ³ª¸ÓÁö ÀÔ·Â,ÀúÀå,ǰÀǿ䱸,Çà»èÁ¦ ¹öư ÄÁÆ®·ÑÀ» ºÒ´É»óÅ·Π¸¸µå´Â ±â´É function fPrtConDisabledControl(state) { btn_save.disabled = state; btn_insert.disabled = state; btn_purccon.disabled = state; btn_choidel.disabled = state; btn_save.disabled = state; } // °è¾à ¼¼ºÎ ³»¿ª¿¡¼­ °è¾à±Ý ȤÀº °è¾à¼ö·® º¯°æ½Ã °øÅë¿¡ ÀÖ´Â Àüü°è¾à±Ý¿¡ ÇÕ»êµÇ´Â ±â´É function fDispSumAmt() { var totconamt = 0, bfconamt = 0, totbfconamt = 0; for(var currow = grd_purccon.fixedRows ; currow < grd_purccon.rows ; currow++) { totconamt += parseFloat(grd_purccon.valueMatrix(currow , grd_purccon.colRef("conamt"))); totbfconamt += bfconamt; } //ÃÑ±Ý¾× model.setValue(ipt_totconamt.attribute("ref"),totconamt); model.refresh(); } // ¹°Ç°¸í º¯°æ½Ã ǰ°Ç¸íµµ ¿¬°èµÇ¾î º¯°æÇÏ´Â ±â´É function fGetGoodcntnm() { var goodnm = "", fstflag = "N", cnt = 0; for(var i=grd_purccon.fixedRows; i < grd_purccon.rows;i++){ if (grd_purccon.rowStatus(i) != "4"){ if (fstflag == "N"){ var goodnm = grd_purccon.valueMatrix(i, grd_purccon.colRef("goodnm")); var fstflag = "Y"; } cnt++ } } if (cnt == 1){ model.setValue(ipt_goodcntnm.attribute("ref"), goodnm); }else{ model.setValue(ipt_goodcntnm.attribute("ref"), goodnm+"¿Ü "+ (cnt-1)+"°Ç"); } model.refresh(); } // Ãâ·Â¹° »ý¼º½Ã Àӽà ³ëµå¿¡ ÁöÁ¤ ³ëµå°ª º¹»ç´Â °¡´É (¹Ì»ç¿ë ÇâÈÄ °³¹ßÀÇ ÆíÀǼºÀ» À§ÇØ Ãß°¡ÇÑ ±â´É) function freqlistprint() { var Path = "/root/send/winregstprnt/winregstprntlist"; model.removenode(Path); model.makeNode(Path); copyNodesetType(Path, grd_winregst.nodeset+ "[chk='Y']"); exeReportPreview("RPRSP00100","XMLSTR"); }