Commit eb955912 authored by manohar's avatar manohar

stock transfer multiple if quantity is not entered also populate the stock for all selected


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91599 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 370ddb10
......@@ -308,6 +308,7 @@ public class GenStkHelpAct extends ActionHandlerEJB implements GenStkHelpActLoca
Statement stmt = null;
PreparedStatement pstmt =null;
ResultSet rs = null;
boolean lbDefault = false;
try
{
conn = connDriver.getConnectDB("DriverITM");
......@@ -341,11 +342,13 @@ public class GenStkHelpAct extends ActionHandlerEJB implements GenStkHelpActLoca
quantity = "0";
}
//Added by Alka 31/05/07 -- Entering Required Quantity in the Screen is necessary
// 20/03/12 manoharan if quantity not entered transfer all
if (Double.parseDouble(quantity) == 0)
{
errCode = "VTQUAN";
errString = itmDbAccess.getErrorString("quantity", errCode, userId, "", conn);
return errString;
lbDefault = true;
//errCode = "VTQUAN";
//errString = itmDbAccess.getErrorString("quantity", errCode, userId, "", conn);
//return errString;
}
// end Added by Alka 31/05/07
......@@ -355,27 +358,35 @@ public class GenStkHelpAct extends ActionHandlerEJB implements GenStkHelpActLoca
{
issCriteria = rs.getString("ISS_CRITERIA");
}
// 20/03/12 manoharan
detailList = selDataDom.getElementsByTagName("Detail");
detailListLength = detailList.getLength();
for (int i = 0;i < detailListLength;i++ )
if (lbDefault == false)
{
stkQtyStr = GenericUtility.getInstance().getColumnValueFromNode("net_available",detailList.item(i));
if (stkQtyStr != null)
for (int i = 0;i < detailListLength;i++ )
{
stkQty = stkQty + Double.parseDouble(stkQtyStr);
}
stkQtyStr = GenericUtility.getInstance().getColumnValueFromNode("net_available",detailList.item(i));
if (stkQtyStr != null)
{
stkQty = stkQty + Double.parseDouble(stkQtyStr);
}
}
if (stkQty < Double.parseDouble(quantity))
{
errCode = "VTSTOCK1";
errString = itmDbAccess.getErrorString("quantity", errCode, userId, "", conn); //Added by Alka 31/05/07
return errString; //Added by Alka 31/05/07
}
}
if (stkQty < Double.parseDouble(quantity))
if (lbDefault == false)
{
errCode = "VTSTOCK1";
errString = itmDbAccess.getErrorString("quantity", errCode, userId, "", conn); //Added by Alka 31/05/07
return errString; //Added by Alka 31/05/07
ordQuantity = Double.parseDouble(quantity);
}
ordQuantity = Double.parseDouble(quantity);
// end 20/03/12 manoharan
System.out.println("issCriteria ::"+issCriteria);
System.out.println("ordQuantity ::"+ordQuantity);
System.out.println("manohar 20/03/12 ordQuantity before ["+ordQuantity + "] detailListLength [" + detailListLength + "]");
for (int ctr = 0;ctr < detailListLength;ctr++)
{
selLocCode = GenericUtility.getInstance().getColumnValueFromNode("loc_code",detailList.item(ctr));
......@@ -383,6 +394,13 @@ public class GenStkHelpAct extends ActionHandlerEJB implements GenStkHelpActLoca
selLotSl = GenericUtility.getInstance().getColumnValueFromNode("lot_sl",detailList.item(ctr));
selUnit = GenericUtility.getInstance().getColumnValueFromNode("unit",detailList.item(ctr));
selQuantity = GenericUtility.getInstance().getColumnValueFromNode("net_available",detailList.item(ctr));
// 20/03/12 manoharan
if (lbDefault == true)
{
ordQuantity = Double.parseDouble(selQuantity);
}
System.out.println("manohar 20/03/12 ordQuantity after ["+ordQuantity + "]");
// 20/03/12 manoharan
// selStkRate = GenericUtility.getInstance().getColumnValueFromNode("stock_rate",detailList.item(ctr)); //stock-rate is wrongly placed Gulzar - 10/05/07
//selStkRate = GenericUtility.getInstance().getColumnValueFromNode("rate",detailList.item(ctr)); //stock-rate is changed to rate Gulzar - 10/05/07
//if (selStkRate == null)
......@@ -436,12 +454,12 @@ public class GenStkHelpAct extends ActionHandlerEJB implements GenStkHelpActLoca
// 18/02/12 manoharan
siteCode = GenericUtility.getInstance().getColumnValue("site_code",dom1);
itemCode = GenericUtility.getInstance().getColumnValue("item_code",dom);
sql = "Select qty_per_art,pack_code From stock "
sql = "Select qty_per_art,pack_code From stock "
+ " WHERE ITEM_CODE = ? "
+ " and site_CODE = ? "
+ " and loc_CODE = ? "
+ " and lot_no = ? "
+ " and lot_sl = ? ";
+ " and lot_sl = ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,itemCode);
......@@ -542,7 +560,8 @@ public class GenStkHelpAct extends ActionHandlerEJB implements GenStkHelpActLoca
} // end 18/02/12 manoharan
valueXmlString.append("</Detail>");
if (ordQuantity == 0)
//if (ordQuantity == 0 )
if (ordQuantity == 0 && lbDefault == false)
{
break;
}
......
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