<%--
  - Author(s)  : Hyung min Son
  - Date       : 2014.07.22
  - Description: 낙찰업체선정상세
  --%>
  
<%@ 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" %>
<%@ 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.27
    boolean p_reason = false;
    boolean c_reason = false;
    boolean m_reason = false;
    
    //2015.3.27 개찰의견 추가
    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("BID_CHK_YN","DETAILCD","Y"), "DETAILNM", "DETAILCD");
	String BID_CHK_CD = initCombo.getCode();
	String BID_CHK_NM = initCombo.getCodeName();
	
	//공통코드
	InitCombo initCombo2 = new InitCombo();

	initCombo2.makeComboData(commCodeManager.getCodeRowSet("TBE_EVAL"), "NAME", "CODE");
	String TBE_EVAL_CD = initCombo2.getCode();
	String TBE_EVAL_NM = initCombo2.getCodeName();
	
	ValueObject sign_info = storage.getValueObject("SIGN_INFO");
    
    String gwurl	=	"http://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 pageLastRowIndex = 1;
	var validationResult = false;
	var filterShow = false;
	var succ_vendor = "";
	var succ_vendor_cnt = 0;
	var for_po = $("#FOR_PO").val();
	function _onReady(){
		 //$("#btn_Currency").hide();
		/**
		 *	IBSheet object initialize
		 */
		gridInit(sheet1);
		gridInit(sheet2);
		gridInit(sheet3);
		
		/**
		 *	Application Initialize
		 */
		 $("#btn_list").click(function() {
				$("#fevent").val("");
				$("#form1").attr("action", "/bid/purchase/SuccessBidList.screen");
				$("#form1").attr("target", "_self");
				$("#form1").attr("method", "post");
				$("#form1").submit();
		});
		 
		 //2015.02.27 실행예산 수정 mklee
		 $("#ACT_AMT").keyup(function(){ act_rate();});
		 $("#CONT_AMT").keyup(function(){ act_rate();});
			
		 $("#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";			 
		});
		 
		 
		 jQuery("#btn_bid").click(function(){
				var f = document.form1;
				submitXmlRequest("/bid/signidentify.screen", "CHK", f, "SUCCESS");
				btn_act = "to_appr";
				
			
		 });
		 
		 
		 jQuery("#btn_divCont").click(function(){//분할업체선정
			 var win_id = "_DivContPop";
			 var link = "/bid/purchase/DivContPop.screen";
			       link += "?pop_win_id="+win_id;
			       link += "&BID_NO="+jQuery("#BID_NO").val();
			       link += "&BID_DEG="+jQuery("#BID_DEG").val();
			fLayerPop(win_id, link, 1000,500, '', '', 'YES');
		 });
			 
		 $("#btn_tbecheckpop").click(function() {
				 var win_id = "_TBECheckPop";
				 var link = "/bid/purchase/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,360, '', '', 'YES');
		 });
		 
		 
