<%--
  - FileName   : suppPayItemRequest.jsp
  - Author(s)  : ok
  - Date       : 2014.06.17
  - 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"%>
<%@ page import="com.udapsoft.waf.common.util.Formatter2"%>

<%@ 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();
	
	
	RowSet perpayReqDivComboList = storage.getRowSet("perpayReqDivComboList"); //신청구분 ComboList Data
	RowSet warrList = storage.getRowSet("contOutWarr");	//보증정보
/*	
	ValueObject file_giveup = storage.getValueObject("PREPAYMENTS_GIVEUP");
	ValueObject file_taxbill = storage.getValueObject("TAX_BILL");

*/

	ValueObject prePayment = storage.getValueObject("prePayment");			//기본정보, 세금계산서정보, 선급금정보 
	RowSet prePaymentList = storage.getRowSet("prePaymentList");	//대금내역
	
    String check1 = "";
    String check2 = "";
    String check3 = "";
    String checkString = "";
    if("3".equals(prePayment.get("TAX_METHOD_CD"))){
    	check3 = "checked";
    	checkString = "Invoice";
    }else if("2".equals(prePayment.get("TAX_METHOD_CD"))){
    	check2 = "checked";
    	checkString = "순발행(업체직접 발행)";
    }else{
    	check1 = "checked";
    	checkString = "역발행(SGC이앤씨 발행)";
    }

	String digit = (String)prePayment.get("digit");
	int intDigit = Integer.parseInt(digit);
  
    //기타 첨부서류
	RowSet purchaseFileRow = storage.getRowSet("purchaseFileRow");
    
	String taxChargNm = "";
	String taxChargHp = "";
	String taxChargEmail = "";
	if(prePayment.get("TAX_CHARG_NM").equals("")){
		taxChargNm = user.get("REP_NAME");	
		taxChargHp = user.get("HP1")+"-"+user.get("HP2")+"-"+user.get("HP3");	
		taxChargEmail = user.get("EMAIL");	
	}else{
		taxChargNm = prePayment.get("TAX_CHARG_NM");
		taxChargHp = prePayment.get("TAX_CHARG_HP");
		taxChargEmail = prePayment.get("TAX_CHARG_EMAIL"); 				
	}
	
     
    
    
