Commit 4e3fd3e3 authored by manohar's avatar manohar

In case of stock transfer not check pending QC


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93820 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 8616d515
......@@ -175,55 +175,6 @@ public class StockUpdate
rs.close();
}
if ((!this.tranSer.equalsIgnoreCase("QC-ORD")) && (!this.tranSer.equalsIgnoreCase("I-PKR")) && (!this.tranSer.equalsIgnoreCase("I-PKI")) && (!this.tranType.equalsIgnoreCase("R")) && (!this.tranSer.equalsIgnoreCase("S-ISS")) && (!this.tranSer.equalsIgnoreCase("QC-TRF") )&& (!this.tranSer.equalsIgnoreCase("PR-AMD")) && (!this.tranSer.equalsIgnoreCase("W-QCS")) )
{
sql=" SELECT COUNT(*) FROM QC_ORDER WHERE SITE_CODE = '"+this.siteCode+"'"
+"AND LOC_CODE = '"+this.locationCode+"'"
+"AND ITEM_CODE = '"+this.itemCode+"'"
+"AND LOT_NO = '"+this.lotNo+"'"
+"AND LOT_SL = '"+this.lotSl+"'"
+"AND STATUS <> 'C'";
System.out.println("Query :::- ["+sql+"]");
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next()){
count = rs.getInt(1);
}
System.out.println("Record from QC_ORDER:::- ["+count+"]");
if(count == 0)
{
sql =" SELECT COUNT(*) FROM QC_ORDER WHERE SITE_CODE = '"+this.siteCode+"'"
+" AND LOC_CODE = '"+this.locationCode+"'"
+"AND ITEM_CODE = '"+this.itemCode+"'"
+"AND LOT_NO = '"+this.lotNo+"'"
+"AND LOT_SL IS NULL "
+" AND STATUS <> 'C' ";
System.out.println("Query :::- ["+sql+"]");
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
pstmt.close();
rs.close();
System.out.println("Record from QC_ORDER:::- ["+count+"]");
if(count > 0)
{
errString = "VTUNCFQC";
errString = itmDBAccessEJB.getErrorString("",errString,"","",conn);
return errString;
}
}else{
errString = "VTUNCFQC";
errString = itmDBAccessEJB.getErrorString("",errString,"","",conn);
return errString;
}
pstmt.close();
rs.close();
}
sql =" SELECT COST_RATE,UNIT,SHELF_LIFE,(CASE WHEN STK_OPT IS NULL THEN '0' ELSE STK_OPT END ),"
+" (CASE WHEN QC_REQD IS NULL THEN 'N' ELSE QC_REQD END ) FROM ITEM WHERE ITEM_CODE = '"+this.itemCode+"'";
System.out.println("Query ::- ["+sql+"]");
......@@ -348,6 +299,65 @@ public class StockUpdate
{
this.lotSl = " ";
}
if ((!this.tranSer.equalsIgnoreCase("QC-ORD")) && (!this.tranSer.equalsIgnoreCase("I-PKR")) && (!this.tranSer.equalsIgnoreCase("I-PKI")) && (!this.tranType.equalsIgnoreCase("R")) && (!this.tranSer.equalsIgnoreCase("S-ISS")) && (!this.tranSer.equalsIgnoreCase("QC-TRF") )&& (!this.tranSer.equalsIgnoreCase("PR-AMD")) && (!this.tranSer.equalsIgnoreCase("W-QCS")) )
{
sql=" SELECT COUNT(*) FROM QC_ORDER WHERE SITE_CODE = '"+this.siteCode+"'"
+"AND LOC_CODE = '"+this.locationCode+"'"
+"AND ITEM_CODE = '"+this.itemCode+"'"
+"AND LOT_NO = '"+this.lotNo+"'"
+"AND LOT_SL = '"+this.lotSl+"'"
+"AND STATUS <> 'C'";
System.out.println("Query :::- ["+sql+"]");
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next()){
count = rs.getInt(1);
}
pstmt.close();
rs.close();
System.out.println("Record from QC_ORDER:::- ["+count+"]");
if(count == 0)
{
sql =" SELECT COUNT(*) FROM QC_ORDER WHERE SITE_CODE = '"+this.siteCode+"'"
+" AND LOC_CODE = '"+this.locationCode+"'"
+"AND ITEM_CODE = '"+this.itemCode+"'"
+"AND LOT_NO = '"+this.lotNo+"'"
+"AND LOT_SL IS NULL "
+" AND STATUS <> 'C' ";
System.out.println("Query :::- ["+sql+"]");
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
pstmt.close();
rs.close();
System.out.println("Record from QC_ORDER:::- ["+count+"]");
}
/* //Commented n Added by Jasmina-05/05/08-DI89SUN004,Script for updating loc_code & lot_sl as null if qc order is found during stock transfer
//Error Uncommented by Jasmina 08/07/08 -DI89SUN004,
//Error While be bypass if transer = 'XFRX' and trantype = 'ID' i.e Stock transfer and quantity < 0 i.e Not Receipt
if s_updatestock.transer = 'XFRX' and s_updatestock.trantype = 'ID' and s_updatestock.quantity < 0 Then
else
populateerror(9999,'populateerror')
ls_errcode = 'VTUNCFQC'
ls_errcode = gf_error_location(ls_errcode)
return ls_errcode
end if
//Error Uncommented end by Jasmina 08/07/08 -DI89SUN004
*/
// 24/10/13 manoharan added this condition missing from PB source
if( (count > 0) && !("XFRX".equalsIgnoreCase(this.tranSer) && "ID".equalsIgnoreCase(this.tranType) && meffQty < 0) )
{
errString = "VTUNCFQC";
errString = itmDBAccessEJB.getErrorString("",errString,"","",conn);
return errString;
}
}
if (this.tranType.equalsIgnoreCase("I") || this.tranType.equalsIgnoreCase("ID") )
{
sql =" select rate from stock where item_code = '"+this.itemCode+"'"
......
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