/* 		 $("#btn_report").click(function() {
		        var reportInfo = new ReportInfo();
		        if($("#PBC_CBE_TYPE_CD").val() == "A")
	            {
		            reportInfo.title = "견적대비표";
		            reportInfo.reportName = "/report/mrd/buyer/bid/purchase/Bid_purchase_Atype.mrd";
		            
		            reportInfo.set($("#BID_NO").val());    	// $1
			        reportInfo.set($("#BID_DEG").val());    	// $2
	            }
		        else if($("#PBC_CBE_TYPE_CD").val() == "B")
	            {
		            reportInfo.title = "견적대비표";
		            reportInfo.reportName = "/report/mrd/buyer/bid/purchase/Bid_purchase_Btype.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_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();
			 }
			 
			 if(jQuery("input:checkbox[id='DIV_CONT_YN']").is(":checked") == true){
				 sheet1.SetColHidden("WON_ESTI_TOT_AMT", true);
				 sheet1.FitColWidth();
			 }else{
				 sheet1.SetColHidden("WON_ESTI_TOT_AMT", false);
				 sheet1.FitColWidth();
			 }
			 
	 	 });
		 
		 
		 //단가계약일경우 환율은 없음
		 //통화가 KRW일경우 
		 // 환율 반영 여부  값이 Y인경우 숨김을 하지 않음.
		 if($("#DIV_PO_YN").val() != "Y"){
		 	if("Y" != $("#KRW_APPR_YN").val()){
		 		$("#btn_Currency").click();
		 	}else{
			 	sheet1.SetColHidden("CHAGE_HP", true);
			 	sheet1.SetColHidden("CHARGE_EMAIL", true);
		 	}
		 	
		 	if(<%= Order.get("pay_div").equals("1") && !Order.get("DEMANDED_KIND").equals("B") %>){
			 	$("#pay_div").val("<%=Order.get("pay_div")%>");
	   		    $("#pay_div").attr("disabled", false);
		 	}else{
				 $("#pay_div").val("<%=Order.get("pay_div")%>");
			 	 $("#pay_div").attr("disabled", true);
		 	}
		 }else{
			 $("#btn_Currency").click();
			 //$("#btn_Currency").hide();		//2022.08.05 단가계약일 경우에도 환율정보 등록 가능하도록 수정
			 //jQuery("#div_cont_span").hide(); //2020.03.11 주석 - 단가계약인 경우 왜 막혀있는지 알수없음 
			 
			 $("#pay_div").val("<%=Order.get("pay_div")%>");
		 	 $("#pay_div").attr("disabled", true);
		 }
		 
		 var status = "<%=Order.get("STATUS_CD")%>";
		 if(status == "07"){
			 	$("#btn_save").hide();
				$("#btn_defer").hide();
				$("#btn_rebid").hide();
		 }else if(status == "05"){
			 $("#btn_bid").hide();
		 }
	     else if(!(status == "06" ||status == "95")  && "<%=Order.get("ONBID_YN")%>" =="Y" ){
		 }
		if($("#ONBID_YN").val() == "N"){
			 $("#btn_rebid").hide();
			 //$("#btn_tbecheckpop").hide();
		}
		
		if($("#TBE_FLAG").val() == "N"){
			 $("#btn_tbecheckpop").hide();
		}
		
		 //For PO
		 if($("#FOR_PO").val() > 0){
			 	$("#btn_save").hide();
				$("#btn_defer").hide();
		 }
		 
		 if("<%=Order.get("PBC_DEFECT_CONDI2")%>"!=""||"<%=Order.get("CBC_DEFECT_DAY2")%>"!=""||"<%=Order.get("CBC_DERECT_TERM_CD2")%>"!=""){
				$("#addGuar").attr("checked", true);
				$(".checkAdd").show();
		}
		divContYnCheck();
		//보고자 조회
		doSearchSheet3();
		
	}
	
	function PopClose(win_id,result){
		if( result != null ){
			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/purchase/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/purchase/SuccessBid_sheet.screen";
		Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 30, "");
	}
	
	function doSearchSheetitem(){
		$("#fevent").val("GET_ITEM_LIST");
		var url = Modular.model.PageContext.CONTEXT_ROOT + "/bid/purchase/BidIng_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/purchase/BidPlan_sheet.screen";
		Modular.view.IBSheet7.doSearch(sheet3, url, jQuery("#form1"), 30, "");
	}
	
	//결재
	function dlgSignForm( sign_class_cd, uri ) {
		var f = document.form1;
		var sheet1 = document.all.sheet1;
		var url = "/bidPurchaseSign/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");
		window.focus();
	}

	


	/**
	 *	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:"CHARGE_EMAIL", 				Width:100, 		Align:"Center", Edit:false},
			    			{Header:'통화|통화',											Type:"Text", 			SaveName:"CURRENCY_GB", 				Width:100, 		Align:"Center", Edit:false},
			    			{Header:'견적금액|견적금액',									Type:"Text", 			SaveName:"ESTI_TOT_AMT", 				Width:160, 		Align:"Right",   Edit:false,			Cursor:"pointer"},
			    			{Header:'선정정보|선정품목수',									Type:"Text", 			SaveName:"SEL_ITEM_QTY", 				Width:160, 		Align:"Right",   Edit:false,			Cursor:"pointer"},
			    			{Header:'선정정보|선정금액',									Type:"Text", 			SaveName:"SEL_ITEM_AMT", 				Width:160, 		Align:"Right",   Edit:false,			Cursor:"pointer"},
			    			{Header:'예상환율|예상환율',									Type:"Float", 			SaveName:"EXCHANGE", 					Width:100, 		Align:"Right"},
			    			{Header:'원화금액|원화금액',									Type:"Int", 				SaveName:"WON_ESTI_TOT_AMT", 		Width:160, 		Align:"Right",   Edit:false,		CalcLogic:"|ESTI_TOT_AMT_I|*|EXCHANGE|"},
			    			{Header:'원화금액|원화금액',									Type:"Int", 				SaveName:"WON_SEL_TOT_AMT", 		Width:160, 		Align:"Right",   Edit:false,		CalcLogic:"|SELECT_TOT_AMT_I|*|EXCHANGE|"},
			    			{Header:'구매예산대비\n견적가율(%)|구매예산대비\n견적가율(%)',		Type:"Text", 			SaveName:"ESTI_TOT_RATE", 			Width:100, 		Align:"Right",   Edit:false},
			    			{Header:'구매예산대비\n견적가율(%)|구매예산대비\n견적가율(%)',		Type:"Text", 			SaveName:"SEL_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:"<%=BID_CHK_NM%>", ComboCode:"<%=BID_CHK_CD%>", 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:60, 		Align:"Center"},
			    			{Header:'업체\n선정|업체\n선정',								Type:"CheckBox", 	SaveName:"SUCC_YN_CK2", 				Width:60, 		Align:"Center", Edit:false},
			    			{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:'SIGN_DT|SIGN_DT',								Type:"Text", 			SaveName:"SIGN_DT", 						Width:100, 		Align:"Center",	Hidden:"True"},
			    			{Header:'EVAL_RESULT|EVAL_RESULT',					Type:"Text", 			SaveName:"EVAL_RESULT_NM", 			Width:100, 		Align:"Center",	Hidden:"True"},
			    			{Header:'ESTI_TOT_AMT_I|ESTI_TOT_AMT_I',		Type:"Text", 			SaveName:"ESTI_TOT_AMT_I", 			Width:100, 		Align:"Center",	Hidden:"True"},
			    			{Header:'SELECT_TOT_AMT_I|SELECT_TOT_AMT_I',		Type:"Text", 			SaveName:"SELECT_TOT_AMT_I", 			Width:100, 		Align:"Center",	Hidden:"True"},
			    			{Header:'EVAL_RESULT|EVAL_RESULT',					Type:"Text", 			SaveName:"EVAL_RESULT_NM", 			Width:100, 		Align:"Center",	Hidden:"True"},
			    			{Header:'CBC_FIRST_RATE|CBC_FIRST_RATE',		Type:"Text", 			SaveName:"CBC_FIRST_RATE", 			Width:100, 		Align:"Center",	Hidden:"True"},
			    			{Header:'PBC_FIRST_CONDI|PBC_FIRST_CONDI',	Type:"Text", 			SaveName:"PBC_FIRST_CONDI", 			Width:100, 		Align:"Center",	Hidden:"True"},
			    			{Header:'CPC_MID_RATE|CPC_MID_RATE',				Type:"Text", 			SaveName:"CPC_MID_RATE", 				Width:100, 		Align:"Center",	Hidden:"True"},
			    			{Header:'PBC_MID_CONDI|PBC_MID_CONDI',			Type:"Text", 			SaveName:"PBC_MID_CONDI", 			Width:100, 		Align:"Center",	Hidden:"True"},
			    			{Header:'PBC_REST_RATE|PBC_REST_RATE',			Type:"Text", 			SaveName:"PBC_REST_RATE", 			Width:100, 		Align:"Center",	Hidden:"True"},
			    			{Header:'PBC_REST_CONDI|PBC_REST_CONDI',		Type:"Text", 			SaveName:"PBC_REST_CONDI", 			Width:100, 		Align:"Center",	Hidden:"True"},
			    			{Header:'파일\n다운|파일\n다운',					Type:"Text", 		SaveName:"FILE_DOWN", 				Width:100, 		Align:"Center", Edit:false	,			Cursor:"pointer"}
			    			
			];
		}else if(sheetName.id == "sheet2"){
			init_sheet.Cfg = {SearchMode:2, Page:30 , MergeSheet:msHeaderOnly};
			init_sheet.Cols = [
     			       			{Header:'Del',								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:'자재코드|자재코드',				Type:"Text", 			SaveName:"MATERIAL_CD", 				Width:60, 			Align:"Center"},
     			    			{Header:'자재명|자재명',					Type:"Text", 			SaveName:"MATERIAL_NAME", 			Width:220, 			Align:"Left"},
     			    			{Header:'규격|규격',						Type:"Text", 			SaveName:"STD", 							Width:70, 			Align:"Left"},
     			    			{Header:'단위|단위',						Type:"Text", 			SaveName:"UNIT_KIND", 					Width:30, 			Align:"Center"},
     			    			{Header:'도급|단가',						Type:"Int", 				SaveName:"CONT_UNIT_AMT", 			Width:50, 			Align:"Right"},
     			    			{Header:'도급|금액',						Type:"Int", 				SaveName:"CONT_AMT", 					Width:50, 			Align:"Right",	CalcLogic:"|CONT_UNIT_AMT|*|DEMANDED_QTY|"},
     			    			{Header:'실행|단가',						Type:"Int", 				SaveName:"ACT_UNIT_AMT", 				Width:50, 			Align:"Right"},
     			    			{Header:'실행|금액',						Type:"Int", 				SaveName:"ACT_AMT", 						Width:50, 			Align:"Right",	CalcLogic:"|ACT_UNIT_AMT|*|DEMANDED_QTY|"},
     			    			{Header:'견적의뢰수량|견적의뢰수량',		Type:"Float", 			SaveName:"DEMANDED_QTY", 			Width:40, 			Align:"Right"},
     			    			{Header:'투입요청일|투입요청일',			Type:"Text", 			SaveName:"REQUEST_DATE", 				Width:40, 			Align:"Center",		Format:"####-##-##"}
				];
		}else{
			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}
				];
		}
		init_sheet.HeaderMode = {Sort:1,HeaderCheck:false};
		IBS_InitSheet(sheetName, init_sheet);
		sheetName.SetDataAutoTrim(0);
		sheet2.SetEditable(false);
		setGridSize();
	}
	
	/**
	 *	IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
	 */
	function sheet1_OnSearchEnd(code, message) {
		var fevent = $("#fevent").val();
	    if(code == 0) {
	    	if("GET_CORP_LIST" == fevent)
	    		doSearchSheetitem();
	    	
	    	setGridSize();
	    	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;
						succ_vendor_cnt = succ_vendor_cnt+1;
					}
					if(sheet1.GetCellValue(r, "SITEPARTI_YN") == 'Y'){
						sheet1.SetCellFontColor(r,"ESTI_TOT_AMT", "#0000ff");
					}
					if(sheet1.GetCellValue(r, "ESTI_TOT_AMT_I") > 0){
						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);
					//환율이 KRW 일 경우 환율 수정 불가
					if(sheet1.GetCellValue(r, "CURRENCY_GB") == "KRW"){
						sheet1.SetCellEditable(r , "EXCHANGE", false);
					}
					if(sheet1.GetCellValue(r, "RNNC_REASON").length > 0){
						sheet1.SetCellEditable(r , "EXCHANGE", false);
					}
					
					var status = "<%=Order.get("STATUS_CD")%>";
					 if(status == "07"){
						 sheet1.SetRowEditable(r,false);
					 }
					 if($("#FOR_PO").val() > 0){
						 //sheet1.SetRowEditable(r,false);
					 }
				}
			}
		} else {
			//조회 에러 수행
			alert(message);
		}
	}
	
	/**
	 *	IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
	 */
	function sheet2_OnSearchEnd(code, message) {
		 if(code == 0) {
			 sheet2.FitColWidth();
		} else {
			//조회 에러 수행
			alert(message);
		}
	}

	/**
	 *	IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
	 */
	function sheet3_OnSearchEnd(code, message) {
		 if(code == 0) {
			//sheet3.FitColWidth();
			//견적대상 업체 조회
			doSearchSheet();
		} else {
			//조회 에러 수행
			alert(message);
		}
	}
	
	/**
	 *	IBSheet size setting
	 */
	function setGridSize() {
		sheet1.FitColWidth();
		sheet2.FitColWidth();
	}
	
	function sheet1_OnSaveEnd(code, msg)
	{
		var event = $("#fevent").val();
		if(event == "SAVE_APPR"){
			if(code>= "0"){
				
				submitXmlRequest("/bid/purchase/SuccessBid_form.screen", "SAVE_BID_STATUS", document.form1, "SUCCESS");
				<%-- 
				var f = document.form1;
				var sign_bid_no = $("#BID_NO").val();
				var sign_bid_deg = $("#BID_DEG").val();
				dlgSignForm('ebid_ppoD', '/bid/purchase/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("에러가 발생 하였습니다.\n" + msg);
				document.form1.isSubmit = false;
			}
		}else if(event == "SAVE_SHEET"){
			if(code>= "0"){
				alert("저장되었습니다.");
				$("#fevent").val("FORM_SELECT");
				$("#form1").attr("action", "/bid/purchase/SuccessBid.screen");
				$("#form1").attr("target", "_self");
				$("#form1").attr("method", "post");
				$("#form1").submit();
			}else{
				alert("에러가 발생하였습니다.\n"+msg);
				document.form1.isSubmit = false;
			}
		}
		
	}

	
	//첨부파일   
	function doAttachFile(obj,No) {
		var file_div = "bid/purchase/<%=Order.get("BID_NO")%>/";
		 if(obj==''){
			 alert("After you have saved, you can attach a file.");
		}else{ 
			if(No == 1){
				viewFileListNew("<%=Order.get("DOC_ETC_IN")%>", obj.value, document.form1.p_AttachFile1, "Y", file_div);
			}else{
				viewFileListNew("<%=Order.get("DOC_ETC_OUT")%>", obj.value, document.form1.p_AttachFile2, "Y", file_div);
			}
		} 
	}
	
	function doResult(resultObj) {
		try {
			if( resultObj.getRequestEvent() == "CHK") {
				if( resultObj.getSuccess() ) {
					document.form1.isSubmit = false;
					if(btn_act == "Rebid"){
						 if (confirm("재입찰 하시겠습니까?")){
								$("#fevent").val("FORM_SELECT");
								$("#form1").attr("action", "/bid/purchase/Rebid.screen");
								$("#form1").attr("target", "_self");
								$("#form1").attr("method", "post");
								$("#form1").submit();
							 }
					}else if(btn_act == "to_Save"){
						if (confirm("저장 하시겠습니까?")){
							if($(':checkbox[name="DIV_CONT_YN"]:checked').val() != "Y")$("#DIV_CONT_YN").val("N");	
							if($("#DELI_FROM_DY").val()>$("#DELI_TO_DY").val()||$("#DELI_FROM_DY").val()==""||$("#DELI_TO_DY").val()==""){
								alert("Delivery Period를 확인해주세요.");
								$("#DELI_TO_DY").focus();
								return;
							}
							jQuery("#fevent").val("SAVE_SHEET");
							var url = Modular.model.PageContext.CONTEXT_ROOT + "/bid/purchase/SuccessBid_sheet.screen";
							Modular.view.IBSheet7.doSave(sheet1, url, jQuery("#form1"), 30, "");
						}
					}else if(btn_act == "to_appr"){
						 if($("#DIV_PO_YN").val() != "Y" && jQuery("input:checkbox[id='DIV_CONT_YN']").is(":checked") != true){
							 var rowcnt = sheet1.RowCount();
							 var succ_cnt = 0;
							 for(var r=0; r < rowcnt; r++)
							{
								if(sheet1.GetCellValue(r+2, "SUCC_YN_CK") == true){
									succ_cnt++;
								}
							}
							 
							 if(succ_cnt == 0){
								 
								alert("낙찰업체을 선정해주세요.");
								return;
							 }else if(succ_cnt > 1){
								 alert("낙찰 업체가 2개 이상입니다.");
								 return;
							 }
							 
						 }else{
							var rowcnt = sheet1.RowCount();
							var succ_cnt = 0;
							if(rowcnt> 0){
								for(var r=0; r < rowcnt; r++)
								{
									if(sheet1.GetCellValue(r+2, "SUCC_YN_CK") == true){
										succ_cnt++;
									}
								}
								if(succ_cnt ==0){
									alert("낙찰업체를 선정해주세요.");
									return;
								}
							} 
						}
						 
						 
						 if (confirm("낙찰 하시겠습니까?")){
							if($(':checkbox[name="DIV_CONT_YN"]:checked').val() != "Y")$("#DIV_CONT_YN").val("N");	
							if($("#DELI_FROM_DY").val()>$("#DELI_TO_DY").val()||$("#DELI_FROM_DY").val()==""||$("#DELI_TO_DY").val()==""){
								alert("Delivery Period를 확인해주세요.");
								$("#DELI_TO_DY").focus();
								return;
							}
							jQuery("#fevent").val("SAVE_APPR");
						 	var url = Modular.model.PageContext.CONTEXT_ROOT + "/bid/purchase/SuccessBid_sheet.screen";
						 	Modular.view.IBSheet7.doSave(sheet1, url, jQuery("#form1"), 30, "");
						 	
						 }

						 /* if (confirm("결재 하시겠습니까?")){
							if($(':checkbox[name="DIV_CONT_YN"]:checked').val() != "Y")$("#DIV_CONT_YN").val("N");	
							if($("#DELI_FROM_DY").val()>$("#DELI_TO_DY").val()||$("#DELI_FROM_DY").val()==""||$("#DELI_TO_DY").val()==""){
								alert("Delivery Period를 확인해주세요.");
								$("#DELI_TO_DY").focus();
								return;
							}
						 	jQuery("#fevent").val("SAVE_APPR");
						 	var url = Modular.model.PageContext.CONTEXT_ROOT + "/bid/purchase/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/purchase/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();
							       link += "&ONBID_YN="+$("#ONBID_YN").val();
					       //window.showModalDialog(link,'Attach Files','dialogWidth:730px;dialogHeight:430px; center:yes; help:no; status:no; scroll:no; resizable:no');
							fLayerPop(win_id, link, 600,210, '', '', 'NO');
						 }
					}else if(btn_act == "to_plan"){
						if (confirm("수정 하시겠습니까?")){
								$("#fevent").val("FORM_SELECT");
								$("#form1").attr("action", "/bid/purchase/OfflineBid.screen");
								$("#form1").attr("target", "_self");
								$("#form1").attr("method", "post");
								$("#form1").submit();
						}
					}
				} else {
					alert("시행결의중입니다.");
					return;
				}
			}
		
			if( resultObj.getRequestEvent() == "FORM_DELETE") {
				if( resultObj.getSuccess() ) {
					alert("삭제 되었습니다.");
 					$("#btn_list").click();
				}
				else {
					dlgErrorMsg(resultObj);
				}
			}

			if( resultObj.getRequestEvent() == "SAVE_BID_STATUS") {
				if( resultObj.getSuccess() ) {
					alert("낙찰 되었습니다.");
 					jQuery("#btn_list").click();
				}
				else {
					dlgErrorMsg(resultObj);
				}
			}
			if( resultObj.getRequestEvent() == "CLEAR_SAVE_LIST") {
				if( resultObj.getSuccess() ) {
					document.form1.isSubmit = false;
					alert("초기화 되었습니다.");
					
					
					sheet1.SetColHidden("SEL_ITEM_QTY",true);
					sheet1.SetColHidden("SEL_ITEM_AMT",true);
					sheet1.SetColHidden("WON_SEL_TOT_AMT",true);
					sheet1.SetColHidden("WON_ESTI_TOT_AMT",false);
					sheet1.SetColHidden("ESTI_TOT_RATE",false);
					sheet1.SetColHidden("SEL_TOT_RATE",true);
					sheet1.SetColHidden("SUCC_YN_CK",false);
					sheet1.SetColHidden("SUCC_YN_CK2",true);
					
					sheet1.SetColEditable("SUCC_YN_CK", true);
					
					jQuery("#btn_divCont").hide();
					doSearchSheet();
					
				}
				else {
					dlgErrorMsg(resultObj);
				}
			}
		} catch(errorObject) {
			showErrorDlg("doResult()", errorObject);
		}
	}
	
	function sheet1_OnSmartResize(Width, Height) { 
		sheet1.FitColWidth();
		sheet2.FitColWidth();
		autoResize();
	}

	function autoResize(){
		//var t1_height = document.getElementById("t1").scrollHeight + 10;
		var iframeHeight= 200;   
		var iframeWidth= document.body.scrollWidth;   
		sheet1.SetSheetHeight(160);
		sheet2.SetSheetHeight(250);
	}	
	
	//2015.02.27 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_OnClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
		var div_po = true; 
		
		//단가계약이 Y 인경우 멀티 업체 선정 가능
		if($("#DIV_PO_YN").val() == "Y")
			div_po = false;
		
		
		if(Row == 0){
			return;
		}
		var Sn = sheet1.GetCellProperty(Row, Col, "SaveName");
		 if(Sn == "DISQ_YN"){
			 if(sheet1.GetRowEditable(Row) == false){
				 alert("결격사유를 입력 할 수 없습니다.");
				 return;
			 }
			if(sheet1.GetCellValue(Row,"SUCC_YN_CK") == "1"){
				alert("낙찰 선정된 업체 입니다.\n결격사유를 입력 할 수 없습니다.");
				return;
			}
			 var win_id = "_DisqPop";
			 var link = "/bid/purchase/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');
		}
		if(Col == 18){
			var DISQ = sheet1.GetCellValue(Row, "DISQ_REASON");
			if(DISQ.length > 0){
				sheet1.SetCellValue(Row, "SUCC_YN_CK", false);
				alert("결격사유가 입력된 업체 입니다.\n업체 선정 할 수 없습니다.");
				return;
			}
			var EVAL_RESULT = sheet1.GetCellValue(Row, "EVAL_RESULT");
			if(sheet1.GetCellValue(Row, "EVAL_RESULT") == "03"){
				sheet1.SetCellValue(Row, "SUCC_YN_CK", false);
				alert("기술검토(TBE)가 부적합 입니다.\n업체 선정 할 수 없습니다.");
				return;
			}
			//alert(sheet1.GetCellValue(Row, "SITEPARTI_YN"));
			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);
						alert("견적금액이 없는 업체는 업체 선정 할 수 없습니다.");
						return;
					}
				}else{
					/* sheet1.SetCellValue(Row, "SUCC_YN_CK", false);
					alert("견적금액이 없는 업체는 업체 선정 할 수 없습니다.");
					return; */
					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;
				}
			}
			
			if(div_po){
				if(Value == true){
					if(succ_vendor != ""){
						if(succ_vendor != Row){
							
							if(sheet1.GetCellValue(Row, "SUCC_YN_CK") == "1"){
								alert("업체 선정은 한곳만 하실 수 있습니다.");
								sheet1.SetCellValue(Row, "SUCC_YN_CK", false);
								return;
							}
						}
					}
					succ_vendor = Row;//업체 선택
					
					//선급금 ,중도금 , 잔금 셋팅
					$("#CBC_FIRST_RATE").val(sheet1.GetCellValue(Row,"CBC_FIRST_RATE"));
				  	$("#PBC_FIRST_CONDI").val(sheet1.GetCellValue(Row,"PBC_FIRST_CONDI"));
					
					$("#CPC_MID_RATE").val(sheet1.GetCellValue(Row,"CPC_MID_RATE"));
					$("#PBC_MID_CONDI").val(sheet1.GetCellValue(Row,"PBC_MID_CONDI"));
					
					$("#PBC_REST_RATE").val(sheet1.GetCellValue(Row,"PBC_REST_RATE"));
					$("#PBC_REST_CONDI").val(sheet1.GetCellValue(Row,"PBC_REST_CONDI"));
				}else{
					if(succ_vendor == Row){//선택 취소
						succ_vendor = "";
					}
				}
			}

		}
		
		if(Sn == "FILE_DOWN"){	
			fileDown(sheet1.GetCellValue(Row,"VENDOR_NAME"), sheet1.GetCellValue(Row,"FILE_GB"));
		}
	}

	/**
	 * 첨부파일 예약 함수
	 */
	function fileDown(file_id, file_gb){		
		var fileName = "<%=Order.get("DEMANDED_TITLE")%>" + "(" + "<%=Order.get("DEMANDED_NO")%>" + ")_" + file_id;
		var url="/common/file/FileDownloadServlet";		
 		url += "?mode=zipDown";
 		url += "&fileName=" + encodeURIComponent(fileName);
	 	url += "&fileGB=" + file_gb;
	 	url += "&ID=<%=Order.get("DEMANDED_ID")%>";
	 	
 		window.open(url, "_fileDown", "toolbar=no, width=400, height=100, top=500, left=400, toolbar=no,directories=no,status=no,scrollbars=yes,resize=no,menubar=no,target=new")
	}
	
	/**
	 *	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/purchase/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 += "&DIV_PO_YN="+$("#DIV_PO_YN").val();
							link += "&DEMANDED_ID="+$("#DEMANDED_ID").val();
							link += "&sModule=LM";
					       //fLayerPop(win_id, link, 1200,690, '', '', 'NO');
					       window.open(link,win_id,"toolbar=no, width=1000, height=600, top=50, left=40, toolbar=no,directories=no,status=no,scrollbars=yes,resize=no,menubar=no,target=new");
					}
				}else if(sheet1.GetCellValue(Row,"SITEPARTI_YN") == "Y" && sheet1.GetCellValue(Row,"BID_RNNC_DT") != ""){
					      var win_id = "_BidGiveupPop";
						  var link = "/bid/purchase/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"){
					if(!confirm("견적서 작성 페이지로 이동 하시겠습니까?"))return;
					$("#fevent").val("");
					$("#VENDOR_CD").val(sheet1.GetCellValue(Row,"VENDOR_CD"));
					$("#form1").attr("action", "/bid/purchase/BidOfflineAmt.screen");
					$("#form1").attr("target", "_self");
					$("#form1").attr("method", "post");
					$("#form1").submit();
				}
			}
		}
		if(Sn == "DISQ_YN"){
			if(sheet1.GetCellValue(Row,"SUCC_YN_CK") == "1"){
				alert("낙찰 선정된 업체 입니다.\n결격사유를 입력 할 수 없습니다.");
				return;
			}
			 var win_id = "_DisqPop";
			 var link = "/bid/purchase/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 sheet1_OnChange(Row, Col, Value) {
		var Sn = sheet1.GetCellProperty(Row, Col, "SaveName");
		if(Sn == "EXCHANGE"){
			//합계 행에 값이 바뀌었을 때, 같은 행의 다른셀에 계산 정보 표시
/* 			var totAmt = sheet1.GetCellValue(Row,"ESTI_TOT_AMT_I");
			var exchange = sheet1.GetCellValue(Row,"EXCHANGE");
			var won_esti_tot_amt = Number(exchange * totAmt);
			sheet1.SetCellValue(Row,"WON_ESTI_TOT_AMT", won_esti_tot_amt); */
		}
	}

	
	
	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);
	}
	
	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 divContYnCheck(){
		var status = "<%=Order.get("STATUS_CD")%>";
		if(jQuery("input:checkbox[id='DIV_CONT_YN']").is(":checked") == true){
			
			sheet1.SetColHidden("SEL_ITEM_QTY",false);
			sheet1.SetColHidden("SEL_ITEM_AMT",false);
			sheet1.SetColHidden("WON_SEL_TOT_AMT",false);
			sheet1.SetColHidden("WON_ESTI_TOT_AMT",true);
			sheet1.SetColHidden("ESTI_TOT_RATE",true);
			sheet1.SetColHidden("SEL_TOT_RATE",false);
			sheet1.SetColHidden("SUCC_YN_CK",true);
			sheet1.SetColHidden("SUCC_YN_CK2",false);

			sheet1.SetColEditable("SUCC_YN_CK", false);
			
			
			if(status == "07"){
				jQuery("#btn_divCont").hide();
			}else{
				jQuery("#btn_divCont").show();
			}
			
		}else{
			sheet1.SetColHidden("SEL_ITEM_QTY",true);
			sheet1.SetColHidden("SEL_ITEM_AMT",true);
			sheet1.SetColHidden("WON_SEL_TOT_AMT",true);
			sheet1.SetColHidden("WON_ESTI_TOT_AMT",false);
			sheet1.SetColHidden("ESTI_TOT_RATE",false);
			sheet1.SetColHidden("SEL_TOT_RATE",true);
			sheet1.SetColHidden("SUCC_YN_CK",false);
			sheet1.SetColHidden("SUCC_YN_CK2",true);
			
			sheet1.SetColEditable("SUCC_YN_CK", true);
			
			 jQuery("#btn_divCont").hide();
		} 

		sheet1.FitColWidth();
		
	}
	
	function doClearDiv(){
		if(!jQuery("input:checkbox[id='DIV_CONT_YN']").is(":checked") == true){
			
			
			
			if(confirm("분할낙찰한 내역이 초기화 됩니다.\n 초기화 하시겠습니까?")){
				
				
				var f = document.form1;
				submitXmlRequest("/bid/purchase/SuccessBid_form.screen", "CLEAR_SAVE_LIST", f, "SUCCESS");
			}else{
				$("input:checkbox[id='DIV_CONT_YN']").prop("checked", true);
			}

			sheet1.FitColWidth();
			
		
		}else{
			sheet1.SetColHidden("SEL_ITEM_QTY",false);
			sheet1.SetColHidden("SEL_ITEM_AMT",false);
			sheet1.SetColHidden("WON_SEL_TOT_AMT",false);
			sheet1.SetColHidden("WON_ESTI_TOT_AMT",true);
			sheet1.SetColHidden("ESTI_TOT_RATE",true);
			sheet1.SetColHidden("SEL_TOT_RATE",false);
			sheet1.SetColHidden("SUCC_YN_CK",true);
			sheet1.SetColHidden("SUCC_YN_CK2",false);

			sheet1.SetColEditable("SUCC_YN_CK", false);
			
			
			if(status == "07"){
				jQuery("#btn_divCont").hide();
			}else{
				jQuery("#btn_divCont").show();
			}
		}
		sheet1.FitColWidth();
	}
	
	
	function fLayerPopClose(layerID)
	{
		
		var	oNode	=	document.getElementById(layerID);
		if(oNode != null)
		{
			$('#'+layerID+ '_divcontent').empty();
			$('#'+layerID).bPopup().close();
			document.body.removeChild(oNode);
		}
		
		if(layerID == '_DivContPop'){
			doSearchSheet();
		}
	}
