<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="java.util.*,java.io.*,java.sql.*"%>
<%@page import="java.text.DecimalFormat"%>
<%@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.*"%>
<%@page import="com.csc.library.timeattendance.*"%>
<%@page import="com.csc.library.database.*"%>

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

<!-- Begin useBean -->

<jsp:useBean id="TEMPLATE_WORKFLOW" class="com.csc.library.system.Task" scope="page"/>
<jsp:useBean id="SCREENEMP" class="com.csc.library.system.Task" scope="page"/>
<jsp:setProperty name="TEMPLATE_WORKFLOW" property="appname" value="WELFARE" />
<jsp:setProperty name="SCREENEMP" property="appname" value="WELFARE" />

<%
TEMPLATE_WORKFLOW.setChannel(request,response);
SCREENEMP.setChannel(request,response);
TEMPLATE_WORKFLOW.checkProfile();
if( TEMPLATE_WORKFLOW.getUProfile() != null ){
	UIManager screenSingle = (UIManager) TEMPLATE_WORKFLOW.process("SingleEntry","TEMPLATE_WORKFLOW");
	HelpEntry screenEmp = (HelpEntry) SCREENEMP.process("HelpEntry","WELEXP_CPN_002HELP");
	String wf = null;
	CheckNull chkNull = new CheckNull();
	Organization og = new Masfactor(screenSingle.getUProfile());
	String subject = null;
	String remark = null;
	String step_type = null;
	String emp_fullname = null;
	String bossid = og.getBoss(screenSingle.getUProfile().get("employeeid"),screenSingle.getUProfile().get("job")).get(0).toString();
	String bossjob = bossid.substring(bossid.indexOf(":")+1);
	CscCalendar calendar = new CscCalendar();
	long attach_time = Long.parseLong(chkNull.chkNullString(request.getParameter("attach_time"),String.valueOf(calendar.getTimeInMillis())));
	ManageDocumentService md = new ManageDocumentService();
	md.setUProfile(screenSingle.getUProfile());
	md.setRequest(request);
	md.setScreen(screenSingle);
	md.setTableSize("100%");
	String wf_step_id=chkNull.chkNullString(request.getParameter("step_id"),"0");
	boolean edit_by_ac=true;

	String document_no = request.getParameter("document_no");
	String __runno = request.getParameter("__runno");
	
	if( !chkNull.chkNullString(request.getParameter("__cmd")).equals("save") ){
		subject = chkNull.chkNullString(request.getParameter("subject"));
		remark = chkNull.chkNullString(request.getParameter("__remark"));
		emp_fullname = chkNull.chkNullString(request.getParameter("emp_fullname"));
	}else if( chkNull.chkNullString(request.getParameter("__cmd")).equals("save") ){
		if(chkNull.chkNullString(request.getParameter("isAdminEdit")).equals("true")){
			response.sendRedirect("../WORKFLOW_ADMIN/ADMIN_EDIT.jsp");
		}else if(chkNull.chkNullString(request.getParameter("isAdminCancel")).equals("true")){
			response.sendRedirect("../WORKFLOW_ADMIN/ADMIN_CANCEL.jsp");
		}else	if(chkNull.chkNullString(request.getParameter("isAdminClean")).equals("true")){
			response.sendRedirect("../WORKFLOW_ADMIN/ADMIN_CLEAN.jsp");
		}else if(chkNull.chkNullString(request.getParameter("isAdminDelete")).equals("true")){
			response.sendRedirect("../WORKFLOW_ADMIN/ADMIN_DELETE.jsp");
		}else if(chkNull.chkNullString(request.getParameter("draft_cmd")).equals("save") || chkNull.chkNullString(request.getParameter("draft_cmd")).equals("delete")){
			response.sendRedirect("../MYNOTE/INBOX.jsp");
		}else{
			response.sendRedirect("../MYNOTE/INBOX.jsp");
		}
		//response.sendRedirect("../MYNOTE/SENT_COMPLETE.jsp");
	}else{
		subject = "";
		remark = "";
		emp_fullname = "";
	}

	bossid = bossid.substring(0,bossid.indexOf(":"));
	DbRecord memployee_dr = new InitialRecord(screenSingle.getUProfile()).getDbRecord("Memployee");
	memployee_dr.setColumn("*");
	memployee_dr.set("COMPANYID",screenSingle.getUProfile().get("companyid"));
	memployee_dr.set("EMPLOYEEID",bossid);
	memployee_dr.search();

	//WF_STATUS 1 = รอการอนุมัติ
	//          3 = ยกเลิกการอนุมัติ
	//          4 = อนุมัติแล้ว
	//          5 = ไม่อนุมัติ
	//          6 = แก้ไขโดย HR
	//          7 = ส่งกลับ
	//          8 = ยกเลิกเอกสาร
	//          9 = ประวัติ

	if( (request.getParameter("__runno") == null || request.getParameter("__runno").equals("")) && 
		(request.getParameter("__help") == null || request.getParameter("__help").equals("")) ){
		screenSingle.clean();
	}

	if( (!screenSingle.getDataLabel("WF_STATUS").equals("1")) && (!screenSingle.getDataLabel("WF_STATUS").equals("4")) &&
		(!screenSingle.getDataLabel("WF_STATUS").equals("7")) ){
		wf = "false";
	}else{
		wf = "true";
	}

	if( request.getParameter("downfile") != null ){
		ThaiUtilities tu = new ThaiUtilities();
		String filePath = request.getParameter("downfile");
		File f = new File(tu.ASCII2Unicode(filePath));
		String fileName = f.getName();
		String fileType = fileName.substring(fileName.indexOf(".")+1,fileName.length());
		if ( f.exists() && f.canRead() ) {
			response.setContentType("application/octet-stream");
			response.setHeader("Content-Disposition", "attachment; filename="+tu.Unicode2ASCII(f.getName()));
			response.setHeader("cache-control", "no-cache");
			response.setContentLength((int) f.length());
			BufferedInputStream fileInput = new BufferedInputStream(new FileInputStream(f));
			byte buffer[] = new byte[8 * 1024];
			out.clearBuffer();
			OutputStream out_s = response.getOutputStream();
			CopyStreams.copyStreamsWithoutClose(fileInput, out_s, buffer);
			out_s.flush();
			out_s.close();
			fileInput.close();
		}
	}

	/* find next 5 woringday */
	//CscCalendar nxcsc = getNextWorkingDay(screenSingle.getUProfile(),5);

	DecimalFormat dc=new DecimalFormat();
	dc.applyPattern("###,###.00");

	String paymentid="",wf_ref_doc="",edit_date="",receiver="",receiverid="",for_job="",trav_reason="",receivedate="",amount="",position="",bu5="",bu2="",comid="",branch_tdesc="",actor_id="",prefix="",fname="",lname="",actorPosition="",mobile="",buaid="",branchid="";
	Double new_amount = 0.00;
	if(!document_no.equals("")){
		wf_ref_doc = getPayment(document_no,"wf_ref_doc",screenSingle.getUProfile());
		paymentid = getPayment(document_no,"paymentid",screenSingle.getUProfile());
		if(!paymentid.equals(""))
			paymentid = paymentid.substring(5,10);
		edit_date = getPayment(document_no,"edit_date",screenSingle.getUProfile());
		if(!edit_date.equals(""))
			edit_date = dateFormat(edit_date);
		 receiver = getPayment(document_no,"receiver",screenSingle.getUProfile());
		 receiverid = getPayment(document_no,"receiverid",screenSingle.getUProfile());
		 for_job = getPayment(document_no,"for_job",screenSingle.getUProfile());
		 trav_reason = getPayment(document_no,"trav_reason",screenSingle.getUProfile());
		 receivedate = getPayment(document_no,"receivedate",screenSingle.getUProfile());
		if(!receivedate.equals(""))
			receivedate = dateFormat(receivedate);
		 amount = getPayment(document_no,"amount",screenSingle.getUProfile());
		 comid = getPayment(document_no,"comid",screenSingle.getUProfile());
		 buaid = getPayment(document_no,"buaid",screenSingle.getUProfile());
		 mobile = getPayment(document_no,"mobile",screenSingle.getUProfile());
		 branchid = getPayment(document_no,"branchid",screenSingle.getUProfile());
		 branch_tdesc = getBranchTdesc(branchid,screenSingle.getUProfile());
		
		if(!amount.equals("")){
			String value_amount="";
			if(amount.indexOf(",")>-1){
				value_amount = amount.replaceAll(",", "");
			}else{
				value_amount = amount;
			}
			new_amount= Double.parseDouble(value_amount);
		}
		 position = getMemployee(receiverid,"position",screenSingle.getUProfile());
		 bu5 = getMemployee(receiverid,"bu5",screenSingle.getUProfile());
		 bu2 = getMemployee(receiverid,"bu2",screenSingle.getUProfile());

		 actor_id = getActorIns(document_no,"actor_id",screenSingle.getUProfile());
		 prefix = getActorDesc(actor_id,"prefix",screenSingle.getUProfile());
		 fname = getActorDesc(actor_id,"fname",screenSingle.getUProfile());
		 lname = getActorDesc(actor_id,"lname",screenSingle.getUProfile());
		 actorPosition = getActorDesc(actor_id,"actorposition",screenSingle.getUProfile());
	}

%>

<%!
	public String getPayment(String document_no,String fieldData,UProfile screenSingle) { //เวลาเรียกใช้งานให้ส่งแบบ String xxx = getfullname(employeeid,screenSingle.getUProfile());
		String data = "";
		try{
			DbInquiry obj = new InitialInquiry(screenSingle).getDbInquiry("mwelpayment_test");
			obj.setColumn("*");
			obj.setFilter("WF_REF_DOC = '"+document_no+"'");
			obj.refresh();
			while(obj.next()){
				data = obj.getString(fieldData);
			}			
		}catch (Exception e) {
			return "";
		}
		return data;
	}

	public String getMemployee(String receiverid,String fieldData,UProfile screenSingle){
		String data="";
		try{
			String sql="select memployee.employeeid,memployee.mobile,mposition.tdesc as position,mbu5.tdesc as bu5,mbu2.tdesc as bu2,mbranch.comid as comid,mbranch.buaid as buaid,mbranch.tdesc as branch_tdesc from  memployee inner join mposition on  memployee.emp_position = mposition.positionid inner join mbu5 on memployee.bu5 = mbu5.bu5id inner join mbu2 on memployee.bu2 = mbu2.bu2id inner join mbranch on memployee.branch = mbranch.branchid where employeeid='"+receiverid+"'";
			String dbName = screenSingle.getDbName();
			String tableName = "memployee";
			DataSet ds = new DataSet(sql,dbName,tableName);
			ds.setFetchAll(false);
			ds.initConnection(screenSingle);
			while(ds.next()){
				data = ds.getString(fieldData);
			}	
		}catch(Exception e){
			return "";
		}
		return data;
	}

	public String getActorIns(String document_no,String fieldData,UProfile screenSingle){
		String data="";
		try{
			//String sql="select top(1)* from actor_incident where wf_seq_no='"+__runno+"' and status='2' order by actor_seq_no desc";
			//String sql="select top(1)* from actor_incident where wf_seq_no in(select runno from workflow_data where doc_no in(select wf_ref_doc from mwelpayment_test where wf_ref_doc='"+document_no+"')) order by actor_seq_no desc";
			String sql = "select top(1)* from actor_incident where wf_seq_no in(select runno from workflow_data where status='2' and doc_no in (select wf_ref_doc from mwelpayment_test where wf_ref_doc='"+document_no+"')) order by step_id desc";
			String dbName = screenSingle.getDbName();
			String tableName = "actor_incident";
			DataSet ds = new DataSet(sql,dbName,tableName);
			ds.setFetchAll(false);
			ds.initConnection(screenSingle);
			while(ds.next()){
				data = ds.getString(fieldData);
			}	
		}catch(Exception e){
			return "";
		}
		return data;
	}

	public String getActorDesc(String actor_id,String fieldData,UProfile screenSingle){
		String data="";
		try{
			String sql="select memployee.employeeid,mprefix.tdesc as prefix,memployee.fname,memployee.lname,mposition.tdesc as actorposition from memployee inner join mprefix on memployee.emp_prefix = mprefix.prefixid inner join mposition on  memployee.emp_position = mposition.positionid where employeeid='"+actor_id+"'";
			String dbName = screenSingle.getDbName();
			String tableName = "memployee";
			DataSet ds = new DataSet(sql,dbName,tableName);
			ds.setFetchAll(false);
			ds.initConnection(screenSingle);
			while(ds.next()){
				data = ds.getString(fieldData);
			}	
		}catch(Exception e){
			return "";
		}
		return data;
	}

	public String getBranchTdesc(String branchid,UProfile screenSingle){
		String data="";
		try{
			String sql="select * from mbranch where branchid ='"+branchid+"'";
			String dbName = screenSingle.getDbName();
			String tableName = "mbranch";
			DataSet ds = new DataSet(sql,dbName,tableName);
			ds.setFetchAll(false);
			ds.initConnection(screenSingle);
			while(ds.next()){
				data = ds.getString("tdesc");
			}	
		}catch(Exception e){
			return "";
		}
		return data;
	}

	public String dateFormat(String date){
		String newFormat = date.substring(8,10)+"-"+date.substring(5,7)+"-"+date.substring(0,4);
		return newFormat;
	}	
%>

<!-- End useBean -->

<SCRIPT LANGUAGE="JavaScript" TYPE="text/JavaScript">
function goPrint()
{
	document.getElementById("print").style.visibility="hidden";
	window.print();
}
</script>

<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 LANGUAGE="JavaScript" TYPE='text/JavaScript' SRC='../JS/UTILITIES.js'></SCRIPT>
		<SCRIPT LANGUAGE="JavaScript" TYPE='text/JavaScript' SRC='../JS/ACTIVE_OBJECT.js'></SCRIPT>
		<SCRIPT TYPE='text/JavaScript' SRC='../JS/MYNOTE_SCREEN.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/DATEINPUT.js'></SCRIPT>
		<SCRIPT TYPE='text/JavaScript' SRC='../JS/VIEWCALENDAR.js'></SCRIPT>
		<SCRIPT TYPE='text/JavaScript' SRC='../JS/ICONSMENU.js'></SCRIPT>
		<SCRIPT LANGUAGE="JavaScript">setLang('<%=screenSingle.getUProfile().get("lang")%>');</SCRIPT>
		<SCRIPT TYPE='text/JavaScript' SRC='../TA/JS/TA_SCREEN.js'></SCRIPT>

		<!-- End Import Script -->

		<link HREF="../CSS/start/jquery-ui-1.9.2.custom.css" REL="stylesheet" TYPE="text/css">
		<SCRIPT TYPE='text/JavaScript' SRC='../JS/jquery-1.7.2.js'></SCRIPT>
		 <SCRIPT TYPE='text/JavaScript' SRC='../JS/jquery-ui-1.9.2.js'></SCRIPT> 
		<!-- <SCRIPT TYPE='text/JavaScript' SRC='../JS/jquery-ui-1.9.2.min.js'></SCRIPT> -->
		<SCRIPT TYPE='text/JavaScript' SRC='../JS/cscWFBase.js'></SCRIPT>

		<SCRIPT LANGUAGE="JavaScript" TYPE="text/JavaScript">
			setPageTitle(swap2String("Request To Payment Test"));
		</SCRIPT>

		<style type="text/css">	
			#tblBody {
				height: 100%;
			}
			#tdFtr {
				height: 206px;
			}
			#tdHdr {
				height: 98px;
			}
			#style1{
				width: 90px;
				height: 30px;
			}
			#styleImage{
				width: 90px;
				height: 30px;
			}
		</style>

	</HEAD>
	<BODY onLoad="init();MM_preloadImages('../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif')">
		<jsp:include page="./loadpage.jsp" flush="true" />	
		<FORM NAME="cscform" METHOD="post" ACTION="WELEXP_CPN_002.jsp">
			
			<TABLE WIDTH=950 BORDER=0 ALIGN="center" CELLPADDING=0 CELLSPACING=0>
				
						<div align="right" style="width: 760px; padding-left: 12px;">
			
