<%--
  - Author(s)  : Hyung min Son
  - Date       : 2014.07.22
  - Description: 낙찰업체선정상세
  --%>
  
<%@page import="monfox.toolkit.snmp.agent.modules.SnmpV2Mib.SysOREntry"%>
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Date" %>
<%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
<%@ page import="com.udapsoft.waf.common.ui.*" %>
<%@ page import="kr.co.udapsoft.common.code.*" %>
<%@ page import="kr.co.hsnc.common.util.*"%>
<%@ page import="kr.co.hsnc.common.sql.*" %>
<%@ page import="com.udapsoft.waf.common.util.Formatter2"%>
<%@ page import="com.udapsoft.waf.common.util.StringUtils"%>
<%@ page import="com.udapsoft.waf.common.ui.InitCombo" %>
<%@ page import="kr.co.udapsoft.common.code.CommCodeManager" %>
<%@ page import="kr.co.udapsoft.common.util.Crosscert"%>
<%@ 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();
    ValueObject Order = storage.getValueObject("Order");
    ValueObject filein = storage.getValueObject(Order.get("DOC_ETC_IN"));
    ValueObject fileout = storage.getValueObject(Order.get("DOC_ETC_OUT"));
    boolean o_reason = false;  //2015.3.30 개찰의견 
    boolean p_reason = false;
    boolean c_reason = false;
    boolean m_reason = false;
    if(Order.get("OPEN_OPINION").length()> 0){
    	o_reason = true;
    }
    if(Order.get("POSTPONE_REASON").length()> 0){
    	p_reason = true;
    }
    if(Order.get("CANCEL_REASON").length()> 0){
    	c_reason = true;
    }
    if(Order.get("MODIFY_REASON").length()> 0){
    	m_reason = true;
    }

    
	//공통코드
	CommCodeManager commCodeManager = new CommCodeManager();
	InitCombo initCombo = new InitCombo();

	initCombo.makeComboData(commCodeManager.getCodeRowSet("TBE_EVAL"), "NAME", "CODE");
	String TBE_EVAL_CD = initCombo.getCode();
	String TBE_EVAL_NM = initCombo.getCodeName();
	
	ValueObject sign_info = storage.getValueObject("SIGN_INFO");

	RowSet getFileListRowSet = storage.getRowSet("getFileListRowSet");
	ValueObject BidMaster = storage.getValueObject("bidmaster");
	
	String gwurl	=	"https://gw.sgcenc.co.kr/";//WAFConfig.get("gw.url.address2");
