SMRAS13000_부채거래처관리원장.xrw 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet href="../../../com/commonweb/css/common.css" type="text/css" ?>
  3. <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
  4. <xhtml:head>
  5. <xhtml:title>관리항목원장</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <main>
  10. <condition>
  11. <notecd/>
  12. <notecdnm/>
  13. <frdt/>
  14. <todt/>
  15. <instcd/>
  16. <mngitem/>
  17. </condition>
  18. <list>
  19. <itemlist/>
  20. <detailist/>
  21. </list>
  22. </main>
  23. <send>
  24. </send>
  25. <init>
  26. <preamt/>
  27. <dramt/>
  28. <cramt/>
  29. <balanceamt/>
  30. </init>
  31. <temp/>
  32. <source>
  33. <slipinfo/>
  34. </source>
  35. </root>
  36. </instance>
  37. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  38. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  39. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  40. <script type="javascript" src="../../../mis/miscommonweb/js/MIS.js"/>
  41. <script type="javascript" src="../../../mis/miscommonweb/js/RAC001.js"/>
  42. <script type="javascript" src="../../../mis/acntcommonweb/js/RAD001.js"/>
  43. <script type="javascript" ev:event="xforms-ready">
  44. <![CDATA[
  45. fOpenForm();
  46. //sCdGrupid = model.getValue("/root/init/comcode/cdgrupid");
  47. ]]>
  48. </script>
  49. <script type="javascript">
  50. <![CDATA[
  51. //========================================================================================
  52. //화면 로드시 초기화 함수
  53. //========================================================================================
  54. function fOpenForm() {
  55. model.removenode("/root/main/notelist");
  56. var sToday = getCurrentDate().toString();
  57. var sFrday = sToday.substring(0,4) + "0101";
  58. model.setValue("/root/main/condition/frdt",sFrday);
  59. model.setValue("/root/main/condition/todt",sToday);
  60. var instcd = getUserInfo("dutplceinstcd");
  61. model.setValue("/root/main/condition/instcd",instcd);
  62. model.refresh();
  63. }
  64. //========================================================================================
  65. //기간 수정시 날짜 월 세팅
  66. //========================================================================================
  67. function fOpenForm2() {
  68. model.removenode("/root/main/notelist");
  69. var sFrday = model.getValue("/root/main/condition/frdt") + "01";
  70. var sToday = model.getValue("/root/main/condition/frdt") + "31";
  71. model.setValue("/root/main/condition/frdt",sFrday);
  72. model.setValue("/root/main/condition/todt",sToday);
  73. var instcd = getUserInfo("dutplceinstcd");
  74. model.setValue("/root/main/condition/instcd",instcd);
  75. model.refresh();
  76. }
  77. //========================================================================================
  78. //기재사항코드 조회
  79. //========================================================================================
  80. function fGetNoteList() {
  81. model.resetInstanceNode("/root/main/list/itemlist");
  82. model.removenode("/root/main/list/itemlist");//조회시 기존 데이터 삭제
  83. model.copyNode("/root/send", "/root/main/condition");
  84. model.refresh();
  85. submit("TRRAS00240");
  86. }
  87. //========================================================================================
  88. //기재사항코드 상세조회
  89. //========================================================================================
  90. function fGetNoteDetlList() {
  91. model.resetInstanceNode("/root/main/list/detailist");
  92. model.removenode("/root/main/list/detailist");//조회시 기존 데이터 삭제
  93. model.copyNode("/root/send", "/root/main/condition");
  94. model.refresh();
  95. submit("TRRAS00260");
  96. }
  97. //========================================================================================
  98. //관리항목 상세정보 조회(그리드용)
  99. //========================================================================================
  100. function fGetMngItemInfo(pRow)
  101. {
  102. if ( pRow > 0 )
  103. {
  104. model.resetInstanceNode("/root/send");
  105. var strItem ;
  106. strItem = grd_notelist.valueMatrix(grd_notelist.row, grd_notelist.colRef("mngitem"));
  107. model.setValue("/root/main/condition/mngitem",strItem);
  108. model.resetInstanceNode("/root/main/list/detailist");
  109. model.removenode("/root/main/list/detailist");//조회시 기존 데이터 삭제
  110. model.copyNode("/root/send", "/root/main/condition");
  111. model.refresh();
  112. submit("TRRAS00250");
  113. fSetRowColor(ipt_detailist);
  114. fGetMoneySum();
  115. model.refresh();
  116. //fCopyInstance();
  117. }
  118. }
  119. //========================================================================================
  120. //차변, 대변, 잔액 구하기
  121. //========================================================================================
  122. function fGetMoneySum(){
  123. var idx = ipt_detailist.rows;
  124. var sum = 0;
  125. var sum1 = 0;
  126. var sum2 = 0;
  127. for (var i = 1; i < idx; i++){
  128. var j = 1;
  129. var gubn = model.getValue("/root/main/list/detailist["+ i +"]/gubn");
  130. if (gubn == "0"){
  131. sum = sum + parseInt(model.getValue("/root/main/list/detailist["+ i +"]/dramt"));
  132. sum1 = sum1 + parseInt(model.getValue("/root/main/list/detailist["+ i +"]/cramt"));
  133. sum2 = sum1 - sum;
  134. }
  135. }
  136. model.setValue("/root/init/dramt", sum);
  137. model.setValue("/root/init/cramt", sum1);
  138. model.setValue("/root/init/balanceamt", sum2);
  139. model.refresh();
  140. }
  141. function fGetNoteSumList() {
  142. var idx = ipt_detailist.rows;
  143. var janak = 0;
  144. var sum = 0;
  145. var sum1 = 0;
  146. var sum2 = 0;
  147. for (var i = 1; i < idx; i++){
  148. //janak = parseInt(model.getValue("/root/main/list/detailist["+ i +"]/dramt")) - parseInt(model.getValue("/root/main/list/detailist["+ i +"]/cramt"));
  149. //model.getValue("/root/main/list/detailist["+ i +"]/janak", janak);
  150. //parseInt(model.getValue("/root/main/list/detailist["+ i +"]/janak", (parseInt(model.getValue("/root/main/list/detailist["+ i +"]/dramt")) - parseInt(model.getValue("/root/main/list/detailist["+ i +"]/cramt")))));
  151. sum = sum + parseInt(model.getValue("/root/main/list/detailist["+ i +"]/dramt"));
  152. sum1 = sum1 + parseInt(model.getValue("/root/main/list/detailist["+ i +"]/cramt"));
  153. sum2 = sum2 + parseInt(model.getValue("/root/main/list/detailist["+ i +"]/janak"));
  154. }
  155. model.setValue("/root/init/dramt", sum);
  156. model.setValue("/root/init/cramt", sum1);
  157. model.setValue("/root/init/balanceamt", sum2);
  158. model.refresh();
  159. }
  160. //========================================================================================
  161. //그리드 로우 색 바꾸기
  162. //========================================================================================
  163. function fSetRowColor(pGrid)
  164. {
  165. var iCnt = 0;
  166. for(var i=0; i<pGrid.rows;i++)
  167. {
  168. if(pGrid.valueMatrix(i, pGrid.colRef("gubn")) == "1")
  169. {
  170. pGrid.rowStyle(i, "all", "background-color") = "#ccffff";
  171. }
  172. else if(pGrid.valueMatrix(i, pGrid.colRef("gubn")) == "2")
  173. {
  174. pGrid.rowStyle(i, "all", "background-color") = "#ffffff";
  175. }
  176. else if(pGrid.valueMatrix(i, pGrid.colRef("gubn")) == "3")
  177. {
  178. pGrid.rowStyle(i, "all", "background-color") = "#ffccff";
  179. }
  180. else if(pGrid.valueMatrix(i, pGrid.colRef("gubn")) == "4")
  181. {
  182. pGrid.rowStyle(i, "all", "background-color") = "#ffffcc";
  183. }
  184. }
  185. //pGrid.frozenRows = 1;
  186. // pGrid.frozenBottomRows = 1;
  187. // pGrid.backColorFrozen = "#dddddd";
  188. }
  189. //========================================================================================
  190. //엑셀입력(excel file을 그리드에 입력)
  191. //========================================================================================
  192. function fInputExcel(pGrid) {
  193. var fileName = window.fileDialog("open", ",", false, "", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  194. if(fileName != "") {
  195. pGrid.loadExcel(fileName, 1, true);
  196. pGrid.deleteRow(1);
  197. for(i = 1; i < pGrid.rows; i++) {
  198. pGrid.rowStatus(i) = 1;
  199. }
  200. pGrid.refresh();
  201. }
  202. }
  203. ]]>
  204. </script>
  205. <submission id="TRRAS00240" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/itemlist"/>
  206. <submission id="TRRAS00250" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/detailist"/>
  207. <submission id="TRRAS00260" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/detailist"/>
  208. <bind id="ipt_preamt1" ref="/root/init/preamt" calculate="sum(/root/main/list/detailist/preamt)"/>
  209. <bind id="ipt_dramt1" ref="/root/init/dramt" calculate="sum(/root/main/list/detailist/dramt)"/>
  210. <bind id="ipt_cramt1" ref="/root/init/cramt" calculate="sum(/root/main/list/detailist/cramt)"/>
  211. <bind id="ipt_balanceamt1" ref="/root/init/balanceamt" calculate="sum(/root/main/list/detailist/balance)"/>
  212. </model>
  213. </xhtml:head>
  214. <xhtml:body guideline="1,1195;" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  215. <group id="group1" style="left:0px; top:0px; width:1195px; height:13px; ">
  216. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:293px; height:14px; ">부채 거래처 관리원장</caption>
  217. <caption id="caption4" class="patient_text_black" style="left:922px; top:0px; width:272px; "/>
  218. </group>
  219. <group id="group3" scroll="auto" style="left:0px; top:20px; width:1195px; height:730px; ">
  220. <group id="grp_sea" style="left:0px; top:10px; width:1195px; height:35px; vertical-align:top; ">
  221. <shape id="roundrect1" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:0px; top:0px; width:1195; height:35px; background-color:#fffbf2; border-color:#ffd799; "/>
  222. <caption id="caption7" class="search_name" style="left:16px; top:9px; width:125px; height:17px; ">관리항목코드 :</caption>
  223. <line id="line5" class="line_4" style="x1:1087px; y1:8px; x2:1087px; y2:30px; border-color:#ffe4bb; border-left-style:solid; "/>
  224. <button id="btn_search" class="btn1_letter2" navindex="4" style="left:1120px; top:10px; width:56px; height:22px; text-align:left; ">
  225. <caption>조회</caption>
  226. <script type="javascript" ev:event="DOMActivate">
  227. <![CDATA[
  228. fGetNoteList();
  229. fGetNoteDetlList();
  230. fGetNoteSumList();
  231. ]]>
  232. </script>
  233. </button>
  234. <input id="ipt_notecd" ref="/root/main/condition/notecd" class="input_s_essential" navindex="6" style="left:135px; top:8px; width:80px; height:19px; ">
  235. <script type="javascript" ev:event="onkeypress">
  236. <![CDATA[
  237. if(event.keyCode == 13)
  238. {
  239. model.setFocus("ipt_notecdnm");
  240. }
  241. ]]>
  242. </script>
  243. <script type="javascript" ev:event="xforms-value-changed">
  244. <![CDATA[
  245. racfNoteValidCheck("notecd,notecdnm");
  246. ]]>
  247. </script>
  248. </input>
  249. <input id="ipt_notecdnm" ref="/root/main/condition/notecdnm" class="input_s_essential" navindex="6" style="left:241px; top:8px; width:230px; height:19px; ">
  250. <script type="javascript" ev:event="onkeypress">
  251. <![CDATA[
  252. if(event.keyCode == 13)
  253. {
  254. model.setFocus("btn_search");
  255. }
  256. ]]>
  257. </script>
  258. <script type="javascript" ev:event="xforms-value-changed">
  259. <![CDATA[
  260. racfNoteValidCheck("notecd,notecdnm");
  261. ]]>
  262. </script>
  263. </input>
  264. <button id="btn_help" class="icon_search" style="left:221px; top:10px; width:16px; height:16px; ">
  265. <caption/>
  266. <script type="javascript" ev:event="DOMActivate">
  267. <![CDATA[
  268. misfOpenPopUpList("06", ipt_notecd, "", "notecd,notecdnm");
  269. model.refresh();
  270. ]]>
  271. </script>
  272. </button>
  273. <caption id="caption1" class="search_name" style="left:505px; top:8px; width:89px; height:17px; ">기 간 :</caption>
  274. <input id="input2" ref="/root/main/condition/frdt" class="input_s_essential" inputtype="date" format="yyyy-mm-dd" style="left:595px; top:8px; width:100px; height:19px; ">
  275. <script type="javascript" ev:event="xforms-value-changed">
  276. <![CDATA[
  277. // fOpenForm2();
  278. ]]>
  279. </script>
  280. </input>
  281. <input id="input3" ref="/root/main/condition/todt" class="input_s_essential" inputtype="date" style="left:712px; top:8px; width:100px; height:19px; "/>
  282. <caption id="caption9" style="left:699px; top:10px; width:15px; height:20px; ">~</caption>
  283. </group>
  284. <line id="line3" class="line_1" style="x1:0px; y1:70px; x2:1192px; y2:70px; "/>
  285. <caption id="caption21" class="tit_2" style="left:5px; top:55px; width:131px; height:14px; ">관리항목</caption>
  286. <datagrid id="grd_notelist" nodeset="/root/main/list/itemlist" caption="기관코드^코드^관리항목" colsep="^" colwidth="0, 0, 165" explorerbar="sortshow" mergecellsfixedrows="bycolrec" rowheader="update" rowheight="16" rowsep="|" style="left:0px; top:75px; width:190px; height:620px; ">
  287. <col ref="instcd" visibility="hidden"/>
  288. <col ref="notecd" visibility="hidden"/>
  289. <col ref="mngitem" maxlength="3" style="text-align:left; "/>
  290. <script type="javascript" ev:event="onrowchanged">
  291. <![CDATA[
  292. var cur_row = grd_notelist.row;
  293. fGetMngItemInfo(cur_row);
  294. grd_notelist.dispatch("onmouseup");
  295. ]]>
  296. </script>
  297. </datagrid>
  298. <datagrid id="ipt_detailist" nodeset="/root/main/list/detailist" caption="날짜^전표일자^전표번호^거래처코드^거래처명^계정코드^계정과목^적요^차변^대변^잔액1^잔액^전월이월^구분" colsep="^" colwidth="72, 100, 60, 82, 118, 65, 93, 186, 115, 115, 51, 115, 80, 100" explorerbar="sortshow" mergecellsfixedrows="bycolrec" rowheader="update" rowheight="16" rowsep="|" style="left:195px; top:75px; width:1000px; height:590px; ">
  299. <col ref="sanctslipdd" format="yyyy-mm-dd" maxlength="3" style="text-align:center; "/>
  300. <col ref="unsldd" visibility="hidden" style="text-align:center; "/>
  301. <col ref="unslno" style="text-align:center; "/>
  302. <col ref="custcd" style="text-align:center; "/>
  303. <col ref="custnm" style="text-align:center; "/>
  304. <col ref="acntcd" style="text-align:center; "/>
  305. <col ref="acntnm" style="text-align:center; "/>
  306. <col ref="etcnotefact" style="text-align:left; "/>
  307. <col ref="dramt" format="(-)#,###" savetype="digit" style="text-align:right; "/>
  308. <col ref="cramt" format="(-)#,###" savetype="digit" style="text-align:right; "/>
  309. <col ref="balance" visibility="hidden" format="(-)#,###" savetype="digit" style="text-align:right; "/>
  310. <col ref="janak" format="(-)#,###" savetype="digit" style="text-align:right; "/>
  311. <col ref="preamt" visibility="hidden" format="(-)#,###" savetype="digit" style="text-align:right; "/>
  312. <col ref="gubn" visibility="hidden" style="text-align:center; "/>
  313. <script type="javascript" ev:event="ondblclick">
  314. <![CDATA[
  315. if (ipt_detailist.row > 0 && ipt_detailist.valueMatrix(ipt_detailist.row, ipt_detailist.colRef("gubn")) == "0")
  316. {
  317. model.makeValue("/root/source/slipinfo/instcd", getUserInfo("dutplceinstcd"));
  318. model.makeValue("/root/source/slipinfo/slipdt", model.getValue(ipt_detailist.nodeset + "[" + ipt_detailist.row + "]/unsldd"));
  319. model.makeValue("/root/source/slipinfo/slipno", model.getValue(ipt_detailist.nodeset + "[" + ipt_detailist.row + "]/unslno").substr(0, 4));
  320. model.refresh();
  321. modal("SMRAD00100","","","","","/root/source", "/root/target" );
  322. }
  323. ]]>
  324. </script>
  325. </datagrid>
  326. <upload id="upload1" style="left:735px; top:415px; width:100px; height:20px; "/>
  327. <button id="button1" class="btn2_letter4" style="left:1118px; top:50px; width:64px; height:19px; text-align:left; ">
  328. <caption>엑셀출력</caption>
  329. <script type="javascript" ev:event="onclick">
  330. <![CDATA[
  331. //radfSaveExcel(ipt_detailist);
  332. var fileName = window.fileDialog("save", ",", false, "excel", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  333. ipt_detailist.saveExcel(fileName,"SheetName:sheet1");
  334. ]]>
  335. </script>
  336. </button>
  337. <input id="ipt_dramt" ref="/root/init/dramt" format="(-)#,###" style="left:259px; top:673px; width:145px; height:19px; text-align:right; "/>
  338. <caption id="caption5" class="cell_1" style="left:195px; top:671px; width:62px; height:23px; text-align:center; vertical-align:middle; ">차변</caption>
  339. <caption id="caption8" class="cell_1" style="left:411px; top:671px; width:62px; height:23px; text-align:center; vertical-align:middle; ">대변</caption>
  340. <input id="ipt_cramt" ref="/root/init/cramt" format="(-)#,###" style="left:475px; top:672px; width:145px; height:19px; text-align:right; "/>
  341. <caption id="caption2" class="cell_1" style="left:627px; top:671px; width:62px; height:23px; text-align:center; vertical-align:middle; ">잔액</caption>
  342. <input id="ipt_balanceamt" ref="/root/init/balanceamt" format="(-)#,###" style="left:691px; top:673px; width:145px; height:19px; text-align:right; "/>
  343. </group>
  344. </xhtml:body>
  345. </xhtml:html>