Commit f87928bb authored by mnair's avatar mnair

Updated changes in stocktransferAct and StockTransferEjb

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@185910 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 0de4d01f
......@@ -91,6 +91,7 @@ public class StockTransferEJB extends ValidatorEJB implements StockTransferEJBRe
int noOfParent = 0;
double lc_Num = 0d,lc_Num2 = 0d,lc_old_qty = 0d,lc_stk_qty = 0d,shipperSize = 0;
double qty = 0d;
ResultSet rs = null;
Connection conn = null;
......@@ -283,6 +284,8 @@ public class StockTransferEJB extends ValidatorEJB implements StockTransferEJBRe
else if ( "quantity".equalsIgnoreCase( childNodeName ) )
{
lc_Num = Double.parseDouble(genericUtility.getColumnValue( "quantity", currDom ));
System.out.println("Input quantity["+lc_Num+"]");
if (lc_Num <= 0)
{
errList.add( "VTQTY" );
......@@ -298,11 +301,47 @@ public class StockTransferEJB extends ValidatorEJB implements StockTransferEJBRe
tranId = genericUtility.getColumnValue( "tran_id", currDom );
lineNo = genericUtility.getColumnValue( "line_no", currDom );
//Changes by mayur on 04-June-2018----start
refSer = genericUtility.getColumnValue( "ref_ser__for", hdrDom );
System.out.println("Reference series::::::::["+refSer+"]");
refId = genericUtility.getColumnValue("ref_id__for", hdrDom);
System.out.println("Reference id::::::::["+refId+"]");
if(tranId == null || tranId.trim().length() == 0)
{
tranId = "@@@";
}
if("S-REQ".equalsIgnoreCase(refSer))
{
sql = "SELECT sum(quantity) As qty from ser_req_item where req_id = ? AND item_code = ? ";
System.out.println("SQL ::"+sql);
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,refId);
pstmt.setString(2,itemCode);
rs = pstmt.executeQuery();
if(rs.next())
{
qty = rs.getDouble("qty");
System.out.println("Service order item quantity:["+qty+"]");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(lc_Num > qty)
{
System.out.println("If input quantity > service order quantity["+lc_Num+">"+qty+"]");
errList.add( "INVQTY1" );
errFields.add( childNodeName.toLowerCase() );
}
} //end of if
//Changes by mayur on 04-June-2018----end
else {
sql = "SELECT quantity FROM stock_transfer_det WHERE tran_id = ? AND line_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
......@@ -364,6 +403,8 @@ public class StockTransferEJB extends ValidatorEJB implements StockTransferEJBRe
}
}
}
}
else if ( "loc_code__fr".equalsIgnoreCase( childNodeName ) )
{
ls_Val = genericUtility.getColumnValue( "loc_code__fr", currDom );
......
......@@ -189,7 +189,7 @@ public class StockTransferAct extends ActionHandlerEJB implements
System.out.println(":::SER_REQUEST TABLE DETAIL:::");
System.out.println("siteCodeReq::["+siteCodeReq+"]");
System.out.println("locCodeTo::["+locCodeTo+"]");
System.out.println("locCodeTo as emp code::["+locCodeTo+"]");
System.out.println(":::SER_REQ_ITEM TABLE DETAIL:::");
System.out.println("lineNo ::["+lineNo+"]");
......@@ -320,6 +320,7 @@ public class StockTransferAct extends ActionHandlerEJB implements
// System.out.println("remainingQty :["+remainingQty+"]");
String mapKey = itemCode + "~" + siteCodeReq + "~"+ locCodeTo + "~" + lotNum + "~" + lotSerial;
System.out.println("mapKey-->"+mapKey);
if (!hm.containsKey(mapKey))
{
......@@ -327,12 +328,14 @@ public class StockTransferAct extends ActionHandlerEJB implements
}
hmQty = Double.parseDouble((hm.get(mapKey)).toString());
System.out.println("hmQty is ["+hmQty+"]");
if (remainingQty == 0) {
break;
}
else if (hmQty >= remainingQty) {
System.out.println("Inside hmQty >= remainingQty");
inputQty = remainingQty;
System.out.println("inputQty :["+inputQty+"]");
remainingQty = 0;
......@@ -343,7 +346,7 @@ public class StockTransferAct extends ActionHandlerEJB implements
}
else if (hmQty < remainingQty) {
System.out.println("Inside hmQty < remainingQty");
inputQty = hmQty;
System.out.println("inputQty :["+inputQty+"]");
......
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