Commit 3656237f authored by prane's avatar prane

Stock mismatch - error trapping and validation of stock for existence during issue

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@199517 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e5979a52
......@@ -418,6 +418,7 @@ public class StockUpdate
if (this.tranType.equalsIgnoreCase("I") || this.tranType.equalsIgnoreCase("ID") )
{
boolean stkcheck = false;
sql =" select rate from stock where item_code = '"+this.itemCode+"'"
+" and site_code = '"+this.siteCode+"'"
+" and loc_code = '"+this.locationCode+"'"
......@@ -428,10 +429,16 @@ public class StockUpdate
rs = pstmt.executeQuery();
if(rs.next())
{
stkcheck = true;
this.rate = rs.getDouble(1);
}
pstmt.close();
rs.close();
if(!stkcheck)
{
errString = itmDBAccessEJB.getErrorString("","VSTOCKER","","",conn);
return errString;
}
///////////////////
errString = calcWeights(conn);
if(errString != null && errString.trim().length() >0){
......@@ -469,6 +476,13 @@ public class StockUpdate
mbefQty=rs.getDouble(1);
minvStat=rs.getString(2);
}
else
{
rs.close();
pstmt.close();
errString = itmDBAccessEJB.getErrorString("","VTLCKERR","","",conn);
return errString;
}
pstmt.close();
rs.close();
if (this.tranType.equalsIgnoreCase("R"))
......
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