Commit 843162c0 authored by caluka's avatar caluka

Error when the stock is on hold and QC order is open


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97102 ce508802-f39f-4f6c-b175-0d175dae99d5
parent a3bd01d3
......@@ -79,6 +79,8 @@ public class StockUpdate
Timestamp mtoday = null;
Timestamp tempTestDate = null;
double qtyPerArtStk = 0d,qtyStk=0d;
String quarantineLock="",lockCode="";
ArrayList< String> lockCodeList= new ArrayList<String>();
try
{
DistCommon distCommon = new DistCommon();
......@@ -498,22 +500,31 @@ public class StockUpdate
}
System.out.println("holdLock========="+holdLock);
//Start added by chandrashekar on 08-jan-2015
quarantineLock = distCommon.getDisparams("999999", "QUARNTINE_LOCKCODE", conn);
System.out.println("quarantineLock:::::" + quarantineLock);
if (quarantineLock == null || "NULLFOUND".equalsIgnoreCase(quarantineLock) || quarantineLock.trim().length() == 0)
{
errString = "VTQUARLOCK";
errString = itmDBAccessEJB.getErrorString("",errString,"","",conn);
return errString;
}
//End added by chandrashekar on 08-jan-2015
if(holdLock==null||holdLock.trim().length()==0)
{
holdLock="N";
holdLock="N";
}
if(holdLock.equals("N") && cntHold==0)
//if(holdLock.equals("N") && !(this.tranType.equalsIgnoreCase("R")) )
{
sql="select count(1)From inv_hold a, inv_hold_det b Where a.tran_id = b.tran_id And b.item_code = ? " +
//if(holdLock.equals("N") && !(this.tranType.equalsIgnoreCase("R")) )
{
sql="select count(1) as count ,a.lock_code as lock_code From inv_hold a, inv_hold_det b Where a.tran_id = b.tran_id And b.item_code = ? " +
"And (b.site_code = ? or b.site_code is null ) " +
"And (b.loc_code = ? or b.loc_code is null ) " +
"And (b.lot_no = ? or b.lot_no is null ) " +
"And (b.lot_sl = ? or b.lot_sl is null )" +
"And (b.line_no_sl = 0 or b.line_no_sl is null)" +
"And a.confirmed='Y' And b.hold_status ='H'";
"And a.confirmed='Y' And b.hold_status ='H' group by a.lock_code";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,this.itemCode);
pstmt.setString(2,this.siteCode);
......@@ -522,21 +533,37 @@ public class StockUpdate
pstmt.setString(5,this.lotSl);
rs = pstmt.executeQuery();
if(rs.next())
while(rs.next())
{
cnt1 = rs.getInt(1);
//cnt1 = rs.getInt(1);
cnt1 = rs.getInt("count");
lockCode =rs.getString("lock_code") == null ? " " : rs.getString("lock_code").trim();
lockCodeList.add(lockCode);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(cnt1>0)
//Start added by chandrashekar on 08-jan-2015
System.out.println("locCodeList:::["+lockCodeList+"]size:"+lockCodeList.size());
for(int i = 0; i < lockCodeList.size() ; i++)
{
errString = "VTSTKHOLD";
errString = itmDBAccessEJB.getErrorString("",errString,"","",conn);
return errString;
lockCode=lockCodeList.get(i);
if (lockCode.trim().length() > 0 && !("NULLFOUND".equalsIgnoreCase(quarantineLock)) && quarantineLock.trim().length() > 0 )
{
if(!(lockCode.equalsIgnoreCase(quarantineLock.trim())))
{
if(cnt1>0)
{
errString = "VTSTKHOLD";
errString = itmDBAccessEJB.getErrorString("",errString,"","",conn);
return errString;
}
}
}
}
//End added by chandrashekar on 08-jan-2015
/*if(cnt1>0)
{
cnt1=0;
......@@ -573,7 +600,7 @@ public class StockUpdate
}
}*/
}
}
if((!this.tranType.equalsIgnoreCase("R")) && (!this.tranType.equalsIgnoreCase("D")))
{
if(mbefQty < this.qtyStduom)
......
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