payRequestList.jsp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <%--
  2. - FileName : payRequestList.jsp
  3. - Author(s) : ok
  4. - Date : 2014.06.17
  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.udapsoft.common.code.*" %>
  12. <%@ page import="kr.co.hsnc.common.util.*"%>
  13. <%@ page import="kr.co.hsnc.common.sql.*" %>
  14. <%@page import="com.udapsoft.waf.common.util.DateUtil"%>
  15. <%@ include file="/jsp/work/taglib.jsp" %>
  16. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  17. <%
  18. ctx.init(request, response);
  19. HandlerStorage storage = ctx.getHandlerStorage();
  20. ValueObject params = storage.getParams();
  21. ValueObject user = storage.getUser();
  22. String event = storage.getEvent();
  23. RowSet statusComboList = storage.getRowSet("statusComboList"); //상태 ComboList Data
  24. //상태 sheetComboList Data
  25. String statusSheetComboListText = (String)storage.getObject("selectText");
  26. String statusSheetComboListValue = (String)storage.getObject("selectValue");
  27. //세금계산서 발행방법 구분
  28. String sTaxMethodComboListText = (String)storage.getObject("selectText1");
  29. String sTaxMethodComboListValue = (String)storage.getObject("selectValue1");
  30. //검색조건 현장 설정
  31. String initSearchDeptCd = params.get("searchDeptCd");
  32. String initSearchDeptNm = params.get("searchDeptNm");
  33. //검색조건 계약명 설정
  34. String initSearchBuildName = params.get("searchBuildName");
  35. //검색조건 작성일
  36. String initSearchDateStart = params.get("searchDateStart");
  37. String initSearchDateEnd = params.get("searchDateEnd");
  38. //거래처명
  39. String initSearchCorp = params.get("searchCorp");
  40. //com.udapsoft.waf.common.util.DateUtil
  41. ValueObject defaultDate = DateUtil.getDefaultPeriod();
  42. if("".equals(initSearchDateStart)){
  43. initSearchDateStart = defaultDate.get("START_DATE");
  44. }
  45. if("".equals(initSearchDateEnd)){
  46. initSearchDateEnd = defaultDate.get("END_DATE");
  47. }
  48. //검색조건 상태 설정
  49. String initStatusCd = params.get("searchStatusCd");
  50. if(initStatusCd == null || initStatusCd == ""){
  51. initStatusCd = "";
  52. }
  53. %>
  54. <SCRIPT language="JavaScript">
  55. /*예약함수*/
  56. var sheet1;
  57. var sheet1Row;
  58. var sheet1PageNo = 1;
  59. var pageLastRowIndex = 1;
  60. var validationResult = false;
  61. var filterShow = false;
  62. function _onReady(){
  63. gridInit(sheet1);
  64. autoResize();
  65. //검색버튼
  66. jQuery("#btnSearch").click(function() {
  67. jQuery("#fevent").val("GET_LIST");
  68. var url = Modular.model.PageContext.CONTEXT_ROOT + "/payment/purchase/PayRequestList_sheet.screen";
  69. Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 10, "");
  70. });
  71. //신규등록
  72. jQuery("#btnCreate").click(function() {
  73. var win_id = "PurchaseRequest";
  74. var link = "/payment/purchase/PurchaseRequestList.screen";
  75. link += "?pop_win_id="+win_id;
  76. link += "&searchDeptCd=" + jQuery("#searchDeptCd").val();
  77. link += "&searchDeptNm=" + jQuery("#searchDeptNm").val();
  78. //link += "&searchDateStart=" + jQuery("#searchDateStart").val();
  79. //link += "&searchDateEnd=" + jQuery("#searchDateEnd").val();
  80. link += "&pageDiv=1"; //1:조달, 2:포탈
  81. fLayerPop(win_id, link, 980, 400, '', '', 'NO');
  82. });
  83. pageinit();
  84. }
  85. //시트 설정
  86. function gridInit(sheetName){
  87. var init_sheet = {};
  88. init_sheet.Cfg = {SearchMode:2, Page:10, MergeSheet:msHeaderOnly};
  89. init_sheet.Cols = [
  90. //{Header:'☞삭제', Type:"DelCheck", SaveName:"DEL_CHECK", Width:50, Align:"Center", Hidden:"True"},
  91. {Header:'상태|상태', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"True"},
  92. {Header:'현장명|현장명', Type:"Text", SaveName:"DEPT_NAME", Width:130, Align:"Left"},
  93. {Header:'계약번호|계약번호', Type:"Text", SaveName:"ORD_DOC_NO", Width:110, Align:"Center"},
  94. {Header:'☞계약명|☞계약명', Type:"Text", SaveName:"CST_DOC_NAME", Width:130, Align:"Left"},
  95. {Header:'업체명|업체명', Type:"Text", SaveName:"CORP_KOR", Width:100, Align:"Left"},
  96. {Header:'대금구분|대금구분', Type:"Text", SaveName:"PAY_DIV_NM", Width:45, Align:"Center"},
  97. {Header:'지급구분|지급구분', Type:"Text", SaveName:"DEPOSIT_NM", Width:55, Align:"Center"},
  98. {Header:'증빙일자|증빙일자', Type:"Text", SaveName:"REQ_DATE", Width:50, Align:"Center"},
  99. {Header:'통화|통화', Type:"Text", SaveName:"CURRENCY_GB", Width:40, Align:"Center"},
  100. {Header:'계약금액|계약금액', Type:"Int", SaveName:"ORD_AMT", Width:70, Align:"Right", Format:"#,##0"},
  101. {Header:'기성고|청구금', Type:"Int", SaveName:"CURREQAMT", Width:70, Align:"Right", Format:"#,##0"},
  102. {Header:'기성고|선급공제', Type:"Int", SaveName:"CUR_REQ_AMT", Width:70, Align:"Right", Format:"#,##0"},
  103. {Header:'기성고|누계', Type:"Int", SaveName:"CUR_BEF_ACMP_AMT", Width:70, Align:"Right", Format:"#,##0"},
  104. {Header:'기성고|잔여', Type:"Int", SaveName:"REMAINDER_ACMP_AMT", Width:70, Align:"Right", Format:"#,##0"},
  105. {Header:'누계\n지급율|누계\n지급율', Type:"Float", SaveName:"CUR_ACMP_PERCENT", Width:40, Align:"Right", Format:"##0.0"},
  106. {Header:'세금계산서\n발행방법|세금계산서\n발행방법', Type:"Combo", SaveName:"TAX_METHOD_CD", Width:50, Align:"Center", ComboText:"<%=sTaxMethodComboListText%>", ComboCode:"<%=sTaxMethodComboListValue%>"},
  107. {Header:'상태|상태', Type:"Combo", SaveName:"REQ_STATUS", Width:60, Align:"Center", ComboText:"<%=statusSheetComboListText%>", ComboCode:"<%=statusSheetComboListValue%>"},
  108. {Header:'PUR_CONT_ID|PUR_CONT_ID', Type:"Text", SaveName:"PUR_CONT_ID", Width:0, Align:"Left", Hidden:"True"},
  109. {Header:'PAYREQ_ID', Type:"Text", SaveName:"PAYREQ_ID", Width:0, Align:"Left", Hidden:"True"}
  110. ];
  111. init_sheet.HeaderMode = {Sort:1};
  112. IBS_InitSheet(sheetName, init_sheet);
  113. sheetName.SetDataAutoTrim(0);
  114. sheetName.SetEditable(false);
  115. sheetName.SetDataLinkMouse("CST_DOC_NAME", 1);
  116. sheetName.SetActionMenu("ExcelDown");
  117. setGridSize();
  118. }
  119. function sheet1_OnSelectMenu(Text, Code) {
  120. // text 또는 code값으로 Action수행
  121. switch(Text) {
  122. case "ExcelDown":
  123. sheetExcelDown(sheet1,$('li').html());
  124. break;
  125. }
  126. }
  127. function sheet1_OnSearchEnd(code, message) {
  128. if(code == 0) {
  129. setGridSize();
  130. sheet1.SetColFontColor("CST_DOC_NAME", "#0000ff");
  131. } else {
  132. //조회 에러 수행
  133. alert(message);
  134. }
  135. }
  136. /**
  137. * IBSheet size setting
  138. */
  139. function setGridSize() {
  140. sheet1.FitColWidth();
  141. }
  142. /**
  143. * IBSheet Event: DBLCLICK
  144. */
  145. function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  146. if (sheet1.ColSaveName(Col) == "CST_DOC_NAME") {
  147. jQuery("#purContId").val(sheet1.GetCellValue(Row, "PUR_CONT_ID"));
  148. jQuery("#payreqId").val(sheet1.GetCellValue(Row, "PAYREQ_ID"));
  149. if(sheet1.GetCellValue(Row, "PAY_DIV_NM") == "계획분할"){
  150. jQuery("#fevent").val("");
  151. jQuery("#form1").attr("action", "/payment/purchase/PayInstallResult.screen");
  152. jQuery("#form1").attr("target", "_self");
  153. jQuery("#form1").attr("method", "post");
  154. jQuery("#form1").submit();
  155. }else if(sheet1.GetCellValue(Row, "PAY_DIV_NM") == "납품정산"){
  156. jQuery("#fevent").val("");
  157. jQuery("#form1").attr("action", "/payment/purchase/PayItemResult.screen");
  158. jQuery("#form1").attr("target", "_self");
  159. jQuery("#form1").attr("method", "post");
  160. jQuery("#form1").submit();
  161. }
  162. }
  163. }
  164. //페이지 초기처리
  165. function pageinit(){
  166. //검색조건의 작성일 일자 설정
  167. setSearchDate();
  168. }
  169. //엔터키 검색 실행
  170. function doKeyPress() {
  171. if( event.keyCode == 13 ) {
  172. $("#btnSearch").click();
  173. }
  174. }
  175. function doKeyPressEvent(param1, param2) {
  176. }
  177. //달력팝업
  178. function calendar(thisDayObj){
  179. dlgCalendar(thisDayObj);
  180. }
  181. //검색 조건에 작성일 일자 설정
  182. function setSearchDate(){
  183. //검색조건 시작일
  184. var startDate = get_year() +'-'+ get_month() +'-'+ '01';
  185. if(jQuery('#searchDateStart').val() == ""){
  186. jQuery('#searchDateStart').val(startDate);
  187. }
  188. //검색조건 종료일
  189. var nowYearMonth = new Date( get_year(), get_month(), "");
  190. var lastDay = nowYearMonth.getDate();
  191. var endDate = get_year() +'-'+ get_month() +'-'+ lastDay;
  192. if(jQuery('#searchDateEnd').val() == ""){
  193. jQuery('#searchDateEnd').val(endDate);
  194. }
  195. }
  196. function PurchaseRequestPopupClose(){
  197. //alert();
  198. setTimeout(function(){fLayerPopClose('PurchaseRequest');},100);
  199. jQuery("#btnSearch").click();
  200. }
  201. //콜백함수
  202. function doResult(resultObj) {
  203. try {
  204. if( resultObj.getRequestEvent() == "GET_EHR_DATA" ) {
  205. if( resultObj.getSuccess() ) {
  206. alert("EHR Synchronize Complete");
  207. doSearch();
  208. }
  209. else {
  210. dlgErrorMsg(resultObj);
  211. }
  212. document.form1.isSubmit = false;
  213. }
  214. }
  215. catch(errorObject) {
  216. showErrorDlg("doResult()", errorObject);
  217. }
  218. }
  219. //페이지 기본 등록 스크립트
  220. function sheet1_OnSmartResize(Width, Height) {
  221. sheet1.FitColWidth();
  222. autoResize();
  223. }
  224. function autoResize(){
  225. var t1_height = document.getElementById("search-table").scrollHeight + document.getElementById("bugase").scrollHeight + document.getElementById("title").scrollHeight + 24;
  226. var iframeHeight= document.body.scrollHeight - t1_height;
  227. var iframeWidth= document.body.scrollWidth;
  228. sheet1.SetSheetHeight(iframeHeight);
  229. }
  230. document.body.onresize = addEvent( document.body.onresize, "autoResize()");
  231. </SCRIPT>
  232. <modular:search id="form1">
  233. <modular:key id="fevent" />
  234. </modular:search>
  235. <form id="form1" name="form1" method="post" modular:type="search" style="width:100%;height:100%;">
  236. <INPUT type="hidden" name="fevent" id="fevent" value="">
  237. <INPUT type="hidden" name="purContId" id="purContId" value=""> <!-- 상세선택 key -->
  238. <INPUT type="hidden" name="payreqId" id="payreqId" value=""> <!-- 상세선택 key -->
  239. <div align="left" id="title">
  240. <ul>
  241. <li>구매_대금신청현황</li>
  242. </ul>
  243. </div>
  244. <!-- 검색조건 시작 -->
  245. <table id="search-table" class="search-form-table">
  246. <colgroup>
  247. <col width="100px" />
  248. <col width="40%"/>
  249. <col width="100px" />
  250. <col/>
  251. <col width="150px" />
  252. </colgroup>
  253. <tr>
  254. <th>현장</th>
  255. <td>
  256. <%--<%=InputText.getSiteCode("searchDeptCd", "searchDeptNm", "", user, initSearchDeptCd, initSearchDeptNm)%> --%>
  257. <%=InputText.getSiteCodeNew("searchDeptCd", "searchDeptNm", "", user, initSearchDeptCd, initSearchDeptNm)%>
  258. </td>
  259. <th>계약명</th>
  260. <td>
  261. <INPUT type="text" id="searchBuildName" name="searchBuildName" value="<%=initSearchBuildName%>" maxlength="50" class="input" style="IME-MODE : active;width:95%;" desc='계약명' onKeyPress="doKeyPress();">
  262. </td>
  263. <td class="button" rowspan="3">
  264. <span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch">검색</a></span>
  265. <span class="btnSearch center"><a href="javascript:void(0);" id="btnCreate">신규등록</a></span>
  266. </td>
  267. </tr>
  268. <tr>
  269. <th>증빙일</th>
  270. <td>
  271. <%= InputText.get("searchDateStart", initSearchDateStart, 15, 50, "Center, date, PerSize, readonly", "date", "") %>
  272. <a href="JavaScript:calendar('searchDateStart');"><img src="/img/buyer/button/bt_calender.gif" alt="달력" border="0" align="absmiddle" /></a>
  273. &nbsp;~&nbsp;
  274. <%= InputText.get("searchDateEnd", initSearchDateEnd, 15, 50, "Center, date, PerSize, readonly", "date", "") %>
  275. <a href="JavaScript:calendar('searchDateEnd');"><img src="/img/buyer/button/bt_calender.gif" alt="달력" border="0" align="absmiddle" /></a>
  276. </td>
  277. <th>상태</th>
  278. <td>
  279. <%= HTMLMaker.getSelectTag(statusComboList, "DETAILCD", "DETAILNM", "searchStatusCd", "width:50%;height=18;", "<option value=''>--전체--</option>", initStatusCd) %>
  280. </td>
  281. </TR>
  282. <TR>
  283. <TH>업체명</TH>
  284. <TD colspan="3">
  285. <INPUT type="text" id="searchCorp" name="searchCorp" value="<%=initSearchCorp%>" maxlength="50" class="input" style="IME-MODE : active; width:42%;" desc='업체명' onKeyPress="doKeyPress();">
  286. </TD>
  287. </TR>
  288. </tr>
  289. </table>
  290. <!-- 검색조건 종료 -->
  291. <img src="/img/com/blank.gif" height="5px" />
  292. <div align="right" id="bugase">
  293. <ul>
  294. <li valign="bottom"><span style="color: red;">* 부가세별도</span></li>
  295. </ul>
  296. </div>
  297. <div id="sheet1_div" style="padding-top:0px; height: auto; min-height: 350px; overflow: auto;">
  298. <script>createIBSheet('sheet1','100%', '350px');</script>
  299. </div>
  300. </FORM>