<%@ 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>VIEW TPYTRAN1</TITLE> </HEAD> <BODY> <% UProfile UP = new UProfile(); UP = new UProfile(); /*UP.setDbName("SQL_THAIMETAL2"); UP.setSchemaName("PR"); UP.setUserName("myhradmin"); UP.set("companyid", "10"); UP.set("lang", "eng"); UP.set("appname","Payroll");*/ /*UP.setDbName("SQL_MYHRDBS"); UP.setSchemaName("PR"); UP.setUserName("myhradmin"); UP.set("companyid", "10"); UP.set("lang", "eng"); UP.set("appname","Payroll");*/ /*UP.setDbName("BTP"); UP.setSchemaName("PR"); UP.setUserName("myhradmin"); UP.set("companyid", "05"); UP.set("lang", "eng"); UP.set("appname","Payroll"); */ UP.setDbName("PRDBS"); UP.setSchemaName("PR"); UP.setUserName("myhradmin"); UP.set("companyid", "001"); UP.set("lang", "eng"); UP.set("appname","Payroll"); String tablename = "mempl_taxm"; boolean flag = false; try{ out.println("============Start sum test =========="+"<br>"); //1. ทำการวนหาค่าใน tpytran0 DbInquiry inqTPY = new InitialInquiry(UP).getDbInquiry(); inqTPY.initMyTable(tablename,"employeeid = 'J2203024'","formula_type"); inqTPY.setColumn("*"); inqTPY.refresh(); double value = 0.0; double tmp = 0.0; int count = 0; while(inqTPY.next()){ DbRecord recTPY = inqTPY.getCurrentDbRecord().cloneRecord(true); /*if(recTPY.getString("formula_type").equals("1")){ out.println("formulaid "+recTPY.getString("FORMULAID")+" "+recTPY.getDouble("AMOUNT")+" "+recTPY.getString("formula_type")+" "+recTPY.getString("gendate")+"<br>"); value += recTPY.getDouble("AMOUNT"); }*/ out.println("formulaid============>"+recTPY.getString("formulaid")+" Taxindex "+recTPY.getString("tax_index") +" value ==========>"+recTPY.getDouble("amount")+"<br>"); } //out.println(value); }catch(Exception e){ e.printStackTrace(); } %> </BODY> </HTML>