<%@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.*,com.csc.library.database.DataSet"%>
<%@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="welexp003c4" class="com.csc.library.system.Task" scope="page"/>
<jsp:setProperty name="welexp003c4" property="appname" value="WELFARE" />
<jsp:setProperty name="welexp003c4" property="classauthen" value="WorkflowUIAuthen" />
<%
welexp003c4.setChannel(request,response);
welexp003c4.checkProfile();
if( welexp003c4.getUProfile() != null ){
	DbRecord borrow_emp=new InitialRecord(welexp003c4.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/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 ";			
			
			  function saveValue() {
			   if(checkPeriodDate("billdate")&&checkValid()){
				   var billcost={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 ,costtypedesc:null}
						dwr.util.getValues(billcost);
						window.opener.writeBillcost(billcost);
						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 setCosttype(obj){
					document.cscform.costtypedesc.value=obj.options[obj.selectedIndex].text;
			}
			
			function loadFromParent(keyid){
					dwr.engine.beginBatch();
					var obj=window.opener.loadDataBill(keyid);
					fillExchange(obj.moneytype);
					dwr.util.setValues(obj);
					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 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 checkValid(){
						with(document.cscform){
								if(billno.value.length==0){
										alert(MyCode[0]);
										billno.focus();
										return false;
								}else if(hotelcompany.value.length==0){
										alert(MyCode[0]);
										hotelcompany.focus();
										return false;
								}else if(hoteltaxno.value.length==0){
										alert(MyCode[0]);
										hoteltaxno.focus();
										return false;
								}else if(hoteladdr.value.length==0){
										alert(MyCode[0]);
										hoteladdr.focus();
										return false;
								}else if(hotelzipcode.value.length==0){
										alert(MyCode[0]);
										hotelzipcode.focus();
										return false;
								}else if(workarea.value.length==0){
										alert(MyCode[0]);
										workarea.focus();
										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='<%=welexp003c4.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;
					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 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 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="WELEXP003C4_INT.jsp">
			<INPUT TYPE="hidden" NAME="__screen" VALUE="WELEXP003C5_INT">
			<INPUT TYPE="hidden" NAME="__cmd" VALUE="">
			<INPUT TYPE="hidden" NAME="__fixCon" VALUE="">
			<INPUT TYPE="hidden" NAME="__help" VALUE="">
			<INPUT TYPE="hidden" NAME="__language" VALUE="<%=welexp003c4.getUProfile().get("lang")%>">
			<INPUT TYPE="hidden" NAME="__companyid" VALUE="<%=welexp003c4.getUProfile().get("companyid")%>">
			<INPUT TYPE="hidden" NAME="companyid" VALUE="<%=welexp003c4.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="billstatus" VALUE="1">
			<INPUT TYPE="hidden" NAME="costtypedesc" VALUE="">
			<INPUT TYPE="hidden" NAME="__server_date"  id="__server_date" VALUE="<%=new CscCalendar().getDDMMYYYY()%>">
			
			
			<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>
													<%
													String tmp="<select id=\"costtype\" onchange=\"setCosttype(this)\">";
																		tmp+="<option value=\"\">...</option>";	
													try{
													
													/*String module[]=rf.getSystemCode("COST_TYPE",welexp003c4.getUProfile().get("lang"));													
															String keyvalue[];
															String tmp="<select id=\"costtype\" onchange=\"setCosttype(this)\">";
																		 tmp+="<option value=\"\">...</option>";	
															for(int n=0;n<module.length;n++){
																keyvalue=module[n].split(",");
																	tmp+="<option value=\""+keyvalue[0]+"\" >"+keyvalue[1]+"</option>";
																}
																tmp+="</select>";
																
																*/
																		DataSet  ds=    new DataSet("select payment_code,description FROM mgl where status!='NB' order by description", welexp003c4.getUProfile().getDbName(), "mgl");
																		ds.setFetchAll(true);
																		ds.initConnection(welexp003c4.getUProfile());																		
																		while(ds.next()){
																			tmp+="<option value=\""+ds.getString("payment_code")+"\" >"+ds.getString("description")+"</option>";
																		}																
																}catch(Exception ex){}
													  %>
																					
													<TR>
													  <TD align="right" nowrap  class="column-label"><%=borrow_emp.getField("costtype").getDescription()%></td>
													  <TD NOWRAP="nowrap" CLASS="desc"><%=tmp%></TD>
						  </TR>
													<TR style="display:none">
													  <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" />
													  </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" />
													  </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" />
													  </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="" >
                                                           <%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>
                                                      <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" >
                                                           <%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" >
                                                           <%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" TYPE="text/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>			
			<%}%>					
			<%if(!isstep1){%>
			<script language="javascript">setDisabled(true);</script>		
			<%}%>
			
    </FORM>
</BODY>
</HTML>
<%}%>