SMRSI00101.js 69 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439
  1. /* ---------------------------------------------------------------------
  2. SMRSI00101_입고관리.xrw (SMRSI00101.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. : Create By Francis Choi
  6. : 2015.05.02
  7. ---------------------------------------------------------------------- */
  8. var vWinQty = 0;
  9. var vWinAmt = 0;
  10. var vWinQtySel = 0;
  11. var vWinAmtSel = 0;
  12. var gIndex = ""; // 02 물품구분
  13. var gGoodflag = ""; // 02 물품구분
  14. var gSuplplcecd = ""; // 03 주거래처
  15. var gSuppcustcd = ""; // 04 보조거래처
  16. var gPurcCloseYymm = ""; // 05 최종마감년월
  17. var gTabIdx1 = "0"; //TAB INDEX
  18. var gPathName = "goodnonwin#goodwin"
  19. var gPathNm = gPathName.split("#");
  20. var gPathDetailName = "goodnonwinlist#goodwinlist"
  21. var gPathDetailNm = gPathDetailName.split("#");
  22. var gGridName = "nonwin#goodwin"
  23. var gGridNm = gGridName.split("#");
  24. // --------------------------------------------------
  25. // 화면 Control을 초기화한다
  26. // --------------------------------------------------
  27. function fInit() {
  28. //화면 Control을 초기화한다
  29. // fCheckAuth();
  30. fInitialize();
  31. }
  32. // --------------------------------------------------
  33. // 저장권한 설정한다
  34. // --------------------------------------------------
  35. function fCheckAuth() {
  36. btn_search.disabled = !checkAuth("R") ;
  37. btn_save.disabled = !checkAuth("X") ;
  38. }
  39. // --------------------------------------------------------------
  40. // 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
  41. // --------------------------------------------------------------
  42. function fInitialize() {
  43. // model.resetInstanceNode("/root/send");
  44. //rszfUserGoodFlagList(cmb_goodflag,getUserInfo("userid"));
  45. rszfGoodFlagListByPgmGubn(cmb_goodflag,"1","N");
  46. rszfUserInstList(cmb_instcd,getUserInfo("userid"));
  47. misfComboComCdList("R0111",cmb_purcflag,"Y");
  48. misfComboComCdList("R0109",cmb_calcdocukind);
  49. // misfComboComCdListMulti("R0109","cmb_calcdocukind");
  50. // 조회가 아닌데 전체는 의미가 없다...HBH . 2007.08.13
  51. //rszfComboAppendBlankChild("cmb_calcdocukind");
  52. misfGridInit(grd_goodwin);
  53. misfGridInit(grd_nonwin);
  54. misfMsterDetailSet(grd_goodwin,null , "TRRSI00101" ,"Y");
  55. misfMsterDetailSet(grd_goodreq,grd_goodwin, "TRRSD00410" ,"N");
  56. var curdate = getCurrentDate();
  57. var cvtdate = curdate.toDate("YYYYMMDD");
  58. model.setValue(ipt_windd.attribute("ref") , curdate);
  59. model.setValue(ipt_reqfrdd.attribute("ref") , cvtdate.getAddDate(-10,"D").getDateFormat("YYYYMMDD"));
  60. model.setValue(ipt_reqtodd.attribute("ref") , curdate);
  61. //입고조회시 입고일자 1주일 간격 기본 설정.
  62. model.setValue(ipt_winfrdd.attribute("ref") , cvtdate.getAddDate(-7, "D").getDateFormat("YYYYMMDD"));
  63. model.setValue(ipt_wintodd.attribute("ref") , curdate);
  64. //hidden
  65. model.setValue(ipt_iokind.attribute("ref") ,'1A'); // 입출유형.
  66. model.setValue(opt_interfacegubn.attribute("ref"),'P' ); // 'B' 평화드림.
  67. model.setValue(ipt_sumwinqty.attribute("ref"),0);
  68. model.setValue(opt_sumwinamt.attribute("ref"),0);
  69. // Total 발주건수, 발주금액 초기화
  70. model.setValue(opt_sumreqqty.attribute("ref"),0);
  71. model.setValue(opt_sumreqfla.attribute("ref"),0);
  72. rszfRscsysinftLists(getUserInfo("dutplceinstcd"));
  73. gPurcCloseYymm = getRscsysinftInfo("purccloseyymm");
  74. model.setValue(cmb_instcd.attribute("ref") , getUserInfo("dutplceinstcd"));
  75. model.setValue(ipt_windeptcd.attribute("ref") , getUserInfo("dutplcecd" ));
  76. model.setValue(ipt_windeptnm.attribute("ref") , getUserInfo("dutplcenm" ));
  77. model.setValue(ipt_winpsn.attribute("ref") , getUserInfo("userid" ));
  78. model.setValue(opt_winpsnnm.attribute("ref") , getUserInfo("usernm" ));
  79. if(getUserInfo("dutplceinstcd") == "014") {
  80. model.setValue(chk_reqpsnyn.attribute("ref") , "Y");
  81. model.setValue(ipt_reqpsn.attribute("ref") , getUserInfo("userid" ));
  82. model.setValue(ipt_reqpsnnm.attribute("ref") , getUserInfo("usernm" ));
  83. if(gPurcCloseYymm >= getCurrentDate().substr(0,6)) {
  84. messageBox("마감이 완료되어 입고처리가 불가능합니다.", "I");
  85. btn_save.disabled = true;
  86. } else {
  87. btn_save.disabled = false;
  88. }
  89. }
  90. rdo_paycond.select(0);
  91. cmb_calcdocukind.select(0);
  92. cmb_goodflag.select(0);
  93. grd_goodwin.explorerbar = "sortshow";
  94. grd_goodreq.explorerbar = "sortshow";
  95. grd_nonwin.explorerbar = "sortshow";
  96. // grd_goodwin.frozenCols = grd_goodwin.colRef("winunit");
  97. // 물품구분별 권한
  98. fSetGoodFlagAuth();
  99. fDtiOptionView();
  100. model.refresh();
  101. }
  102. // --------------------------------------------------------------
  103. // 물품구분별 권한체크.
  104. // --------------------------------------------------------------
  105. function fSetGoodFlagAuth()
  106. {
  107. btn_save.disabled =true;
  108. btn_select.disabled =true;
  109. btn_subdelive.disabled=true;
  110. btn_delive.disabled =true;
  111. btn_choidel.disabled =true;
  112. btn_insert.disabled =true;
  113. rszfGetPurcGoodFlagAuthInfo(cmb_instcd.value , cmb_goodflag.value, getUserInfo("userid"), "%");
  114. if (rszfGetGoodFlagAuthInfoByCond("goodflagauth") =="Y") {
  115. btn_save.disabled=false;
  116. btn_select.disabled=false;
  117. btn_subdelive.disabled=false;
  118. btn_delive.disabled=false;
  119. btn_choidel.disabled=false;
  120. btn_insert.disabled=false;
  121. }
  122. }
  123. // --------------------------------------------------------------
  124. // 거래처의 전화번호를 Setting한다.
  125. // --------------------------------------------------------------
  126. function fValiDataCheckSetting() {
  127. if (model.getValue("/root/init/main/reqcustomlist/entrregno") != "") {
  128. model.setValue(opt_cntctel.attribute("ref"), model.getValue("/root/init/main/reqcustomlist/cntctel"));
  129. }
  130. }
  131. // --------------------------------------------------------------
  132. // 평화드림 미입고 데이타 load
  133. // --------------------------------------------------------------
  134. function fDataLoadNoWin()
  135. {
  136. //messatgebox
  137. submit("TRRSI00103");
  138. for(var currow = grd_nonwin.fixedRows ; currow < grd_nonwin.rows ; currow++)
  139. {
  140. model.setValue(grd_nonwin.nodeset + "[" + (currow - grd_nonwin.fixedRows + 1)+ "]/select","Y");
  141. grd_nonwin.rowStatus(currow) = "2";
  142. }
  143. }
  144. // --------------------------------------------------------------
  145. // 조회 조건 데이타 Check
  146. // --------------------------------------------------------------
  147. function fCheckRetrieveData(pmsg)
  148. {
  149. if (fCheckIdValue(pmsg, "cmb_instcd" , "기관코드를 " , "C002")) return false;
  150. if (fCheckIdValue(pmsg, "cmb_goodflag" , "물품구분을 " , "C002")) return false;
  151. //if (fCheckIdValue(pmsg, "ipt_suplplcecd", "공급처를 " , "C001")) return false;
  152. if (fCheckIdValue(pmsg, "ipt_winpsn" , "입고담당자를 ", "C001")) return false;
  153. if (fCheckIdValue(pmsg, "ipt_windeptcd" , "입고부서를 " , "C001")) return false;
  154. if (sch_select.selectedIndex == 0) {
  155. if (fCheckIdValue(pmsg, "ipt_reqfrdd" , "발주시작일자 ", "C001")) return false;
  156. if (fCheckIdValue(pmsg, "ipt_reqtodd" , "발주종료일자 ", "C001")) return false;
  157. // if (fCheckIdValue(pmsg, "ipt_subsuplplcecd" , "보조거래처를 ", "C001")) return false;
  158. } else {
  159. if (fCheckIdValue(pmsg, "ipt_windd" , "입고일자를 " , "C001")) return false;
  160. }
  161. return true;
  162. }
  163. // ---------------------------------------------------
  164. // ID 값 Check
  165. // ---------------------------------------------------
  166. function fCheckIdValue(pMsgFlag, pIDNm, pMsg, pTail)
  167. {
  168. if (model.getValue(eval(pIDNm).attribute("ref")).length== 0 ) {
  169. if (pMsgFlag == true) {
  170. messageBox(pMsg , pTail);
  171. model.setFocus(pIDNm);
  172. }
  173. return true; // 필수 입력이 없음을 알림.
  174. }
  175. return false; // 필수입력 있음을 알림.
  176. }
  177. // ---------------------------------------------------
  178. // Grid 기본값 입력
  179. // ---------------------------------------------------
  180. function fDefaultSetting(prow)
  181. {
  182. var grd_setting = (sch_select.selectedIndex == 0) ? grd_nonwin : grd_goodwin;
  183. //
  184. model.setValue(grd_setting.nodeset+"["+prow+"]/instcd" ,model.getValue(cmb_instcd.attribute("ref") ));
  185. model.setValue(grd_setting.nodeset+"["+prow+"]/goodflag" ,model.getValue(cmb_goodflag.attribute("ref") ));
  186. model.setValue(grd_setting.nodeset+"["+prow+"]/windd" ,model.getValue(ipt_windd.attribute("ref") ));
  187. model.setValue(grd_setting.nodeset+"["+prow+"]/winpsn" ,model.getValue(ipt_winpsn.attribute("ref") ));
  188. model.setValue(grd_setting.nodeset+"["+prow+"]/windeptcd" ,model.getValue(ipt_windeptcd.attribute("ref") ));
  189. //model.setValue(grd_setting.nodeset+"["+prow+"]/installplcecd",model.getValue("/root/send/goodwin/installplcecd"));
  190. model.setValue(grd_setting.nodeset+"["+prow+"]/paycond" ,model.getValue("/root/send/goodwin/paycond" ));
  191. //model.setValue(grd_setting.nodeset+"["+prow+"]/temppay" ,model.getValue("/root/send/goodwin/temppay" ));
  192. model.setValue(grd_setting.nodeset+"["+prow+"]/calcdocukind" ,model.getValue(cmb_calcdocukind.attribute("ref" )));
  193. if (model.getValue(grd_setting.nodeset+"["+prow+"]/calcdocudd")== "") {
  194. model.setValue(grd_setting.nodeset+"["+prow+"]/calcdocudd" ,model.getValue(ipt_calcdocudd.attribute("ref" )));
  195. }
  196. //model.setValue(grd_setting.nodeset+"["+prow+"]/suplplcecd" ,model.getValue(ipt_suplplcecd.attribute("ref" )));
  197. model.setValue(grd_setting.nodeset+"["+prow+"]/winseqno" ,fGetMaxWinSeqNo() );
  198. model.setValue(grd_setting.nodeset+"["+prow+"]/delivedeptqty",0 );
  199. model.setValue(grd_setting.nodeset+"["+prow+"]/deliveno" ,0 );
  200. model.setValue(grd_setting.nodeset+"["+prow+"]/stocqty" ,0 );
  201. model.setValue(grd_setting.nodeset+"["+prow+"]/iokind" ,model.getValue(ipt_iokind.attribute("ref")) );
  202. model.setValue(grd_setting.nodeset+"["+prow+"]/paycond" ,model.getValue(rdo_paycond.attribute("ref") ));;
  203. }
  204. // ---------------------------------------------------
  205. // Max 입고번호 발취
  206. // ---------------------------------------------------
  207. function fGetMaxWinSeqNo()
  208. {
  209. var maxwinseqno = "";
  210. for (var currow = grd_goodwin.fixedRows ; currow < grd_goodwin.rows; currow++)
  211. {
  212. if (maxwinseqno < grd_goodwin.valueMatrix(currow , grd_goodwin.colRef("winseqno")))
  213. maxwinseqno = grd_goodwin.valueMatrix(currow , grd_goodwin.colRef("winseqno"));
  214. }
  215. maxwinseqno = "" +((maxwinseqno.length == 0) ? "001" : parseInt(maxwinseqno) + 1);
  216. return maxwinseqno.getLeftPad(3,"0");
  217. }
  218. // ---------------------------------------------------
  219. // 물품정보 LIST Setting
  220. // ---------------------------------------------------
  221. function fSettingGoodList(pnode, nodename, userqtynm){
  222. var codynode = instance1.selectNodes(pnode + "/*");
  223. var addRow = grd_goodwin.rows - grd_goodwin.fixedRows;
  224. if (model.getValue(grd_goodwin.nodeset + "[" + addRow + "]/goodcd").length > 0) addRow = addRow + 1;
  225. for (var j = 1; j <= codynode.length ; j++) {
  226. if (addRow > grd_goodwin.rows - grd_goodwin.fixedRows)
  227. {
  228. misfGridIUD(grd_goodwin,"A");
  229. addRow = grd_goodwin.rows - grd_goodwin.fixedRows;
  230. fDefaultSetting(addRow );
  231. }
  232. model.setValue(grd_goodwin.nodeset + "[" + addRow + "]/goodcd" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodcd" ));
  233. model.setValue(grd_goodwin.nodeset + "[" + addRow + "]/goodnm" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodnm" ));
  234. model.setValue(grd_goodwin.nodeset + "[" + addRow + "]/goodspec" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodspec" ));
  235. model.setValue(grd_goodwin.nodeset + "[" + addRow + "]/goodmodel" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodmodel" ));
  236. model.setValue(grd_goodwin.nodeset + "[" + addRow + "]/prodcmpynm" , model.getValue(pnode +"/" + nodename + "[" + j + "]/prodcmpynm" ));
  237. model.setValue(grd_goodwin.nodeset + "[" + addRow + "]/winpackqty" , model.getValue(pnode +"/" + nodename + "[" + j + "]/" + userqtynm));
  238. model.setValue(grd_goodwin.nodeset + "[" + addRow + "]/winpackunit", model.getValue(pnode +"/" + nodename + "[" + j + "]/purcunit" ));
  239. model.setValue(grd_goodwin.nodeset + "[" + addRow + "]/winunit" , model.getValue(pnode +"/" + nodename + "[" + j + "]/purcunit" ));
  240. if (model.getValue(pnode +"/" + nodename + "[" + j + "]/exchqty") != "0" &&
  241. model.getValue(pnode +"/" + nodename + "[" + j + "]/exchqty").length>0 )
  242. model.setValue(grd_goodwin.nodeset + "[" + addRow + "]/winpackcntperunit" , model.getValue(pnode +"/" + nodename + "[" + j + "]/exchqty"));
  243. else
  244. model.setValue(grd_goodwin.nodeset + "[" + addRow + "]/winpackcntperunit" ,"1");
  245. model.setValue(grd_goodwin.nodeset + "[" + addRow + "]/winunitcost" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodunitcost"));
  246. addRow = addRow + 1;
  247. }
  248. model.recalculate();
  249. model.refresh();
  250. }
  251. // ---------------------------------------------------
  252. // 출고생성되지 않은 데이타라면 출고시 입력을 위해 insert logic으로 구현한다
  253. // ---------------------------------------------------
  254. function fSettingPreSaveData()
  255. {
  256. for(var liRow = grd_goodreq.fixedRows ; liRow < grd_goodreq.rows ; liRow++)
  257. {
  258. //출고생성되지 않은 데이타라면 출고시 입력을 위해 insert logic으로 구현한다
  259. if((grd_goodreq.valueMatrix(liRow ,"delivedd").length == 0 ||
  260. grd_goodreq.valueMatrix(liRow ,"deliveno").length == 0 ||
  261. grd_goodreq.valueMatrix(liRow ,"deliveseqno").length == 0) &&
  262. grd_goodreq.rowStatus(liRow) == "1" ) grd_goodreq.rowStatus(liRow) = "2";
  263. }
  264. }
  265. // ---------------------------------------------------
  266. // 출고부서, 입고부서를 SETTING
  267. // ---------------------------------------------------
  268. function fSettingSaveInData()
  269. {
  270. for (var liRow = grd_nonwin.fixedRows; liRow < grd_nonwin.rows ; liRow++)
  271. {
  272. fDefaultSetting(liRow);
  273. model.setValue( grd_nonwin.nodeset + "[" + (liRow - grd_nonwin.fixedRows + 1) + "]/windeptcd"
  274. , model.getValue(ipt_windeptcd.attribute("ref")));
  275. model.setValue( grd_nonwin.nodeset + "[" + (liRow - grd_nonwin.fixedRows + 1) + "]/delivedeptcd"
  276. , model.getValue(ipt_windeptcd.attribute("ref")));
  277. }
  278. }
  279. // ---------------------------------------------------
  280. // 출고Data Save
  281. // ---------------------------------------------------
  282. function fSettingSaveOutData()
  283. {
  284. if ( getGridUpdateData(grd_goodreq) == "" ) {
  285. messageBox("변경내역이 없습니다. ", "I999");
  286. return;
  287. }
  288. var winqty = parseFloat(grd_goodwin.valueMatrix(grd_goodwin.row, grd_goodwin.colRef("remainderqty")));
  289. var outqty = 0.0;
  290. for (var liRow = grd_goodreq.fixedRows ; liRow < grd_goodreq.rows ; liRow++) {
  291. if((grd_goodreq.rowStatus(liRow) == "1" || grd_goodreq.rowStatus(liRow) == "2") &&
  292. (grd_goodreq.valueMatrix(liRow , grd_goodreq.colRef("deliveprcsflag") ) == "3") ) {
  293. grd_goodreq.rowStatus(liRow) = "1";
  294. model.setValue(grd_goodreq.nodeset + "[" + (liRow - grd_goodreq.fixedRows + 1) + "]/delivedeptcd", model.getValue(ipt_windeptcd.attribute("ref"))); // 출고부서(구매팀)
  295. model.setValue(grd_goodreq.nodeset + "[" + (liRow - grd_goodreq.fixedRows + 1) + "]/deliveunit" , grd_goodreq.valueMatrix(liRow ,grd_goodreq.colRef("requnit") )); // 출고단위(청구단위)
  296. model.setValue(grd_goodreq.nodeset + "[" + (liRow - grd_goodreq.fixedRows + 1) + "]/windeptcd" , grd_goodreq.valueMatrix(liRow ,grd_goodreq.colRef("reqdeptcd") )); // 입고부서(청구부서)
  297. model.setValue(grd_goodreq.nodeset + "[" + (liRow - grd_goodreq.fixedRows + 1) + "]/windd" , grd_goodwin.valueMatrix(grd_goodwin.row ,grd_goodwin.colRef("windd") )); // 입고일자
  298. model.setValue(grd_goodreq.nodeset + "[" + (liRow - grd_goodreq.fixedRows + 1) + "]/winno" , grd_goodwin.valueMatrix(grd_goodwin.row ,grd_goodwin.colRef("winno") )); // 입고번호
  299. model.setValue(grd_goodreq.nodeset + "[" + (liRow - grd_goodreq.fixedRows + 1) + "]/winseqno" , grd_goodwin.valueMatrix(grd_goodwin.row ,grd_goodwin.colRef("winseqno"))); // 입고순번
  300. }
  301. outqty = ( outqty + parseFloat(grd_goodreq.valueMatrix(liRow , grd_goodreq.colRef("delivedeptqty"))) );
  302. if (winqty < outqty) {
  303. messageBox(liRow + " 번째 누적 출고량이 입고량 보다 많습니다. 출고량을 조정하여" ,"C001");
  304. return;
  305. }
  306. }
  307. model.setValue("/root/send/gooddelive/gooddelivelist", grd_goodreq.getUpdateData());
  308. model.refresh();
  309. submit("TXRSO00101");
  310. if (model.getValue(gvErrorMsgPath + "/type") != "error") btn_search.dispatch("DOMActivate");
  311. //출고생성되지 않은 데이타라면 출고시 입력을 위해 insert logic으로 구현한다
  312. //[20090410] YYJ 현 페이지에서 출고에 대한 수정을 막는다.. ( 청구를 기준으로 하기 때문에 출고 수정시 정산 여부등을 판단하기 모호하다
  313. // 출고 관련 개별화된 화면 필요
  314. /* ================
  315. for (var liRow = grd_goodreq.fixedRows ; liRow < grd_goodreq.rows ; liRow++) {
  316. //출고생성되지 않은 데이타라면 출고시 입력을 위해 insert logic으로 구현한다
  317. if ((grd_goodreq.valueMatrix(liRow ,grd_goodreq.colRef("delivedd")).length == 0 ||
  318. grd_goodreq.valueMatrix(liRow ,grd_goodreq.colRef("deliveno")).length == 0 ||
  319. grd_goodreq.valueMatrix(liRow ,grd_goodreq.colRef("deliveseqno")).length == 0) && grd_goodreq.rowStatus(liRow) == "2")
  320. {
  321. grd_goodreq.rowStatus(liRow) = "1";
  322. model.setValue(grd_goodreq.nodeset + "[" + (liRow - grd_goodreq.fixedRows + 1) + "]/deliveunit" , grd_goodreq.valueMatrix(liRow ,grd_goodreq.colRef("requnit")));
  323. model.setValue(grd_goodreq.nodeset + "[" + (liRow - grd_goodreq.fixedRows + 1) + "]/delivedeptcd" , model.getValue(ipt_windeptcd.attribute("ref") ));
  324. }
  325. }
  326. model.setValue("/root/send/gooddelive/gooddelivelist", grd_goodreq.getUpdateData());
  327. model.refresh();
  328. submit("TXRSO00101");
  329. if (model.getValue(gvErrorMsgPath + "/type") != "error") btn_search.dispatch("DOMActivate");
  330. else
  331. {
  332. for(var liRow = grd_goodreq.fixedRows ; liRow < grd_goodreq.rows ; liRow++)
  333. {
  334. //출고생성되지 않은 데이타라면 출고시 입력을 위해 insert logic으로 구현한다
  335. if((grd_goodreq.valueMatrix(liRow , grd_goodreq.colRef("delivedd")).length == 0 ||
  336. grd_goodreq.valueMatrix(liRow , grd_goodreq.colRef("deliveno")).length == 0 ||
  337. grd_goodreq.valueMatrix(liRow , grd_goodreq.colRef("deliveseqno")).length == 0 ) &&
  338. grd_goodreq.rowStatus(liRow) == "1") grd_goodreq.rowStatus(liRow) = "2";
  339. }
  340. }
  341. ============== */
  342. }
  343. // --------------------------------------------------------------
  344. // 입력 데이타 Check
  345. // --------------------------------------------------------------
  346. function fCheckSaveData()
  347. {
  348. if (fCheckIdValue(true, "cmb_instcd" , "기관코드를 " , "C002")) return false;
  349. if (fCheckIdValue(true, "cmb_goodflag" , "물품구분을 " , "C002")) return false;
  350. if (fCheckIdValue(true, "ipt_windd" , "입고일자를 " , "C001")) return false;
  351. if (fCheckIdValue(true, "ipt_windeptcd", "입고부서를 " , "C001")) return false;
  352. if (sch_select.selectedIndex == 0)
  353. {
  354. if (fCheckIdValue(true, "ipt_windeptcd" , "입고부서를 " , "C001")) return false;
  355. if (fCheckIdValue(true, "ipt_winpsn" , "입고담당자를 " , "C001")) return false;
  356. if (fCheckIdValue(true, "rdo_paycond" , "계산방법을 " , "C001")) return false;
  357. if (fCheckIdValue(true, "cmb_calcdocukind", "계산서유형을 " , "C001")) return false;
  358. if (fCheckIdValue(true, "ipt_calcdocudd" , "계산서일자를 " , "C001")) return false;
  359. for (var currow = grd_nonwin.fixedRows ; currow < grd_nonwin.rows ; currow++)
  360. {
  361. if ((grd_nonwin.valueMatrix(currow , grd_nonwin.colRef("select")) == "Y") &&
  362. (grd_nonwin.valueMatrix(currow , grd_nonwin.colRef("winqty")).length == 0 ||
  363. grd_nonwin.valueMatrix(currow , grd_nonwin.colRef("winqty")) == 0 )) {
  364. messageBox(currow + " 번째 입고량을 " ,"C001");
  365. grd_nonwin.endEditCell();
  366. grd_nonwin.row = currow;
  367. grd_nonwin.col= grd_nonwin.colRef("winqty");
  368. grd_nonwin.editCell();
  369. return false;
  370. }
  371. if((grd_nonwin.valueMatrix(currow , grd_nonwin.colRef("select")) == "Y") &&
  372. (grd_nonwin.valueMatrix(currow , grd_nonwin.colRef("goodunitcost")).length == 0 ||
  373. grd_nonwin.valueMatrix(currow , grd_nonwin.colRef("goodunitcost")) == 0 ) ){
  374. messageBox(currow + " 번째 입고단가를 " ,"C001");
  375. grd_nonwin.endEditCell();
  376. grd_nonwin.row = currow;
  377. grd_nonwin.col= grd_nonwin.colRef("goodunitcost");
  378. grd_nonwin.editCell();
  379. return false;
  380. }
  381. }
  382. } else{
  383. // if (fCheckIdValue(true, "ipt_suplplcecd", "공급처를 ", "C001")) return false;
  384. var winqty = 0;
  385. var stocqty = 0;
  386. var delivedeptqty = 0;
  387. for (var currow = grd_goodwin.fixedRows ; currow < grd_goodwin.rows ; currow++)
  388. {
  389. if (grd_goodwin.valueMatrix(currow , grd_goodwin.colRef("goodcd")).length == 0) {
  390. messageBox(currow + " 번째 물품코드를 " ,"C001");
  391. grd_goodwin.row = currow;
  392. grd_goodwin.col = grd_goodwin.colRef("goodcd");
  393. grd_goodwin.editCell();
  394. return false;
  395. }
  396. else {
  397. // for(srcrow = currow + 1 ; srcrow < grd_goodwin.rows ; srcrow++)
  398. // {
  399. // if(grd_goodwin.valueMatrix(currow , grd_goodwin.colRef("goodcd")) == grd_goodwin.valueMatrix(srcrow , grd_goodwin.colRef("goodcd")))
  400. // {
  401. // messageBox("동일 물품코드가 [" + (currow - grd_goodwin.fixedRows + 1)+ "," + (srcrow - grd_goodwin.fixedRows + 1)+ "->" + grd_goodwin.valueMatrix(currow , grd_goodwin.colRef("goodcd")) + "] 존재하여 저장 " ,"E001");
  402. // return false;
  403. // }
  404. // }
  405. }
  406. /* 20081202 YYJ 단가 입력 수정 [ 수량이 0인 발주 생성으로 인해 잠시 보류 ]
  407. if (grd_goodwin.valueMatrix(currow , grd_goodwin.colRef("winqty")).length == 0) {
  408. messageBox((currow)+ " 번째 요구량을 " ,"C001");
  409. grd_goodwin.row = currow;
  410. grd_goodwin.col= grd_goodwin.colRef("winqty");
  411. grd_goodwin.editCell();
  412. return false;
  413. }
  414. if (grd_goodwin.valueMatrix(currow , grd_goodwin.colRef("winunitcost")) == 0) {
  415. messageBox((currow)+ " 번째 단가를 " ,"C001");
  416. grd_goodwin.row = currow;
  417. grd_goodwin.col= grd_goodwin.colRef("winunitcost");
  418. grd_goodwin.editCell();
  419. return false;
  420. }
  421. if (grd_goodwin.valueMatrix(currow , grd_goodwin.colRef("winamt")) == 0) {
  422. messageBox((currow -1)+ " 번째 금액을 " ,"C001");
  423. grd_goodwin.row = currow;
  424. grd_goodwin.col = grd_goodwin.colRef("winamt");
  425. grd_goodwin.editCell();
  426. return false;
  427. }
  428. */
  429. winqty = grd_goodwin.valueMatrix(currow , grd_goodwin.colRef("winqty"));
  430. delivedeptqty = grd_goodwin.valueMatrix(currow , grd_goodwin.colRef("delivedeptqty"));
  431. stocqty = winqty - delivedeptqty;
  432. model.setValue(grd_goodwin.nodeset + "[" + (currow - grd_goodwin.fixedRows + 1) + "]/stocqty" , stocqty);
  433. if(stocqty > 0)model.setValue(grd_goodwin.nodeset + "[" + (currow - grd_goodwin.fixedRows + 1) + "]/stocynindx" , "Y");
  434. else model.setValue(grd_goodwin.nodeset + "[" + (currow - grd_goodwin.fixedRows + 1) + "]/stocynindx" , "N");
  435. }
  436. }
  437. return true;
  438. }
  439. // --------------------------------------------------------------
  440. // 입력 데이타 Check
  441. // --------------------------------------------------------------
  442. function fAfterRetrieve()
  443. {
  444. if (sch_select.selectedIndex == 0)
  445. {
  446. var nonwinqty = 0;
  447. var nonwinamt = 0.0;
  448. for (var currow = grd_nonwin.fixedRows ; currow < grd_nonwin.rows ; currow++)
  449. {
  450. nonwinamt += parseFloat(grd_nonwin.valueMatrix(currow , grd_nonwin.colRef("reqfla")));
  451. }
  452. model.setValue(opt_sumreqqty.attribute("ref"),grd_nonwin.rows - grd_nonwin.fixedRows);
  453. model.setValue(opt_sumreqfla.attribute("ref"),nonwinamt);
  454. // 입고건수,금액 초기화
  455. model.setValue(opt_winqtycnt.attribute("ref") ,"0");
  456. model.setValue(opt_winqtytotal.attribute("ref"),"0");
  457. }else{
  458. var winqty = 0.0;
  459. var winamt = 0.0;
  460. for (var currow = grd_goodwin.fixedRows ; currow < grd_goodwin.rows ; currow++)
  461. {
  462. winqty += parseFloat(grd_goodwin.valueMatrix(currow , grd_goodwin.colRef("winqty")) );
  463. winamt += parseFloat(grd_goodwin.valueMatrix(currow , grd_goodwin.colRef("winamt")) );
  464. if (model.getValue(grd_goodwin.nodeset+"["+ currow + "]/slipno") != "") {
  465. grd_goodwin.isReadOnly(currow, grd_goodwin.colRef("winnum"), currow, grd_goodwin.colRef("slipno")) = true;
  466. }
  467. }
  468. model.setValue(ipt_sumwinqty.attribute("ref"),grd_goodwin.rows - grd_goodwin.fixedRows);
  469. model.setValue(opt_sumwinamt.attribute("ref"),winamt);
  470. }
  471. if (sch_select.selectedIndex == 0)
  472. {
  473. if (model.getValue("/root/main/list/goodnonwin/goodmaxwinno/winno").length > 0)
  474. model.setValue(ipt_winno.attribute("ref"),model.getValue("/root/main/list/goodnonwin/goodmaxwinno/winno"));
  475. }
  476. else {
  477. if (model.getValue("/root/main/list/goodwin/goodmaxwinno/winno").length > 0)
  478. model.setValue(ipt_winno.attribute("ref"),model.getValue("/root/main/list/goodwin/goodmaxwinno/winno"));
  479. }
  480. /* 왜 하는지 몰른다...막는다........2007.10.12 */
  481. //fArrangeControl("true");
  482. model.refresh();
  483. }
  484. // --------------------------------------------------------------
  485. // 입고번호 Control
  486. // --------------------------------------------------------------
  487. function fArrangeControl(pDisabled)
  488. {
  489. cmb_instcd.disabled = pDisabled;
  490. cmb_goodflag.disabled = pDisabled;
  491. ipt_windeptcd.disabled = pDisabled;
  492. ipt_winpsn.disabled = pDisabled;
  493. if (pDisabled == "true") {
  494. ipt_winno.attribute("editable") = "false";
  495. }
  496. else {
  497. model.removeNodeset(grd_goodwin.nodeset);
  498. model.removeNodeset(grd_nonwin.nodeset);
  499. model.removeNodeset(grd_goodreq.nodeset);
  500. ipt_winno.attribute("editable") = "true";
  501. }
  502. model.setFocus("ipt_winno");
  503. model.refresh();
  504. }
  505. // --------------------------------------------------------------
  506. // 입고수량 합계 Control
  507. // --------------------------------------------------------------
  508. function fWinqtyTotal()
  509. {
  510. var amt = 0.0;
  511. var amt2 = 0.0;
  512. var cnt = 0;
  513. var bigoamt = 0.0;
  514. bigoamt = parseFloat(grd_nonwin.valueMatrix(grd_nonwin.row, grd_nonwin.colRef("winqty" )))
  515. + parseFloat(grd_nonwin.valueMatrix(grd_nonwin.row, grd_nonwin.colRef("prewinqty")));
  516. if (parseFloat(grd_nonwin.valueMatrix(grd_nonwin.row, grd_nonwin.colRef("reqqty"))) < bigoamt) {
  517. grd_nonwin.valueMatrix(grd_nonwin.row, grd_nonwin.colRef("winqty")) = 0;
  518. messageBox("발주량을 초과하였습니다. 다시 입력하세요.", "");
  519. }
  520. grd_nonwin.valueMatrix(grd_nonwin.row, grd_nonwin.colRef("winqtytotal")) = parseFloat(grd_nonwin.valueMatrix(grd_nonwin.row, grd_nonwin.colRef("goodunitcost")))
  521. * parseFloat(grd_nonwin.valueMatrix(grd_nonwin.row, grd_nonwin.colRef("winqty" )));
  522. grd_nonwin.valueMatrix(grd_nonwin.row, grd_nonwin.colRef("reqfla")) = parseFloat(grd_nonwin.valueMatrix(grd_nonwin.row, grd_nonwin.colRef("goodunitcost")))
  523. * parseFloat(grd_nonwin.valueMatrix(grd_nonwin.row, grd_nonwin.colRef("reqqty" )));
  524. grd_nonwin.refresh();
  525. for (var r = grd_nonwin.fixedRows; r < grd_nonwin.rows; r++) {
  526. if (grd_nonwin.valueMatrix(r, grd_nonwin.colRef("select")) == 'Y' ) {
  527. amt = ( parseFloat(amt) + parseFloat( grd_nonwin.valueMatrix(r, grd_nonwin.colRef("winqtytotal"))));
  528. cnt ++;
  529. }
  530. amt2 = ( parseFloat(amt2) + parseFloat( grd_nonwin.valueMatrix(r, grd_nonwin.colRef("reqfla" ))));
  531. }
  532. model.setValue(opt_sumreqfla.attribute("ref") , amt2);
  533. model.setValue(opt_winqtycnt.attribute("ref") , cnt);
  534. model.setValue(opt_winqtytotal.attribute("ref"), amt);
  535. opt_sumreqfla.refresh();
  536. opt_winqtycnt.refresh();
  537. opt_winqtytotal.refresh();
  538. }
  539. // --------------------------------------------------------------
  540. // 출고완료여부 따라 출고량 수정여부 SETTING
  541. // --------------------------------------------------------------
  542. function fGoodReqListSetting()
  543. {
  544. grd_goodreq.colStyle(grd_goodreq.colRef("delivedeptqty"), "data", "color") = "black";
  545. for(var currow = grd_goodreq.fixedRows ; currow < grd_goodreq.rows ; currow++)
  546. {
  547. if (grd_goodreq.valueMatrix(currow, grd_goodreq.colRef("deliveprcsflag")) == "7" ) //출고 완료된 경우 출고량을 수정 하지 못하게 Grid를 막는다.
  548. grd_goodreq.isReadOnly(currow , grd_goodreq.colRef("delivedeptqty" )) = true;
  549. else
  550. grd_goodreq.isReadOnly(currow , grd_goodreq.colRef("delivedeptqty" )) = false;
  551. }
  552. }
  553. // --------------------------------------------------
  554. // View Option 처리하는 함수
  555. // --------------------------------------------------
  556. function fViewOptionSingle(pColName) {
  557. var vColName = "";
  558. var sNode = null;
  559. var oPath = "/root/init/Options/option_"+ gTabIdx1 +"/";
  560. var vOpTail = "_op_"+gTabIdx1;
  561. var pGrid = eval("grd_"+gGridNm[gTabIdx1])
  562. pGrid.colHidden(pGrid.colRef(pColName)) = (eval("chk_"+pColName + vOpTail).value =="Y") ? false : true;
  563. pGrid.refresh();
  564. }
  565. // --------------------------------------------------------------
  566. // 거래처 변경
  567. // --------------------------------------------------------------
  568. function fCustChange()
  569. {
  570. if ((model.getValue(chk_cust.attribute("ref") ) != "Y") &&
  571. (model.getValue(chk_cust2.attribute("ref")) != "Y") ) {
  572. alert("변경 여부를 선택하십시요.");
  573. return;
  574. };
  575. if ((model.getValue(chk_cust.attribute("ref") ) == "Y") &&
  576. ((model.getValue(ipt_frsuplplcecd.attribute("ref") ) == "") ||
  577. (model.getValue(ipt_frsuplplcenm.attribute("ref") ) == "") ||
  578. (model.getValue(ipt_tosuplplcecd.attribute("ref") ) == "") ||
  579. (model.getValue(ipt_tosuplplcenm.attribute("ref") ) == "")) ) {
  580. alert("주거래처 코드,명칭을 확인하십시요!!");
  581. return;
  582. };
  583. if ((model.getValue(chk_cust2.attribute("ref") ) == "Y") &&
  584. ((model.getValue(ipt_frsubsuplplcecd.attribute("ref") ) == "") ||
  585. (model.getValue(ipt_frsubsuplplcenm.attribute("ref") ) == "") ||
  586. (model.getValue(ipt_tosubsuplplcecd.attribute("ref") ) == "") ||
  587. (model.getValue(ipt_tosubsuplplcenm.attribute("ref") ) == "")) ) {
  588. alert("보조거래처 코드,명칭을 확인하십시요!!");
  589. return;
  590. };
  591. var pGrid = (gTabIdx1 == 0) ? grd_nonwin : grd_nonwin;
  592. alert(pGrid.rows);
  593. for (var r = pGrid.fixedRows; r < pGrid.rows; r++) {
  594. if (model.getValue(chk_cust.attribute("ref") ) == "Y") {
  595. if (model.getValue(pGrid.nodeset+"["+ r +"]/suplplcecd") == model.getValue(ipt_frsuplplcecd.attribute("ref"))) {
  596. model.setValue(pGrid.nodeset+"["+ r +"]/suplplcecd",model.getValue(ipt_tosuplplcecd.attribute("ref")));
  597. model.setValue(pGrid.nodeset+"["+ r +"]/suplplcenm",model.getValue(ipt_tosuplplcenm.attribute("ref")));
  598. }
  599. }
  600. //
  601. if (model.getValue(chk_cust2.attribute("ref") ) == "Y") {
  602. if (model.getValue(pGrid.nodeset+"["+ r +"]/subsuplplcecd") == model.getValue(ipt_frsubsuplplcecd.attribute("ref"))) {
  603. model.setValue(pGrid.nodeset+"["+ r +"]/subsuplplcecd",model.getValue(ipt_tosubsuplplcecd.attribute("ref")));
  604. model.setValue(pGrid.nodeset+"["+ r +"]/subsuplplcenm",model.getValue(ipt_tosubsuplplcenm.attribute("ref")));
  605. }
  606. }
  607. }
  608. pGrid.refresh();
  609. grp_cust.visible = false;
  610. }
  611. //==========================================================
  612. // --------------------------------------------------------------
  613. // 조회후 값 SUM처리한다
  614. // --------------------------------------------------------------
  615. function fDataSum(pGrid)
  616. {
  617. vWinQty = 0;
  618. vWinAmt = 0;
  619. // 결재 내역 List
  620. for (var fRow = pGrid.fixedRows ; fRow < pGrid.rows ; fRow++) {
  621. vWinQty += parseFloat(pGrid.valueMatrix(fRow, pGrid.colRef("winqty")));
  622. vWinAmt += parseFloat(pGrid.valueMatrix(fRow, pGrid.colRef("winamt")));
  623. }
  624. }
  625. // --------------------------------------------------
  626. // 화면 Control을 초기화한다
  627. // --------------------------------------------------
  628. function fClearData() {
  629. misfGridInit(eval("grd_"+gGridNm[gTabIdx1]+"_tree"));
  630. misfGridInit(eval("grd_"+gGridNm[gTabIdx1]));
  631. model.setValue(eval("opt_"+gGridNm[gTabIdx1]+"_qty").attribute("ref"),"");
  632. model.setValue(eval("opt_"+gGridNm[gTabIdx1]+"_amt").attribute("ref"),"");
  633. model.refresh();
  634. return;
  635. }
  636. // --------------------------------------------------------------
  637. // 조회후 값 SUM처리한다
  638. // pGrid : 선택그리드, pFlag : Y:선택, N :취소
  639. // --------------------------------------------------------------
  640. function fDataChkAllSelect(pFlag) {
  641. vWinQtySel = 0;
  642. vWinAmtSel = 0;
  643. var pGrid = eval("grd_"+gGridNm[gTabIdx1])
  644. // 결재 내역 List
  645. for (var fRow = pGrid.fixedRows ; fRow < pGrid.rows ; fRow++) {
  646. fDataCheckSelect(pGrid, fRow, pFlag);
  647. }
  648. pGrid.refresh();
  649. }
  650. function fDataCheckSelect(pGrid, pRow, pFlag) {
  651. vCheck = 0;
  652. if ((model.getValue(pGrid.nodeset+"["+pRow+"]/calccnfmyn") == "Y") &&
  653. (model.getValue(pGrid.nodeset+"["+pRow+"]/winprcsflag") == "9") ){
  654. vCheck = 1;
  655. }
  656. ChkFlag = model.getValue(pGrid.nodeset+"["+pRow+"]/oldchkyn");
  657. if (ChkFlag == "") ChkFlag = "N";
  658. if (ChkFlag == pFlag){
  659. vCheck = 1;
  660. }
  661. if (vCheck == 0) {
  662. pGrid.rowStatus(pRow) = "2";
  663. model.setValue(pGrid.nodeset + "[" + pRow + "]/chkyn", pFlag);
  664. } else {
  665. pGrid.removeStatus(pRow, "update");
  666. model.setValue(pGrid.nodeset + "[" + pRow + "]/chkyn", ChkFlag);
  667. }
  668. // pGrid.refresh();
  669. }
  670. // --------------------------------------------------------------
  671. // 조회후 값 SUM처리한다
  672. // --------------------------------------------------------------
  673. function fDataAllSelect(pFlag) {
  674. vWinQtySel = 0;
  675. vWinAmtSel = 0;
  676. // 결재 내역 List
  677. for (var fRow = grd_rsihdpaplist.fixedRows ; fRow < grd_rsihdpaplist.rows ; fRow++) {
  678. if (grd_rsihdpaplist.valueMatrix(fRow, grd_rsihdpaplist.colRef("slipdd")) == "") {
  679. if (pFlag == "Y") {
  680. vWinQtySel += parseFloat(grd_rsihdpaplist.valueMatrix(fRow, grd_rsihdpaplist.colRef("winqty")));
  681. vWinAmtSel += parseFloat(grd_rsihdpaplist.valueMatrix(fRow, grd_rsihdpaplist.colRef("winamt")));
  682. if (model.getValue(grd_rsihdpaplist.nodeset+ "[" + fRow + "]/chkyn") !="Y") {
  683. model.setValue(grd_rsihdpaplist.nodeset+ "[" + fRow + "]/chkyn" ,pFlag);
  684. model.setValue(grd_rsihdpaplist.nodeset+ "[" + fRow + "]/chkpsn" ,getUserInfo("userid"));
  685. model.setValue(grd_rsihdpaplist.nodeset+ "[" + fRow + "]/chkpsnnm",getUserInfo("usernm"));
  686. model.setValue(grd_rsihdpaplist.nodeset+ "[" + fRow + "]/chkdd" ,getCurrentDate() );
  687. }
  688. } else {
  689. model.setValue(grd_rsihdpaplist.nodeset+ "[" + fRow + "]/chkpsn" , '');
  690. model.setValue(grd_rsihdpaplist.nodeset+ "[" + fRow + "]/chkpsnnm", '');
  691. model.setValue(grd_rsihdpaplist.nodeset+ "[" + fRow + "]/chkdd" , '');
  692. }
  693. }
  694. }
  695. //
  696. model.refresh();
  697. }
  698. // --------------------------------------------------------------
  699. // 조회후 값 SUM처리한다
  700. // --------------------------------------------------------------
  701. function fDataSelectSum(pGrid)
  702. {
  703. vWinQtySel = 0;
  704. vWinAmtSel = 0;
  705. // 결재 내역 List
  706. for (var fRow = pGrid.fixedRows ; fRow < pGrid.rows ; fRow++) {
  707. if (pGrid.valueMatrix(fRow, pGrid.colRef("slipdd")) == "" ) {
  708. if (pGrid.valueMatrix(fRow, pGrid.colRef("chkyn" )) == "Y") {
  709. vWinQtySel += parseFloat(pGrid.valueMatrix(fRow, pGrid.colRef("winqty")));
  710. vWinAmtSel += parseFloat(pGrid.valueMatrix(fRow, pGrid.colRef("winamt")));
  711. }
  712. }
  713. }
  714. model.setValue(opt_winqtysel.attribute("ref") ,vWinQtySel);
  715. model.setValue(opt_winamtsel.attribute("ref") ,vWinAmtSel);
  716. model.refresh();
  717. }
  718. // --------------------------------------------------------------
  719. // 조회후 값 SUM처리한다
  720. // --------------------------------------------------------------
  721. function fOnRowChanged(pGrid)
  722. {
  723. sPath ="/root/send/";
  724. tPath ="/root/send/windtl/";
  725. model.setValue(tPath + "instcd" , model.getValue(sPath + "instcd" )); // 기관코드
  726. model.setValue(tPath + "fromdd" , model.getValue(sPath + "fromdd" )); // 입고일자 FROM
  727. model.setValue(tPath + "todd" , model.getValue(sPath + "todd" )); // 입고일자 TO
  728. model.setValue(tPath + "chkyn" , model.getValue(sPath + "chkyn" )); // 검수유무
  729. model.setValue(tPath + "winpsn" , model.getValue(sPath + "winpsn" )); // 입고자
  730. model.setValue(tPath + "suppcustcd", model.getValue(sPath + "suppcustcd")); // 보조거래처
  731. model.setValue(tPath + "purcflag" , model.getValue(sPath + "purcflag" )); // 구매구분
  732. model.setValue(tPath + "paycond" , model.getValue(sPath + "paycond" )); // 1:정상, 2:지불필
  733. model.setValue(tPath + "windd" , "" ); // 입고일자
  734. model.setValue(tPath + "calcdocudd", "" ); // 계산서일자
  735. model.setValue(tPath +"goodflag" , pGrid.valueMatrix(pGrid.row, pGrid.colRef("goodflag" ))); // 물품구분
  736. model.setValue(tPath +"suplplcecd" , pGrid.valueMatrix(pGrid.row, pGrid.colRef("suplplcecd" ))); // 주거래처
  737. model.setValue(tPath +"purcflag" , pGrid.valueMatrix(pGrid.row, pGrid.colRef("purcflag" ))); // 구매구분
  738. model.setValue(tPath +"calcdocukind", pGrid.valueMatrix(pGrid.row, pGrid.colRef("calcdocukind"))); // 계산서구분
  739. model.setValue(tPath +"slipdd" , pGrid.valueMatrix(pGrid.row, pGrid.colRef("slipdd"))); // 전표일자
  740. model.setValue(tPath +"slipno" , pGrid.valueMatrix(pGrid.row, pGrid.colRef("slipno"))); // 전표번호
  741. model.setValue(tPath +"winpsn" , pGrid.valueMatrix(pGrid.row, pGrid.colRef("winpsn"))); // 입고자
  742. submit("TRRSI02706");
  743. fAfterRetrieve("2");
  744. model.refresh();
  745. }
  746. // --------------------------------------------------
  747. // Tree Click
  748. // --------------------------------------------------
  749. function fTreeGridClick() {
  750. var OpCode = "";
  751. var OpDepth = "";
  752. var pGrid = eval("grd_"+gGridNm[gTabIdx1]+"_tree")
  753. var Idx = pGrid.row;
  754. var TreePath = pGrid.nodeset;
  755. if (Idx == 0) return;
  756. if (gIndex == Idx) {
  757. return;
  758. } else {
  759. gIndex = Idx;
  760. }
  761. //
  762. var vDepth = ""; // 1 LEVEL
  763. var vPcode = ""; // 2 코드+상위코드
  764. var vCodecd = ""; // 3 코드
  765. var vCodenm = ""; // 4 코드명
  766. var vBasecd = ""; // 5 결합코드
  767. var vWincnt = ""; // 6 입고건수
  768. var vWinqty = ""; // 7 입고수량
  769. var vWinamt = ""; // 8 입고금액
  770. var vWincnt2 = ""; // 6 입고건수
  771. var vWinqty2 = ""; // 7 입고수량
  772. var vWinamt2 = ""; // 8 입고금액
  773. var vDispnm = ""; // 9 DISPLAY 분류명
  774. var DispData = ""; //
  775. var vGoodflag = ""; // 02 물품구분
  776. var vSuplplcecd = ""; // 03 주거래처
  777. var vSuppcustcd = ""; // 04 보조거래처
  778. vDepth = model.getValue(TreePath +"["+Idx+"]/depth" ); // 01 LEVEL
  779. vPcode = model.getValue(TreePath +"["+Idx+"]/pcode" ); // 02 코드+상위코드
  780. vCodecd = model.getValue(TreePath +"["+Idx+"]/codecd" ); // 03 코드
  781. vEcodecd = model.getValue(TreePath +"["+Idx+"]/ecodecd"); // 04 EDIT 코드
  782. vCodenm = model.getValue(TreePath +"["+Idx+"]/codenm" ); // 05 코드명
  783. vBasecd = model.getValue(TreePath +"["+Idx+"]/basecd" ); // 06 결합코드
  784. vWincnt = model.getValue(TreePath +"["+Idx+"]/wincnt" ); // 07 입고건수
  785. vWinqty = model.getValue(TreePath +"["+Idx+"]/winqty" ); // 08 입고수량
  786. vWinamt = model.getValue(TreePath +"["+Idx+"]/winamt" ); // 09 입고금액
  787. vWincnt2 = model.getValue(TreePath +"["+Idx+"]/wincnt2"); // 07 입고건수
  788. vWinqty2 = model.getValue(TreePath +"["+Idx+"]/winqty2"); // 08 입고수량
  789. vWinamt2 = model.getValue(TreePath +"["+Idx+"]/winamt2"); // 09 입고금액
  790. vDispnm = model.getValue(TreePath +"["+Idx+"]/dispnm" ); // 10 DISPLAY 분류명
  791. DispData = vEcodecd + " : " + vCodenm; //
  792. vGoodflag = vPcode.substr( 2, 1); // 02 물품구분
  793. vSuplplcecd = vPcode.substr( 3, 10); // 03 주거래처
  794. vSuppcustcd = vPcode.substr(13, 10); // 04 보조거래처
  795. model.setValue(eval("opt_"+gGridNm[gTabIdx1]+"_qty").attribute("ref"), vWinqty);
  796. model.setValue(eval("opt_"+gGridNm[gTabIdx1]+"_amt").attribute("ref"), vWinamt);
  797. // if (parseFloat(vWincnt) > 500) {
  798. // alert("조회량이 500건을 초과하여 시간이 지연됩니다. 하위레벨에서 조회 바랍니다!!");
  799. // misfGridInit(eval("grd_"+gGridNm[gTabIdx1]));
  800. // model.refresh();
  801. // return;
  802. // }
  803. sPath ="/root/send/";
  804. tPath ="/root/send/windtl/";
  805. model.setValue(tPath + "instcd" , model.getValue(sPath + "instcd" )); // 기관코드
  806. model.setValue(tPath + "fromdd" , model.getValue(sPath + "fromdd" )); // 입고일자 FROM
  807. model.setValue(tPath + "todd" , model.getValue(sPath + "todd" )); // 입고일자 TO
  808. model.setValue(tPath + "chkyn" , model.getValue(sPath + "chkyn" )); // 검수유무
  809. model.setValue(tPath + "winpsn" , model.getValue(sPath + "winpsn" )); // 입고자
  810. model.setValue(tPath + "suplplcecd" , model.getValue(sPath + "suplplcecd" )); // 주거래처
  811. model.setValue(tPath + "suppcustcd" , model.getValue(sPath + "suppcustcd" )); // 보조거래처
  812. model.setValue(tPath + "purcflag" , model.getValue(sPath + "purcflag" )); // 구매구분
  813. model.setValue(tPath + "paycond" , model.getValue(sPath + "paycond" )); // 1:정상, 2:지불필
  814. model.setValue(tPath + "searchflag" , model.getValue(sPath + "searchflag" )); // 조회구분
  815. model.setValue(tPath + "frcalcdocudd" , model.getValue(sPath + "frcalcdocudd")); // 계산서일자 FR
  816. model.setValue(tPath + "tocalcdocudd" , model.getValue(sPath + "tocalcdocudd")); // 계산서일자 TO
  817. model.setValue(tPath + "groupbugt" , model.getValue(sPath + "groupbugt" )); // 예산계정코드
  818. model.setValue(tPath + "calccnfmyn" , model.getValue(sPath + "calccnfmyn" )); // 정산확정여부
  819. model.setValue(tPath + "winprcsflag" , model.getValue(sPath + "winprcsflag" )); // 8:미처리, 9:처리
  820. model.setValue(tPath + "calccnfmdd" , model.getValue(sPath + "calccnfmdd" )); // 정산일자
  821. model.setValue(tPath + "frcalccnfmdd" , model.getValue(sPath + "frcalccnfmdd")); // 정산확정일자 FR
  822. model.setValue(tPath + "tocalccnfmdd" , model.getValue(sPath + "tocalccnfmdd")); // 정산확정일자 TO
  823. model.setValue(tPath +"goodflag" , vGoodflag ); // 물품구분
  824. model.setValue(tPath +"suplplcecd" , vSuplplcecd ); // 주거래처
  825. model.setValue(tPath +"suppcustcd" , vSuppcustcd ); // 보조거래처
  826. if (gTabIdx1 == "0") {
  827. submit("TRRSI02706");
  828. }
  829. if (gTabIdx1 == "2") {
  830. submit("TRRSI02712");
  831. }
  832. if (gTabIdx1 == "3") {
  833. submit("TRRSI02713");
  834. }
  835. var pGridDetail = eval("grd_"+gGridNm[gTabIdx1])
  836. fViewOptionToggleX(pGridDetail);
  837. fViewOptionToggle();
  838. // fCopy2DetailData(gTabIdx1, pGridDetail);
  839. pGridDetail.refresh();
  840. model.refresh();
  841. }
  842. /**
  843. * @group :
  844. * @ver : 2009.04.23
  845. * @by : 최학록
  846. * @---------------------------------------------------
  847. * @type : function
  848. * @access : public
  849. * @desc : 그리드를 트리구조로 만들어준다.
  850. * @param :
  851. * @return :
  852. * @---------------------------------------------------
  853. */
  854. function fCopy2DetailData(pIdx, pGrid){
  855. // model.removeNodeset(pGrid.nodeset);
  856. misfGridInit(pGrid);
  857. model.copyNode( "/root/init/"+gPathNm[pIdx], "/root/main/"+ gPathNm[pIdx]);
  858. model.removeNodeset("/root/main/"+ gPathNm[pIdx]);
  859. fViewOptionToggleX(pGrid);
  860. }
  861. // --------------------------------------------------
  862. // Data Part Toggle 속성Toggle 처리하는 함수
  863. // --------------------------------------------------
  864. function fDataPartToggle(pCls) {
  865. var pGrpDetail = eval("grp_"+gGridNm[gTabIdx1])
  866. var pGrdDetail = eval("grd_"+gGridNm[gTabIdx1])
  867. switch(pCls) {
  868. case 0 :
  869. // 메인 Grup
  870. pGrpDetail.attribute("left" ) = "457";
  871. pGrpDetail.attribute("width" ) = "731";
  872. pGrdDetail.attribute("width" ) = "731";
  873. break;
  874. case 1 :
  875. pGrpDetail.attribute("left" ) = "0";
  876. pGrpDetail.attribute("width" ) = "1188";
  877. pGrdDetail.attribute("width" ) = "1188";
  878. }
  879. pGrpDetail.refresh();
  880. }
  881. // --------------------------------------------------
  882. // View Option 처리하는 함수
  883. // --------------------------------------------------
  884. function fViewOptionToggleX(pGrid) {
  885. for (var fRow = 1; fRow < pGrid.rows ; fRow++) {
  886. if (model.getValue(pGrid.nodeset+"["+fRow+"]/winprcsflag")=="9") {
  887. pGrid.isReadOnly(fRow, pGrid.colRef("chkyn"), fRow, pGrid.colRef("chkyn")) = true;
  888. } else {
  889. pGrid.isReadOnly(fRow, pGrid.colRef("chkyn"), fRow, pGrid.colRef("chkyn")) = false;
  890. }
  891. }
  892. pGrid.refresh();
  893. }
  894. // --------------------------------------------------
  895. // View Option 처리하는 함수
  896. // --------------------------------------------------
  897. function fViewOptionToggle() {
  898. var vColName = "";
  899. var sNode = null;
  900. var oPath = "/root/init/Options/option_"+ gTabIdx1 +"/";
  901. var vOpTail = "_op_"+gTabIdx1;
  902. var pGrid = eval("grd_"+gGridNm[gTabIdx1])
  903. for (var fCol = 1; fCol < pGrid.cols ; fCol++) {
  904. vColName = pGrid.colAttribute(fCol,"ref");
  905. var sNode = instance1.selectSingleNode(oPath + vColName);
  906. if (sNode != null) {
  907. pGrid.colHidden(pGrid.colRef(vColName)) = (eval("chk_"+vColName + vOpTail).value =="Y") ? false : true;
  908. }
  909. }
  910. pGrid.refresh();
  911. grp_view.visible = false;
  912. }
  913. // --------------------------------------------------
  914. // Grid On Click 처리하는 함수
  915. // --------------------------------------------------
  916. function fGridConClick() {
  917. var vGrid = eval("grd_"+gGridNm[gTabIdx1])
  918. if ((vGrid.row == 0 ) ||
  919. (vGrid.col != vGrid.colRef("chkyn"))) return;
  920. ChkFlag = model.getValue(vGrid.nodeset + "[" + vGrid.row + "]/chkyn");
  921. fDataCheckSelect(vGrid, vGrid.row, ChkFlag);
  922. vGrid.refresh();
  923. }
  924. //-----------------------------------
  925. // 입고 검수 확인 저장
  926. //-----------------------------------
  927. function fCheckPersonSave(){
  928. var vCnt = 0 ;
  929. var pGrid = eval("grd_"+gGridNm[gTabIdx1])
  930. var sPath = pGrid.nodeset;
  931. var tPath = "/root/send/winchecklists";
  932. var tPath2 = "/root/send/winchecklists/winchecklist";
  933. var WincheckData = ""; // Send Data
  934. var WincheckHead = "instcd" + "▦" // 01 기관코드
  935. + "goodflag" + "▦" // 02 물품구분
  936. + "windd" + "▦" // 03 입고일자
  937. + "winno" + "▦" // 04 입고번호(0000)
  938. + "winseqno" + "▦" // 05 입고일련번호(000~999)
  939. + "windeptcd" + "▦" // 06 입고부서코드
  940. + "checkflag" + "▦" // 07 검수확인 UPDATE 여부
  941. + "chkyn" + "▦" // 08 검수확인여부
  942. + "chkpsn" + "▦" // 09 검수확인자
  943. + "chkdd" + "▦" // 10 검수확인년월
  944. + "calccnfmflag" + "▦" // 11 정산확정UPDATE 여부
  945. + "calccnfmpsn" + "▦" // 12 정산확정자
  946. + "calccnfmyn" + "▦" // 13 정산확정여부
  947. + "calccnfmdd" + "▦" // 14 정산확정년월
  948. + "winprcsflag" + "▦" // 15 정산상태 0:미결재,8:회계처리대상,9:회계처리완료
  949. + "slipflag" + "▦" // 16 전표UPDATE 여부
  950. + "slipdd" + "▦" // 17 전표일자
  951. + "slipno" + "▦" // 18 전표번호
  952. + "tableflag" + "▩"; // 19 검수테이블구분
  953. for (var fRow = pGrid.fixedRows; fRow < pGrid.rows ; fRow++ ) {
  954. if (pGrid.rowStatus(fRow) == 2) {
  955. WincheckData += model.getValue(sPath + "[" + fRow + "]/instcd" ) + "▦" // 01 기관코드
  956. if (gTabIdx1 == "3") {
  957. WincheckData += model.getValue(sPath + "[" + fRow + "]/fixtrseqmtflag" ) + "▦" // 02 물품구분
  958. WincheckData += model.getValue(sPath + "[" + fRow + "]/reqdd" ) + "▦" // 03 입고일자
  959. WincheckData += model.getValue(sPath + "[" + fRow + "]/reqno" ) + "▦" // 04 입고번호(0000)
  960. WincheckData += "" + "▦" // 05 입고일련번호(000~999)
  961. WincheckData += "" + "▦" // 06 입고부서코드
  962. } else {
  963. WincheckData += model.getValue(sPath + "[" + fRow + "]/goodflag" ) + "▦" // 02 물품구분
  964. WincheckData += model.getValue(sPath + "[" + fRow + "]/windd" ) + "▦" // 03 입고일자
  965. WincheckData += model.getValue(sPath + "[" + fRow + "]/winno" ) + "▦" // 04 입고번호(0000)
  966. WincheckData += model.getValue(sPath + "[" + fRow + "]/winseqno" ) + "▦" // 05 입고일련번호(000~999)
  967. if (gTabIdx1 == "2") {
  968. WincheckData += "" + "▦" // 06 입고부서코드
  969. } else {
  970. WincheckData += model.getValue(sPath + "[" + fRow + "]/windeptcd") + "▦" // 06 입고부서코드
  971. }
  972. }
  973. WincheckData += "Y" + "▦" // 07 검수확인 UPDATE 여부
  974. WincheckData += model.getValue(sPath + "[" + fRow + "]/chkyn" ) + "▦" // 08 검수확인여부
  975. if (model.getValue(sPath + "[" + fRow + "]/chkyn")=="Y") {
  976. WincheckData += getUserInfo("userid") + "▦" // 09 검수확인자
  977. WincheckData += getCurrentDate() + "▦" // 10 검수확인년월
  978. } else {
  979. WincheckData += "" + "▦" // 09 검수확인자
  980. WincheckData += "" + "▦" // 10 검수확인년월
  981. }
  982. WincheckData += "N" + "▦" // 11 정산확정UPDATE 여부
  983. WincheckData += "" + "▦" // 12 정산확정자
  984. WincheckData += "" + "▦" // 13 정산확정여부
  985. WincheckData += "" + "▦" // 14 정산확정년월
  986. WincheckData += "" + "▦" // 15 정산상태 0:미결재,8:회계처리대상,9:회계처리완료
  987. WincheckData += "N" + "▦" // 16 전표UPDATE 여부
  988. WincheckData += "" + "▦" // 17 전표일자
  989. WincheckData += "" + "▦" // 18 전표번호
  990. WincheckData += gTabIdx1 + "▩"; // 19 검수테이블구분
  991. vCnt++;
  992. }
  993. }
  994. if (vCnt > 0) {
  995. model.removenode(tPath);
  996. model.makeValue(tPath2, WincheckHead+WincheckData);
  997. submit("TXRSI02710");
  998. }
  999. }
  1000. // --------------------------------------------------
  1001. // 보기 Option 선택
  1002. // --------------------------------------------------
  1003. function fViewOptionClick() {
  1004. switch(gTabIdx1) {
  1005. case "0" :
  1006. grp_rsihinptlist_op.visible = true;
  1007. grp_rfchinpflist_op.visible = false;
  1008. grp_rfehemhtlist_op.visible = false;
  1009. break;
  1010. case "2" :
  1011. grp_rsihinptlist_op.visible = false;
  1012. grp_rfchinpflist_op.visible = true;
  1013. grp_rfehemhtlist_op.visible = false;
  1014. break;
  1015. case "3" :
  1016. grp_rsihinptlist_op.visible = false;
  1017. grp_rfchinpflist_op.visible = false;
  1018. grp_rfehemhtlist_op.visible = true;
  1019. }
  1020. grp_view.visible = true;
  1021. grp_view.refresh();
  1022. }
  1023. // --------------------------------------------------
  1024. // Grid Excel 저장
  1025. // --------------------------------------------------
  1026. function fExcelDataSave() {
  1027. switch(gTabIdx1) {
  1028. case "0" :
  1029. misfSaveExcel(grd_rsihinptlist);
  1030. break;
  1031. case "2" :
  1032. misfSaveExcel(grd_rfchinpflist);
  1033. break;
  1034. case "3" :
  1035. misfSaveExcel(grd_rfehemhtlist);
  1036. }
  1037. }
  1038. // --------------------------------------------------
  1039. // Grid Button 저장
  1040. // --------------------------------------------------
  1041. function fOnButtonClick(pCode, pName) {
  1042. model.removenode("/root/copynode");
  1043. model.removenode(gvParamPath +"/CUSTCD_/CUSTCD_value");
  1044. model.makeNode("/root/copynode");
  1045. rszfOpenPopUpListByWndName(grd_nonwin,"",pCode+","+pName,"SPRSD00220","instcd,goodflag","cmb_instcd,cmb_goodflag");
  1046. var cur_row = grd_nonwin.row;
  1047. var status = grd_nonwin.valueMatrix(cur_row, grd_nonwin.colRef("m"));
  1048. var CSV = model.getValue(gvParamPath +"/CUSTCD_/CUSTCD_value");
  1049. setCSVToNode("/root/copynode", CSV, "custlist");
  1050. }
  1051. //--------------------------------------
  1052. // 전자 세금계산서 변경 컨트롤을 View
  1053. //--------------------------------------
  1054. function fUpdateDataView()
  1055. {
  1056. grp_invoice.visible = true;
  1057. grp_main.disabled = true;
  1058. grp_invoice.refresh();
  1059. }
  1060. //--------------------------------------
  1061. // 발주용으로 화면 변경
  1062. //--------------------------------------
  1063. function fDtiOptionView()
  1064. {
  1065. // grp_cond.visible = false;
  1066. grp_goodflag.visible = false;
  1067. // grp_sup_reg_num.visible = true;
  1068. dti_map.visible = "hidden";
  1069. dti_select.visible = "visible";
  1070. // cmb_supregnum.visible = "hidden";
  1071. ckb_sameyn.disabled = true;
  1072. ipt_fr_pub_date.attribute("editable") = true;
  1073. ipt_to_pub_date.attribute("editable") = true;
  1074. ipt_sup_reg_num.attribute("editable") = true;
  1075. }
  1076. //
  1077. // 입고내역 세금계산서번호 매핑한다.
  1078. //
  1079. function fSelectInvoiceNo(vGride) {
  1080. if (vGride.row < 1) {
  1081. alert("세금계산서를 선택하십시요!!");
  1082. return true;
  1083. }
  1084. // var pGrid = (gTabIdx1 == 0) ? grd_nonwin : grd_nonwin;
  1085. var pGrid = grd_nonwin;
  1086. var vNo = model.getValue(vGride.nodeset + "[" +vGride.row + "]/inv_no" ); // 17 전자계산서번호
  1087. var vPub_date = model.getValue(vGride.nodeset + "[" +vGride.row + "]/pub_date" ); // 23 전자계산서일자
  1088. var vSupRegNum = model.getValue(vGride.nodeset + "[" +vGride.row + "]/sup_reg_num" ); // 59 공급자 사업자번호
  1089. for (var Idx = pGrid.fixedRows; Idx < pGrid.rows; Idx++) {
  1090. if (model.getValue(pGrid.nodeset+"["+ Idx +"]/suplplcecd") == vSupRegNum) {
  1091. vCheck = 0;
  1092. if ((model.getValue(cmb_custselect.attribute("ref")) != "A" ) &&
  1093. (model.getValue(pGrid.nodeset + "[" + Idx + "]/select") != "Y")){
  1094. vCheck = 1;
  1095. }
  1096. // 전자세금계산서 매핑 안된 것만
  1097. if ((model.getValue(ckb_mappingyn.attribute("ref") ) == "Y") &&
  1098. (model.getValue(pGrid.nodeset + "[" + Idx + "]/inv_no") != "-" )){
  1099. vCheck = 1;
  1100. }
  1101. //
  1102. if (vCheck == 0) {
  1103. pGrid.rowStatus(Idx) = "2";
  1104. model.setValue(pGrid.nodeset + "[" + Idx + "]/inv_no" , vNo); // 전자계산서번호
  1105. model.setValue(pGrid.nodeset + "[" + Idx + "]/select" ,"Y" ); // CHECK구분
  1106. model.setValue(pGrid.nodeset + "[" + Idx + "]/elctstmntyn","Y" ); // 계산서여부
  1107. //
  1108. if (model.getValue(ckb_calcdocuddyn.attribute("ref") ) == "Y") {
  1109. model.setValue(pGrid.nodeset + "[" + Idx + "]/calcdocudd", vPub_date);
  1110. }
  1111. grd_goodwin.valueMatrix(Idx , grd_goodwin.colRef("select")) = "Y";
  1112. }
  1113. }
  1114. }
  1115. fWinqtyTotal_2();
  1116. pGrid.refresh();
  1117. grp_invoice.visible = false;
  1118. grp_main.disabled = false; // addGroup 컨트롤이 나타나면 listGroup 컨트롤을 disabled 시킴
  1119. }
  1120. // --------------------------------------------------------------
  1121. // 입고수량 합계 Control
  1122. // --------------------------------------------------------------
  1123. function fWinqtyTotal_2()
  1124. {
  1125. var amt = 0.0;
  1126. var amt2 = 0.0;
  1127. var cnt = 0;
  1128. for (var r = grd_nonwin.fixedRows; r < grd_nonwin.rows; r++) {
  1129. ReqFla = parseFloat(grd_nonwin.valueMatrix(r, grd_nonwin.colRef("goodunitcost")))
  1130. * parseFloat(grd_nonwin.valueMatrix(r, grd_nonwin.colRef("reqqty" )));
  1131. if (grd_nonwin.valueMatrix(r, grd_nonwin.colRef("select")) == 'Y' ) {
  1132. WinAmt = parseFloat(grd_nonwin.valueMatrix(r, grd_nonwin.colRef("goodunitcost")))
  1133. * parseFloat(grd_nonwin.valueMatrix(r, grd_nonwin.colRef("winqty" )));
  1134. grd_nonwin.valueMatrix(r, grd_nonwin.colRef("winqtytotal")) = WinAmt;
  1135. grd_nonwin.valueMatrix(r, grd_nonwin.colRef("reqfla" )) = ReqFla;
  1136. amt = ( parseFloat(amt) + WinAmt);
  1137. cnt ++;
  1138. }
  1139. amt2 = ( parseFloat(amt2) + ReqFla);
  1140. }
  1141. model.setValue(opt_sumreqfla.attribute("ref") , amt2);
  1142. model.setValue(opt_winqtycnt.attribute("ref") , cnt);
  1143. model.setValue(opt_winqtytotal.attribute("ref"), amt);
  1144. opt_sumreqfla.refresh();
  1145. opt_winqtycnt.refresh();
  1146. opt_winqtytotal.refresh();
  1147. }
  1148. /* ------------------------------------------------- */
  1149. /* ------End Of List ------------------------------- */
  1150. /* -------------------------------------------------- */