Commit 5c8ddc93 authored by manohar's avatar manohar

Bug fixing despatchdet line_no selected without leading spaces, corrected also...

Bug fixing despatchdet line_no selected without leading spaces, corrected also sorditem update taken out of sordalloc update block


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96785 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f2357b4b
......@@ -103,7 +103,7 @@ public class DespatchPos extends ValidatorEJB implements DespatchPosLocal, Despa
Node currDetail = null;
int detailListLength = 0,currDetailListLength = 0;
String qtyStduomStr = "",updateStatus = "",nodeName = "",tranId = "";
Connection conn1 = null;
try
{
......@@ -128,7 +128,7 @@ public class DespatchPos extends ValidatorEJB implements DespatchPosLocal, Despa
tranId = GenericUtility.getInstance().getColumnValueFromNode("desp_id",hdrDom.item(0));
System.out.println("Site Code :: "+siteCode);
System.out.println("Tran ID :: "+tranId);
System.out.println("10/11/14 manohar executepostSaveRec DomID ["+domID+"] Update Status ["+updateStatus + "]");
currDetail = getCurrentDetailFromDom(dom,domID);
updateStatus = getCurrentUpdateFlag(currDetail);
System.out.println("DomID :: "+domID+"\n Update Status ::"+updateStatus);
......@@ -186,6 +186,10 @@ public class DespatchPos extends ValidatorEJB implements DespatchPosLocal, Despa
pstmt.clearParameters();
*///End Commented Gulzar - 12/11/07
//Added By Gulzar - 12/11/07
lineNo = (" " + lineNo) ;
lineNo = lineNo.substring(lineNo.length()-3);
sql = "UPDATE DESPATCHDET SET COST_RATE = ? "
+"WHERE DESP_ID = '"+tranId+"' "
+"AND ITEM_CODE = '"+itemCode+"' "
......@@ -420,8 +424,8 @@ public class DespatchPos extends ValidatorEJB implements DespatchPosLocal, Despa
}
rs = null;
////////
conn1 = getConnection();
//Statement stmt2 = conn1.createStatement();
//conn = getConnection();
//Statement stmt2 = conn.createStatement();
double oldQty = 0,qtyUpdate = 0;
if(tranIdSOAlloc != null && tranIdSOAlloc.trim().length() > 0){
sql = "SELECT QUANTITY__STDUOM FROM DESPATCHDET WHERE DESP_ID = '"+tranId+"' AND LINE_NO = '"+lineNo+"'";
......@@ -431,8 +435,8 @@ public class DespatchPos extends ValidatorEJB implements DespatchPosLocal, Despa
}
//stmt2.close();
//stmt2 = null;
conn1.close();
conn1 = null;
//conn.close();
//conn = null;
rs = null;
//////////////
if(deAllocQty + qtyStduom - oldQty > allocQty){
......
......@@ -144,7 +144,7 @@ public class DespatchPrs extends ValidatorEJB implements DespatchPrsLocal, Despa
currDetail = getCurrentDetailFromDom(dom,domID);
updateStatus = getCurrentUpdateFlag(currDetail);
System.out.println("manohar executepreSaveRec DomID ["+domID+"] Update Status ["+updateStatus + "]");
System.out.println("manohar 10/11/14 executepreSaveRec DomID ["+domID+"] Update Status ["+updateStatus + "]");
//01/11/2012 manoj sharma for deallocation
int length=0;
......@@ -406,6 +406,10 @@ public class DespatchPrs extends ValidatorEJB implements DespatchPrsLocal, Despa
{
//Commented And Changes Below - Gulzar 10/05/07
//sql = "SELECT QUANTITY__STDUOM FROM DESPATCHDET WHERE DESP_ID = '"+tranId+"' AND LINE_NO = '"+lineNo+"'"; //Gulzar - 10/05/07
lineNo = (" " + lineNo) ;
lineNo = lineNo.substring(lineNo.length()-3);
sql = "SELECT LINE_NO__SORD, EXP_LEV, ITEM_CODE__ORD, ITEM_CODE, LOC_CODE, LOT_NO, LOT_SL, QUANTITY__STDUOM "
+"FROM DESPATCHDET WHERE DESP_ID = '"+tranId+"' AND LINE_NO = '"+lineNo+"'";
System.out.println("SQL ::"+sql);
......@@ -502,25 +506,25 @@ public class DespatchPrs extends ValidatorEJB implements DespatchPrsLocal, Despa
pstmt = null;
System.out.println("Updated the no of records are : updateCnt :"+updateCnt);
}
sqlSordItem = "UPDATE SORDITEM SET QTY_ALLOC = QTY_ALLOC - ? "
+"WHERE SALE_ORDER = ? "
+"AND LINE_NO = ? "
+"AND EXP_LEV = ? ";
System.out.println("Update sql sqlSordItem :"+sqlSordItem);
pstmt = conn.prepareStatement(sqlSordItem);
pstmt.setDouble(1,qtyStduom);
pstmt.setString(2,sordNo);
pstmt.setString(3,lineNoSord);
pstmt.setString(4,expLev);
updateCnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println("Updated the no of records : updateCnt :"+updateCnt);
}
rs1.close();
rs1 = null;
stmt1.close();
stmt1 = null;
sqlSordItem = "UPDATE SORDITEM SET QTY_ALLOC = QTY_ALLOC - ? "
+"WHERE SALE_ORDER = ? "
+"AND LINE_NO = ? "
+"AND EXP_LEV = ? ";
System.out.println("Update sql sqlSordItem :"+sqlSordItem);
pstmt = conn.prepareStatement(sqlSordItem);
pstmt.setDouble(1,qtyStduom);
pstmt.setString(2,sordNo);
pstmt.setString(3,lineNoSord);
pstmt.setString(4,expLev);
updateCnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println("Updated the no of records : updateCnt :"+updateCnt);
}
rs.close();
......
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