SMRSI02720.js 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882
  1. /* ---------------------------------------------------------------------
  2. SMRSI02720_입고전자세금계산서관리.xrw (SMRSI02720.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 gTabIdx1 = "0"; //TAB INDEX
  17. var gTreeNode = "/root/main/TreeLists";
  18. var gTreeNodeset = "/root/main/TreeLists/TreeList";
  19. var gPathName = "RsihinptLists#RsihinptLists#RfchinpfLists#RfehemhtLists"
  20. var gPathNm = gPathName.split("#");
  21. var gPathDetailName = "RsihinptList#RsihinptList#RfchinpfList#RfehemhtList"
  22. var gPathDetailNm = gPathDetailName.split("#");
  23. var gGridName = "rsihinptlist#rsihinptlist2#rfchinpflist#rfehemhtlist"
  24. var gGridNm = gGridName.split("#");
  25. // --------------------------------------------------
  26. // 화면 Control을 초기화한다
  27. // --------------------------------------------------
  28. function fInit() {
  29. fInitialize();
  30. return;
  31. }
  32. // --------------------------------------------------------------
  33. // 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
  34. // --------------------------------------------------------------
  35. function fInitialize() {
  36. //misfGridInit(grd_rsihdpaplistst);
  37. //misfGridInit(grd_rsihdpaplist2);
  38. // misfGridInit(grd_rsihdpapfixlist);
  39. fInitializeGrid();
  40. // 사용자별 청구 기관 List
  41. rszfUserReqInstList(cmb_instcd,getUserInfo("userid"),"1","B");
  42. cmb_instcd.value = getUserInfo("dutplceinstcd");
  43. // 성가, 빈센트
  44. // if (cmb_instcd.value == "014" || cmb_instcd.value == "017") {
  45. // bbt_calcdd_up.visible = true;
  46. // }
  47. // 성의교정,산협은 계정을 가져온다.
  48. if (cmb_instcd.value == "103" || cmb_instcd.value == "114") {
  49. //rszfComboBgcdBugtList("cmb_groupbugt" , cmb_instcd.value, '1');
  50. rszfComboBgcdBugtList("cmb_groupbugt" , "103" , "1" );
  51. addComboItem( "cmb_groupbugt" , "전체", "", "above");
  52. cmb_groupbugt.visible = true;
  53. cap_groupbugt.visible = true;
  54. cpt_suppcustcd.visible = false; // 보조거래처
  55. ipt_suppcustcd.visible = false; // 보조거래처
  56. ipt_suppcustcdnm.visible = false; // 보조거래처
  57. bbt_suppcustcd.visible = false; // 보조거래처
  58. } else {
  59. cpt_suppcustcd.visible = true; // 보조거래처
  60. ipt_suppcustcd.visible = true; // 보조거래처
  61. ipt_suppcustcdnm.visible = true; // 보조거래처
  62. bbt_suppcustcd.visible = true; // 보조거래처
  63. cmb_groupbugt.visible = false; // 계정
  64. cap_groupbugt.visible = false; // 계정
  65. }
  66. // 사용자별 물품 구분
  67. misfComboComCdList("R0111",cmb_purcflag,"Y");
  68. var reqdate = getCurrentDate().toDate("YYYYMMDD");
  69. model.setValue(ipt_fromdd.attribute("ref"), getCurrentDate());
  70. model.setValue(ipt_todd.attribute("ref") , getCurrentDate());
  71. misfMsterDetailSet(eval("grd_"+gGridNm[gTabIdx1]) , null, "TRRSI02706", "N");
  72. model.setValue("/root/init/Options/option_0/chkyn" ,"N");
  73. model.setValue("/root/init/Options/option_0/calccnfmyn","N");
  74. model.setValue("/root/init/Options/option_2/chkyn" ,"N");
  75. model.setValue("/root/init/Options/option_2/calccnfmyn","N");
  76. model.setValue("/root/init/Options/option_3/chkyn" ,"N");
  77. model.setValue("/root/init/Options/option_3/calccnfmyn","N");
  78. //model.setValue("/root/init/Options/option_3/chkpsn","N");
  79. //model.setValue("/root/init/Options/option_3/chkpsnnm","N");
  80. //model.setValue("/root/init/Options/option_3/calccnfmpsnnm","N");
  81. model.refresh();
  82. }
  83. //
  84. function fInitializeGrid() {
  85. misfGridInit(eval("grd_"+gGridNm[0]));
  86. misfGridInit(eval("grd_"+gGridNm[0]+"_tree"));
  87. misfGridInit(eval("grd_"+gGridNm[2]));
  88. misfGridInit(eval("grd_"+gGridNm[2]+"_tree"));
  89. misfGridInit(eval("grd_"+gGridNm[3]));
  90. misfGridInit(eval("grd_"+gGridNm[3]+"_tree"));
  91. }
  92. /**
  93. * @group :
  94. * @ver : 2009.04.23
  95. * @by : 최학록
  96. * @---------------------------------------------------
  97. * @type : function
  98. * @access : public
  99. * @desc : 그리드를 트리구조로 만들어준다.
  100. * @param :
  101. * @return :
  102. * @---------------------------------------------------
  103. */
  104. function fDataSearch(){
  105. if(!isRequiredControls("cmb_instcd"))return;
  106. if(!isRequiredControls("ipt_fromdd"))return;
  107. if(!isRequiredControls("ipt_todd" ))return;
  108. model.removeNodeset(gTreeNodeset);
  109. submit("TRRSI02705");
  110. fMakeTreeView(gTabIdx1, eval("grd_"+gGridNm[gTabIdx1]+"_tree"))
  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 sRowCnt = pGrid.rows-pGrid.fixedRows;
  133. var depth;
  134. for(var i=1; i<= sRowCnt; i++){
  135. model.setValue(pGrid.nodeset+"["+i+"]/treenm", model.getValue(pGrid.nodeset+"["+i+"]/codecd") +" : " +
  136. model.getValue(pGrid.nodeset+"["+i+"]/codenm") );
  137. depth = model.getValue(pGrid.nodeset+"["+i+"]/depth");
  138. pGrid.outlinelevel(i) = depth;//depth별로 레벨을 지정한다.
  139. // eval("grd_"+gGridNm[gTabIdx1]+"_tree").rowhidden(i) = (depth > 3) ? true : false;
  140. // eval("grd_"+gGridNm[gTabIdx1]+"_tree").colDisabled(11) = true ;//시작일자 컬럼을 Non-Edit처리한다.
  141. }
  142. pGrid.OutlineCol = 1; //트리구조로 보여줄 col인덱스설정
  143. pGrid.OutlineBar = 4; //트리의 스타일 설정
  144. pGrid.TreeColor = "gray"; //트리색 설정 blue red yellow skyblue black gray
  145. model.removeNodeset(gTreeNodeset);
  146. pGrid.refresh();
  147. }
  148. // --------------------------------------------------------------
  149. // 조회후 값 SUM처리한다
  150. // --------------------------------------------------------------
  151. function fAfterRetrieve(pFlag)
  152. {
  153. vWinQty = 0;
  154. vWinAmt = 0;
  155. vWinQtySel = 0;
  156. vWinAmtSel = 0;
  157. if (pFlag == "1") {
  158. // 결재 내역 List
  159. for (var fRow = grd_rsihdpaplist.fixedRows ; fRow < grd_rsihdpaplist.rows ; fRow++) {
  160. vWinQty += parseFloat(grd_rsihdpaplist.valueMatrix(fRow, grd_rsihdpaplist.colRef("winqty")));
  161. vWinAmt += parseFloat(grd_rsihdpaplist.valueMatrix(fRow, grd_rsihdpaplist.colRef("winamt")));
  162. if (grd_rsihdpaplist.valueMatrix(fRow, grd_rsihdpaplist.colRef("slipdd")) != "") {
  163. grd_rsihdpaplist.isReadOnly(fRow, grd_rsihdpaplist.fixedCols-1, fRow, grd_rsihdpaplist.cols-1) = true;
  164. } else {
  165. if (grd_rsihdpaplist.valueMatrix(fRow, grd_rsihdpaplist.colRef("chkyn")) == "Y") {
  166. vWinQtySel += parseFloat(grd_rsihdpaplist.valueMatrix(fRow, grd_rsihdpaplist.colRef("winqty")));
  167. vWinAmtSel += parseFloat(grd_rsihdpaplist.valueMatrix(fRow, grd_rsihdpaplist.colRef("winamt")));
  168. }
  169. // grd_rsihdpaplist.isReadOnly(fRow, grd_rsihdpaplist.fixedCols-1, fRow, grd_rsihdpaplist.cols-1) = false;
  170. }
  171. }
  172. //
  173. model.setValue(eval("opt_"+gGridNm[gTabIdx1]+"_qty").attribute("ref"),vWinQty );
  174. model.setValue(eval("opt_"+gGridNm[gTabIdx1]+"_amt").attribute("ref"),vWinAmt );
  175. } else {
  176. // 결재 내역 상세 List
  177. fDataSum(eval("grd_"+gGridNm[gTabIdx1]));
  178. }
  179. model.refresh();
  180. }
  181. // --------------------------------------------------------------
  182. // 조회후 값 SUM처리한다
  183. // --------------------------------------------------------------
  184. function fDataSum(pGrid)
  185. {
  186. vWinQty = 0;
  187. vWinAmt = 0;
  188. // 결재 내역 List
  189. for (var fRow = pGrid.fixedRows ; fRow < pGrid.rows ; fRow++) {
  190. vWinQty += parseFloat(pGrid.valueMatrix(fRow, pGrid.colRef("winqty")));
  191. vWinAmt += parseFloat(pGrid.valueMatrix(fRow, pGrid.colRef("winamt")));
  192. }
  193. }
  194. // --------------------------------------------------
  195. // 화면 Control을 초기화한다
  196. // --------------------------------------------------
  197. function fClearData() {
  198. misfGridInit(eval("grd_"+gGridNm[gTabIdx1]+"_tree"));
  199. misfGridInit(eval("grd_"+gGridNm[gTabIdx1]));
  200. model.setValue(eval("opt_"+gGridNm[gTabIdx1]+"_qty").attribute("ref"),"");
  201. model.setValue(eval("opt_"+gGridNm[gTabIdx1]+"_amt").attribute("ref"),"");
  202. model.refresh();
  203. return;
  204. }
  205. // --------------------------------------------------------------
  206. // 조회후 값 SUM처리한다
  207. // pGrid : 선택그리드, pFlag : Y:선택, N :취소
  208. // --------------------------------------------------------------
  209. function fDataChkAllSelect(pFlag) {
  210. vWinQtySel = 0;
  211. vWinAmtSel = 0;
  212. var pGrid = eval("grd_"+gGridNm[gTabIdx1])
  213. // 결재 내역 List
  214. for (var fRow = pGrid.fixedRows ; fRow < pGrid.rows ; fRow++) {
  215. fDataCheckSelect(pGrid, fRow, pFlag);
  216. }
  217. pGrid.refresh();
  218. }
  219. function fDataCheckSelect(pGrid, pRow, pFlag) {
  220. vCheck = 0;
  221. ChkFlag = model.getValue(pGrid.nodeset+"["+pRow+"]/oldchk");
  222. if (ChkFlag == "") ChkFlag = "N";
  223. if (ChkFlag == pFlag){
  224. vCheck = 1;
  225. }
  226. if (vCheck == 0) {
  227. pGrid.rowStatus(pRow) = "2";
  228. model.setValue(pGrid.nodeset + "[" + pRow + "]/chk", pFlag);
  229. } else {
  230. pGrid.removeStatus(pRow, "update");
  231. model.setValue(pGrid.nodeset + "[" + pRow + "]/chk", ChkFlag);
  232. }
  233. // pGrid.refresh();
  234. }
  235. function fInvNoCheck(pRow) {
  236. var vCheck = 0;
  237. var pGrid = eval("grd_"+gGridNm[gTabIdx1])
  238. ChkFlag = model.getValue(pGrid.nodeset+"["+pRow+"]/old_inv_no");
  239. if (ChkFlag == "") ChkFlag = "-";
  240. if (ChkFlag == "-"){
  241. vCheck = 1;
  242. }
  243. if (vCheck == 0) {
  244. pGrid.rowStatus(pRow) = "2";
  245. model.setValue(pGrid.nodeset + "[" + pRow + "]/inv_no", "-");
  246. } else {
  247. pGrid.removeStatus(pRow, "update");
  248. model.setValue(pGrid.nodeset + "[" + pRow + "]/inv_no", "-");
  249. }
  250. }
  251. // --------------------------------------------------------------
  252. // 조회후 값 SUM처리한다
  253. // --------------------------------------------------------------
  254. function fDataAllSelect(pFlag) {
  255. vWinQtySel = 0;
  256. vWinAmtSel = 0;
  257. // 결재 내역 List
  258. for (var fRow = grd_rsihdpaplist.fixedRows ; fRow < grd_rsihdpaplist.rows ; fRow++) {
  259. if (grd_rsihdpaplist.valueMatrix(fRow, grd_rsihdpaplist.colRef("slipdd")) == "") {
  260. if (pFlag == "Y") {
  261. vWinQtySel += parseFloat(grd_rsihdpaplist.valueMatrix(fRow, grd_rsihdpaplist.colRef("winqty")));
  262. vWinAmtSel += parseFloat(grd_rsihdpaplist.valueMatrix(fRow, grd_rsihdpaplist.colRef("winamt")));
  263. if (model.getValue(grd_rsihdpaplist.nodeset+ "[" + fRow + "]/chkyn") !="Y") {
  264. model.setValue(grd_rsihdpaplist.nodeset+ "[" + fRow + "]/chkyn" ,pFlag);
  265. model.setValue(grd_rsihdpaplist.nodeset+ "[" + fRow + "]/chkpsn" ,getUserInfo("userid"));
  266. model.setValue(grd_rsihdpaplist.nodeset+ "[" + fRow + "]/chkpsnnm",getUserInfo("usernm"));
  267. model.setValue(grd_rsihdpaplist.nodeset+ "[" + fRow + "]/chkdd" ,getCurrentDate() );
  268. }
  269. } else {
  270. model.setValue(grd_rsihdpaplist.nodeset+ "[" + fRow + "]/chkpsn" , '');
  271. model.setValue(grd_rsihdpaplist.nodeset+ "[" + fRow + "]/chkpsnnm", '');
  272. model.setValue(grd_rsihdpaplist.nodeset+ "[" + fRow + "]/chkdd" , '');
  273. }
  274. }
  275. }
  276. //
  277. model.refresh();
  278. }
  279. // --------------------------------------------------------------
  280. // 조회후 값 SUM처리한다
  281. // --------------------------------------------------------------
  282. function fDataSelectSum(pGrid)
  283. {
  284. vWinQtySel = 0;
  285. vWinAmtSel = 0;
  286. // 결재 내역 List
  287. for (var fRow = pGrid.fixedRows ; fRow < pGrid.rows ; fRow++) {
  288. if (pGrid.valueMatrix(fRow, pGrid.colRef("slipdd")) == "" ) {
  289. if (pGrid.valueMatrix(fRow, pGrid.colRef("chkyn" )) == "Y") {
  290. vWinQtySel += parseFloat(pGrid.valueMatrix(fRow, pGrid.colRef("winqty")));
  291. vWinAmtSel += parseFloat(pGrid.valueMatrix(fRow, pGrid.colRef("winamt")));
  292. }
  293. }
  294. }
  295. model.setValue(opt_winqtysel.attribute("ref") ,vWinQtySel);
  296. model.setValue(opt_winamtsel.attribute("ref") ,vWinAmtSel);
  297. model.refresh();
  298. }
  299. // --------------------------------------------------------------
  300. // 조회후 값 SUM처리한다
  301. // --------------------------------------------------------------
  302. function fOnRowChanged(pGrid)
  303. {
  304. sPath ="/root/send/";
  305. tPath ="/root/send/windtl/";
  306. model.setValue(tPath + "instcd" , model.getValue(sPath + "instcd" )); // 기관코드
  307. model.setValue(tPath + "fromdd" , model.getValue(sPath + "fromdd" )); // 입고일자 FROM
  308. model.setValue(tPath + "todd" , model.getValue(sPath + "todd" )); // 입고일자 TO
  309. model.setValue(tPath + "chkyn" , model.getValue(sPath + "chkyn" )); // 검수유무
  310. model.setValue(tPath + "winpsn" , model.getValue(sPath + "winpsn" )); // 입고자
  311. model.setValue(tPath + "suppcustcd", model.getValue(sPath + "suppcustcd")); // 보조거래처
  312. model.setValue(tPath + "purcflag" , model.getValue(sPath + "purcflag" )); // 구매구분
  313. model.setValue(tPath + "paycond" , model.getValue(sPath + "paycond" )); // 1:정상, 2:지불필
  314. model.setValue(tPath + "windd" , "" ); // 입고일자
  315. model.setValue(tPath + "calcdocudd", "" ); // 계산서일자
  316. model.setValue(tPath +"goodflag" , pGrid.valueMatrix(pGrid.row, pGrid.colRef("goodflag" ))); // 물품구분
  317. model.setValue(tPath +"suplplcecd" , pGrid.valueMatrix(pGrid.row, pGrid.colRef("suplplcecd" ))); // 주거래처
  318. model.setValue(tPath +"purcflag" , pGrid.valueMatrix(pGrid.row, pGrid.colRef("purcflag" ))); // 구매구분
  319. model.setValue(tPath +"calcdocukind", pGrid.valueMatrix(pGrid.row, pGrid.colRef("calcdocukind"))); // 계산서구분
  320. model.setValue(tPath +"slipdd" , pGrid.valueMatrix(pGrid.row, pGrid.colRef("slipdd"))); // 전표일자
  321. model.setValue(tPath +"slipno" , pGrid.valueMatrix(pGrid.row, pGrid.colRef("slipno"))); // 전표번호
  322. model.setValue(tPath +"winpsn" , pGrid.valueMatrix(pGrid.row, pGrid.colRef("winpsn"))); // 입고자
  323. submit("TRRSI02706");
  324. // fAfterRetrieve("2");
  325. model.refresh();
  326. }
  327. // --------------------------------------------------
  328. // Tree Click
  329. // --------------------------------------------------
  330. function fTreeGridClick() {
  331. var OpCode = "";
  332. var OpDepth = "";
  333. var pGrid = eval("grd_"+gGridNm[gTabIdx1]+"_tree")
  334. var Idx = pGrid.row;
  335. var TreePath = pGrid.nodeset;
  336. if (Idx == 0) return;
  337. if (gIndex == Idx) {
  338. return;
  339. } else {
  340. gIndex = Idx;
  341. }
  342. var vDepth = ""; // 1 LEVEL
  343. var vPcode = ""; // 2 코드+상위코드
  344. var vCodecd = ""; // 3 코드
  345. var vCodenm = ""; // 4 코드명
  346. var vBasecd = ""; // 5 결합코드
  347. var vWincnt = ""; // 6 입고건수
  348. var vWinqty = ""; // 7 입고수량
  349. var vWinamt = ""; // 8 입고금액
  350. var vWincnt2 = ""; // 6 입고건수
  351. var vWinqty2 = ""; // 7 입고수량
  352. var vWinamt2 = ""; // 8 입고금액
  353. var vDispnm = ""; // 9 DISPLAY 분류명
  354. var DispData = ""; //
  355. var vGoodflag = ""; // 02 물품구분
  356. var vSuplplcecd = ""; // 03 주거래처
  357. var vSuppcustcd = ""; // 04 보조거래처
  358. vDepth = model.getValue(TreePath +"["+Idx+"]/depth" ); // 01 LEVEL
  359. vPcode = model.getValue(TreePath +"["+Idx+"]/pcode" ); // 02 코드+상위코드
  360. vCodecd = model.getValue(TreePath +"["+Idx+"]/codecd" ); // 03 코드
  361. vEcodecd = model.getValue(TreePath +"["+Idx+"]/ecodecd"); // 04 EDIT 코드
  362. vCodenm = model.getValue(TreePath +"["+Idx+"]/codenm" ); // 05 코드명
  363. vBasecd = model.getValue(TreePath +"["+Idx+"]/basecd" ); // 06 결합코드
  364. vWincnt = model.getValue(TreePath +"["+Idx+"]/wincnt" ); // 07 입고건수
  365. vWinqty = model.getValue(TreePath +"["+Idx+"]/winqty" ); // 08 입고수량
  366. vWinamt = model.getValue(TreePath +"["+Idx+"]/winamt" ); // 09 입고금액
  367. vWincnt2 = model.getValue(TreePath +"["+Idx+"]/wincnt2"); // 07 입고건수
  368. vWinqty2 = model.getValue(TreePath +"["+Idx+"]/winqty2"); // 08 입고수량
  369. vWinamt2 = model.getValue(TreePath +"["+Idx+"]/winamt2"); // 09 입고금액
  370. vDispnm = model.getValue(TreePath +"["+Idx+"]/dispnm" ); // 10 DISPLAY 분류명
  371. DispData = vEcodecd + " : " + vCodenm; //
  372. vGoodflag = vPcode.substr( 2, 1); // 02 물품구분
  373. vSuplplcecd = vPcode.substr( 3, 10); // 03 주거래처
  374. vSuppcustcd = vPcode.substr(13, 10); // 04 보조거래처
  375. model.setValue(eval("opt_"+gGridNm[gTabIdx1]+"_qty").attribute("ref"), vWinqty);
  376. model.setValue(eval("opt_"+gGridNm[gTabIdx1]+"_amt").attribute("ref"), vWinamt);
  377. // if (parseFloat(vWincnt) > 500) {
  378. // alert("조회량이 500건을 초과하여 시간이 지연됩니다. 하위레벨에서 조회 바랍니다!!");
  379. // misfGridInit(eval("grd_"+gGridNm[gTabIdx1]));
  380. // model.refresh();
  381. // return;
  382. // }
  383. sPath ="/root/send/mst/";
  384. tPath ="/root/send/windtl/";
  385. model.setValue(tPath + "instcd" , model.getValue(sPath + "instcd" )); // 기관코드
  386. model.setValue(tPath + "fromdd" , model.getValue(sPath + "fromdd" )); // 입고일자 FROM
  387. model.setValue(tPath + "todd" , model.getValue(sPath + "todd" )); // 입고일자 TO
  388. model.setValue(tPath + "chkyn" , model.getValue(sPath + "chkyn" )); // 검수유무
  389. model.setValue(tPath + "winpsn" , model.getValue(sPath + "winpsn" )); // 입고자
  390. model.setValue(tPath + "suplplcecd" , model.getValue(sPath + "suplplcecd" )); // 주거래처
  391. model.setValue(tPath + "suppcustcd" , model.getValue(sPath + "suppcustcd" )); // 보조거래처
  392. model.setValue(tPath + "purcflag" , model.getValue(sPath + "purcflag" )); // 구매구분
  393. model.setValue(tPath + "paycond" , model.getValue(sPath + "paycond" )); // 1:정상, 2:지불필
  394. model.setValue(tPath + "searchflag" , model.getValue(sPath + "searchflag" )); // 조회구분
  395. model.setValue(tPath + "frcalcdocudd" , model.getValue(sPath + "frcalcdocudd")); // 계산서일자 FR
  396. model.setValue(tPath + "tocalcdocudd" , model.getValue(sPath + "tocalcdocudd")); // 계산서일자 TO
  397. model.setValue(tPath + "groupbugt" , model.getValue(sPath + "groupbugt" )); // 예산계정코드
  398. model.setValue(tPath + "calccnfmyn" , model.getValue(sPath + "calccnfmyn" )); // 정산확정여부
  399. model.setValue(tPath + "winprcsflag" , model.getValue(sPath + "winprcsflag" )); // 8:미처리, 9:처리
  400. model.setValue(tPath + "calccnfmdd" , model.getValue(sPath + "calccnfmdd" )); // 정산일자
  401. model.setValue(tPath + "frcalccnfmdd" , model.getValue(sPath + "frcalccnfmdd")); // 정산확정일자 FR
  402. model.setValue(tPath + "tocalccnfmdd" , model.getValue(sPath + "tocalccnfmdd")); // 정산확정일자 TO
  403. model.setValue(tPath +"goodflag" , vGoodflag ); // 물품구분
  404. model.setValue(tPath +"suplplcecd" , vSuplplcecd ); // 주거래처
  405. model.setValue(tPath +"suppcustcd" , vSuppcustcd ); // 보조거래처
  406. if (gTabIdx1 == "0") {
  407. submit("TRRSI02706");
  408. }
  409. if (gTabIdx1 == "2") {
  410. submit("TRRSI02712");
  411. }
  412. if (gTabIdx1 == "3") {
  413. submit("TRRSI02713");
  414. }
  415. var pGridDetail = eval("grd_"+gGridNm[gTabIdx1])
  416. // fViewOptionToggleX(pGridDetail);
  417. fViewOptionToggle();
  418. // fCopy2DetailData(gTabIdx1, pGridDetail);
  419. pGridDetail.refresh();
  420. fCustTreeSelect(pGrid); // 세금계산서 주거래처 Set
  421. model.refresh();
  422. }
  423. /**
  424. * @group :
  425. * @ver : 2009.04.23
  426. * @by : 최학록
  427. * @---------------------------------------------------
  428. * @type : function
  429. * @access : public
  430. * @desc : 그리드를 트리구조로 만들어준다.
  431. * @param :
  432. * @return :
  433. * @---------------------------------------------------
  434. */
  435. function fCopy2DetailData(pIdx, pGrid){
  436. // model.removeNodeset(pGrid.nodeset);
  437. misfGridInit(pGrid);
  438. model.copyNode( "/root/init/"+gPathNm[pIdx], "/root/main/"+ gPathNm[pIdx]);
  439. model.removeNodeset("/root/main/"+ gPathNm[pIdx]);
  440. fViewOptionToggleX(pGrid);
  441. }
  442. // --------------------------------------------------
  443. // Data Part Toggle 속성Toggle 처리하는 함수
  444. // --------------------------------------------------
  445. function fDataPartToggle(pCls) {
  446. var pGrpDetail = eval("grp_"+gGridNm[gTabIdx1])
  447. var pGrdDetail = eval("grd_"+gGridNm[gTabIdx1])
  448. switch(pCls) {
  449. case 0 :
  450. // 메인 Grup
  451. pGrpDetail.attribute("left" ) = "457";
  452. pGrpDetail.attribute("width" ) = "731";
  453. pGrdDetail.attribute("width" ) = "731";
  454. break;
  455. case 1 :
  456. pGrpDetail.attribute("left" ) = "0";
  457. pGrpDetail.attribute("width" ) = "1188";
  458. pGrdDetail.attribute("width" ) = "1188";
  459. }
  460. pGrpDetail.refresh();
  461. }
  462. // --------------------------------------------------
  463. // View Option 처리하는 함수
  464. // --------------------------------------------------
  465. function fViewOptionToggleX(pGrid) {
  466. for (var fRow = 1; fRow < pGrid.rows ; fRow++) {
  467. if (model.getValue(pGrid.nodeset+"["+fRow+"]/winprcsflag")=="9") {
  468. pGrid.isReadOnly(fRow, pGrid.colRef("chkyn"), fRow, pGrid.colRef("chkyn")) = true;
  469. } else {
  470. pGrid.isReadOnly(fRow, pGrid.colRef("chkyn"), fRow, pGrid.colRef("chkyn")) = false;
  471. }
  472. }
  473. pGrid.refresh();
  474. }
  475. // --------------------------------------------------
  476. // View Option 처리하는 함수
  477. // --------------------------------------------------
  478. function fViewOptionToggle() {
  479. var vColName = "";
  480. var sNode = null;
  481. var oPath = "/root/init/Options/option_"+ gTabIdx1 +"/";
  482. var vOpTail = "_op_"+gTabIdx1;
  483. var pGrid = eval("grd_"+gGridNm[gTabIdx1])
  484. for (var fCol = 1; fCol < pGrid.cols ; fCol++) {
  485. vColName = pGrid.colAttribute(fCol,"ref");
  486. var sNode = instance1.selectSingleNode(oPath + vColName);
  487. if (sNode != null) {
  488. pGrid.colHidden(pGrid.colRef(vColName)) = (eval("chk_"+vColName + vOpTail).value =="Y") ? false : true;
  489. }
  490. }
  491. pGrid.refresh();
  492. grp_view.visible = false;
  493. grp_main.disabled = false;
  494. }
  495. // --------------------------------------------------
  496. // Grid On Click 처리하는 함수
  497. // --------------------------------------------------
  498. function fGridConClick() {
  499. var vGrid = eval("grd_"+gGridNm[gTabIdx1])
  500. if ((vGrid.row == 0 ) ||
  501. (vGrid.col != vGrid.colRef("chk"))) return;
  502. ChkFlag = model.getValue(vGrid.nodeset + "[" + vGrid.row + "]/chk");
  503. fDataCheckSelect(vGrid, vGrid.row, ChkFlag);
  504. vGrid.refresh();
  505. }
  506. //-----------------------------------
  507. // 입고 검수 확인 저장
  508. //-----------------------------------
  509. function fCheckPersonSave(){
  510. var vCnt = 0 ;
  511. var pGrid = eval("grd_"+gGridNm[gTabIdx1])
  512. var sPath = pGrid.nodeset;
  513. var tPath = "/root/send/winchecklists";
  514. var tPath2 = "/root/send/winchecklists/winchecklist";
  515. var WincheckData = ""; // Send Data
  516. var WincheckHead = "instcd" + "▦" // 01 기관코드
  517. + "goodflag" + "▦" // 02 물품구분
  518. + "windd" + "▦" // 03 입고일자
  519. + "winno" + "▦" // 04 입고번호(0000)
  520. + "winseqno" + "▦" // 05 입고일련번호(000~999)
  521. + "windeptcd" + "▦" // 06 입고부서코드
  522. + "checkflag" + "▦" // 07 검수확인 UPDATE 여부
  523. + "chkyn" + "▦" // 08 검수확인여부
  524. + "chkpsn" + "▦" // 09 검수확인자
  525. + "chkdd" + "▦" // 10 검수확인년월
  526. + "calccnfmflag" + "▦" // 11 정산확정UPDATE 여부
  527. + "calccnfmpsn" + "▦" // 12 정산확정자
  528. + "calccnfmyn" + "▦" // 13 정산확정여부
  529. + "calccnfmdd" + "▦" // 14 정산확정년월
  530. + "winprcsflag" + "▦" // 15 정산상태 0:미결재,8:회계처리대상,9:회계처리완료
  531. + "slipflag" + "▦" // 16 전표UPDATE 여부
  532. + "slipdd" + "▦" // 17 전표일자
  533. + "slipno" + "▦" // 18 전표번호
  534. + "calcdocudd" + "▦" // 19 계산서일자
  535. + "calcfalg" + "▦" // 20 계산서일자 구분
  536. + "tableflag" + "▩"; // 21 검수테이블구분
  537. for (var fRow = pGrid.fixedRows; fRow < pGrid.rows ; fRow++ ) {
  538. if (pGrid.rowStatus(fRow) == 2) {
  539. WincheckData += model.getValue(sPath + "[" + fRow + "]/instcd" ) + "▦" // 01 기관코드
  540. if (gTabIdx1 == "3") {
  541. WincheckData += model.getValue(sPath + "[" + fRow + "]/fixtrseqmtflag" ) + "▦" // 02 물품구분
  542. WincheckData += model.getValue(sPath + "[" + fRow + "]/reqdd" ) + "▦" // 03 입고일자
  543. WincheckData += model.getValue(sPath + "[" + fRow + "]/reqno" ) + "▦" // 04 입고번호(0000)
  544. WincheckData += "" + "▦" // 05 입고일련번호(000~999)
  545. WincheckData += "" + "▦" // 06 입고부서코드
  546. } else {
  547. WincheckData += model.getValue(sPath + "[" + fRow + "]/goodflag" ) + "▦" // 02 물품구분
  548. WincheckData += model.getValue(sPath + "[" + fRow + "]/windd" ) + "▦" // 03 입고일자
  549. WincheckData += model.getValue(sPath + "[" + fRow + "]/winno" ) + "▦" // 04 입고번호(0000)
  550. WincheckData += model.getValue(sPath + "[" + fRow + "]/winseqno" ) + "▦" // 05 입고일련번호(000~999)
  551. if (gTabIdx1 == "2") {
  552. WincheckData += "" + "▦" // 06 입고부서코드
  553. } else {
  554. WincheckData += model.getValue(sPath + "[" + fRow + "]/windeptcd") + "▦" // 06 입고부서코드
  555. }
  556. }
  557. WincheckData += "Y" + "▦" // 07 검수확인 UPDATE 여부
  558. WincheckData += model.getValue(sPath + "[" + fRow + "]/chkyn" ) + "▦" // 08 검수확인여부
  559. if (model.getValue(sPath + "[" + fRow + "]/chkyn")=="Y") {
  560. WincheckData += getUserInfo("userid") + "▦" // 09 검수확인자
  561. WincheckData += getCurrentDate() + "▦" // 10 검수확인년월
  562. } else {
  563. WincheckData += "" + "▦" // 09 검수확인자
  564. WincheckData += "" + "▦" // 10 검수확인년월
  565. }
  566. WincheckData += "N" + "▦" // 11 정산확정UPDATE 여부
  567. WincheckData += "" + "▦" // 12 정산확정자
  568. WincheckData += "" + "▦" // 13 정산확정여부
  569. WincheckData += "" + "▦" // 14 정산확정년월
  570. WincheckData += "" + "▦" // 15 정산상태 0:미결재,8:회계처리대상,9:회계처리완료
  571. WincheckData += "N" + "▦" // 16 전표UPDATE 여부
  572. WincheckData += "" + "▦" // 17 전표일자
  573. WincheckData += "" + "▦" // 18 전표번호
  574. if (model.getValue(sPath + "[" + fRow + "]/calcdocudd" )==
  575. model.getValue(sPath + "[" + fRow + "]/oldcalcdocudd") ) {
  576. WincheckData += "" + "▦" // 19 계산서일자
  577. WincheckData += "N" + "▦" // 20 계산서일자 구분
  578. } else {
  579. WincheckData += model.getValue(sPath + "[" + fRow + "]/calcdocudd") + "▦" // 19 계산서일자
  580. WincheckData += "Y" + "▦" // 20 계산서일자 구분
  581. }
  582. WincheckData += gTabIdx1 + "▩"; // 21 검수테이블구분
  583. vCnt++;
  584. }
  585. }
  586. if (vCnt > 0) {
  587. model.removenode(tPath);
  588. model.makeValue(tPath2, WincheckHead+WincheckData);
  589. submit("TXRSI02710");
  590. }
  591. }
  592. // --------------------------------------------------
  593. // 보기 Option 선택
  594. // --------------------------------------------------
  595. function fViewOptionClick() {
  596. switch(gTabIdx1) {
  597. case "0" :
  598. grp_rsihinptlist_op.visible = true;
  599. grp_rfchinpflist_op.visible = false;
  600. grp_rfehemhtlist_op.visible = false;
  601. break;
  602. case "2" :
  603. grp_rsihinptlist_op.visible = false;
  604. grp_rfchinpflist_op.visible = true;
  605. grp_rfehemhtlist_op.visible = false;
  606. break;
  607. case "3" :
  608. grp_rsihinptlist_op.visible = false;
  609. grp_rfchinpflist_op.visible = false;
  610. grp_rfehemhtlist_op.visible = true;
  611. }
  612. grp_view.visible = true;
  613. grp_main.disabled = true;
  614. grp_view.refresh();
  615. }
  616. // --------------------------------------------------
  617. // Grid Excel 저장
  618. // --------------------------------------------------
  619. function fExcelDataSave() {
  620. switch(gTabIdx1) {
  621. case "0" :
  622. misfSaveExcel(grd_rsihinptlist);
  623. break;
  624. case "2" :
  625. misfSaveExcel(grd_rfchinpflist);
  626. break;
  627. case "3" :
  628. misfSaveExcel(grd_rfehemhtlist);
  629. }
  630. }
  631. //--------------------------------------
  632. // 전자 세금계산서 변경 컨트롤을 View
  633. //--------------------------------------
  634. function fUpdateDataView()
  635. {
  636. grp_invoice.visible = true;
  637. grp_main.disabled = true;
  638. grp_invoice.refresh();
  639. }
  640. //--------------------------------------------
  641. // 입력한 값들을 초기화 시키고, 컨트롤을 숨김
  642. //--------------------------------------------
  643. function fUpdateDataExit()
  644. {
  645. // 입력한 값들을 초기화 시키고, 컨트롤을 숨김
  646. grp_update.visible = false;
  647. ipt_changecalcfr.value = "";
  648. ipt_changecalcto.value = "";
  649. //컨트롤을 숨기고 좌표를 초기화 시킴
  650. // grp_update.initStyle("left");
  651. // grp_update.initStyle("top");
  652. grp_main.disabled = false;
  653. }
  654. //--------------------------------------
  655. // 세금 계산서일자를 변경한다
  656. //--------------------------------------
  657. function fUpdateData()
  658. {
  659. if ((model.getValue(ipt_changecalcfr.attribute("ref")) == "")) {
  660. alert("변경전 계산서일자를 입력하십시요!!.");
  661. return;
  662. };
  663. if ((model.getValue(ipt_changecalcto.attribute("ref")) == "")) {
  664. alert("변경후 계산서일자를 입력하십시요!!.");
  665. return;
  666. };
  667. //
  668. var vCalDateFr = model.getValue(ipt_changecalcfr.attribute("ref"));
  669. var vCalDateTo = model.getValue(ipt_changecalcto.attribute("ref"));
  670. //
  671. var pGrid = eval("grd_"+gGridNm[gTabIdx1])
  672. // 결재 내역 List
  673. var vCheck = 0;
  674. for (var fRow = pGrid.fixedRows ; fRow < pGrid.rows ; fRow++) {
  675. if ((model.getValue(pGrid.nodeset+"["+fRow+"]/calccnfmyn") == "Y") &&
  676. (model.getValue(pGrid.nodeset+"["+fRow+"]/winprcsflag") == "9") ){
  677. vCheck = 1;
  678. } else {
  679. if (model.getValue(pGrid.nodeset+"["+fRow+"]/calcdocudd") == vCalDateFr) {
  680. pGrid.rowStatus(fRow) = "2";
  681. model.setValue(pGrid.nodeset+"["+fRow+"]/calcdocudd", vCalDateTo);
  682. }
  683. }
  684. }
  685. pGrid.refresh();
  686. fUpdateDataExit();
  687. }
  688. /* ------------------------------------------------- */
  689. /* ------End Of List ------------------------------- */
  690. /* -------------------------------------------------- */