<!-- Begin Step1 -->
<%=md.getStepDocument("3111","1")%>
<% if(md.isStep1 || md.isDraft ){%>
		<INPUT TYPE="hidden" NAME="isstep1" VALUE="true">
<%}else{%>
		<INPUT TYPE="hidden" NAME="isstep1" VALUE="false">
<%}%>
<%//=md.getHeadDocument()%>
                     
<%//=md.getHelpDocument("Request To Payment Test")%>
                   
<%//=md.getSendToDocumentWithDocno("Request To Payment Test",true)%>
					  
						<!-- Begin Code -->
<table border="0" align="center" cellpadding="0" cellspacing="0" width="1001" style="table-layout:fixed;">
	<tr>
		<td id="style1" colspan="12" height="30">&nbsp;</td>
	</tr>
	<tr>
		<td id="styleImage" rowspan="4" width="90"><img src="../IMAGES/CPN/logo_cpn.jpg" align="right" width="100%"></td>
		<td colspan="10" align="center"><p><font size="6">ใบเบิกเงินทดรองจ่าย/ใบเครดิตเงินสด</font></p></td>
	</tr>
	<tr>
		<td width="90" height="30">&nbsp;</td>
		<td width="90">&nbsp;</td>
		<td width="90">&nbsp;</td>
		<td width="90">&nbsp;</td>
		<td width="90">&nbsp;</td>
		<td width="90">&nbsp;</td>
		<td width="90">&nbsp;</td>
		<td width="90">&nbsp;</td>
		<td width="90">&nbsp;</td>
		<td width="90">&nbsp;</td>
	</tr>
	<tr>
		<td colspan="6" height="30">&nbsp;</td>
		<td colspan="4"><font size="4">เลขที่<span style="border-bottom:1px dashed #000;">&nbsp;&nbsp;<%=wf_ref_doc%>/<%=paymentid%>&nbsp;&nbsp;</span></font></td>
	</tr>
	<tr>
		<td colspan="6" height="30">&nbsp;</td>
		<td colspan="4"><font size="4">วันที่<span style="border-bottom:1px dashed #000;">&nbsp;&nbsp;<%=edit_date%>&nbsp;&nbsp;</span></font></td>
	</tr>
	<tr>
		<td rowspan="50" width="50">&nbsp;</td>
		<td colspan="10" height="30">&nbsp;</td>
	</tr>
	<tr>
		<td colspan="6" height="30"><font size="4">ชื่อผู้เบิก<span style="border-bottom:1px dashed #000;">&nbsp;&nbsp;<%=receiver%>&nbsp;&nbsp;</span></font></td>
		<td colspan="4" widht="360"><font size="4">รหัสพนักงาน<span style="border-bottom:1px dashed #000;">&nbsp;&nbsp;<%=receiverid%>&nbsp;&nbsp;</span></font></td>
	</tr>
	<tr>
		<td colspan="6" height="30"><font size="4">แผนก<span style="border-bottom:1px dashed #000;">&nbsp;&nbsp;<%=bu5%>&nbsp;&nbsp;</span></font></td>
		<td colspan="4"><font size="4">ตำแหน่ง<span style="border-bottom:1px dashed #000;">&nbsp;&nbsp;<%=position%>&nbsp;&nbsp;</span></font></td>
	</tr>
	<tr>
		<td colspan="6" height="30"><font size="4">ฝ่าย<span style="border-bottom:1px dashed #000;">&nbsp;&nbsp;<%=bu2%>&nbsp;&nbsp;</span></font></td>
		<td colspan="4"><font size="4">โทรศัพท์<span style="border-bottom:1px dashed #000;">&nbsp;&nbsp;<%=mobile%>&nbsp;&nbsp;</font></td>
	</tr>
	<tr>
		<td colspan="7" height="30"><font size="4">บริษัท<span style="border-bottom:1px dashed #000;">&nbsp;&nbsp;<%=branch_tdesc%>&nbsp;&nbsp;</span></font></td>
		<td colspan="3"><font size="4">รหัสบริษัท<span style="border-bottom:1px dashed #000;">&nbsp;&nbsp;<%=comid%>/<%=buaid%>&nbsp;&nbsp;</span></font></td>
	</tr>
	<tr>
		<td colspan="10" height="120" style="text-align:left;vertical-align:top"><font size="4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		&nbsp;&nbsp;&nbsp;ขอเบิกเงินทดรองจ่ายเพื่อ<span style="border-bottom:1px dashed #000;line-height:160%;"> 
		&nbsp;&nbsp;<%=for_job%>&nbsp;/&nbsp;<%=trav_reason%>&nbsp;&nbsp;</span></font></td>
	</tr>
	<tr>
		<td colspan="6" height="30"><font size="4">โดยโอนเงินเข้าบัญชีธนาคารของผู้รับเงิน ในวันที่<span style="border-bottom:1px dashed #000;">&nbsp;<%=receivedate%>&nbsp;&nbsp;</span></font></td>
		<td colspan="3"><font size="4">จำนวนเงิน<span style="border-bottom:1px dashed #000;">&nbsp;&nbsp;<%=dc.format(new_amount)%>&nbsp;&nbsp;</span></font></td>
		<td colspan="1"><font size="4">บาท</font></td>
	</tr>
	<tr>
		<td colspan="1" height="30">&nbsp;</td>
		<td colspan="9"><font size="4">หากไม่สามารถ clear เงินทดรองจ่ายได้ตามที่กำหนดไว้ในระเบียบการเบิกเงินทดรองจ่ายที่มีผลบังคับใช้</font></td>
	</tr>
	<tr>
		<td colspan="10" height="30"><font size="4">ในขณะนี้ ยินยอมให้บริษัทฯคิดค่าปรับในอัตรา 15% ต่อปี และพิจารณาหักเงินเดือน หรือเงินอื่นใดที่จะได้รับจาก</font></td>
	</tr>
	<tr>
		<td colspan="10" height="30"><font size="4">บริษัทฯ เพื่อชดใช้จำนวนเงินที่เบิกเงินทดรองจ่ายได้จนครบจำนวน</font></td>
	</tr>
		<tr>
		<td colspan="10" height="30">&nbsp;</td>
	</tr>
	<tr>
		<td colspan="4" height="30"><font size="4">ผู้รับเงิน<span style="border-bottom:1px dashed #000;">&nbsp;&nbsp;<%=receiver%>&nbsp;&nbsp;</span></font></td>
		<td colspan="6"><font size="4">ตำแหน่ง<span style="border-bottom:1px dashed #000;">&nbsp;&nbsp;<%=position%>&nbsp;&nbsp;</span></font></td>
	</tr>
	<tr>
		<td colspan="10" height="30">&nbsp;</td>
	</tr>
	<tr>
		<td colspan="4" height="30"><font size="4">ผู้อนุมัติ<span style="border-bottom:1px dashed #000;">&nbsp;&nbsp;<%=prefix%><%=fname%>&nbsp;<%=lname%>&nbsp;&nbsp;</span></font></td>
		<td colspan="6"><font size="4">ตำแหน่ง<span style="border-bottom:1px dashed #000;">&nbsp;&nbsp;<%=actorPosition%>&nbsp;&nbsp;</span></font></td>
	</tr>
	<tr>
		<td colspan="10" height="30">&nbsp;</td>
	</tr>
	<tr>
		<td colspan="10" height="30"><font size="4">สิ่งที่แนบมาด้วย : Proposal , แผนงาน</font></td>
	</tr>
	<tr>
		<td colspan="10" height="30"><font size="4">หมายเหตุ : ผู้เบิกต้องส่งใบเบิกเงินทดรองจ่าย ล่วงหน้าอย่างน้อย 5 วันทำการ ก่อนวันใช้เงิน</font></td>
	</tr>
	<tr>
		<td colspan="10" height="30">__________________________________________________________________________________________________</td>
	</tr>
	<tr>
		<td colspan="10" height="30">&nbsp;</td>
	</tr>
	<tr>
		<td colspan="6" height="30">&nbsp;</td>
		<td colspan="4"><font size="4">เลขที่</font></td>
	</tr>
	<tr>
		<td colspan="10" height="30">&nbsp;</td>
	</tr>
	<tr>
		<td colspan="6" height="30"><font size="4">บริษัทฯ ได้รับคืนเงินทดรองจ่ายข้างต้น วันที่<span style="border-bottom:1px dashed #000;"></span></font></td>
		<td colspan="4"><font size="4">โดย</font></td>
	</tr>
	<tr>
		<td colspan="3" height="30"><font size="4">เป็นค่าใช้จ่าย</font></td>
		<td colspan="2"><font size="4">จำนวน<span style="border-bottom:1px dashed #000;"></span></font></td>
		<td colspan="5"><font size="4">บาท --> (ตามเอกสารแนบ)</font></td>
	</tr>
	<tr>
		<td colspan="3" height="30"><font size="4">คืนเงินสด</font></td>
		<td colspan="2"><font size="4">จำนวน<span style="border-bottom:1px dashed #000;"></span></font></td>
		<td colspan="5"><font size="4">บาท --> (เข้าบัญชีบริษัทฯ ตามที่ระบุด้านล่าง)</font></td>
	</tr>
	<tr>
		<td colspan="3" height="30"><font size="4">ขอเบิกเพิ่ม</font></td>
		<td colspan="2"><font size="4">จำนวน<span style="border-bottom:1px dashed #000;"></span></font></td>
		<td colspan="5"><font size="4">บาท --> (โอนเงินเข้าบัญชีธนาคารของผู้รับเงิน)</font></td>
	</tr>
	<tr>
		<td colspan="3" height="30"><font size="4">ผลต่างจากอัตราแลกเปลี่ยน(ถ้ามี)</font></td>
		<td colspan="2"><font size="4">จำนวน<span style="border-bottom:1px dashed #000;"></span></font></td>
		<td colspan="5"><font size="4">บาท --> (อัตราแลกเปลี่ยน ตามเอกสารแนบ)</font></td>
	</tr>
	<tr>
		<td colspan="3" height="30">&nbsp;</td>
		<td colspan="2"><font size="4">รวม<span style="border-bottom:1px dashed #000;"></span></font></td>
		<td colspan="5"><font size="4">บาท</font></td>
	</tr>
	<tr>
		<td colspan="10" height="30">&nbsp;</td>
	</tr>
	<tr>
		<td colspan="4" height="30"><font size="4">ผู้คืน<span style="border-bottom:1px dashed #000;"></span></font></td>
		<td colspan="6"><font size="4">ตำแหน่ง<span style="border-bottom:1px dashed #000;"></span></font></td>
	</tr>
	<tr>
		<td colspan="10" height="30">&nbsp;</td>
	</tr>
	<tr>
		<td colspan="4" height="30"><font size="4">ผู้อนุมัติ<span style="border-bottom:1px dashed #000;"></span></font></td>
		<td colspan="6"><font size="4">ตำแหน่ง<span style="border-bottom:1px dashed #000;"></span></font></td>
	</tr>
	<tr>
		<td colspan="10" height="30">&nbsp;</td>
	</tr>
	<tr>
		<td colspan="1" height="30">&nbsp;</td>
		<td colspan="4"><font size="4">ผู้รับคืน<span style="border-bottom:1px dashed #000;"></span></font></td>
		<td colspan="5"><font size="4">วันที่<span style="border-bottom:1px dashed #000;"></span></font></td>
	</tr>
	<tr>
		<td colspan="10" height="30">&nbsp;</td>
	</tr>
	<tr>
		<td colspan="10" height="30"><font size="4">หมายเหตุ : หากมีเงินสดคงเหลือ ให้ผู้เบิกนำฝากคืนเข้าบัญชีบริษัทฯ ดังนี้</font></td>
	</tr>
	<tr>
		<td colspan="3"><font size="4">[ ]&nbsp;ธนาคารสาขา กทม./ปริมณฑล</font></td>
		<td colspan="2"><font size="4">บัญชี<span style="border-bottom:1px dashed #000;"></span></font></td>
		<td colspan="2"><font size="4">ธนาคาร<span style="border-bottom:1px dashed #000;"></span></font></td>
		<td colspan="3"><font size="4">เลขที่บัญชี<span style="border-bottom:1px dashed #000;"></span></font></td>
	</tr>
