<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="java.util.*,java.io.*"%>
<%@page import="com.csc.library.util.download.*"%>
<%@page import="com.csc.library.util.ManageDocumentService"%>
<%@page import="com.csc.library.databean.util.FileUtil"%>
<%@page import="com.csc.library.approve.*,com.csc.library.databean.*"%>
<%@page import="com.csc.library.entry.*,com.csc.library.utilities.*"%>
<%@page import="com.csc.library.session.*"%>
<%@page import="com.csc.library.components.*,com.csc.library.report.ReportUDF"%>

<%request.setCharacterEncoding("UTF-8");%>
<jsp:useBean id="WELEXP_RH_003c3" class="com.csc.library.system.Task" scope="page"/>
<jsp:setProperty name="WELEXP_RH_003c3" property="appname" value="WELFARE" />
<jsp:setProperty name="WELEXP_RH_003c3" property="classauthen" value="WorkflowUIAuthen" />
<%
WELEXP_RH_003c3.setChannel(request,response);
WELEXP_RH_003c3.checkProfile();
if( WELEXP_RH_003c3.getUProfile() != null ){
	DbRecord borrow_emp=new InitialRecord(WELEXP_RH_003c3.getUProfile()).getDbRecord("Texpend_cost");
	ReportUDF rf=new ReportUDF();
	CheckNull chkNull = new CheckNull();
	String billno=chkNull.chkNullString(request.getParameter("billno")); 
    boolean isstep1=Boolean.parseBoolean(java.net.URLDecoder.decode(chkNull.chkNullString(request.getParameter("isstep1"))));											
%>
<HTML>
	<HEAD>
		<TITLE>myNOTE : Business Process Management Service</TITLE>
		<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
		<LINK HREF="../CSS/MYNOTE.css" REL="stylesheet" TYPE="text/css">
		<script type='text/javascript' src='/hr/dwr/engine.js'> </script>
	   <script type='text/javascript' src='/hr/dwr/util.js'> </script>
	   <script type='text/javascript' src='/hr/dwr/interface/SearchDWR.js'></script>  	   	   
	   <script type='text/javascript' src='/hr/dwr/interface/HotelcostempCtrl.js'></script>		
	   <script type='text/javascript' src='/hr/dwr/interface/ExchangerateCtrl.js'></script>			   
		<SCRIPT TYPE='text/JavaScript' SRC='../JS/SCREEN.js'></SCRIPT>
		<SCRIPT TYPE='text/JavaScript' SRC='../JS/MYNOTE_SCREEN.js'></SCRIPT>
		<SCRIPT TYPE='text/JavaScript' SRC='../JS/VIEWCALENDAR.js'></SCRIPT>
		<SCRIPT LANGUAGE="JavaScript">setLang('tha');</SCRIPT>
		<SCRIPT LANGUAGE="JavaScript" TYPE="text/JavaScript">
		ThaiCode[311]="ข้อมูลไม่ถูกต้อง วันที่ต้องอยู่ในช่วง ";
		EngCode[311]="invalid date between ";		
		ThaiCode[312]="วันที่เข้าพักต้องซ้ำ";
		EngCode[312]="Duplicate checkin date";		
		
			  function saveValue() {
			   if(checkPeriodDate("billdate") &&chkCheckindate()&&checkPeriodDate("checkindate") &&checkPeriodDate("checkoutdate")){
			   var hotelcost={expendid:null ,  employeeid:null ,  companyid:null ,  billdate:null ,  billno:null ,  costtype:null ,  checkindate:null ,  checkoutdate:null ,  hotelname:null ,  hotelcompany:null ,  hoteltaxno:null ,  hoteladdr:null ,  hotelzipcode:null ,  amt_dollar:null ,  vat_dollar:null ,  nets_dollar:null ,  moneytype:null ,  amount:null ,  vat:null ,  nets:null ,  workarea:null ,  workareadesc:null ,  costcenter:null ,  costcenterdesc:null ,  budget:null ,  budgetdesc:null ,  billstatus:null }
					dwr.util.getValues(hotelcost);
					window.opener.writeHotelcost(hotelcost);
					window.close();
					}
			}			
						
		function goHelp(helpName,inputName){
				with(document.cscform){
				var helpReturn="",fcon="";
					if(inputName == "costcenter"){
						helpReturn="costcenter:costcenterid,costcenterdesc:tdesc";
						linkHelp_Return_search(helpName,helpReturn);
					}else if(inputName == "budget"){
									if(costcenter.value.length>0){
												temp = __fixCon.value;
												__fixCon.value = "costcenterid='"+costcenter.value+"'";
												helpReturn="budget:budgetid,budgetdesc:tdesc";
												linkHelp_Return(helpName,helpReturn);
												__fixCon.value=temp;								
										}else{
												alert(MyCode[0]);
												costcenter.focus();
										}						
					}else if(inputName == "workarea"){
						helpReturn="workarea:workareaid,workareadesc:tdesc";
						linkHelp_Return(helpName,helpReturn);
					}
				}
			}		
			
			function loadFromParent(keyid){
				  dwr.engine.beginBatch();
					var obj=window.opener.loadDataHotel(keyid);
					fillExchange(obj.moneytype);
					dwr.util.setValues(obj);					 
					 //fillHotelemp();
				  dwr.engine.endBatch();					 
			}
			
		function addNewChild(pagename)
		{
			if(document.cscform.billno.value.length>0){
			        var fixcon=chkEmplist();
					var generator=window.open(pagename+".jsp?expendid="+document.cscform.expendid.value+"&employeeid="+document.cscform.employeeid.value+"&billno="+document.cscform.billno.value+"&billdate="+document.cscform.billdate.value+"&emp_list="+fixcon,'popup','height=530,width=600,scrollbars=yes,resizable=yes,status=yes');
			  }else{
					alert(MyCode[0]);
					document.cscform.billno.focus();
			  }
			
		}		
		var hotelempCache ={};
		
		function fillHotelemp() {
		  HotelcostempCtrl.getHotelemp(function(hotelcostempctrl) {
			dwr.util.removeAllRows("hotelemp_body", { filter:function(tr) {
			  return (tr.id != "hotelemp_pattern");
			}}); 
		
			var hotelemp, id; 
			var isstep1= "<%=isstep1%>";	
			hotelcostempctrl.sort(function(p1, p2) { return p1.collaborator.localeCompare(p2.collaborator); });
			for (var i = 0; i < hotelcostempctrl.length; i++) {
			  hotelemp = hotelcostempctrl[i];		
			  id = hotelemp.collaborator;
			  dwr.util.cloneNode("hotelemp_pattern", { idSuffix:id });
			  if(isstep1=="true")
			  		$("__selected_hotelemp"+id).innerHTML="<center><input type=\"checkbox\" id=\"deleteItemhotelemp\" value="+hotelemp.collaborator+"></center>";
			   else
			   		$("__selected_hotelemp"+id).innerHTML="";
			  dwr.util.setValue("__collaborator"+id,hotelemp.collaborator);
			  dwr.util.setValue("__collaboratordesc"+id,hotelemp.collaboratordesc);
			  
			for(key in hotelemp){
				if(key != "$dwrClassName"){
					$("hotelemp_"+key+id).value = eval("hotelemp."+key);
					$("hotelemp_"+key+id).name = "__wf__texpend_cost$_hotelemp_"+key+"$"+id;				
					}     
				}

			 document.getElementById("hotelemp_pattern" + id).style.display = "";  // officially we should use table-row, but IE prefers "" for some reason
			 hotelempCache[id] = hotelemp;
			}
		  });
		}
			
			
		function chkCheckindate(){
			var emplist=window.opener.document.cscform.__wf__texpend_cost_hotel_list_date.value;
			 if(emplist.indexOf(document.cscform.checkindate.value) >-1){
			 	alert(MyCode[312]);
			 	return false;				
				}
			return true;
		}
		
		function chkEmplist(){
		return emplist=window.opener.document.cscform.__wf__texpend_cost_hotelemp_list.value.split(",");
		}
	
		function writeHotelcostemp(hotelcostemp){
		  dwr.engine.beginBatch();
		  HotelcostempCtrl.setHotelemp(hotelcostemp);
		  //fillHotelemp();
		  dwr.engine.endBatch();
		}
		
		function writeHotelcostempNoFill(hotelcostemp){
		  dwr.engine.beginBatch();
		  HotelcostempCtrl.setHotelemp(hotelcostemp);
		  dwr.engine.endBatch();
		}		

		var exrate={};
		
		function fillExchange(types){
		  ExchangerateCtrl.getExchange(function(exchangectrl) {
		
			var exchange, id;
			exchangectrl.sort(function(p1, p2) { return p1.exchangeid.localeCompare(p2.exchangeid); });
			var isstep1="<%=isstep1%>";			
			var str="<select id=\"moneytype\" disabled>";
				if(isstep1=="true"){
					str="<select id=\"moneytype\">";		
				}
			for (var i = 0; i < exchangectrl.length; i++) {
			  exchange = exchangectrl[i];		
			  str+="<option value=\""+exchange.exchangeid+"\"";
			  if(exchange.exchangeid==types)
			  	str+=" selected ";
			  str+=">"+exchange.exchangedesc+"</option>";
			 exrate[exchange.exchangeid]=exchange.amount;
			}
			 $("__moneytype").innerHTML=str;
		  });
		  
		}

		function transferRate(res,des){
				with(document.cscform){
						var rate =parseFloat(exrate[moneytype.options[moneytype.selectedIndex].value]);
						des.value=formatCurrency(parseFloat(res.value)*rate);
				}
		}
		
		function sumNets(){
				with(document.cscform){
						var rate =parseFloat(exrate[moneytype.options[moneytype.selectedIndex].value]);
						 nets_dollar.value=formatCurrency(parseFloat(amt_dollar.value.replace(",",""))+parseFloat(vat_dollar.value.replace(",","")));
						nets.value=formatCurrency(parseFloat(nets_dollar.value.replace(",",""))*rate);
				}
		}		
		
			function formatCurrency(num) {
					num = num.toString().replace(/\|\,/g,'');
					if(isNaN(num))
						num = "0";
						sign = (num == (num = Math.abs(num)));
						num = Math.floor(num*100+0.50000000001);
						cents = num%100;
						num = Math.floor(num/100).toString();
					if(cents<10)
						cents = "0" + cents;
					for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
						num = num.substring(0,num.length-(4*i+3))+','+
						num.substring(num.length-(4*i+3));
						return (((sign)?'':'-') +  num + '.' + cents);
			}			
			
			function checkPeriodDate(strname){
				var bdate=$(strname).value.split("-");
				var cdate=new Date(bdate[2],bdate[1]-1,bdate[0]);
						bdate=window.opener.document.cscform.__wf__startdate.value.split("-");
				var stdate=new Date(bdate[2],bdate[1]-1,bdate[0]);
						bdate=window.opener.document.cscform.__wf__enddate.value.split("-");
				var endate=new Date(bdate[2],bdate[1]-1,bdate[0]);
				var st=Math.ceil(stdate.getTime());
				var cu=Math.ceil(cdate.getTime());
				var en=Math.ceil(endate.getTime());	
				if(cu<st || cu>en){
						alert(MyCode[311]+" "+window.opener.document.cscform.__wf__startdate.value +"  -   "+window.opener.document.cscform.__wf__enddate.value);
						return false;
				}
				return true;
		}			
					
			function linkHelp_SendToReturn(help,input){
				with( document.cscform ){
					var param = "BROWSE_USER.jsp?__helpName="+help+"&__helpReturn="+input+"&__pageCall="+__screen.value+"&__fixCon="+__fixCon.value+"&__checkVerify=off&__langOn=off";
					window.open(param,"Help","left=150,top=150,width=530,height=370,toolbar=no,status=yes,scrollbars=yes,resizable=yes");
				}
			}
			
			function linkHelp_Return_search(help,input){
				with( document.cscform ){
					var param="BROWSE_WELFAREHELP.jsp?__helpName="+help+"&__helpReturn="+input+"&__pageCall="+__screen.value+"&__fixCon="+__fixCon.value+"&__checkVerify=off&__langOn=off";
					window.open(param,"Help","left=150,top=150,width=530,height=370,toolbar=no,status=yes,scrollbars=yes,resizable=yes");
				}
			}		
						
			function linkHelp_Return(help,input){
				with( document.cscform ){
					var param="EMV_PRU084.jsp?__helpName="+help+"&__helpReturn="+input+"&__pageCall="+__screen.value+"&__fixCon="+__fixCon.value+"&__checkVerify=off&__langOn=off";
					window.open(param,"Help","left=150,top=150,width=530,height=370,toolbar=no,status=yes,scrollbars=yes,resizable=yes");
				}
			}
			function linkHelpWF(help,input){
				with(document.cscform){
					var temp = __fixCon.value;
					var fix = "wf_id='"+wf_id.value+"' and wf_ver='"+wf_ver.value+"' and initiator='<%=WELEXP_RH_003c3.getUProfile().get("actor")%>' and (wf_status<>'4' and wf_status<>'6' and wf_status<>'3' and wf_status<>'8' and wf_status<>'A' and wf_status<>'B')";
					var param="EMV_PRU084.jsp?__helpName="+help+"&__fieldSearch="+input+"&__pageCall="+__screen.value+"&__fixCon="+fix;
					alert("param is:"+param);
					window.open(param,"Help","left=150,top=150,width=530,height=370,resizable=yes,scrollbars=yes,toolbar=no,status=yes");
					__fixCon.value = temp;
				}
			}		
					
			function searchCostcenter(){
				with(document.cscform){			
						SearchDWR.searchDBXMLAll(new Array("MBUDGET_PTTHELP", "mbudget_ptt.budgetid,mbudget_ptt.tdesc", "mbudget_ptt:costcenterid = '"+costcenter.value+"'", "false", "langOn"), function(data){
										if(data.length>0){  
													budget.value=data[0][0];
													budgetdesc.value=data[0][1];
										}else{
													budget.value="";
													budgetdesc.value="";
										}
								});						
					}
			}					
			
			function postReturn(){
					//searchCostcenter();
			}
			
		function chkInputDate(obj) {
		var temp = obj.value;
		var tempdate = obj.value.split("-");
		var chk = true;
		//ตรวจสอบดูว่าพิมเป็นตัวอักษรหรือไม่
		if (!chkIntNotChar (temp)) {
			alert(MyAlert[30]); 
			obj.value = datePresent(); 
			obj.select();
			chk = false;
		}
		//ตรวจสอบดูว่ากรอกตัวเลขครบแปดหลักแล้วหรือไม่
		else if ((obj.value.length < 8) && (obj.value.length > 0)) { 
			alert(MyAlert[31]); 
			obj.value = datePresent();
			obj.select();
			chk = false;
		}
		//ตรวจสอบดูว่าถ้ากรอกวันที่ครบแปดตัวเลขแล้ว กรอก วัน เดือน ปี ถูกต้องหรือไม่ ( โดยเรียก script checkTrueDay(str) )
		else if ( (tempdate[0].length == 2) && (tempdate[1].length == 2) && (tempdate[2].length == 4) && (temp.length > 0 ) && (!checkTrueDay(delWordDate(temp))) ) {
			alert(MyAlert[31]);
			obj.select();
			chk = false;
		}
		//ตรวจสอบดูว่ากรอก วันเป็นเลขสองหลัก เดือนเป็นเลขสองหลัก และปีเป็นเลขสี่หลักหรือป่าว
		else if ( (tempdate[0].length != 2 || tempdate[1].length != 2 || tempdate[2].length != 4) && temp.length > 0  ) {
			alert(MyAlert[31]);
			obj.select();
			chk = false;
		}
		//ตรวจสอบดูว่ากรอกวันเกินสิบตัวเลขหรือไม่ ( กรณีที่เกิดคือ copy คำมาแปะอาจเป็นภาษาไทย หรือ อักษร )
		else if ( (temp != delWordDate(obj.value)) && (temp.length > 10) ) {
			obj.value = datePresent(); 
			alert(MyAlert[31]); 
			obj.select();
			chk = false;
		}
		//ตรวจสอบดูว่ารูปแบบวันที่อยู่ในรูปของ ddmmyyyy หรือ dd-mm-yyyy แล้วหรือยัง
		else if ( tempdate.length != 3 ) 	{
			obj.value = datePresent();
			alert(MyAlert[31]); 
			obj.select();
			chk = false;
		}
		//ตรวจสอบดูว่า วันที่กรอกเป็นเลขสองหลัก เดือนเป็นเลขสองหลัก และปีเป็นเลขสี่หลักหรือไม่
		else if (  (tempdate[0].length != 2) && (tempdate[1].length != 2) && (tempdate[2].length != 4)  )   {
			obj.value = datePresent();
			alert(MyAlert[31]); 
			obj.select();
			chk = false;
		}
		return chk; //ถ้ากรอกวันที่ถูกต้องตามเงื่อนไขแล้วจะ retrun เป็น true
	}					
	
	
						
</script>
		<STYLE TYPE="text/css">
		<!--
			.style1 {
			color: #FFFFFF;
			font-weight: bold;
			}
		-->
		</STYLE>
	</HEAD>
	<BODY onLoad="MM_preloadImages('../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif','../IMAGES/BUTTON/SWAP/CALENDAR_SWAP20.gif')">
		<FORM NAME="cscform" METHOD="post" ACTION="FORM_LIST.jsp">
			<INPUT TYPE="hidden" NAME="__screen" VALUE="FORM_LIST">
			<INPUT TYPE="hidden" NAME="__cmd" VALUE="">
			<INPUT TYPE="hidden" NAME="__fixCon" VALUE="">
			<INPUT TYPE="hidden" NAME="__help" VALUE="">
			<INPUT TYPE="hidden" NAME="__language" VALUE="<%=WELEXP_RH_003c3.getUProfile().get("lang")%>">
			<INPUT TYPE="hidden" NAME="__companyid" VALUE="<%=WELEXP_RH_003c3.getUProfile().get("companyid")%>">
			<INPUT TYPE="hidden" NAME="companyid" VALUE="<%=WELEXP_RH_003c3.getUProfile().get("companyid")%>">
			<INPUT TYPE="hidden" NAME="__calendar" VALUE="">
			<INPUT TYPE="hidden" NAME="expendid" VALUE="<%=request.getParameter("expendid")%>">
			<INPUT TYPE="hidden" NAME="employeeid" VALUE="<%=request.getParameter("employeeid")%>">
			<INPUT TYPE="hidden" NAME="__server_date"  id="__server_date" VALUE="<%=new CscCalendar().getDDMMYYYY()%>">
			<INPUT TYPE="hidden" NAME="billstatus" VALUE="1">
			
			
			<SCRIPT LANGUAGE="JavaScript">getInputFormatDate();</SCRIPT>			

			<TABLE WIDTH="580" BORDER="0" ALIGN="center" CELLPADDING="0" CELLSPACING="0">
  				<TR>
    				<TD WIDTH="5" HEIGHT="5"><IMG SRC="../IMAGES/MYNOTE/C-T-L.gif" WIDTH="5" HEIGHT="5"></TD>
    				<TD HEIGHT="5"><IMG SRC="../IMAGES/MYNOTE/T.gif" WIDTH="100%" HEIGHT="5"></TD>
	    			<TD WIDTH="5" HEIGHT="5"><IMG SRC="../IMAGES/MYNOTE/C-T-R.gif" WIDTH="5" HEIGHT="5"></TD>
  				</TR>
  				<TR>
	    			<TD WIDTH="5" BACKGROUND="../IMAGES/MYNOTE/L2.gif"><FONT COLOR="#FFFFFF"></FONT></TD>
    				<TD >
      					<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="1" CLASS="txt01">
      						<td width="34%">
							<TR BGCOLOR="#EFF7FA">
							<TD  COLSPAN="2" class="column-title"><DIV ALIGN="CENTER"><B><script language="javascript">swapLang("ค่าที่พัก");</script></B></DIV></TD>
							</TR>
													<TR>
													<TD align="right" nowrap  class="column-label"><%=borrow_emp.getField("billdate").getDescription()%></td>
													<TD width="66%" NOWRAP="nowrap" CLASS="desc"><INPUT TYPE="text" NAME="billdate" id="billdate" VALUE="<%=new CscCalendar().getDDMMYYYY()%>" SIZE="10" MAXLENGTH="10" ONKEYPRESS="chkInteger();" ONBLUR="chkInputDate(this);" ONKEYUP="formatDate(this);" ONFOCUS="this.select();">
                                                       <%if(isstep1){%><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image1','','../IMAGES/BUTTON/SWAP/CALENDAR_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/CALENDAR20.gif" alt="calendar" name="Image1" border="0" align="absmiddle" id="Image1" onClick="viewCal('billdate')"></a><%}%></TD>
													</TR>
													<TR>
                                                      <TD align="right" nowrap  class="column-label"><%=borrow_emp.getField("billno").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><INPUT TYPE="text" NAME="billno" id="billno"  size="30" VALUE="" ></TD>
													</TR>
													<TR>
													  <TD align="right" nowrap  class="column-label"><%=borrow_emp.getField("checkindate").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><INPUT TYPE="text" NAME="checkindate" id="checkindate" VALUE="<%=new CscCalendar().getDDMMYYYY()%>" SIZE="10" MAXLENGTH="10" ONKEYPRESS="chkInteger();" ONBLUR="chkInputDate(this);" ONKEYUP="formatDate(this);" ONFOCUS="this.select();">
                                                         <%if(isstep1){%><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image11','','../IMAGES/BUTTON/SWAP/CALENDAR_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/CALENDAR20.gif" alt="calendar" name="Image11" border="0" align="absmiddle" id="Image11" onClick="viewCal('checkindate')"></a><%}%></TD>
													</TR>
													<TR>
													  <TD align="right" nowrap  class="column-label"><%=borrow_emp.getField("checkoutdate").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><INPUT TYPE="text" NAME="checkoutdate" id="checkoutdate" VALUE="<%=new CscCalendar().getDDMMYYYY()%>" SIZE="10" MAXLENGTH="10" ONKEYPRESS="chkInteger();" ONBLUR="chkInputDate(this);" ONKEYUP="formatDate(this);" ONFOCUS="this.select();">
                                                         <%if(isstep1){%><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image12','','../IMAGES/BUTTON/SWAP/CALENDAR_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/CALENDAR20.gif" alt="calendar" name="Image12" border="0" align="absmiddle" id="Image12" onClick="viewCal('checkoutdate')"></a> <%}%></TD>
						  </TR>
													<TR>
													  <TD align="right" nowrap  class="column-label"><%=borrow_emp.getField("hotelname").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><INPUT TYPE="text" NAME="hotelname" id="hotelname"  size="50" VALUE="" ></TD>
						  </TR>
													<TR>
													  <TD align="right" nowrap  class="column-label"><%=borrow_emp.getField("hotelcompany").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><INPUT TYPE="text" NAME="hotelcompany" id="hotelcompany"  size="50" VALUE="" ></TD>
						  </TR>
													<TR>
													  <TD align="right" nowrap  class="column-label"><%=borrow_emp.getField("hoteltaxno").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><INPUT TYPE="text" NAME="hoteltaxno" id="hoteltaxno"  size="12" VALUE="" maxlength="10" onKeyPress="checkWordNumber(this.value,event);" onKeyUp="sysIsEdit();" >
*กรอกเป็นตัวเลขติดกัน 10 หลัก</TD>
						  </TR>
													<TR>
													  <TD align="right" nowrap  class="column-label"><%=borrow_emp.getField("hoteladdr").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><span class="column-input">
													    <textarea NAME='hoteladdr' id="hoteladdr" COLS='80' ROWS='4' onKeyPress="chkSpecialStr(event);" onKeyUp="chkLimitTextArea(this,1000);sysIsEdit();" onBlur="trimValue(this);" ></textarea>
													  </span></TD>
						  </TR>
													<TR>
                                                      <TD align="right" nowrap  class="column-label"><%=borrow_emp.getField("hotelzipcode").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><INPUT TYPE="text" NAME="hotelzipcode" id="hotelzipcode"  size="12" VALUE="" maxlength="5" onKeyPress="checkWordNumber(this.value,event);" onKeyUp="sysIsEdit();" ></TD>
						  </TR>
													<TR>
													  <TD align="right" nowrap bgcolor=#0099cc class="column-label"><%=borrow_emp.getField("amt_dollar").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><span class="column-input">
													    <input type="text" name="amt_dollar" size="10" maxlength="10" value="0.00" onKeyPress="checkWordNumber(this.value,event);" onKeyUp="sysIsEdit();checkComma(this,2);" onBlur="transferRate(this,document.cscform.amount);sumNets();checkNumFloat(this,0,900000000);" onFocus="callDelComma(this);" class="numeric" />
													  </span></TD>
						  </TR>
													<TR>
													  <TD align="right" nowrap bgcolor=#0099cc class="column-label"><%=borrow_emp.getField("vat_dollar").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><span class="column-input">
													    <input type="text" name="vat_dollar" size="10" maxlength="10" value="0.00" onKeyPress="checkWordNumber(this.value,event);" onKeyUp="sysIsEdit();checkComma(this,2);" onBlur="transferRate(this,document.cscform.vat);sumNets();checkNumFloat(this,0,900000000);" onFocus="callDelComma(this);" class="numeric" />
													  </span></TD>
						  </TR>
													<TR>
													  <TD align="right" nowrap bgcolor=#0099cc class="column-label"><%=borrow_emp.getField("nets_dollar").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><span class="column-input">
													    <input type="text" name="nets_dollar" size="10" maxlength="10" value="0.00" onKeyPress="checkWordNumber(this.value,event);" onKeyUp="sysIsEdit();checkComma(this,2);" onBlur="transferRate(this,document.cscform.nets);checkNumFloat(this,0,900000000);" onFocus="callDelComma(this);" class="numeric"  readonly/>
													  </span></TD>
						  </TR>
													<TR>
													  <TD align="right" nowrap bgcolor=#0099cc class="column-label"><%=borrow_emp.getField("moneytype").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><span id="__moneytype"></span></TD>
						  </TR>
													<TR>
													  <TD align="right" nowrap bgcolor=#0099cc class="column-label"><%=borrow_emp.getField("amount").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><span class="column-input">
													    <input type="text" name="amount" size="10" maxlength="10" value="0.00" onKeyPress="checkWordNumber(this.value,event);" onKeyUp="sysIsEdit();checkComma(this,2);" onBlur="checkNumFloat(this,0,900000000);" onFocus="callDelComma(this);" class="numeric"  readonly/>
													  </span></TD>
						  </TR>
													<TR>
													  <TD align="right" nowrap bgcolor=#0099cc class="column-label"><%=borrow_emp.getField("vat").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><span class="column-input">
													    <input type="text" name="vat" size="10" maxlength="10" value="0.00" onKeyPress="checkWordNumber(this.value,event);" onKeyUp="sysIsEdit();checkComma(this,2);" onBlur="checkNumFloat(this,0,900000000);" onFocus="callDelComma(this);" class="numeric" readonly/>
													  </span></TD>
						  </TR>
													<TR>
													  <TD align="right" nowrap bgcolor=#0099cc class="column-label"><%=borrow_emp.getField("nets").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><span class="column-input">
													    <input type="text" name="nets" size="10" maxlength="10" value="0.00" onKeyPress="checkWordNumber(this.value,event);" onKeyUp="sysIsEdit();checkComma(this,2);" onBlur="checkNumFloat(this,0,900000000);" onFocus="callDelComma(this);" class="numeric" readonly />
													  </span></TD>
						  </TR>
													<TR>
                                                      <TD align="right" nowrap bgcolor=#0099cc class="column-label"><%=borrow_emp.getField("workarea").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><DIV ALIGN="left">
													    <INPUT TYPE="text" NAME="workarea" id="workarea"  size="10" VALUE=""  readonly>
													     <%if(isstep1){%><a HREF="javascript:goHelp('MWORKAREAHELP','workarea')" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('999','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><IMG SRC="../IMAGES/BUTTON/MAIN/SEARCH20.gif" ALT="SEARCH" NAME="employee_image2" WIDTH="20" HEIGHT="20" BORDER="0" ALIGN="absmiddle"></a> <%}%>
                                                          <INPUT TYPE="text" SIZE="50" NAME="workareadesc" id="workareadesc"  VALUE="" readonly class="disabled">
													    </DIV></TD>
						  </TR>
													<TR style="display:none">
                                                      <TD align="right" nowrap bgcolor=#0099cc class="column-label"><%=borrow_emp.getField("costcenter").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><DIV ALIGN="left">
													    <INPUT TYPE="text" NAME="costcenter" id="costcenter"  VALUE="" size="10" readonly>
													     <%if(isstep1){%><a HREF="javascript:goHelp('MCOSTCENTER0HELP','costcenter')" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('999','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><IMG SRC="../IMAGES/BUTTON/MAIN/SEARCH20.gif" ALT="SEARCH" NAME="employee_image2" WIDTH="20" HEIGHT="20" BORDER="0" ALIGN="absmiddle"></a> <%}%>
                                                          <INPUT TYPE="text" SIZE="50" NAME="costcenterdesc" id="costcenterdesc"  VALUE="" readonly class="disabled">
													    </DIV></TD>
						  </TR>
													
													<TR  style="display:none">
                                                      <TD align="right" nowrap bgcolor=#0099cc class="column-label"><%=borrow_emp.getField("budget").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><DIV ALIGN="left">
                                                          <INPUT TYPE="text" NAME="budget" id="budget"  VALUE="" size="10" readonly>
                                                           <%if(isstep1){%><a HREF="javascript:goHelp('MBUDGET_PTTHELP','budget')" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('999','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><IMG SRC="../IMAGES/BUTTON/MAIN/SEARCH20.gif" ALT="SEARCH" NAME="employee_image2" WIDTH="20" HEIGHT="20" BORDER="0" ALIGN="absmiddle"></a> <%}%>
                                                          <INPUT TYPE="text" SIZE="50" NAME="budgetdesc" id="budgetdesc"  VALUE="" readonly class="disabled">
                                                      </DIV></TD>
						  </TR>
      				  </TABLE>
    				</FONT></TD>
    				<TD WIDTH="5" BACKGROUND="../IMAGES/MYNOTE/R2.gif"><FONT COLOR="#FFFFFF"></FONT></TD>
  				</TR>
	  			<TR>
    				<TD WIDTH="5" HEIGHT="5"><IMG SRC="../IMAGES/MYNOTE/C-B-L.gif" WIDTH="5" HEIGHT="5"></TD>
    				<TD HEIGHT="5"><IMG SRC="../IMAGES/MYNOTE/B.gif" WIDTH="100%" HEIGHT="5"></TD>
    				<TD WIDTH="5" HEIGHT="5"><IMG SRC="../IMAGES/MYNOTE/C-B-R.gif" WIDTH="5" HEIGHT="5"></TD>
	  			</TR>
			</TABLE>
			<BR>
			<TABLE WIDTH="500"  BORDER="0" ALIGN="center" CELLPADDING="0" CELLSPACING="0" CLASS="thai03">
  				<TR>
    				<TD><DIV ALIGN="right"> <%if(isstep1){%><a HREF="JavaScript:saveValue();"><IMG SRC="../IMAGES/MYNOTE/BUTTON/BUTTON_SUBMIT.gif" WIDTH="89" HEIGHT="37" BORDER="0"></A><%}%><A HREF="JavaScript:window.close();"><IMG SRC="../IMAGES/MYNOTE/BUTTON/BUTTON_CANCEL.gif" WIDTH="89" HEIGHT="37" BORDER="0"></A></DIV></TD>
  				</TR>
			</TABLE>
			<%
				if(billno.length()>0){
				%>
				<script language="javascript">loadFromParent("<%=billno%>");</script>
				<%		
				}else{
			%>
			<script language="javascript">fillExchange();</script>
				<script language="javascript">
						document.cscform.costcenter.value=window.opener.document.cscform.__wf__costcenter.value;
						document.cscform.budget.value=window.opener.document.cscform.__wf__budget.value;				
						document.cscform.costcenterdesc.value=window.opener.document.cscform.mcostcenter0_tdesc.value;
						document.cscform.budgetdesc.value=window.opener.document.cscform.budgetdesc.value;										
				</script>			
			<%}%>
				<script language="javascript">
						document.cscform.checkindate.value=window.opener.document.cscform.__wf__startdate.value;
						document.cscform.checkoutdate.value=window.opener.document.cscform.__wf__enddate.value;
				</script>			
			<%if(!isstep1){%>
			<script language="javascript">setDisabled(true);</script>		
			<%}%>
			
    </FORM>
</BODY>
</HTML>
<%}%>