<%--
  - FileName   : purchaseRequestList.jsp
  - Author(s)  : ok
  - Date       : 2014.07.28
  - Copyright  : Copyright (c) 2014 www.udapsoft.co.kr, Inc.
  - Description: (전자조달.구매대금) 대금신청현황의 대금신규등록 팝업
--%>

<%@ page contentType="text/html; charset=utf-8" %>
<%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
<%@ page import="com.udapsoft.waf.common.ui.*" %>
<%@ page import="kr.co.hsnc.common.util.*"%>
<%@ page import="kr.co.hsnc.common.sql.*" %>
<%@ page import="kr.co.hsnc.common.util.Formatter"%>

<%@ include file="/jsp/work/taglib.jsp" %>
<jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
<%
	ctx.init(request, response);
	HandlerStorage storage = ctx.getHandlerStorage();
	ValueObject params = storage.getParams();
	ValueObject user = storage.getUser();
	String event = storage.getEvent();
	
    
%>

<script type="text/javascript">
<!--

	$(function(){
	    
	    $("#btn_close").click(function(){
	        winClose();
	    });
	    
	    $("#btn_save").click(function(){
	        
	        var f = document.form1;
	        
	        if(confirm("반려 하시겠습니까?"))
            {
	            $("#fevent").val("SAVE_DATA");
		        $("#status").val("50");
		        
		        submitXmlRequest("/payment/purchase/VendorPrintCheck_form.screen", "SAVE_DATA", f);
		        
            }
	    });
	    
	});
	
	function doResult(resultObj) 
	{
		try 
		{
		    if( resultObj.getRequestEvent() == "SAVE_DATA") 
		    {
		        if( resultObj.getSuccess() ) 
				{
					alert("반려 되었습니다.");
					document.form1.isSubmit = false;
					window.parent.$("#btn_list").click();
// 					winClose();
				}
				else 
				{
	// 				dlgErrorMsg(resultObj.getMessage);
					alert(resultObj.getValueObject().get("errMsg"));
					document.form1.isSubmit = false;
				}
		    }
		}
		catch(errorObject) 
		{
			showErrorDlg("doResult()", errorObject);
		}
	}

//-->
</script>


<modular:search id="form1">
	<modular:key id="fevent" />
</modular:search>
<BODY>
<form id="form1" name="form1" method="post" modular:type="search">
	<INPUT type="hidden" name="fevent" id="fevent" value="">
	<input type="hidden" name="status" id="status" value="">
	<input type="hidden" name="payreqId" id="payreqId" value="<%=params.get("payreqId")%>">
	
	
	<table border="0" cellspacing="0" cellpadding="0" style="width: 100%;">
			<td style="text-align: right; vertical-align: bottom;">
				<span class="btnSearch center"><a href="javascript:void(0);" id="btn_save">반려</a></span>
				<span class="btnSearch center"><a href="javascript:void(0);" id="btn_close">닫기</a></span>
			</td>
		</tr>
	</table>
	
	<div style="height: 10px;"></div>
	
	<!-- 검색조건 영역 : 시작 -->
	<table class="form-table" style="width: 100%">
		<colgroup>
			<col width="20%" />
			<col width="80%" />
		</colgroup>
		<tr height="25"> 
			<th>반려사유</th>
			<td>
					<textarea name="return_reson" id="return_reson" style="width:98%; height:53px; overflow-y:auto" maxlength="100" class="input byteChk ctrlTarget"></textarea>
			</td>					
  		</tr>
	</table>
	<!-- 검색조건 영역 : 종료 -->
</FORM>
</body>
