SMRAR00200_가수금상계.xrw 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  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. <maindatalist>
  11. <instcd/>
  12. <line/>
  13. <seqline/>
  14. <aactno/>
  15. <aactcd/>
  16. <gadate/>
  17. <gubun/>
  18. <rmrk/>
  19. <gaamt/>
  20. <janamt/>
  21. <sangflag/>
  22. <ymdwrite/>
  23. <seqwrite/>
  24. <sangflag_text/>
  25. <hiscnt/>
  26. <hissumjanamt/>
  27. <statementdate/>
  28. <realjanamt/>
  29. </maindatalist>
  30. </main>
  31. <send>
  32. <instcd/>
  33. <statementdate/>
  34. <gadate_fr/>
  35. <gadate_to/>
  36. </send>
  37. <hidden>
  38. <apsl>
  39. <sumgaamt/>
  40. <sumjanamt/>
  41. </apsl>
  42. <save/>
  43. </hidden>
  44. <init>
  45. </init>
  46. <temp>
  47. <unsllist>
  48. <instcd/>
  49. <statementdate/>
  50. <unslno/>
  51. </unsllist>
  52. </temp>
  53. </root>
  54. </instance>
  55. <script type="javascript" ev:event="xforms-ready">
  56. <![CDATA[
  57. var fdate = getCurrentDate();
  58. model.removenode( "/root/main/maindatalist");
  59. model.setValue("/root/send/instcd", getUserInfo("dutplceinstcd"));
  60. model.setValue("/root/send/statementdate", fdate);
  61. var vyear = fdate.substr(0,4) + "0101"
  62. model.setValue("/root/send/gadate_fr", vyear);
  63. model.setValue("/root/send/gadate_to", fdate);
  64. submit("TRRAR00201");
  65. model.refresh();
  66. ]]>
  67. </script>
  68. <script type="javascript">
  69. <![CDATA[
  70. var chkflag = 0;
  71. //조회
  72. function fGetMainDataList() {
  73. setAlertOn();
  74. submit("TRRAR00201");
  75. model.setValue("/root/hidden/apsl/sumjanamt", 0);
  76. model.refresh();
  77. }
  78. //정렬 순서로 sort함.
  79. function fGetSortSeq(){
  80. var num = grd_main.rows- 1;
  81. if(rdo_seq.value == 1){
  82. grd_main.sort(1, 2, num, 2) = "asc";
  83. }else{
  84. grd_main.sort(1, 3, num, 3) = "asc";
  85. }
  86. model.refresh();
  87. }
  88. //출력물순서 저장
  89. //엑셀 입력
  90. function fInputExcel(pGrid) {
  91. var fileName = window.fileDialog("open", ",", false, "", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  92. if(fileName != "") {
  93. pGrid.loadExcel(fileName, 1, true);
  94. pGrid.deleteRow(1);
  95. for(i = 1; i < pGrid.rows; i++) {
  96. pGrid.rowStatus(i) = 1;
  97. }
  98. pGrid.refresh();
  99. }
  100. }
  101. //저장시 입력data checking logic..
  102. function fSetChackValue()
  103. {
  104. var updtdata = getGridUpdateData(grd_main);
  105. if (updtdata == ""){
  106. messageBox("변경된 데이터가","I004");
  107. return false;
  108. }
  109. var row = grd_main.row;
  110. for ( var i = grd_main.fixedRows; i <= grd_main.rows; i++ ) {
  111. if ( grd_main.rowStatus(i)=='2' ) { //update..
  112. if ( grd_main.valueMatrix(i, grd_main.colRef("sangflag"))=="Y" ){
  113. //전표번호적용..
  114. grd_main.valueMatrix(i, grd_main.colRef("statementdate")) = ipt_statementdate.value;
  115. if ( grd_main.valueMatrix(i, grd_main.colRef("janamt")).length==0 || grd_main.valueMatrix(i, grd_main.colRef("janamt"))==0 ){
  116. messageBox("상계금액을" ,"C001");
  117. grd_main.row = i;
  118. grd_main.col = grd_main.colRef("janamt");
  119. grd_main.editCell();
  120. return false;
  121. }
  122. if ( ( parseInt(grd_main.valueMatrix(i, grd_main.colRef("gaamt"))) - parseInt(grd_main.valueMatrix(i, grd_main.colRef("hissumjanamt")) ) < grd_main.valueMatrix(i, grd_main.colRef("janamt"))) ) {
  123. messageBox("상계금액이 "+ (grd_main.valueMatrix(i, grd_main.colRef("gaamt")) - grd_main.valueMatrix(i, grd_main.colRef("hissumjanamt")))+" 보다 클 수 없습니다. 다시 " ,"C001");
  124. grd_main.row = i;
  125. grd_main.col = grd_main.colRef("janamt");
  126. grd_main.editCell();
  127. return false;
  128. }
  129. }
  130. }
  131. }
  132. //rtn = messageBox("", "Q002");
  133. //if(rtn != "6" ) return false;
  134. return true;
  135. }
  136. ]]>
  137. </script>
  138. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  139. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  140. <script type="javascript" src="../../../com/basiccodeweb/js/ZBC001.js"/>
  141. <script type="javascript" src="../../../mis/miscommonweb/js/MIS.js"/>
  142. <script type="javascript" src="../../../mis/humtrafactmngtweb/js/RPB001.js"/>
  143. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  144. <bind id="bind_cpt_gaamtsum" ref="/root/hidden/apsl/sumgaamt" calculate="sum(/root/main/maindatalist/gaamt)-sum(/root/main/maindatalist/janamt)"/>
  145. <submission id="TRRAR00201" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/maindatalist"/>
  146. <submission id="TXRAR00201" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/hidden/save" resultref="/root/temp"/>
  147. </model>
  148. </xhtml:head>
  149. <xhtml:body guideline="1,1194;" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  150. <group id="group1" style="left:0px; top:0px; width:1195px; height:13px; ">
  151. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:293px; height:14px; ">가수금 상계</caption>
  152. <caption id="caption4" class="patient_text_black" style="left:922px; top:0px; width:272px; "/>
  153. </group>
  154. <group id="group3" scroll="auto" style="left:0px; top:40; width:1195px; height:744px; ">
  155. <group id="grp_sea" style="left:0px; top:10px; width:1195px; height:38px; vertical-align:top; ">
  156. <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; "/>
  157. <button id="button2" class="btn1_letter2" navindex="4" style="left:1123px; top:9px; width:56px; height:22px; text-align:left; ">
  158. <caption>조회</caption>
  159. <script type="javascript" ev:event="DOMActivate">
  160. <![CDATA[
  161. fGetMainDataList();
  162. ]]>
  163. </script>
  164. </button>
  165. <line id="line5" class="line_4" style="x1:1107px; y1:8px; x2:1107px; y2:30px; border-color:#ffe4bb; border-left-style:solid; "/>
  166. <input id="ipt_statementdate" ref="/root/send/statementdate" class="input_s_essential" inputtype="date" format="yyyy-mm-dd" style="left:978px; top:9px; width:110px; height:19px; ">
  167. <script type="javascript" ev:event="xforms-value-changed">
  168. <![CDATA[
  169. var row = grd_main.row;
  170. for ( var i = grd_main.fixedRows; i <= grd_main.rows; i++ ) {
  171. grd_main.valueMatrix(i, grd_main.colRef("statementdate")) = ipt_statementdate.value;
  172. }
  173. //model.refresh();
  174. ]]>
  175. </script>
  176. </input>
  177. <caption id="caption3" class="search_name" style="left:886px; top:9px; width:104px; height:17px; ">전표일자 :</caption>
  178. <input id="ipt_gadate_fr" ref="/root/send/gadate_fr" class="input_s_essential" inputtype="date" format="yyyy-mm-dd" style="left:118px; top:9px; width:110px; height:19px; "/>
  179. <input id="ipt_gadate_to" ref="/root/send/gadate_to" class="input_s_essential" inputtype="date" format="yyyy-mm-dd" style="left:251px; top:9px; width:110px; height:19px; "/>
  180. <caption id="caption2" style="left:234px; top:9px; width:15px; height:17px; ">~</caption>
  181. <caption id="caption5" class="search_name" style="left:16px; top:9px; width:104px; height:17px; ">가수금일자 :</caption>
  182. </group>
  183. <line id="line3" class="line_1" style="x1:0px; y1:75px; x2:1194px; y2:75px; "/>
  184. <datagrid id="grd_main" nodeset="/root/main/maindatalist" dragmode="true" caption="예금계좌^보조과목^가수금일자^구분^적 요^가수금액^상계금액^전표^전표^이미상계된금액^instcd^line^seqline^적용할전표일^상계후실잔액" colsep="^" colwidth="120, 70, 90, 90, 190, 110, 110, 28, 70, 90, 0, 0, 0, 90, 90" ellipsis="true" explorerbar="sortshow" mergecellsfixedrows="bycolrec" rowheader="update" rowheight="16" rowsep="|" selectionmode="byrow" tooltip="true" style="left:0px; top:80px; width:1194px; height:635px; ">
  185. <col ref="aactno" style="text-align:center; "/>
  186. <col ref="aactcd" style="text-align:center; "/>
  187. <col ref="gadate" format="yyyy-mm-dd" style="text-align:center; "/>
  188. <col ref="gubun" style="text-align:center; "/>
  189. <col ref="rmrk"/>
  190. <col ref="gaamt" format="#,###" style="text-align:right; "/>
  191. <col class="input_s_essential" ref="janamt" type="input" format="#,###" style="text-align:right; "/>
  192. <col checkvalue="Y,N" ref="sangflag" type="checkbox"/>
  193. <col ref="sangflag_text"/>
  194. <col ref="hissumjanamt" format="#,###" style="text-align:right; "/>
  195. <col ref="instcd"/>
  196. <col ref="line"/>
  197. <col ref="seqline"/>
  198. <col ref="statementdate" format="yyyy-mm-dd" style="text-align:center; "/>
  199. <col ref="realjanamt" format="#,###" style="text-align:right; "/>
  200. <script type="javascript" ev:event="onaftersort">
  201. <![CDATA[
  202. grd_main.gridToInstance();
  203. ]]>
  204. </script>
  205. <script type="javascript" ev:event="xforms-value-changed">
  206. <![CDATA[
  207. if (grd_main.col == grd_main.colRef("sangflag") ) {
  208. if (grd_main.valueMatrix(grd_main.row, grd_main.colRef("sangflag")) == 'Y') { //가수금 - 이전상계금액합계
  209. grd_main.valueMatrix(grd_main.row, grd_main.colRef("janamt")) = grd_main.valueMatrix(grd_main.row, grd_main.colRef("gaamt")) - grd_main.valueMatrix(grd_main.row, grd_main.colRef("hissumjanamt"));
  210. grd_main.valueMatrix(grd_main.row, grd_main.colRef("statementdate")) = ipt_statementdate.value;
  211. } else {
  212. grd_main.valueMatrix(grd_main.row, grd_main.colRef("janamt")) = 0;
  213. }
  214. }
  215. if ( grd_main.col==grd_main.colRef("sangflag")||grd_main.col==grd_main.colRef("janamt") ) {
  216. grd_main.valueMatrix(grd_main.row, grd_main.colRef("realjanamt")) = parseInt(grd_main.valueMatrix(grd_main.row, grd_main.colRef("gaamt"))) - (parseInt(grd_main.valueMatrix(grd_main.row, grd_main.colRef("janamt"))) + parseInt(grd_main.valueMatrix(grd_main.row, grd_main.colRef("hissumjanamt")))) ;
  217. var sumjanamt = 0;
  218. for ( var i = grd_main.fixedRows; i <= grd_main.rows; i++ ) {
  219. if ( grd_main.valueMatrix(i, grd_main.colRef("sangflag"))=="Y" ){
  220. sumjanamt = sumjanamt + parseInt(grd_main.valueMatrix(i, grd_main.colRef("janamt")));
  221. }else{
  222. grd_main.removeStatus( i , "update");
  223. }
  224. }
  225. model.setValue("/root/hidden/apsl/sumjanamt", sumjanamt);
  226. }
  227. ]]>
  228. </script>
  229. <script type="javascript" ev:event="onmouseup">
  230. <![CDATA[
  231. // 2011.07.25 cyw Sangflag 컬럼에서 드레그시, 드레그 영역 자동체크&계산
  232. if( grd_main.col == grd_main.colRef("sangflag") ){
  233. if( grd_main.selectedRows > 1){
  234. for( var i = 0 ; i < grd_main.selectedRows ; i++ ){
  235. if(model.getValue("/root/main/maindatalist[" + grd_main.selectedRow(i) + "]/sangflag") == "N"){
  236. model.setValue("/root/main/maindatalist[" + grd_main.selectedRow(i) + "]/sangflag" , "Y");
  237. grd_main.rowStatus( grd_main.selectedRow(i) ) = 2;
  238. }else{
  239. model.setValue("/root/main/maindatalist[" + grd_main.selectedRow(i) + "]/sangflag" , "N");
  240. grd_main.removeStatus( grd_main.selectedRow(i) , "update");
  241. }
  242. if (grd_main.valueMatrix( grd_main.selectedRow(i), grd_main.colRef("sangflag")) == 'Y') { //가수금 - 이전상계금액합계
  243. grd_main.valueMatrix( grd_main.selectedRow(i), grd_main.colRef("janamt")) = grd_main.valueMatrix( grd_main.selectedRow(i), grd_main.colRef("gaamt")) - grd_main.valueMatrix( grd_main.selectedRow(i), grd_main.colRef("hissumjanamt"));
  244. grd_main.valueMatrix( grd_main.selectedRow(i), grd_main.colRef("statementdate")) = ipt_statementdate.value;
  245. } else {
  246. grd_main.valueMatrix( grd_main.selectedRow(i), grd_main.colRef("janamt")) = 0;
  247. }
  248. grd_main.valueMatrix( grd_main.selectedRow(i), grd_main.colRef("realjanamt")) = parseInt(grd_main.valueMatrix( grd_main.selectedRow(i), grd_main.colRef("gaamt"))) - (parseInt(grd_main.valueMatrix( grd_main.selectedRow(i), grd_main.colRef("janamt"))) + parseInt(grd_main.valueMatrix( grd_main.selectedRow(i), grd_main.colRef("hissumjanamt")))) ;
  249. var sumjanamt = 0;
  250. for ( var a = grd_main.fixedRows; a <= grd_main.rows; a++ ) {
  251. if ( grd_main.valueMatrix(a, grd_main.colRef("sangflag"))=="Y" ){
  252. sumjanamt = sumjanamt + parseInt(grd_main.valueMatrix(a, grd_main.colRef("janamt")));
  253. }
  254. }
  255. model.setValue("/root/hidden/apsl/sumjanamt", sumjanamt);
  256. }
  257. }
  258. }
  259. model.recalculate();
  260. model.refresh();
  261. ]]>
  262. </script>
  263. </datagrid>
  264. <button id="ipt_excsave" class="btn2_letter4" style="left:1127px; top:52px; width:64px; height:19px; ">
  265. <caption>엑셀저장</caption>
  266. <script type="javascript" ev:event="DOMActivate">
  267. <![CDATA[
  268. misfSaveExcel(grd_main);
  269. ]]>
  270. </script>
  271. </button>
  272. <caption id="caption21" class="tit_2" style="left:5px; top:57px; width:131px; height:13px; ">출력 목록</caption>
  273. </group>
  274. <group id="group4" scroll="auto" style="left:0px; top:13; width:1195px; height:27px; ">
  275. <button id="button39" class="btn4_letter2" style="left:1137px; top:3px; width:56px; height:22px; ">
  276. <caption>저장</caption>
  277. <script type="javascript" ev:event="DOMActivate">
  278. <![CDATA[
  279. if( fSetChackValue() ) { //저장시 입력data checking logic..
  280. rtn = messageBox("저장하시면 체크하신 DATA를 상계하면서 전표처리 합니다.","Q002");
  281. if ( rtn == "6" ) {
  282. //입력,수정,삭제된 data save node 에 담기..
  283. model.setValue("/root/hidden/save",grd_main.getUpdateData());
  284. if(submit("TXRAR00201")) {
  285. //전표입력창 띄우기
  286. model.makeValue("/root/source/slipinfo/instcd", model.getValue("/root/temp/unsllist/instcd"));
  287. model.makeValue("/root/source/slipinfo/slipdt", model.getValue("/root/temp/unsllist/statementdate")); //미결전표일자
  288. model.makeValue("/root/source/slipinfo/slipno", model.getValue("/root/temp/unsllist/unslno"));//미결전표번호
  289. model.refresh();
  290. modal("SMRAD08100","","","","","/root/source", "/root/target" );
  291. //opener.javascript.grd_unsl.rowStatus(1) = "2";
  292. button2.dispatch("DOMActivate");
  293. }
  294. }
  295. }
  296. ]]>
  297. </script>
  298. </button>
  299. <line id="line2" class="line_6" style="x1:0px; y1:25px; x2:1194px; y2:25px; "/>
  300. </group>
  301. <caption id="caption1" class="cell_1" style="left:534px; top:757px; width:120px; height:23px; text-align:center; vertical-align:middle; ">합 계</caption>
  302. <caption id="cpt_gaamtsum" ref="/root/hidden/apsl/sumgaamt" format="(-)#,###" style="left:655px; top:757px; width:110px; height:23px; text-align:right; vertical-align:middle; background-color:#ffcccc; "/>
  303. <caption id="cpt_janamtsum" ref="/root/hidden/apsl/sumjanamt" format="(-)#,###" style="left:766px; top:757px; width:120px; height:23px; text-align:right; vertical-align:middle; padding-right:2; background-color:#ffe79d; "/>
  304. <button id="btn_print" class="btn4_letter2" visibility="visible" style="left:1080px; top:16px; width:56px; height:22px; ">
  305. <caption>출력</caption>
  306. <script type="javascript" ev:event="DOMActivate">
  307. <![CDATA[
  308. exeReportPreview("SMRAR00201", "XMLSTR");
  309. ]]>
  310. </script>
  311. </button>
  312. </xhtml:body>
  313. </xhtml:html>