%>
<SCRIPT language="JavaScript">
document.body.onresize = addEvent( document.body.onresize, "autoResize()");
	/*예약함수*/
	var sheet1 = new ibsheetObject();
	var sheet2 = new ibsheetObject();
	var sheet3 = new ibsheetObject();
	var sheet1Row;
	var sheet1PageNo = 1;
	var pageLastRowIndex = 1;
	var validationResult = false;
	var filterShow = false;
	var succ_vendor = "";
	var btn_act = "";
	function _onReady(){
		
		//저장된 첨부파일 리스트 불러오기
	    getFileListForTextarea();
		
		/**
		 *	IBSheet object initialize
		 */
		
		gridInit(sheet1);
		gridInit(sheet2);
		gridInit(sheet3);
		
		/**
		 *	Application Initialize
		 */
		 $("#btn_list").click(function() {
				$("#fevent").val("");
				$("#form1").attr("action", "/bid/outside/SuccessBidList.screen");
				$("#form1").attr("target", "_self");
				$("#form1").attr("method", "post");
				$("#form1").submit();
		});
		 
		//2018.04.09 실행예산 수정 mklee
		 $("#ACT_AMT").keyup(function(){ act_rate();});
		 $("#CONT_AMT").keyup(function(){ act_rate();});
		 
		 $("#btn_report").click(function() {
		        var reportInfo = new ReportInfo();
	            reportInfo.title = "견적대비표";
	            reportInfo.reportName = "/report/mrd/buyer/bid/outside/bid_outside_rd.mrd";
	            reportInfo.set($("#BID_NO").val());    	// $1
		        reportInfo.set($("#BID_DEG").val());    	// $2
		        reportInfo.width = 1000;                         	// Default: 1024
		        reportInfo.height = 700;                         	// Default: 768
				reportInfo.showPopup(); 
		 });
		
		 $("#btn_save").click(function() {//저장
			var f = document.form1;
			submitXmlRequest("/bid/signidentify.screen", "CHK", f, "SUCCESS");
			btn_act = "to_Save";			 
		 });
		 
		 $("#btn_appr").click(function() {//결재
			var f = document.form1;
			submitXmlRequest("/bid/signidentify.screen", "CHK", f, "SUCCESS");
			btn_act = "to_appr";				 
		 });
		 
		 $("#btn_rebid").click(function(){//재입찰
			var f = document.form1;
			submitXmlRequest("/bid/signidentify.screen", "CHK", f, "SUCCESS");
			btn_act = "Rebid";
		 });
		
		 $("#btn_defer").click(function() {//유찰
			var f = document.form1;
			submitXmlRequest("/bid/signidentify.screen", "CHK", f, "SUCCESS");
			btn_act = "to_defer";			 
		 });
		 
		 $("#btn_plan").click(function() {//입찰계획변경
				var f = document.form1;
				submitXmlRequest("/bid/signidentify.screen", "CHK", f, "SUCCESS");
				btn_act = "to_plan";			 
		});
		 
		 //2015.10.26 환율적용 
		 $("#btn_Currency").click(function() {
			 var hidden = sheet1.GetColHidden("CURRENCY_GB");
			 if(hidden == 0){
				 $("#KRW_APPR_YN").val("N");
				 sheet1.SetColHidden("CURRENCY_GB", true);
				 sheet1.SetColHidden("EXCHANGE", true);
				 sheet1.SetColHidden("WON_ESTI_TOT_AMT", true);
				 sheet1.SetColHidden("CHAGE_HP", false);
				 sheet1.SetColHidden("CHARGE_EMAIL", false);
				 sheet1.FitColWidth();
			 }else{
				 $("#KRW_APPR_YN").val("Y");
				 sheet1.SetColHidden("CURRENCY_GB", false);
				 sheet1.SetColHidden("EXCHANGE", false);
				 sheet1.SetColHidden("WON_ESTI_TOT_AMT", false);
				 sheet1.SetColHidden("CHAGE_HP", true);
				 sheet1.SetColHidden("CHARGE_EMAIL", true);
				 sheet1.FitColWidth();
			 }			 
	 	 });
		 
		 
		 $("#btn_tbecheckpop").click(function() {
			 var win_id = "_TBECheckPop";
			 var link = "/bid/outside/TBECheckPop.screen";
			       link += "?pop_win_id="+win_id;
			       link += "&BID_NO="+$("#BID_NO").val();
			       link += "&BID_DEG="+$("#BID_DEG").val();
			       link += "&RTN_YN=Y";
			fLayerPop(win_id, link, 900,450, '', '', 'YES');
	 	});
		 
		 
		 var status = "<%=Order.get("STATUS_CD")%>";
		 if(status == "07"){
		//	 	$("#btn_save").hide();
				$("#btn_appr").hide();
				$("#btn_defer").hide();
				$("#btn_rebid").hide();
				sheet3.SetColHidden("DEL_CHECK", true);
		 }else if(!(status == "06" ||status == "95") && "<%=Order.get("ONBID_YN")%>" == "Y"){
			 $("#btn_appr").hide();
		 }else if(status == "10"){
			 sheet3.SetColHidden("DEL_CHECK", true);
		 }
		
		 if($("#ONBID_YN").val() == "N"){
			 $("#btn_rebid").hide();
		 }
		 
		 if($("#TBE_FLAG").val() != "Y"){
			 $("#btn_tbecheckpop").hide();
		 }
		 
		$(document).on("blur", "#CONF_NO", function() {
			
			$("#CONF_NO").val($("#CONF_NO").val().toUpperCase().replace(/ /g, ''));
	     });
		
		//2015.11.23
		if("<%=Order.get("CURRENCY_GB_NM") %>" == "KRW(한국)"){
			$("#btn_Currency").hide();			
		 }
		
		$("#report_emp_add").click(function(){
			SearchUser('REPORT_EMP','REPORT_EMP','N');
		});
		
		$("#report_emp_del").click(function() {
			if(confirm("삭제 하시겠습니까?")){
				$("#fevent").val("SET_REPORT_EMP_DELETE");
				var url = Modular.model.PageContext.CONTEXT_ROOT + "/bid/outside/SuccessBid_sheet.screen";
				var result = Modular.view.IBSheet7.doSave(sheet3, url, $("#form1"), false);
			}
		});
		
		//유관부서 담당자 조회
		doSearchsheet3();		
		//보고자 조회
		doSearchSheet2();
	}
	
	function PopClose(win_id,result){
		if( result != null ){
			if(win_id == "_BidOfflineAmtPop"){
				doSearchSheet();
				setTimeout(function(){fLayerPopClose(win_id);},100);
			}else{
				if(result[0] == 0){
					setTimeout(function(){fLayerPopClose(win_id);},100);
					if(result[1].length> 0)alert(result[1]);
					$("#btn_list").click();
				}else if(result[0] == 1){
					setTimeout(function(){	fLayerPopClose(win_id);},100);
					if(result[1].length> 0)alert(result[1]);
					$("#fevent").val("FORM_SELECT");
					$("#form1").attr("action", "/bid/outside/SuccessBid.screen");
					$("#form1").attr("target", "_self");
					$("#form1").attr("method", "post");
					$("#form1").submit();
				}
			}
		}else{
			setTimeout(function(){fLayerPopClose(win_id);},100);
		}
		
	}

	function doSearchSheet(){
		$("#fevent").val("GET_CORP_LIST");
		var url = Modular.model.PageContext.CONTEXT_ROOT + "/bid/outside/SuccessBid_sheet.screen";
		Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 30, "");
	}

	function doSearchSheet2(){
		$("#fevent").val("GET_REPORT_EMP_LIST");
		var url = Modular.model.PageContext.CONTEXT_ROOT + "/bid/outside/BidPlan_sheet.screen";
		Modular.view.IBSheet7.doSearch(sheet2, url, jQuery("#form1"), 30, "");
	}
	
	function doSearchsheet3(){
		$("#fevent").val("GET_REPORT_EMP_LIST");
		var url = Modular.model.PageContext.CONTEXT_ROOT + "/bid/outside/SuccessBid_sheet.screen";
		Modular.view.IBSheet7.doSearch(sheet3, url, jQuery("#form1"), 30, "");
	}
	
	function doSaveSheet3(){
		$("#fevent").val("REPORT_EMP_UPDATE");
		var url = Modular.model.PageContext.CONTEXT_ROOT + "/bid/outside/SuccessBid_sheet.screen";
		var result = Modular.view.IBSheet7.doSave(sheet3, url, $("#form1"), false);
	}
	
	function sheet3_OnSaveEnd(code, msg)
	{
		var event = $("#fevent").val();
		if(event == "SET_REPORT_EMP_DELETE"){
			if(code>= "0"){
				alert("삭제되었습니다.");
				doSearchSheet3();
			}else{
				alert("에러가 발생하였습니다.\n"+msg);
				document.form1.isSubmit = false;
			}
		}else if(event == "REPORT_EMP_UPDATE"){
			if(code>= "0"){
				if(btn_act == "to_appr"){
					document.form1.isSubmit = false;
					var f = document.form1;
					var sign_bid_no = $("#BID_NO").val();
					var sign_bid_deg = $("#BID_DEG").val();	
					dlgSignForm('ebid_opoD', '/bid/outside/BidSuccessSign.screen?sign_bid_no='+sign_bid_no+'^sign_bid_deg='+sign_bid_deg+'^acct_id='+'<%=user.get("ACCT_ID")%>');
				} else {
					alert("저장되었습니다.");
					refresh();
				}
			}else{
				alert("에러가 발생하였습니다.\n"+msg);
				document.form1.isSubmit = false;
			}
		}
	}
	
	function refresh(){//저장
		$("#fevent").val("FORM_SELECT");
		$("#form1").attr("action", "/bid/outside/SuccessBid.screen");
		$("#form1").attr("target", "_self");
		$("#form1").attr("method", "post");
		$("#form1").submit();
	}
	/**
	 *	IBSheet object initialize
	 */
	function gridInit(sheetName){
		var init_sheet = {};
		if(sheetName.id == "sheet1"){
			init_sheet.Cfg = {SearchMode:2, Page:30 , MergeSheet:msHeaderOnly};
			init_sheet.Cols = [
			       			{Header:'삭제|삭제',											Type:"DelCheck",		SaveName:"DEL_CHECK", 					Width:0, 		Align:"Center",	Hidden:"True"},
			    			{Header:'Status|Status',									Type:"Status", 		    SaveName:"STATUS", 						Width:0, 		Align:"Center",	Hidden:"True"},
			    			{Header:'No.|No.',											Type:"Seq", 			SaveName:"NO",								Width:0, 		Align:"Center",	Hidden:"True"},
			    			{Header:'지명부서|지명부서',									Type:"Text", 			SaveName:"RECM_DEPT_NM", 			Width:100,		Align:"Center", Edit:false},
			    			{Header:'사업자번호|사업자번호',								Type:"Text", 			SaveName:"VENDOR_NO", 					Width:100,		Align:"Center", Format:"SaupNo", Edit:false},
			    			{Header:'업체명|업체명',										Type:"Text", 			SaveName:"VENDOR_NAME", 				Width:100, 		Align:"Center", Edit:false},
			    			{Header:'대표자명|대표자명',									Type:"Text", 			SaveName:"REPRE_NO", 					Width:100, 		Align:"Center", Edit:false},
			    			{Header:'담당자명|담당자명',									Type:"Text",	 		SaveName:"CHARGE_NAME", 				Width:100, 		Align:"Center", Edit:false},
			    			{Header:'핸드폰|핸드폰',										Type:"Text", 			SaveName:"CHAGE_HP", 					Width:100, 		Align:"Center", Edit:false},
			    			{Header:'대표번호|대표번호',									Type:"Text", 			SaveName:"CORP_TEL",					Width:100, 		Align:"Center", Edit:false},
			    			{Header:'이메일|이메일',										Type:"Text", 			SaveName:"CHARGE_EMAIL", 				Width:100, 		Align:"Center", Edit:false},
			    			{Header:'통화|통화',											Type:"Text", 			SaveName:"CURRENCY_GB", 				Width:100, 		Align:"Center", Edit:false},  //2015.10.26
			    			{Header:'견적금액|견적금액',									Type:"Text", 			SaveName:"ESTI_TOT_AMT", 				Width:180, 		Align:"Right", Edit:false,			Cursor:"pointer"},
	/* 		    			{Header:'견적대비 \n실행율(%)|견적대비 \n실행율(%)',		Type:"Text", 			SaveName:"ESTI_TOT_RATE", 			Width:100, 		Align:"Right", Edit:false}, */
			    			{Header:'예상환율|예상환율',									Type:"Float", 			SaveName:"EXCHANGE", 					Width:100, 		Align:"Right"},  //2015.10.26        
				    		{Header:'원화금액|원화금액',									Type:"Int", 				SaveName:"WON_ESTI_TOT_AMT", 		Width:160, 		Align:"Right",   Edit:false,		CalcLogic:"|ESTI_TOT_AMT_I|*|EXCHANGE|"},   //2015.10.26
				    		{Header:'외주예산대비\n견적가율(%)|외주예산대비\n견적가율(%)',		Type:"Text", 			SaveName:"ESTI_TOT_RATE", 			Width:100, 		Align:"Right", Edit:false},
			    			{Header:'기술검토(TBE)|첨부파일',							Type:"Text", 			SaveName:"FILE_CNT", 						Width:100, 		Align:"Center", Edit:false,	Hidden:"True"},
			    			{Header:'기술검토(TBE)|TBE여부',							Type:"Combo", 		SaveName:"TBEEVALUATE_YN", 			Width:100, 		Align:"Center", ComboText:"√|-", ComboCode:"Y|N", Edit:false,	Hidden:"True"},
			    			{Header:'기술검토(TBE)|기술검토(TBE)',					Type:"Combo", 		SaveName:"EVAL_RESULT", 				Width:100, 		Align:"Center", ComboText:"<%=TBE_EVAL_NM%>", ComboCode:"<%=TBE_EVAL_CD%>" <%if("Y".equals(Order.get("ONBID_YN"))){%>, Edit:false<%}%>},
			    			{Header:'업체\n선정|업체\n선정',								Type:"CheckBox", 	SaveName:"SUCC_YN_CK", 				Width:100, 		Align:"Center"},
			    			{Header:'업체\n선정|업체\n선정',								Type:"Text", 			SaveName:"SUCC_YN", 						Width:100, 		Align:"Center",	Hidden:"True"},
			    			{Header:'결격\n사유|결격\n사유',								Type:"PopupEdit", 	SaveName:"DISQ_YN", 						Width:100, 		Align:"Center", Edit:false	,			Cursor:"pointer"},
			    			{Header:'DISQ_REASON|DISQ_REASONO',				Type:"Text", 			SaveName:"DISQ_REASON", 				Width:100, 		Align:"Center",	Hidden:"True"},
			    			{Header:'BID_NO|BID_NO',									Type:"Text", 			SaveName:"BID_NO", 						Width:100, 		Align:"Center",	Hidden:"True"},
			    			{Header:'BID_DEG|BID_DEG',								Type:"Text", 			SaveName:"BID_DEG", 						Width:100, 		Align:"Center",	Hidden:"True"},
			    			{Header:'VENDOR_CD|VENDOR_CD',						Type:"Text", 			SaveName:"VENDOR_CD", 					Width:100, 		Align:"Center",	Hidden:"True"},
			    			{Header:'FILE_GB|FILE_GB',								Type:"Text", 			SaveName:"FILE_GB", 						Width:100, 		Align:"Center",	Hidden:"True"},
			    			{Header:'SITEPARTI_YN|SITEPARTI_YN',				Type:"Text", 			SaveName:"SITEPARTI_YN", 				Width:100, 		Align:"Center",	Hidden:"True"},
			    			{Header:'BID_RNNC_DT|BID_RNNC_DT',				Type:"Text", 			SaveName:"BID_RNNC_DT", 				Width:100, 		Align:"Center",	Hidden:"True"},
			    			{Header:'BID_RNNC_ID|BID_RNNC_ID',					Type:"Text", 			SaveName:"BID_RNNC_ID", 				Width:100, 		Align:"Center",	Hidden:"True"},
			    			{Header:'BID_RNNC_NM|BID_RNNC_NM',				Type:"Text", 			SaveName:"BID_RNNC_NM", 				Width:100, 		Align:"Center",	Hidden:"True"},
			    			{Header:'RNNC_REASON|RNNC_REASON',				Type:"Text", 			SaveName:"RNNC_REASON", 				Width:100, 		Align:"Center",	Hidden:"True"},
			    			{Header:'ESTI_TOT_AMT_I|ESTI_TOT_AMT_I',		Type:"Text", 			SaveName:"ESTI_TOT_AMT_I", 				Width:180, 		Align:"Right",  Hidden:"True"},
			    			{Header:'SIGN_DT|SIGN_DT',								Type:"Text", 			SaveName:"SIGN_DT", 						Width:100, 		Align:"Center",	Hidden:"True"}
			];
		}else if(sheetName.id == "sheet2"){
			init_sheet.Cfg = {SearchMode:2, Page:30 , MergeSheet:msHeaderOnly,SizeMode:1};
			init_sheet.Cols = [
					       		{Header:'삭제',			Type:"DelCheck",		SaveName:"DEL_CHECK", 		Width:0, 		Align:"Center",	Hidden:"True"},
					    		{Header:'Status',		Type:"Status", 			SaveName:"STATUS", 			Width:0, 		Align:"Center",	Hidden:"True"},
	   			    			{Header:'No.',			Type:"Seq", 			SaveName:"NO",				Width:0, 		Align:"Center", Hidden:"True"},
	   			    			{Header:'계정ID',		Type:"Text", 			SaveName:"ACCT_ID", 		Width:0, 		Align:"Center", Hidden:"True"},
	   			    			{Header:'이름',			Type:"Text", 			SaveName:"USER_NAME", 		Width:100, 		Align:"Center", Edit:false},
	   			    			{Header:'부서명',			Type:"Text", 			SaveName:"BUSEO_NAME", 		Width:150, 		Align:"Left", Edit:false},
	   			    			{Header:'직위명',			Type:"Text", 			SaveName:"GRADE_NAME", 		Width:100, 		Align:"Center", Edit:false}
				];
		}else if(sheetName.id == "sheet3"){
			init_sheet.Cfg = {SearchMode:2, Page:30,MergeSheet:msHeaderOnly,SizeMode:1};
			init_sheet.Cols = [
				       		{Header:'삭제',			Type:"DelCheck",		SaveName:"DEL_CHECK", 		Width:0, 		Align:"Center"},
				    		{Header:'Status',		Type:"Status", 			SaveName:"STATUS", 			Width:0, 		Align:"Center",	Hidden:"True"},
   			    			{Header:'No.',			Type:"Seq", 			SaveName:"NO",				Width:0, 		Align:"Center", Hidden:"True"},
   			    			{Header:'계정ID',		Type:"Text", 			SaveName:"ACCT_ID", 		Width:0, 		Align:"Center", Hidden:"True"},
   			    			{Header:'이름',			Type:"Text", 			SaveName:"USER_NAME", 		Width:100, 		Align:"Center", Edit:false},
   			    			{Header:'부서명',			Type:"Text", 			SaveName:"BUSEO_NAME", 		Width:150, 		Align:"Left", 	Edit:false},
   			    			{Header:'직위명',			Type:"Text", 			SaveName:"GRADE_NAME", 		Width:100, 		Align:"Center", Edit:false}
				];
			init_sheet.HeaderMode = {Sort:1};
		}
		
		init_sheet.HeaderMode = {Sort:1,HeaderCheck:false};
		IBS_InitSheet(sheetName, init_sheet);
		sheetName.SetDataAutoTrim(0);
		setGridSize();
	}
	
	function sheet1_OnChange(Row, Col, Value) {
		if(Col == 19){
			var DISQ = sheet1.GetCellValue(Row, "DISQ_REASON");
			if(DISQ.length > 0){
				sheet1.SetCellValue(Row, "SUCC_YN_CK", false, false);
				alert("결격사유가 입력된 업체 입니다.\n업체 선정 할 수 없습니다.");
				return;
			}
			
			if(jQuery("#ONBID_YN").val() == "Y"){
				if(sheet1.GetCellValue(Row, "SITEPARTI_YN") == 'Y'){
					if(sheet1.GetCellValue(Row, "ESTI_TOT_AMT") == 0 ||sheet1.GetCellValue(Row, "ESTI_TOT_AMT") == ""  || sheet1.GetCellValue(Row, "ESTI_TOT_RATE") == ""){
						sheet1.SetCellValue(Row, "SUCC_YN_CK", false, false);
						alert("견적금액이 없는 업체는 업체 선정 할 수 없습니다.");
						return;
					}
				}else{
					
					sheet1.SetCellValue(Row, "SUCC_YN_CK", false, false);
					alert("견적설명회 참여하지 않은 업체는 선정 할 수 없습니다.");
					return;
				}
			}else{
				if(sheet1.GetCellValue(Row, "ESTI_TOT_AMT") == 0 ||sheet1.GetCellValue(Row, "ESTI_TOT_AMT") == ""  || sheet1.GetCellValue(Row, "ESTI_TOT_RATE") == ""){
					sheet1.SetCellValue(Row, "SUCC_YN_CK", false, false);
					alert("견적금액이 없는 업체는 업체 선정 할 수 없습니다.");
					return;
				}
			}
			
			//2017.12.19 환율적용 안되면 선정불가
			if(sheet1.GetCellValue(Row, "CURRENCY_GB") != "KRW" && sheet1.GetCellValue(Row, "WON_ESTI_TOT_AMT") == 0 ){
				alert("외화 계약인 경우 환율을 적용하십시요.");
				sheet1.SetCellValue(Row, "SUCC_YN_CK", false, false);
				return;
			}
			
			if(chkcount() > 1){
				alert("업체 선정은 한곳만 하실 수 있습니다.");
				sheet1.SetCellValue(Row, "SUCC_YN_CK", false, false);
				return;
			}
		}
	}
	
	
	function chkcount(){
		var rowcnt = sheet1.RowCount();
		var chkcount = 0;
		if(rowcnt> 0){
			for(var r=2; r < rowcnt+2; r++){
				if(sheet1.GetCellValue(r, "SUCC_YN_CK") == true){
					chkcount++;
				}
			}
		}
		return chkcount;
	}
	/**
	 *	IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
	 */
	function sheet1_OnSearchEnd(code, message) {
	    if(code == 0) {
	    	setGridSize();
	    	//sheet1.SetColFontColor("ESTI_TOT_AMT", "#0000ff");
	    	var rowcnt = sheet1.RowCount();
			if(rowcnt> 0){
				for(var r=2; r < rowcnt+2; r++)
				{
					if(sheet1.GetCellValue(r, "SUCC_YN_CK") == '1'){
						succ_vendor = r;
					}
					if(sheet1.GetCellValue(r, "SITEPARTI_YN") == 'Y' && sheet1.GetCellValue(r, "SIGN_DT").length > 3){
						sheet1.SetCellFontColor(r,"ESTI_TOT_AMT", "#0000ff");
					}
					if(sheet1.GetCellValue(r, "BID_RNNC_DT") != ""){
						sheet1.SetCellFontColor(r,"ESTI_TOT_AMT", "#0000ff");
					}
					if(sheet1.GetCellValue(r, "ESTI_TOT_RATE") == ""){
						sheet1.SetCellEditable(r , "SUCC_YN_CK", false);
					}
					
					if(sheet1.GetCellValue(r, "EVAL_RESULT") == "03"){
						sheet1.SetCellEditable(r , "SUCC_YN_CK", false);
					}
					
					//2015.10.26 수정 
					if(sheet1.GetCellValue(r, "CURRENCY_GB") == "KRW"){
						sheet1.SetCellEditable(r , "EXCHANGE", false);
						sheet1.SetColHidden("EXCHANGE", true);
						sheet1.SetColHidden("WON_ESTI_TOT_AMT", true);
					    sheet1.FitColWidth();
					}
				}
			}
		} else {
			//조회 에러 수행
			alert(message);
		}
	}
	
	/**
	 *	IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
	 */
	function sheet2_OnSearchEnd(code, message) {
		 if(code == 0) {
			//sheet2.FitColWidth();
			//견적대상 업체 조회
			doSearchSheet();
		} else {
			//조회 에러 수행
			alert(message);
		}
	}

	function sheet3_OnSearchEnd(code, message) {
		 if(code == 0) {
			//sheet3.FitColWidth();
			//견적대상 업체 조회
			doSearchSheet();
		} else {
			//조회 에러 수행
			alert(message);
		}
	}
	
	function SearchUser(NAME,CODE,DEPT_YN){
		if(CODE == "PUREMPNO"){
			CODE = "";
			NAME = "";
			GB = "PUREMP";
		}else if(CODE == "SITEDESCCHRGPRSNID"){
			CODE = "";
			NAME = "";
			GB = "SITEDESCCHRGPRSN";
		}else if(CODE == "REPORT_EMP"){
			CODE = "";
			NAME = "";
			GB = "REPORT_EMP";
		}else{
			GB = "";
		}
		var win_id = "_searchUserPopup";
		var link = "/lib/dlgSearchUserPop.screen";
		    link += "?pop_win_id="+win_id;
		    link += "&NAME="+NAME;
		    link += "&CODE="+CODE;
		    link += "&GB="+GB;
		    if(DEPT_YN == "Y")
		    	link += "&deptNameYn=outside";
		fLayerPop(win_id, link, 700,400, '', '', 'NO');
	}
	
	function SearchUserClose(result){
		if(result[10] == "PUREMP"){
			$("#PUREMPNO").val(result[9])//ACCT_ID
			$("#PUREMPNM").val(result[1])//이름
			$("#PO_EMPNM").val(result[6])//연락처
		}else if(result[10] == "SITEDESCCHRGPRSN"){
			$("#SITEDESCCHRGPRSNID").val(result[9])//ACCT_ID
			$("#SITEDESCCHRGPRSNNM").val(result[1])//이름
			$("#SITEDESCTELNO").val(result[6])//연락처
			$("#SITEDESCEMAIL").val(result[8])//이메일
		}else if(result[10] == "REPORT_EMP"){
	 		var rowcnt = sheet3.RowCount();
			 if(rowcnt> 0){
				for(var r=0; r < rowcnt; r++)
				{
					var acct_id = sheet3.GetCellValue(r+1,"ACCT_ID");
					if(acct_id == result[9]){
						alert(result[1]+" " +result[5]+ "님은 이미 등록된 유관부서 담당자 입니다.");
						return;
					}
				}
			} 
	 		//sheetObj.DataAutoTrim = false;
			var row = sheet3.DataInsert(-1);
			sheet3.SetCellValue(row,"ACCT_ID",result[9]);
			sheet3.SetCellValue(row,"USER_NAME",result[1]);
			sheet3.SetCellValue(row,"BUSEO_NAME",result[3]);
			sheet3.SetCellValue(row,"GRADE_NAME",result[5]);
		}
		setTimeout(function(){	fLayerPopClose('_searchUserPopup');},100);
	}

	/**
	 *	IBSheet size setting
	 */
	function setGridSize() {
		sheet1.FitColWidth();
	}
	
	function sheet1_OnSaveEnd(code, msg)
	{
		var event = $("#fevent").val();
		if(event == "SAVE_APPR"){
			if(jQuery("#PO_PRC").val() == null || jQuery("#PO_PRC").val() == ''){
			 	alert("발주진행율 등록해주십시오.");
			 	jQuery("#PO_PRC").focus();
			 	return;
		     }
		     if(jQuery("#RES_PRC").val() == null || jQuery("#RES_PRC").val() == ''){
			 	alert("실적진행율 등록해주십시오.");
			 	jQuery("#RES_PRC").focus();
			 	return;
		     }
		     
			if(code>= "0"){
				doSaveSheet3();
				/*
				document.form1.isSubmit = false;
				var f = document.form1;
				var sign_bid_no = $("#BID_NO").val();
				var sign_bid_deg = $("#BID_DEG").val();	
				dlgSignForm('ebid_opoD', '/bid/outside/BidSuccessSign.screen?sign_bid_no='+sign_bid_no+'^sign_bid_deg='+sign_bid_deg+'^acct_id='+'<%=user.get("ACCT_ID")%>');
				*/
				/* alert("결재되었습니다.");
				$("#btn_list").click(); */
			}else{
				alert(msg);
			}
		}else if(event == "SAVE_SHEET"){
			if(code>= "0"){
				doSaveSheet3();
				/*
				alert("저장되었습니다.");
				$("#fevent").val("FORM_SELECT");
				$("#form1").attr("action", "/bid/outside/SuccessBid.screen");
				$("#form1").attr("target", "_self");
				$("#form1").attr("method", "post");
				$("#form1").submit();
				*/
			}else{
				alert("에러가 발생하였습니다.\n" + msg);
			}
		}else if(event == "SAVE_PLAN"){
			if(code>= "0"){
				alert("변경되었습니다.");
				$("#fevent").val("FORM_SELECT");
				$("#form1").attr("action", "/bid/outside/OfflineBid.screen");
				$("#form1").attr("target", "_self");
				$("#form1").attr("method", "post");
				$("#form1").submit();
			}else{
				alert("에러가 발생하였습니다.\n" + msg);
			}
		}
	}
	
	//결재
	function dlgSignForm( sign_class_cd, uri ) {
		var f = document.form1;
		var sheet1 = document.all.sheet1;
		var url = "/bidOutsideSign/BidSuccessSign_form.screen";
		url += "?sign_class_cd=" + sign_class_cd;
		url += "&uri="           + uri;
		url += "&sign_bid_no="   + $("#BID_NO").val();
		url += "&sign_bid_deg="   + $("#BID_DEG").val();
		url += "&acct_type=1";
		window.open(url, "_blank","width=200,height=100,SCROLLBARS=no");
	}
	
	//첨부파일   
	function doAttachFile(obj,No) {
		var file_div = "bid/outside/"+"<%=Order.get("BID_NO")%>"+"/";
		var fileName = "<%=Order.get("DEMANDED_NO")%>" + "(" + "<%=Order.get("DEMANDED_TITLE")%>" + ")_";
		 if(obj==''){
			 alert("After you have saved, you can attach a file.");
		}
		else if(obj != ''){ 
			if(No == 1){
				fileName += "내부자료";
				<%-- viewFileListNew("<%=Order.get("DOC_ETC_IN")%>", obj.value, document.form1.p_AttachFile1, "Y", file_div); --%>
				viewFileListNew("<%=Order.get("DOC_ETC_IN")%>", obj.value, document.form1.p_AttachFile1, "Y", file_div, null, null, null, null, "Y", fileName);
			}else{
				fileName += "외부자료";
				<%-- viewFileListNew("<%=Order.get("DOC_ETC_OUT")%>", obj.value, document.form1.p_AttachFile2, "Y", file_div); --%>
				viewFileListNew("<%=Order.get("DOC_ETC_OUT")%>", obj.value, document.form1.p_AttachFile2, "Y", file_div, null, null, null, null, "Y", fileName);
			}
		}
	}
	
	function doResult(resultObj) {
		try {
			if( resultObj.getRequestEvent() == "CHK") {
				if( resultObj.getSuccess() ) {
					document.form1.isSubmit = false;
					if(btn_act == "to_fileDw"){//결재중이 아니면 파일 수정가능
						jQuery("#signCheck").val("");
						doAttachFile2(jQuery("#fileGB").val(), jQuery("#fileID").val());
					}else if(btn_act == "to_fileCk"){//결재중이 아니면 파일 수정가능
						jQuery("#signCheck").val("");
						fileAfterCheck(jQuery("#ckVal").val());
					}else {
						submitXmlRequest("/bid/outside/SuccessBid_form.screen", "PO_CHECK", document.form1, "VALUEOBJECT");
					}
				}
				else {
					if(btn_act == "to_fileDw"){
						jQuery("#signCheck").val("N");
						doAttachFile2(jQuery("#fileGB").val(), jQuery("#fileID").val());
					}else if(btn_act == "to_fileCk"){
						jQuery("#signCheck").val("N");
						fileAfterCheck(jQuery("#ckVal").val());
					}else {					
						alert("시행결의중입니다.");
					}
					document.form1.isSubmit = false;
					return;
				}
			}
			
			if(resultObj.getRequestEvent() == "PO_CHECK"){
				if(resultObj.getSuccess()){
					document.form1.isSubmit = false;	
					var vo = resultObj.getValueObject();
					var cnt = vo.get("cnt");
					if(cnt == 0){
						if(btn_act == "Rebid"){
							 if (confirm("재입찰 하시겠습니까?")){
								$("#fevent").val("FORM_SELECT");
								$("#form1").attr("action", "/bid/outside/Rebid.screen");
								$("#form1").attr("target", "_self");
								$("#form1").attr("method", "post");
								$("#form1").submit();
							 }
						}else if(btn_act == "to_Save"){
							if (confirm("저장 하시겠습니까?")){
								jQuery("#fevent").val("SAVE_SHEET");
								var url = Modular.model.PageContext.CONTEXT_ROOT + "/bid/outside/SuccessBid_sheet.screen";
								Modular.view.IBSheet7.doSave(sheet1, url, jQuery("#form1"), 30, "");
							}
						}else if(btn_act == "to_appr"){
							 if(chkcount() == 0){
								alert("업체선정을 해주세요.");
								return;
							 }
							if (confirm("결재 하시겠습니까?")){
								jQuery("#fevent").val("SAVE_APPR");
								var url = Modular.model.PageContext.CONTEXT_ROOT + "/bid/outside/SuccessBid_sheet.screen";
								Modular.view.IBSheet7.doSave(sheet1, url, jQuery("#form1"), 30, "");
							}
						}else if(btn_act == "to_defer"){
							 if (confirm("유찰 하시겠습니까?")){
								 var win_id = "_CancelBidPop";
								 var link = "/bid/outside/CancelBidPop.screen";
										link += "?pop_win_id="+win_id;
										link += "&BID_NO="+$("#BID_NO").val();
										link += "&BID_DEG="+$("#BID_DEG").val();
										link += "&DEMANDED_ID="+$("#DEMANDED_ID").val();
								fLayerPop(win_id, link, 600,210, '', '', 'NO');
							 }
						}else if(btn_act == "to_plan"){
							 if (confirm("수정 하시겠습니까?")){
									$("#fevent").val("FORM_SELECT");
									$("#form1").attr("action", "/bid/outside/OfflineBid.screen");
									$("#form1").attr("target", "_self");
									$("#form1").attr("method", "post");
									$("#form1").submit();
								 	//jQuery("#fevent").val("SAVE_PLAN");
									//var url = Modular.model.PageContext.CONTEXT_ROOT + "/bid/outside/SuccessBid_sheet.screen";
									//Modular.view.IBSheet7.doSave(sheet1, url, jQuery("#form1"), 30, "");
							 }
						}
					}else{
						alert("중복된 계약 번호가 있습니다.");
					}
				}else{
					dlgErrorMsg(resultObj);
				}
				
			}
			
			if( resultObj.getRequestEvent() == "FORM_DELETE") {
				if( resultObj.getSuccess() ) {
					alert("삭제 되었습니다.");
 					$("#btn_list").click();
				}
				else {
					dlgErrorMsg(resultObj);
				}
			}
			
			if(resultObj.getRequestEvent() == "GET_ATTACHFILE")
	    	{
	    		if( resultObj.getSuccess() ) {				
					document.form1.p_AttachFile3.value = resultObj.getValueObject().get("AttachFile");
				}else {
					dlgErrorMsg(resultObj);
				}
				document.form1.isSubmit = false;
	    	}			
		} catch(errorObject) {
			showErrorDlg("doResult()", errorObject);
		}
	}
	
	function sheet1_OnSmartResize(Width, Height) { 
		sheet1.FitColWidth();
		autoResize();
	}

	function autoResize(){
		//var t1_height = document.getElementById("t1").scrollHeight + 10;
		var iframeHeight= 170;   
		var iframeWidth= document.body.scrollWidth;   
		sheet1.SetSheetHeight(iframeHeight); 
	}	
	
	//2018.04.09 mklee 실행대비율 자동계산 추가 
	function act_rate(){
		var cont = $("#CONT_AMT").val();
		if(cont == "")
			cont = 0;
		else
			cont = cont.replace(/,/gi,"");
		
		var act = $("#ACT_AMT").val();
		if(act == "")
			act = 0;
		else
			act = act.replace(/,/gi,"");
		
		if(cont > 0 && act > 0){
			var rate = Number(act)/Number(cont) * 100;
			$("#ACT_RATE").val(Math.round(rate *10)/10);
		}else{
			$("#ACT_RATE").val("0");
		}
	}
	
	function btnEvent(num){
		if(num == '1')
			$("#btn_list").click();
		if(num == '2')
		if(num == '3')
			 $("#btn_defer").click();
		if(num == '4')
			$("#btn_cancel").click();
	}
	
	/**
	 *	IBSheet Event: Click
	 */
	
	function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
		 if(Row == 0)return;
		 var Sn = sheet1.GetCellProperty(Row, Col, "SaveName");
		 if(Sn == "ESTI_TOT_AMT"){
			if(Value != ""){
				if(sheet1.GetCellValue(Row,"SITEPARTI_YN") == "Y" && sheet1.GetCellValue(Row, "SIGN_DT").length > 3){
					if(sheet1.GetCellValue(Row,"BID_RNNC_DT") == ""){
						 $("#fevent").val("VENDOR_INFO_SELECT");
						  var win_id = "_BidAmtPop";
					 	  var  link = "/bid/outside/BidAmtPop.screen";
							link += "?pop_win_id="+win_id;
							link += "&ROW="+Row;
							link += "&VENDOR_CD="+sheet1.GetCellValue(Row,"VENDOR_CD");
							link += "&BID_NO="+sheet1.GetCellValue(Row,"BID_NO");
							link += "&BID_DEG="+sheet1.GetCellValue(Row,"BID_DEG");
							link += "&FILE_GB="+sheet1.GetCellValue(Row,"FILE_GB");
							link += "&VENDOR_NO="+sheet1.GetCellValue(Row,"VENDOR_NO");
							link += "&VENDOR_NAME="+sheet1.GetCellValue(Row,"VENDOR_NAME");
							link += "&ESTI_TOT_AMT="+sheet1.GetCellValue(Row,"ESTI_TOT_AMT");
							link += "&DEMANDED_ID="+$("#DEMANDED_ID").val();
					       fLayerPop(win_id, link, 1200,690, '', '', 'NO');
					}
				}else if(sheet1.GetCellValue(Row,"SITEPARTI_YN") == "Y" && sheet1.GetCellValue(Row,"BID_RNNC_DT") != ""){
					      var win_id = "_BidGiveupPop";
						  var link = "/bid/outside/BidGiveupPop.screen";
							link += "?pop_win_id="+win_id;
							link += "&VENDOR_CD="+$("#VENDOR_CD").val();
							link += "&BID_NO="+$("#BID_NO").val();
							link += "&BID_DEG="+$("#BID_DEG").val();
							link += "&ROW="+Row;
					       fLayerPop(win_id, link, 600,190, '', '', 'NO');
				}else if($("#ONBID_YN").val() == "N"){
					var win_id = "_BidOfflineAmtPop";
					var link = "/bid/outside/BidOfflineAmtPop.screen";
					link += "?pop_win_id="+win_id;
					link += "&ROW="+Row;
					link += "&VENDOR_CD="+sheet1.GetCellValue(Row,"VENDOR_CD");
					link += "&VENDOR_NO="+sheet1.GetCellValue(Row,"VENDOR_NO");
					if(sheet1.GetCellValue(Row,"ESTI_TOT_AMT") != "미참여"){
						link += "&ESTI_TOT_AMT="+sheet1.GetCellValue(Row,"ESTI_TOT_AMT");
					}else{
						link += "&ESTI_TOT_AMT=";
					}
					link += "&BID_NO="+$("#BID_NO").val();
					link += "&BID_DEG="+$("#BID_DEG").val();
					link += "&FILE_GB="+sheet1.GetCellValue(Row,"FILE_GB");
					link += "&DEMANDED_ID="+$("#DEMANDED_ID").val();
					link += "&OBC_EMP_YN="+$("#OBC_EMP_YN").val();
					link += "&OBC_PENSION_YN="+$("#OBC_PENSION_YN").val();
					link += "&OBC_HEALTH_YN="+$("#OBC_HEALTH_YN").val();
					link += "&OBC_ELDER_YN="+$("#OBC_ELDER_YN").val();
					link += "&OBC_WORK_YN="+$("#OBC_WORK_YN").val();
					link += "&OBC_RESIGN_YN="+$("#OBC_RESIGN_YN").val();
					link += "&OBC_SAFE_YN="+$("#OBC_SAFE_YN").val();
					link += "&OBC_ENV_YN="+$("#OBC_ENV_YN").val();
					link += "&OBC_SITE_YN="+$("#OBC_SITE_YN").val();
					link += "&OBC_DUTY_YN="+$("#OBC_DUTY_YN").val();
					link += "&OBC_WARR_YN="+$("#OBC_WARR_YN").val();
					link += "&OBC_DUTY_RATE="+$("#OBC_DUTY_RATE").val();
					link += "&PointCount="+$("#PointCount").val();
					fLayerPop(win_id, link, 1000,600, '', '', 'NO');
				}
			}
		}
		 if(Col == 21){
			if(sheet1.GetCellValue(Row,"SUCC_YN_CK") == "1"){
				alert("낙찰 선정된 업체 입니다.\n결격사유를 입력 할 수 없습니다.");
				return;
			}
			 var win_id = "_DisqPop";
			 var link = "/bid/outside/BidDisqlPop.screen";
			       link += "?pop_win_id="+win_id;
			       link += "&ROW="+Row;
			       link += "&DISQ_REASON="+escape(sheet1.GetCellValue(Row,"DISQ_REASON"));
			fLayerPop(win_id, link, 600,190, '', '', 'NO');
		}
	}

	function DisqReasonClose(returnValue){
		if(returnValue != null){
			if(returnValue[1].length > 0){
				sheet1.SetCellValue(returnValue[0],"DISQ_REASON",returnValue[1]);
				sheet1.SetCellValue(returnValue[0],"DISQ_YN","[수정]");
				sheet1.SetCellEditable(returnValue[0], "SUCC_YN", false);
			}else{
				sheet1.SetCellValue(returnValue[0],"DISQ_REASON","");
				sheet1.SetCellValue(returnValue[0],"DISQ_YN","[등록]");
				sheet1.SetCellEditable(returnValue[0], "SUCC_YN", true);
			}
		}
		setTimeout(function(){fLayerPopClose("_DisqPop");},100);
		fLayerPopClose("_DisqPop");
	}
	
	function doSignFile(doc_id){
		//alert(doc_id);
		if(doc_id == ""){
			alert("결재 정보가 없습니다.");
			return;
		}
		var doc_chk = doc_id.substring(doc_id.length-3, doc_id.length);
		
		doc_chk = doc_chk * 1;
		

		var link = "";
		var year = "<%=sign_info.get("year") %>";
		if (year > "20151213"){
		 	link = "<%=gwurl%>upload_approval/TEC/doc/" + year.substr(0,4) + "/" + doc_chk + "/"+ doc_id+".mht";
		}
		else
		{
			link = "<%=gwurl%>upload_approval/TEC/doc/" + doc_chk + "/"+ doc_id+".mht";
		}
		//var popOption = "width=400, height=450, resizable=no, scrollbars=auto, status=no;";    //팝업창 옵션(optoin)
		
		window.open(link,"_viewDraft","");	
	}

	function fileCheck(val){
		var f = document.form1;
		jQuery("#ckVal").val(val);				
		submitXmlRequest("/bid/signidentify.screen", "CHK", f, "SUCCESS");
		btn_act = "to_fileCk";
		document.form1.isSubmit = false;
	}

	function doAttachFile2(fileGB, id, editYN) {		
		if(fileGB != ''){ 
			var file_div = "bid/outside/succfile/<%=Order.get("BID_NO")%>/";
			var upLoadFlg = "Y";
			if((jQuery("#signCheck").val() != "") || (jQuery("#fileEditYN").val() == "N")){
				upLoadFlg = "N";
			}
			viewFileListNew1(fileGB, id, document.form1.p_AttachFile4, upLoadFlg, file_div, null, null);
		} 
	}

	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 fileAfterCheck(val){		
		if(!jQuery("#signCheck").val() == ""){
			var obj = eval("document.getElementById('p_" + val + "')");
			alert("결재중엔 파일 수정이 불가합니다.");
			jQuery(obj).attr("checked",false);
			return;
		}else{
			var obj = eval("document.getElementById('" + val + "')");
			if(obj.style.display == "none"){
				obj.style.display = "inline";
			}else{
				obj.style.display = "none";
			}
		}		
	}
	
	//첨부목록 조회
	function getFileListForTextarea(){
		document.form1.p_AttachFile3.value = "";
		var f = document.form1;  
		jQuery("#fevent").val("GET_ATTACHFILE");
		submitXmlRequest("/bid/outside/SuccessBid_form.screen", "GET_ATTACHFILE", f, "VALUEOBJECT");	
	}	
	
	function doDupChk(fileGB, id, editYN) {
		var f = document.form1;		
		jQuery("#fileGB").val(fileGB);
		jQuery("#fileID").val(id);
		jQuery("#fileEditYN").val(editYN);
		
		submitXmlRequest("/bid/signidentify.screen", "CHK", f, "SUCCESS");
		btn_act = "to_fileDw";
		document.form1.isSubmit = false;
	}
	
	function openBidAmtPop(bidNO, bidDEG, vendorCD, vendorNO, vendorNAME, estitotAMT, demandedID, fileGB, PointCount) {
        var win_id = "_BidAmtPop";
        var link = "http://ebid.sgcenc.co.kr:80/bid/outside/SignBidAmtPop.screen";
        link += "?pop_win_id=" + win_id;
        link += "&VENDOR_CD=" + vendorCD;
        link += "&BID_NO=" + bidNO;
        link += "&BID_DEG=" + bidDEG;
        link += "&FILE_GB=" + fileGB;
        link += "&VENDOR_NO=" + vendorNO;
        link += "&VENDOR_NAME=" + vendorNAME;
        link += "&ESTI_TOT_AMT=" + estitotAMT;
        link += "&DEMANDED_ID=" + demandedID;
        link += "&PointCount=" + PointCount;
        link += "&SIGN_YN=Y";
        window.open(link, win_id, "toolbar=no, width=1200, height=690, top=50, left=40, toolbar=no,directories=no,status=no,scrollbars=yes,resize=no,menubar=no,target=new");
    }		
	
	//2019.11.22 전산요구사항으로 추가
	function textareaResize(obj) {
	  obj.style.height = "80px";
	  obj.style.height = obj.scrollHeight+"px";
	}	
</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="">
<!-- List Search -->
<INPUT type="hidden" name="P_BID_MASTER_NM" id="P_BID_MASTER_NM" value="<%= params.get("P_BID_MASTER_NM") %>">
<INPUT type="hidden" name="p_dept_nm" id="p_dept_nm" value="<%= params.get("p_dept_nm") %>">
<INPUT type="hidden" name="p_dept_cd" id="p_dept_cd" value="<%= params.get("p_dept_cd") %>">
<INPUT type="hidden" name="p_demanded_status" id="p_demanded_status" value="<%= params.get("p_demanded_status") %>">
<!-- List Search -->  
<INPUT type='hidden' name="signClass" value="ebid_opoD">
<INPUT type='hidden' name="DEMANDED_ID" value="<%=Order.get("DEMANDED_ID")%>">
<INPUT type='hidden' name="BID_NO" value="<%=Order.get("BID_NO")%>">
<INPUT type='hidden' name="BID_DEG" value="<%=Order.get("BID_DEG")%>">
<INPUT type='hidden' name="STATUS_CD" value="<%=Order.get("STATUS_CD")%>">
<%-- <INPUT type='hidden' name="ACT_AMT" value="<%=Order.get("ACT_AMT")%>"> 2018.04.09--%>
<INPUT type='hidden' name="DEPT_CD" value="<%=Order.get("DEPT_CD")%>">
<INPUT type='hidden' name="DEPT_NM" value="<%=Order.get("DEPT_NM")%>">
<INPUT type='hidden' name="BID_MASTER_NM" value="<%=Order.get("BID_MASTER_NM")%>">
<INPUT type='hidden' name="REQ_DEPT_CD" value="<%=Order.get("REQ_DEPT_CD")%>">
<INPUT type='hidden' name="DEMANDED_DATE" value="<%=Order.get("DEMANDED_DATE")%>">
<INPUT type='hidden' name="EMP_NO" value="<%=Order.get("EMP_NO")%>">
<INPUT type='hidden' name="EMP_NM" value="<%=Order.get("EMP_NM")%>">
<INPUT type='hidden' name="ESTI_TOT_AMT" value="<%=Order.get("ESTI_TOT_AMT")%>">
<INPUT type='hidden' name="CONTFUL_RATE" value="<%=Order.get("CONTFUL_RATE")%>">
<INPUT type='hidden' name="WARR_RATE" value="<%=Order.get("WARR_RATE")%>">
<INPUT type='hidden' name="CURRENCY_GB" value="<%=Order.get("CURRENCY_GB")%>">
<INPUT type='hidden' name="PAY_ITEM" value="<%=Order.get("PAY_ITEM")%>">
<INPUT type='hidden' name="COST_CODE" value="<%=Order.get("COST_CODE")%>">
<INPUT type='hidden' name="COST_TYPE" value="<%=Order.get("COST_TYPE")%>">
<INPUT type='hidden' name="OUT_ITEM_CD" value="<%=Order.get("OUT_ITEM_CD")%>">
<INPUT type='hidden' name="COST_CODE" value="<%=Order.get("COST_CODE")%>">
<INPUT type='hidden' name="ONBID_YN" value="<%=Order.get("ONBID_YN")%>">
<INPUT type='hidden' name="ONBID_YN_NM" value="<%=Order.get("ONBID_YN_NM")%>">
<INPUT type='hidden' name="OBC_EMP_YN" value="<%=Order.get("OBC_EMP_YN")%>">
<INPUT type='hidden' name="OBC_PENSION_YN" value="<%=Order.get("OBC_PENSION_YN")%>">
<INPUT type='hidden' name="OBC_HEALTH_YN" value="<%=Order.get("OBC_HEALTH_YN")%>">
<INPUT type='hidden' name="OBC_ELDER_YN" value="<%=Order.get("OBC_ELDER_YN")%>">
<INPUT type='hidden' name="OBC_WORK_YN" value="<%=Order.get("OBC_WORK_YN")%>">
<INPUT type='hidden' name="OBC_RESIGN_YN" value="<%=Order.get("OBC_RESIGN_YN")%>">
<INPUT type='hidden' name="OBC_SAFE_YN" value="<%=Order.get("OBC_SAFE_YN")%>">
<INPUT type='hidden' name="OBC_ENV_YN" value="<%=Order.get("OBC_ENV_YN")%>">
<INPUT type='hidden' name="OBC_SITE_YN" value="<%=Order.get("OBC_SITE_YN")%>">
<INPUT type='hidden' name="OBC_DUTY_YN" value="<%=Order.get("OBC_DUTY_YN")%>">
<INPUT type='hidden' name="OBC_WARR_YN" value="<%=Order.get("OBC_WARR_YN")%>">
<INPUT type='hidden' name="OBC_DUTY_RATE" value="<%=Order.get("OBC_DUTY_RATE")%>">
<INPUT type='hidden' name="PointCount" value="<%=Order.get("PointCount")%>">	
<INPUT type='hidden' name="SITEPARTI_YN" value="Y">
<INPUT type='hidden' name="TBE_FLAG" value="<%=Order.get("TBE_FLAG")%>">

