SMRSI02712.js 60 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145
  1. /* ---------------------------------------------------------------------
  2. SMRSI02711_입고내역검수관리.xrw (SMRSI02711.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 gPurcDeptcd = ""; // 구매부서코드
  17. var gPurcDeptnm = ""; // 구매부서코드명
  18. var gTabIdx1 = "0"; //TAB INDEX
  19. var gTreeNode = "/root/main/TreeLists";
  20. var gTreeNodeset = "/root/main/TreeLists/TreeList";
  21. var gCustNodeset = "/root/main/TreeLists/CustList";
  22. var gPathName = "RsihinptLists#RsihinptLists#RfchinpfLists#RfehemhtLists"
  23. var gPathNm = gPathName.split("#");
  24. var gPathDetailName = "RsihinptList#RsihinptList#RfchinpfList#RfehemhtList"
  25. var gPathDetailNm = gPathDetailName.split("#");
  26. var gGridName = "rsihinptlist#rsihinptlist2#rfchinpflist#rfehemhtlist"
  27. var gGridNm = gGridName.split("#");
  28. // --------------------------------------------------
  29. // 화면 Control을 초기화한다
  30. // --------------------------------------------------
  31. function fInit() {
  32. fInitialize();
  33. return;
  34. }
  35. // --------------------------------------------------------------
  36. // 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
  37. // --------------------------------------------------------------
  38. // <group id="grp_batchconf" visibility="hidden" showeffect="slidepositive 500" style="left:0px; top:0px; width:1194px; height:739px; border-color:#ffcc99; border-style:solid; ">
  39. function fInitialize() {
  40. misfGridInit(grd_gooddelivelist);
  41. misfGridInit(eval("grd_"+gGridNm[0]));
  42. misfGridInit(eval("grd_"+gGridNm[0]+"_tree"));
  43. misfGridInit(eval("grd_"+gGridNm[2]));
  44. misfGridInit(eval("grd_"+gGridNm[2]+"_tree"));
  45. misfGridInit(eval("grd_"+gGridNm[3]));
  46. misfGridInit(eval("grd_"+gGridNm[3]+"_tree"));
  47. // 사용자별 청구 기관 List
  48. rszfUserReqInstList(cmb_instcd ,getUserInfo("userid"),"1","B");
  49. rszfUserReqInstList(ipt_batch_instcd,getUserInfo("userid"),"1","B");
  50. cmb_instcd.value = getUserInfo("dutplceinstcd");
  51. ipt_batch_instcd.value = getUserInfo("dutplceinstcd");
  52. // -------------------------------------------------------------------------------------
  53. // 기관별 구매시스템 기본정보를 조회한다
  54. // vPathResult = "/root/init/RscsysinftLists";
  55. // -------------------------------------------------------------------------------------
  56. rszfRscsysinftLists(getUserInfo("dutplceinstcd"));
  57. // -------------------------------------------------------------------------------------
  58. // 구매 인터페이스 거래처정보를 조회한다
  59. // vPathResult = "/root/init/RscifcustLists";
  60. // pInstcd" : (조회값) 기관코드
  61. // pEntrregno" : (조회값) 거래처
  62. // pMaindeptcd" : (조회값) 관리부서코드
  63. // pCombo : 콤보구분
  64. // pAllYN : 전체구분
  65. // ------------------------------------------------------------------------------------*/
  66. gPurcDeptcd = getRscsysinftInfo("purcdept" );
  67. gPurcDeptnm = getRscsysinftInfo("purcdeptnm");
  68. // 성의교정,산협은 계정을 가져온다.
  69. if (cmb_instcd.value == "103" || cmb_instcd.value == "114") {
  70. //rszfComboBgcdBugtList("cmb_groupbugt" , cmb_instcd.value, '1');
  71. rszfComboBgcdBugtList("cmb_groupbugt" , "103", "1");
  72. addComboItem( "cmb_groupbugt" , "전체", "", "above");
  73. cmb_groupbugt.visible = true;
  74. cap_groupbugt.visible = true;
  75. } else {
  76. cmb_groupbugt.visible = false; // 계정
  77. cap_groupbugt.visible = false; // 계정
  78. }
  79. // 사용자별 물품 구분
  80. misfComboComCdList("R0111",cmb_purcflag,"Y");
  81. var reqdate = getCurrentDate().toDate("YYYYMMDD");
  82. model.setValue(ipt_fromdd.attribute("ref"), getCurrentDate());
  83. model.setValue(ipt_todd.attribute("ref") , getCurrentDate());
  84. model.setValue(opt_calccnfmpsn.attribute("ref"), getUserInfo("userid"));
  85. model.setValue(opt_purcdeptcd.attribute("ref") , gPurcDeptcd);
  86. misfMsterDetailSet(eval("grd_"+gGridNm[gTabIdx1]) , null, "TRRSI02706", "N");
  87. model.refresh();
  88. }
  89. /**
  90. * @group :
  91. * @ver : 2009.04.23
  92. * @by : 최학록
  93. * @---------------------------------------------------
  94. * @type : function
  95. * @access : public
  96. * @desc : 그리드를 트리구조로 만들어준다.
  97. * @param :
  98. * @return :
  99. * @---------------------------------------------------
  100. */
  101. function fDataSearch(){
  102. if(!isRequiredControls("cmb_instcd"))return;
  103. if(!isRequiredControls("ipt_fromdd"))return;
  104. if(!isRequiredControls("ipt_todd" ))return;
  105. var vGrid = eval("grd_"+gGridNm[gTabIdx1]+"_tree")
  106. misfGridInit(vGrid);
  107. // fClearData();
  108. model.removeNodeset(gTreeNodeset);
  109. submit("TRRSI02705");
  110. fMakeTreeView(gTabIdx1, vGrid)
  111. gIndex = ""; // 02 물품구분
  112. gGoodflag = ""; // 02 물품구분
  113. gSuplplcecd = ""; // 03 주거래처
  114. gSuppcustcd = ""; // 04 보조거래처
  115. }
  116. /**
  117. * @group :
  118. * @ver : 2009.04.23
  119. * @by : 최학록
  120. * @---------------------------------------------------
  121. * @type : function
  122. * @access : public
  123. * @desc : 그리드를 트리구조로 만들어준다.
  124. * @param :
  125. * @return :
  126. * @---------------------------------------------------
  127. */
  128. function fMakeTreeView(pIdx, pGrid){
  129. model.removeNodeset(pGrid.nodeset);
  130. model.copyNode( "/root/init/"+ gPathNm[pIdx], gTreeNode);
  131. pGrid.refresh();
  132. var iQty = 0;
  133. var oQty = 0;
  134. var sRowCnt = pGrid.rows-pGrid.fixedRows;
  135. var depth;
  136. for(var i=1; i<= sRowCnt; i++){
  137. model.setValue(pGrid.nodeset+"["+i+"]/treenm", model.getValue(pGrid.nodeset+"["+i+"]/codecd") +" : " +
  138. model.getValue(pGrid.nodeset+"["+i+"]/codenm") );
  139. depth = model.getValue(pGrid.nodeset+"["+i+"]/depth");
  140. pGrid.outlinelevel(i) = depth;//depth별로 레벨을 지정한다.
  141. if (model.getValue(rd_mainsub.attribute("ref")) == "N" ) {
  142. vDepth = 3;
  143. } else {
  144. vDepth = 4;
  145. }
  146. //
  147. if (depth == vDepth) { //depth별로 레벨을 지정한다.
  148. iQty = parseFloat(model.getValue(pGrid.nodeset+"["+ i +"]/winqty" ));
  149. oQty = parseFloat(model.getValue(pGrid.nodeset+"["+ i +"]/outqty" ));
  150. if (iQty != oQty ) {
  151. pGrid.cellstyle("background-color", i, pGrid.colRef("winamt"), i, pGrid.colRef("winamt")) = "yellow";
  152. pGrid.cellstyle("color" , i, pGrid.colRef("winamt"), i, pGrid.colRef("winamt")) = "red";
  153. }
  154. }
  155. // eval("grd_"+gGridNm[gTabIdx1]+"_tree").rowhidden(i) = (depth > 3) ? true : false;
  156. // eval("grd_"+gGridNm[gTabIdx1]+"_tree").colDisabled(11) = true ;//시작일자 컬럼을 Non-Edit처리한다.
  157. }
  158. pGrid.OutlineCol = 1; //트리구조로 보여줄 col인덱스설정
  159. pGrid.OutlineBar = 4; //트리의 스타일 설정
  160. pGrid.TreeColor = "gray"; //트리색 설정 blue red yellow skyblue black gray
  161. model.removeNodeset(gTreeNodeset);
  162. model.removeNodeset(gCustNodeset);
  163. pGrid.refresh();
  164. // /*
  165. // cmb_supregnum.refresh();
  166. // */
  167. }
  168. // --------------------------------------------------------------
  169. // 조회후 값 SUM처리한다
  170. // --------------------------------------------------------------
  171. function fAfterRetrieve(pFlag)
  172. {
  173. vWinQty = 0;
  174. vWinAmt = 0;
  175. vWinQtySel = 0;
  176. vWinAmtSel = 0;
  177. if (pFlag == "1") {
  178. // 결재 내역 List
  179. for (var fRow = grd_rsihdpaplist.fixedRows ; fRow < grd_rsihdpaplist.rows ; fRow++) {
  180. vWinQty += parseFloat(grd_rsihdpaplist.valueMatrix(fRow, grd_rsihdpaplist.colRef("winqty")));
  181. vWinAmt += parseFloat(grd_rsihdpaplist.valueMatrix(fRow, grd_rsihdpaplist.colRef("winamt")));
  182. if (grd_rsihdpaplist.valueMatrix(fRow, grd_rsihdpaplist.colRef("slipdd")) != "") {
  183. grd_rsihdpaplist.isReadOnly(fRow, grd_rsihdpaplist.fixedCols-1, fRow, grd_rsihdpaplist.cols-1) = true;
  184. } else {
  185. if (grd_rsihdpaplist.valueMatrix(fRow, grd_rsihdpaplist.colRef("chkyn")) == "Y") {
  186. vWinQtySel += parseFloat(grd_rsihdpaplist.valueMatrix(fRow, grd_rsihdpaplist.colRef("winqty")));
  187. vWinAmtSel += parseFloat(grd_rsihdpaplist.valueMatrix(fRow, grd_rsihdpaplist.colRef("winamt")));
  188. }
  189. grd_rsihdpaplist.isReadOnly(fRow, grd_rsihdpaplist.fixedCols-1, fRow, grd_rsihdpaplist.cols-1) = false;
  190. }
  191. }
  192. //
  193. model.setValue(eval("opt_"+gGridNm[gTabIdx1]+"_qty").attribute("ref"),vWinQty );
  194. model.setValue(eval("opt_"+gGridNm[gTabIdx1]+"_amt").attribute("ref"),vWinAmt );
  195. } else {
  196. // 결재 내역 상세 List
  197. fDataSum(eval("grd_"+gGridNm[gTabIdx1]));
  198. }
  199. model.refresh();
  200. }
  201. // --------------------------------------------------------------
  202. // 조회후 값 SUM처리한다
  203. // --------------------------------------------------------------
  204. function fDataSum(pGrid)
  205. {
  206. vWinQty = 0;
  207. vWinAmt = 0;
  208. // 결재 내역 List
  209. for (var fRow = pGrid.fixedRows ; fRow < pGrid.rows ; fRow++) {
  210. vWinQty += parseFloat(pGrid.valueMatrix(fRow, pGrid.colRef("winqty")));
  211. vWinAmt += parseFloat(pGrid.valueMatrix(fRow, pGrid.colRef("winamt")));
  212. }
  213. }
  214. // --------------------------------------------------
  215. // 화면 Control을 초기화한다
  216. // --------------------------------------------------
  217. function fClearData() {
  218. misfGridInit(eval("grd_"+gGridNm[gTabIdx1]+"_tree"));
  219. misfGridInit(eval("grd_"+gGridNm[gTabIdx1]));
  220. // model.setValue(opt_winqtysum.attribute("ref" ),"");
  221. // model.setValue(opt_winamtsum.attribute("ref" ),"");
  222. model.setValue(eval("opt_"+gGridNm[gTabIdx1]+"_qty").attribute("ref"),"");
  223. model.setValue(eval("opt_"+gGridNm[gTabIdx1]+"_amt").attribute("ref"),"");
  224. model.refresh();
  225. return;
  226. }
  227. // --------------------------------------------------------------
  228. // 조회후 값 SUM처리한다
  229. // pGrid : 선택그리드, pFlag : Y:선택, N :취소
  230. // --------------------------------------------------------------
  231. function fDataChkAllSelect(pFlag) {
  232. vWinQtySel = 0;
  233. vWinAmtSel = 0;
  234. var pGrid = eval("grd_"+gGridNm[gTabIdx1])
  235. // 결재 내역 List
  236. for (var fRow = pGrid.fixedRows ; fRow < pGrid.rows ; fRow++) {
  237. fDataCheckSelect(pGrid, fRow, pFlag);
  238. }
  239. pGrid.refresh();
  240. }
  241. function fDataCheckSelect(pGrid, pRow, pFlag) {
  242. vCheck = 0;
  243. if ((model.getValue(pGrid.nodeset+"["+pRow+"]/calccnfmyn") == "Y") &&
  244. (model.getValue(pGrid.nodeset+"["+pRow+"]/winprcsflag") == "9") ){
  245. vCheck = 1;
  246. }
  247. ChkFlag = model.getValue(pGrid.nodeset+"["+pRow+"]/oldcalccnfmyn");
  248. if (ChkFlag == "") ChkFlag = "N";
  249. if (ChkFlag == pFlag){
  250. vCheck = 1;
  251. }
  252. if (vCheck == 0) {
  253. pGrid.rowStatus(pRow) = "2";
  254. model.setValue(pGrid.nodeset + "[" + pRow + "]/calccnfmyn", pFlag);
  255. } else {
  256. pGrid.removeStatus(pRow, "update");
  257. model.setValue(pGrid.nodeset + "[" + pRow + "]/calccnfmyn", ChkFlag);
  258. }
  259. // pGrid.refresh();
  260. }
  261. // --------------------------------------------------------------
  262. // 조회후 값 SUM처리한다
  263. // --------------------------------------------------------------
  264. function fDataAllSelect(pFlag) {
  265. vWinQtySel = 0;
  266. vWinAmtSel = 0;
  267. // 결재 내역 List
  268. for (var fRow = grd_rsihdpaplist.fixedRows ; fRow < grd_rsihdpaplist.rows ; fRow++) {
  269. if (grd_rsihdpaplist.valueMatrix(fRow, grd_rsihdpaplist.colRef("slipdd")) == "") {
  270. if (pFlag == "Y") {
  271. vWinQtySel += parseFloat(grd_rsihdpaplist.valueMatrix(fRow, grd_rsihdpaplist.colRef("winqty")));
  272. vWinAmtSel += parseFloat(grd_rsihdpaplist.valueMatrix(fRow, grd_rsihdpaplist.colRef("winamt")));
  273. if (model.getValue(grd_rsihdpaplist.nodeset+ "[" + fRow + "]/chkyn") !="Y") {
  274. model.setValue(grd_rsihdpaplist.nodeset+ "[" + fRow + "]/chkyn" ,pFlag);
  275. model.setValue(grd_rsihdpaplist.nodeset+ "[" + fRow + "]/chkpsn" ,getUserInfo("userid"));
  276. model.setValue(grd_rsihdpaplist.nodeset+ "[" + fRow + "]/chkpsnnm",getUserInfo("usernm"));
  277. model.setValue(grd_rsihdpaplist.nodeset+ "[" + fRow + "]/chkdd" ,getCurrentDate() );
  278. }
  279. } else {
  280. model.setValue(grd_rsihdpaplist.nodeset+ "[" + fRow + "]/chkpsn" , '');
  281. model.setValue(grd_rsihdpaplist.nodeset+ "[" + fRow + "]/chkpsnnm", '');
  282. model.setValue(grd_rsihdpaplist.nodeset+ "[" + fRow + "]/chkdd" , '');
  283. }
  284. }
  285. }
  286. //
  287. model.refresh();
  288. }
  289. // --------------------------------------------------------------
  290. // 조회후 값 SUM처리한다
  291. // --------------------------------------------------------------
  292. function fDataSelectSum(pGrid)
  293. {
  294. vWinQtySel = 0;
  295. vWinAmtSel = 0;
  296. // 결재 내역 List
  297. for (var fRow = pGrid.fixedRows ; fRow < pGrid.rows ; fRow++) {
  298. if (pGrid.valueMatrix(fRow, pGrid.colRef("slipdd")) == "" ) {
  299. if (pGrid.valueMatrix(fRow, pGrid.colRef("chkyn" )) == "Y") {
  300. vWinQtySel += parseFloat(pGrid.valueMatrix(fRow, pGrid.colRef("winqty")));
  301. vWinAmtSel += parseFloat(pGrid.valueMatrix(fRow, pGrid.colRef("winamt")));
  302. }
  303. }
  304. }
  305. model.setValue(opt_winqtysel.attribute("ref") ,vWinQtySel);
  306. model.setValue(opt_winamtsel.attribute("ref") ,vWinAmtSel);
  307. model.refresh();
  308. }
  309. // --------------------------------------------------------------
  310. // 조회후 값 SUM처리한다
  311. // --------------------------------------------------------------
  312. function fOnRowChanged(pGrid)
  313. {
  314. sPath ="/root/send/";
  315. tPath ="/root/send/windtl/";
  316. model.setValue(tPath + "instcd" , model.getValue(sPath + "instcd" )); // 기관코드
  317. model.setValue(tPath + "fromdd" , model.getValue(sPath + "fromdd" )); // 입고일자 FROM
  318. model.setValue(tPath + "todd" , model.getValue(sPath + "todd" )); // 입고일자 TO
  319. model.setValue(tPath + "chkyn" , model.getValue(sPath + "chkyn" )); // 검수유무
  320. model.setValue(tPath + "winpsn" , model.getValue(sPath + "winpsn" )); // 입고자
  321. model.setValue(tPath + "suppcustcd", model.getValue(sPath + "suppcustcd")); // 보조거래처
  322. model.setValue(tPath + "purcflag" , model.getValue(sPath + "purcflag" )); // 구매구분
  323. model.setValue(tPath + "paycond" , model.getValue(sPath + "paycond" )); // 1:정상, 2:지불필
  324. model.setValue(tPath + "windd" , "" ); // 입고일자
  325. model.setValue(tPath + "calcdocudd", "" ); // 계산서일자
  326. model.setValue(tPath +"goodflag" , pGrid.valueMatrix(pGrid.row, pGrid.colRef("goodflag" ))); // 물품구분
  327. model.setValue(tPath +"suplplcecd" , pGrid.valueMatrix(pGrid.row, pGrid.colRef("suplplcecd" ))); // 주거래처
  328. model.setValue(tPath +"purcflag" , pGrid.valueMatrix(pGrid.row, pGrid.colRef("purcflag" ))); // 구매구분
  329. model.setValue(tPath +"calcdocukind", pGrid.valueMatrix(pGrid.row, pGrid.colRef("calcdocukind"))); // 계산서구분
  330. model.setValue(tPath +"slipdd" , pGrid.valueMatrix(pGrid.row, pGrid.colRef("slipdd"))); // 전표일자
  331. model.setValue(tPath +"slipno" , pGrid.valueMatrix(pGrid.row, pGrid.colRef("slipno"))); // 전표번호
  332. model.setValue(tPath +"winpsn" , pGrid.valueMatrix(pGrid.row, pGrid.colRef("winpsn"))); // 입고자
  333. submit("TRRSI02706");
  334. fAfterRetrieve("2");
  335. model.refresh();
  336. }
  337. // --------------------------------------------------
  338. // Tree Click
  339. // --------------------------------------------------
  340. function fTreeGridClick() {
  341. var OpCode = "";
  342. var OpDepth = "";
  343. var pGrid = eval("grd_"+gGridNm[gTabIdx1]+"_tree")
  344. var Idx = pGrid.row;
  345. var TreePath = pGrid.nodeset;
  346. if (Idx == 0) return;
  347. if (gIndex == Idx) {
  348. return;
  349. } else {
  350. gIndex = Idx;
  351. }
  352. var vDepth = ""; // 1 LEVEL
  353. var vPcode = ""; // 2 코드+상위코드
  354. var vCodecd = ""; // 3 코드
  355. var vCodenm = ""; // 4 코드명
  356. var vBasecd = ""; // 5 결합코드
  357. var vWincnt = ""; // 6 입고건수
  358. var vWinqty = ""; // 7 입고수량
  359. var vWinamt = ""; // 8 입고금액
  360. var vWincnt2 = ""; // 6 입고건수
  361. var vWinqty2 = ""; // 7 입고수량
  362. var vWinamt2 = ""; // 8 입고금액
  363. var vDispnm = ""; // 9 DISPLAY 분류명
  364. var DispData = ""; //
  365. var vGoodflag = ""; // 02 물품구분
  366. var vSuplplcecd = ""; // 03 주거래처
  367. var vSuppcustcd = ""; // 04 보조거래처
  368. vDepth = model.getValue(TreePath +"["+Idx+"]/depth" ); // 01 LEVEL
  369. vPcode = model.getValue(TreePath +"["+Idx+"]/pcode" ); // 02 코드+상위코드
  370. vCodecd = model.getValue(TreePath +"["+Idx+"]/codecd" ); // 03 코드
  371. vEcodecd = model.getValue(TreePath +"["+Idx+"]/ecodecd"); // 04 EDIT 코드
  372. vCodenm = model.getValue(TreePath +"["+Idx+"]/codenm" ); // 05 코드명
  373. vBasecd = model.getValue(TreePath +"["+Idx+"]/basecd" ); // 06 결합코드
  374. vWincnt = model.getValue(TreePath +"["+Idx+"]/wincnt" ); // 07 입고건수
  375. vWinqty = model.getValue(TreePath +"["+Idx+"]/winqty" ); // 08 입고수량
  376. vWinamt = model.getValue(TreePath +"["+Idx+"]/winamt" ); // 09 입고금액
  377. vWincnt2 = model.getValue(TreePath +"["+Idx+"]/wincnt2"); // 07 입고건수
  378. vWinqty2 = model.getValue(TreePath +"["+Idx+"]/winqty2"); // 08 입고수량
  379. vWinamt2 = model.getValue(TreePath +"["+Idx+"]/winamt2"); // 09 입고금액
  380. vDispnm = model.getValue(TreePath +"["+Idx+"]/dispnm" ); // 10 DISPLAY 분류명
  381. DispData = vEcodecd + " : " + vCodenm; //
  382. vGoodflag = vPcode.substr( 2, 2); // 02 물품구분
  383. vSuplplcecd = vPcode.substr( 4, 10); // 03 주거래처
  384. vSuppcustcd = vPcode.substr(14, 10); // 04 보조거래처
  385. model.setValue(eval("opt_"+gGridNm[gTabIdx1]+"_qty").attribute("ref"), vWinqty);
  386. model.setValue(eval("opt_"+gGridNm[gTabIdx1]+"_amt").attribute("ref"), vWinamt);
  387. // if (parseFloat(vWincnt) > 500) {
  388. // alert("조회량이 500건을 초과하여 시간이 지연됩니다. 하위레벨에서 조회 바랍니다!!");
  389. // misfGridInit(eval("grd_"+gGridNm[gTabIdx1]));
  390. // model.refresh();
  391. // return;
  392. // }
  393. sPath ="/root/send/";
  394. tPath ="/root/send/windtl/";
  395. model.setValue(tPath + "instcd" , model.getValue(sPath + "instcd" )); // 기관코드
  396. model.setValue(tPath + "fromdd" , model.getValue(sPath + "fromdd" )); // 입고일자 FROM
  397. model.setValue(tPath + "todd" , model.getValue(sPath + "todd" )); // 입고일자 TO
  398. model.setValue(tPath + "chkyn" , model.getValue(sPath + "chkyn" )); // 검수유무
  399. model.setValue(tPath + "winpsn" , model.getValue(sPath + "winpsn" )); // 입고자
  400. model.setValue(tPath + "suplplcecd" , model.getValue(sPath + "suplplcecd" )); // 주거래처
  401. model.setValue(tPath + "suppcustcd" , model.getValue(sPath + "suppcustcd" )); // 보조거래처
  402. model.setValue(tPath + "purcflag" , model.getValue(sPath + "purcflag" )); // 구매구분
  403. model.setValue(tPath + "paycond" , model.getValue(sPath + "paycond" )); // 1:정상, 2:지불필
  404. model.setValue(tPath + "searchflag" , model.getValue(sPath + "searchflag" )); // 조회구분
  405. model.setValue(tPath + "frcalcdocudd" , model.getValue(sPath + "frcalcdocudd")); // 계산서일자 FR
  406. model.setValue(tPath + "tocalcdocudd" , model.getValue(sPath + "tocalcdocudd")); // 계산서일자 TO
  407. model.setValue(tPath + "groupbugt" , model.getValue(sPath + "groupbugt" )); // 예산계정코드
  408. model.setValue(tPath + "calccnfmyn" , model.getValue(sPath + "calccnfmyn" )); // 정산확정여부
  409. model.setValue(tPath + "winprcsflag" , model.getValue(sPath + "winprcsflag" )); // 8:미처리, 9:처리
  410. // model.setValue(tPath + "calccnfmdd" , model.getValue(sPath + "calccnfmdd" )); // 정산일자
  411. model.setValue(tPath + "frcalccnfmdd" , model.getValue(sPath + "frcalccnfmdd")); // 정산확정일자 FR
  412. model.setValue(tPath + "tocalccnfmdd" , model.getValue(sPath + "tocalccnfmdd")); // 정산확정일자 TO
  413. model.setValue(tPath + "qtyflag" , model.getValue(sPath + "qtyflag" )); // 입고출고다른내역
  414. model.setValue(tPath + "goodflag" , vGoodflag ); // 물품구분
  415. model.setValue(tPath + "suplplcecd" , vSuplplcecd ); // 주거래처
  416. model.setValue(tPath + "suppcustcd" , vSuppcustcd ); // 보조거래처
  417. var pGridDetail = eval("grd_"+gGridNm[gTabIdx1])
  418. misfGridInit(pGridDetail);
  419. if (gTabIdx1 == "0") {
  420. misfGridInit(grd_gooddelivelist);
  421. submit("TRRSI02706");
  422. // if (grd_rsihinptlist.rows > 1) {
  423. //
  424. // grd_rsihinptlist.row = 1;
  425. // fRsihinptGridRowChanged(grd_rsihinptlist);
  426. // }
  427. }
  428. if (gTabIdx1 == "2") {
  429. submit("TRRSI02712");
  430. }
  431. if (gTabIdx1 == "3") {
  432. submit("TRRSI02713");
  433. }
  434. fViewOptionToggleX(pGridDetail);
  435. fViewOptionToggle();
  436. pGridDetail.refresh();
  437. model.refresh();
  438. }
  439. /**
  440. * @group :
  441. * @ver : 2009.04.23
  442. * @by : 최학록
  443. * @---------------------------------------------------
  444. * @type : function
  445. * @access : public
  446. * @desc : 그리드를 트리구조로 만들어준다.
  447. * @param :
  448. * @return :
  449. * @---------------------------------------------------
  450. */
  451. function fCopy2DetailData(pIdx, pGrid){
  452. // model.removeNodeset(pGrid.nodeset);
  453. misfGridInit(pGrid);
  454. model.copyNode( "/root/init/"+gPathNm[pIdx], "/root/main/"+ gPathNm[pIdx]);
  455. model.removeNodeset("/root/main/"+ gPathNm[pIdx]);
  456. fViewOptionToggleX(pGrid);
  457. }
  458. // --------------------------------------------------
  459. // Data Part Toggle 속성Toggle 처리하는 함수
  460. // --------------------------------------------------
  461. function fDataPartToggle(pCls) {
  462. var pGrpDetail = eval("grp_"+gGridNm[gTabIdx1])
  463. var pGrdDetail = eval("grd_"+gGridNm[gTabIdx1])
  464. switch(pCls) {
  465. case 0 :
  466. // 메인 Grup
  467. pGrpDetail.attribute("left" ) = "457";
  468. pGrpDetail.attribute("width" ) = "731";
  469. pGrdDetail.attribute("width" ) = "731";
  470. break;
  471. case 1 :
  472. pGrpDetail.attribute("left" ) = "0";
  473. pGrpDetail.attribute("width" ) = "1188";
  474. pGrdDetail.attribute("width" ) = "1188";
  475. }
  476. pGrpDetail.refresh();
  477. }
  478. // --------------------------------------------------
  479. // View Option 처리하는 함수
  480. // --------------------------------------------------
  481. function fViewOptionToggleX(pGrid) {
  482. var iQty = 0;
  483. var oQty = 0;
  484. for (var fRow = 1; fRow < pGrid.rows ; fRow++) {
  485. if (gTabIdx1 == "0") {
  486. iQty = parseFloat(model.getValue(pGrid.nodeset+"["+ fRow +"]/winqty" ));
  487. oQty = parseFloat(model.getValue(pGrid.nodeset+"["+ fRow +"]/delivedeptqty" ));
  488. if (iQty != oQty ) {
  489. pGrid.cellstyle("background-color", fRow, pGrid.colRef("winqty"), fRow, pGrid.colRef("delivedeptqty")) = "yellow";
  490. pGrid.cellstyle("color" , fRow, pGrid.colRef("winqty"), fRow, pGrid.colRef("delivedeptqty")) = "red";
  491. } else {
  492. pGrid.cellstyle("background-color", fRow, pGrid.colRef("winqty"), fRow, pGrid.colRef("delivedeptqty")) = "white";
  493. pGrid.cellstyle("color" , fRow, pGrid.colRef("winqty"), fRow, pGrid.colRef("delivedeptqty")) = "black";
  494. }
  495. }
  496. if (model.getValue(pGrid.nodeset+"["+fRow+"]/winprcsflag")=="9") {
  497. pGrid.isReadOnly(fRow, pGrid.colRef("calccnfmyn"), fRow, pGrid.colRef("calccnfmyn")) = true;
  498. } else {
  499. pGrid.isReadOnly(fRow, pGrid.colRef("calccnfmyn"), fRow, pGrid.colRef("calccnfmyn")) = false;
  500. }
  501. //
  502. //if (model.getValue(pGrid.nodeset+"["+fRow+"]/calccnfmdd")=="0") {
  503. // model.setValue(pGrid.nodeset+"["+fRow+"]/calccnfmdd", "");
  504. //}
  505. }
  506. pGrid.refresh();
  507. }
  508. // --------------------------------------------------
  509. // View Option 처리하는 함수
  510. // --------------------------------------------------
  511. function fViewOptionToggle() {
  512. var vColName = "";
  513. var sNode = null;
  514. var oPath = "/root/init/Options/option_"+ gTabIdx1 +"/";
  515. var vOpTail = "_op_"+gTabIdx1;
  516. var pGrid = eval("grd_"+gGridNm[gTabIdx1])
  517. for (var fCol = 1; fCol < pGrid.cols ; fCol++) {
  518. vColName = pGrid.colAttribute(fCol,"ref");
  519. var sNode = instance1.selectSingleNode(oPath + vColName);
  520. if (sNode != null) {
  521. pGrid.colHidden(pGrid.colRef(vColName)) = (eval("chk_"+vColName + vOpTail).value =="Y") ? false : true;
  522. }
  523. }
  524. pGrid.refresh();
  525. grp_view.visible = false;
  526. grp_main.disabled = false; // addGroup 컨트롤이 나타나면 listGroup 컨트롤을 disabled 시킴
  527. }
  528. // --------------------------------------------------
  529. // Grid On Click 처리하는 함수
  530. // --------------------------------------------------
  531. function fGridConClick() {
  532. var vGrid = eval("grd_"+gGridNm[gTabIdx1])
  533. if ((vGrid.row == 0 ) ||
  534. (vGrid.col != vGrid.colRef("calccnfmyn"))) return;
  535. ChkFlag = model.getValue(vGrid.nodeset + "[" + vGrid.row + "]/calccnfmyn");
  536. fDataCheckSelect(vGrid, vGrid.row, ChkFlag);
  537. vGrid.refresh();
  538. }
  539. //-----------------------------------
  540. // 입고 검수 확인 저장
  541. //-----------------------------------
  542. function fCheckPersonSave(){
  543. var vCnt = 0 ;
  544. var pGrid = eval("grd_"+gGridNm[gTabIdx1])
  545. var sPath = pGrid.nodeset;
  546. var tPath = "/root/send/winchecklists";
  547. var tPath2 = "/root/send/winchecklists/winchecklist";
  548. var vCalcCnfmDd = "";
  549. var WincheckData = ""; // Send Data
  550. var WincheckHead = "instcd" + "▦" // 01 기관코드
  551. + "goodflag" + "▦" // 02 물품구분
  552. + "windd" + "▦" // 03 입고일자
  553. + "winno" + "▦" // 04 입고번호(0000)
  554. + "winseqno" + "▦" // 05 입고일련번호(000~999)
  555. + "windeptcd" + "▦" // 06 입고부서코드
  556. + "checkflag" + "▦" // 07 검수확인 UPDATE 여부
  557. + "chkyn" + "▦" // 08 검수확인여부
  558. + "chkpsn" + "▦" // 09 검수확인자
  559. + "chkdd" + "▦" // 10 검수확인년월
  560. + "calccnfmflag" + "▦" // 11 정산확정UPDATE 여부
  561. + "calccnfmpsn" + "▦" // 12 정산확정자
  562. + "calccnfmyn" + "▦" // 13 정산확정여부
  563. + "calccnfmdd" + "▦" // 14 정산확정년월
  564. + "winprcsflag" + "▦" // 15 정산상태 0:미결재,8:회계처리대상,9:회계처리완료
  565. + "slipflag" + "▦" // 16 전표UPDATE 여부
  566. + "slipdd" + "▦" // 17 전표일자
  567. + "slipno" + "▦" // 18 전표번호
  568. + "tableflag" + "▦" // 19 검수테이블구분
  569. + "oldendmonth" + "▩"; // 20 마감년월
  570. for (var fRow = pGrid.fixedRows; fRow < pGrid.rows ; fRow++ ) {
  571. if (pGrid.rowStatus(fRow) == 2) {
  572. if (gTabIdx1 == "0") { // 의료소모,비품,일반소모 입고내역
  573. iQty = parseFloat(model.getValue(sPath + "[" + fRow + "]/winqty" ));
  574. oQty = parseFloat(model.getValue(sPath + "[" + fRow + "]/delivedeptqty" ));
  575. if (iQty != oQty ) {
  576. alert(fRow+" 번째 입고수량:=>"+iQty+ "<== 과 츨고수량:=>"+oQty+"<== 이 같지 않습니다. 출고내역을 수정하십시요!!. ");
  577. return;
  578. }
  579. }
  580. WincheckData += model.getValue(sPath + "[" + fRow + "]/instcd" ) + "▦" // 01 기관코드
  581. if (gTabIdx1 == "3") {
  582. WincheckData += model.getValue(sPath + "[" + fRow + "]/fixtrseqmtflag" ) + "▦" // 02 물품구분
  583. WincheckData += model.getValue(sPath + "[" + fRow + "]/reqdd" ) + "▦" // 03 입고일자
  584. WincheckData += model.getValue(sPath + "[" + fRow + "]/reqno" ) + "▦" // 04 입고번호(0000)
  585. WincheckData += "" + "▦" // 05 입고일련번호(000~999)
  586. WincheckData += "" + "▦" // 06 입고부서코드
  587. } else {
  588. WincheckData += model.getValue(sPath + "[" + fRow + "]/goodflag" ) + "▦" // 02 물품구분
  589. WincheckData += model.getValue(sPath + "[" + fRow + "]/windd" ) + "▦" // 03 입고일자
  590. WincheckData += model.getValue(sPath + "[" + fRow + "]/winno" ) + "▦" // 04 입고번호(0000)
  591. WincheckData += model.getValue(sPath + "[" + fRow + "]/winseqno" ) + "▦" // 05 입고일련번호(000~999)
  592. if (gTabIdx1 == "2") {
  593. WincheckData += "" + "▦" // 06 입고부서코드
  594. } else {
  595. WincheckData += model.getValue(sPath + "[" + fRow + "]/windeptcd") + "▦" // 06 입고부서코드
  596. }
  597. }
  598. WincheckData += "" + "▦" // 07 검수확인 UPDATE 여부
  599. WincheckData += "" + "▦" // 08 검수확인여부
  600. WincheckData += "" + "▦" // 09 검수확인자
  601. WincheckData += "" + "▦" // 10 검수확인년월
  602. WincheckData += "Y" + "▦" // 11 정산확정UPDATE 여부
  603. if (model.getValue(sPath + "[" + fRow + "]/calccnfmyn")=="Y") {
  604. WincheckData += getUserInfo("userid") + "▦" // 12 정산확정자
  605. WincheckData += model.getValue(sPath + "[" + fRow + "]/calccnfmyn") + "▦" // 13 정산확정여부
  606. WincheckData += model.getValue(ipt_insertdd.attribute("ref")) + "▦" // 14 정산확정년일자
  607. WincheckData += "8" + "▦" // 15 정산상태 0:미결재,8:회계처리대상,9:회계처리완료
  608. } else {
  609. WincheckData += "" + "▦" // 12 정산확정자
  610. WincheckData += "" + "▦" // 13 정산확정여부
  611. WincheckData += "" + "▦" // 14 정산확정년일자
  612. WincheckData += "" + "▦" // 15 정산상태 0:미결재,8:회계처리대상,9:회계처리완료
  613. }
  614. if (model.getValue(sPath + "[" + fRow + "]/calccnfmdd") =="" ||
  615. model.getValue(sPath + "[" + fRow + "]/calccnfmdd") =="0" ) {
  616. vCalcCnfmDd = "999999";
  617. } else {
  618. vCalcCnfmDd = model.getValue(sPath + "[" + fRow + "]/calccnfmdd").substr(0,6);
  619. }
  620. WincheckData += "N" + "▦" // 16 전표UPDATE 여부
  621. WincheckData += "" + "▦" // 17 전표일자
  622. WincheckData += "" + "▦" // 18 전표번호
  623. WincheckData += gTabIdx1 + "▦" // 19 검수테이블구분
  624. WincheckData += vCalcCnfmDd + "▩"; // 20 마감년월
  625. vCnt++;
  626. }
  627. }
  628. //
  629. if (vCnt > 0) {
  630. model.removenode(tPath);
  631. model.makeValue(tPath2, WincheckHead+WincheckData);
  632. submit("TXRSI02710");
  633. }
  634. ipt_insertdd.value = "";
  635. }
  636. //-----------------------------------
  637. // 입고 검수 확인 일괄 저장
  638. //-----------------------------------
  639. function fCheckBatchProcess(){
  640. if (model.getValue(ipt_batch_instcd.attribute("ref")) == "" ) {
  641. alert("기관을 선택하십시요!!");
  642. return;
  643. }
  644. if (model.getValue(ipt_batch_calccnfmdd.attribute("ref")) == "" ) {
  645. alert("확정일자를 선택하십시요!!");
  646. return;
  647. }
  648. if (model.getValue(ipt_batch_frwindd.attribute("ref")) == "" ) {
  649. alert("시작입고일자를 선택하십시요!!");
  650. return;
  651. }
  652. if (model.getValue(ipt_batch_towindd.attribute("ref")) == "" ) {
  653. alert("끝 입고일자를 선택하십시요!!");
  654. return;
  655. }
  656. if (model.getValue(ipt_batch_frwindd.attribute("ref")) >
  657. model.getValue(ipt_batch_towindd.attribute("ref")) ) {
  658. alert("입고일자 끝일자가 시작일자보다 큽니다. 확인하십시요!!");
  659. return;
  660. }
  661. if (model.getValue(ipt_batch_frcalcdocudd.attribute("ref")) == "" ) {
  662. alert("시작 계산서일자를 선택하십시요!!");
  663. return;
  664. }
  665. if (model.getValue(ipt_batch_tocalcdocudd.attribute("ref")) == "" ) {
  666. alert("끝 계산서일자를 선택하십시요!!");
  667. return;
  668. }
  669. if (model.getValue(ipt_batch_frcalcdocudd.attribute("ref")) >
  670. model.getValue(ipt_batch_tocalcdocudd.attribute("ref")) ) {
  671. alert("계산서일자 끝일자가 시작일자보다 큽니다. 확인하십시요!!");
  672. return;
  673. }
  674. var ChekFlag = 0
  675. ChekFlag += (model.getValue(chk_rsihinpt.attribute("ref")) == "" ) ? 0 : 1;
  676. ChekFlag += (model.getValue(chk_rfchinpf.attribute("ref")) == "" ) ? 0 : 1;
  677. ChekFlag += (model.getValue(chk_rfehemht.attribute("ref")) == "" ) ? 0 : 1;
  678. if (ChekFlag == 0 ) {
  679. alert("입고구분을 선택하십시요!!");
  680. return;
  681. }
  682. submit("TXRSI02711");
  683. if (model.getValue(gvErrorMsgPath + "/type") == "error") {
  684. alert("작업처리 중 오류 운영팀에 문의 要 !!!");
  685. } else {
  686. alert("작업처리 완료 !!");
  687. grp_batchconf.visible = false;
  688. }
  689. }
  690. // --------------------------------------------------
  691. // 보기 Option 선택
  692. // --------------------------------------------------
  693. function fViewOptionClick() {
  694. switch(gTabIdx1) {
  695. case "0" :
  696. grp_rsihinptlist_op.visible = true;
  697. grp_rfchinpflist_op.visible = false;
  698. grp_rfehemhtlist_op.visible = false;
  699. break;
  700. case "2" :
  701. grp_rsihinptlist_op.visible = false;
  702. grp_rfchinpflist_op.visible = true;
  703. grp_rfehemhtlist_op.visible = false;
  704. break;
  705. case "3" :
  706. grp_rsihinptlist_op.visible = false;
  707. grp_rfchinpflist_op.visible = false;
  708. grp_rfehemhtlist_op.visible = true;
  709. }
  710. grp_view.visible = true;
  711. grp_main.disabled = true; // addGroup 컨트롤이 나타나면 listGroup 컨트롤을 disabled 시킴
  712. grp_view.refresh();
  713. }
  714. // --------------------------------------------------
  715. // Grid Excel 저장
  716. // --------------------------------------------------
  717. function fExcelDataSave() {
  718. switch(gTabIdx1) {
  719. case "0" :
  720. misfSaveExcel(grd_rsihinptlist);
  721. break;
  722. case "2" :
  723. misfSaveExcel(grd_rfchinpflist);
  724. break;
  725. case "3" :
  726. misfSaveExcel(grd_rfehemhtlist);
  727. }
  728. }
  729. // --------------------------------------------------
  730. // 입고내역 Grid Click 저장
  731. // --------------------------------------------------
  732. function fRsihinptGridRowChanged(pGrid)
  733. {
  734. misfGridInit(grd_gooddelivelist);
  735. if (pGrid.row == 0) return;
  736. var pRow = pGrid.row;
  737. var xPath = "/root/send/gooddelive";
  738. model.setValue(xPath + "/goodcd" , model.getValue(pGrid.nodeset+"["+pRow +"]/goodcd" ));
  739. model.setValue(xPath + "/goodflag" , model.getValue(pGrid.nodeset+"["+pRow +"]/goodflag" ));
  740. model.setValue(xPath + "/winseqno" , model.getValue(pGrid.nodeset+"["+pRow +"]/winseqno" ));
  741. model.setValue(xPath + "/winno" , model.getValue(pGrid.nodeset+"["+pRow +"]/winno" ));
  742. model.setValue(xPath + "/windd" , model.getValue(pGrid.nodeset+"["+pRow +"]/windd" ));
  743. model.setValue(xPath + "/windeptcd", model.getValue(pGrid.nodeset+"["+pRow +"]/windeptcd"));
  744. model.setValue(xPath + "/instcd" , model.getValue(pGrid.nodeset+"["+pRow +"]/instcd" ));
  745. submit("TRRSI02714");
  746. for ( var i = grd_gooddelivelist.fixedRows ; i< grd_gooddelivelist.rows ; i++ )
  747. {
  748. if (grd_gooddelivelist.valueMatrix(grd_gooddelivelist.fixedRows, grd_gooddelivelist.colRef("deliveno")) == "")
  749. {
  750. grd_gooddelivelist.cellStyle("background-image", grd_gooddelivelist.fixedRows , grd_gooddelivelist.colRef("delivedeptnm")) = "";
  751. grd_gooddelivelist.cellStyle("background-color", grd_gooddelivelist.fixedRows , grd_gooddelivelist.colRef("delivedeptnm")) = "red";
  752. }else{
  753. grd_gooddelivelist.cellStyle("background-image", grd_gooddelivelist.fixedRows , grd_gooddelivelist.colRef("delivedeptnm")) = "";
  754. grd_gooddelivelist.cellStyle("background-color", grd_gooddelivelist.fixedRows , grd_gooddelivelist.colRef("delivedeptnm")) = "white";
  755. }
  756. }
  757. model.setValue(chk_allchoiyn.attribute("ref"), "");
  758. model.refresh();
  759. //grd_gooddelivelist.refresh();
  760. }
  761. // --------------------------------------------------
  762. // 출고내역 Grid Changed
  763. // --------------------------------------------------
  764. function fGoodDeliveListChanged()
  765. {
  766. var restqty;
  767. var deliveamt;
  768. var reqqty = parseFloat(model.getValue(grd_gooddelivelist.nodeset+"[" + grd_gooddelivelist.row + "]/reqqty" ));
  769. var delivedeptqty = parseFloat(model.getValue(grd_gooddelivelist.nodeset+"[" + grd_gooddelivelist.row + "]/delivedeptqty"));
  770. if (delivedeptqty > reqqty){
  771. var retMes = messageBox("출고수량이 청구수량 보다 큽니다. 작업하시겠습니까?", "Q999");
  772. if (retMes != 6) {
  773. model.setValue(grd_gooddelivelist.nodeset+"[" + grd_gooddelivelist.row + "]/delivedeptqty", "0");
  774. // return;
  775. }
  776. // messageBox("출고 수량이 청구 수량을 ","E003");
  777. // model.setValue(grd_gooddelivelist.nodeset+"[" + grd_gooddelivelist.row + "]/delivedeptqty", "0");
  778. }
  779. restqty = parseFloat(model.getValue(grd_gooddelivelist.nodeset+"[" + grd_gooddelivelist.row + "]/reqqty" ))
  780. - parseFloat(model.getValue(grd_gooddelivelist.nodeset+"[" + grd_gooddelivelist.row + "]/delivedeptqty"));
  781. model.setValue(grd_gooddelivelist.nodeset+"[" + grd_gooddelivelist.row + "]/restqty", restqty);
  782. deliveamt = parseFloat(model.getValue(grd_gooddelivelist.nodeset+"[" + grd_gooddelivelist.row + "]/delivedeptqty"))
  783. * parseFloat(model.getValue(grd_gooddelivelist.nodeset+"[" + grd_gooddelivelist.row + "]/goodunitcost" ));
  784. model.setValue(grd_gooddelivelist.nodeset+"[" + grd_gooddelivelist.row + "]/deliveamt", deliveamt);
  785. grd_gooddelivelist.refresh();
  786. }
  787. // --------------------------------------------------
  788. // 출고내역 INSERT ROW
  789. // --------------------------------------------------
  790. function fDeliveInsertRow()
  791. {
  792. var retMes = messageBox("추가 하시겠습니까?", "Q999");
  793. if (retMes != 6) {
  794. return;
  795. }
  796. //
  797. misfGridIUD(grd_gooddelivelist, "A");
  798. grd_gooddelivelist.row = grd_gooddelivelist.rows -grd_gooddelivelist.fixedRows ;
  799. //
  800. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/chk" , "TRUE" );
  801. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/windeptcd" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/windeptcd" ));
  802. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/oldwindeptcd" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/windeptcd" ));
  803. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/windeptnm" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/windeptnm" ));
  804. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/deliveallno" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/windd" ));
  805. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/delivedd" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/windd" ));
  806. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/deliveno" , "" );
  807. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/deliveseqno" , "" );
  808. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/reqqty" , "0" );
  809. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/delivedeptqty" , "0" );
  810. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/restqty" , "0" );
  811. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/goodunitcost" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/winunitcost" ));
  812. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/deliveamt" , "0" );
  813. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/deliveunit" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/winunit" ));
  814. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/iokindcd" , "2C" );
  815. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/iokindnm" , "정상입고동시출고" );
  816. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/goodcd" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/goodcd" ));
  817. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/allsizespecid" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/allsizespecid"));
  818. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/goodnm" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/goodnm" ));
  819. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/goodspec" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/goodspec" ));
  820. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/goodmodel" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/goodmodel" ));
  821. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/winallno" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/winputno" ));
  822. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/windd" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/windd" ));
  823. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/winno" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/winno" ));
  824. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/winseqno" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/winseqno" ));
  825. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/olddelivedeptcd", model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/windeptcd" ));
  826. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/delivedeptcd" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/windeptcd" ));
  827. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/delivedeptnm" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/windeptnm" ));
  828. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/reqflag" , "" );
  829. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/reqallno" , "" );
  830. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/reqdd" , "" );
  831. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/reqno" , "" );
  832. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/reqseqno" , "" );
  833. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/purcdmnddd" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/purcdmnddd" ));
  834. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/purcdmndno" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/purcdmndno" ));
  835. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/purcdmndseq" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/purcdmndseq" ));
  836. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/delivepsn" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/winpsn" ));
  837. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/delivepsnnm" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/winpsnnm" ));
  838. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/goodflag" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/goodflag" ));
  839. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/tranflag" , "" );
  840. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/instcd" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/instcd" ));
  841. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/reqdeptcd" , model.getValue(grd_rsihinptlist.nodeset+"["+grd_rsihinptlist.row +"]/windeptcd" ));
  842. model.setValue(grd_gooddelivelist.nodeset+"["+grd_gooddelivelist.row+"]/endmonth" , "999999" );
  843. //
  844. grd_gooddelivelist.refresh();
  845. }
  846. // --------------------------------------------------
  847. // 출고내역 UPDATE
  848. // --------------------------------------------------
  849. function fGoodDeliveUpdate()
  850. {
  851. // var retMes = messageBox("저장 하시겠습니까?", "Q999");
  852. // if (retMes != 6) {
  853. // return;
  854. // }
  855. for(var i = grd_gooddelivelist.fixedRows ; i < grd_gooddelivelist.rows ; i++ ){
  856. var chk = grd_gooddelivelist.valueMatrix(i, grd_gooddelivelist.colRef("chk"));
  857. if (grd_gooddelivelist.rowStatus(i) == 0) {
  858. if (chk == "true"){
  859. grd_gooddelivelist.rowStatus(i) = 2;
  860. }else{
  861. grd_gooddelivelist.rowStatus(i) = 0;
  862. }
  863. }
  864. }
  865. var updtdata = getGridUpdateData(grd_gooddelivelist);
  866. if (updtdata == "")
  867. {
  868. messageBox("선택된 데이터가","I004");
  869. return;
  870. }
  871. model.setValue("/root/send/gooddelivesave/gooddelivesavelist", updtdata)
  872. misfSave("TXRSI02709");
  873. var focus = grd_rsihinptlist.row;
  874. gIndex = -1;
  875. fTreeGridClick();
  876. model.setFocus("grd_rsihinptlist");
  877. grd_rsihinptlist.row = focus;
  878. //
  879. fRsihinptGridRowChanged(grd_rsihinptlist);
  880. //
  881. model.refresh();
  882. }
  883. function fItemAllChoice( vFlag ) {
  884. if (grd_gooddelivelist.rows - grd_gooddelivelist.fixedRows <= 0 ) {
  885. messageBox("선택할 데이터가","I004");
  886. model.setValue(chk_allchoiyn.attribute("ref"), "false");
  887. return false;
  888. }
  889. for( cnt = grd_gooddelivelist.fixedRows; cnt < grd_gooddelivelist.rows ; cnt++ ) {
  890. grd_gooddelivelist.valueMatrix( cnt, grd_gooddelivelist.colRef("chk")) = vFlag;
  891. if (vFlag == "true"){
  892. grd_gooddelivelist.rowStatus(cnt) = "2";
  893. }else{
  894. grd_gooddelivelist.rowStatus(cnt) = "0";
  895. }
  896. }
  897. }
  898. /* ------------------------------------------------- */
  899. /* ------End Of List ------------------------------- */
  900. /* -------------------------------------------------- */