Commit 3fb75164 authored by wansari's avatar wansari

D15AKAT008 update source in case of PGRL location quantity will be entered by...

D15AKAT008 update source in case of PGRL location quantity will be entered by user and commented loose item quantity will save as 1.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@100223 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3285b603
......@@ -987,10 +987,10 @@ public class PoRcpArtIC extends ValidatorEJB implements PoRcpArtICRemote, PoRcpA
childList = parentList.item( 0 ).getChildNodes();
noOfChilds = childList.getLength();
asnNo=checkNull(genericUtility.getColumnValue("asn_no", allDom, "1" ));
String purc_order=checkNull(genericUtility.getColumnValue("purc_order", allDom, "1" ));
purcOrder=checkNull(genericUtility.getColumnValue("purc_order", allDom, "1" ));
System.out.println("ASN IN CASE 3 WFVAliation 3==================>"+purc_order);
System.out.println("Purchase order IN CASE 3 WFVAliation 3 ==================>"+asnNo);
System.out.println("ASN IN CASE 3 WFVAliation 3==================>"+asnNo);
System.out.println("Purchase order IN CASE 3 WFVAliation 3 ==================>"+purcOrder);
for (int ctr = 0; ctr < noOfChilds; ctr++)
......@@ -1339,6 +1339,74 @@ public class PoRcpArtIC extends ValidatorEJB implements PoRcpArtICRemote, PoRcpA
errFields.add( childNodeName.toLowerCase() );
}
}
//Changed by wasim on 17-02-2016 for quanity validation [START]
else if ( "quantity".equalsIgnoreCase( childNodeName ) )
{
System.out.println("Quantity Validation");
if ( childNode.getFirstChild() == null )
{
errList.add( "VTNULLQTYP" ); //quantity null not allowed.
errFields.add( childNodeName.toLowerCase() );
break;
}
else
{
double qty=Double.parseDouble(checkNull(genericUtility.getColumnValue("quantity", allDom, "3" ).trim()));
itemCode = checkNull(genericUtility.getColumnValue("item_code", allDom, "3" ));
System.out.println("Item code["+itemCode+"]Quantity entered is="+qty);
if(qty <= 0)
{
errList.add( "VTINVQTYP" ); //quantity null not allowed.
errFields.add( childNodeName.toLowerCase() );
break;
}//max qty validation pending...
else
{
System.out.println("Validating max quantity");
double porcpArtQty = 0;
double porddetQty = 0;
sql = " select sum(quantity) from porcp_art where item_code = ? and purc_order = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, purcOrder);
rs=pstmt.executeQuery();
if(rs.next())
{
porcpArtQty = rs.getDouble(1);
}
rs.close();rs=null;
pstmt.close();pstmt=null;
sql = " select quantity from porddet where item_code = ? and purc_order = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, purcOrder);
rs=pstmt.executeQuery();
if(rs.next())
{
porddetQty = rs.getInt(1);
}
rs.close();rs=null;
pstmt.close();pstmt=null;
System.out.println("Porddet quantity["+porddetQty+"] Porcp Art quantity ["+porcpArtQty+"]");
double remainingQty = porddetQty - porcpArtQty;
System.out.println("Max Remaing can enter"+remainingQty);
if(qty > remainingQty)
{
System.out.println("Invalid quantity entered");
errList.add( "VMMQTY" ); //quantity null not allowed.
errFields.add( childNodeName.toLowerCase() );
break;
}
}
}
}
//Changed by wasim on 17-02-2016 for quanity validation [START]
//updated by wasim on 20-04-2015 [START]
/*else if ( "quantity".equalsIgnoreCase( childNodeName ) ){
if(asnNo != null && !asnNo.equals("")){//protect ='1'
......@@ -2944,10 +3012,11 @@ private String disParmValue( Connection conn , String disparmVar ) throws ITMExc
//@@changed by wasim on 28-05-2015 when chenged the PGRL menu separate [START]
//if(shipperSize > rem)//scan remainig loose items
//{
if(scanLocCode.equals("PGRL"))//scan remainig loose items
if("PGRL".equalsIgnoreCase(scanLocCode))//scan remainig loose items
{
//@@changed by wasim on 28-05-2015 when chenged the PGRL menu separate [END]
if(data == oldQuantity)
//Changed by wasim on 17-02-2016 as user can enter quantity in case of PGRL
/*if(data == oldQuantity)
{
continue;//all loose items are scanned
}
......@@ -2957,14 +3026,22 @@ private String disParmValue( Connection conn , String disparmVar ) throws ITMExc
maxLine++;
data++;
System.out.println("@@DOM ID="+domID);
System.out.println("Inside showing detail......");
//added by wasim on 20-04-2015 to show details as per quantity count. [END]
lineNo = domID+"";*/
System.out.println("Total Count from porcpart PGRL is="+data);
int remaining = oldQuantity - data;
System.out.println("Remaining quantity is="+remaining);
//lineNo = " " + domID;
//lineNo = lineNo.substring( lineNo.length()-3 );
lineNo = domID+"";
if(data == oldQuantity || data > oldQuantity)
{
continue;//item code already present in porcp_art table.
}
domID++;
maxLine++;
data++;
System.out.println("@@DOM ID="+domID);
//Changed by wasim on 17-02-2016 as user can enter quantity in case of PGRL [END]
valueXmlString.append( "<Detail3 domID='"+ domID +"' objContext = '"+currentFormNo+"' selected=\"N\">\r\n" );
valueXmlString.append( "<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\"/>\r\n" );
......@@ -2976,12 +3053,14 @@ private String disParmValue( Connection conn , String disparmVar ) throws ITMExc
valueXmlString.append("<loc_code><![CDATA[").append(scanLocCode).append("]]></loc_code>\r\n");
valueXmlString.append("<item_descr><![CDATA[").append( checkNullAndTrim(rs.getString("ITEM_DESCR")) ).append("]]></item_descr>\r\n");
valueXmlString.append("<quantity><![CDATA[").append("1").append("]]></quantity>\r\n");
//Changed by wasim on 17-02-2016 as user can enter quantity in case of PGRL
//valueXmlString.append("<quantity><![CDATA[").append("1").append("]]></quantity>\r\n");
valueXmlString.append("<quantity><![CDATA[").append(remaining).append("]]></quantity>\r\n");
valueXmlString.append("<no_art><![CDATA[").append("1").append("]]></no_art>\r\n");
valueXmlString.append("</Detail3>\r\n");
//added by wasim on 20-04-2015 to end while loop. [START]
}
//}
//added by wasim on 20-04-2015 to end while loop. [END]
System.out.println("Last DOMID="+domID);
}
......
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