</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="VENDOR_CD" value="">
<INPUT type='hidden' name="signClass" value="ebid_ppoD">
<INPUT type='hidden' name="PBC_CBE_TYPE_CD" value="<%=Order.get("PBC_CBE_TYPE_CD")%>">
<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="DIV_PO_YN" value="<%=Order.get("DIV_PO_YN")%>">
<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="DELIVERY_CONDITION_YN" value="<%=Order.get("DELIVERY_CONDITION_YN")%>">
<INPUT type='hidden' name="PBC_LANDTRAN_YN" value="<%=Order.get("PBC_LANDTRAN_YN")%>">
<INPUT type='hidden' name="PBC_PACK_YN" value="<%=Order.get("PBC_PACK_YN")%>">
<INPUT type='hidden' name="PBC_DOC_YN" value="<%=Order.get("PBC_DOC_YN")%>">
<INPUT type='hidden' name="PBC_TEST_YN" value="<%=Order.get("PBC_TEST_YN")%>">
<INPUT type='hidden' name="PBC_SPETOOL_YN" value="<%=Order.get("PBC_SPETOOL_YN")%>">
<INPUT type='hidden' name="PBC_COMMISS_YN" value="<%=Order.get("PBC_COMMISS_YN")%>">
<INPUT type='hidden' name="PBC_INSTALL_YN" value="<%=Order.get("PBC_INSTALL_YN")%>">
<INPUT type='hidden' name="CURRENCY_GB_YN" value="<%=Order.get("CURRENCY_GB_YN")%>">
<INPUT type='hidden' name="PBC_FEE_YN" value="<%=Order.get("PBC_FEE_YN")%>">
<INPUT type='hidden' name="PBC_OPTION_YN" value="<%=Order.get("PBC_OPTION_YN")%>">
<INPUT type='hidden' name="CONTFUL_RATE" value="<%=Order.get("CONTFUL_RATE")%>">
<INPUT type='hidden' name="CURRENCY_GB" value="<%=Order.get("CURRENCY_GB")%>">
<INPUT type='hidden' name="PBC_OPTION_COMMENT" value="<%=Order.get("PBC_OPTION_COMMENT")%>">
<INPUT type='hidden' name="CBC_DAMAGE_RATE" value="<%=Order.get("CBC_DAMAGE_RATE")%>">
<INPUT type='hidden' name="CBC_DAMAGE_MAXRATE" value="<%=Order.get("CBC_DAMAGE_MAXRATE")%>">



