Commit 0a1be95b authored by manohar's avatar manohar

Bug fixing, optimisation


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@104102 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d1174fe0
...@@ -104,7 +104,7 @@ public class PostOrdDespatchGen ...@@ -104,7 +104,7 @@ public class PostOrdDespatchGen
int cnt=0,lineNum=0; int cnt=0,lineNum=0;
boolean lbCheck=false,isDetailExist=false; boolean lbCheck=false,isDetailExist=false;
Date expDate=null,mfgDate=null; Date expDate=null,mfgDate=null;
double quantityStd=0,qtyAllocStd=0,convQtyStduom=0,costRate=0,noArt=0,confDiffAmt=0; double quantityStd=0,qtyAllocStd=0,convQtyStduom=0,costRate=0,noArt=0,confDiffAmt=0,totAmount=0;
double rate=0,rateClg=0,qtyDesp=0,pendingQty=0,shipperQty=0,intQty=0,convRtuomStduom=0,rateStduom=0,rateStd=0; double rate=0,rateClg=0,qtyDesp=0,pendingQty=0,shipperQty=0,intQty=0,convRtuomStduom=0,rateStduom=0,rateStd=0;
String taxClass="",taxChap="",taxEnv="",packCode="",custItemRef="",unitRateSord="",unitSord=""; String taxClass="",taxChap="",taxEnv="",packCode="",custItemRef="",unitRateSord="",unitSord="";
String postUpto="",confDespOnPost=""; String postUpto="",confDespOnPost="";
...@@ -1072,7 +1072,7 @@ public class PostOrdDespatchGen ...@@ -1072,7 +1072,7 @@ public class PostOrdDespatchGen
rs1=pstmt1.executeQuery(); rs1=pstmt1.executeQuery();
if(rs1.next()) if(rs1.next())
{ {
totAmount = rs1.getdouble("amount"); totAmount = rs1.getDouble("amount");
} }
rs1.close(); rs1.close();
rs1 = null; rs1 = null;
...@@ -1169,9 +1169,11 @@ public class PostOrdDespatchGen ...@@ -1169,9 +1169,11 @@ public class PostOrdDespatchGen
tempMapSord.put("conv__rtuom_stduom", netWtPerArt); tempMapSord.put("conv__rtuom_stduom", netWtPerArt);
tempMapSord.put("rate__stduom", netWtPerArt*mrate); tempMapSord.put("rate__stduom", netWtPerArt*mrate);
if (totAmount > 0)
//CalcSchemeAmt calcSchemeAmt= new CalcSchemeAmt(); {
CalcSchemeAmt calcSchemeAmt= new CalcSchemeAmt();
calcSchemeAmt.updateAmt(saleOrder, conn); calcSchemeAmt.updateAmt(saleOrder, conn);
}
/* lc_offinv_rate = nvo_fin_inv.gbf_calc_discount_rate(as_sordno,ls_linenoord,ls_itemcode,(ld_net_wt_perart * mrate),'O') /* lc_offinv_rate = nvo_fin_inv.gbf_calc_discount_rate(as_sordno,ls_linenoord,ls_itemcode,(ld_net_wt_perart * mrate),'O')
if isnull(lc_offinv_rate) then lc_offinv_rate = 0 if isnull(lc_offinv_rate) then lc_offinv_rate = 0
......
...@@ -1203,13 +1203,19 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB ...@@ -1203,13 +1203,19 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
} }
//pending for R //pending for R
// System.out.println("ldTranDate::::::::::::"+ldTranDate); //System.out.println("ldTranDate::::::::::::"+ldTranDate);
if(ldTranDate != null) // 02/dec-16 manoharan avoid deprecated
/*if(ldTranDate != null)
{ {
liMonth=ldTranDate.getMonth(); liMonth=ldTranDate.getMonth();
} }*/
// System.out.println("Li Month :- ["+liMonth+"]"); Calendar cal = Calendar.getInstance();
cal.setTime(ldTranDate);
//li_mth = ld_desp_date.getMonth();
liMonth = cal.get(Calendar.MONTH);
//System.out.println("Li Month :- ["+liMonth+"]");
if(liMonth==12) if(liMonth==12)
{ {
...@@ -1608,7 +1614,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB ...@@ -1608,7 +1614,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
double lc_desp_std_rate=0.0,totAmount = 0; double lc_desp_std_rate=0.0,totAmount = 0;
PreparedStatement pstmt=null, pstmt1 = null; PreparedStatement pstmt=null, pstmt1 = null;
ResultSet rs=null, rs1 = null; ResultSet rs=null, rs1 = null;
String beanMapKey="",lsLineType=""; String beanMapKey="",lsLineType="", sql= "";
ArrayList<Object> mainArrayList= new ArrayList<Object>(); ArrayList<Object> mainArrayList= new ArrayList<Object>();
HashMap commissionMap = null; HashMap commissionMap = null;
/** /**
...@@ -1739,11 +1745,11 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB ...@@ -1739,11 +1745,11 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
sql="select sum(quantity * rate) as amount from sorddet where sale_order = ? "; sql="select sum(quantity * rate) as amount from sorddet where sale_order = ? ";
pstmt1=conn.prepareStatement(sql); pstmt1=conn.prepareStatement(sql);
pstmt1.setString(1, saleOrder); pstmt1.setString(1, sord_no);
rs1=pstmt1.executeQuery(); rs1=pstmt1.executeQuery();
if(rs1.next()) if(rs1.next())
{ {
totAmount = rs1.getdouble("amount"); totAmount = rs1.getDouble("amount");
} }
rs1.close(); rs1.close();
rs1 = null; rs1 = null;
...@@ -1753,7 +1759,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB ...@@ -1753,7 +1759,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
{ {
CalcSchemeAmt calcSchemeAmt=new CalcSchemeAmt(); CalcSchemeAmt calcSchemeAmt=new CalcSchemeAmt();
calcSchemeAmt.updateAmt(rs.getString("sord_no"), conn); calcSchemeAmt.updateAmt(sord_no, conn);
} }
lsAcctSchemedet=getLsAcctSchemedet(rs.getString("sord_no"),rs.getString("line_no__sord"),conn); lsAcctSchemedet=getLsAcctSchemedet(rs.getString("sord_no"),rs.getString("line_no__sord"),conn);
......
...@@ -1790,7 +1790,9 @@ public class PostOrdInvoicePost extends ActionHandlerEJB implements PostOrdInvoi ...@@ -1790,7 +1790,9 @@ public class PostOrdInvoicePost extends ActionHandlerEJB implements PostOrdInvoi
ldPostdate2 = Timestamp.valueOf(genericUtility.getValidDateString(ldPostdate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0"); ldPostdate2 = Timestamp.valueOf(genericUtility.getValidDateString(ldPostdate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
} }
glTraceMap.put("tran_date", ldPostdate2); glTraceMap.put("tran_date", ldPostdate2);
glTraceMap.put("eff_date",new Timestamp(Timestamp.parse(InvoiceHrdMap.get("eff_date")))); // 02-dec-16 manoharan avoid deprecated
//glTraceMap.put("eff_date",new Timestamp(Timestamp.parse(InvoiceHrdMap.get("eff_date"))));
glTraceMap.put("eff_date", Timestamp.valueOf(InvoiceHrdMap.get("eff_date")));
glTraceMap.put("fin_entity", InvoiceHrdMap.get("fin_entity")); glTraceMap.put("fin_entity", InvoiceHrdMap.get("fin_entity"));
glTraceMap.put("site_code", InvoiceHrdMap.get("site_code")); glTraceMap.put("site_code", InvoiceHrdMap.get("site_code"));
glTraceMap.put("sundry_type","O"); glTraceMap.put("sundry_type","O");
...@@ -1903,8 +1905,11 @@ public class PostOrdInvoicePost extends ActionHandlerEJB implements PostOrdInvoi ...@@ -1903,8 +1905,11 @@ public class PostOrdInvoicePost extends ActionHandlerEJB implements PostOrdInvoi
* Generate sundry_bal Map * Generate sundry_bal Map
* */ * */
sundryBalMap = new HashMap(); sundryBalMap = new HashMap();
sundryBalMap.put("tran_date",new Timestamp(Timestamp.parse(InvoiceHrdMap.get("tran_date")))); // 02-dec-16 manoharan avoid deprecated
sundryBalMap.put("eff_date",new Timestamp(Timestamp.parse(InvoiceHrdMap.get("eff_date")))); //sundryBalMap.put("tran_date",new Timestamp(Timestamp.parse(InvoiceHrdMap.get("tran_date"))));
//sundryBalMap.put("eff_date",new Timestamp(Timestamp.parse(InvoiceHrdMap.get("eff_date"))));
sundryBalMap.put("tran_date", Timestamp.valueOf(InvoiceHrdMap.get("tran_date")));
sundryBalMap.put("eff_date", Timestamp.valueOf(InvoiceHrdMap.get("eff_date")));
sundryBalMap.put("fin_entity", InvoiceHrdMap.get("fin_entity")); sundryBalMap.put("fin_entity", InvoiceHrdMap.get("fin_entity"));
sundryBalMap.put("site_code", InvoiceHrdMap.get("site_code")); sundryBalMap.put("site_code", InvoiceHrdMap.get("site_code"));
sundryBalMap.put("sundry_type", "C"); sundryBalMap.put("sundry_type", "C");
...@@ -1963,7 +1968,9 @@ public class PostOrdInvoicePost extends ActionHandlerEJB implements PostOrdInvoi ...@@ -1963,7 +1968,9 @@ public class PostOrdInvoicePost extends ActionHandlerEJB implements PostOrdInvoi
//glTraceMap.put("tran_date", lsPostdate); //glTraceMap.put("tran_date", lsPostdate);
glTraceMap.put("tran_date", lsPostdateTemp); glTraceMap.put("tran_date", lsPostdateTemp);
glTraceMap.put("eff_date",new Timestamp(Timestamp.parse(InvoiceHrdMap.get("eff_date")))); // 02-dec-16 manoharan avoid deprecated
//glTraceMap.put("eff_date",new Timestamp(Timestamp.parse(InvoiceHrdMap.get("eff_date"))));
glTraceMap.put("eff_date", Timestamp.valueOf(InvoiceHrdMap.get("eff_date")));
glTraceMap.put("fin_entity", InvoiceHrdMap.get("fin_entity")); glTraceMap.put("fin_entity", InvoiceHrdMap.get("fin_entity"));
glTraceMap.put("site_code", InvoiceHrdMap.get("site_code")); glTraceMap.put("site_code", InvoiceHrdMap.get("site_code"));
glTraceMap.put("sundry_type", "C"); glTraceMap.put("sundry_type", "C");
...@@ -2200,14 +2207,18 @@ public class PostOrdInvoicePost extends ActionHandlerEJB implements PostOrdInvoi ...@@ -2200,14 +2207,18 @@ public class PostOrdInvoicePost extends ActionHandlerEJB implements PostOrdInvoi
receivablesMap.put("cr_term", InvoiceHrdMap.get("cr_term")); receivablesMap.put("cr_term", InvoiceHrdMap.get("cr_term"));
receivablesMap.put("sales_pers", InvoiceHrdMap.get("sales_pers")); receivablesMap.put("sales_pers", InvoiceHrdMap.get("sales_pers"));
//receivablesMap.put("eff_date", InvoiceHrdMap.get("eff_date")); //receivablesMap.put("eff_date", InvoiceHrdMap.get("eff_date"));
receivablesMap.put("eff_date", new Timestamp(Timestamp.parse(InvoiceHrdMap.get("eff_date")))); // 02-dec-16 manoharan avoid deprecated
//receivablesMap.put("eff_date", new Timestamp(Timestamp.parse(InvoiceHrdMap.get("eff_date"))));
receivablesMap.put("eff_date", Timestamp.valueOf(InvoiceHrdMap.get("eff_date")));
receivablesMap.put("sales_pers__1", InvoiceHrdMap.get("sales_pers__1")); receivablesMap.put("sales_pers__1", InvoiceHrdMap.get("sales_pers__1"));
receivablesMap.put("sales_pers__2", InvoiceHrdMap.get("sales_pers__2")); receivablesMap.put("sales_pers__2", InvoiceHrdMap.get("sales_pers__2"));
receivablesMap.put("item_ser", InvoiceHrdMap.get("item_ser")); receivablesMap.put("item_ser", InvoiceHrdMap.get("item_ser"));
receivablesMap.put("line_no__ref", lsNo); receivablesMap.put("line_no__ref", lsNo);
receivablesMap.put("gp_no", InvoiceHrdMap.get("gp_no")); receivablesMap.put("gp_no", InvoiceHrdMap.get("gp_no"));
//receivablesMap.put("gp_date", InvoiceHrdMap.get("gp_date")); //receivablesMap.put("gp_date", InvoiceHrdMap.get("gp_date"));
receivablesMap.put("gp_date", new Timestamp(Timestamp.parse(InvoiceHrdMap.get("gp_date")))); // 02-dec-16 manoharan avoid deprecated
//receivablesMap.put("gp_date", new Timestamp(Timestamp.parse(InvoiceHrdMap.get("gp_date"))));
receivablesMap.put("gp_date", Timestamp.valueOf(InvoiceHrdMap.get("gp_date")));
receivablesMap.put("mrp_value","0"); receivablesMap.put("mrp_value","0");
...@@ -2344,8 +2355,12 @@ public class PostOrdInvoicePost extends ActionHandlerEJB implements PostOrdInvoi ...@@ -2344,8 +2355,12 @@ public class PostOrdInvoicePost extends ActionHandlerEJB implements PostOrdInvoi
// ldTranDt=Timestamp.valueOf(billDate); // ldTranDt=Timestamp.valueOf(billDate);
ldTranDt=Timestamp.valueOf(genericUtility.getValidDateString(billDate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0"); ldTranDt=Timestamp.valueOf(genericUtility.getValidDateString(billDate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
} }
// 02-dec-16 manoharan avoid deprecated
//liMonth=ldTranDt.getMonth();
Calendar cal = Calendar.getInstance();
cal.setTime(ldTranDt);
liMonth = cal.get(Calendar.MONTH);
liMonth=ldTranDt.getMonth();
if(liMonth==12) if(liMonth==12)
{ {
liMonth=1; liMonth=1;
......
...@@ -149,9 +149,9 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca ...@@ -149,9 +149,9 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
try try
{ {
//System.out.println("process starts................"); //System.out.println("process starts................");
conn = connDriver.getConnectDB("DriverITM"); //conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false); //conn.setAutoCommit(false);
//conn = getConnection() ; conn = getConnection() ;
sdf = new SimpleDateFormat(e12GenericUtility.getApplDateFormat()); sdf = new SimpleDateFormat(e12GenericUtility.getApplDateFormat());
timestamp = new Timestamp(System.currentTimeMillis()); timestamp = new Timestamp(System.currentTimeMillis());
......
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