<INPUT type="hidden" id="signCheck" value="">
<INPUT type="hidden" id="ckVal" value="">
<INPUT type="hidden" id="fileGB" value="">
<INPUT type="hidden" id="fileID" value="">
<INPUT type="hidden" id="fileEditYN" value="">
<input type="hidden" name="p_AttachFile4" id="p_AttachFile4" onPropertyChange="JavaScript:getFileListForTextarea();"/>
<INPUT type="hidden" id="DOC_ETC_OUT" value="<%=Order.get("DOC_ETC_OUT")%>">
<INPUT type="hidden" id="TOT_FILE_GB" value="<%=Order.get("TOT_FILE_GB")%>">

<table width="100%">
	<colgroup>
		<col width="*" />
		<col width="300" />
	</colgroup>
	<tr>
   		<th>
			<div align="left" id="title">
			    <ul><li>외주_낙찰업체선정 상세<font style="font-size:11px"> (<%=Order.get("STATUS_NM")%>)</font></li></ul>
			</div> 
   		</th>
   		<td align="right">
   				<%if("N".equals(Order.get("ONBID_YN"))){ %><span class="btnSearch center" id="btn_plan"><a href="javascript:void(0);">수정</a></span><%}%>
				<span class="btnSearch center" id="btn_save"><a href="javascript:void(0);">저장</a></span>
				<span class="btnSearch center" id="btn_appr"><a href="javascript:void(0);">결재</a></span>
				<span class="btnSearch center" id="btn_defer"><a href="javascript:void(0);">유찰</a></span>
				<span class="btnSearch center" id="btn_rebid"><a href="javascript:void(0);">재입찰</a></span>
				<span class="btnSearch center" id="btn_list"><a href="javascript:void(0);">목록</a></span>
   		</td>
  	</tr>
