Commit edf682cf authored by caluka's avatar caluka

After Source review code changed


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98273 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7388f9aa
......@@ -3,6 +3,7 @@ package ibase.webitm.ejb.fin;
import java.util.*;
import java.util.Date;
import java.io.File;
import java.rmi.RemoteException;
import java.sql.*;
......@@ -239,8 +240,9 @@ public class MilestonePayGen
}
else
{
calRelAmt = calculateRelAmt(amtType,relAmt,odtAmt,totAmt,taxAmt);
if (amtType.equalsIgnoreCase("01")) // % of base
/*if (amtType.equalsIgnoreCase("01")) // % of base
{
calRelAmt = (odtAmt * Double.parseDouble(relAmt)) / 100;
} else if (amtType.equalsIgnoreCase("02")) // % of net
......@@ -252,7 +254,7 @@ public class MilestonePayGen
} else if (amtType.equalsIgnoreCase("04"))// % of full tax
{
calRelAmt = (totAmt * Double.parseDouble(relAmt)) / 100 + taxAmt;
}
}*/
System.out.println("calRelAmt :" + calRelAmt);
/*GenPurcMilestoneSch purmstnsch = new GenPurcMilestoneSch();
......@@ -322,6 +324,7 @@ public class MilestonePayGen
xmlBuff.append("<chg_user><![CDATA[" + chgUser + "]]></chg_user>");
xmlBuff.append("<chg_date><![CDATA[" + tranDate + "]]></chg_date>");
xmlBuff.append("<chg_term><![CDATA[" + chgTerm + "]]></chg_term>");
xmlBuff.append("<date_format><![CDATA["+e12GenericUtility.getApplDateFormat()+"]]></date_format>");
xmlBuff.append("</Detail1>");
xmlBuff.append("</Header0>");
......@@ -364,9 +367,14 @@ public class MilestonePayGen
catch (SQLException sqx)
{
System.out.println("The SQLException occurs in MilestonePayGen :"+sqx);
sqx.printStackTrace();
try
{
conn.rollback();
}
catch(Exception se1){}
throw new ITMException(sqx);
//sqx.printStackTrace();
//throw new ITMException(sqx);
}
catch(Exception e)
{
......@@ -2008,6 +2016,33 @@ public class MilestonePayGen
return isReult;
}
public double calculateRelAmt(String amtType,String relAmt,double odtAmt,double totAmt,double taxAmt)
{
double calRelAmt = 0.0d;
try
{
if (amtType.equalsIgnoreCase("01")) // % of base
{
calRelAmt = (odtAmt * Double.parseDouble(relAmt)) / 100;
} else if (amtType.equalsIgnoreCase("02")) // % of net
{
calRelAmt = (totAmt * Double.parseDouble(relAmt)) / 100;
} else if (amtType.equalsIgnoreCase("03"))// fixed amount
{
calRelAmt = Double.parseDouble(relAmt);
} else if (amtType.equalsIgnoreCase("04"))// % of full tax
{
calRelAmt = (totAmt * Double.parseDouble(relAmt)) / 100 + taxAmt;
}
}
catch ( Exception e )
{
e.printStackTrace();
}
return calRelAmt;
}
}
\ No newline at end of file
......@@ -733,7 +733,7 @@ public class MilestonePayGenPrc extends ValidatorEJB implements MilestonePayGenP
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, purcOrder);
rs = pstmt.executeQuery();
while (rs.next())
if (rs.next())
{
supplierCode =rs.getString("supp_code");
}
......@@ -1153,93 +1153,6 @@ public class MilestonePayGenPrc extends ValidatorEJB implements MilestonePayGenP
System.out.println("\n****ValueXmlString :" + valueXmlString.toString() + ":********");
return valueXmlString.toString();
}
public String getPurcOrderSupplierCode(String purchaseOrder,String dbId)
{
String SupplierCodeData = "";
try
{
System.out.println("getPurcOrderSupplierCode for onchange");
SupplierCodeData = getSupplierCode(purchaseOrder,dbId);
String xslFileName = getXSLFileName("milestone_purcOrder_onchange_suppliercode.xsl");
System.out.println("xslFileName !!! "+xslFileName);
System.out.println("purcOrdData@@@@:"+SupplierCodeData);
System.out.println("CommonConstants.APPLICATION_CONTEXT@@@@:"+CommonConstants.APPLICATION_CONTEXT);
System.out.println("File.separator@@@@:"+File.separator);
SupplierCodeData = new E12GenericUtility().transformToString(xslFileName, SupplierCodeData, CommonConstants.APPLICATION_CONTEXT + File.separator + "temp", "Output", ".html" );
System.out.println("purcOrdData :"+SupplierCodeData);
}
catch ( Exception e )
{
e.printStackTrace();
}
return SupplierCodeData;
}
public String getSupplierCode(String purchaseOrder,String dbId) throws ITMException
{
String sql = "";
StringBuffer valueXmlString = new StringBuffer("<Root>\r\n");
Connection connectionObject = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
E12GenericUtility genericUtility = new E12GenericUtility();
try
{
System.out.println("getSupplierCode!!!!!!!!!!!");
System.out.println("dbId :"+dbId);
ConnDriver connDriver = new ConnDriver();
connectionObject = connDriver.getConnectDB("DriverITM");
sql = " select supp_code from porder where purc_order = ? ";
System.out.println(" selectteam sql [" + sql + "]");
pstmt = connectionObject.prepareStatement(sql);
pstmt.setString(1, purchaseOrder);
rs = pstmt.executeQuery();
int num = 1;
while (rs.next())
{ valueXmlString.append("<ITEM domID='" + num + "' selected = 'N'>\r\n");
valueXmlString.append("<supp_code><![CDATA[").append(rs.getString("supp_code")).append("]]></supp_code>\r\n");
valueXmlString.append("<purc_order><![CDATA[").append(purchaseOrder).append("]]></purc_order>\r\n");
valueXmlString.append("<db_id><![CDATA[").append(dbId).append("]]></db_id>\r\n");
valueXmlString.append("</ITEM>\r\n");
num++;
}
}
catch (Exception e)
{
e.printStackTrace();
System.out.println("Exception :getProjectCdList1(String):" + e.getMessage() + ":");
valueXmlString = valueXmlString.append(genericUtility.createErrorString(e));
}
finally
{
try
{
if (connectionObject != null && !connectionObject.isClosed())
{
connectionObject.close();
connectionObject = null;
}
}
catch (Exception e)
{
System.out.println("Exception :ITMWizardStatefulEJB :getSalesPersTeamList(String) :==>\n"+ e.getMessage());
throw new ITMException(e);
}
}
valueXmlString.append("</Root>\r\n");
System.out.println("\n****ValueXmlString :" + valueXmlString.toString() + ":********");
return valueXmlString.toString();
}
private String getXSLFileName( String xslFileName )throws ITMException
{
String retFileName = null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment