Commit 94fa4a91 authored by dsawant's avatar dsawant

updated for new validation of alloc qty


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96273 ce508802-f39f-4f6c-b175-0d175dae99d5
parent fd5242d3
...@@ -50,7 +50,7 @@ public class DissIssuePosSave extends ValidatorEJB implements DissIssuePosSave ...@@ -50,7 +50,7 @@ public class DissIssuePosSave extends ValidatorEJB implements DissIssuePosSave
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
String lotsl = "",siteCode=""; String lotsl = "",siteCode="";
boolean isLocalConn = false; boolean isLocalConn = false;
double quantity = 0; double quantity = 0,allQty=0;
ResultSet rs = null; ResultSet rs = 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;
...@@ -94,7 +94,28 @@ public class DissIssuePosSave extends ValidatorEJB implements DissIssuePosSave ...@@ -94,7 +94,28 @@ public class DissIssuePosSave extends ValidatorEJB implements DissIssuePosSave
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
sql = "UPDATE stock SET ALLOC_QTY = ? WHERE site_code = ? AND LOT_SL = ? AND QUANTITY > 0;";
sql = "select ALLOC_QTY from stock WHERE site_code = ? AND LOT_SL = ? AND QUANTITY > 0";
pstmt= conn.prepareStatement(sql);
//System.out.println("Second sql ["+sql + "]");
pstmt.setString( 1, siteCode);
pstmt.setString( 2, lotsl);
rs = pstmt.executeQuery();
if(rs.next())
{
allQty = rs.getDouble(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(allQty > 0)
{
quantity = allQty + quantity;
}
sql = "UPDATE stock SET ALLOC_QTY = ? WHERE site_code = ? AND LOT_SL = ? AND QUANTITY > 0";
pstmt= conn.prepareStatement(sql); pstmt= conn.prepareStatement(sql);
//System.out.println("First sql ["+ sql + "] tranId [" + tranId + "]"); //System.out.println("First sql ["+ sql + "] tranId [" + tranId + "]");
pstmt.setDouble( 1, quantity); pstmt.setDouble( 1, quantity);
......
...@@ -117,7 +117,7 @@ public class DistIssWiz extends ValidatorEJB implements DistIssWizLocal, DistIss ...@@ -117,7 +117,7 @@ public class DistIssWiz extends ValidatorEJB implements DistIssWizLocal, DistIss
PreparedStatement pstmt = null ; PreparedStatement pstmt = null ;
ResultSet rs = null; ResultSet rs = null;
String sql = "",locCode ="",invstat="",aval="",avalyn=""; String sql = "",locCode ="",invstat="",aval="",avalyn="";
double qtyConf=0,qtyShip=0,totQty=0,detquantity=0,stkquantity=0,quantity=0,totquantity=0,dodetquantity=0; double qtyConf=0,qtyShip=0,totQty=0,detquantity=0,stkquantity=0,quantity=0,totquantity=0,dodetquantity=0,allQty=0;
String squantity="",distOrder = "",itemCode="",confirmed="",tranId="",siteCode="",lotSl="",addUser="",tranCode="",siteCodeDlv=""; String squantity="",distOrder = "",itemCode="",confirmed="",tranId="",siteCode="",lotSl="",addUser="",tranCode="",siteCodeDlv="";
try { try {
...@@ -522,6 +522,33 @@ public class DistIssWiz extends ValidatorEJB implements DistIssWizLocal, DistIss ...@@ -522,6 +522,33 @@ public class DistIssWiz extends ValidatorEJB implements DistIssWizLocal, DistIss
errString = getErrorString("quantity",errCode,userId); errString = getErrorString("quantity",errCode,userId);
break; break;
} }
else
{
sql = "select ALLOC_QTY from stock WHERE site_code = ? AND LOT_SL = ? AND QUANTITY > 0";
pstmt= conn.prepareStatement(sql);
//System.out.println("Second sql ["+sql + "]");
pstmt.setString( 1, siteCode);
pstmt.setString( 2, lotSl);
rs = pstmt.executeQuery();
if(rs.next())
{
allQty = rs.getDouble(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(allQty == quantity)
{
errCode = "DIDOQUALSM";
errString = getErrorString("quantity",errCode,userId);
break;
}
}
/*else /*else
{ {
if(totquantity > stkquantity) if(totquantity > stkquantity)
......
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