</table>

<%if(!Order.get("REBID_REASON").equals("") || !Order.get("REBID_OUTREASON").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="150"/>
		<col width="40%" />
		<col width="150" />
		<col width="*" />
	</colgroup>
  <TR height="25"> 
    <TH>재입찰사유<br>(내부보고)</TH>
	<TD><%=StringUtils.cvtHTML(Order.get("REBID_REASON"))%></TD>
	<TH>재입찰사유<br>(외부공지)
	</TH>
	<TD><%=StringUtils.cvtHTML(Order.get("REBID_OUTREASON"))%></TD>
  </TR>
 </TABLE>
<%} %>

<%if(o_reason || p_reason || m_reason || c_reason){ %>
<div class="application-info magT15">
	<div class="application-sub-title">
		<span class="title">입찰사유</span>
	</div>
</div>

<TABLE class="form-table">
	<colgroup>
		<col width="150">
		<col/>
	</colgroup>
   <%if(o_reason){ %>
  <TR height="25">
    <TH>개찰 특기사항</TH>
	<TD style="vertical-align: top"><%=StringUtils.cvtHTML(Order.get("OPEN_OPINION"))%></TD>
  </TR>
  <%} %>
   <%if(c_reason){ %>
  <TR height="25">
    <TH>취소사유</TH>
	<TD style="vertical-align: top"><%=StringUtils.cvtHTML(Order.get("CANCEL_REASON"))%></TD>
  </TR>
  <%} %>
   <%if(p_reason){ %>
  <TR height="25">
    <TH>연기사유</TH>
	<TD style="vertical-align: top"><%=StringUtils.cvtHTML(Order.get("POSTPONE_REASON"))%></TD>
  </TR>
  <%} %>
  <%if(m_reason){ %>
  <TR height="25">
    <TH>정정사유</TH>
	<TD style="vertical-align: top"><%=StringUtils.cvtHTML(Order.get("MODIFY_REASON"))%></TD>
  </TR>
  <%} %>
</TABLE>
<%}%>

