payResultList.jsp 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. <%--
  2. - FileName : payResultList.jsp
  3. - Author(s) : ok
  4. - Date : 2014.08.28
  5. - Copyright : Copyright (c) 2013 www.udapsoft.co.kr, Inc.
  6. - Description: 대금관리 구매 대금지급현황
  7. --%>
  8. <%@ page contentType="text/html; charset=utf-8" %>
  9. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  10. <%@ page import="com.udapsoft.waf.common.ui.*" %>
  11. <%@ page import="kr.co.hsnc.common.util.*"%>
  12. <%@ page import="kr.co.hsnc.common.sql.*" %>
  13. <%@ page import="com.udapsoft.waf.common.util.DateUtil" %>
  14. <%@ include file="/jsp/work/taglib.jsp" %>
  15. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  16. <%
  17. ctx.init(request, response);
  18. HandlerStorage storage = ctx.getHandlerStorage();
  19. ValueObject params = storage.getParams();
  20. ValueObject user = storage.getUser();
  21. String event = storage.getEvent();
  22. RowSet statusComboList = storage.getRowSet("statusComboList"); //상태 ComboList Data
  23. //상태 sheetComboList Data
  24. String statusSheetComboListText = (String)storage.getObject("selectText");
  25. String statusSheetComboListValue = (String)storage.getObject("selectValue");
  26. //검색조건 현장 설정
  27. String initSearchDeptCd = params.get("searchDeptCd");
  28. String initSearchDeptNm = params.get("searchDeptNm");
  29. //검색조건 계약명 설정
  30. String initSearchBuildName = params.get("searchBuildName");
  31. //검색조건 작성일
  32. String initSearchDateStart = params.get("searchDateStart");
  33. String initSearchDateEnd = params.get("searchDateEnd");
  34. //com.udapsoft.waf.common.util.DateUtil
  35. ValueObject defaultDate = DateUtil.getDefaultPeriod();
  36. if("".equals(initSearchDateStart)){
  37. initSearchDateStart = defaultDate.get("START_DATE");
  38. }
  39. if("".equals(initSearchDateEnd)){
  40. initSearchDateEnd = defaultDate.get("END_DATE");
  41. }
  42. //검색조건 상태 설정
  43. String initStatusCd = params.get("searchStatusCd");
  44. if(initStatusCd == null || initStatusCd == ""){
  45. initStatusCd = "";
  46. }
  47. %>
  48. <SCRIPT language="JavaScript">
  49. /*예약함수*/
  50. var sheet1;
  51. var sheet1Row;
  52. var sheet1PageNo = 1;
  53. var pageLastRowIndex = 1;
  54. var validationResult = false;
  55. var filterShow = false;
  56. function _onReady(){
  57. /**
  58. * IBSheet object initialize
  59. */
  60. gridInit(sheet1);
  61. autoResize();
  62. /**
  63. * Application Initialize
  64. */
  65. jQuery("#btnSearch").click(function() {
  66. if(jQuery("#searchDeptCd").val() == ""){
  67. alert("현장을 선택해주세요.");
  68. jQuery("#searchDeptCd").focus();
  69. return;
  70. }
  71. jQuery("#fevent").val("GET_DATA");
  72. var url = Modular.model.PageContext.CONTEXT_ROOT + "/payment/purchase/PayResultList_sheet.screen";
  73. Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 30, "");
  74. });
  75. pageinit();
  76. }
  77. function pageinit(){
  78. //달력 조건에 당해년도1월, 당해년도당월 셋팅
  79. setSearchDate();
  80. //jQuery("#btnSearch").click();
  81. }
  82. /**
  83. * IBSheet object initialize
  84. */
  85. function gridInit(sheetName){
  86. var init_sheet = {};
  87. init_sheet.Cfg = {SearchMode:2, Page:100, MergeSheet:7};
  88. init_sheet.Cols = [
  89. {Header:'상태|상태', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"True"},
  90. {Header:'현장명|현장명', Type:"Text", SaveName:"DEPT_NAME", Width:200, Align:"Left",Hidden:"True"},
  91. {Header:'계약번호|계약번호', Type:"Text", SaveName:"ORD_DOC_NO", Width:200, Align:"Left"},
  92. {Header:'계약명|계약명', Type:"Text", SaveName:"CST_DOC_NAME", Width:200, Align:"Left"},
  93. {Header:'업체명|업체명', Type:"Text", SaveName:"CORP_KOR", Width:200, Align:"Left"},
  94. {Header:'계약기간|계약기간', Type:"Text", SaveName:"ORD_DATE", Width:200, Align:"Left"},
  95. {Header:'계약금액|계약금액', Type:"Text", SaveName:"ORD_AMT", Width:100, Align:"Right" },
  96. {Header:'대금구분|대금구분', Type:"Text", SaveName:"PAY_DIV_NM", Width:80, Align:"Center", Hidden:""},
  97. {Header:'통화|통화', Type:"Text", SaveName:"CURRENCY_GB", Width:60, Align:"Center"},
  98. {Header:'지급구분|지급구분', Type:"Text", SaveName:"DEPOSIT_NM", Width:80, Align:"Center"},
  99. {Header:'지급차수|지급차수', Type:"Text", SaveName:"DEPOSIT_SEQ", Width:60, Align:"Center"},
  100. {Header:'증빙일자|증빙일자', Type:"Text", SaveName:"REQ_DATE", Width:80, Align:"Center"},
  101. {Header:'대금|선급공제액', Type:"AutoSum", SaveName:"CUR_PREPAY_APPLYAMT", Width:100, Align:"Right", Format:"Integer"},
  102. {Header:'대금|청구액', Type:"AutoSum", SaveName:"CUR_REQ_AMT", Width:100, Align:"Right", Format:"Integer"},
  103. {Header:'대금|잔여', Type:"Float", SaveName:"REMAINDER_ACMP_SUPPLYAMT",Width:100, Align:"Right", Format:"Float"},
  104. {Header:'대금|잔여', Type:"Float", SaveName:"REMAINDER_SUPPLYAMT", Width:100, Align:"Right", Format:"Float", Hidden:"True"},
  105. {Header:'대금|지급율', Type:"Float", SaveName:"CUR_ACMP_PERCENT", Width:50, Align:"Right", Format:"##0.00",Hidden:"True"},
  106. {Header:'상태|상태', Type:"Combo", SaveName:"REQ_STATUS", Width:70, Align:"Center", ComboText:"<%=statusSheetComboListText%>", ComboCode:"<%=statusSheetComboListValue%>"},
  107. {Header:'계약ID|계약ID', Type:"Text", SaveName:"PUR_CONT_ID", Width:70, Align:"Center", Hidden:"True"}
  108. ];
  109. init_sheet.HeaderMode = {Sort:1};
  110. IBS_InitSheet(sheetName, init_sheet);
  111. sheetName.SetDataAutoTrim(0);
  112. sheetName.SetEditable(false);
  113. var info = [{StdCol:2, SumCols:"CUR_PREPAY_APPLYAMT|CUR_REQ_AMT", ShowCumulate:0,Sort:0,CaptionCol:1}];
  114. //[{StdCol:13, SumCols:"CUR_REQ_AMT", ShowCumulate:0,Sort:0,CaptionCol:1}];
  115. //,{StdCol:2, SumCols:"CON_AMT|FUND_AMT|FUND_RATE", ShowCumulate:0,Sort:0,CaptionCol:2}];
  116. sheetName.ShowSubSum(info);
  117. sheetName.SetCountPosition(4);
  118. sheetName.SetActionMenu("ExcelDown");
  119. setGridSize();
  120. }
  121. function sheet1_OnSelectMenu(Text, Code) {
  122. // text 또는 code값으로 Action수행
  123. switch(Text) {
  124. case "ExcelDown":
  125. sheetExcelDown(sheet1,$('li').html());
  126. break;
  127. }
  128. }
  129. /**
  130. * IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
  131. */
  132. function sheet1_OnSearchEnd(code, message) {
  133. if(code == 0) {
  134. sheet1.SetSumValue(0,"합 계");
  135. sheet1.SetCellAlign(sheet1.LastRow(),0,"Center");
  136. sheet1.SetMergeCell (sheet1.LastRow(), 0, 1,2);
  137. var lr = sheet1.LastRow();
  138. var str = "";
  139. var startrow = 2;
  140. var endrow = 1;
  141. var backColor = "";
  142. var totalConAmtValue = 0;
  143. var totalModAmtValue = 0;
  144. var totalRatAmtValue = 0.00;
  145. for(var i=1; i <= lr; i++){
  146. str = sheet1.GetCellText(i,1);
  147. if(str.indexOf("소계:") > -1){
  148. sheet1.SetCellAlign(i,1,"Center");
  149. sheet1.SetCellText(i,1, "소계");
  150. //sheet1.SetRangeBackColor(i,1,i,12,"#e0ffff");
  151. //alert(startrow);
  152. //alert(endrow);
  153. sheet1.SetMergeCell(startrow , 1, endrow + 1, 1);
  154. sheet1.SetMergeCell(i,1,1,5);
  155. sheet1.SetMergeCell(i,7,1,2);
  156. //var remainderAcmpSupplyamt = sheet1.GetCellValue(i-1, "REMAINDER_ACMP_SUPPLYAMT"); //잔여
  157. var remainderAcmpSupplyamt = sheet1.GetCellValue(i-1, "REMAINDER_SUPPLYAMT"); //잔여
  158. var curAcmpPercent = sheet1.GetCellValue(i-1, "CUR_ACMP_PERCENT"); //지급율
  159. sheet1.SetCellValue(i, "REMAINDER_ACMP_SUPPLYAMT", remainderAcmpSupplyamt);
  160. sheet1.SetCellValue(i, "CUR_ACMP_PERCENT", curAcmpPercent.toFixed(2));
  161. totalConAmtValue = 0;
  162. totalModAmtValue = 0;
  163. totalRatAmtValue = 0.00;
  164. startrow = i + 1;
  165. }
  166. //var info = {Type: "Int", Align: "Right", Format:"Integer"};
  167. var info = {Type: "Float", Align: "Right", Format:"##0.00"};
  168. sheet1.InitCellProperty(i, "CUR_ACMP_PERCENT", info);
  169. var info2 = {Type: "Int", Align: "Right", Format:"Integer"};
  170. sheet1.InitCellProperty(i, "REMAINDER_ACMP_SUPPLYAMT", info2);
  171. }
  172. setGridSize();
  173. } else {
  174. //조회 에러 수행
  175. alert(message);
  176. }
  177. }
  178. /**
  179. * IBSheet Event: Save End(IBSheet 데이터 저장 CallBack)
  180. */
  181. function sheet1_OnSaveEnd(code, msg) {
  182. if(code >= 0) {
  183. alert("저장 성공");
  184. } else {
  185. alert(msg);
  186. }
  187. }
  188. /**
  189. * IBSheet Event: Click
  190. */
  191. function sheet1_OnClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  192. //masterSheetRow = Row;
  193. }
  194. /**
  195. * IBSheet size setting
  196. */
  197. function setGridSize() {
  198. sheet1.FitColWidth();
  199. }
  200. /**
  201. * IBSheet Event: DBLCLICK
  202. */
  203. function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  204. }
  205. function doResult(resultObj) {
  206. try {
  207. if( resultObj.getRequestEvent() == "" ) {
  208. if( resultObj.getSuccess() ) {
  209. var f = document.form1;
  210. f.action = "/main.screen";
  211. f.target = "_parent";
  212. f.submit();
  213. }
  214. else {
  215. dlgErrorMsg(resultObj);
  216. }
  217. document.form1.isSubmit = false;
  218. }else if( resultObj.getRequestEvent() == "GET_EHR_DATA" ) {
  219. if( resultObj.getSuccess() ) {
  220. alert("EHR Synchronize Complete");
  221. doSearch(document.all.sheet1);
  222. }
  223. else {
  224. dlgErrorMsg(resultObj);
  225. }
  226. document.form1.isSubmit = false;
  227. }
  228. }
  229. catch(errorObject) {
  230. showErrorDlg("doResult()", errorObject);
  231. }
  232. }
  233. function searchAccDept(p_dept_cd, p_dept_nm){
  234. result = window.showModalDialog(getDummyUrl('/lib/dlgSearchAccDept.screen'),'부서 찾기','dialogWidth:620px;dialogHeight:460px; center:yes; help:no; status:no; scroll:no; resizable:no');
  235. if( result == null ){
  236. document.form1.p_dept_cd.value = ""; //부서코드
  237. document.form1.p_dept_nm.value = ""; //부서명
  238. }else{
  239. document.form1.p_dept_cd.value = result[0]; //부서코드
  240. document.form1.p_dept_nm.value = result[1]; //부서명
  241. }
  242. }
  243. function doKeyPress() {
  244. if( event.keyCode == 13 ) {
  245. doSearch(document.all.sheet1)
  246. }
  247. }
  248. function calendar(thisDayObj){
  249. dlgCalendar(thisDayObj);
  250. }
  251. //검색조건에 기성년월 초기 설정
  252. function setSearchDate(){
  253. //검색조건 시작일
  254. var startDate = get_year() +'-'+ get_month() +'-'+ '01';
  255. if(jQuery('#searchDateStart').val() == ""){
  256. jQuery('#searchDateStart').val(startDate);
  257. }
  258. //검색조건 종료일
  259. var nowYearMonth = new Date( get_year(), get_month(), "");
  260. var lastDay = nowYearMonth.getDate();
  261. var endDate = get_year() +'-'+ get_month() +'-'+ lastDay;
  262. if(jQuery('#searchDateEnd').val() == ""){
  263. jQuery('#searchDateEnd').val(endDate);
  264. }
  265. }
  266. function sheet1_OnSmartResize(Width, Height) {
  267. sheet1.FitColWidth();
  268. autoResize();
  269. }
  270. function autoResize(){
  271. /* var t1_height = document.getElementById("t1").scrollHeight + 10;
  272. var iframeHeight= document.body.scrollHeight - t1_height;
  273. var iframeWidth= document.body.scrollWidth;
  274. sheet1.SetSheetHeight(iframeHeight); */
  275. var t1_height = document.getElementById("search-table").scrollHeight + document.getElementById("title").scrollHeight + 54;
  276. var iframeHeight= document.body.scrollHeight - t1_height;
  277. var iframeWidth= document.body.scrollWidth;
  278. sheet1.SetSheetHeight(iframeHeight);
  279. }
  280. function searchSite() {
  281. var win_id = "_searchSite";
  282. var link = "/lib/dlgSearchSpotDept_Unitcd.screen";
  283. link += "?pop_win_id="+win_id;
  284. fLayerPop(win_id, link, 550,500, '', '', 'NO');
  285. }
  286. function searchSiteClose(result) {
  287. if( result == null ){
  288. document.form1.searchDeptCd.value = ""; //부서코드
  289. document.form1.searchDeptNm.value = ""; //부서명
  290. }else{
  291. document.form1.searchDeptCd.value = result[0]; //부서코드
  292. document.form1.searchDeptNm.value = result[1]; //부서명
  293. }
  294. fLayerPopClose('_searchSite');
  295. }
  296. </SCRIPT>
  297. <modular:search id="form1">
  298. <modular:key id="fevent" />
  299. </modular:search>
  300. <BODY onresize="autoResize()" >
  301. <form id="form1" name="form1" method="post" modular:type="search">
  302. <INPUT type="hidden" name="fevent" id="fevent" value="">
  303. <div align="left" id="title">
  304. <ul>
  305. <li>대금지급현황</li>
  306. </ul>
  307. </div>
  308. <!-- 검색조건 영역 : 시작 -->
  309. <table id="search-table" class="search-form-table">
  310. <colgroup>
  311. <col width="100px">
  312. <col width="40%">
  313. <col width="100px">
  314. <col/>
  315. <col width="100px">
  316. </colgroup>
  317. <TR>
  318. <Th>현장</Th>
  319. <TD>
  320. <%--<%=InputText.getSiteCode("searchDeptCd", "searchDeptNm", "", user, initSearchDeptCd, initSearchDeptNm)%> --%>
  321. <%=InputText.getSiteCodeNew("searchDeptCd", "searchDeptNm", "", user, initSearchDeptCd, initSearchDeptNm)%>
  322. </TD>
  323. <Th>계약명</Th>
  324. <TD>
  325. <INPUT type="text" id="searchBuildName" name="searchBuildName" value="<%=initSearchBuildName%>" maxlength="50" class="input" style="IME-MODE : active;width:95%;" desc='계약명' onKeyPress="doKeyPress();">
  326. </TD>
  327. <TD class="button" rowspan="3">
  328. <!-- 검색버튼 영역 : 시작 -->
  329. <span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch">검색</a></span>
  330. <!-- 검색버튼 영역 : 종료 -->
  331. </TD>
  332. </TR>
  333. <TR>
  334. <Th>증빙일</Th>
  335. <TD>
  336. <%= InputText.get("searchDateStart", initSearchDateStart, 15, 10, "Center, date, PerSize, readonly", "date", "") %>
  337. <a href="JavaScript:calendar('searchDateStart');"><img src="/img/buyer/button/bt_calender.gif" alt="달력" border="0" align="absmiddle" /></a>
  338. &nbsp;~&nbsp;
  339. <%= InputText.get("searchDateEnd", initSearchDateEnd, 15, 10, "Center, date, PerSize, readonly", "date", "") %>
  340. <a href="JavaScript:calendar('searchDateEnd');"><img src="/img/buyer/button/bt_calender.gif" alt="달력" border="0" align="absmiddle" /></a>
  341. </TD>
  342. <th>상태</th>
  343. <td colspan="1">
  344. <%= HTMLMaker.getSelectTag(statusComboList, "DETAILCD", "DETAILNM", "searchStatusCd", "width:25%;height=18;", "<option value=''>--전체--</option>", initStatusCd) %>
  345. </td>
  346. </TR>
  347. <TR>
  348. <TH>업체명</TH>
  349. <TD colspan="3">
  350. <INPUT type="text" id="searchCorp" name="searchCorp" value="" maxlength="50" class="input" style="IME-MODE : active; width:42%;" desc='업체명' onKeyPress="doKeyPress();">
  351. </TD>
  352. </TR>
  353. </TABLE>
  354. <img src="/img/com/blank.gif" height="5px" />
  355. <div align="right" id="bugase">
  356. <ul>
  357. <li valign="bottom"><span style="color: red;">* 부가세별도</span></li>
  358. </ul>
  359. </div>
  360. <div id="sheet1_div" style="padding-top:5px; height: auto; min-height: 350px; overflow: auto;">
  361. <script>createIBSheet('sheet1','100%', '350px');</script>
  362. </div>
  363. </FORM>
  364. </body>