<!--	<tr>
		<td colspan="3"><font size="4">[ ]&nbsp;ธนาคารสาขา กทม./ปริมณฑล</font></td>
		<td colspan="2"><font size="4">บัญชี<span style="border-bottom:1px dashed #000;"></span></font></td>
		<td colspan="2"><font size="4">ธนาคาร<span style="border-bottom:1px dashed #000;"></span></font></td>
		<td colspan="3"><font size="4">เลขที่บัญชี<span style="border-bottom:1px dashed #000;"></span></font></td>
	</tr>
	<tr>
		<td colspan="3"><font size="4">[ ]&nbsp;ธนาคารสาขาต่างจังหวัด</font></td>
		<td colspan="2"><font size="4">บัญชี<span style="border-bottom:1px dashed #000;"></span></font></td>
		<td colspan="2"><font size="4">ธนาคาร<span style="border-bottom:1px dashed #000;"></span></font></td>
		<td colspan="3"><font size="4">เลขที่บัญชี<span style="border-bottom:1px dashed #000;"></span></font></td>
	</tr> -->
	<tr>
		<td colspan="3"><font size="4">[ ]&nbsp;ธนาคารสาขาต่างจังหวัด</font></td>
		<td colspan="2"><font size="4">บัญชี<span style="border-bottom:1px dashed #000;"></span></font></td>
		<td colspan="2"><font size="4">ธนาคาร<span style="border-bottom:1px dashed #000;"></span></font></td>
		<td colspan="3"><font size="4">เลขที่บัญชี<span style="border-bottom:1px dashed #000;"></span></font></td>
	</tr>
	<tr>
		<td colspan="10" height="30">__________________________________________________________________________________________________</td>
		<!-- <td colspan="10" height="30"><hr style="border:5px; color:#000"/></td> -->
	</tr>
	<tr>
		<td colspan="10" height="30"><div align="center" id="print"><a href="javascript:goPrint();"><img src="../IMAGES/MYNOTE/BUTTON/BUTTON_PRINT.gif" alt="Print Form" width="89" height="37" border="0"></a></div></td>
	</tr>
</table>
						</DIV>
					</TD>
					
				</TR>

			</TABLE>

		</FORM>
</BODY>
</HTML>
<%
}
%>