<INPUT type='hidden' name="PBC_FRSTGUAR_RATE" value="<%=Order.get("PBC_FRSTGUAR_RATE")%>">
<INPUT type='hidden' name="WARR_RATE" value="<%=Order.get("WARR_RATE")%>">
<INPUT type='hidden' name="PBC_DEFECT_CONDI" value="<%=Order.get("PBC_DEFECT_CONDI")%>">
<INPUT type='hidden' name="CBC_DEFECT_DAY" value="<%=Order.get("CBC_DEFECT_DAY")%>">
<INPUT type='hidden' name="CBC_DERECT_TERM_NM" value="<%=Order.get("CBC_DERECT_TERM_NM")%>">
<INPUT type='hidden' name="CBC_DERECT_TERM_CD" value="<%=Order.get("CBC_DERECT_TERM_CD")%>">
<INPUT type='hidden' name="KRW_APPR_YN" value="<%=Order.get("KRW_APPR_YN")%>">
<INPUT type='hidden' name="FOR_PO" value="<%=Order.get("FOR_PO")%>">
<INPUT type='hidden' name="SITEPARTI_YN" value="Y">

<INPUT type='hidden' name="OLD_PAY_DIV" value="<%=Order.get("PAY_DIV")%>">
<INPUT type='hidden' name="TBE_FLAG" value="<%=Order.get("TBE_FLAG")%>">

