<%@ page contentType="text/html; charset=utf-8" %>
<%@ page import="kr.co.udapsoft.common.code.*" %>
<%
%>
<script>

function setStampDuty(){

	if( jQuery('#stamp_duty_issue_gb').val() == '00' ){
		jQuery("#stamp_duty_no").val('');
		jQuery("#stamp_duty_tax").val('');
		jQuery("#stamp_duty_date").val('');
		jQuery("#remark").val('');
		jQuery("#stamp_duty_no").prop("disabled", true);
		jQuery("#stamp_duty_tax").prop("disabled", true);
		jQuery("#remark").prop("disabled", true);
		jQuery("#stampCalImg").hide();
		jQuery("#search_spot_button_stamp").hide();
	}else {
		jQuery("#stamp_duty_no").prop("disabled", false);
		jQuery("#stamp_duty_tax").prop("disabled", false);
		jQuery("#remark").prop("disabled", false);
		jQuery("#stampCalImg").show();
		jQuery("#search_spot_button_stamp").show();
	}
	
}

function doAttachStampFile(obj){
	if(obj.value==''){
		alert("저장을 한 후 파일을 첨부할 수 있습니다.");
	}
	else if(obj != ''){ 
		viewFileListNew('PUR_STAMP_DUTY', obj.value, document.getElementById("attach_file_view_stamp"), "Y", "cont/purchase/stamp/<%=ContInfo.get("PUR_CONT_MOD_ID")%>", "_stampFile", "", "", "N");
	}
}


function stampDesc()
{
	var win_id = "_stampPopup";
	var link = "/cont/purchase/stampDescPopup.screen";
	    link += "?pop_win_id="+win_id;
	fLayerPop(win_id, link, 400,210, '', '', 'NO');
}

function downStampFile(){
	var url="/common/file/FileDownloadServlet?mode=fpDown";
	url += "&mode=fpDown";
	url += "&filePath=/userMenual";
	url += "&fileName=" + encodeURI("전자문서에_대한_인지세_납부방법_등에_관한_고시_(전문).hwp");
	url += "&fileRealName=stamp_duty.hwp";
	
		
		//window.open(url, "_fileDown", "toolbar=no, width=400, height=100, top=500, left=400, toolbar=no,directories=no,status=no,scrollbars=yes,resize=no,menubar=no,target=new")
		document.getElementById("fileDown").src=url;
}

</script>
<!-- 인지세 -->
<INPUT type="hidden" id="STAMP_DUTY_ID" name="STAMP_DUTY_ID" value="<%=ContInfo.get("STAMP_DUTY_ID") %>">
<div class="application-info  magT10">
	<div class="application-sub-title">
		<span class="title">인지세</span> <font color="red">※ 전자문서 계약자가 인지세무(과소) 납부시 가산세가 300% 부가됨</font> <a href="javascript:downStampFile()"><IMG src='/img/buyer/button/bt_change.gif' align="absmiddle"></a>
	</div>
</div>
<TABLE class="form-table">
	<colgroup>
		<col width="120px" />
		<col width="24%"/>
		<col width="120px" />
		<col width="24%"/>
		<col width="120px" />
		<col/>
	</colgroup>
  <TR height="25"> 
    <TH>발행주체</TH>
	<TD><%= CommCodeManager.getSelectCodeList("STAMP_DUTY_ISSUE_GB", "stamp_duty_issue_gb", "width:90px;height=18px;", "", ContInfo.get("STAMP_DUTY_ISSUE_GB"), " onchange='setStampDuty();'") %></TD>
	<TH>고유식별번호</TH>
	<TD><%= InputText.get("stamp_duty_no", ContInfo.get("STAMP_DUTY_NO"), 97, 50, "desc=고유식별번호,persize,hangule") %></TD>
	<TH>인지세액 <a href="javascript:stampDesc()"><IMG src='/img/buyer/button/q.gif' align="absmiddle"></a></TH>
	<TD><%= InputText.get("stamp_duty_tax", Formatter2.currency(ContInfo.getDouble("STAMP_DUTY_TAX"), 0), 97, 20, "desc=인지세액,persize,Number,right","number") %></TD> 	
  </TR>
  <TR height="25"> 
	<TH>발행일자</TH>
	<TD>
		<%= InputText.get("stamp_duty_date", Formatter2.formatDate(ContInfo.get("STAMP_DUTY_DATE"), "-"), 30, 10, "Center, date, PerSize, readonly", "date", "") %>
		<A href="JavaScript:dlgCalendar('stamp_duty_date');" id="stampCalImg"><IMG src="/img/supplier/template/bt_calender.gif" alt="달력" border="0" align="absmiddle"></A>
	</TD> 
	<TH>인지세사본</TH>
	<TD>
		<div id="attach_file_view_stamp" class="attach_file_view" style="width:80%; text-overflow:ellipsis; white-space: nowrap; overflow: hidden; float: left;">
			<%=FileManager.getFileListForDiv("PUR_STAMP_DUTY", ContInfo.get("PUR_CONT_MOD_ID")) %>
		</div>
		<div style="text-align: right;">
			<IMG id='search_spot_button_stamp' onClick="doAttachStampFile(document.form1.PUR_CONT_MOD_ID,1);" src='/img/buyer/button/bt_change.gif' border='0'  align="top" align='absmiddle' alt='[Attach File]' style='cursor:pointer;'>
		</div>
	</TD> 	
	<TH>비고</TH>
	<TD><%= InputText.get("remark", ContInfo.get("REMARK"), 97, 500, "desc=비고,persize,hangule") %></TD> 	
  </TR> 	
</TABLE>
<iframe id="fileDown" name="fileDown" style="display:none"></iframe>
<script>
setStampDuty();
</script>