%>
<SCRIPT language="JavaScript">
	/*예약함수*/
	var sheet1;
	var sheet1Row;
	var sheet1PageNo = 1;
	var pageLastRowIndex = 1;
	var validationResult = false;
	var filterShow = false;
	
	var g_digit = <%= intDigit %>;			// 소숫점 이하 자릿수
	
	function _onReady(){
		
		gridInit(sheet1);

		//리스트 페이지 이동
		jQuery("#btnList").click(function() {
		
			jQuery("#fevent").val("");
			jQuery("#form1").attr("action", "/portal/payment/SuppPayRequestList.screen");
			jQuery("#form1").attr("target", "_self");
			jQuery("#form1").attr("method", "post");
			jQuery("#form1").submit();
		});
		 

		jQuery("#btnDelete").click(function() {
			var f = document.form1;
			//필수 입력항목 check
			if(jQuery("#prepayId").val() == ""){
				alert("삭제되었습니다.");
				return;
			}
			//입력데이터 저장 
			if (confirm("삭제 하시겠습니까?")) {
				jQuery("#fevent").val("DELETE_DATA");
				submitXmlRequest("/portal/payment/SuppPayItemRequests_form.screen", "DELETE_DATA", f, "SUCCESS");
			}
		});		

		jQuery("#btnSave").click(function() {
		
			var f = document.form1;
			jQuery("#fevent").val("SAVE_DATA");
			//필수 입력항목 check
			if(requiredItemsCheck() == false){
				return;
			}
			//입력데이터 저장 
			if (confirm("저장 하시겠습니까?")) {
				submitXmlRequest("/portal/payment/SuppPayItemRequests_form.screen", "SAVE_DATA", f, "SUCCESS");
			}
		}); 
		
		jQuery("#btnAppReq").click(function() {
			
			//첨부파일Check
			ChkAttch();
		});		
		
		//반려
		jQuery("#btnRejection").click(function() {
/* 			var param = "";
			var param = "?payreqId=" + jQuery("#payreqId").val();
			param = param + "&pageDiv=2";	//0:선급, 1:기성, 2:대금(납품,설치), 3:대금(선급금)
			
 			var url = "/payment/outside/RejectionPopup.screen"+param;
			result = window.showModalDialog(url,'rejection','dialogWidth:600px;dialogHeight:250px;center:yes;help:no;status:no;scroll:no;resizable:no');
			if(result != null){
				if(result[0] == "1"){
					reDisplay();
					//goList();	
				}
			} */
		});
		
		//결재
		jQuery("#btnApproval").click(function() {
			//if (!dlgConfirm("기성결재를  진행하시겠습니까?")) {
				//return;
			//}
			//var f = document.form1;
			//submitXmlRequest("/payment/outside/AdvencePayment_form.screen", "APPROVAL", f, "SUCCESS");
		});	
		
		
		//jQuery("#curAcmpVat, #curPrepayApplyamt, #curPrepayVat").blur(function () {
		jQuery("#curPrepayApplyamt_notUse").blur(function () {
			
 			var conConAmtVal = jQuery("#conConAmt").val().replace(/(\,|\:)/g,"");				//계약금
 			var conConVatVal = conConAmtVal /100 * 10;											//계약금 부가세
 			var conPrepayAmtVal = jQuery("#conPrepayAmt").val().replace(/(\,|\:)/g,"");			//선급금액
 			var conPrepayVatVal = conPrepayAmtVal /100 * 10;									//선급금액 부가세
 			
			//전회 청구
 			var befAcmpApplyAmtVal = jQuery("#befAcmpApplyAmt").val().replace(/(\,|\:)/g,"");	//전회 청구 공급가액
 			var befAcmpVatVal = jQuery("#befAcmpVat").val().replace(/(\,|\:)/g,"");				//전회 청구 부가세
 			var befAcmpAmtVal = jQuery("#befAcmpAmt").val().replace(/(\,|\:)/g,"");				//전회 청구 합계
 			var befAcmpPercentVal = jQuery("#befAcmpPercent").val().replace(/(\,|\:)/g,"");		//전회 청구 지급율
 			
 			var curAcmpApplyamtVal = jQuery("#curAcmpApplyamt").val().replace(/(\,|\:)/g,"");	//금회 청구 공급가액
 			var befPrepayApplyAmtVal = jQuery("#befPrepayApplyAmt").val().replace(/(\,|\:)/g,"");	//전회 선급 공급가액
 			//금회 선급
 			var curPrepayApplyamtVal = jQuery("#curPrepayApplyamt").val().replace(/(\,|\:)/g,"");	//금회 선급 공급가액
 			var curBefPrepaySupplyamtVal = parseFloat(befPrepayApplyAmtVal) + parseFloat(curPrepayApplyamtVal);	//누계 선급 공급가액
 			
 			if(curPrepayApplyamtVal == ""){
 				curPrepayApplyamtVal = 0;
 				jQuery("#curPrepayApplyamt").val(0);	
 			}else{
 				
 				var reqPrepaySamtVal = jQuery("#reqPrepaySamt").val().replace(/(\,|\:)/g,"");		//선급금 청구금액 공급가
 				if(parseFloat(curBefPrepaySupplyamtVal) > parseFloat(reqPrepaySamtVal)  ){
 					alert("선급금 청구금액 공급가 보다 선급금공제액이 큽니다.");
 					curPrepayApplyamtVal = jQuery("#orgCurPrepayApplyamt").val();
 					jQuery("#curPrepayApplyamt").val(curPrepayApplyamtVal);
 					jQuery("#curPrepayApplyamt").focus();
 				}else{
 				
	 				if(parseFloat(curPrepayApplyamtVal) > parseFloat(curAcmpApplyamtVal) ){	//입력한 선급금공제금액이 금회기성고공급가액보다 클수 없다.
	 					alert("선급금 공제액이 금회 기성고보다 큽니다.");
	 					curPrepayApplyamtVal = jQuery("#orgCurPrepayApplyamt").val();
	 					jQuery("#curPrepayApplyamt").val(curPrepayApplyamtVal);
	 					jQuery("#curPrepayApplyamt").focus();
	 				}else{
	 					
	 					jQuery("#curPrepayApplyamt").val(curPrepayApplyamtVal);	//입력한 선급금공제 금회 공급가액 표시 
	 					
	 					if( jQuery("#bugase").val() == "INPUT_VAT" ){	//분계유형에따른 부가세 계산
	 						var bugaseVal = curAcmpApplyamtVal / 100 * 10;
	 						jQuery("#curAcmpVat").val(bugaseVal);		//기성고 금회 부가세
	 						
	 						var bugaseVatVal = curPrepayApplyamtVal / 100 * 10;
	 						jQuery("#curPrepayVat").val(bugaseVatVal);	//선급금공제 금회 부가세
	 						
	 					}else{
	 						
	 						jQuery("#curAcmpVat").val("0");		//기성고 금회 부가세
	 						jQuery("#curPrepayVat").val("0");	//선급금공제 금회 부가세
	 					}
	 				}
 				}
 			}			
			
 			//금회 청구
			
			var curAcmpVatVal = jQuery("#curAcmpVat").val().replace(/(\,|\:)/g,"");				//금회 청구 부가세
 			if(curAcmpVatVal == ""){
 				curAcmpVatVal = 0;
 				jQuery("#curAcmpVat").val(0);	
 			}else{
 				jQuery("#curAcmpVat").val(curAcmpVatVal);	
 			}
			
			var curAcmpAmtVal =  parseFloat(curAcmpApplyamtVal) + parseFloat(curAcmpVatVal);	//금회 청구 합계
			jQuery("#curAcmpAmt").val(curAcmpAmtVal);	
 			jQuery("#curAcmpAmt, #curAcmpVat").each(function(index){
				jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
			});
 			var curAcmpPercentVal = parseFloat(curAcmpApplyamtVal) / parseFloat(conConAmtVal) * 100;	//금회 청구 지급율
 			jQuery("#curAcmpPercent").val(curAcmpPercentVal.toFixed(1));

 			//누계 청구
 			var curBefAcmpSupplyamtVal = parseFloat(befAcmpApplyAmtVal) + parseFloat(curAcmpApplyamtVal);	//누계 청구 공급가액
 			jQuery("#curBefAcmpSupplyamt").val(curBefAcmpSupplyamtVal);
 			var curBefAcmpVatVal = parseFloat(befAcmpVatVal) + parseFloat(curAcmpVatVal);	//누계 청구 부가세
 			jQuery("#curBefAcmpVat").val(curBefAcmpVatVal);
			var curBefAcmpAmtVal =  parseFloat(curBefAcmpSupplyamtVal) + parseFloat(curBefAcmpVatVal);	//누계 청구 합계
			jQuery("#curBefAcmpAmt").val(curBefAcmpAmtVal);
 			var curBefAcmpPercentVal = parseFloat(curBefAcmpSupplyamtVal) / parseFloat(conConAmtVal) * 100;	//누계 청구 지급율
 			jQuery("#curBefAcmpPercent").val(curBefAcmpPercentVal.toFixed(1));
 			jQuery("#curBefAcmpSupplyamt, #curBefAcmpVat, #curBefAcmpAmt").each(function(index){
				jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
			});

 			//잔여 청구
 			var remainderAcmpSupplyamtVal = parseFloat(conConAmtVal) - parseFloat(curBefAcmpSupplyamtVal);	//잔여 청구 공급가액
 			jQuery("#remainderAcmpSupplyamt").val(remainderAcmpSupplyamtVal);	
 			var remainderAcmpVatVal = parseFloat(conConVatVal) - parseFloat(curBefAcmpVatVal);		//잔여 청구 부가세
 			jQuery("#remainderAcmpVat").val(remainderAcmpVatVal);
 			var remainderAcmpAmtVal = parseFloat(remainderAcmpSupplyamtVal) + parseFloat(remainderAcmpVatVal);	//잔여 청구 합계
 			jQuery("#remainderAcmpAmt").val(remainderAcmpAmtVal);
 			var remainderAcmpPercentVal = parseFloat(remainderAcmpSupplyamtVal) / parseFloat(conConAmtVal) * 100;	//누계 청구 지급율
 			jQuery("#remainderAcmpPercent").val(remainderAcmpPercentVal.toFixed(1));
 			jQuery("#remainderAcmpSupplyamt, #remainderAcmpVat, #remainderAcmpAmt").each(function(index){
				jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
			});
 			
 			//전회 선급
 			var befPrepayVatVal = jQuery("#befPrepayVat").val().replace(/(\,|\:)/g,"");				//전회 선급 부가세
 			var befPrepayAmtVal = jQuery("#befPrepayAmt").val().replace(/(\,|\:)/g,"");				//전회 선급 합계
 			var befPrepayPercentVal = jQuery("#befPrepayPercent").val().replace(/(\,|\:)/g,"");		//전회 선급 지급율 		
 			
 			var curPrepayVatVal = jQuery("#curPrepayVat").val().replace(/(\,|\:)/g,"");	//금회 선급 부가세
 			if(curPrepayVatVal == ""){
 				curPrepayVatVal = 0;
 				jQuery("#curPrepayVat").val(0);	
 			}else{
 				jQuery("#curPrepayVat").val(curPrepayVatVal);	
 			}
 			var curPrepayDeductamtVal =  parseFloat(curPrepayApplyamtVal) + parseFloat(curPrepayVatVal);	//금회 선급 합계
 			jQuery("#curPrepayDeductamt").val(curPrepayDeductamtVal);
 			
 			if(parseFloat(curPrepayApplyamtVal) == "0"){
 				var curPrepayPercentVal = 0.0;	//금회 선급 지급율
 			}else{
 				var curPrepayPercentVal = parseFloat(curPrepayApplyamtVal) / parseFloat(conPrepayAmtVal) * 100;	//금회 선급 지급율
 			}
 			jQuery("#curPrepayPercent").val(curPrepayPercentVal.toFixed(1));
 			
 			jQuery("#curPrepayApplyamt, #curPrepayVat, #curPrepayDeductamt").each(function(index){
				jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
			});

 			//누계 선급
 			jQuery("#curBefPrepaySupplyamt").val(curBefPrepaySupplyamtVal);
 			var curBefPrepayVatVal = parseFloat(befPrepayVatVal) + parseFloat(curPrepayVatVal);	//누계 선급 부가세
 			jQuery("#curBefPrepayVat").val(curBefPrepayVatVal);
			var curBefPrepayAmtVal =  parseFloat(befPrepayAmtVal) + parseFloat(curPrepayDeductamtVal);	//누계 청구 합계
			jQuery("#curBefPrepayAmt").val(curBefPrepayAmtVal);
 			
			if(parseFloat(curBefPrepaySupplyamtVal) == "0"){
				var curBefPrepayPercentVal = 0.0;	//누계 선급 지급율
 			}else{
 				var curBefPrepayPercentVal = parseFloat(curBefPrepaySupplyamtVal) / parseFloat(conPrepayAmtVal) * 100;	//누계 선급 지급율
 			}
 			
 			jQuery("#curBefPrepayPercent").val(curBefPrepayPercentVal.toFixed(1));
 			jQuery("#curBefPrepaySupplyamt, #curBefPrepayVat, #curBefPrepayAmt").each(function(index){
				jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
			});
			
 			//잔여 선급
 			var remainderPrepaySupplyamtVal = parseFloat(conPrepayAmtVal) - parseFloat(curBefPrepaySupplyamtVal);	//잔여 선급 공급가액

 			jQuery("#remainderPrepaySupplyamt").val(remainderPrepaySupplyamtVal);	
 			var remainderPrepayVatVal = parseFloat(conPrepayVatVal) - parseFloat(curBefPrepayVatVal);		//잔여 선급 부가세
 			jQuery("#remainderPrepayVat").val(remainderPrepayVatVal);
 			var remainderPrepayAmtVal = parseFloat(remainderPrepaySupplyamtVal) + parseFloat(remainderPrepayVatVal);	//잔여 선급 합계
 			jQuery("#remainderPrepayAmt").val(remainderPrepayAmtVal);
			if(parseFloat(remainderPrepaySupplyamtVal) == "0"){
				var remainderPrepayPercentVal = 0.0;	//잔여 선급 지급율
 			}else{
 				var remainderPrepayPercentVal = parseFloat(remainderPrepaySupplyamtVal) / parseFloat(conPrepayAmtVal) * 100;	//잔여 선급 지급율
 			}
 			jQuery("#remainderPrepayPercent").val(remainderPrepayPercentVal.toFixed(1));
 			jQuery("#remainderPrepaySupplyamt, #remainderPrepayVat, #remainderPrepayAmt").each(function(index){
				jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
			});
 			
 			//전회 실지급
 			var payedApplyamtVal = parseFloat(befAcmpApplyAmtVal) - parseFloat(befPrepayApplyAmtVal);	//전회 실지급 공급가액
 			jQuery("#payedApplyamt").val(payedApplyamtVal);
 			var payedVatVal = parseFloat(befAcmpVatVal) - parseFloat(befPrepayVatVal);	//전회 실지급 부가세
 			jQuery("#payedVat").val(payedVatVal);
 			var payedAmtVal = parseFloat(payedApplyamtVal) + parseFloat(payedVatVal);	//전회 실지급 합계
 			jQuery("#payedAmt").val(payedAmtVal);
 			var payedPercentVal = parseFloat(payedApplyamtVal) / parseFloat(conConAmtVal) * 100;	//전회 실지급 지급율
 			jQuery("#payedPercent").val(payedPercentVal.toFixed(1));
 			jQuery("#payedApplyamt, #payedVat, #payedAmt").each(function(index){
				jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
			});
 			
 			//금회 실지급
 			var curReqAmtVal	=	parseFloat(curAcmpApplyamtVal) - parseFloat(curPrepayApplyamtVal);	//금회 실지급 공급가액
 			jQuery("#curReqAmt").val(curReqAmtVal);
 			//var curReqVatamtVal	=	parseFloat(curAcmpVatVal) - parseFloat(curPrepayVatVal);	//금회 실지급 부가세
 			if( jQuery("#bugase").val() == "INPUT_VAT" ){	//분계유형에따른 부가세 계산
 				var curReqVatamtVal	= curReqAmtVal / 100 * 10;	//금회 실지급 부가세
 			}else{
 				var curReqVatamtVal	= 0;	//금회 실지급 부가세
 			}
 			jQuery("#curReqVatamt").val(curReqVatamtVal);
 			var curReqApplyamtVal = parseFloat(curReqAmtVal) + parseFloat(curReqVatamtVal);	//금회 실지급 합계
 			jQuery("#curReqApplyamt").val(curReqApplyamtVal);
 			var curReqPercentVal = parseFloat(curReqAmtVal) / parseFloat(conConAmtVal) * 100;	//금회 실지급 지급율
 			jQuery("#curReqPercent").val(curReqPercentVal.toFixed(1));
 			jQuery("#curReqAmt, #curReqVatamt, #curReqApplyamt").each(function(index){
				jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
			});
 			
 			//누계 실지급
 			var curPayedSupplyamtVal	= parseFloat(curBefAcmpSupplyamtVal) - parseFloat(curBefPrepaySupplyamtVal);	//누계 실지급 공급가액
 			jQuery("#curPayedSupplyamt").val(curPayedSupplyamtVal);
 			var curPayedVatVal			= parseFloat(curBefAcmpVatVal) - parseFloat(curBefPrepayVatVal);	//누계 실지급 부가세
 			jQuery("#curPayedVat").val(curPayedVatVal);
 			var curPayedAmtVal			= parseFloat(curPayedSupplyamtVal) + parseFloat(curPayedVatVal);	//누계 실지급 합계
 			jQuery("#curPayedAmt").val(curPayedAmtVal);
 			var curPayedPercentVal		= parseFloat(curPayedSupplyamtVal) / parseFloat(conConAmtVal) * 100;	//누계 실지급 지급율
 			jQuery("#curPayedPercent").val(curPayedPercentVal.toFixed(1));
 			jQuery("#curPayedSupplyamt, #curPayedVat, #curPayedAmt").each(function(index){
				jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
			});
 			
 			//잔여 실지급
 			var remainderSupplyamtVal	=	parseFloat(remainderAcmpSupplyamtVal) - parseFloat(remainderPrepaySupplyamtVal);	//잔여 실지급 공급가액
 			jQuery("#remainderSupplyamt").val(remainderSupplyamtVal);
 			var remainderVatVal			=	parseFloat(remainderAcmpVatVal) - parseFloat(remainderPrepayVatVal);				//잔여 실지급 부가세
 			jQuery("#remainderVat").val(remainderVatVal);
 			var remainderAmtVal			=	parseFloat(remainderSupplyamtVal) + parseFloat(remainderVatVal);	//잔여 실지급 합계
 			jQuery("#remainderAmt").val(remainderAmtVal);
 			var remainderPercentVal		=	parseFloat(remainderSupplyamtVal) / parseFloat(conConAmtVal) * 100;	//잔여 실지급 지급율
 			jQuery("#remainderPercent").val(remainderPercentVal.toFixed(1));
 			jQuery("#remainderSupplyamt, #remainderVat, #remainderAmt").each(function(index){
				jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
			});
 			
 			
 			//잔여가 0이면 잔급으로 설정
 			setDepostiCd();
 			
			//하자이행율이 100%이상이면 보증정보 표시
			setGuarOutList();
 			
		});
		
		pageinit();
		
	}
	
	//페이지 초기처리
	function pageinit(){
		
		//대금신청(신청상태)
		//setAmountData();
		
		//작성일자(증빙일자)
		seTaxDate();
		
		//신청구분 선택불가
		//appDivSet();
		
		//발행방법에 따른 페이지 셋팅
		//taxDataSet();
		
		//버튼표시 셋팅
		btnCtr();

		//상태에 따른 입력항목 readOnly
		inputReadOnlyset();
		
		getFileListForTextarea();
		
		setTimeout(function() {
			getPaymentList();
		}, 500);
		
		//하자이행보증정보 view유무
		setGuarOutList();
	}
	
	function setGuarOutList(){
		
		var defEstGuarRateValue = Number(jQuery("#defEstGuarRate").val());	//하자보수보증금율 
		var preFundRateValue = Number(jQuery("#befAcmpPercent").val());		//전회 누계기성율
		//var preFundRateValue = 90;		//전회 누계기성율
		var checkRate1 = defEstGuarRateValue + preFundRateValue;
		var totFundRateValue = Number(jQuery("#curBefAcmpPercent").val());	//누계기성율
		var checkRate2 = defEstGuarRateValue + totFundRateValue;
		var acmpNoValue = jQuery("#depositSeq").val();						//지급차수
		
		if(Number(checkRate1) > 99){
			jQuery('#warr1').show();
			jQuery('#warr2').show();
		}else if(Number(checkRate2) > 99){
			jQuery('#warr1').show();
			jQuery('#warr2').show();
		}else{
			jQuery('#warr1').hide();
			jQuery('#warr2').hide();
		}
	}

	//대금내역 조회
	function getPaymentList(){
		jQuery("#fevent").val("GET_LIST");
		var url = Modular.model.PageContext.CONTEXT_ROOT + "/portal/payment/SuppPayItemRequests_sheet.screen";
		Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 1000, "");
	}

	//시트 설정
	function gridInit(sheetName){
		var init_sheet = {};
		init_sheet.Cfg = {SearchMode:2, Page:1000, MergeSheet:msHeaderOnly};
		init_sheet.Cols = [
		    			{Header:'입고번호|입고번호',	Type:"Text", 		SaveName:"STOCK_NO",			Width:110, 	Align:"Left"},
		    			{Header:'자재코드|자재코드',	Type:"Text", 		SaveName:"MATERIAL_CD", 		Width:110, 	Align:"Center"},
		    			{Header:'자재명|자재명',		Type:"Text", 		SaveName:"MATERIAL_NAME", 		Width:110,	Align:"Left"},
		    			{Header:'규격|규격',			Type:"Text", 		SaveName:"MATERIAL_SPEC", 		Width:50, 	Align:"Left"},
		    			{Header:'단위|단위',			Type:"Text",		SaveName:"UNIT_KIND", 			Width:45, 	Align:"Center"},
		    			{Header:'수량|수량',			Type:"Int", 		SaveName:"ITEM_QTY", 			Width:55, 	Align:"Right", Format:"Integer"},
		    			{Header:'KRW|단가',			Type:"Int", 		SaveName:"EXC_PRI", 			Width:50, 	Align:"Right", Format:"Integer"},
		    			{Header:'KRW|금액',			Type:"AutoSum", 	SaveName:"EXC_AMT", 			Width:50, 	Align:"Right", Format:"Integer"},
		    			{Header:'<%=prePayment.get("CURRENCY_GB")%>|단가',	Type:"Int", 		SaveName:"ITEM_PRI", 			Width:50, 	Align:"Right", Format:"Integer"},
		    			{Header:'<%=prePayment.get("CURRENCY_GB")%>|금액',	Type:"AutoSum", 	SaveName:"ITEM_AMT", 			Width:50, 	Align:"Right", Format:"Integer"}
		];

		init_sheet.HeaderMode = {Sort:1};
		IBS_InitSheet(sheetName, init_sheet);
		sheetName.SetDataAutoTrim(0);
		sheetName.SetEditable(false);
		//sheetName.SetDataLinkMouse("CST_DOC_NAME", 1);
		
		setGridSize();
	}

	function sheet1_OnSearchEnd(code, message) {
	    if(code == 0) {
	    	setGridSize();
		} else {
			//조회 에러 수행
			alert(message);
		}
	}
	
	function setGridSize() {
		sheet1.FitColWidth();
	}
	
	function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
		 
	}
	
	//신청대상일때 계약선급금액을 선급신청금액에 초기 입력한다.
	function setAmountData() {
		if(jQuery("#statusCd").val() == "00"){	//신청대상
			var subPrepaySupplyTamtValue = jQuery("#subPrepaySupplyTamt").val();	//계약 선급금액
			jQuery("#reqPrepaySupplyTamt").val(subPrepaySupplyTamtValue);			//선급 신청금액
			
			var subPrepaySupplyNamtValue = jQuery("#subPrepaySupplyNamt").val();	//계약 면세금액
			jQuery("#reqPrepaySupplyNamt").val(subPrepaySupplyNamtValue);			//선급 면세금액
		}
	}
	
	function appDivSet() {
		jQuery("#perpayReqDiv").attr("disabled", true);
		
		jQuery("#reqPrepaySupplyTamt, #reqPrepaySupplyNamt").blur();

	}
	
	function seTaxDate(){
	    
		var newDay = new Date( get_year(), get_month(), "");
	    var lastDay = newDay.getDate();
	    var yyyymmdd = get_year() +'-'+ get_month() +"-"+ lastDay;
	    
	    //alert(jQuery('#date1').val());
	    if(jQuery('#date1').val() == ""){
	    	jQuery('#date1').val(yyyymmdd);	
	    }
    		
	}
	
	function btnCtr(){
		
		//alert(jQuery("#statusCd").val());
		if(jQuery("#statusCd").val() == "00"){	//01:신청대상는 목록, 삭제, 저장 표시
			
			jQuery("#spanBtnList").show();
			jQuery("#spanBtnDelete").show();
			jQuery("#spanBtnSave").show();
			
			jQuery("#spanBtnRejection").hide();
			jQuery("#spanBtnApproval").hide();
			jQuery("#spanBtnAppReq").hide();
		}

		if(jQuery("#statusCd").val() == "01"){	//01:작성상태는 목록, 삭제, 저장, 대금신청 표시

			jQuery("#spanBtnList").show();
			jQuery("#spanBtnDelete").show();
			jQuery("#spanBtnSave").show();
			jQuery("#spanBtnAppReq").show();
			
			jQuery("#spanBtnRejection").hide();
			jQuery("#spanBtnApproval").hide();
		}
		
		if(jQuery("#statusCd").val() == "02"){	//02:대금요청상태는 목록, 삭제, 저장, 대금신청 표시
			
			jQuery("#spanBtnList").show();
			jQuery("#spanBtnDelete").show();
			jQuery("#spanBtnSave").show();
			jQuery("#spanBtnAppReq").show();
			
			jQuery("#spanBtnRejection").hide();
			jQuery("#spanBtnApproval").hide();
		}
		
		if(jQuery("#statusCd").val() == "03"){	//03:대금신청상태는 목록, 반려, 결재

			jQuery("#spanBtnList").show();
			
			jQuery("#spanBtnDelete").hide();
			jQuery("#spanBtnSave").hide();
			jQuery("#spanBtnAppReq").hide();
			jQuery("#spanBtnRejection").hide();
			jQuery("#spanBtnApproval").hide();
		}

		if(jQuery("#statusCd").val() == "04"){	//04:결재중상태는 목록
			
			jQuery("#spanBtnList").show();
		
			jQuery("#spanBtnDelete").hide();
			jQuery("#spanBtnSave").hide();
			jQuery("#spanBtnAppReq").hide();
			jQuery("#spanBtnRejection").hide();
			jQuery("#spanBtnApproval").hide();
		}
		
		if(jQuery("#statusCd").val() == "10"){	//10:결재완료상태는 목록
			
			jQuery("#spanBtnList").show();
		
			jQuery("#spanBtnDelete").hide();
			jQuery("#spanBtnSave").hide();
			jQuery("#spanBtnAppReq").hide();
			jQuery("#spanBtnRejection").hide();
			jQuery("#spanBtnApproval").hide();
		}		
		
		if(jQuery("#statusCd").val() == "99"){	//99:반려상태는 목록, 삭제, 저장, 대금신청요청 표시

			jQuery("#spanBtnList").show();
			jQuery("#spanBtnDelete").show();
			jQuery("#spanBtnSave").show();
			jQuery("#spanBtnAppReq").show();
			
			jQuery("#spanBtnRejection").hide();
			jQuery("#spanBtnApproval").hide();
		}		

	}

	function inputReadOnlyset() {

		if (jQuery("#statusCd").val() == "10" || jQuery("#statusCd").val() == "04" || jQuery("#statusCd").val() == "03") { //입력불가상태
			
			jQuery("#userName").attr("readonly", true);
			jQuery("#userName").css({'background-color' : '#F0F0F0'});
			jQuery("#userName").css({'border' : '1px solid #bcbcbc'});
			
			jQuery("#hp").attr("readonly", true);
			jQuery("#hp").css({'background-color' : '#F0F0F0'});
			jQuery("#hp").css({'border' : '1px solid #bcbcbc'});
			
			jQuery("#eMail").attr("readonly", true);
			jQuery("#eMail").css({'background-color' : '#F0F0F0'});
			jQuery("#eMail").css({'border' : '1px solid #bcbcbc'});
			
			jQuery("#curAcmpVat").attr("readonly", true);
			jQuery("#curAcmpVat").css({'background-color' : '#F0F0F0'});
			jQuery("#curAcmpVat").css({'border' : '1px solid #bcbcbc'});

			jQuery("#curPrepayApplyamt").attr("readonly", true);
			jQuery("#curPrepayApplyamt").css({'background-color' : '#F0F0F0'});
			jQuery("#curPrepayApplyamt").css({'border' : '1px solid #bcbcbc'});
			
			jQuery("#curPrepayVat").attr("readonly", true);
			jQuery("#curPrepayVat").css({'background-color' : '#F0F0F0'});
			jQuery("#curPrepayVat").css({'border' : '1px solid #bcbcbc'});
			
			jQuery("#selectDepositCd").attr("disabled", true);
			
		}
		
		WarrantyDiv();
	}
	
	function taxDataSet(){
		
		var radioCheck	= jQuery(':radio[name="chk_info"]:checked').val();	//세금계산서 발행방법
		if(radioCheck == "1"){
			jQuery("#taxAttachments").hide();
			jQuery("#taxTrRow").hide();
		}else{
			jQuery("#taxAttachments").show();
			jQuery("#taxTrRow").show();
		}
	}
	
	//잔여/중도금 설정
	function setDepostiCd(){
		var remainderAcmpAmtValue = jQuery("#remainderAcmpAmt").val();	//기성고_잔여_합계
		if(Number(remainderAcmpAmtValue) == 0){
			jQuery("#selectDepositCd").val("3");	//잔금
		}else{
			jQuery("#selectDepositCd").val("2");	//중도금
		}		
	}
	
	function warrCtr(gubun){
		
		if (gubun == "H") { //숨김
			var warrWamt = jQuery("#warrWamt").val().replace(/(\,|\:)/g, "");
			if(warrWamt == "0" || warrWamt == ""){
				
				jQuery('#warr1').slideUp();
				jQuery('#warr2').slideUp();				

			}else{
				
				alert("보증정보가 존재합니다.");
				//jQuery("#reqPrepaySupplyTamt").val(jQuery("#warrWamt").val());
			}
			
		} else {
			
			jQuery('#warr1').show("slow");
			jQuery('#warr2').show("slow");
			
		}
	}
	
	function reDisplay() {
		
		jQuery("#fevent").val("");
		jQuery("#form1").attr("action", "/portal/payment/SuppPayItemRequest.screen");
		jQuery("#form1").attr("target", "_self");
		jQuery("#form1").attr("method", "post");
		jQuery("#form1").submit();
		
	}
	
	//저장 및 대금 신청시 필수항목 Check
	function requiredItemsCheck(){
		
		var date1 		= jQuery('#date1').val();		//작성일자(증빙일자)
		var userName 	= jQuery('#userName').val();	//담당자명
		var hp 			= jQuery('#hp').val();			//담당자 핸드폰번호
		var eMail 		= jQuery('#eMail').val();		//담당자 이메일
		
		if(date1 == "" ){
			alert("입력필수입니다.");
			jQuery('#date1').focus();
			return false;
		}
		if(userName == ""){
			alert("담당자명은 입력필수입니다.");
			jQuery('#userName').focus();
			return false;
		}
		if(hp == ""){
			alert("담당자 핸드폰 번호는 입력필수입니다.");
			jQuery('#hp').focus();
			return false;
		}else{
			var rgEx = /(01[016789])[-](\d{4}|\d{3})[-]\d{4}$/g;  
			var strValue = hp;
			var chkFlg = rgEx.test(strValue);   
			if(!chkFlg){
				alert("올바른 휴대폰번호가 아닙니다.");
				jQuery('#hp').focus();
				return false;
			}
		}
		if(eMail == ""){
			alert("담당자 이메일은 입력필수입니다.");
			jQuery('#eMail').focus();
			return false;
		}else{
			var regEmail = /([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
			if(!regEmail.test(eMail)) {
                alert('올바른 이메일 주소가 아닙니다.');
                jQuery('#eMail').focus();
                return false;
            }
		}

		//금액Check처리
		var remainderAcmpAmtValue	 = jQuery("#remainderAcmpAmt").val();	//기성고_잔여_합게
		var remainderPrepayAmtValue  = jQuery("#remainderPrepayAmt").val();	//선급금공제_잔여_합게
		var curReqVatamtValue		 = jQuery("#curReqVatamt").val();		//청구액_금회_부가세
		if(Number(remainderAcmpAmtValue) < 0 || Number(remainderPrepayAmtValue) < 0 || Number(curReqVatamtValue) < 0){
			alert("금액을 확인바랍니다.");
			return false;
		}
		
		if(jQuery("#btnAppReqSelect").val() == "1"){	//대신청요청시에는 해당하는 첨부파일이 모드 등록되어있어야함.

			var defEstGuarRateValue = Number(jQuery("#defEstGuarRate").val());	//하자보수보증금율 
			var preFundRateValue = Number(jQuery("#befAcmpPercent").val());		//전회 누계기성율
			//var preFundRateValue = 90;		//전회 누계기성율
			var checkRate1 = defEstGuarRateValue + preFundRateValue;
			var totFundRateValue = Number(jQuery("#curBefAcmpPercent").val());	//누계기성율
			var checkRate2 = defEstGuarRateValue + totFundRateValue;
 			if(checkRate1 > 99 || checkRate2 > 100){
				//하자이행보증 정보가 존재하는지Check
				if(jQuery("#warrWgno").val() == ""){
					alert("하자이행보증 정보가 없습니다.");
 					return false;
				}
 			}
 			
			//01:작성중, 02:대금요청, 03:대금신청, 04:결재, 10:결재완료, 99:반려
/* 			if (jQuery("#perpayReqDiv").val() == "1") { //선급신청
				jQuery("#selectStatusCd").val("20");
			} else if (jQuery("#perpayReqDiv").val() == "2") { //부분신청
				jQuery("#selectStatusCd").val("20");
			} else if (jQuery("#perpayReqDiv").val() == "3") { //포기신청
				jQuery("#selectStatusCd").val("21");
			} else {
				alert("신청구분을 선택하세요");
				return;
			} */

			/* 			
			var radioCheck	= jQuery(':radio[name="chk_info"]:checked').val();
			if(radioCheck == "2"){	//순발행일때 세금계산서 첨부파일이 등록되어있어야함.
				var fileName2 = jQuery('#p_AttachFile2').val();
				if(fileName2 == ""){
					alert("세금계산서 첨부파일 필수입니다.");
					return false;
				}
			}
			
			var reqDivGubun = jQuery("#perpayReqDiv option:selected").val();
			if(reqDivGubun == "2" || reqDivGubun == "3"){
				var fileName1 = jQuery('#p_AttachFile1').val();
				if(fileName1 == ""){
					alert("선급금 포기각서 첨부파일 필수입니다.");
					return false;
				}
			}
			
			if(reqDivGubun == "1" || reqDivGubun == "2"){
				var subContId = jQuery('#subContId').val();
				if(subContId == ""){
					alert("보증정보 입력 필수입니다.");
					return false;
				}
			}
*/		
			//보증정보 첨부확인Check
 			//alert("기능신청시 첨부파일 확인 처리 개발중 일단 진행");	
		}
	}
	
	function doResult(resultObj) {
		try {
			
			
			if( resultObj.getRequestEvent() == "SAVE_DATA" ) {
				if( resultObj.getSuccess() ) {				
					
					document.form1.isSubmit = false;
					
					if(jQuery("#btnAppReqSelect").val() == "0"){

						alert("저장되었습니다.");		
						//jQuery("#btnList").click();	
						reDisplay();
						
					}else{
						
						jQuery("#btnAppReqSelect").val("0");
						btnAppReqProcess();
						
					}
					
				}else {
					dlgErrorMsg(resultObj);
				}
				document.form1.isSubmit = false;
			}

			if( resultObj.getRequestEvent() == "DELETE_DATA" ) {
				if( resultObj.getSuccess() ) {				
					alert("삭제되었습니다.");			
					jQuery("#btnList").click();
				}else {
					dlgErrorMsg(resultObj);
				}
				document.form1.isSubmit = false;
			}

			if( resultObj.getRequestEvent() == "REQ_DATA" ) {
				if( resultObj.getSuccess() ) {				
					alert("신청하였습니다.");			
					jQuery("#btnList").click();
				}else {
					dlgErrorMsg(resultObj);
				}
				document.form1.isSubmit = false;
			}
			
			if( resultObj.getRequestEvent() == "GET_ATTACHFILE" ) {
				if( resultObj.getSuccess() ) {				
					document.form1.p_AttachFile.value = resultObj.getValueObject().get("AttachFile");
				}else {
					dlgErrorMsg(resultObj);
				}
				document.form1.isSubmit = false;
			}
			
			if( resultObj.getRequestEvent() == "CHK_ATTCH" ) {
				
				var vo = resultObj.getValueObject();
    			var check = vo.get('checkFlag');
    			if(check == 0){	//가능
					
    				document.form1.isSubmit = false;
    				runAppReq();	
					
    			}else{
    				
    				document.form1.isSubmit = false;
    				if(check == 1){
    					
    					location.href = "#fAttch";
    					alert("대금청구서 첨부파일이 없습니다.");	
    				}
    			}
			}
			
			if( resultObj.getRequestEvent() == "GET_DATA" ) {
				
				if( resultObj.getSuccess() ) {

					var subContId = resultObj.getValueObject().get("SUB_CONT_ID");
					if(subContId != ""){
						jQuery("#subContId").val(subContId);
						
						var warrGubun = resultObj.getValueObject().get("WARR_GUBUN");
						jQuery("#warrGubun").val(warrGubun);
						
						var warrSeq = resultObj.getValueObject().get("WARR_SEQ");
						jQuery("#warrSeq").val(warrSeq);
						
						var causeCode = resultObj.getValueObject().get("CAUSECODE");
						jQuery("#causeCode").val("당초");

						var guarOnoffYn = resultObj.getValueObject().get("GUAR_ONOFF_YN");
						jQuery("#guarOnoffYn").val(guarOnoffYn);

						var warrGoffice = resultObj.getValueObject().get("WARR_GOFFICE");
						jQuery("#warrGoffice").val(warrGoffice);

						var guarStatus = resultObj.getValueObject().get("GUAR_STATUS");
						jQuery("#guarStatus").val(guarStatus);
						
						var paperDate = resultObj.getValueObject().get("PAPERDATE");
						jQuery("#paperDate").val(paperDate);

						var warrWgno = resultObj.getValueObject().get("WARR_WGNO");
						jQuery("#warrWgno").val(warrWgno);

						var warrWamt = resultObj.getValueObject().get("WARR_WAMT");
						jQuery("#warrWamt").val(warrWamt);
						jQuery("#warrWamt").each(function(index){
							jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
						});
						
						var warrSdateEdate = resultObj.getValueObject().get("WARR_SDATE_EDATE");
						jQuery("#warrSdateEdate").val(warrSdateEdate);
						
					}

				}else {
					dlgErrorMsg(resultObj);
				}
				document.form1.isSubmit = false;
			}			
			
		}
		catch(errorObject) {
	        showErrorDlg("doResult()", errorObject);
		}
	}

	//저장 후  대금신청 처리
	function btnAppReqProcess(){
		fMakeItemInfo();
// 		if (fMakeItemInfo()) { //서명데이터 처리
// 			var f = document.form1;
// 			jQuery("#fevent").val("REQ_DATA");
// 			submitXmlRequest("/portal/payment/SuppPayItemRequests_form.screen", "REQ_DATA", f, "SUCCESS");
// 		}

	}

	

	function doKeyPress() {
		
	    if( event.keyCode == 13 ) {
			doSearch(document.all.sheet1)
	    }
	}	

	function calendar(thisDayObj){
		dlgCalendar(thisDayObj);
	}		

	//첨부파일   
	function doAttachFile(obj,No,fileName) {
		
		if(obj.value == ''){
			alert("데이터를 저장 후, 파일을 첨부할 수가 있습니다.");
		}
		else if(obj.value != ''){ 
			if(No == 1){
				viewFileListNew1('PURCHASE_'+obj.value, No, document.form1.fileMapID, "Y", "payment/purchase/"+obj.value);
			}else{
				var upLoadFlg = "Y";
				if(jQuery("#statusCd").val() == "10"){	//상태값이 기성신청(03), 결재완료(10) 일때는 첨부파일 다운로드만 가능
					upLoadFlg = "N";
				}
				viewFileListNew1('PURCHASE_'+obj.value, No, document.form1.fileMapID, upLoadFlg, "payment/purchase/"+obj.value, null, fileName);
			}
		} 

	}

	function viewFileListNew1(fileGB, id, obj, isModify, isDrectory, iframeID, user_filename) {
		
		var win_id = "_viewFileList";
		var link = "/common/file/FileListNew.screen";
		    link += "?pop_win_id="+win_id;
		    link += "&extFunction=viewFileListClose1";
		    link += "&file_gb=" + fileGB;
		    link += "&id=" + id;
		    
		    if( obj.id != null )
			    link += "&obj_id=" + obj.id;
		    if( iframeID != null )
		    	link += "&iframeID=" + iframeID;
		    
			if( isModify != null )
				link += "&is_modify=" + isModify;
			if( isDrectory != null )
				link += "&sys_gb=" + isDrectory;	    
			if( user_filename != null )
				link += "&user_filename=" + user_filename;	 
		
		fLayerPop(win_id, link, 750,430, '', '', 'NO', '200');
	}
	
	//첨부목록 조회
	function getFileListForTextarea(){
		 
		document.form1.p_AttachFile.value = "";
		var f = document.form1;  
		jQuery("#fevent").val("GET_ATTACHFILE");
		submitXmlRequest("/portal/payment/SuppPayItemRequests_form.screen", "GET_ATTACHFILE", f, "VALUEOBJECT");	
	}
	
	//보증정보 조회
	function callback_getContWarr(){
		
		//alert("보증정보 조회");
		fLayerPopClose('contOutWarrPop');
		var f = document.form1;
		jQuery("#fevent").val("GET_DATA");
		submitXmlRequest("/portal/payment/AdvencePayRequest_form.screen", "GET_DATA", f, "VALUEOBJECT");
		
	}
	
	function fileCheck(checkObj, val){
		var f = document.form1;
		var obj = eval("document.getElementById('" + val + "')");
		
		if(obj.style.display == "none"){
			obj.style.display = "inline";
			checkObj.checked = true;
		}else{
			obj.style.display = "none";
			checkObj.checked = false;
		}
	} 
	
	//보증정보 조회
	function callback_getContWarr(){
		
		var f = document.form1;
		jQuery("#fevent").val("GET_DATA");
		submitXmlRequest("/payment/outside/AdvencePayment_form.screen", "GET_DATA", f, "VALUEOBJECT");
		
	}

	//첨부파일Check
	function ChkAttch(){
		
		var f = document.form1;
		jQuery("#fevent").val("CHK_ATTCH");
		submitXmlRequest("/portal/payment/SuppPayItemRequests_form.screen", "CHK_ATTCH", f, "VALUEOBJECT");
		
	}	

	function runAppReq(){
		var f = document.form1;
		jQuery("#btnAppReqSelect").val("1");	//0:저장처리, 1:대금신청요청 
		
		jQuery("#fevent").val("SAVE_DATA");
		//필수 입력항목 check
		if(requiredItemsCheck() == false){
			return;
		}
		
		//입력데이터 저장 
		if (confirm(jQuery("#btnText").text()+" 하시겠습니까?")) {
			submitXmlRequest("/portal/payment/SuppPayItemRequests_form.screen", "SAVE_DATA", f, "SUCCESS");
		}	
	}
	
	function fMakeItemInfo() {

		var sColumDelimiter = "┃";
		var sRowDelimiter = "↕";
		var sSumDelimiter = "╂";
		var sEncDelimiter = "⇔";

		var sItemInfo = ""; //서명할 문자열 데이터

		var infoDeptName = "현장명:" + jQuery("#deptName").val(); //현장명
		var infoBuildName = "계약명:" + jQuery("#buildName").val(); //계약명
		var infoConCurNm = "계약통화:" + jQuery("#conCurCd").val(); //계약통화

		var infoCorpRegNo = "사업자번호:" + jQuery("#vendCd").val(); //사업자번호
		var CorpRegNoVal = jQuery("#vendCd").val().replace(/-/gi, "");
		//사업자번호
		//alert(CorpRegNoVal);

		var infoCorpKor = "계약업체명:" + jQuery("#memberName").val(); //계약업체명
		var infoBossName = "대표이사:" + jQuery("#bossName").val(); //업체대표이사

		var infoStartEndWorkDate = "계약기간:" + jQuery("#startEndWorkDate").val(); //계약기간
		var infoConAmt = "계약금액:" + jQuery("#conAmt").val(); //계약금액합계
		var infoPerpayAmt = "선급금액:" + jQuery("#perpayAmt").val(); //선급금액합계
		//var infoHowToPay = "대금지불방법:" + jQuery("#howToPay").val(); //대금지불방법
		var infoHowToPay = "지급사유:" + jQuery("#howToPay").val(); //지급사유
		
		var infoTaxMethod = ""; //세금계산서발행방법
		if (jQuery('input:checkbox[id="chk_1"]').is(":checked")) { //역발행
			infoTaxMethod = "세금계산서발행방법:역발행";
		} else {
			infoTaxMethod = "세금계산서발행방법:순발행";
		}
		var infoDate1 = "작성일자:" + jQuery("#date1").val(); //작성일자(증빙일자)
		var infoTaxChargNm = "담당자명:" + jQuery("#userName").val(); //담당자명
		var infoTaxChargHp = "핸드폰번호:" + jQuery("#hp").val(); //담당자 핸드폰번호
		var infoTaxChargEmail = "이메일주소:" + jQuery("#eMail").val(); //담당자 이메일

		var infoPayDiv = "대금구분:납품정산"; 		//대금구분:납품
		var infoDepositCd = "지급구분:" + jQuery("#selectDepositCd option:selected").val(); 	//지급구분:중도금
		var infoDepositSeq = "지급차수:" + jQuery("#depositSeq").val();						 //지급차수:02
		
		var infoPrepayAmt = "선급_청구금액_합계:" + jQuery("#reqPrepayAmt").val();
		var infoPrepaySupplyTamt = "선급_청구금액_공급가:"+ jQuery("#reqPrepaySamt").val();
		var infoPrepaySurtaxAmt = "선급_청구금액_부가세:" + jQuery("#reqPrepaySamt").val();

		sItemInfo = sItemInfo + infoDeptName + sColumDelimiter;
		sItemInfo = sItemInfo + infoBuildName + sColumDelimiter;
		sItemInfo = sItemInfo + infoConCurNm + sColumDelimiter;

		sItemInfo = sItemInfo + infoCorpRegNo + sColumDelimiter;
		sItemInfo = sItemInfo + infoCorpKor + sColumDelimiter;
		sItemInfo = sItemInfo + infoBossName + sColumDelimiter;

		sItemInfo = sItemInfo + infoStartEndWorkDate + sColumDelimiter;
		sItemInfo = sItemInfo + infoConAmt + sColumDelimiter;
		sItemInfo = sItemInfo + infoPerpayAmt + sColumDelimiter;
		sItemInfo = sItemInfo + infoHowToPay + sColumDelimiter;

		sItemInfo = sItemInfo + infoTaxMethod + sColumDelimiter;
		sItemInfo = sItemInfo + infoDate1 + sColumDelimiter;
		sItemInfo = sItemInfo + infoTaxChargNm + sColumDelimiter;
		sItemInfo = sItemInfo + infoTaxChargHp + sColumDelimiter;
		sItemInfo = sItemInfo + infoTaxChargEmail + sColumDelimiter;

		sItemInfo = sItemInfo + infoPayDiv + sColumDelimiter;
		sItemInfo = sItemInfo + infoDepositCd + sColumDelimiter;
		sItemInfo = sItemInfo + infoDepositSeq + sColumDelimiter;

		sItemInfo = sItemInfo + infoPrepayAmt + sColumDelimiter;
		sItemInfo = sItemInfo + infoPrepaySupplyTamt + sColumDelimiter;
		//sItemInfo = sItemInfo + infoReqPrepaySupplyNamt + sColumDelimiter;
		sItemInfo = sItemInfo + infoPrepaySurtaxAmt;

		//alert(sItemInfo);

		// 환경설정 함수 콜

		if (sItemInfo == null || sItemInfo == "") {
			alert("서명할 데이타를 넣어주십시요");
			return false;
		}

		unisign.SignDataNVerifyVID( sItemInfo, null, CorpRegNoVal, function( resultObject ) {
			if( !resultObject || resultObject.resultCode != 0 ){
				if( resultObject.resultCode == '14208'){
					alert("주민번호/사업자번호를 확인할 수 없는 인증서입니다.");
				} else if( resultObject.resultCode == '999'){
					alert("사용자 DN 선택이 취소 되었습니다.");
				} else {
					alert( resultObject.resultMessage);
				}
				return ;
			}
			
			var signeddata = resultObject.signedData;
// 	 		var userdn = resultObject.certAttrs.subjectName;
			
	 		jQuery("#signeddata").val(signeddata);
	 		
	 		var f = document.form1;
			jQuery("#fevent").val("REQ_DATA");
			submitXmlRequest("/portal/payment/SuppPayItemRequests_form.screen", "REQ_DATA", f, "SUCCESS");
		});
		
	}
	
	
	
	//보증정보팝업 호출
	function popContWarr(wG, wSeq, wCauseCd) {
		
		var win_id = "contPurWarrPopup";			

		var param = "";
		var param = "?purContModId=" + jQuery("#selectSubContModId").val();
		var param = param + "&warrGubun=" + wG;
		var param = param + "&warrSeq=" + wSeq;
		var param = param + "&causeCode=" + wCauseCd;
		var param = param + "&viewDiv=PAYREQ";
//		var param = param + "&prepayId=" + jQuery("#prepayId").val();
		var param = param + "&pop_win_id=" + win_id;
		
		var url = "/portal/guar/contPurWarrPopup.screen"+param;
		
		fLayerPop(win_id, url, 560,350, '','', 'NO');
	}	
	//보증정보팝업 종료후 액션
	function popContWarrClose(returnValue){
		if(returnValue == null){
			fLayerPopClose('contPurWarrPopup');
		}else{
			fLayerPopClose('contPurWarrPopup');
			location.reload();
		}
	}
	function doAttachFilePop(obj, No, fObj, fileGB, fileDir) {
		var editFile = "";
		 if(obj==''){
			alert("After you have saved, you can attach a file.");
		}
		else if(obj != ''){ 
			if(fObj.guarStatus.value != "02"){editFile="N";}else{editFile="Y";}
			viewFileListNew(fileGB, obj.value, fObj.p_AttachFileGuar1, editFile, fileDir, "contPurWarrPopup");
		} 
	} 
		
	function WarrantyDiv(){
		
		//alert(jQuery("#selectDepositCd option:selected").val());
/* 		if(jQuery("#selectDepositCd option:selected").val() == "2"){	//중도금
			jQuery("#warr1").hide();
			jQuery("#warr2").hide();
		}else{
			jQuery("#warr1").show();
			jQuery("#warr2").show();
		} */
		
	}	
</SCRIPT>


<modular:search id="form1">
	<modular:key id="fevent" />
</modular:search>

<form id="form1" name="form1" method="post" modular:type="search">

	<INPUT type="hidden" name="fevent" id="fevent" value="">
	<INPUT type="hidden" name="payreqId" id="payreqId" value="<%=prePayment.get("PAYREQ_ID") %>">	<!-- 발주계약ID -->
	<INPUT type="hidden" name="purContId" id="purContId" value="<%=prePayment.get("PUR_CONT_ID") %>">	<!-- 발주계약ID -->
	<INPUT type="hidden" name="selectSubContModId" id="selectSubContModId" value="<%=prePayment.get("PUR_CONT_MOD_ID") %>">
	
	<!-- 리스트 검색조건 보존 시작-->
	<INPUT type='hidden' id="searchDeptCd" name="searchDeptCd" value="<%=params.get("searchDeptCd")%>">	<!-- 현장코드 -->
	<INPUT type='hidden' id="searchDeptNm" name="searchDeptNm" value="<%=params.get("searchDeptNm")%>">	<!-- 현장명 -->
	<INPUT type='hidden' id="searchBuildName" name="searchBuildName" value="<%=params.get("searchBuildName")%>">	<!-- 계약명 -->
	<INPUT type='hidden' id="searchDateStart" name="searchDateStart" value="<%=params.get("searchDateStart")%>">	<!-- 작성 시작일 -->
	<INPUT type='hidden' id="searchDateEnd" name="searchDateEnd" value="<%=params.get("searchDateEnd")%>">			<!-- 작성 종료일 -->
	<INPUT type='hidden' id="searchStatusCd" name="searchStatusCd" value="<%=params.get("searchStatusCd")%>">			<!-- 상태값 -->
	<!-- 리스트 검색조건 보존 종료-->
	
	<INPUT type="hidden" name="btnAppReqSelect" id="btnAppReqSelect" value="0">	<!-- 결재 및 저장 구분 0:저장, 1:결재 -->
	
	<INPUT type='hidden' id="conConAmt" name="conConAmt" value="<%=prePayment.get("ORD_AMT")%>">					<!-- 계약금액 -->
	<INPUT type='hidden' id="conPrepayAmt" name="conPrepayAmt" value="<%=prePayment.get("PREPAY_SUPPLY_AMT")%>">	<!-- 선급금액 -->
	
	<INPUT type="hidden" name="statusCd" id="statusCd" value="<%=prePayment.get("REQ_STATUS") %>">	<!-- 상태값 -->
	
	<!--  임시 FILE MAP ID 값 -->
	<INPUT type="hidden" name="fileMapID" id="fileMapID" value="" onPropertyChange="JavaScript:getFileListForTextarea();">
	<INPUT type='hidden' name="signeddata" value="">	<!-- 서명데이터 -->
	<INPUT type="hidden" name="bugase" id="bugase" value="<%=prePayment.get("CHG_CODE10") %>">
	<INPUT type="hidden" name="orgCurPrepayApplyamt" id="orgCurPrepayApplyamt" value="<%=prePayment.get("CUR_PREPAY_APPLYAMT") %>">
	
	<INPUT type='hidden' id="resUserName" name="resUserName" value="<%=prePayment.get("RES_USER_NAME") %>">	<!-- 계약담당자 -->
	<INPUT type='hidden' id="resHp" name="resHp" value="<%=prePayment.get("RES_HP") %>">	<!-- 계약담당자 핸드폰번호 -->
	<INPUT type='hidden' id="resEmail" name="resEmail" value="<%=prePayment.get("RES_EMAIL") %>">	<!-- 계약담당자 이메일 -->
	<INPUT type='hidden' id="resDivision" name="resDivision" value="<%=prePayment.get("RES_DIVISION") %>">	
	<INPUT type='hidden' id="conDocNo" name="conDocNo" value="<%=prePayment.get("ORD_DOC_NO") %>">	<!-- 발주계약번호 -->
	
	<INPUT type='hidden' id="defEstGuarRate" name="defEstGuarRate" value="<%=prePayment.get("DEF_GUAR_AMT_RATE") %>">	<!-- 하자보수보증금율 -->
	
	<!-- 제목 및 버튼 -->
	<table width="100%">
		<colgroup>
			<col width="500" />
			<col width="*" />
		</colgroup>
		<tr>
	   		<th>
		   		<div align="left" id="title">
					<ul>
			    		<li>구매_대금신청 상세(<%=prePayment.get("STATUS_NM")%>)</li>
			    	</ul>
				</div>
			</th>
			<td align="right">
				<span id="spanBtnSave" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnSave">저장</a></span>
				<span id="spanBtnDelete" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnDelete">삭제</a></span>
				<span id="spanBtnAppReq" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnAppReq"><span id="btnText">대금신청</span></a></span>
				<span id="spanBtnApproval" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnApproval">결재</a></span>
				<span id="spanBtnRejection" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnRejection">반려</a></span>
				<span id="spanBtnList" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnList">목록</a></span>
			</td>
		</tr>
	</table>
<%
if(!prePayment.get("RTN_REASON").equals("")){
%>
 	<div class="application-info  magT10">
		<div class="application-sub-title">
			<span class="title">반려정보</span>
		</div>
		<div class="application-location"></div>
	</div>
	<TABLE class="form-table">
		<colgroup>
			<col width="13%" />
			<col width="*" />
		</colgroup>

		<TR height="25">
			<th style="text-align: left;">반려일</th>
			<TD><%=Formatter2.formatDate(prePayment.get("RTN_DATE"), "-")%></TD>
		</TR>
		<TR>
			<th style="text-align: left;">반려사유</th>
			<TD><%=prePayment.get("RTN_REASON")%></TD>
		</TR>
	</TABLE>
<%
}
%>

	<div class="application-info  magT10">
		<div class="application-sub-title">
			<span class="title">계약정보</span>
		</div>
		<div class="application-location"></div>
	</div>
	 
	<TABLE class="form-table">
		<colgroup>
			<col width="13%" />
			<col width="20%" />
			<col width="13%" />
			<col width="20%" />
			<col width="13%" />
			<col width="*" />
		</colgroup>

		<TR height="25">
			<th style="text-align: left;">현장명</th>
			<TD><%= InputText.get("deptName", prePayment.get("DEPT_NAME"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
			<th style="text-align: left;">계약명</th>
			<TD><%= InputText.get("buildName", prePayment.get("CST_DOC_NAME"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
			<th style="text-align: left;">통화</th>
			<TD><%= InputText.get("conCurCd", prePayment.get("CURRENCY_GB"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
		</TR>
		<TR>
			<th style="text-align: left;">사업자번호</th>
			<TD><%= InputText.get("vendCd", prePayment.get("REG_NO"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>

			<th style="text-align: left;">계약업체명</th>
			<TD><%= InputText.get("memberName", prePayment.get("CORP_KOR"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>

			<th style="text-align: left;">대표이사</th>
			<TD><%= InputText.get("bossName", prePayment.get("BOSS_NAME"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
		</TR>
		<TR>
			<th style="text-align: left;">계약기간</th>
			<TD><%= InputText.get("startEndWorkDate", prePayment.get("ORD_START_END_DATE"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
			<th style="text-align: left;">계약금액</th>
			<TD><%= InputText.get("conConAmtNm", Formatter2.currency(prePayment.get("ORD_AMT"), intDigit)+" (부가세 별도)", 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
			<th style="text-align: left;">선급금액</th>
			<TD><%= InputText.get("conPrepayAmtNm", Formatter2.currency(prePayment.get("PREPAY_SUPPLY_AMT"), intDigit)+" (부가세 별도)", 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
		</TR>
		<TR>
			<th style="text-align: left;">지급사유</th>
			<TD colspan="5">
			<INPUT type="text" name="howToPay" id="howToPay" maxlength="999" style="width:99%;" value="<%=prePayment.get("DDD") %>">
			</TD>
		</TR>
	</TABLE>
	<!-- 계약정보 : 끝 -->

	<!-- 세금계산서정보 : 시작 -->
	<div class="application-info  magT10">
		<div class="application-sub-title">
			<span class="title">세금계산서 정보</span>
		</div>
		<div class="application-location">
		</div>
	</div>
	
	<TABLE class="form-table">
		<colgroup>
			<col width="13%" />
			<col width="20%" />
			<col width="13%" />
			<col width="20%" />
			<col width="13%" />
			<col width="*" />
		</colgroup>
		<TR>
			<th style="text-align: left;">세금계산서 발행방법</th>
			<TD colspan="3">
				<input type="radio" id="chk_1" name="chk_info" value="1" onclick="taxDataSet();" <%= check1 %> disabled='disabled' style="display: none;"/>
				<input type="radio" id="chk_2" name="chk_info" value="2" onclick="taxDataSet();" <%= check2 %> disabled='disabled' style="display: none;"/>
				<input type="radio" id="chk_3" name="chk_info" value="3" onclick="taxDataSet();" <%= check3 %> disabled='disabled' style="display: none;"/>
				<%= checkString %>
			</TD>
			<th style="text-align: left;">작성일자(증빙일자)</th>
			<TD><%= InputText.get("date1", Formatter2.formatDate(prePayment.get("TAX_DY"), "-"), 30, 10, "Center, date, PerSize, readonly", "date", "") %>
				<A href="JavaScript:calendar('date1');"><IMG src="/img/supplier/template/bt_calender.gif" alt="달력" border="0" align="absmiddle"></A>
			</TD>
  		</TR>
 		<TR> 
			<th class="required" style="text-align: left;">담당자명</th>
			<TD><%= InputText.get("userName", taxChargNm, 98, 6, "string, left, perSize", "string") %></TD>
			<th class="required" style="text-align: left;">담당자 핸드폰번호</th>
			<TD><input type="text" id="hp" name="hp" value="<%=taxChargHp%>" style="width: 44%" size="13" maxlength="13" alt="left">&nbsp;ex)010-0000-0000</TD>
			<th class="required" style="text-align: left;">담당자 이메일</th>
			<TD><%= InputText.get("eMail", taxChargEmail, 98, 40, "string, left, perSize", "string") %></TD>
  		</TR>
	</TABLE>
	<!-- 세금계산서정보 : 끝 -->
	
   	<div class="application-info  magT10">
		<div class="application-sub-title">
			<span class="title">대금정보</span>
		</div>
		<div class="application-location">
		</div>
	</div>

	<TABLE class="form-table">
		<colgroup>
			<col width="13%" />
			<col width="20%" />
			<col width="13%" />
			<col width="20%" />
			<col width="13%" />
			<col width="*" />
		</colgroup>

		<TR height="25">
			<th style="text-align: left;">대금구분</th>
			<TD><%= InputText.get("payDiv", "납품정산", 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
			<th style="text-align: left;">지급구분</th>
			<TD>
			<select name="selectDepositCd" id="selectDepositCd" onchange="WarrantyDiv()" style="background-color:#F0F0F0" disabled>
       			<option value="2">중도금</option>
       			<option value="3">잔금</option>
			</select>
			<script>
				setSelect(form1.selectDepositCd, '<%=prePayment.get("DEPOSIT_CD")%>');
			</script>
			</TD>
			<th style="text-align: left;">지급차수</th>
			<TD><%= InputText.get("depositSeq", prePayment.get("DEPOSIT_SEQ"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
		</TR>
	</TABLE>
	
	<img src="/img/com/blank.gif" height="10px" />
	
	<TABLE class="form-table">	
		<colgroup>
			<col width="13%" />
			<col width="20%" />
			<col width="13%" />
			<col width="20%" />
			<col width="13%" />
			<col width="*" />
		</colgroup>
		<TR>
			<th style="text-align: left;">선급금 청구금액</th>
			<TD colspan="3">				
			합계금액:<%= InputText.get("reqPrepayAmt", Formatter2.currency(prePayment.get("PREPAY_AMT"), intDigit), 20, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %>
			(청구금액:<%= InputText.get("reqPrepaySamt", Formatter2.currency(prePayment.get("PREPAY_SUPPLY_AMT"), intDigit), 20, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %>
			,부가세:<%= InputText.get("reqPrepaySamt", Formatter2.currency(prePayment.get("PREPAY_SURTAX_AMT"), intDigit), 20, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %>
			)									
			</TD>

			<th style="text-align: left;">업체신청일시</th>
			<TD><%= InputText.get("signDate", prePayment.get("CUST_SIGN_DATE"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
		</TR>
	</TABLE>
	
<%-- 	<img src="/img/com/blank.gif" height="10px" />
	
	<TABLE class="form-table">	
		<colgroup>
			<col width="65" />
			<col/>
			<col/>
			<col/>
			<col width="40" />
			<col/>
			<col/>
			<col/>
			<col width="40" />
			<col/>
			<col/>
			<col/>
		</colgroup>
		<TR>
			<th style="text-align: center;" rowspan="2"></th>
			<th style="text-align: center;" colspan="4">기성고</th>
			<th style="text-align: center;" colspan="4">선급금공제</th>
			<th style="text-align: center;" colspan="3">청구액</th>
		</TR>
		<TR>
			<th style="text-align: center;padding-left:0px;">공급가액</th>
			<th style="text-align: center;padding-left:0px;">부가세</th>
			<th style="text-align: center;padding-left:0px;">합계</th>
			<th style="text-align: center;padding-left:0px;">요율</th>
			<th style="text-align: center;padding-left:0px;">공급가액</th>
			<th style="text-align: center;padding-left:0px;">부가세</th>
			<th style="text-align: center;padding-left:0px;">합계</th>
			<th style="text-align: center;padding-left:0px;">요율</th>
			<th style="text-align: center;padding-left:0px;">공급가액</th>
			<th style="text-align: center;padding-left:0px;">부가세</th>
			<th style="text-align: center;padding-left:0px;">합계</th>
		</TR>
		<TR>
			<th style="text-align: left;padding-left:5px;">전회까지</th>
			<td><%= InputText.get("befAcmpApplyAmt", Formatter2.currency(prePayment.get("BEF_ACMP_APPLYAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("befAcmpVat", Formatter2.currency(prePayment.get("BEF_ACMP_VAT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("befAcmpAmt", Formatter2.currency(prePayment.get("BEF_ACMP_AMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("befAcmpPercent", Formatter2.currency(prePayment.get("BEF_ACMP_PERCENT"),1), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("befPrepayApplyAmt", Formatter2.currency(prePayment.get("BEF_PREPAY_APPLYAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("befPrepayVat", Formatter2.currency(prePayment.get("BEF_PREPAY_VAT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("befPrepayAmt", Formatter2.currency(prePayment.get("BEF_PREPAY_AMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("befPrepayPercent", Formatter2.currency(prePayment.get("BEF_PREPAY_PERCENT"),1), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("payedApplyamt", Formatter2.currency(prePayment.get("PAYED_APPLYAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("payedVat", Formatter2.currency(prePayment.get("PAYED_VAT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("payedAmt", Formatter2.currency(prePayment.get("PAYED_AMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("payedPercent", Formatter2.currency(prePayment.get("PAYED_PERCENT"),1), 96, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
		</TR>
		<TR>
			<th style="text-align: left;padding-left:5px;">금회</th>
			<td><%= InputText.get("curAcmpApplyamt", Formatter2.currency(prePayment.get("CUR_ACMP_APPLYAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("curAcmpVat", Formatter2.currency(prePayment.get("CUR_ACMP_VAT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("curAcmpAmt", Formatter2.currency(prePayment.get("CUR_ACMP_AMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("curAcmpPercent", Formatter2.currency(prePayment.get("CUR_ACMP_PERCENT"),1), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("curPrepayApplyamt", Formatter2.currency(prePayment.get("CUR_PREPAY_APPLYAMT"),intDigit), 99, 16, "class=input byteChk ,number, right, perSize", "number") %></td>
			<td><%= InputText.get("curPrepayApplyamt", Formatter2.currency(prePayment.get("CUR_PREPAY_APPLYAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("curPrepayVat", Formatter2.currency(prePayment.get("CUR_PREPAY_VAT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("curPrepayDeductamt", Formatter2.currency(prePayment.get("CUR_PREPAY_DEDUCTAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("curPrepayPercent", Formatter2.currency(prePayment.get("CUR_PREPAY_PERCENT"),1), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("curReqAmt", Formatter2.currency(prePayment.get("CUR_REQ_AMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("curReqVatamt", Formatter2.currency(prePayment.get("CUR_REQ_VATAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("curReqApplyamt", Formatter2.currency(prePayment.get("CUR_REQ_APPLYAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("curReqPercent", Formatter2.currency(prePayment.get("CUR_REQ_PERCENT"),1), 96, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
		</TR>
		<TR>
			<th style="text-align: left;padding-left:5px;">누계</th>
			<td><%= InputText.get("curBefAcmpSupplyamt", Formatter2.currency(prePayment.get("CUR_BEF_ACMP_SUPPLYAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("curBefAcmpVat", Formatter2.currency(prePayment.get("CUR_BEF_ACMP_VAT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("curBefAcmpAmt", Formatter2.currency(prePayment.get("CUR_BEF_ACMP_AMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("curBefAcmpPercent", Formatter2.currency(prePayment.get("CUR_BEF_ACMP_PERCENT"),1), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("curBefPrepaySupplyamt", Formatter2.currency(prePayment.get("CUR_BEF_PREPAY_SUPPLYAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("curBefPrepayVat", Formatter2.currency(prePayment.get("CUR_BEF_PREPAY_VAT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("curBefPrepayAmt", Formatter2.currency(prePayment.get("CUR_BEF_PREPAY_AMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("curBefPrepayPercent", Formatter2.currency(prePayment.get("CUR_BEF_PREPAY_PERCENT"),1), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("curPayedSupplyamt", Formatter2.currency(prePayment.get("CUR_PAYED_SUPPLYAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("curPayedVat", Formatter2.currency(prePayment.get("CUR_PAYED_VAT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("curPayedAmt", Formatter2.currency(prePayment.get("CUR_PAYED_AMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("curPayedPercent", Formatter2.currency(prePayment.get("CUR_PAYED_PERCENT"),1), 96, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
		</TR>
		<tr>
			<th style="text-align: left;padding-left:5px;">잔여</th>
			<td><%= InputText.get("remainderAcmpSupplyamt", Formatter2.currency(prePayment.get("REMAINDER_ACMP_SUPPLYAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("remainderAcmpVat", Formatter2.currency(prePayment.get("REMAINDER_ACMP_VAT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("remainderAcmpAmt", Formatter2.currency(prePayment.get("REMAINDER_ACMP_AMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("remainderAcmpPercent", Formatter2.currency(prePayment.get("REMAINDER_ACMP_PERCENT"),1), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("remainderPrepaySupplyamt", Formatter2.currency(prePayment.get("REMAINDER_PREPAY_SUPPLYAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("remainderPrepayVat", Formatter2.currency(prePayment.get("REMAINDER_PREPAY_VAT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("remainderPrepayAmt", Formatter2.currency(prePayment.get("REMAINDER_PREPAY_AMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("remainderPrepayPercent", Formatter2.currency(prePayment.get("REMAINDER_PREPAY_PERCENT"),1), 99, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("remainderSupplyamt", Formatter2.currency(prePayment.get("REMAINDER_SUPPLYAMT"),intDigit), 96, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("remainderVat", Formatter2.currency(prePayment.get("REMAINDER_VAT"),intDigit), 96, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("remainderAmt", Formatter2.currency(prePayment.get("REMAINDER_AMT"),intDigit), 96, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td><%= InputText.get("remainderPercent", Formatter2.currency(prePayment.get("REMAINDER_PERCENT"),1), 96, 16, "class=input_blank, readOnly=white, number, right, perSize, tabIndex=-1", "number") %></td>
			<td style="background-color: #e1e0e0"></td>
			<td style="background-color: #e1e0e0"></td>
			<td style="background-color: #e1e0e0"></td>
		</tr>			
	</TABLE><br/>	 --%>
	<!-- 대금정보 : 끝 -->

	<img src="/img/com/blank.gif" height="10px" />
	
	<TABLE class="form-table">	
		<colgroup>
			<col width="3%" />
			<col width="3%" />
			<col width="5%" />
			<col width="5%" />
			<col width="5%" />
			<col width="5%" />
			<col width="5%" />
			<col width="5%" />
			<col width="5%" />
			<col width="5%" />
			<col width="5%" />
			<col width="5%" />
			<col width="5%" />
			<col width="5%" />
		</colgroup>
		<TR>
			<th style="text-align: center;" colspan="2" rowspan="2"></th>
			<th style="text-align: center;" colspan="3">전회누계</th>
			<th style="text-align: center;" colspan="3">금회</th>
			<th style="text-align: center;" colspan="3">금회누계</th>
			<th style="text-align: center;" colspan="3">잔여</th>
		</TR>
		<TR>
			<th style="text-align: center;padding-left:0px;">공급가액</th>
			<th style="text-align: center;padding-left:0px;">부가세</th>
			<th style="text-align: center;padding-left:0px;">합계</th>
			<th style="text-align: center;padding-left:0px;">공급가액</th>
			<th style="text-align: center;padding-left:0px;">부가세</th>
			<th style="text-align: center;padding-left:0px;">합계</th>
			<th style="text-align: center;padding-left:0px;">공급가액</th>
			<th style="text-align: center;padding-left:0px;">부가세</th>
			<th style="text-align: center;padding-left:0px;">합계</th>
			<th style="text-align: center;padding-left:0px;">공급가액</th>
			<th style="text-align: center;padding-left:0px;">부가세</th>
			<th style="text-align: center;padding-left:0px;">합계</th>
		</TR>
		<TR>
			<th style="text-align: left;padding-left:5px;" rowspan="2">기성</th>
			<th style="text-align: left;padding-left:5px;" rowspan="1">율</th>
			<td><%= InputText.get("befAcmpPercent", Formatter2.currency(prePayment.get("BEF_ACMP_PERCENT"),1), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("blank", "", 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("blank", "", 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("curAcmpPercent", Formatter2.currency(prePayment.get("CUR_ACMP_PERCENT"),1), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("blank", "", 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("blank", "", 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("curBefAcmpPercent", Formatter2.currency(prePayment.get("CUR_BEF_ACMP_PERCENT"),1), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("blank", "", 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("blank", "", 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("remainderAcmpPercent", Formatter2.currency(prePayment.get("REMAINDER_ACMP_PERCENT"),1), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("blank", "", 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("blank", "", 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
		</TR>
		<TR>
			<th style="text-align: left;padding-left:5px;" rowspan="1">금액</th>
			<td><%= InputText.get("befAcmpApplyAmt", Formatter2.currency(prePayment.get("BEF_ACMP_APPLYAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("befAcmpVat", Formatter2.currency(prePayment.get("BEF_ACMP_VAT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("befAcmpAmt", Formatter2.currency(prePayment.get("BEF_ACMP_AMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("curAcmpApplyamt", Formatter2.currency(prePayment.get("CUR_ACMP_APPLYAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("curAcmpVat", Formatter2.currency(prePayment.get("CUR_ACMP_VAT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("curAcmpAmt", Formatter2.currency(prePayment.get("CUR_ACMP_AMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("curBefAcmpSupplyamt", Formatter2.currency(prePayment.get("CUR_BEF_ACMP_SUPPLYAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("curBefAcmpVat", Formatter2.currency(prePayment.get("CUR_BEF_ACMP_VAT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("curBefAcmpAmt", Formatter2.currency(prePayment.get("CUR_BEF_ACMP_AMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("remainderAcmpSupplyamt", Formatter2.currency(prePayment.get("REMAINDER_ACMP_SUPPLYAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("remainderAcmpVat", Formatter2.currency(prePayment.get("REMAINDER_ACMP_VAT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("remainderAcmpAmt", Formatter2.currency(prePayment.get("REMAINDER_ACMP_AMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
		</TR>
		<TR>
			<th style="text-align: left;padding-left:5px;" rowspan="2">선급<BR/>공제</th>
			<th style="text-align: left;padding-left:5px;" rowspan="1">율</th>
			<td><%= InputText.get("befPrepayPercent", Formatter2.currency(prePayment.get("BEF_PREPAY_PERCENT"),1), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("blank", "", 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("blank", "", 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("curPrepayPercent", Formatter2.currency(prePayment.get("CUR_PREPAY_PERCENT"),1), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("blank", "", 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("blank", "", 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("curBefPrepayPercent", Formatter2.currency(prePayment.get("CUR_BEF_PREPAY_PERCENT"),1), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("blank", "", 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("blank", "", 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("remainderPrepayPercent", Formatter2.currency(prePayment.get("REMAINDER_PREPAY_PERCENT"),1), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("blank", "", 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("blank", "", 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
		</TR>
		<tr>
			<th style="text-align: left;padding-left:5px;">금액</th>
			<td><%= InputText.get("befPrepayApplyAmt", Formatter2.currency(prePayment.get("BEF_PREPAY_APPLYAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("befPrepayVat", Formatter2.currency(prePayment.get("BEF_PREPAY_VAT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("befPrepayAmt", Formatter2.currency(prePayment.get("BEF_PREPAY_AMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("curPrepayApplyamt", Formatter2.currency(prePayment.get("CUR_PREPAY_APPLYAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("curPrepayVat", Formatter2.currency(prePayment.get("CUR_PREPAY_VAT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("curPrepayDeductamt", Formatter2.currency(prePayment.get("CUR_PREPAY_DEDUCTAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("curBefPrepaySupplyamt", Formatter2.currency(prePayment.get("CUR_BEF_PREPAY_SUPPLYAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("curBefPrepayVat", Formatter2.currency(prePayment.get("CUR_BEF_PREPAY_VAT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("curBefPrepayAmt", Formatter2.currency(prePayment.get("CUR_BEF_PREPAY_AMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("remainderPrepaySupplyamt", Formatter2.currency(prePayment.get("REMAINDER_PREPAY_SUPPLYAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("remainderPrepayVat", Formatter2.currency(prePayment.get("REMAINDER_PREPAY_VAT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("remainderPrepayAmt", Formatter2.currency(prePayment.get("REMAINDER_PREPAY_AMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
		</tr>			
		<tr>
			<th style="text-align: left;padding-left:5px;">청구액</th>
			<th style="text-align: left;padding-left:5px;">금액</th>
			<td><%= InputText.get("payedApplyamt", Formatter2.currency(prePayment.get("PAYED_APPLYAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("payedVat", Formatter2.currency(prePayment.get("PAYED_VAT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("payedAmt", Formatter2.currency(prePayment.get("PAYED_AMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("curReqAmt", Formatter2.currency(prePayment.get("CUR_REQ_AMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("curReqVatamt", Formatter2.currency(prePayment.get("CUR_REQ_VATAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("curReqApplyamt", Formatter2.currency(prePayment.get("CUR_REQ_APPLYAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("curPayedSupplyamt", Formatter2.currency(prePayment.get("CUR_PAYED_SUPPLYAMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("curPayedVat", Formatter2.currency(prePayment.get("CUR_PAYED_VAT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("curPayedAmt", Formatter2.currency(prePayment.get("CUR_PAYED_AMT"),intDigit), 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("blank", "", 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("blank", "", 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
			<td><%= InputText.get("blank", "", 99, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></td>
		</tr>			
	</TABLE><br/>
	
   	<div id="fAttch" class="application-info  magT10">
		<div class="application-sub-title">
			<span class="title">첨부 및 기타서류</span>
		</div>
		<div class="application-location">
		</div>
	</div>
		
	<TABLE class="form-table">
		<colgroup>
			<col width="25%" />
			<col width="*" />
			<col width="20%" />
			<col width="20%" />
		</colgroup>
		<TR>
			<th style="text-align: Center;" colspan="3">첨부서류</th>
			<th style="text-align: Center;" colspan="1">파일첨부</th>
  		</TR>
 		<TR height="140">
 			<TD colspan="3">
 			<TABLE class="inner_table" border="0" >
				<%
				if(purchaseFileRow.size() > 0){
					int i_mod = 0;
					for(int i = 0; purchaseFileRow.size() > i; i++){
						i_mod = i%3;
						if(i_mod == 0){ %>
							<TR>
					<%	} %>
								<td width="2%">
								<input type="checkbox" name="doc_cd" value="<%=purchaseFileRow.getRow(i).get("DETAILCD") %>" style="cursor:pointer;" onClick="fileCheck(this,'<%=purchaseFileRow.getRow(i).get("DETAILCD") %>')" <%if(!purchaseFileRow.getRow(i).get("DOC_CD").equals("")){out.print("checked");} %>>
								</td>
								<td width="20%">
								<%-- <%=acmpFileRow.getRow(i).get("DETAILNM").replace(" ", "<BR>") %> --%>
								<%=purchaseFileRow.getRow(i).get("DETAILNM") %>
								</td>
								<td width="7%" height="24">
								<IMG src="/img/supplier/button/bt_attach_file.gif" id="<%=purchaseFileRow.getRow(i).get("DETAILCD") %>" alt="첨부파일 관리" align="top" style="display:<%if(!purchaseFileRow.getRow(i).get("DOC_CD").equals("")){out.print("inline");}else{out.print("none");} %>" onClick="doAttachFile(document.form1.payreqId, '<%=purchaseFileRow.getRow(i).get("DETAILCD") %>', '<%=purchaseFileRow.getRow(i).get("DETAILNM")%>');" class="button">
								</td>
					<%	if(i_mod == 2) { %>		
							</TR>
					<%	} %>		
				<%
					}
					for(int i=i_mod+1; i<3; i++){ %>
						<td></td>
				<%	}
					if(i_mod == 0 || i_mod == 1){ %>
						</TR>	
				<%	}
				}
				%>
			</TABLE>		
			</TD>
			<TD><TEXTAREA name="p_AttachFile" id="p_AttachFile" rows="12" readOnly class="input ctrlTarget" style="width:98%; height: 98%; overflow-y:auto"></TEXTAREA></TD>
		</TR>
		<TR height="55">
			<th style="text-align: Center;" colspan="1">특기사항</th>
			<TD colspan="3">
				<%-- <TEXTAREA name="reMarks" id="reMarks" rows="12" maxlength="1000" class="input byteChk ctrlTarget" style="width:98%; height: 98%; overflow-y:auto"><%=prePayment.get("RE_MARKS")%></TEXTAREA> --%>
				<TEXTAREA name="reMarks" id="reMarks" rows="5" maxlength="999" class="input byteChk ctrlTarget" style="width:98%; height: 98%; overflow-y:auto"><%=prePayment.get("RE_MARKS")%></TEXTAREA>
				<!-- <INPUT type="text" name="reMarks" id="reMarks" maxlength="1000" style="width:99%;" value=""> -->
			</TD>
		</TR>
	</TABLE>

	<!-- 대금내역 : 시작 -->
	<div class="application-info  magT15">
		<div class="application-sub-title">
			<span class="title">대금내역</span>
		</div>
		<div class="application-location">
		</div>
	</div>
	
<%-- 	<TABLE class="form-table">
		<colgroup>
			<col width="12%" />
			<col width="12%" />
			<col width="26%" />
			<col width="5%" />
			<col width="5%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="*" />
		</colgroup>
		<TR>
			<th style="text-align: Center;" rowspan="2">입고번호</th>
			<th style="text-align: Center;" rowspan="2">자재코드</th>
			<th style="text-align: Center;" rowspan="2">자재명</th>
			<th style="text-align: Center;" rowspan="2">규격</th>
			<th style="text-align: Center;" rowspan="2">수량</th>
			<th style="text-align: Center;" colspan="2"><%=prePayment.get("CURRENCY_GB")%></th>
			<th style="text-align: Center;" colspan="2">KRW</th>
		</TR>
		<TR>
			<th style="text-align: Center;">단가</th>
			<th style="text-align: Center;">금액</th>
			<th style="text-align: Center;">단가</th>
			<th style="text-align: Center;">금액</th>
  		</TR>
  		<%
  		for(int i=0; i<prePaymentList.size(); i++){
  			Row row = prePaymentList.getRow(i);
  		%>
 		<TR> 
			<TD><%=row.get("STOCK_NO") %></TD>
			<TD><%=row.get("MATERIAL_CD") %></TD>
			<TD><%=row.get("MATERIAL_NAME") %></TD>
			<TD><%=row.get("MATERIAL_SPEC") %></TD>
			<TD style="text-align: right;"><%=Formatter2.currency(row.get("ITEM_QTY"),0) %></TD>
			<TD style="text-align: right;"><%=Formatter2.currency(row.get("EXC_PRI"),intDigit)%></TD>
			<TD style="text-align: right;"><%=Formatter2.currency(row.get("EXC_AMT"),intDigit)%></TD>
			<TD style="text-align: right;"><%=Formatter2.currency(row.get("ITEM_PRI"),intDigit)%></TD>
			<TD style="text-align: right;"><%=Formatter2.currency(row.get("ITEM_AMT"),intDigit)%></TD>
  		</TR>
  		<% 
  		} 
  		%>
	</TABLE> --%>
	<!-- 대금내역 : 끝 -->

	<div id="sheet1_div" style="padding-top:0px; height: auto; min-height: 200px; overflow: auto;">
		<script>createIBSheet('sheet1','100%', '200px');</script>
	</div>

<%
	/*
		보증 목록을  include 시킴 (2014-10-17) 김명호
	*/	
%>
<%@ include file="/jsp/ko_KR/supplier/portal/common/guar/guarPurList.jsp" %>

		
		
			
</FORM>


<div id="CONTROL_LAYER" style="position:absolute; z-index:10; visibility:hidden;">


<script>


</script>
</div>



<!-- 전자인증 모듈 설정 //-->
<link rel="stylesheet" type="text/css" href="/CrossCert/CC_WSTD_home/unisignweb/rsrc/css/certcommon.css?v=1" />
<script type="text/javascript" src="/CrossCert/CC_WSTD_home/unisignweb/js/unisignwebclient.js?v=1"></script>
<script type="text/javascript" src="/CrossCert/UniSignWeb_Multi_Init_Nim.js?v=1"></script>
<!-- 전자인증 모듈 설정 //-->