<div class="application-info magT10">
	<div class="application-sub-title">
		<span class="title">발주의뢰정보</span>
	</div>
</div>

<!-- 발주의뢰정보 : 시작 -->

<TABLE class="form-table">
	<colgroup>
		<col width="150"/>
		<col width="23%">
		<col width="150"/>
		<col width="23%">
		<col width="150"/>
		<col/>
	</colgroup>
  <TR height="25"> 
    <TH> 현장</TH>
	<TD><%=Order.get("dept_nm") %></TD>
	<TH> 발주의뢰번호</TH>
	<TD><a href="javascript:doSignFile('<%=sign_info.get("doc_id") %>');"><%=Order.get("DEMANDED_NO")%></a>
	</TD>
	<TH> 발주의뢰명</TH>
	<TD><%=Order.get("DEMANDED_TITLE")%></TD>
  </TR>

  <TR height="25"> 
	<TH> 발주의뢰일</TH>
	<TD><%= Order.get("DEMANDED_DATE")%></TD>
	<TH> 발주의뢰부서</TH>
	<TD><%= Order.get("REQ_DEPT_NM")%></TD>
	<TH> 발주의뢰자</TH>
	<TD><%= Order.get("EMP_NM")%></TD> 	
  </TR>
  
  <TR height="25"> 
	<TH> 발주접수일자</TH>
	<TD><%=Order.get("RECEIPT_DATE") %></TD>
	<TH> Pay Item</TH>
	<TD><%= Order.get("PAY_ITEM_NM") %></TD> 	
	<TH> 외주예산 (원)</TH>
	<TD><%= InputText.get("PUR_AMT", Formatter2.currency(Order.get("PUR_AMT"),0), 13, 300, "desc=외주예산,Number,right, readonly","Number") %></TD>  <!-- 2015.3.2 외주예산추가 MKLEE <%= Formatter2.currency(Order.get("PUR_AMT"),0)%>-->	
	
  </TR> 	

  <TR height="25"> 
	<TH> 도급금액 (원)</TH>
	<TD><%= InputText.get("CONT_AMT", Formatter2.currency(Order.get("CONT_AMT"),0), 13, 300, "desc=예산금액,Number,right, readonly","Number") %></TD>
	<TH> 실행예산 (원)</TH>
	<TD><%= InputText.get("ACT_AMT", Formatter2.currency(Order.get("ACT_AMT"),0), 13, 300, "desc=예산금액,Number,right, readonly","Number") %></TD>
	<TH> 도급대비실행율(%)</TH><%-- <%= Order.get("ACT_RATE")%> 2018.4.9 --%>
	<TD><%= InputText.get("ACT_RATE", Order.get("ACT_RATE"), 40, 300, "class=input_blank,desc=실행금액,left,readOnly=white") %></TD> 	
  </TR>
  <TR height="25">
	<TH> 공사기간</TH>
	<TD><%=Order.get("DELI_FROM_DY") %> <%if(!Order.get("DELI_FROM_DY").isEmpty()||!Order.get("DELI_TO_DY").isEmpty()){ %>~<%} %> <%= Order.get("DELI_TO_DY") %></TD>
	<TH> 공사장소</TH>
	<TD><%= Order.get("DELIVERY_PLACE") %></TD>
   	<TH> 공종</TH>
	<TD><%= Order.get("OUT_ITEM_NM") %></TD>
  </TR>
  <TR height="25">
	<TH> 계약번호</TH>
	<TD colspan="5"><INPUT type="text" name="CONF_NO" id="CONF_NO" value="<%=Order.get("CONF_NO")%>" maxlength="100" class="input" size="50" style="IME-MODE : disabled;"  desc='계약번호'></TD>
  </TR>
    
  <!-- 발주의뢰정보 : 종료 -->
</table>


<table width="100%">
	<colgroup>
		<col width="500" />
		<col width="*" />
	</colgroup>
	<tr>
   		<th>
   		<div class="application-info magT15">
			<div class="application-sub-title">
				<span class="title">견적업체 입찰 결과</span>
			</div>
		</div>
   		</th>
   		<td align="right">	
   		        <span class="btnSearch center" id="btn_Currency"><a href="javascript:void(0);">환율반영</a></span>
   				<span class="btnSearch center" id="btn_report"><a href="javascript:void(0);">견적대비표</a></span>
				<span class="btnSearch center" id="btn_tbecheckpop"><a href="javascript:void(0);">기술검토결과서</a></span>
   		</td>
  	</tr>
</table>
	<div id="sheet1_div" style="padding-top:5px;height: auto; min-height: 170px; overflow: auto;">
		<script>createIBSheet('sheet1','100%', '170px');</script>
	</div>

<div class="application-info magT15">
	<div class="application-sub-title">
		<span class="title">입찰기본정보</span>
	</div>
</div>

<TABLE class="form-table">
	<colgroup>
		<col width="145"/>
		<col width="145"/>
		<col width="29%"/>
		<col width="145"/>
		<col />
	</colgroup>
  <TR height="25"> 
    <TH> 입찰번호-차수</TH>
	<TD colspan="2"> 
	  <%=Order.get("BID_NO")%>-<%=Order.get("BID_DEG")%>
    </TD>
	<TH> 온라인입찰여부</TH>
	<TD>
	 <%=Order.get("ONBID_YN_NM")%>            
	</TD>
  </TR>


  <TR height="25"> 
	<TH> 입찰명</TH>
	<TD colspan="2"> 
		<%=Order.get("BID_MASTER_NM")%> 
	</TD>
	<TH> 공사기간</TH>
	<TD> 
		<%= InputText.get("DELI_START_DT", Order.get("DELI_START_DT"), 10, 50, "hangule,center, desc=공사시작일자,ReadOnly") %>
		<IMG name="start_img" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('DELI_START_DT');">
					~
		<%= InputText.get("DELI_END_DT", Order.get("DELI_END_DT"), 10, 50, "hangule,center, desc=공사종료일자,ReadOnly") %>
		<IMG name="start_img" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('DELI_END_DT');">
		<IMG name="dataClear" id="dataClear" src="/img/buyer/button/bt_eraser1.gif" border="0" align="absmiddle" style="cursor:pointer;">
	</TD>
  </TR>
  
  <TR height="25"> 
	<TH> 경쟁방법</TH>
	<TD colspan="2"> 
		<%=Order.get("CMPT_NM")%>
	</TD>
       
	<TH> 낙찰자선정방법</TH>
	<TD>
	  <%=Order.get("SUCC_NM") %>
 	</TD> 	
  </TR> 	
  <!-- 발주의뢰정보 : 종료 -->
</table>

