/* --------------------------------------------------------------------- ºÐÇÒ_Àç»ç¿ëǰ_±¸¸ÅÀü¼Û(SMMNP04800.xfm - JScript ) - Version : 1) : Ver.1.00.01 : Create By ±èÁø¸í : 2007.09.27 ---------------------------------------------------------------------- */ /* --------------------------------------------------*/ /* type : function */ /* access : public */ /* desc : ºÐÇÒ_Àç»ç¿ëǰ_±¸¸ÅÀü¼Û ÃʱâÈ­ */ /* param : */ /* return : */ /* --------------------------------------------------*/ function fInit() { var curtDate = getCurrentDate(); curtDate = curtDate.substr(0, 8); model.setValue("/root/main/cond/refopfromdd", getDateAddc(getCurrentDate(), -7)); model.setValue("/root/main/cond/refoptodd", curtDate); submit("TRMNP03004") // ¼ö¼ú½Ç(Rosette) °¡Á®¿À±â addComboItem("cmb_rosette","Àüü","","above"); model.removenode("/root/send"); model.makeNode("/root/send"); model.makeValue("/root/send/reqdata/opcnfmdd" ,model.getValue("/root/main/cond/refopfromdd") ); model.makeValue("/root/send/reqdata/rosette" ,model.getValue("/root/main/cond/oprosette")); submit("TRMNP03002"); // ¼ö¼ú½ÇÄÚµå °¡Á®¿À±â addComboItem("cmb_oproomlist","Àüü","","above"); //submit("TRMNP04603", false); //addComboItem("cmb_oproomlist", "Àü ü", "ALL", "above" ); grd_reqgoodlist.fixedcellcheckbox(0,15) = true; btn_cncl.visible = false; btn_send.visible = true; grd_reqgoodlist.explorerbar = "sort"; grd_reqgoodlist.colHidden(grd_reqgoodlist.colRef("senddd")) = true;//Àü¼ÛÀÏÀÚ grd_reqgoodlist.colHidden(grd_reqgoodlist.colRef("sendyn")) = true;//Àü¼Û¿©ºÎ grd_reqgoodlist.colWidth(grd_reqgoodlist.colRef("goodnm")) = "250";//¹°Ç°¸í grd_reqgoodlist.colWidth(grd_reqgoodlist.colRef("goodspec")) = "105";//±Ô°Ý grd_reqgoodlist.colWidth(grd_reqgoodlist.colRef("goodmodel")) = "95"; //¸ðµ¨ grd_reqgoodlist.colWidth(grd_reqgoodlist.colRef("prodcmpynm")) = "95"; //Á¦Á¶¿ø model.removenode("/root/main/reqgoodlist"); model.refresh(); //fSearch(); } /* --------------------------------------------------*/ /* type : function */ /* access : public */ /* desc : ÄÞº¸¾ÆÀÌÅÛ Á¦°Å */ /* param : */ /* return : */ /* --------------------------------------------------*/ function removeComboItem( comboID ) { var comboObj = document.all.item(comboID); var comboItemNodeSet = comboObj.choices.itemset.attribute("nodeset"); model.removenode(comboItemNodeSet + "[1]");//CCR model.removenode(comboItemNodeSet + "[1]");//C-C(Clean-Zone) model.removenode(comboItemNodeSet + "[1]");//C-O(ORâ°í) model.refresh(); } /* --------------------------------------------------*/ /* type : function */ /* access : public */ /* desc : ºÐÇÒ_Àç»ç¿ëǰ_±¸¸ÅÀü¼Û Á¶È¸ */ /* param : */ /* return : */ /* --------------------------------------------------*/ function fSearch() { model.removenode("/root/send"); model.makeNode("/root/send/reqdata"); model.copyNode("/root/send/reqdata", "/root/main/cond"); submit("TRMNP04801"); } /* --------------------------------------------------*/ /* type : function */ /* access : public */ /* desc : ºÐÇÒ_Àç»ç¿ëǰ_±¸¸ÅÀü¼Û ÀúÀå(±¸¸Åû±¸) */ /* param : */ /* return : */ /* --------------------------------------------------*/ function fSaveSend() { var iRows = -1; var chkflag, goodcd, allsizespecid, sendqty = 0, oprsrvno, deptcd, deliveunit, ddavguseqty = 0, basevol = 0, oproomcd, oldgoodcd, oldallsizespecid, totsendqty = 0; var oldoprsrvno, olddeliveunit, oldddavguseqty = 0, oldbasevol = 0, reqdeptcd, cartgubn, acmlbaseqty, studydeptcd; var cnt = 0, sendexchqty = 0; var rowCnt = 1, rowCnt2 = 1; iRows = grd_reqgoodlist.rows; var reqgoodlist = "m¢Ërownum¢Ëgoodcd¢Ëallsizespecid¢Ësendqty¢Ëoproomcd¢Ëcartgubn¢Ësendexchqty"; var sendgoodlist = "m¢Ërownum¢Ëgoodcd¢Ëallsizespecid¢Ëtotsendqty¢Ëdeptcd¢Ëddavguseqty¢Ëdeliveunit¢Ëbasevol¢Ëreqdeptcd¢Ëstudydeptcd"; var iNode = "/root/main/reqgoodlist"; for( var i = 1; i <= iRows; i++ ) { chkflag = model.getValue( iNode + "[" + i +"]/" + "chkflag" ); goodcd = model.getValue( iNode + "[" + i +"]/" + "goodcd" ); allsizespecid = model.getValue( iNode + "[" + i +"]/" + "allsizespecid" ); sendqty = model.getValue( iNode + "[" + i +"]/" + "sendqty" ); deptcd = model.getValue( iNode + "[" + i +"]/" + "deptcd" ); deliveunit = model.getValue( iNode + "[" + i +"]/" + "deliveunit" ); ddavguseqty = model.getValue( iNode + "[" + i +"]/" + "ddavguseqty" ); basevol = model.getValue( iNode + "[" + i +"]/" + "basevol" ); reqdeptcd = model.getValue( iNode + "[" + i +"]/" + "reqdeptcd" ); acmlbaseqty = model.getValue( iNode + "[" + i +"]/" + "acmlbaseqty" ); studydeptcd = model.getValue( iNode + "[" + i +"]/" + "studydeptcd" ); oproomcd = model.getValue( "/root/main/cond/oproomcd"); cartgubn = model.getValue( "/root/main/cond/refdeptflag"); sendexchqty = ( parseInt(acmlbaseqty) * parseInt(sendqty) ); //sendexchqty = parseInt(sendqty); if( chkflag == "true" ) { if( parseInt(sendqty) < 1 ) { messageBox("Àü¼Û ¼ö·®À» ÀÔ·ÂÇϽʽÿä!", "E000"); return; } if( cnt == 0 ) { oldgoodcd = goodcd; oldallsizespecid = allsizespecid; } reqgoodlist = reqgoodlist + "¢Ì" + "i" + "¢Ë" + rowCnt + "¢Ë" + goodcd + "¢Ë" + allsizespecid + "¢Ë" + sendqty + "¢Ë" + oproomcd + "¢Ë" + cartgubn + "¢Ë" + sendexchqty; rowCnt += 1; cnt += 1; if( ( goodcd == oldgoodcd )&&( allsizespecid == oldallsizespecid ) ) { totsendqty = totsendqty + parseInt(sendqty); oldgoodcd = goodcd; oldallsizespecid = allsizespecid; olddeliveunit = deliveunit; oldddavguseqty = ddavguseqty; oldbasevol = basevol; }else { sendgoodlist = sendgoodlist + "¢Ì" + "i" + "¢Ë" + rowCnt2 + "¢Ë" + oldgoodcd + "¢Ë" + oldallsizespecid + "¢Ë" + totsendqty + "¢Ë" + deptcd + "¢Ë" + ddavguseqty + "¢Ë" + deliveunit + "¢Ë" + basevol + "¢Ë" + reqdeptcd + "¢Ë" + studydeptcd; totsendqty = parseInt(sendqty); oldgoodcd = goodcd; oldallsizespecid = allsizespecid; rowCnt2 += 1; } } if( i == ( iRows - 1 ) ) { sendgoodlist = sendgoodlist + "¢Ì" + "i" + "¢Ë" + rowCnt2 + "¢Ë" + oldgoodcd + "¢Ë" + oldallsizespecid + "¢Ë" + totsendqty + "¢Ë" + deptcd + "¢Ë" + oldddavguseqty + "¢Ë" + olddeliveunit + "¢Ë" + oldbasevol + "¢Ë" + reqdeptcd + "¢Ë" + studydeptcd; } } if( cnt > 0 ) { model.removenode("/root/send"); model.makeNode("/root/send/reqdata"); model.makeNode("/root/send/savedata"); model.makeNode("/root/send/senddata"); model.copyNode("/root/send/reqdata", "/root/main/cond"); model.setValue("/root/send/savedata", reqgoodlist); model.setValue("/root/send/senddata", sendgoodlist); submit("TXMNP04801"); }else { messageBox("¼±ÅÃÇѰÍÀÌ", "I004"); } } /* --------------------------------------------------*/ /* type : function */ /* access : public */ /* desc : ºÐÇÒ_Àç»ç¿ëǰ_±¸¸ÅÀü¼Û Ãë¼Ò(±¸¸Åû±¸Ãë¼Ò)*/ /* param : */ /* return : */ /* --------------------------------------------------*/ function fCnclSend() { var iRows = -1; var chkflag, goodcd, allsizespecid, sendqty = 0, oprsrvno, deptcd, deliveunit, ddavguseqty = 0, basevol = 0, oproomcd, oldgoodcd, oldallsizespecid, totsendqty = 0; var oldoprsrvno, olddeliveunit, oldddavguseqty = 0, oldbasevol = 0, reqdeptcd, cartgubn, acmlbaseqty, studydeptcd; var cnt = 0, sendexchqty = 0; var rowCnt = 1, rowCnt2 = 1; iRows = grd_reqgoodlist.rows; var reqgoodlist = "m¢Ërownum¢Ëgoodcd¢Ëallsizespecid¢Ësendqty¢Ëoproomcd¢Ëcartgubn¢Ësendexchqty"; var sendgoodlist = "m¢Ërownum¢Ëgoodcd¢Ëallsizespecid¢Ëtotsendqty¢Ëdeptcd¢Ëddavguseqty¢Ëdeliveunit¢Ëbasevol¢Ëreqdeptcd¢Ëstudydeptcd"; var iNode = "/root/main/reqgoodlist"; for( var i = 1; i <= iRows; i++ ) { chkflag = model.getValue( iNode + "[" + i +"]/" + "chkflag" ); goodcd = model.getValue( iNode + "[" + i +"]/" + "goodcd" ); allsizespecid = model.getValue( iNode + "[" + i +"]/" + "allsizespecid" ); sendqty = model.getValue( iNode + "[" + i +"]/" + "sendqty" ); deptcd = model.getValue( iNode + "[" + i +"]/" + "deptcd" ); deliveunit = model.getValue( iNode + "[" + i +"]/" + "deliveunit" ); ddavguseqty = model.getValue( iNode + "[" + i +"]/" + "ddavguseqty" ); basevol = model.getValue( iNode + "[" + i +"]/" + "basevol" ); reqdeptcd = model.getValue( iNode + "[" + i +"]/" + "reqdeptcd" ); acmlbaseqty = model.getValue( iNode + "[" + i +"]/" + "acmlbaseqty" ); studydeptcd = model.getValue( iNode + "[" + i +"]/" + "studydeptcd" ); oproomcd = model.getValue( "/root/main/cond/oproomcd"); cartgubn = model.getValue( "/root/main/cond/refdeptflag"); sendexchqty = ( parseInt(acmlbaseqty) * parseInt(sendqty) ); if( chkflag == "true" ) { if( cnt == 0 ) { oldgoodcd = goodcd; oldallsizespecid = allsizespecid; } reqgoodlist = reqgoodlist + "¢Ì" + "u" + "¢Ë" + rowCnt + "¢Ë" + goodcd + "¢Ë" + allsizespecid + "¢Ë" + (-1*parseInt(sendqty)) + "¢Ë" + oproomcd + "¢Ë" + cartgubn + "¢Ë" + sendexchqty; rowCnt += 1; cnt += 1; if( ( goodcd == oldgoodcd )&&( allsizespecid == oldallsizespecid ) ) { totsendqty = totsendqty + parseInt(sendqty); oldgoodcd = goodcd; oldallsizespecid = allsizespecid; olddeliveunit = deliveunit; oldddavguseqty = ddavguseqty; oldbasevol = basevol; }else { sendgoodlist = sendgoodlist + "¢Ì" + "u" + "¢Ë" + rowCnt2 + "¢Ë" + oldgoodcd + "¢Ë" + oldallsizespecid + "¢Ë" + (-1*totsendqty)+ "¢Ë" + deptcd + "¢Ë" + ddavguseqty + "¢Ë" + deliveunit + "¢Ë" + basevol + "¢Ë" + reqdeptcd + "¢Ë" + studydeptcd; totsendqty = parseInt(sendqty); oldgoodcd = goodcd; oldallsizespecid = allsizespecid; rowCnt2 += 1; } } if( i == ( iRows - 1 ) ) { sendgoodlist = sendgoodlist + "¢Ì" + "u" + "¢Ë" + rowCnt2 + "¢Ë" + oldgoodcd + "¢Ë" + oldallsizespecid + "¢Ë" + (-1*totsendqty)+ "¢Ë" + deptcd + "¢Ë" + oldddavguseqty + "¢Ë" + olddeliveunit + "¢Ë" + oldbasevol + "¢Ë" + reqdeptcd + "¢Ë" + studydeptcd; } } if( cnt > 0 ) { model.removenode("/root/send"); model.makeNode("/root/send/reqdata"); model.makeNode("/root/send/savedata"); model.makeNode("/root/send/senddata"); model.copyNode("/root/send/reqdata", "/root/main/cond"); model.setValue("/root/send/savedata", reqgoodlist); model.setValue("/root/send/senddata", sendgoodlist); submit("TXMNP04801"); }else { messageBox("¼±ÅÃÇѰÍÀÌ", "I004"); } }