<table width="100%">
	<colgroup>
		<col width="*" />
		<col width="320" />
	</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_bid"><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.getInt("FOR_PO") > 0){ %>
<TABLE class="form-table" style="margin-bottom: 5px">
	<colgroup>
		<col width="160">
		<col/>
	</colgroup>
  <TR height="25">
	<TD colspan="2"><font color="red">발주의뢰 수량이 변경되어 재입찰이 필요합니다.</font></TD>
  </TR>
</TABLE>
<%}%>

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

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

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

<TABLE class="form-table">
	<colgroup>
		<col width="160"/>
		<col width="23%">
		<col width="160"/>
		<col width="23%">
		<col width="160"/>
		<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>  <!-- 2015.02.27 구매예산추가 mklee -->
	<TD><%= InputText.get("PUR_AMT", Formatter2.currency(Order.get("PUR_AMT"),0), 13, 300, "desc=구매예산,Number,right,readOnly=white","Number") %></TD>
  </TR> 	

  <TR height="25"> 
	<TH> 도급금액 (원)</TH>
	<TD><%= InputText.get("CONT_AMT", Formatter2.currency(Order.get("CONT_AMT"),0), 13, 300, "desc=실행예산,Number,right","Number") %></TD>
	<TH> 실행예산 (원)</TH>	
	<TD><%= InputText.get("ACT_AMT", Formatter2.currency(Order.get("ACT_AMT"),0), 13, 300, "desc=실행예산,Number,right","Number") %></TD>
	<TH> 도급대비실행율(%)</TH>	
	<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 colspan="5">
		<select name="pay_div" id="pay_div" style="width: 15%;">
			<option value="1">납품정산</option>
			<option value="2">계획분할</option>
		</select>
	</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="160"/>
		<col width="160"/>
		<col width="25%"/>
		<col width="160"/>
		<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 colspan="2"><%=Order.get("DIV_PO_YN").equals("Y") ? "예" : "아니오" %></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="160"/>
		<col width="160"/>
		<col width="25%"/>
		<col width="160"/>
		<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="sheet3_div" style="width: 100%; height: 100%;"> 	
			<script>createIBSheet('sheet3','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("SUPP_REQ_DY")%></TD>	
  </TR>
  
  <TR height="25"> 
	<TH> TBE 심사자</TH>
	<TD><%=Order.get("EVAL_EMPNM")%></TD>
	<TH> TBE 완료일</TH>
	<TD ><%=Order.get("TBE_FIN_DT")%></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="160"/>
		<col width="23%">
		<col width="160"/>
		<col width="23%">
		<col width="160"/>
		<col/>
	</colgroup>
  <TR height="25"> 
	<TH>통화구분</TH>
	<TD><%=Order.get("CURRENCY_GB_NM") %> &nbsp&nbsp  
		<%=Order.get("CURRENCY_GB_YN").equals("Y") ? "[업체변경가능]" : "[업체변경불가능]" %>
		
	</TD>
	<TH>CBE문서 TYPE</TH>
	<TD colspan="3">
		<%if(!Order.get("PBC_CBE_TYPE_CD").isEmpty()){ %><%=Order.get("PBC_CBE_TYPE_CD").equals("A") ? "A type" : Order.get("PBC_CBE_TYPE_CD").equals("B") ? "B type":"C type(최종입찰업체만 표시)" %><%} %>
	</TD>	
  </TR>
  <TR height="25"> 
	<TH>Installation</TH><!-- 설치비 포함여부 -->
	<TD><%=Order.get("PBC_INSTALL_YN").equals("Y") ? "업체 견적내용 반영" : "업체 견적내용 미반영" %></TD>
	<TH>Spare Parts for Commissionig</TH><!-- 시운전 포함여부 -->
	<TD><%=Order.get("PBC_COMMISS_YN").equals("Y") ? "업체 견적내용 반영" : "업체 견적내용 미반영" %></TD>
	<TH>Special Tool</TH><!-- 설치비 특별공구 포함여부 -->
	<TD><%=Order.get("PBC_SPETOOL_YN").equals("Y") ? "업체 견적내용 반영" : "업체 견적내용 미반영" %></TD>	
  </TR>
  <TR height="25"> 
	<TH>Test & Inspection at Fabrication shop</TH><!-- 샾(공장) 검사비용 포함여부 -->
	<TD><%=Order.get("PBC_TEST_YN").equals("Y") ? "업체 견적내용 반영" : "업체 견적내용 미반영" %></TD>
	<TH>Documentation</TH><!-- vendor print  (무조건 포함)  삭제? -->
	<TD><%=Order.get("PBC_DOC_YN").equals("Y") ? "업체 견적내용 반영" : "업체 견적내용 미반영" %></TD>
	<TH>Packing cost</TH><!-- 포장비용 포함여부 -->
	<TD><%=Order.get("PBC_PACK_YN").equals("Y") ? "업체 견적내용 반영" : "업체 견적내용 미반영" %></TD>	
  </TR>
  <TR height="25"> 
	<TH>Inland Transportaion</TH><!-- 내륙운송비 -->
	<TD><%=Order.get("PBC_LANDTRAN_YN").equals("Y") ? "업체 견적내용 반영" : "업체 견적내용 미반영" %></TD>
	<TH>Delivery Condition</TH><!-- 인도조건 (현장도착도, 현장상차도,현장설치도, 설치시운전도) -->
	<TD colspan="3">
	  <%=Order.get("DELIVERY_CONDITION_NM") %>&nbsp&nbsp  <%=Order.get("DELIVERY_CONDITION_YN").equals("Y") ? "[업체변경가능]" : "[업체 변경 불가능]" %></TD>
  </TR>
   <TR height="25"> 
	<TH>OPTIONAL PRICE</TH><!-- 현장감독관 일당   &     기타일당 내역 -->
	<TD colspan="5">A. Supervision fee &nbsp <%=Order.get("PBC_FEE_YN").equals("Y") ? "업체 견적내용 반영" : "업체 견적내용 미반영" %>
	    <% if(!Order.get("PBC_OPTION_COMMENT").isEmpty()){ %>&nbsp&nbsp  B. <%= Order.get("PBC_OPTION_COMMENT")%> &nbsp<%=Order.get("PBC_OPTION_YN").equals("Y") ? "업체 견적내용 반영" : "업체 견적내용 미반영" %><%} %></TD>
  </TR>
  <TR height="25"> 
	<TH>Liquidated Damages</TH><!-- 지체상금 fix -->
	<TD colspan="5"><%= Order.get("CBC_DAMAGE_RATE")%>% <%=Order.get("CBC_DAMAGE_NM") %>, Max <%= Order.get("CBC_DAMAGE_MAXRATE")%>%</TD>
  </TR>
  <TR height="25"> 
	<TH>선급금</TH>
	<TD><%= InputText.get("CBC_FIRST_RATE", Order.get("CBC_FIRST_RATE"), 5, 3, "Right,Number","Number") %>% <%= InputText.get("PBC_FIRST_CONDI", Order.get("PBC_FIRST_CONDI"), 20, 50, "") %></TD>
	<TH>중도금</TH>
	<TD><%= InputText.get("CPC_MID_RATE", Order.get("CPC_MID_RATE"), 5, 3, "Right,Number","Number") %>% <%= InputText.get("PBC_MID_CONDI", Order.get("PBC_MID_CONDI"), 20, 50, "") %></TD>
	<TH>잔금</TH>
	<TD><%= InputText.get("PBC_REST_RATE", Order.get("PBC_REST_RATE"), 5, 3, "Right,Number","Number") %>% <%= InputText.get("PBC_REST_CONDI", Order.get("PBC_REST_CONDI"), 20, 50, "") %></TD>
	<%-- <TH>선급금</TH>
	<TD><% if(!Order.get("CBC_FIRST_RATE").isEmpty()){ %><%=Order.get("CBC_FIRST_RATE") %>% <%} %><%= Order.get("PBC_FIRST_CONDI")%></TD>
	<TH>중도금</TH>
	<TD><% if(!Order.get("CPC_MID_RATE").isEmpty()){ %><%= Order.get("CPC_MID_RATE")%>% <%} %><%=Order.get("PBC_MID_CONDI")%></TD>
	<TH>잔금</TH>
	<TD><% if(!Order.get("PBC_REST_RATE").isEmpty()){ %><%= Order.get("PBC_REST_RATE") %>% <%} %><%=Order.get("PBC_REST_CONDI")%></TD> --%>	
  </TR>
  <TR height="25"> 
	<TH>First Payment Bond</TH><!-- 선급금이행증권(yes, no) -->
	<TD><%= Order.get("PBC_FRSTGUAR_RATE") %>% <%= Order.get("PBC_FRSTGUAR_CONDI")%></TD>
	<TH>Performance Bond</TH><!-- 계약이행증권(yes, no) -->
	<TD><%= Order.get("CONTFUL_RATE") %>% <%=Order.get("CONTFUL_CONDI") %></TD>
	<TH>Guarantee Bond</TH><!-- 하자이행증권(yes, no) -->
	<TD><%= Order.get("WARR_RATE") %>% <%= Order.get("WARR_CONDI")%></TD>	
  </TR>  
  <TR height="25"> 
	<TH>Guarantee Period</TH><!-- 하자보수기간 -->
	<TD colspan="3"><%=Order.get("PBC_DEFECT_CONDI") %> <%=Order.get("CBC_DEFECT_DAY") %>  
	<% if(!Order.get("CBC_DERECT_TERM_NM").isEmpty()){ %><%=Order.get("CBC_DERECT_TERM_NM") %>간<%} %>
	<input type="checkbox" id="addGuar" style="margin-top:2px; display:none;">
	<span class="checkAdd" style="display:none;">&nbsp;or&nbsp;
	<%=Order.get("PBC_DEFECT_CONDI2") %> <%=Order.get("CBC_DEFECT_DAY2")%>  
	<%if(Order.get("CBC_DERECT_TERM_CD2").equals("01")){%>
		<span>일 간 중 선도래일</span>
	<%}else if(Order.get("CBC_DERECT_TERM_CD2").equals("02")){%>
		<span>개월 간 중 선도래일</span>
	<%} %>
	</span>
	</TD>
	
	<TH>Delivery Period</TH><!-- 납기일 fix -->
	<TD>
		<%= InputText.get("DELI_FROM_DY", Order.get("DELI_FROM_DY"), 10, 50, "hangule,center, desc=납기일,ReadOnly") %>
		<IMG name="start_img" id="calender_from" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('DELI_FROM_DY');">
		~
		<%= InputText.get("DELI_TO_DY", Order.get("DELI_TO_DY"), 10, 50, "hangule,center, desc=납기일,ReadOnly") %>
		<IMG name="start_img" id="calender_to" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('DELI_TO_DY');">
				
	</TD>
  </TR>  
</TABLE>

<TABLE class="form-table" style="margin-top: 10px">
		<colgroup>
		<col width="160"/>
		<col width="160"/>
		<col width="25%"/>
		<col width="160"/>
		<col/>
	</colgroup>
	<TR height="25"> 
    <TH>특이사항</TH>
	<TD colspan="4"><!-- 저장할때 추가해야됨 -->
	<textarea id="CON_REMARK" style="width:95%;height:80px" rows="1" class="input"><%=Order.get("CON_REMARK")%></textarea>
	<%-- <%= InputText.get("CON_REMARK", Order.get("CON_REMARK"), 75, 500, "hangule,left, desc=특이사항") %> --%>
    </TD>

  </TR>
  <TR height="25"> 
    <TH>주요발주내용</TH>
	<TD colspan="2">
		<%=StringUtils.cvtHTML(Order.get("MAIN_PR_CONTENTS"))%>
    </TD>
	
	<TH>입찰업체선정사유</TH>
	<TD>
	 <%=StringUtils.cvtHTML(Order.get("BID_SUPP_SELECT_REASON"))%>      
	</TD>
  </TR>  
  <TR height="25"> 
    <TH>특이사항 내부</TH>
	<TD colspan="2">
		<%=StringUtils.cvtHTML(Order.get("INNER_REMARKS"))%>
    </TD>
	
	<TH> 특이사항 외부</TH>
	<TD>
	 <%=StringUtils.cvtHTML(Order.get("OUTER_REMARKS"))%>      
	</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>  
</TABLE>

<table id=item_list width="100%">
	<colgroup>
		<col width="500" />
		<col width="*" />
	</colgroup>
	<tr>
   		<th>
   		<div class="application-info magT20">
			<div class="application-sub-title">
				<span class="title">견적의뢰내역</span>
			</div>
		</div>
   		</th>
   		<td align="right">
   		</td>
  	</tr>
</table>
<div id="sheet2_div" style="padding-top:5px;height: auto; min-height: 200px; overflow: auto;">
	<script>createIBSheet('sheet2','100%', '200px');</script>
</div>

<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>
				<span id="div_cont_span"><LABEL for="DIV_CONT_YN"><INPUT type="checkbox" id="DIV_CONT_YN" name="DIV_CONT_YN" value="Y" <%=Order.get("DIV_CONT_YN").equals("Y") ? "checked=\"checked\"" : "" %> onclick="doClearDiv();"> 분할낙찰 여부</LABEL></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_divCont"><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: 200px; overflow: auto;">
		<script>createIBSheet('sheet1','100%', '300px');</script>
	</div>
</form>