<div class="application-info magT15">
	<div class="application-sub-title">
		<span class="title">입찰진행</span>
	</div>
</div>

<TABLE class="form-table">
	<colgroup>
		<col width="145"/>
		<col width="145"/>
		<col width="29%"/>
		<col width="145"/>
		<col />
	</colgroup>
  <TR height="25"> 
    <TH>업체공지일자</TH>
	<TD colspan="4"><%=Order.get("NOTI_DY") %></TD>
  </TR>


  <TR height="25"> 
	<TH rowspan="3"> 견적설명회 정보</TH>
	<TH> 여부</TH>
	<TD><%=Order.get("SITEDESC_FLAG")%></TD>
	<TH> 담당자</TH>
	<TD><%=Order.get("SITEDESCCHRGPRSNNM")%></TD>	
  </TR>
  
  <TR height="25"> 
	<TH> 담당자 전화번호</TH>
	<TD ><%=Order.get("SITEDESCTELNO")%></TD>
	<TH> 일시</TH>
	<TD ><%=Order.get("SITEDESCDATE")%></TD>		
  </TR> 	
  
    <TR height="25"> 
	<TH> 담당자 E-Mail</TH>
	<TD ><%=Order.get("SITEDESCEMAIL")%></TD>
	<TH> 장소</TH>
	<TD ><%=Order.get("SITEDESCPLACE")%></TD>		
  </TR> 
  
    <TR height="25"> 
	<TH rowspan="4"> 견적 의뢰</TH>
	<TH> 견적제출기간</TH>
	<TD colspan="3"><%=Order.get("BID_FROM_DT")%> ~<%=Order.get("BID_TO_DT")%></TD>
  </TR>
  
  <TR height="25"> 
	<TH> 외주담당자</TH>
	<TD ><%=Order.get("PUREMPNM")%></TD>
	<TH> 외주담당자 전화번호</TH>
	<TD ><%=Order.get("PO_EMPNM")%></TD>		
  </TR> 	
  
    <TR height="25"> 
	<TH> 개찰자</TH>
	<TD colspan="3"><%=Order.get("OPEN_EMPNM")%></TD>	
  </TR> 

  <TR height="25"> 
	<TH> 보고자</TH>
	<TD colspan="3">
		<div  id="sheet2_div" style="width: 100%; height: 100%;"> 	
			<script>createIBSheet('sheet2','100%', '100px');</script>
		</div>
	</TD>
  </TR> 
    
  <TR height="25"> 
	<TH rowspan="2">기술검토(TBE)</TD>
	<TH> TBE 여부</TH>
	<TD ><%=Order.get("TBE_FLAG").equals("Y") ? "예" : "아니오"%></TD>
	<TH> TBE 완료일</TH>
	<TD><%=Order.get("TBE_FIN_DT")%></TD>	
  </TR>
  
  <TR height="25"> 
	<TH> TBE 심사자</TH>
	<TD><%=Order.get("EVAL_EMPNM")%></TD>
	<TH> TBE담당자 전화번호</TH>
	<TD ><%=Order.get("EVAL_TEL")%></TD>			
  </TR> 	
  <!-- 발주의뢰정보 : 종료 -->
</table>

<div class="application-info magT15">
	<div class="application-sub-title">
		<span class="title">입찰조건</span>
	</div>
</div>

<TABLE class="form-table">
	<colgroup>
		<col width="145"/>
		<col width="145"/>
		<col width="29%"/>
		<col width="145"/>
		<col/>
	</colgroup>
  <TR height="25"> 
	<TH>통화구분</TH>
	<TD colspan="4"> <%=Order.get("CURRENCY_GB_NM") %>
	</TD>
  </TR>
   <TR height="25"> 
	<TH>계약형태</TH>
	<TD colspan="4"> 
		<%=Order.get("OBC_CONT_TYPE_NM") %>
	</TD>
  </TR>
  <TR height="25"> 
  	<TH rowspan="2">공사대금</TH>
	<TH>선급금</TH>
	<TD><% if(!Order.get("OBC_FRST_CONT_RATE").isEmpty()){%> 계약금액의 : <%= Order.get("OBC_FRST_CONT_RATE") %>%<br><%}%>
	<%= Order.get("OBC_FRST_CONDI") %> <br>
	<%= Order.get("OBC_FRST_CNT_CONDI") %></TD>
	<TH>기성금</TH>
	<TD><% if(!Order.get("CPC_MID_RATE").isEmpty()){%> 계약금액의 :<%= Order.get("CPC_MID_RATE")%>% ,<%}%><% if(!Order.get("OBC_MID_CASH_RATE").isEmpty()){%> 현금 : <%= Order.get("OBC_MID_CASH_RATE")%>% <%}%> <% if(!Order.get("OBC_MID_BILL_RATE").isEmpty()){%>어음 : <%= Order.get("OBC_MID_BILL_RATE")%>%<br><%}%>
			<% if(!Order.get("OBC_MID_PAYDAY").isEmpty()){%>세금계산서 발행일로부터 <%=Order.get("OBC_MID_PAYDAY")%> 일 내 지급<br><%} %>
			<% if(!Order.get("OBC_MID_BILL_DATE").isEmpty()){%>어음일 경우, 어음 만기일은 목적물 수령일로부터 (<%= Order.get("OBC_MID_BILL_DATE")%>)일<br><%} %>
			<% if(!Order.get("OBC_MID_PAYDAY").isEmpty()){%><%=Order.get("OBC_MID_REQ_MONTH")%> 개월 당 <%=Order.get("OBC_MID_CNT")%> 회 말일에 청구<%}%>
	</TD>	
  </TR>
    <TR height="25"> 
	<TH>준공금</TH>
	<TD colspan="3"><% if(!Order.get("PBC_REST_RATE").isEmpty()){%> 계약금액의 : <%=Order.get("PBC_REST_RATE")%>%, <%}%><% if(!Order.get("OBC_FIN_CASH_RATE").isEmpty()){%> 현금 : <%=Order.get("OBC_FIN_CASH_RATE")%>% <%}%><% if(!Order.get("OBC_FIN_BILL_RATE").isEmpty()){%> 어음 : <%=Order.get("OBC_FIN_BILL_RATE")%>%<%}%>
			<%-- <br><% if(!Order.get("OBC_FIN_PAYDAY").isEmpty()){%>세금계산서 발행일로부터 <%=Order.get("OBC_FIN_PAYDAY")%> 일 내 지급<%}%><br>
			<%=Order.get("OBC_FIN_CONDI") %></TD> --%>
  </TR>
  <TR height="25"> 
  	<TH rowspan="2">보증조건</TH>
	<TH>선급금보증</TH>
	<TD><% if(!Order.get("CBC_FIRST_RATE").isEmpty()){%>계약금액의 <%=Order.get("CBC_FIRST_RATE")%>%<%}%></TD>
	<TH>계약이행 보증</TH>
	<TD><% if(!Order.get("CONTFUL_RATE").isEmpty()){%>계약금액의 <%= Order.get("CONTFUL_RATE") %>%<%}%></TD>	
  </TR>
  <TR height="25"> 
	<TH>하자이행 보증</TH>
	<TD><% if(!Order.get("WARR_RATE").isEmpty()){%>준공금액의 <%= Order.get("WARR_RATE")%>%<%}%></TD>
	<TH>하자담보기간</TH>
	<TD><% if(!Order.get("CBC_DEFECT_DAY").isEmpty()){%>준공일로부터 <%= Order.get("CBC_DEFECT_DAY")%> 개월<%}%></TD>
  </TR>  
  <TR height="25"> 
  	<TH>기타조건</TH>
	<TH>하도급대금<br>연동 기준비율</TH>
	<TD><% if(!Order.get("PAY_CON_RATE").isEmpty()){%><%= Order.get("PAY_CON_RATE")%>%<%}%></TD>
	<TH>지체상금</TH>
	<TD><% if(!Order.get("CBC_DAMAGE_RATE").isEmpty()){%>일당 계약금액의 <%= Order.get("CBC_DAMAGE_RATE")%>%,<%}%><% if(!Order.get("CBC_DAMAGE_MAXRATE").isEmpty()){%> 최대 <%= Order.get("CBC_DAMAGE_MAXRATE")%>%<%}%></TD>	
  </TR>
  <TR height="25"> 
  	<TH rowspan="6">간접비 견적조건</TH>
	<TH>고용보험료</TH>
	<TD><% if(!Order.get("OBC_EMP_RATE").isEmpty()){%>노무비 * <%= Order.get("OBC_EMP_RATE")%>  % &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp  &nbsp
		<%}%><%=Order.get("OBC_EMP_YN").equals("Y") ? "<font color='blue'>[견적포함]</font>" : "<font color='red'>[견적미포함]</font>" %></TD>
	<TH>연금보험료</TH>
	<TD><% if(!Order.get("OBC_PENSION_RATE").isEmpty()){%>직접노무비 <%=Order.get("OBC_PENSION_RATE")%>  % &nbsp &nbsp &nbsp&nbsp &nbsp  &nbsp
		<%}%><%=Order.get("OBC_PENSION_YN").equals("Y") ? "<font color='blue'>[견적포함]</font>" : "<font color='red'>[견적미포함]</font>" %></TD>	
  </TR>
  <TR height="25"> 
	<TH>건강보험료</TH>
	<TD><% if(!Order.get("OBC_HEALTH_RATE").isEmpty()){%>직접노무비 * <%=Order.get("OBC_HEALTH_RATE")%>  % &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp   &nbsp
	<%}%><%=Order.get("OBC_HEALTH_YN").equals("Y") ? "<font color='blue'>[견적포함]</font>" : "<font color='red'>[견적미포함]</font>" %></TD>
	<TH>노인장기보험료</TH>
	<TD><% if(!Order.get("OBC_ELDER_RATE").isEmpty()){%>건강보험료 * <%=Order.get("OBC_ELDER_RATE")%>  % &nbsp &nbsp&nbsp &nbsp  &nbsp
	<%}%><%=Order.get("OBC_ELDER_YN").equals("Y") ? "<font color='blue'>[견적포함]</font>" : "<font color='red'>[견적미포함]</font>" %></TD>	
  </TR>
  <TR height="25"> 
	<TH>산재보험료</TH>
	<TD><% if(!Order.get("OBC_WORK_RATE").isEmpty()){%>노무비 * <%=Order.get("OBC_WORK_RATE")%>  % &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
		<%}%><%=Order.get("OBC_WORK_YN").equals("Y") ? "<font color='blue'>[견적포함]</font>" : "<font color='red'>[견적미포함]</font>" %></TD>
	<TH>퇴직공제부금</TH>
	<TD><% if(!Order.get("OBC_RESIGN_RATE").isEmpty()){%>노무비 * <%=Order.get("OBC_RESIGN_RATE")%>  % &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp&nbsp &nbsp
		<%}%><%=Order.get("OBC_RESIGN_YN").equals("Y") ? "<font color='blue'>[견적포함]</font>" : "<font color='red'>[견적미포함]</font>" %></TD>	
  </TR>
  <TR height="25"> 
	<TH>안전관리비</TH>
	<TD><% if(!Order.get("OBC_SAFE_RATE").isEmpty()){%>노무비 * <%= Order.get("OBC_SAFE_RATE")%>  % &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
		<%}%><%=Order.get("OBC_SAFE_YN").equals("Y") ? "<font color='blue'>[견적포함]</font>" : "<font color='red'>[견적미포함]</font>" %></TD>
	<TH>환경관리비</TH>
	<TD><% if(!Order.get("OBC_ENV_RATE").isEmpty()){%>재료비 * <%= Order.get("OBC_ENV_RATE")%>  %  &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp&nbsp &nbsp
		<%}%><%=Order.get("OBC_ENV_YN").equals("Y") ? "<font color='blue'>[견적포함]</font>" : "<font color='red'>[견적미포함]</font>" %></TD>	
  </TR>
  <TR height="25"> 
	<TH>현장관리비</TH>
	<TD><% if(!Order.get("OBC_SITE_RATE").isEmpty()){%>직접비 * <%=Order.get("OBC_SITE_RATE")%>  % &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
		<%}%><%=Order.get("OBC_SITE_YN").equals("Y") ? "<font color='blue'>[견적포함]</font>" : "<font color='red'>[견적미포함]</font>" %></TD>
	<TH>매입부가세</TH>
	<TD><% if(!Order.get("OBC_DUTY_RATE").isEmpty()){%>재료비 * 매입세율 <%= Order.get("OBC_DUTY_RATE")%>  %  &nbsp
		<%}%><%=Order.get("OBC_DUTY_YN").equals("Y") ? "<font color='blue'>[견적포함]</font>" : "<font color='red'>[견적미포함]</font>" %></TD>	
  </TR>
  <TR height="25"> 
	<TH>간접비 정산조건</TH>
	<TD><%=Order.get("OBC_IND_YN").equals("Y") ? "<font color='blue'>[실적정산]</font>" : "<font color='red'>[비례정산]</font>" %></TD>
  <TH>건설기계 수수료</TH>
	<TD><%=Order.get("OBC_WARR_YN").equals("Y") ? "<font color='blue'>[견적포함]</font>" : "<font color='red'>[견적미포함]</font>" %></TD>
  </TR>
