Commit ae72385e authored by pchavan's avatar pchavan

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@204150 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9334bf5f
......@@ -1863,7 +1863,7 @@ public class PostOrdDespatchGen
if(rs3.next())
{
stkOpt = rs3.getString("stk_opt");
}
rs3.close();
rs3 = null;
......@@ -1945,7 +1945,7 @@ public class PostOrdDespatchGen
isDetailExist=true;
pstmtdDet.close();
pstmtdDet = null;//[pstmtdDet closed and nulled by Pavan R]
*/ /*insertCntDet = pstmt.executeUpdate();
*/ /*insertCntDet = pstmt.executeUpdate();
pstmt.close();
pstmt=null;
System.out.println("Despatch Detail Count===="+insertCntDet);*/
......@@ -1953,7 +1953,7 @@ public class PostOrdDespatchGen
xmlBuff.append("<Detail2 dbID=\"\" domID=\""+Integer.parseInt(lineNumber.trim())+"\" objContext=\"2\" objName=\"despatch\">");
xmlBuff.append("<attribute pkNames=\"\" selected=\"N\" status=\"N\" updateFlag=\"A\"/>");
xmlBuff.append("<desp_id/>");
xmlBuff.append("<line_no><![CDATA[" + lineNumber + "]]></line_no>");
xmlBuff.append("<sord_no><![CDATA[" + checkNull(sordDetMap.get("sord_no").toString()) + "]]></sord_no>");
xmlBuff.append("<line_no__sord><![CDATA[" + checkNull(sordDetMap.get("line_no__sord").toString()) + "]]></line_no__sord>");
......@@ -1995,12 +1995,12 @@ public class PostOrdDespatchGen
xmlBuff.append("<conv__qty_stduom><![CDATA[" + (Double)sordDetMap.get("conv__qty_stduom") + "]]></conv__qty_stduom>");
xmlBuff.append("<unit__std><![CDATA[" + sordDetMap.get("unit__std").toString() + "]]></unit__std>");
xmlBuff.append("<unit><![CDATA[" + sordDetMap.get("unit").toString() + "]]></unit>");
xmlBuff.append("<quantity__stduom><![CDATA[" + (Double)sordDetMap.get("quantity__stduom") + "]]></quantity__stduom>");
xmlBuff.append("<quantity_real><![CDATA[" + (Double)sordDetMap.get("quantity_real") + "]]></quantity_real>");
xmlBuff.append("<rate__stduom><![CDATA[" + (Double)sordDetMap.get("rate__stduom") + "]]></rate__stduom>");
xmlBuff.append("<no_art><![CDATA[" + (Double)sordDetMap.get("no_art") + "]]></no_art>");
xmlBuff.append("<site_code><![CDATA[" + sordDetMap.get("site_code").toString() + "]]></site_code>");
xmlBuff.append("<rate__clg><![CDATA[" + (Double)sordDetMap.get("rate__clg") + "]]></rate__clg>");
xmlBuff.append("<disc_amt><![CDATA[" + (Double)sordDetMap.get("disc_amt") + "]]></disc_amt>");
......@@ -2010,7 +2010,7 @@ public class PostOrdDespatchGen
{
xmlBuff.append("<retest_date><![CDATA[" + sdf.format((Date)sordDetMap.get("retest_date")) + "]]></retest_date>");
}else {
xmlBuff.append("<retest_date><![CDATA[" + "" + "]]></retest_date>");
xmlBuff.append("<retest_date><![CDATA[" + "" + "]]></retest_date>");
}
xmlBuff.append("<conf_diff_amt><![CDATA[" + (Double)sordDetMap.get("conf_diff_amt") + "]]></conf_diff_amt>");
xmlBuff.append("<conv__rtuom_stduom><![CDATA[" + (Double)sordDetMap.get("conv__rtuom_stduom") + "]]></conv__rtuom_stduom>");
......@@ -2019,75 +2019,77 @@ public class PostOrdDespatchGen
xmlBuff.append("<tax_chap><![CDATA[" + sordDetMap.get("tax_chap").toString() + "]]></tax_chap>");
xmlBuff.append("<tax_env><![CDATA[" + sordDetMap.get("tax_env").toString() + "]]></tax_env>");
xmlBuff.append("<tax_amt><![CDATA[" + "0" + "]]></tax_amt>");
xmlBuff.append("</Detail2>");
isDetailExist = true;
//Pavan R [to deallocate quantity in invalloc_trace for S-ORD] start
invAllocTraceMap = new HashMap();
invBean = new InvAllocTraceBean();
invAllocTraceMap.put("ref_ser","S-ORD");
invAllocTraceMap.put("ref_id", checkNull(sordDetMap.get("sord_no").toString()));
invAllocTraceMap.put("ref_line", checkNull(sordDetMap.get("line_no__sord").toString()));
invAllocTraceMap.put("site_code", siteCode);
invAllocTraceMap.put("item_code", checkNull(sordDetMap.get("item_code").toString()));
invAllocTraceMap.put("loc_code", checkNull(sordDetMap.get("loc_code").toString()));
invAllocTraceMap.put("lot_no", checkNull(sordDetMap.get("lot_no").toString()));
invAllocTraceMap.put("lot_sl", checkNull(sordDetMap.get("lot_sl").toString()));
invAllocTraceMap.put("alloc_qty",(Double)sordDetMap.get("quantity__stduom") * -1);
invAllocTraceMap.put("chg_user",chgUser);
invAllocTraceMap.put("chg_term",chgTerm);
invAllocTraceMap.put("chg_win","W_SORDER");
//added by nandkumar gadkari on 17/04/19-------start=----------
String logMsg=checkNull(sordDetMap.get("sord_no").toString()) + " " + checkNull(sordDetMap.get("exp_lev").toString()) +" "+ checkNull(sordDetMap.get("line_no__sord").toString()) + " "+"Deallocation of stock from PostOrdDespatchGen";
invAllocTraceMap.put("alloc_ref",logMsg);
//added by nandkumar gadkari on 17/04/19-------end=----------
errString = invBean.updateInvallocTrace(invAllocTraceMap,conn);
System.out.println("deallocating.......");
if(errString != null && errString.trim().length() > 0)
{
errString = itmDBAccessEJB.getErrorString("VTSTKNOAVL",errString,"","",conn);
return errString;
}else //Pavan R 10apr19[to deallocate in sordalloc and sorditem] start
if(!"0".equals(stkOpt)) //Added By PriyankaC on 22July2019.
{
invAllocTraceMap = new HashMap();
invBean = new InvAllocTraceBean();
invAllocTraceMap.put("ref_ser","S-ORD");
invAllocTraceMap.put("ref_id", checkNull(sordDetMap.get("sord_no").toString()));
invAllocTraceMap.put("ref_line", checkNull(sordDetMap.get("line_no__sord").toString()));
invAllocTraceMap.put("site_code", siteCode);
invAllocTraceMap.put("item_code", checkNull(sordDetMap.get("item_code").toString()));
invAllocTraceMap.put("loc_code", checkNull(sordDetMap.get("loc_code").toString()));
invAllocTraceMap.put("lot_no", checkNull(sordDetMap.get("lot_no").toString()));
invAllocTraceMap.put("lot_sl", checkNull(sordDetMap.get("lot_sl").toString()));
invAllocTraceMap.put("alloc_qty",(Double)sordDetMap.get("quantity__stduom") * -1);
invAllocTraceMap.put("chg_user",chgUser);
invAllocTraceMap.put("chg_term",chgTerm);
invAllocTraceMap.put("chg_win","W_SORDER");
//added by nandkumar gadkari on 17/04/19-------start=----------
String allocRef="";
sql = "select alloc_ref from stock where item_code= ? and site_code= ? and lot_no= ? and loc_code=? and lot_sl=? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,checkNull(sordDetMap.get("item_code").toString()));
pstmt.setString(2,siteCode);
pstmt.setString(3,checkNull(sordDetMap.get("lot_no").toString()));
pstmt.setString(4,checkNull(sordDetMap.get("loc_code").toString()));
pstmt.setString(5,checkNull(sordDetMap.get("lot_sl").toString()));
rs = pstmt.executeQuery();
if(rs.next())
{
allocRef = rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("allocRef["+allocRef+"]");
System.out.println("allocReflog["+logMsg+"]");
if(!allocRef.equalsIgnoreCase(logMsg))
String logMsg=checkNull(sordDetMap.get("sord_no").toString()) + " " + checkNull(sordDetMap.get("exp_lev").toString()) +" "+ checkNull(sordDetMap.get("line_no__sord").toString()) + " "+"Deallocation of stock from PostOrdDespatchGen";
invAllocTraceMap.put("alloc_ref",logMsg);
//added by nandkumar gadkari on 17/04/19-------end=----------
errString = invBean.updateInvallocTrace(invAllocTraceMap,conn);
System.out.println("deallocating.......");
if(errString != null && errString.trim().length() > 0)
{
errString = itmDBAccessEJB.getErrorString("VTSTKNOAVL",errString,"","",conn);
return errString;
}
//added by nandkumar gadkari on 17/04/19-------end=----------
double qtyAlloc = 0;
double qtyStduom = (Double)sordDetMap.get("quantity__stduom");
int updateCnt = 0;
sql = "SELECT QTY_ALLOC AS COUNT FROM SORDALLOC "
+"WHERE SALE_ORDER = ? "
+"AND LINE_NO = ? "
+"AND EXP_LEV = ? "
+"AND ITEM_CODE__ORD = ? "
+"AND ITEM_CODE = ? "
+"AND LOT_NO = ? "
+"AND LOT_SL = ? "
+"AND LOC_CODE = ? ";
}else //Pavan R 10apr19[to deallocate in sordalloc and sorditem] start
{
//added by nandkumar gadkari on 17/04/19-------start=----------
String allocRef="";
sql = "select alloc_ref from stock where item_code= ? and site_code= ? and lot_no= ? and loc_code=? and lot_sl=? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,checkNull(sordDetMap.get("item_code").toString()));
pstmt.setString(2,siteCode);
pstmt.setString(3,checkNull(sordDetMap.get("lot_no").toString()));
pstmt.setString(4,checkNull(sordDetMap.get("loc_code").toString()));
pstmt.setString(5,checkNull(sordDetMap.get("lot_sl").toString()));
rs = pstmt.executeQuery();
if(rs.next())
{
allocRef = rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("allocRef["+allocRef+"]");
System.out.println("allocReflog["+logMsg+"]");
if(!allocRef.equalsIgnoreCase(logMsg))
{
errString = itmDBAccessEJB.getErrorString("VTSTKNOAVL",errString,"","",conn);
return errString;
}
//added by nandkumar gadkari on 17/04/19-------end=----------
double qtyAlloc = 0;
double qtyStduom = (Double)sordDetMap.get("quantity__stduom");
int updateCnt = 0;
sql = "SELECT QTY_ALLOC AS COUNT FROM SORDALLOC "
+"WHERE SALE_ORDER = ? "
+"AND LINE_NO = ? "
+"AND EXP_LEV = ? "
+"AND ITEM_CODE__ORD = ? "
+"AND ITEM_CODE = ? "
+"AND LOT_NO = ? "
+"AND LOT_SL = ? "
+"AND LOC_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,checkNull(sordDetMap.get("sord_no").toString()));
pstmt.setString(2,checkNull(sordDetMap.get("line_no__sord").toString()));
......@@ -2114,13 +2116,13 @@ public class PostOrdDespatchGen
if (qtyAlloc - qtyStduom <= 0)
{
sqlSord = "DELETE FROM SORDALLOC WHERE SALE_ORDER = ? "
+"AND LINE_NO = ? "
+"AND EXP_LEV = ? "
+"AND ITEM_CODE__ORD = ? "
+"AND ITEM_CODE = ? "
+"AND LOT_NO = ? "
+"AND LOT_SL = ? "
+"AND LOC_CODE = ? ";
+"AND LINE_NO = ? "
+"AND EXP_LEV = ? "
+"AND ITEM_CODE__ORD = ? "
+"AND ITEM_CODE = ? "
+"AND LOT_NO = ? "
+"AND LOT_SL = ? "
+"AND LOC_CODE = ? ";
System.out.println("Postord Delete sql sqlSord :"+sqlSord);
pstmt = conn.prepareStatement(sqlSord);
pstmt.setString(1,checkNull(sordDetMap.get("sord_no").toString()));
......@@ -2139,14 +2141,14 @@ public class PostOrdDespatchGen
else
{
sqlSord = "UPDATE SORDALLOC SET QTY_ALLOC = QTY_ALLOC - ? "
+"WHERE SALE_ORDER = ? "
+"AND LINE_NO = ? "
+"AND EXP_LEV = ? "
+"AND ITEM_CODE__ORD = ? "
+"AND ITEM_CODE = ? "
+"AND LOT_NO = ? "
+"AND LOT_SL = ? "
+"AND LOC_CODE = ? ";
+"WHERE SALE_ORDER = ? "
+"AND LINE_NO = ? "
+"AND EXP_LEV = ? "
+"AND ITEM_CODE__ORD = ? "
+"AND ITEM_CODE = ? "
+"AND LOT_NO = ? "
+"AND LOT_SL = ? "
+"AND LOC_CODE = ? ";
System.out.println("Postord Update sql sqlSord :"+sqlSord);
pstmt = conn.prepareStatement(sqlSord);
pstmt.setDouble(1,qtyStduom);
......@@ -2164,9 +2166,9 @@ public class PostOrdDespatchGen
System.out.println("Postord Updated the no of records are : updateCnt :"+updateCnt);
}
sqlSord = "UPDATE SORDITEM SET QTY_ALLOC = QTY_ALLOC - ? "
+"WHERE SALE_ORDER = ? "
+"AND LINE_NO = ? "
+"AND EXP_LEV = ? ";
+"WHERE SALE_ORDER = ? "
+"AND LINE_NO = ? "
+"AND EXP_LEV = ? ";
System.out.println("Postord Update sql sqlSord :"+sqlSord);
pstmt = conn.prepareStatement(sqlSord);
pstmt.setDouble(1,qtyStduom);
......@@ -2178,8 +2180,9 @@ public class PostOrdDespatchGen
pstmt = null;
System.out.println("Postord Updated the no of records : updateCnt :"+updateCnt);
}
}
//Pavan R 10apr19 end
}
//Pavan R 10apr19 end
}
}
}
xmlBuff.append("</Header0>");
......
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