SMRAR00100_가수금입력.xrw 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.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. <search>
  11. <maindatalist>
  12. <line/>
  13. <gubun/>
  14. <rmrk/>
  15. <gaamt/>
  16. <gadate/>
  17. <aactcd/>
  18. <sangflag/>
  19. <instcd/>
  20. <seqline/>
  21. <unslno/>
  22. <sanctslipno/>
  23. <sangcnt/>
  24. </maindatalist>
  25. <gaamtsum>
  26. <gaamtsum/>
  27. </gaamtsum>
  28. </search>
  29. </main>
  30. <search>
  31. <gadate/>
  32. <instcd/>
  33. <aactno/>
  34. <aactcd/>
  35. <seqline/>
  36. <janamt/>
  37. <chulamt/>
  38. <unslno/>
  39. <sanctslipno/>
  40. </search>
  41. <send>
  42. <gadate/>
  43. <instcd/>
  44. <aactno/>
  45. <aactcd/>
  46. <seqline/>
  47. <janamt/>
  48. <chulamt/>
  49. <unslno/>
  50. <sanctslipno/>
  51. </send>
  52. <hidden>
  53. <search>
  54. <code/>
  55. <prntnm/>
  56. </search>
  57. <save/>
  58. <apsl>
  59. <sumgaamt/>
  60. </apsl>
  61. </hidden>
  62. <init>
  63. <bankinfo>
  64. <acctno/>
  65. <acctcd/>
  66. </bankinfo>
  67. <etcinfo>
  68. <seqline/>
  69. <janamt/>
  70. <chulamt/>
  71. </etcinfo>
  72. </init>
  73. <temp/>
  74. </root>
  75. </instance>
  76. <script type="javascript" ev:event="xforms-ready">
  77. <![CDATA[
  78. var fdate = getCurrentDate();
  79. model.removenode( "/root/main/search/maindatalist");
  80. model.setValue("/root/search/instcd", getUserInfo("dutplceinstcd"));
  81. model.setValue("/root/search/gadate", fdate);
  82. submit("TRRAR00101"); //기관코드 send. / 예금계좌번호,코드 return.
  83. addComboItem("cmb_aactno","--전체--","","");
  84. model.refresh();
  85. ]]>
  86. </script>
  87. <script type="javascript">
  88. <![CDATA[
  89. //조회
  90. function fGetMainDataList() {
  91. if (cmb_aactno.value == ""){
  92. messageBox("예금계좌를 ","C002");
  93. return false;
  94. }
  95. if (ipt_gadate.value == ""){
  96. messageBox("가수금일자 ","C002");
  97. return false;
  98. }
  99. if (opt_seqline.value == ""){
  100. messageBox("일자별 SEQ ","C001");
  101. return false;
  102. }
  103. return true;
  104. }
  105. //정렬 순서로 sort함.
  106. function fGetSortSeq(){
  107. var num = grd_main.rows- 1;
  108. if(rdo_seq.value == 1){
  109. grd_main.sort(1, 2, num, 2) = "asc";
  110. }else{
  111. grd_main.sort(1, 3, num, 3) = "asc";
  112. }
  113. model.refresh();
  114. }
  115. //출력물순서 저장
  116. //엑셀 입력
  117. function fInputExcel(pGrid) {
  118. var fileName = window.fileDialog("open", ",", false, "", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  119. if(fileName != "") {
  120. pGrid.loadExcel(fileName, 1, true);
  121. // pGrid.deleteRow(1);
  122. for(i = 1; i < pGrid.rows; i++) {
  123. pGrid.rowStatus(i) = 1;
  124. }
  125. pGrid.refresh();
  126. }
  127. }
  128. //최종예금잔액계산
  129. function fn_janamtaccount(){
  130. //JANAMT <= 최종예금잔액before - (예금출고금액-예금출고금액before) + (가수금합계-가수금합계before)
  131. }
  132. //저장시 입력data checking logic..
  133. function fSetChackValue()
  134. {
  135. var updtdata = getGridUpdateData(grd_main);
  136. if (updtdata == ""){
  137. messageBox("변경된 데이터가","I004");
  138. return false;
  139. }
  140. var row = grd_main.row;
  141. for ( var i = grd_main.fixedRows; i <= grd_main.rows; i++ ) {
  142. //rowStatus=1:insert, 2:update, 4:delete
  143. if ( grd_main.rowStatus(i)=='1' || grd_main.rowStatus(i)=='2' || grd_main.rowStatus(i)=='4' ) {
  144. if ( grd_main.valueMatrix(i, grd_main.colRef("sangcnt")) > 0 ){
  145. alert("상계건수가 있는 Data는 수정 또는 삭제 할 수 없습니다.");
  146. grd_main.row = i;
  147. return false;
  148. }
  149. if ( grd_main.valueMatrix(i, grd_main.colRef("line")).length==0 ){
  150. alert("NO 가 없는 Data는 입력할 수 없습니다. 입력해 주세요");
  151. grd_main.row = i;
  152. return false;
  153. }
  154. if ( grd_main.valueMatrix(i, grd_main.colRef("gaamt")).length==0 ){
  155. alert("가수금이 없는 Data는 입력할 수 없습니다. 입력해 주세요");
  156. grd_main.row = i;
  157. grd_main.col = grd_main.colRef("gaamt");
  158. grd_main.editCell();
  159. return false;
  160. }
  161. if ( grd_main.valueMatrix(i, grd_main.colRef("gadate")).length==0 ){
  162. alert("가수금일자가 없는 Data는 입력할 수 없습니다. 입력해 주세요");
  163. grd_main.row = i;
  164. return false;
  165. }
  166. if ( grd_main.valueMatrix(i, grd_main.colRef("gadate")).length!=8 ){
  167. alert("가수금일자는 8자리여야 됩니다. 다시 입력해 주세요");
  168. grd_main.row = i;
  169. return false;
  170. }
  171. }
  172. }
  173. //rtn = messageBox("", "Q002");
  174. //if(rtn != "6" ) return false;
  175. return true;
  176. }
  177. ]]>
  178. </script>
  179. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  180. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  181. <script type="javascript" src="../../../com/basiccodeweb/js/ZBC001.js"/>
  182. <script type="javascript" src="../../../mis/miscommonweb/js/MIS.js"/>
  183. <script type="javascript" src="../../../mis/humtrafactmngtweb/js/RPB001.js"/>
  184. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  185. <submission id="TRRAR00101" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/search" resultref="/root/init/bankinfo"/>
  186. <submission id="TRRAR00102" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/init/etcinfo"/>
  187. <submission id="TRRAR00103" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/search" validate="false"/>
  188. <submission id="TXRAR00101" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/hidden"/>
  189. <submission id="TXRAR00102" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/hidden/save" resultref="/root/temp"/>
  190. <submission id="TXRAR00103" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/temp"/>
  191. <bind id="bind_cpt_gaamtsum" ref="/root/hidden/apsl/sumgaamt" calculate="sum(/root/main/search/maindatalist/gaamt)"/>
  192. <bind id="bind_cpt_janamt" ref="/root/search/janamt" calculate="/root/init/etcinfo/janamt - ( /root/search/chulamt - /root/init/etcinfo/chulamt ) + /root/hidden/apsl/sumgaamt - /root/main/search/gaamtsum/gaamtsum" type="xsd:int"/>
  193. </model>
  194. </xhtml:head>
  195. <xhtml:body guideline="1,1194;" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  196. <group id="group1" style="left:0px; top:0px; width:1195px; height:13px; ">
  197. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:293px; height:14px; ">가수금 입력</caption>
  198. <caption id="caption4" class="patient_text_black" style="left:922px; top:0px; width:272px; "/>
  199. </group>
  200. <group id="group3" scroll="auto" style="left:0px; top:40; width:1195px; height:744px; ">
  201. <group id="grp_sea" style="left:0px; top:10px; width:1195px; height:38px; vertical-align:top; ">
  202. <shape id="roundrect1" class="roundrect_search" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:0px; top:0px; width:1195px; height:38; background-color:#fffbf2; border-color:#ffd799; "/>
  203. <caption id="caption3" class="search_name" style="left:11px; top:9px; width:104px; height:17px; ">예금계좌 :</caption>
  204. <select1 id="cmb_aactno" ref="/root/search/aactcd" class="combo_s_essential" navindex="1" appearance="minimal" style="left:100px; top:9px; width:130px; height:19px; ">
  205. <choices>
  206. <itemset nodeset="/root/init/bankinfo">
  207. <label ref="aactno"/>
  208. <value ref="aactcd"/>
  209. </itemset>
  210. </choices>
  211. <script type="javascript" ev:event="xforms-select">
  212. <![CDATA[
  213. model.setValue("/root/search/aactno",cmb_aactno.label);
  214. //seqline, janamt, chulamt 가져오기위한 sql..
  215. model.copyNode ("/root/send", "/root/search");
  216. if ( submit("TRRAR00102") ) {
  217. model.setValue("/root/search/seqline", model.getValue("/root/init/etcinfo/seqline"));
  218. model.setValue("/root/search/janamt", model.getValue("/root/init/etcinfo/janamt"));
  219. model.setValue("/root/search/chulamt", model.getValue("/root/init/etcinfo/chulamt"));
  220. //alert("seqline ==> "+model.getValue("/root/init/etcinfo/seqline")+"\n janamt ==> "+model.getValue("/root/init/etcinfo/janamt")+"\n chulamt ==> "+model.getValue("/root/init/etcinfo/chulamt")+"\n" );
  221. ipt_chulamt.disabled = false;
  222. model.refresh();
  223. button2.dispatch("DOMActivate");
  224. }
  225. ]]>
  226. </script>
  227. </select1>
  228. <output id="opt_aactcd" ref="/root/search/aactcd" class="output_fix" appearance="output" style="left:232px; top:9px; width:40px; height:19px; "/>
  229. <caption id="cap_codeflag" class="search_name" style="left:280px; top:9px; width:110px; height:17px; ">가수금일자 :</caption>
  230. <input id="ipt_gadate" ref="/root/search/gadate" class="input_s_essential" inputtype="date" format="yyyy-mm-dd" style="left:383px; top:9px; width:95px; height:19px; ">
  231. <script type="javascript" ev:event="xforms-value-changed">
  232. <![CDATA[
  233. //seqline, janamt, chulamt 가져오기위한 sql..
  234. model.copyNode ("/root/send", "/root/search");
  235. if ( submit("TRRAR00102") ) {
  236. model.setValue("/root/search/seqline", model.getValue("/root/init/etcinfo/seqline"));
  237. model.setValue("/root/search/janamt", model.getValue("/root/init/etcinfo/janamt"));
  238. model.setValue("/root/search/chulamt", model.getValue("/root/init/etcinfo/chulamt"));
  239. //alert("seqline ==> "+model.getValue("/root/init/etcinfo/seqline")+"\n janamt ==> "+model.getValue("/root/init/etcinfo/janamt")+"\n chulamt ==> "+model.getValue("/root/init/etcinfo/chulamt")+"\n" );
  240. ipt_chulamt.disabled = false;
  241. model.refresh();
  242. button2.dispatch("DOMActivate");
  243. }
  244. ]]>
  245. </script>
  246. </input>
  247. <input id="opt_seqline" ref="/root/search/seqline" class="input_s_essential" appearance="input" style="left:480px; top:9px; width:30px; height:19px; ">
  248. <script type="javascript" ev:event="xforms-value-changed">
  249. <![CDATA[
  250. if ( opt_seqline.value != 1){
  251. ipt_chulamt.value = 0;
  252. ipt_chulamt.disabled = true;
  253. }else{
  254. ipt_chulamt.disabled = false;
  255. }
  256. button2.dispatch("DOMActivate");
  257. ]]>
  258. </script>
  259. </input>
  260. <caption id="caption7" class="search_name" style="left:515px; top:9px; width:120px; height:17px; ">최종예금잔액 :</caption>
  261. <output id="ipt_janamt" ref="/root/search/janamt" class="output_fix" format="(-)#,###" appearance="output" style="left:630px; top:9px; width:95px; height:19px; "/>
  262. <input id="ipt_janamtup" ref="/root/send/janamt" class="input_s_essential" format="(-)#,###" appearance="input" style="left:727px; top:9px; width:95px; height:19px; "/>
  263. <button id="btn_janamtsave" class="btn2_letter4" style="left:824px; top:9px; width:64px; height:19px; ">
  264. <caption>잔액수정</caption>
  265. <script type="javascript" ev:event="DOMActivate">
  266. <![CDATA[
  267. //alert( ipt_janamt.value );
  268. //model.copyNode ("/root/send", "/root/search");
  269. setAlertOn();
  270. submit("TXRAR00101")
  271. ]]>
  272. </script>
  273. </button>
  274. <caption id="caption8" class="search_name" style="left:890px; top:9px; width:115px; height:17px; ">예금출고금액 :</caption>
  275. <input id="ipt_chulamt" ref="/root/search/chulamt" class="input_s_essential" format="(-)#,###" appearance="input" style="left:1010px; top:9px; width:100px; height:19px; ">
  276. <script type="javascript" ev:event="DOMFocusIn">
  277. <![CDATA[
  278. if (model.getValue("/root/search/seqline") != 1){
  279. alert("SEQ NO가 1일 경우에만 출금액을 사용할 수 있습니다.");
  280. ipt_chulamt.value = 0;
  281. ipt_chulamt.disabled = true;
  282. }else{
  283. ipt_chulamt.disabled = false;
  284. }
  285. ]]>
  286. </script>
  287. <script type="javascript" ev:event="xforms-value-changed">
  288. <![CDATA[
  289. //최종예금잔액계산
  290. fn_janamtaccount();
  291. ]]>
  292. </script>
  293. </input>
  294. <line id="line5" class="line_4" style="x1:1122px; y1:8px; x2:1122px; y2:30px; border-color:#ffe4bb; border-left-style:solid; "/>
  295. <button id="button2" class="btn1_letter2" navindex="4" style="left:1133px; top:10px; width:56px; height:22px; text-align:left; ">
  296. <caption>조회</caption>
  297. <script type="javascript" ev:event="DOMActivate">
  298. <![CDATA[
  299. if( fGetMainDataList() ) {
  300. //setAlertOn();
  301. model.copyNode ("/root/send", "/root/search");
  302. submit("TRRAR00103");
  303. model.setValue("/root/search/unslno", grd_main.valueMatrix(1, grd_main.colRef("unslno")) );
  304. model.setValue("/root/search/sanctslipno", grd_main.valueMatrix(1, grd_main.colRef("sanctslipno")) );
  305. model.refresh();
  306. }
  307. ]]>
  308. </script>
  309. </button>
  310. </group>
  311. <line id="line3" class="line_1" style="x1:0px; y1:75px; x2:1194px; y2:75px; "/>
  312. <button id="button18" class="btn2_letter3" style="left:1137px; top:52px; width:53px; height:19px; ">
  313. <caption>행삭제</caption>
  314. <script type="javascript" ev:event="DOMActivate">
  315. <![CDATA[
  316. misfGridIUD(grd_main, "D");
  317. model.refresh();
  318. ]]>
  319. </script>
  320. </button>
  321. <button id="btn_addrow" class="btn2_letter3" style="left:1080px; top:52px; width:53px; height:19px; ">
  322. <caption>행추가</caption>
  323. <script type="javascript" ev:event="DOMActivate">
  324. <![CDATA[
  325. if( fGetMainDataList() ) {
  326. misfGridIUD(grd_main, "A");
  327. if(grd_main.row == '1'){
  328. grd_main.valueMatrix(grd_main.row, grd_main.colRef("line")) = 1;
  329. }else{
  330. grd_main.valueMatrix(grd_main.row, grd_main.colRef("line")) = parseInt(grd_main.valueMatrix(grd_main.row-1, grd_main.colRef("line"))) + 1;
  331. }
  332. grd_main.valueMatrix(grd_main.row, grd_main.colRef("gadate")) = ipt_gadate.value;
  333. grd_main.valueMatrix(grd_main.row, grd_main.colRef("aactcd")) = opt_aactcd.value;
  334. grd_main.valueMatrix(grd_main.row, grd_main.colRef("sangflag")) = "N";
  335. grd_main.valueMatrix(grd_main.row, grd_main.colRef("instcd")) = getUserInfo("dutplceinstcd");
  336. grd_main.valueMatrix(grd_main.row, grd_main.colRef("seqline")) = opt_seqline.value;
  337. grd_main.valueMatrix(grd_main.row, grd_main.colRef("sangcnt")) = 0;
  338. model.refresh();
  339. }
  340. ]]>
  341. </script>
  342. </button>
  343. <datagrid id="grd_main" nodeset="/root/main/search/maindatalist" caption="NO^구분^가수금^적요^가수금일자^미결전표번호^승인전표번호^상계건수^계좌코드^sangflag^instcd^seqline^상계여부" colsep="^" colwidth="80, 153, 150, 350, 100, 90, 90, 79, 0, 0, 0, 0" ellipsis="true" explorerbar="sortshow" mergecellsfixedrows="bycolrec" rowheader="update" rowheight="16" rowsep="|" tooltip="true" style="left:0px; top:80px; width:1194px; height:635px; ">
  344. <col ref="line" style="text-align:right; "/>
  345. <col ref="gubun" type="input" style="left:106px; top:23px; width:128px; height:23px; "/>
  346. <col ref="gaamt" type="input" format="(-)#,###" maxlength="10" style="text-align:right; "/>
  347. <col ref="rmrk" type="input"/>
  348. <col ref="gadate" format="yyyy-mm-dd" style="left:904px; top:23px; width:100px; height:23px; text-align:center; "/>
  349. <col ref="unslno" style="text-align:center; "/>
  350. <col ref="sanctslipno" style="text-align:center; "/>
  351. <col ref="sangcnt" style="text-align:center; "/>
  352. <col ref="aactcd"/>
  353. <col ref="sangflag"/>
  354. <col ref="instcd"/>
  355. <col ref="seqline"/>
  356. <script type="javascript" ev:event="onaftersort">
  357. <![CDATA[
  358. grd_main.gridToInstance();
  359. ]]>
  360. </script>
  361. </datagrid>
  362. <button id="ipt_excsave" class="btn2_letter4" style="left:1012px; top:52px; width:64px; height:19px; ">
  363. <caption>엑셀저장</caption>
  364. <script type="javascript" ev:event="DOMActivate">
  365. <![CDATA[
  366. misfSaveExcel(grd_main);
  367. ]]>
  368. </script>
  369. </button>
  370. <caption id="caption21" class="tit_2" style="left:5px; top:57px; width:131px; height:13px; ">출력 목록</caption>
  371. <button id="ipt_excadd" class="btn2_letter4" style="left:944px; top:52px; width:64px; height:19px; ">
  372. <caption>엑셀입력</caption>
  373. <script type="javascript" ev:event="DOMActivate">
  374. <![CDATA[
  375. if( fGetMainDataList() ) {
  376. fInputExcel(grd_main);
  377. grd_main.gridToInstance();
  378. for(var i = 1 ; i <= model.instance1.selectNodes(grd_main.nodeset).length ; i++)
  379. {
  380. model.setValue(grd_main.nodeset + "[" + i + "]/gadate", ipt_gadate.value);
  381. model.setValue(grd_main.nodeset + "[" + i + "]/aactcd", opt_aactcd.value);
  382. model.setValue(grd_main.nodeset + "[" + i + "]/sangflag", "N");
  383. model.setValue(grd_main.nodeset + "[" + i + "]/instcd", getUserInfo("dutplceinstcd"));
  384. model.setValue(grd_main.nodeset + "[" + i + "]/seqline", opt_seqline.value);
  385. model.setValue(grd_main.nodeset + "[" + i + "]/sangcnt", 0);
  386. }
  387. }
  388. ]]>
  389. </script>
  390. </button>
  391. <output id="ipt_unslno" ref="/root/search/unslno" class="output_fix" visibility="hidden" appearance="output" style="left:770px; top:50px; width:50px; height:19px; "/>
  392. <output id="ipt_sanctslipno" ref="/root/search/sanctslipno" class="output_fix" visibility="hidden" appearance="output" style="left:825px; top:50px; width:50px; height:19px; "/>
  393. </group>
  394. <group id="group4" scroll="auto" style="left:0px; top:13; width:1195px; height:27px; ">
  395. <button id="button39" class="btn4_letter2" style="left:1137px; top:3px; width:56px; height:22px; ">
  396. <caption>저장</caption>
  397. <script type="javascript" ev:event="DOMActivate">
  398. <![CDATA[
  399. if( fSetChackValue() ) { //저장시 입력data checking logic..
  400. //중복체크에 대한 부부이 빠져있음.
  401. model.setValue("/root/hidden/save",grd_main.getUpdateData());
  402. //rtn = messageBox("", "Q002");
  403. //if(rtn != "6" ) return false;
  404. //RADMSUSA 테이블에 저장
  405. if(submit("TXRAR00102")) {
  406. //전표처리 하기위한 프로시저 실행..
  407. model.copyNode ("/root/send", "/root/search");
  408. if(submit("TXRAR00103")) {
  409. button2.dispatch("DOMActivate");
  410. }
  411. }
  412. }
  413. ]]>
  414. </script>
  415. </button>
  416. <line id="line2" class="line_6" style="x1:0px; y1:25px; x2:1194px; y2:25px; "/>
  417. </group>
  418. <caption id="caption1" class="cell_1" style="left:134px; top:757px; width:120px; height:23px; text-align:center; vertical-align:middle; ">가수금합계</caption>
  419. <caption id="cpt_gaamtsum" ref="/root/hidden/apsl/sumgaamt" format="(-)#,###" style="left:255px; top:757px; width:151px; height:23px; text-align:right; vertical-align:middle; background-color:#ffcccc; "/>
  420. </xhtml:body>
  421. </xhtml:html>