REPORTPGD.jsp 2.93 KB
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page import="com.csc.library.system.*,com.csc.library.utilities.*,com.csc.library.cscexport.*,java.util.*,com.csc.library.entry.*,com.csc.library.database.*,com.csc.library.session.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META name="GENERATOR" content="IBM WebSphere Studio">
<META http-equiv="Content-Style-Type" content="text/css">
<LINK href="theme/Master.css" rel="stylesheet" type="text/css">
<TITLE>Export   income || tax  to Text</TITLE>
</HEAD>
<BODY>
			
<%

			UProfile UP = new UProfile();
			UP = new UProfile();
				//UP.setDbName("EASYBUY_ORACLE");
			UP.setDbName("ORA_PRDBS");  
				//UP.setDbName("MYHRDBS");  
			UP.setSchemaName("PR");
			UP.setUserName("myhradmin");
			UP.set("companyid", "001");
				//UP.set("companyid", "10");
			UP.set("lang", "eng");	
			UP.set("appname","Payroll");
			int error=0;
			try{
						String data = "",tmp="";
					
						DbInquiry tax = new InitialInquiry(UP).getDbInquiry();
						tax.setParam("PERIOD_MONTH","11");
						tax.setParam("PERIOD_YEAR","2005");
						tax.initMyTable("Reportpgd","","");
					
						tax.setColumn("*");
						tax.setFilter("employeeid >= 'J2203024' and employeeid <= 'P9911002'");
						//tax.setFilter("employeeid <= 'J2406053'");
						
						DbInquiry taxm = new InitialInquiry(UP).getDbInquiry();
						taxm.initMyTable("pmempl_taxy","period='11'","");
						taxm.setColumn("*");
						tax.putChild(taxm);
						tax.refresh();
						
						while (tax.next()){
							//System.out.print("Employee  ID  = "+tax.getString("employeeid"));
							//System.out.print("       Income  =  "+tax.getString("_inc_check_caltax"));
							data += "Employee ID  =  "+tax.getString("employeeid")+"\t\t\t\t\t"+tax.getString("_inc_check_caltax");
							tmp ="";
							tmp +=  "\t\t\t\t\t"+tax.getString("_inctax");
							
							DbInquiry tax2 = new InitialInquiry(UP).getDbInquiry();
							tax2.setParam("PERIOD_MONTH","12");
							tax2.setParam("PERIOD_YEAR","2005");
							tax2.initMyTable("Reportpgd","","");
							tax2.setColumn("*");
							tax2.setFilter("employeeid",tax.getString("employeeid"));
							DbInquiry taxm2 = new InitialInquiry(UP).getDbInquiry();
							taxm2.initMyTable("pmempl_taxy","period='12'","");
							taxm2.setColumn("*");
							tax2.putChild(taxm2);     
							tax2.refresh(); 
							while (tax2.next()){
								//System.out.println("     "+ tax2.getString("_inc_check_caltax"));
								data += "  ||  "+tax2.getString("_inc_check_caltax");
								tmp  += "  ||  "+tax2.getString("_inctax");
								data +=  tmp+"\r\n";
							}
						}//  end--while
						WriteFile w = new WriteFile("D:/EnterprisePT/Jboss4/server/default/deploy/HRPEAP.ear/hrAppWeb.war/PAYROLL/EXPORT/Report PGD.txt");
						w.writeString(data);
						out.println(data);
	
			}catch(Exception e){
				e.printStackTrace();
			}
%>
</BODY>
</HTML>