Commit 311195c1 authored by dsawant's avatar dsawant

updated for set alloc qty


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96300 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c0f43ede
...@@ -62,7 +62,7 @@ public class DistIssWizPostSave extends ValidatorEJB implements DistIssWizPostSa ...@@ -62,7 +62,7 @@ public class DistIssWizPostSave extends ValidatorEJB implements DistIssWizPostSa
PreparedStatement pstmt = null,pstmt1 = null; PreparedStatement pstmt = null,pstmt1 = null;
String lotsl = "",siteCode=""; String lotsl = "",siteCode="";
boolean isLocalConn = false; boolean isLocalConn = false;
double quantity = 0,allQty=0; double quantity = 0,allQty=0,holdQty=0;
ResultSet rs = null,rs1 = null; ResultSet rs = null,rs1 = null;
double amount = 0,netAmount=0,discAmount=0,taxAmount=0,noArt = 0; //net_amt =amount+tax_amt-disc_amt double amount = 0,netAmount=0,discAmount=0,taxAmount=0,noArt = 0; //net_amt =amount+tax_amt-disc_amt
double grossWeight = 0 ,tareWeight = 0 , netWeight = 0; double grossWeight = 0 ,tareWeight = 0 , netWeight = 0;
...@@ -109,7 +109,7 @@ public class DistIssWizPostSave extends ValidatorEJB implements DistIssWizPostSa ...@@ -109,7 +109,7 @@ public class DistIssWizPostSave extends ValidatorEJB implements DistIssWizPostSa
pstmt1 = null; pstmt1 = null;
sql = "select ALLOC_QTY from stock WHERE site_code = ? AND LOT_SL = ? AND QUANTITY > 0"; sql = "select ALLOC_QTY,HOLD_QTY from stock WHERE site_code = ? AND LOT_SL = ? AND QUANTITY > 0";
pstmt1= conn.prepareStatement(sql); pstmt1= conn.prepareStatement(sql);
//System.out.println("Second sql ["+sql + "]"); //System.out.println("Second sql ["+sql + "]");
pstmt1.setString( 1, siteCode); pstmt1.setString( 1, siteCode);
...@@ -118,6 +118,7 @@ public class DistIssWizPostSave extends ValidatorEJB implements DistIssWizPostSa ...@@ -118,6 +118,7 @@ public class DistIssWizPostSave extends ValidatorEJB implements DistIssWizPostSa
if(rs1.next()) if(rs1.next())
{ {
allQty = rs1.getDouble(1); allQty = rs1.getDouble(1);
holdQty = rs1.getDouble(2);
} }
rs1.close(); rs1.close();
rs1 = null; rs1 = null;
...@@ -127,6 +128,7 @@ public class DistIssWizPostSave extends ValidatorEJB implements DistIssWizPostSa ...@@ -127,6 +128,7 @@ public class DistIssWizPostSave extends ValidatorEJB implements DistIssWizPostSa
if(allQty > 0) if(allQty > 0)
{ {
quantity = allQty + quantity; quantity = allQty + quantity;
quantity = quantity - holdQty;
} }
sql = "UPDATE stock SET ALLOC_QTY = ? WHERE site_code = ? AND LOT_SL = ? AND QUANTITY > 0"; sql = "UPDATE stock SET ALLOC_QTY = ? WHERE site_code = ? AND LOT_SL = ? AND QUANTITY > 0";
......
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