Commit b38369c5 authored by cpatil's avatar cpatil

modify for quantity


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93448 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 86db4f02
...@@ -748,6 +748,10 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL ...@@ -748,6 +748,10 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
double quantity = 0, remainingQty = 0, inputQty = 0, stkQty = 0, gWeight = 0; double quantity = 0, remainingQty = 0, inputQty = 0, stkQty = 0, gWeight = 0;
Node currDetail = null, currDetail1 = null; Node currDetail = null, currDetail1 = null;
// added by cpatil 31/07/13
double qtyPerArt=0;
//
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB(); ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
...@@ -826,10 +830,44 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL ...@@ -826,10 +830,44 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
if (stkQty >= remainingQty) if (stkQty >= remainingQty)
{ {
if (issCriteria != null && issCriteria.equalsIgnoreCase("W")) if (issCriteria != null && ("W").equalsIgnoreCase(issCriteria))
{ {
inputQty = stkQty; inputQty = stkQty;
} }
// added by cpatil on 31/07/13 for criteria type is F MF1JSUN006
else if( issCriteria != null && ("F").equalsIgnoreCase(issCriteria))
{
sql =" select qty_per_art from stock where item_code = ? and site_code = ? " +
" and loc_code = ? and lot_no = ? and lot_sl = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,itemCode);
pstmt.setString(2,siteCode);
pstmt.setString(3,stkLocCode);
pstmt.setString(4,stkLotNo);
pstmt.setString(5,stkLotSl);
rs = pstmt.executeQuery();
if(rs.next())
{
qtyPerArt = rs.getDouble(1);
}
rs.close();
pstmt.close();
System.out.println("@@@@@1 stkQty["+stkQty+"]:::remainingQty["+remainingQty+"]:::qtyPerArt["+qtyPerArt+"]");
if( qtyPerArt > 0 )
{
if((remainingQty % qtyPerArt) > 0 )
{
inputQty = ( (int)(remainingQty/qtyPerArt) + 1 ) * qtyPerArt;
System.out.println("@@@@@@@inputQty2:["+inputQty+"]");
}
}
else
{
inputQty = remainingQty;
System.out.println("@@@@@@@inputQty2:["+inputQty+"]");
}
}
//end
else else
{ {
inputQty = remainingQty; inputQty = remainingQty;
...@@ -964,12 +1002,15 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL ...@@ -964,12 +1002,15 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
String retNoArt = null, locGroup = "", locUsageType = "", suppCodeMfg = ""; String retNoArt = null, locGroup = "", locUsageType = "", suppCodeMfg = "";
ArrayList noArtDetArrLst = new ArrayList(); ArrayList noArtDetArrLst = new ArrayList();
PreparedStatement pstmt = null, pstmt1 = null, cpstmt1 = null; PreparedStatement pstmt = null, pstmt1 = null, cpstmt1 = null,pstmt2 = null;
Connection conn = null; Connection conn = null;
ResultSet rs = null, rs1 = null, crs1 = null; ResultSet rs = null, rs1 = null, crs1 = null,rs2=null;
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
StringBuffer valueXmlString = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root>\r\n"); StringBuffer valueXmlString = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root>\r\n");
String sql2="";
// added by cpatil 31/07/13
double qtyPerArt=0;
//
if (dom == null) if (dom == null)
{ {
valueXmlString.append("</Root>\r\n"); valueXmlString.append("</Root>\r\n");
...@@ -1232,7 +1273,7 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL ...@@ -1232,7 +1273,7 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
// FOR QC_REQD TO BE CHECKED FROM FIRST SITEITEM & THEN ITEM // FOR QC_REQD TO BE CHECKED FROM FIRST SITEITEM & THEN ITEM
qcReqd = mfgCommon.chkQcReqd(siteCode, itemCode, conn); qcReqd = mfgCommon.chkQcReqd(siteCode, itemCode, conn);
autoQcReqd = mfgCommon.chkAutoQcReqd(siteCode, itemCode, conn); autoQcReqd = mfgCommon.chkAutoQcReqd(siteCode, itemCode, conn);
sql = "SELECT ISS_CRITERIA, TRACK_SHELF_LIFE FROM ITEM WHERE ITEM_CODE = ?"; sql = "SELECT ISS_CRITERIA, TRACK_SHELF_LIFE FROM ITEM WHERE ITEM_CODE = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode); pstmt.setString(1, itemCode);
...@@ -1435,10 +1476,44 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL ...@@ -1435,10 +1476,44 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
System.out.println("manohar stkQtyLot [" + stkQtyLot + "] remainingQty [" + remainingQty + "] criteria [" + criteria + "]"); System.out.println("manohar stkQtyLot [" + stkQtyLot + "] remainingQty [" + remainingQty + "] criteria [" + criteria + "]");
if (stkQtyLot >= remainingQty) if (stkQtyLot >= remainingQty)
{ {
if (criteria != null && criteria.equalsIgnoreCase("W")) if (criteria != null && ("W").equalsIgnoreCase(criteria))
{ {
inputQty = stkQtyLot; inputQty = stkQtyLot;
} }
// added by cpatil on 31/07/13 for criteria type is F MF1JSUN006
else if(criteria != null && ("F").equalsIgnoreCase(criteria))
{
sql2 =" select qty_per_art from stock where item_code = ? and site_code = ? " +
" and loc_code = ? and lot_no = ? and lot_sl = ? ";
pstmt2 = conn.prepareStatement(sql2);
pstmt2.setString(1,itemCode);
pstmt2.setString(2,siteCode);
pstmt2.setString(3,stkLocCode);
pstmt2.setString(4,stkLotNo);
pstmt2.setString(5,stkLotSl);
rs2 = pstmt2.executeQuery();
if(rs2.next())
{
qtyPerArt = rs2.getDouble(1);
}
rs2.close();
pstmt2.close();
System.out.println("@@@@@1 stkQtyLot["+stkQtyLot+"]:::remainingQty["+remainingQty+"]:::qtyPerArt["+qtyPerArt+"]");
if( qtyPerArt > 0 )
{
if( (remainingQty % qtyPerArt) > 0 )
{
inputQty = ( (int)(remainingQty/qtyPerArt) + 1 ) * qtyPerArt;
System.out.println("@@@@@@@inputQty:["+inputQty+"]");
}
}
else
{
inputQty = remainingQty;
System.out.println("@@@@@@@inputQty:["+inputQty+"]");
}
}
//end
else else
{ {
inputQty = remainingQty; inputQty = remainingQty;
......
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