SMRST03500_기간별제조사별구입량현황.xrw 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.css" ?>
  3. <xhtml:html xmlns:ex="http://www.comsquare.co.kr/xforms/excel" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:ms="urn:schemas-microsoft-com:xslt" xmlns:my="http://www.comsquare.co.kr/example" 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" xmlns:cs="http://www.comsquare.co.kr/xforms">
  4. <xhtml:head>
  5. <xhtml:title>기간별제조사별구입량현황</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <init/>
  10. <send>
  11. <winfromdd/>
  12. <wintodd/>
  13. <flag/>
  14. </send>
  15. <temp/>
  16. <main>
  17. <list>
  18. <winqtylist/>
  19. </list>
  20. </main>
  21. </root>
  22. </instance>
  23. <script type="javascript" ev:event="xforms-ready">
  24. <![CDATA[
  25. //화면 Control을 초기화한다
  26. fInitialize();
  27. ]]>
  28. </script>
  29. <submission id="TRRST03501" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/list"/>
  30. </model>
  31. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  32. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  33. <script type="javascript" src="../../../mis/miscommonweb/js/MIS.js"/>
  34. <script type="javascript" src="../../../mis/miscommonweb/js/RSZ001.js"/>
  35. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  36. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  37. <script type="javascript">
  38. <![CDATA[
  39. var RetrYn = "Y";
  40. function fInitialize() {
  41. misfGridInit(grd_winqty);
  42. grd_winqty.rowHeight(0) = "20";
  43. grd_winqty.rowHeight(1) = "20";
  44. var curdate = new Date();//getCurrentDate();
  45. ipt_wintodd.value = curdate.getDateFormat();
  46. ipt_winfromdd.value = curdate.getAddDate(-1, "M").getDateFormat();
  47. //grd_winqty.mergecells = "bycol";
  48. // grid sum
  49. //grd_winqty.subtotalposition = "after";
  50. makeReportPreview(0, 0,1160,600, "grp_biz");
  51. btn_month.selected = "true";
  52. model.setValue("/root/send/flag", "mnth");
  53. model.toggle("case_grid");
  54. model.refresh();
  55. }
  56. function fRetrieve() {
  57. if (!validCondition()) {
  58. return;
  59. }
  60. model.removenodeset(grd_winqty.nodeset);//.substring(0, grd_winqty.nodeset.lastIndexOf("/")));
  61. model.removeNodeset("/root/properties/report/mainreport/params");
  62. fClearGrid(grd_winqty);
  63. grd_winqty.rebuildStyle();
  64. grd_winqty.refresh();
  65. model.refresh();
  66. //if (ipt_winfromdd.value == "20120128")
  67. // return;
  68. if (submit("TRRST03501")) {
  69. if (model.getValue("/root/send/flag") == "mnth") {
  70. fAfterRetrieve();
  71. } else {
  72. if (document.all("ivr_grp_biz")) {
  73. grp_biz.removeChild("ivr_grp_biz");
  74. }
  75. makeReportPreview(0, 0,1160,600, "grp_biz");
  76. exeReportPreview("RPRST03501", "XMLSTR", "", "", "", "", "", "", "", "", "", "grp_biz");
  77. }
  78. }
  79. model.refresh();
  80. }
  81. //조회후 그리드 셋팅
  82. function fAfterRetrieve() {
  83. var iCnt = getNodesetCount(grd_winqty.nodeset);
  84. for (var i = 1; i <= iCnt; i++) {
  85. switch (model.getValue(grd_winqty.nodeset+"["+ i +"]/lvl1") + "" + model.getValue(grd_winqty.nodeset+"["+ i +"]/lvl2") +"" + model.getValue(grd_winqty.nodeset+"["+ i +"]/lvl3") ) {
  86. case "110":
  87. grd_winqty.cellstyle("background-color", i, 2, i, 2) = "#ccffff";
  88. //grd_winqty.cellstyle("font-weight", i, 0, i, 1) = "bold";
  89. model.setValue(grd_winqty.nodeset+"["+ i +"]/winmm", "제조사별 누계");
  90. break;
  91. case "111":
  92. grd_winqty.cellstyle("background-color", i, 2, i, 5) = "#ffff99";
  93. grd_winqty.cellstyle("font-weight", i, 2, i, 5) = "bold";
  94. model.setValue(grd_winqty.nodeset+"["+ i +"]/prodcmpycdnm", "총 합계");
  95. break;
  96. case "001":
  97. model.setValue(grd_winqty.nodeset+"["+ i +"]/prodcmpycdnm", model.getValue(grd_winqty.nodeset+"["+ i +"]/winmm")+" 소계");
  98. grd_winqty.cellstyle("background-color", i, 1, i, 5) = "#ffff99";
  99. grd_winqty.cellstyle("font-weight", i, 1, i, 5) = "bold";
  100. break;
  101. }
  102. }
  103. //grd_winqty.rebuildStyle();
  104. grd_winqty.refresh();
  105. /*
  106. grd_winqty.subtotal("clear", 0, 0);
  107. grd_winqty.subtotalPosition = "below";
  108. grd_winqty.multitotals = true;
  109. // 총합계 ( sub합계보다 먼저 선언되어야한다.)
  110. grd_winqty.subtotal("sum", -1, 4, "format:#,###.0; ", "text-align:center;background-color:#ffff99; font-weight:bold; ", 2, "TOTAL");
  111. grd_winqty.subtotal("sum", -1, 5, "format:#,###.0; ", "text-align:center;background-color:#ffff99; font-weight:bold; ", 2, "TOTAL");
  112. // 구분별 합계 ( total 합계가 먼저 선언되어야한다)
  113. grd_winqty.subtotal("sum", 2, 4, "format:#,###.0; ", "text-align:center;background-color:#ffff99; font-weight:bold; ", 3, "SUB합계");
  114. grd_winqty.subtotal("sum", 2, 5, "format:#,###.0; ", "text-align:center;background-color:#ffff99; font-weight:bold; ", 3, "SUB합계");
  115. */
  116. }
  117. function fClearGrid(o) {
  118. for (var i = o.fixedRows; i <= o.rows; i++) {
  119. o.deleteRow(i);
  120. }
  121. }
  122. function validCondition() {
  123. if(ipt_winfromdd.value.length== 0 ) {
  124. messageBox("입고시작일자를 " ,"C001");
  125. model.setFocus("ipt_winfromdd");
  126. return false;
  127. }
  128. if(ipt_wintodd.value.length== 0 ) {
  129. messageBox("입고종료일자를 " ,"C001");
  130. model.setFocus("ipt_wintodd");
  131. return false;
  132. }
  133. return true;
  134. }
  135. ]]>
  136. </script>
  137. </xhtml:head>
  138. <xhtml:body style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  139. <group id="group1" style="left:0px; top:0px; width:1195; height:13px; ">
  140. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:189px; height:14px; ">기간별 제조사별 구입량 현황</caption>
  141. </group>
  142. <group id="group5" scroll="auto" style="left:0px; top:38px; width:1195px; height:744px; ">
  143. <group id="group6" style="left:0px; top:10px; width:1195px; height:35px; vertical-align:top; ">
  144. <shape id="roundrect3" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:0px; top:0px; width:1195px; height:35px; background-color:#fffbf2; border-color:#ffd799; "/>
  145. <caption id="caption2" class="search_name" style="left:13px; top:9px; width:86px; height:17px; ">입고일자 :</caption>
  146. <button id="btn_sea" class="btn1_letter2" navindex="3" style="left:1125px; top:7px; width:56px; height:22px; ">
  147. <caption>조회</caption>
  148. <script type="javascript" ev:event="DOMActivate">
  149. <![CDATA[
  150. misfMsterDetailRetrieve();
  151. fRetrieve();
  152. ]]>
  153. </script>
  154. </button>
  155. <input id="ipt_winfromdd" ref="/root/send/winfromdd" class="input_s_essential" navindex="1" inputtype="date" style="left:100px; top:9px; width:114px; height:19px; "/>
  156. <input id="ipt_wintodd" ref="/root/send/wintodd" class="input_s_essential" navindex="2" inputtype="date" style="left:238px; top:9px; width:114px; height:19px; "/>
  157. <caption id="caption22" style="left:220px; top:9px; width:15px; height:20px; font-weight:bold; vertical-align:middle; ">~</caption>
  158. </group>
  159. <switch id="sw_flag" class="sw_box" style="left:0px; top:74px; width:1195px; height:660px; border-style:solid; ">
  160. <case id="case_grid">
  161. <line id="line15" class="line_1" style="x1:0px; y1:26px; x2:1195px; y2:26px; "/>
  162. <caption id="caption3" class="tit_2" style="left:5px; top:5px; width:215px; height:14px; ">기간별 제조사별 구입량 현황</caption>
  163. <datagrid id="grd_winqty" nodeset="/root/main/winqtylist" caption="입고년^입고년월^제조사^입고수량^입고금액" colsep="^" colwidth="0,120,400,250,250" dataheight="25" extendlastcol="scroll" mergecells="bycol" mergecellsfixedcols="bycol" mergecellsfixedrows="bycolrec" rowheader="seq" rowheight="25" rowsep="|" style="left:0px; top:30px; width:1180px; height:610px; ">
  164. <col ref="winyy" visibility="hidden" format="####"/>
  165. <col ref="winmm" format="yyyy-mm" style="text-align:center; "/>
  166. <col ref="prodcmpycdnm" style="text-align:left; "/>
  167. <col ref="sumqty" format="###,###,###.##" style="text-align:right; "/>
  168. <col ref="sumamt" format="###,###,###.##" style="text-align:right; "/>
  169. </datagrid>
  170. <button id="button14" class="btn2_letter2" navindex="4" style="left:1145px; top:5px; width:42px; height:19px; ">
  171. <caption>엑셀</caption>
  172. <script type="javascript" ev:event="DOMActivate">
  173. <![CDATA[
  174. misfSaveExcel(grd_winqty,"기간별제조사별구입량현황");
  175. ]]>
  176. </script>
  177. </button>
  178. </case>
  179. <case id="case_report" selected="true">
  180. <group id="grp_biz" scroll="auto" style="left:0px; top:10px; width:1175px; height:620px; "/>
  181. </case>
  182. </switch>
  183. <button id="btn_prod" class="btn_sw" group="tab" style="left:95px; top:49px; width:100px; height:22px; ">
  184. <caption>거래처 별</caption>
  185. <toggle case="case_report" ev:event="onclick"/>
  186. <script type="javascript" ev:event="onclick">
  187. <![CDATA[
  188. model.setValue("/root/send/flag", "prod");
  189. btn_sea.dispatch("DOMActivate");
  190. ]]>
  191. </script>
  192. </button>
  193. <button id="btn_month" class="btn_sw" group="tab" style="left:0px; top:49px; width:95px; height:22px; ">
  194. <caption>월별</caption>
  195. <toggle case="case_grid" ev:event="onclick"/>
  196. <script type="javascript" ev:event="onclick">
  197. <![CDATA[
  198. model.setValue("/root/send/flag", "mnth");
  199. btn_sea.dispatch("DOMActivate");
  200. ]]>
  201. </script>
  202. </button>
  203. </group>
  204. <group id="group4" scroll="auto" style="left:0px; top:12; width:1195px; height:27px; ">
  205. <button id="button34" class="btn6_letter2" visibility="hidden" style="left:0; top:3px; width:56px; height:22px; ">
  206. <caption>출력</caption>
  207. </button>
  208. <line id="line17" class="line_6" style="x1:0px; y1:25; x2:1195; y2:25; "/>
  209. </group>
  210. </xhtml:body>
  211. </xhtml:html>