Commit a2b24c44 authored by manohar's avatar manohar

sorder_scheme, sorderdet_scheme update made conditional as was taking very long time unnecessarily


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@104072 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 076fbec7
......@@ -1066,9 +1066,23 @@ public class PostOrdDespatchGen
tempMapSord.put("rate__std", rateStdum);
sql="select sum(quantity * rate) as amount from sorddet where sale_order = ? ";
pstmt1=conn.prepareStatement(sql);
pstmt1.setString(1, saleOrder);
rs1=pstmt1.executeQuery();
if(rs1.next())
{
totAmount = rs1.getdouble("amount");
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
if (totAmount > 0)
{
CalcSchemeAmt calcSchemeAmt= new CalcSchemeAmt();
calcSchemeAmt.updateAmt(saleOrder, conn);
}
sql="select item_type, unit__netwt, unit__rate from item where item_code = ? ";
......
......@@ -1605,9 +1605,9 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
String rate="",quantity_real="",quantity_inv="",invoice_id="",no_art="",rate__clg="",desp_rate__stduom="",disc_amt="",cust_item__ref="";
String disc_schem_billback_amt="",disc_schem_offinv_amt="",retString="";
double totalCommSp1=0.0,totalCommSp2=0.0,totalCommSp3=0.0,totalCommAmt=0.0;
double lc_desp_std_rate=0.0;
PreparedStatement pstmt=null;
ResultSet rs=null;
double lc_desp_std_rate=0.0,totAmount = 0;
PreparedStatement pstmt=null, pstmt1 = null;
ResultSet rs=null, rs1 = null;
String beanMapKey="",lsLineType="";
ArrayList<Object> mainArrayList= new ArrayList<Object>();
HashMap commissionMap = null;
......@@ -1737,9 +1737,24 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
/*System.out.println("Detal map Size::::::::::::::"+invTraceMap.size());
System.out.println("Map Values :::::::::::::::::::"+invTraceMap);*/
sql="select sum(quantity * rate) as amount from sorddet where sale_order = ? ";
pstmt1=conn.prepareStatement(sql);
pstmt1.setString(1, saleOrder);
rs1=pstmt1.executeQuery();
if(rs1.next())
{
totAmount = rs1.getdouble("amount");
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
if (totAmount > 0)
{
CalcSchemeAmt calcSchemeAmt=new CalcSchemeAmt();
calcSchemeAmt.updateAmt(rs.getString("sord_no"), conn);
}
lsAcctSchemedet=getLsAcctSchemedet(rs.getString("sord_no"),rs.getString("line_no__sord"),conn);
invTraceMap.put("acc_code__item", lsAcctSchemedet);
......
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