</TABLE>

<TABLE class="form-table" style="margin-top:5px">
	<colgroup>
		<col width="145"/>
		<col width="145"/>
		<col width="29%"/>
		<col width="145"/>
		<col/>
	</colgroup>
  <TR height="25"> 
	<TH> 외주발주진행율누계</TH>
	<TD colspan="2"><%= InputText.get("PO_PRC", Order.get("PO_PRC"), 5, 5, "Right,Float","Float") %>%</TD>
	<TH> 외주발주실적율누계</TH>
	<TD><%= InputText.get("RES_PRC", Order.get("RES_PRC"), 5, 5, "Right,Float","Float") %>%</TD>	
  </TR>
  <TR> 
    <TH>주요발주내용</TH>
	<TD colspan="2">
		<textarea name="MAIN_PR_CONTENTS" id="MAIN_PR_CONTENTS" style="width:98%; height:80px; overflow-y:auto" maxlength="1000" class="input byteChk ctrlTarget" onkeyup="textareaResize(this)"><%=Order.get("MAIN_PR_CONTENTS")%></textarea>		
    </TD>
	
	<TH>입찰업체선정사유</TH>
	<TD>
		<textarea name="BID_SUPP_SELECT_REASON" id="BID_SUPP_SELECT_REASON" style="width:98%; height:80px; overflow-y:auto" maxlength="1000" class="input byteChk ctrlTarget" onkeyup="textareaResize(this)"><%=Order.get("BID_SUPP_SELECT_REASON")%></textarea>	 	
	</TD>
  </TR>	
  <TR height="100"> 
    <TH>특이사항 내부</TH>
	<TD colspan="2">
		<textarea name="INNER_REMARKS" id="INNER_REMARKS" style="width:98%; height:80px; overflow-y:auto" maxlength="1000" class="input byteChk ctrlTarget" onkeyup="textareaResize(this)"><%=Order.get("INNER_REMARKS")%></textarea> 
    </TD>
	
	<TH>특이사항 외부</TH>
	<TD>
	 <textarea name="OUTER_REMARKS" id="OUTER_REMARKS" style="width:98%; height:80px; overflow-y:auto" maxlength="1000" class="input byteChk ctrlTarget" onkeyup="textareaResize(this)"><%=Order.get("OUTER_REMARKS")%></textarea>
	</TD>
  </TR>
  <TR height="100"> 
    <TH>내부자료</TH>
	<TD colspan="2"> 
	 <TEXTAREA name="p_AttachFile1" id="p_AttachFile1" style="width:85%;height:80px" rows="1" class="input" readOnly><%=filein.get(Order.get("DOC_ETC_IN")) %></TEXTAREA>
	                    <IMG id='search_spot_button' onClick="doAttachFile(document.form1.DEMANDED_ID,1);" src='/img/buyer/button/bt_change.gif' border='0'  align="top" align='absmiddle' alt='[Attach File]' style='cursor:pointer;'>
    </TD>
	<TH>외부자료</TH>
	<TD>
	 <TEXTAREA name="p_AttachFile2" id="p_AttachFile2" style="width:85%;height:80px" rows="1" class="input" readOnly><%=fileout.get(Order.get("DOC_ETC_OUT")) %></TEXTAREA>
	                    <IMG id='search_spot_button' onClick="doAttachFile(document.form1.DEMANDED_ID,2);" src='/img/buyer/button/bt_change.gif' border='0'  align="top" align='absmiddle' alt='[Attach File]' style='cursor:pointer;'>
	</TD>
  </TR>
  <TR height="25"> 
	<TH> 유관부서 담당자</TH>
	<TD colspan="4">
		<div id="report_emp_btn" style="width:410px; margin-top:5px; text-align: left; height: 25px; vertical-align: top;">
            <span class="btnSearch center"><a href="javascript:void(0);" id="report_emp_add">추가</a></span>
			<span class="btnSearch center"><a href="javascript:void(0);" id="report_emp_del">삭제</a></span>
		</div>	
		<div  id="sheet3_div" style="width: 100%; height: 100%;"> 	
			<script>createIBSheet('sheet3','100%', '100px');</script>
		</div>
	</TD>
  </TR> 
	<tr >
		<th>첨부파일</th>
		<td colspan="3">
			<table width="100%" border="0" cellpadding="0" cellspacing="0">
			<%			
				if(getFileListRowSet.size() > 0){
					int i_mod = 0;
					for(int i = 0; getFileListRowSet.size() > i; i++){
						i_mod = i%2;
						if(i_mod == 0){ %>
							<TR>
					<%	} %>
								<td width="50%">
									<%	if(getFileListRowSet.getRow(i).get("DETAILCD").equals("130")) { %>
										<label for="p_<%=getFileListRowSet.getRow(i).get("DETAILCD") %>"><input type="checkbox" name="<%=getFileListRowSet.getRow(i).get("DETAILNM") %>" id="p_<%=getFileListRowSet.getRow(i).get("DETAILCD") %>" value="<%=getFileListRowSet.getRow(i).get("DETAILCD") %>" style="cursor:pointer;" onClick="fileCheck('<%=getFileListRowSet.getRow(i).get("DETAILCD") %>')" <%if(!getFileListRowSet.getRow(i).get("DOC_CD").equals("") && !BidMaster.get("BID_NO").equals("")){out.print("checked");} %> <%if(getFileListRowSet.getRow(i).get("EDIT_YN").equals("N")){out.print("disabled");} %>> <%=getFileListRowSet.getRow(i).get("DETAILNM") %></label>
									<%}else{ %>
										<label for="p_<%=getFileListRowSet.getRow(i).get("DETAILCD") %>"><input type="checkbox" name="<%=getFileListRowSet.getRow(i).get("DETAILNM") %>" id="p_<%=getFileListRowSet.getRow(i).get("DETAILCD") %>" value="<%=getFileListRowSet.getRow(i).get("DETAILCD") %>" style="cursor:pointer;" onClick="fileCheck('<%=getFileListRowSet.getRow(i).get("DETAILCD") %>')" <%if(!getFileListRowSet.getRow(i).get("DOC_CD").equals("")){out.print("checked");} %> <%if(getFileListRowSet.getRow(i).get("EDIT_YN").equals("N")){out.print("disabled");} %>> <%=getFileListRowSet.getRow(i).get("DETAILNM") %></label>
									<%} %>
								</td>
								<td width="5%" height="24">
									<%	if(getFileListRowSet.getRow(i).get("DETAILCD").equals("130")) { %>
										<IMG src="/img/supplier/button/bt_attach_file.gif" id="<%=getFileListRowSet.getRow(i).get("DETAILCD") %>" alt="첨부파일 관리" align="top" style="display:<%if(!getFileListRowSet.getRow(i).get("DOC_CD").equals("") && !BidMaster.get("BID_NO").equals("")){out.print("inline");}else{out.print("none");} %>" onClick="openBidAmtPop('<%=BidMaster.get("BID_NO")%>','<%=BidMaster.get("BID_DEG")%>','<%=BidMaster.get("VENDOR_CD")%>','<%=BidMaster.get("VENDOR_NO")%>','<%=BidMaster.get("VENDOR_NAME")%>','<%=BidMaster.get("ESTI_TOT_AMT")%>','<%=BidMaster.get("DEMANDED_ID")%>','<%=BidMaster.get("FILE_GB")%>','<%=BidMaster.get("PointCount")%>');" class="button">
									<%}else{ %>
										<IMG src="/img/supplier/button/bt_attach_file.gif" id="<%=getFileListRowSet.getRow(i).get("DETAILCD") %>" alt="첨부파일 관리" align="top" style="display:<%if(!getFileListRowSet.getRow(i).get("DOC_CD").equals("")){out.print("inline");}else{out.print("none");} %>" onClick="doDupChk('<%=getFileListRowSet.getRow(i).get("FILE_GB") %>', '<%=getFileListRowSet.getRow(i).get("ID")%>', '<%=getFileListRowSet.getRow(i).get("EDIT_YN")%>');" class="button">
									<%} %>
								</td>
					<%	if(i_mod == 2) { %>		
							</TR>
					<%	} %>		
				<%
					}
					for(int i=i_mod+1; i<2; i++){ %>
						<td></td>
				<%	}
					if(i_mod == 0 || i_mod == 1){ %>
						</TR>	
				<%	}
				}
			%>
			</table>
		</TD>
		<td>
			<textarea name="p_AttachFile3" id="p_AttachFile3" style="width:98%;height:100px" rows="1" class="input" readOnly></textarea>
		</td>
	</tr>      
</TABLE>

</form>