<%@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.ManageDocument"%>
<%@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.report.*"%>

<%request.setCharacterEncoding("UTF-8");%>

<jsp:useBean id="TEMPLATE_WORKFLOW" class="com.csc.library.system.Task" scope="page"/>

<%
TEMPLATE_WORKFLOW.setChannel(request,response);
TEMPLATE_WORKFLOW.checkProfile();
if( TEMPLATE_WORKFLOW.getUProfile() != null ){
	TEMPLATE_WORKFLOW.getUProfile().set("appname","WELFARE");
	UIManager screenSingle = (UIManager) TEMPLATE_WORKFLOW.process("SingleEntry","TEMPLATE_WORKFLOW");
%>

<%	CheckNull chkNull = new CheckNull();%>
<%CscCalendar calendar = null;%>
<%  ReportUDF thaifullmoney = new ReportUDF(); %>
<!-- Insert useBean -->

<HTML>
	<HEAD>
		<TITLE>myNOTE : Business Process Management Service</TITLE>
		<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">

		<!-- Insert Link -->
		<LINK HREF="../CSS/MYNOTE.css" REL="stylesheet" TYPE="text/css">
		<LINK HREF="../CSS/MYNOTE_MENU.css" REL="stylesheet" TYPE="text/css">
		<!-- Insert Script Import -->
			<SCRIPT TYPE='text/JavaScript' SRC='../JS/MYNOTE_SCREEN.js'></SCRIPT>
			<script src="../JS/PRINTPAGE.js"></script>
			<SCRIPT TYPE='text/JavaScript' SRC='../JS/MYNOTE_MENU.js'></SCRIPT>
			<SCRIPT TYPE='text/JavaScript' SRC='../JS/SCREEN.js'></SCRIPT>
			<SCRIPT TYPE='text/JavaScript' SRC='../JS/CALENDAR.js'></SCRIPT>
			<SCRIPT LANGUAGE="JavaScript">setLang('<%=screenSingle.getUProfile().get("lang")%>');</SCRIPT>
				<!--DWR INCLUDE-->
		  <script src="../JS/VIEWCALENDAR.js"></script>
		  <script type='text/javascript' src='/hr/dwr/interface/SearchDWR.js'></script>
		  <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/SystemCode.js"></script>
		  <script type="text/javascript" src="/hr/dwr/interface/CscCalendar.js"></script>
<!--DWR INCLUDE-->
<SCRIPT LANGUAGE="JavaScript">
<!--
		function searchDataEmp(empid){
			SearchDWR.searchDBXMLAll(new Array("MEMPLOYEEHELP3", "memployee.employeeid,memployee.fullname,mposition.tdesc,memployee.bu1,memployee.bu2,memployee.bu3,mbu2.tdesc,mbu3.tdesc,mbu1.tdesc","memployee:employeeid = '"+empid+"'  ", "false", "langOn"), empdata);
	}

	var empdata=function(data1){
		dwr.util.setValue("empdata_employeeid",data1[0][0]);
		dwr.util.setValue("empdata_fullname",data1[0][1]);
		dwr.util.setValue("empdata_position",data1[0][2]);
		dwr.util.setValue("empdata_bu2name",data1[0][6]);
		dwr.util.setValue("empdata_bu3name",data1[0][7]);

		if(data1[0][5]!=""){
			dwr.util.setValue("empdata_bu_code",data1[0][5]);
		}else if(data1[0][4]!=''){
			dwr.util.setValue("empdata_bu_code",data1[0][4]);
		}else if(data1[0][3]!=''){
			dwr.util.setValue("empdata_bu_code",data1[0][3]);
		}

	}
//-->
</SCRIPT>
	    <style type="text/css">
<!--
		.style2 {font-size: 14px}
		.style3 { font-size: 14px; font-family: Tahoma}
		.tablelayout{
		width:640;
		text-align:justify;
}
		.style4 {font-size: 10px}

		.style5 {font-size: 10px; text-align:center;
						}
		.style6 {font-size: 8px}
-->
        </style>
</HEAD>
	<BODY BGCOLOR=#FFFFFF>
	<!-- ImageReady Slices (02.psd) -->
		<FORM NAME="cscform" METHOD="post" ACTION="">
			<INPUT TYPE="hidden" NAME="__screen" VALUE="">
			<INPUT TYPE="hidden" NAME="__cmd" VALUE="">
			<INPUT TYPE="hidden" NAME="__help" VALUE="">
			<INPUT TYPE="hidden" NAME="__fixCon" VALUE="">
			<%=screenSingle.getTagConfirm()%>
			<INPUT TYPE="hidden" NAME="__notNull" VALUE="<%=screenSingle.getRequire()%>">
			<INPUT TYPE="hidden" NAME="__companyid" VALUE="<%=screenSingle.getUProfile().get("companyid")%>">
			
			<!-- Insert Hidden Field -->
			             
			 <div id="popmenu" class="menuskin" onMouseover="clearhidemenu();highlightmenu(event,'on')" onMouseout="highlightmenu(event,'off');dynamichide(event)"></div>
			<script language="javascript">getInputFormatDate();</script>	
			<DIV ID="toolTipLayer" STYLE="position:absolute; visibility: hidden"></DIV>
			<SCRIPT LANGUAGE="JavaScript">initToolTips();</SCRIPT>
			<div align="center">
<TABLE width="100%" BORDER="0" CELLPADDING=0 CELLSPACING=0   onMouseover="showmenu(event,linkset[0])" onMouseout="delayhidemenu()">
<tr>
<td><div align="center">
                    <TABLE width="950"  class="tablelayout" BORDER="0" CELLPADDING=0 CELLSPACING=0 >
                    <tr>
                    <td>
                                    <TABLE width="100%"  class="tablelayout" BORDER="0" CELLPADDING=0 CELLSPACING=0>
                                    <tr>
                                    <td><div id="headimage" align="right" style="position:absolute; top:65px; width:50px"><img src="../IMAGES/LOGO_RH01.gif" width="60" height="60"></div>
                                      <DIV ALIGN="right">
                                        <%
                                                
                                                    String screen_value = chkNull.chkNullString(screenSingle.getDataLabel("SCREEN_VALUE"));
                                                    HashMap hm = new HashMap();
                                                    ManageDocument md = new ManageDocument();
                                                    
                                                    hm.put("WF_ID",request.getParameter("wf_id"));
                                                    hm.put("WF_VER",request.getParameter("wf_ver"));
                                                    hm.put("WF_SEQ_NO",request.getParameter("wf_seq_no"));
                                                    hm.put("DOC_NO",request.getParameter("wf_doc_no"));
                                                    hm.put("STEP_ID",request.getParameter("step_id"));
                                                    hm.put("STEP_SEQ_NO",request.getParameter("step_seq_no"));
                                                    hm.put("ACTOR_ID",screenSingle.getUProfile().getActor());
                                                    hm.put("POSITION_CODE",screenSingle.getUProfile().get("job"));
                                                    
                                                    md.setUProfile(screenSingle.getUProfile());
                                                    md.setParam(hm);
                                                    md.setVW_Incident();
                                                    md.setWFDataValue(screen_value);
                                                %>
                                                    <!-- Head -->
												<script language="javascript">searchDataEmp('<%=screenSingle.getUProfile().get("employeeid")%>');</script>
												<table width="100%" border="0" cellspacing="1" cellpadding="0">
															<tr><td colspan="5">&nbsp;</td></tr>
															<tr>
																		<td width="10%">&nbsp;</td>
																		<td colspan="3" class="style3"><font style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size:10px; color:#000000">
																		<div align="left"><font style="font-size:14px; font-weight:bold">บริษัทผลิตไฟฟ้าราชบุรีโฮลดิ้ง  จำกัด (มหาชน)</font></div></td>
																		<td><div align="right"><font style="font-size:10px">แบบ  คด. 2</font>&nbsp;&nbsp;</div></td>
															</tr>
															<tr>
																		<td>&nbsp;</td>
																		<td colspan ="4"><div align="left"><font style="font-size:10px">RATCHABURI ELECTRICITY GENERATING HOLDING PUBLIC  CO.,LTD.</font></div></td>
															 </tr>
															  <tr>
																	  <td>&nbsp;</td>
																	  <td colspan ="3"><div align="left"><font style="font-size:10px">แบบคืนเงินยืม/ เบิกค่าใช้จ่ายเดินทาง</fonr></div></td>
																	  <td>&nbsp;</td>
															  </tr>
															  <tr>
																	  <td>&nbsp;</td>
																	  <td colspan ="3"><div align="left"><font style="font-size:10px">Advance Clearance/ Reimburse For Abroad Travel</font></div></td>
																	 <td><div align="right"><font style="font-size:10px">วันที่ &nbsp;&nbsp;<%= new CscCalendar().getDDMMYYYY()%></font>&nbsp;&nbsp;</div></td>
															  </tr>
															<tr>
																<td class="style4" colspan="2">ชื่อ - นามสกุล :&nbsp;&nbsp;<span id="empdata_fullname"/></td>
																<td class="style4" width="25%">เลขประจำตัว : &nbsp;&nbsp;<span id="empdata_employeeid"/></td>
																<td class="style4" colspan="2">ตำแหน่ง : &nbsp;&nbsp;<span id="empdata_position"/></td>
															</tr>

															<tr>
																<td class="style4" colspan="2">ส่วน : &nbsp;&nbsp;<span id="empdata_bu3name"/></td>
																<td class="style4">ฝ่าย : &nbsp;&nbsp;<span id="empdata_bu2name"/></td>
																<td class="style4" colspan="2">รหัสหน่วยงาน : &nbsp;&nbsp;<span id="empdata_bu_code"/></td>
																
															</tr>
													  </table>
                    <!-- End Head -->
                                            <!-- User Code -->
                                            <!-- End User Code -->
										</DIV></TD>
                                      </TR>
                                    </TABLE>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="style4" width="63%">อ้างถึง : คำสั่งเดินทางเลขที่ &nbsp;&nbsp;<%=md.getWFDataValue("__wf__expendid")%>&nbsp;&nbsp;<%=md.getWFDataValue("__wf__location_typedesc")%></td>
<td class="style4">อื่น ๆ  </td>
</tr>
<tr>
<td class="style4" colspan="2">เพื่อ :&nbsp;&nbsp;<img src="../WELFARE/IMAGES/circle.gif" width="10" height="10">&nbsp;&nbsp;คืนเงินยืมเพื่อใช้จ่ายเดินทาง&nbsp;&nbsp;<img src="../WELFARE/IMAGES/circle.gif" width="10" height="10">&nbsp;&nbsp;เบิกค่าใช้จ่ายเดินทาง</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bordercolor="#000000">
<tr>
<td class="style6">&nbsp;</td>
</tr>
</table>
<TABLE WIDTH="100%" BORDER="1" CELLSPACING="0" CELLPADDING="0" BORDERCOLOR="#000000">
<TR>
		<TD class="style5" rowspan="2" bgcolor="#BFBFBF">รายละเอียด</TD>
		<TD class="style5" colspan="2" bgcolor="#BFBFBF">ใบเสร็จ</TD>
		<TD class="style5" rowspan="2" colspan="2" bgcolor="#BFBFBF">จำนวนเงินสกุลต่างประเทศ</TD>
		<TD class="style5" rowspan="2" bgcolor="#BFBFBF">อัตราแลกเปลี่ยน</TD>
		<TD class="style5" rowspan="2" bgcolor="#BFBFBF">จำนวนเงิน (บาท)</TD>
		<TD class="style5" rowspan="2" bgcolor="#BFBFBF">หมายเหตุ</TD>
</TR>
<TR>
		<TD class="style5" bgcolor="#BFBFBF">&nbsp;มี&nbsp;</TD>
		<TD class="style5" bgcolor="#BFBFBF">ไม่มี</TD>
</TR>

<TR>
		<TD class="style4">1. ค่าเบี้ยเลี้ยงเดินทาง &nbsp;&nbsp;<%=md.getWFDataValue("__wf__travelday")%>&nbsp;&nbsp; วัน/ อัตราวันละ &nbsp;&nbsp;<%=md.getWFDataValue("__wf__allowancerate")%></TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4"><div align="right">
		<%
				int travelday = Integer.parseInt(md.getWFDataValue("__wf__travelday"));
				int allowan = Integer.parseInt(md.getWFDataValue("__wf__allowancerate"));
				double total = 0.00;
								 total = travelday*allowan;
				java.text.DecimalFormat formatNumber = new java.text.DecimalFormat("0.00");
				out.print(formatNumber.format(total));
	%></div></TD>
		<TD class="style4">&nbsp;</TD>
</TR>
<TR>
		<TD class="style4">2. ค่าที่พัก / ค่าโรงแรม</TD>
		<%
			String totalhotel = md.getWFDataValue("__wf__total_summary_hotel").replace(",","");
			double hotel_p  = Double.parseDouble(totalhotel);
			if(hotel_p!=0.00){
		%>
		<TD class="style4">&nbsp;<img src="../WELFARE/IMAGES/mark.gif" width="12" height="12"></TD>
		<TD class="style4">&nbsp;</TD>
		<%}else{%>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;<img src="../WELFARE/IMAGES/mark.gif" width="12" height="12"></TD>
		<%}%>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4"><div align="right">&nbsp;<%=md.getWFDataValue("__wf__total_summary_hotel")%></div></TD>
		<TD class="style4">&nbsp;</TD>
</TR>
<TR>
		<TD class="style4">3. ค่าพาหนะ</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
</TR>
<TR>
		<TD class="style4">-  ค่าตั๋วเครื่องบิน</TD>
		<%
			String totalplane = md.getWFDataValue("__wf__planecost").replace(",","");
			double plane_p  = Double.parseDouble(totalplane);
			if(plane_p!=0.00){
		%>
		<TD class="style4">&nbsp;<img src="../WELFARE/IMAGES/mark.gif" width="12" height="12"></TD>
		<TD class="style4">&nbsp;</TD>
		<%}else{%>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;<img src="../WELFARE/IMAGES/mark.gif" width="12" height="12"></TD>
		<%}%>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4"><div align="right">&nbsp;<%=md.getWFDataValue("__wf__planecost")%></div></TD>
		<TD class="style4">&nbsp;</TD>
</TR>
<TR>
		<TD class="style4">-  ค่าแท็กซี่</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4"><div align="right">&nbsp;<%=md.getWFDataValue("__wf__taxicost")%></div></TD>

		<TD class="style4">&nbsp;</TD>
</TR>
<TR>
		<TD class="style4">-  ค่าชดเชยยานพาหนะ ระยะทาง &nbsp;&nbsp;<%=md.getWFDataValue("__wf__distance")%>&nbsp;&nbsp; กม.</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>

		<TD class="style4">&nbsp;</TD>
</TR>
<TR>
		<TD class="style4">-  จำนวน &nbsp;&nbsp;<%=md.getWFDataValue("__wf__oilrate")%>&nbsp;&nbsp; ลิตร ราคา &nbsp;&nbsp;<%=md.getWFDataValue("__wf__moneyrate")%>&nbsp;&nbsp; บาท/ ลิตร</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4"><div align="right">&nbsp;<%=md.getWFDataValue("__wf__oilcost")%></div></TD>
		<TD class="style4">&nbsp;</TD>
</TR>
<TR>
		<TD class="style4">4. ค่าเครื่องแต่งกาย</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4"><div align="right">&nbsp;<%=md.getWFDataValue("__wf__dresscost")%></div></div></TD>
		<TD class="style4">&nbsp;</TD>
</TR>
<TR>
		<TD class="style4">5. ค่าใช้จ่ายอื่น ๆ   รายการ</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4"><div align="right">&nbsp;<%=md.getWFDataValue("__wf__sum_other_cost")%></div></TD>
		<TD class="style4">&nbsp;</TD>
</TR>
<TR>
		<TD class="style4">-  </TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
</TR>
<TR>
		<TD class="style4">-  </TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
</TR>
<TR>
		<TD class="style4">-</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
</TR>

		<% 
					double total_of_list = 0.00;
					
					String hotel = md.getWFDataValue("__wf__total_summary_hotel").replace(",","");
					String plane	= md.getWFDataValue("__wf__planecost").replace(",","");
					String taxi	= md.getWFDataValue("__wf__taxicost").replace(",","");
					String oil =md.getWFDataValue("__wf__oilcost").replace(",","");
					String dress = md.getWFDataValue("__wf__dresscost").replace(",","");
					String other = md.getWFDataValue("__wf__sum_other_cost").replace(",","");
			
					double hotel_parse = Double.parseDouble(hotel);
					double plane_parse = Double.parseDouble(plane);
					double taxi_parse = Double.parseDouble(taxi);
					double oil_parse = Double.parseDouble(oil);
					double dress_parse = Double.parseDouble(dress);
					double other_parse = Double.parseDouble(other);
				
					total_of_list = total+hotel_parse+plane_parse+taxi_parse+oil_parse+dress_parse+other_parse;
							

				java.text.DecimalFormat formatNumber2 = new java.text.DecimalFormat("#,##0.00");
			
	%>
<TR>
		<TD class="style4" colspan="6">&nbsp;<%=thaifullmoney.getMoneyToText(screenSingle.getUProfile().get("lang"),total_of_list)%></TD>
		<TD class="style4"><div align="right">&nbsp;<%	out.print(formatNumber2.format(total_of_list));%></div></TD>
		<TD class="style4">&nbsp;</TD>
</TR>
</TABLE>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bordercolor="#000000">
<tr>
<td class="style6">&nbsp;</td>
</tr>
</table>
<TABLE WIDTH="100%" BORDER="1" CELLSPACING="0" CELLPADDING="0" BORDERCOLOR="#000000">
<TR>
		<TD class="style5" colspan="2" bgcolor="#BFBFBF">เคลียร์เงินยืม</TD>
		<TD class="style5" colspan="3"><div align="right">&nbsp;จำนวนเงินที่ยืม &nbsp;&nbsp;<%=md.getWFDataValue("__wf__borrow_cost")%>&nbsp;&nbsp;บาท &nbsp;&nbsp;ขอคืนเงินยืม &nbsp;&nbsp;<%=md.getWFDataValue("__wf__emp_return")%>&nbsp;&nbsp;บาท&nbsp;&nbsp;</div></TD>
</TR>
<TR>
		<TD class="style5" colspan="5" bgcolor="#BFBFBF">รายละเอียดการเดินทาง</TD>
</TR>
<TR>
		<TD class="style5" colspan="2">วันที่</TD>
		<TD class="style5" colspan="2">สถานที่</TD>
		<TD class="style5" rowspan="2">งานที่ปฏิบัติ</TD>
</TR>
<TR>
		<TD class="style5" width="8%">จาก</TD>
		<TD class="style5" width="8%">ถึง</TD>
		<TD class="style5" width="17%">จาก</TD>
		<TD class="style5" width="17%">ถึง</TD>
</TR>
<TR>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
</TR>
<TR>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
</TR>
<TR>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
</TR>
<TR>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
</TR>
<TR>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
</TR>
<TR>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
</TR>
<TR>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
		<TD class="style4">&nbsp;</TD>
</TR>
</TABLE>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bordercolor="#000000">
<tr>
<td class="style6">&nbsp;</td>
</tr>
</table>



									 <TABLE width="100%" BORDER="1" CELLPADDING=0 CELLSPACING=0 bordercolor="#000000" >
									 	<TR>
												<TD CLASS="style2" colspan="2">
												<table width="100%" border="0" cellspacing="0" cellpadding="0" class="txt01" bordercolor="#000000" frame="hsides" rules="groups"><tr><td><div align="center"> <font style="font-size:10px; font-weight:bold">หน่วยงานผู้คืนเงินยืม / ผู้เบิกค่าใช้จ่าย</font></div></td></tr></table>
												</TD>
												<TD CLASS="style2" colspan="3">
												<table width="100%" border="0" cellspacing="0" cellpadding="0" class="txt01" bordercolor="#000000" frame="hsides" rules="groups"><tr><td><div align="center"> <font style="font-size:10px; font-weight:bold">หน่วยการเงิน</font></div></td></tr></table>
												</TD>
										</TR>
												<%
											    CscCalendar calendar3 = new CscCalendar();
												DbInquiry actor_incident3 = (DbInquiry)screenSingle.getRecord().getChild("VW_INCIDENT");
												DbInquiry memployee3 = new InitialInquiry(actor_incident3.getUProfile()).getDbInquiry("MEMPLOYEE");
												memployee3.setColumn("EMP_PREFIX, FNAME, LNAME, ELNAME, EFNAME, EMP_POSITION, BU2");
												memployee3.setFilter("EMPLOYEEID='"+actor_incident3.getString("ACTOR_ID")+"'");
												memployee3.refresh();
													while( memployee3.next() ){		
															calendar3.setTimeInMillis(Long.parseLong(actor_incident3.getString("AI_COMPLETION_TIME")));

												%>
										<TR>
												<TD CLASS="style4">จัดทำโดย :<br>&nbsp;&nbsp;<%=memployee3.getString("FULLNAME")%></TD>
												<%}%>
												<%
												CscCalendar calendar2 = new CscCalendar();
												DbInquiry actor_incident = (DbInquiry)screenSingle.getRecord().getChild("VW_INCIDENT");
												actor_incident.setOrderBy("STEP_ID ASC");
												actor_incident.refresh();
												while(actor_incident.next()){};
												DbInquiry memployee = new InitialInquiry(actor_incident.getUProfile()).getDbInquiry("MEMPLOYEE");
												memployee.setColumn("EMP_PREFIX, FNAME, LNAME, ELNAME, EFNAME, EMP_POSITION, BU2");
												DbInquiry mposition = new InitialInquiry(actor_incident.getUProfile()).getDbInquiry("MPOSITION");
												mposition.setColumn("POSITIONID, TDESC, EDESC");
												DbInquiry mbu2 = new InitialInquiry(actor_incident.getUProfile()).getDbInquiry("MBU2");
												mbu2.setColumn("BU2ID, TSHORT_NAME, ESHORT_NAME");
												memployee.putChild(mposition);
												memployee.putChild(mbu2);
												//do{
													memployee.setFilter("EMPLOYEEID='"+actor_incident.getString("ACTOR_ID")+"'");
													memployee.refresh();
													
													while( memployee.next() ){		
															calendar2.setTimeInMillis(Long.parseLong(actor_incident.getString("AI_COMPLETION_TIME")));
														%>
												<TD CLASS="style4">อนุมัติโดย :<br>&nbsp;&nbsp; <%=memployee.getString("FULLNAME")%></TD>
												<%}%>
												<TD CLASS="style4" rowspan="2">&nbsp;จ่ายโดย<BR>
																												&nbsp;&nbsp;&nbsp;<img src="../WELFARE/IMAGES/box.gif" width="8" height="8">&nbsp;&nbsp;เงินสดย่อย<BR>
																												&nbsp;&nbsp;&nbsp;<img src="../WELFARE/IMAGES/box.gif" width="8" height="8">&nbsp;&nbsp;เช็คธนาคาร</TD>
												<TD CLASS="style4">ผู้จ่ายเงิน</TD>
												<TD CLASS="style4">ผู้รับเงิน</TD>
										</TR>
										 <TR>
												<TD CLASS="style4"><div align="left">วันที่ : <% String create_date = calendar3.getDDMMYYYY(); out.print(create_date.replace("-","/"));%></div></TD>
												<TD CLASS="style4"><div align="center">วันที่ : <% String approve_date = calendar2.getDDMMYYYY(); out.print(approve_date.replace("-","/"));%></div></TD>		
												<TD CLASS="style4">วันที่ : .../..../.....</TD>
												<TD CLASS="style4">วันที่ : .../..../.....</TD>
										</TR>
										<TR>
												<TD CLASS="style6" colspan="2">1. แนบใบเสร็จรับเงิน/ หลักฐานการจ่ายเงิน/ สำเนา Passport<BR>
																														2. ส่ง สปบ. กรณีค่าใช้จ่ายมากกว่า หรือเท่ากับเงินยืมทดรอง<BR>
																														&nbsp;&nbsp;&nbsp;ส่ง สกง. กรณีค่าใช้จ่ายน้อยกว่าเงินยืม<br>
																														&nbsp;&nbsp;&nbsp;สำเนา  :  ผู้คืนเงินยืม/ ผู้เบิก</TD>
												<TD CLASS="style6" colspan="3">*  การคำนวณอัตราแลกเปลี่ยนเงินสกลุต่างประเทศให้ใช้อัตราแลกเปลี่ยนตามที่ปรากฏในเอกสารแลกเปลี่ยนเงินของธนาคาร ซึ่งมี<br>
																														การแลกไว้เป็นระยะไม่เกิน 7 วัน ก่อนถึงวันเดินทางหรือในระหว่างการเดินทาง<br>
																														*  กรณีที่ไม่มีเอกสารแลกเงินให้ไปใช้ Average Selling Rate ของธนาคารพาณิชย์ ซึ่งประกาศโดย ธปท. ณ วันเดินทาง<br>
																														*  กรณีเป็นค่าใช้จ่ายที่เกิดจากการใช้บัตรเคตดิตให้เบิกได้ตามจำนวนเงินที่ถูกเรียกเก็บจริงจากทางบัตรเครดิต</TD>
										</TR>
										<TR>
												<TD CLASS="style6" colspan="5">
															 <TABLE width="100%" BORDER="0" CELLPADDING=0 CELLSPACING=0 >
																		<TR>
																					<TD CLASS="style6" >หมายเหตุ  1. สูตรการคิดจำนวนน้ำมันสำหรับยานพาหนะประจำหน่วยงาน(ลิตร)</TD>
																					<TD CLASS="style6" >3. แนบใบเสร็จรับเงิน/ หลักฐานการจ่ายเงิน</TD>
																		</TR>
																		<TR>
																					<TD CLASS="style6" ><img src="../WELFARE/IMAGES/01.gif" width="148" height="31"></TD>
																					<TD CLASS="style6" >4. ต้นฉบับ : กรณีคืนเงินยืมทดรอง - ส่ง สปบ. กรณีค่าใช้จ่ายมากกว่าหรือเทียบเท่ากับเงินยืม<BR>
																																- ส่ง สกง. กรณีค่าใช้จ่ายน้อยกว่าเงินยืม<BR></TD>
																		</TR>
																		<TR>
																					<TD CLASS="style6" >2. กรอกเมื่องต้องการเบิกค่าชดเชยยานพาหนะ</TD>
																					<TD CLASS="style6" >- กรณีเบิกค่าใช้จ่าย - ส่งสปม.</TD>
																		</TR>
																		<TR>
																					<TD CLASS="style6" ></TD>
																					<TD CLASS="style6" >สำเนา : ผู้คืนเงิน/ ผู้เบิก</TD>
																		</TR>
															 </TABLE>				
										</TR>
									</TABLE>
                    </TD>
                    </TR>
                    </TABLE>
		</DIV></TD>
		</TR>
		</TABLE>
			<BR>
			<BR>
		  </div>
		</FORM>
	</BODY>
</HTML>
<%
}
%>