Commit 42d4f6be authored by skale's avatar skale

Changes in code as no of articals calculating was wrong.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91192 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 5f59e33a
......@@ -900,25 +900,25 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
//taxEnv = genericUtility.getColumnValue("tax_env",dom);
//System.out.println("taxEnv :"+taxEnv);
grossWeight = genericUtility.getColumnValue("gross_weight",dom);
System.out.println("grossWeight :"+grossWeight);
//System.out.println("grossWeight :"+grossWeight);
netWeight = genericUtility.getColumnValue("net_weight",dom);
System.out.println("netWeight :"+netWeight);
//System.out.println("netWeight :"+netWeight);
tareWeight = genericUtility.getColumnValue("tare_weight",dom);
System.out.println("tareWeight :"+tareWeight);
//System.out.println("tareWeight :"+tareWeight);
packInstr = genericUtility.getColumnValue("pack_instr",dom);
System.out.println("packInstr :"+packInstr);
//System.out.println("packInstr :"+packInstr);
partQty = genericUtility.getColumnValue("part_qty",dom1);
System.out.println("partQty :"+partQty);
//System.out.println("partQty :"+partQty);
tranDate = genericUtility.getColumnValue("tran_date",dom1);
System.out.println("tranDate :"+tranDate);
//System.out.println("tranDate :"+tranDate);
locCodeGit = genericUtility.getColumnValue("loc_code__git",dom1);
System.out.println("locCodeGit :"+locCodeGit);
//System.out.println("locCodeGit :"+locCodeGit);
noArt = genericUtility.getColumnValue("no_art",dom);
System.out.println("noArt :"+noArt);
//System.out.println("noArt :"+noArt);
checkIntegralQty = "N";
tranType = genericUtility.getColumnValue("tran_type",dom1);
System.out.println("tranType :"+tranType);
//System.out.println("tranType :"+tranType);
if (tranType != null && tranType.trim().length() > 0)
......@@ -1056,11 +1056,11 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
itemDescr = rs.getString( 5 );
System.out.println("active : " + active);
/* System.out.println("active : " + active);
System.out.println("minShelfLife : " + minShelfLife);
System.out.println("trackShelfLife : " + trackShelfLife);
System.out.println("suppSour : " + suppSour);
System.out.println("itemDescr : " + itemDescr);
System.out.println("itemDescr : " + itemDescr); */
if( active.equals("N") )
{
......@@ -1262,21 +1262,21 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
stmt = conn1.createStatement();
rs = stmt.executeQuery( sql );
remQuantity = Double.parseDouble(quantity);
System.out.println("remQuantity :" + remQuantity);
//System.out.println("remQuantity :" + remQuantity);
while (rs.next())
{
isRecordFound = true;
lotNo = rs.getString(1);
System.out.println("lotNo :" + lotNo);
//System.out.println("lotNo :" + lotNo);
packCode = rs.getString(11);
System.out.println("packCode :" + packCode);
//System.out.println("packCode :" + packCode);
if (remQuantity == 0)
{
break;
}
stockQty = rs.getDouble(3) - rs.getDouble(10);
System.out.println("stockQty :" + stockQty);
// System.out.println("stockQty :" + stockQty);
if (stockQty == 0)
{
continue;
......@@ -1286,10 +1286,10 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
if (minShelfLife > 0)
{
chkDate = calcExpiry(tranDate,minShelfLife); //calcExpiry function to be checked.
System.out.println("chkDate :" + chkDate);
//System.out.println("chkDate :" + chkDate);
chkDate1 = sdf.parse(chkDate);
java.sql.Date date1 = rs.getDate(4);
System.out.println("date1 :" + date1);
//System.out.println("date1 :" + date1);
java.util.Date date2 = null;
if(date1 != null)
{
......@@ -1303,7 +1303,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
}
}
}//end if
System.out.println("checkIntegralQty :" + checkIntegralQty);
//System.out.println("checkIntegralQty :" + checkIntegralQty);
//if (checkIntegralQty.equals("Y"))//Commented by jiten 04/10/06
if (!checkIntegralQty.equals("N"))
{
......@@ -1553,9 +1553,9 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
{
shipQty = shipperSize;
noArt11 = (minputQty - (minputQty % shipQty))/shipQty;
System.out.println("noArt11 .............:"+noArt11);
//System.out.println("noArt11 .............:"+noArt11);
remainder = minputQty % shipQty;
System.out.println("remainder .............:"+remainder);
//System.out.println("remainder .............:"+remainder);
sql ="select ( case when integral_qty is null then 0 else integral_qty end) integral_qty"
+" from customeritem where cust_code = '"+sundryCode+"' and item_code ='"+itemCode+"'";
System.out.println("sql :"+sql);
......@@ -1565,7 +1565,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
integralqty = rs1.getDouble(1);
}
System.out.println("integralqty .............:"+integralqty);
//System.out.println("integralqty .............:"+integralqty);
if(integralqty ==0)
{
sql ="select ( case when integral_qty is null then 0 else integral_qty end) integral_qty"
......@@ -1577,7 +1577,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
integralqty = rs1.getDouble(1);
}
System.out.println("integralqty .............:"+integralqty);
//System.out.println("integralqty .............:"+integralqty);
if(integralqty ==0)
{
sql ="select ( case when integral_qty is null then 0 else integral_qty end) integral_qty"
......@@ -1587,25 +1587,25 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
if (rs1.next())
{
integralqty = rs1.getDouble(1);
System.out.println("integralqty .............:"+integralqty);
//System.out.println("integralqty .............:"+integralqty);
}
}
}
System.out.println("integralqty .............:"+integralqty);
//System.out.println("integralqty .............:"+integralqty);
if(integralqty > 0)
{
noArt12 = (remainder -(remainder % integralqty))/integralqty;
System.out.println("noArt12 ....2.........:"+noArt12);
//System.out.println("noArt12 ....2.........:"+noArt12);
}
if(noArt12 > 0)
{
noArt12 =1;
System.out.println("noArt2 ....0.........:"+noArt12);
//System.out.println("noArt2 ....0.........:"+noArt12);
}
noArt1 = (int)(noArt11 + noArt12);
noArt = "" + noArt1;
System.out.println("noArt .............:"+noArt);
//System.out.println("noArt .............:"+noArt);
acShipperQty = shipQty;
acIntegralQty = integralqty;
}
......@@ -1613,7 +1613,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
{
noArt1 = getNoArt(siteCode, sundryCode, itemCode, packCode, minputQty, 'B', acShipperQty, acIntegralQty);
noArt = "" + noArt1;
System.out.println("noArt .............:"+noArt);
//System.out.println("noArt .............:"+noArt);
}
//ended on 28/11/09
String abc =rs.getString(5);
......@@ -1706,7 +1706,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
tareWt = 0;
netWt = 0;
cnt++;
System.out.println("The cnt :" + ++cnt);
//System.out.println("The cnt :" + ++cnt);
}//while end
//changed by msalam on 22/09/07 start
......@@ -2215,7 +2215,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
if ( rsS.next() )
{
tranTypeParent = rsS.getString( "TRAN_TYPE__PARENT" );
System.out.println("tranTypeParent :"+tranTypeParent);
//System.out.println("tranTypeParent :"+tranTypeParent);
}
rsS.close();
rsS = null;
......@@ -2328,51 +2328,51 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
itemChngXmlString = distIssueRemote.itemChanged(returnValue, xmlString1, "", objContext, "line_no_dist_order", "E", xtraParams);
*/
itemChngXmlString = itemChngXmlStrBuff.toString();
System.out.println("itemChngXmlString :"+itemChngXmlString);
//System.out.println("itemChngXmlString :"+itemChngXmlString);
domItmChng = genericUtility.parseString(itemChngXmlString);
returnValue = serializeDom(domItmChng);
System.out.println("\n\nreturnValue from serializeDom :"+returnValue);
//System.out.println("\n\nreturnValue from serializeDom :"+returnValue);
parentNodeList = dom.getElementsByTagName("Detail2");
parentNodeList1 = domItmChng.getElementsByTagName("Detail2");
System.out.println("\n parentNodeList :"+parentNodeList+" \n parentNodeList1 :"+parentNodeList);
//System.out.println("\n parentNodeList :"+parentNodeList+" \n parentNodeList1 :"+parentNodeList);
parentNodeListLen = parentNodeList.getLength();
parentNodeListLen1 = parentNodeList1.getLength();
System.out.println("\n parentNodeListLen :"+parentNodeListLen+"\n parentNodeListLen1 :"+parentNodeListLen1);
//System.out.println("\n parentNodeListLen :"+parentNodeListLen+"\n parentNodeListLen1 :"+parentNodeListLen1);
int count = 0;
for (int ctr = 0; ctr < parentNodeListLen1; ctr++)
{
parentNode1 = parentNodeList1.item(ctr);
childNodeList1 = parentNode1.getChildNodes();
System.out.println("childNodeList1 :"+childNodeList1);
//System.out.println("childNodeList1 :"+childNodeList1);
childNodeListLen1 = childNodeList1.getLength();
System.out.println("childNodeListLen1 :"+childNodeListLen1);
//System.out.println("childNodeListLen1 :"+childNodeListLen1);
for (int i = 0; i < childNodeListLen1; i++) // 10 TAG OF ITEM CHANGE
{
childNode1 = childNodeList1.item(i);
System.out.println("childNode1 :"+childNode1);
//System.out.println("childNode1 :"+childNode1);
childNodeName1 = childNode1.getNodeName();
System.out.println("childNodeName1 :"+childNodeName1);
//System.out.println("childNodeName1 :"+childNodeName1);
for (int j = 0;j < parentNodeListLen; j++) //OF DETAIL2 LENGTH = 1
{
parentNode = parentNodeList.item(j);
childNodeList = parentNode.getChildNodes();
System.out.println("childNodeList :"+childNodeList);
//System.out.println("childNodeList :"+childNodeList);
childNodeListLen = childNodeList.getLength();
System.out.println("childNodeListLen :"+childNodeListLen); // 44
// System.out.println("childNodeListLen :"+childNodeListLen); // 44
for (int k = 0; k < childNodeListLen; k++)
{
childNode = childNodeList.item(k);
System.out.println("childNode :"+childNode);
//System.out.println("childNode :"+childNode);
childNodeName = childNode.getNodeName();
System.out.println("childNodeName :"+childNodeName);
//System.out.println("childNodeName :"+childNodeName);
if (childNodeName1.equals(childNodeName))
{
System.out.println("childNode1 :"+childNode1+"\n childNode :"+childNode);
//System.out.println("childNode1 :"+childNode1+"\n childNode :"+childNode);
Node updatedNode = dom.importNode(childNode1, true);
System.out.println("updatedNode :"+updatedNode);
System.out.println("Before Replacing the dom :"+dom.getElementsByTagName("Detail2").item(0));
//System.out.println("updatedNode :"+updatedNode);
//System.out.println("Before Replacing the dom :"+dom.getElementsByTagName("Detail2").item(0));
(dom.getElementsByTagName("Detail2").item(0)).replaceChild(updatedNode, childNode);
System.out.println("After Replacing the dom :"+dom.getElementsByTagName("Detail2").item(0));
// System.out.println("After Replacing the dom :"+dom.getElementsByTagName("Detail2").item(0));
}
}//k for end
}//j for end
......@@ -2386,7 +2386,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
if(retString.indexOf("<Detail>") != -1)
{
finalStr = retString.substring( retString.indexOf( "<Detail>" ), retString.lastIndexOf("</Detail>") + 9 );
System.out.println( "finalStr from Default :" + finalStr);
//System.out.println( "finalStr from Default :" + finalStr);
retStrFrAllocate = retStrFrAllocate.append(String.valueOf(finalStr));
}
else
......@@ -2394,13 +2394,13 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
if (retString.indexOf("<error>") != -1)
{
finalStr = retString.substring(retString.indexOf("<error>"),retString.lastIndexOf("</error>")+9);
System.out.println("finalStr from Default :"+finalStr);
//System.out.println("finalStr from Default :"+finalStr);
//retStrFrAllocate = retStrFrAllocate.append(String.valueOf(finalStr));
}
else if (retString.indexOf("<Errors>") != -1)
{
finalStr = retString.substring(retString.indexOf("<Errors>"),retString.lastIndexOf("</Errors>")+9);
System.out.println("finalStr from Default :"+finalStr);
//System.out.println("finalStr from Default :"+finalStr);
retStrFrAllocate = retStrFrAllocate.append(String.valueOf(finalStr));
}
}
......@@ -2521,7 +2521,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
if (rs.next())
{
rate = rs.getDouble(1);
System.out.println("rate :"+rate);
//System.out.println("rate :"+rate);
}
else
{
......@@ -3179,9 +3179,21 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
integralQty = rs.getDouble(1);
//System.out.println("integralQty :"+integralQty);
}
if (integralQty == 0)
{
sql = "SELECT REO_QTY FROM ITEM "
+"WHERE ITEM_CODE = '"+itemCode+"'";
System.out.println("sql :"+sql);
rs = stmt.executeQuery(sql);
if (rs.next())
{
integralQty = rs.getDouble(1);
//System.out.println("integralQty :"+integralQty);
}
}
}
}
System.out.println("integralQty from getIntegralQty function = ["+integralQty+"]");
System.out.println("integralQty = ["+integralQty+"]");
break;
case 'P':
sql = "SELECT CASE WHEN CAPACITY IS NULL THEN 0 ELSE CAPACITY END "
......@@ -3193,7 +3205,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
integralQty = rs.getDouble(1);
//System.out.println("integralQty :"+integralQty);
}
System.out.println("integralQty from getIntegralQty function = ["+integralQty+"]");
System.out.println("integralQty = ["+integralQty+"]");
break;
case 'I':
sql = "SELECT INTEGRAL_QTY FROM SITEITEM "
......@@ -3313,7 +3325,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
reoQty = rs.getDouble(1);
System.out.println("reoQty :"+reoQty);
}
else
if( reoQty == 0 )
{
sql = "SELECT REO_QTY FROM ITEM WHERE ITEM_CODE = '"+itemCode+"'";
System.out.println("sql :"+sql);
......@@ -3331,18 +3343,18 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
if (capacity > 0)
{
shipperQty = capacity;
System.out.println("shipperQty :"+shipperQty);
//System.out.println("shipperQty :"+shipperQty);
}
else
{
shipperQty = reoQty;
System.out.println("shipperQty :"+shipperQty);
//System.out.println("shipperQty :"+shipperQty);
}
System.out.println("shipperQty :"+shipperQty);
if (shipperQty > 0)
{
mod = qty%shipperQty;
System.out.println("mod :"+mod);
//System.out.println("mod :"+mod);
noArt = (qty - mod) / shipperQty;
}
System.out.println("noArt :"+noArt);
......@@ -3355,7 +3367,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
if (rs.next())
{
integralQty = rs.getDouble(1);
System.out.println("integralQty :"+integralQty);
//System.out.println("integralQty :"+integralQty);
}
if (integralQty == 0)
{
......@@ -3366,9 +3378,9 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
if (rs.next())
{
integralQty = rs.getDouble(1);
System.out.println("integralQty :"+integralQty);
//System.out.println("integralQty :"+integralQty);
}
else
if( integralQty == 0 )
{
sql = "SELECT INTEGRAL_QTY FROM ITEM WHERE ITEM_CODE = '"+itemCode+"'";
System.out.println("sql :"+sql);
......@@ -3376,16 +3388,16 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
if (rs.next())
{
integralQty = rs.getDouble(1);
System.out.println("integralQty :"+integralQty);
//System.out.println("integralQty :"+integralQty);
}
}
}
if (integralQty > 0)
{
mod = qty%integralQty;
System.out.println("mod :"+mod);
//System.out.println("mod :"+mod);
noArt = (qty - mod) / integralQty;
System.out.println("noArt :"+noArt);
//System.out.println("noArt :"+noArt);
}
break;
case 'B' :
......@@ -3396,7 +3408,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
if (rs.next())
{
capacity = rs.getDouble(1);
System.out.println("capacity :"+capacity);
//System.out.println("capacity :"+capacity);
}
else
{
......@@ -3409,9 +3421,9 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
if (rs.next())
{
reoQty = rs.getDouble(1);
System.out.println("reoQty :"+reoQty);
//System.out.println("reoQty :"+reoQty);
}
else
if( reoQty == 0 )
{
sql = "SELECT REO_QTY FROM ITEM WHERE ITEM_CODE = '"+itemCode+"'";
System.out.println("sql :"+sql);
......@@ -3419,25 +3431,25 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
if (rs.next())
{
reoQty = rs.getDouble(1);
System.out.println("reoQty :"+reoQty);
//System.out.println("reoQty :"+reoQty);
}
}
if (capacity > 0)
{
shipperQty = capacity;
System.out.println("shipperQty :"+shipperQty);
//System.out.println("shipperQty :"+shipperQty);
}
else
{
shipperQty = reoQty;
System.out.println("shipperQty :"+shipperQty);
//System.out.println("shipperQty :"+shipperQty);
}
if (shipperQty > 0)
{
mod = (qty % shipperQty);
System.out.println("mod :"+mod);
//System.out.println("mod :"+mod);
noArt1 = (qty - mod) / shipperQty;
System.out.println("noArt1 :"+noArt1);
//System.out.println("noArt1 :"+noArt1);
}
sql = "SELECT INTEGRAL_QTY FROM CUSTOMERITEM "
+"WHERE CUST_CODE = '"+custCode+"' "
......@@ -3447,7 +3459,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
if (rs.next())
{
integralQty = rs.getDouble(1);
System.out.println("integralQty :"+integralQty);
//System.out.println("integralQty :"+integralQty);
}
if (integralQty == 0)
{
......@@ -3459,7 +3471,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
if (rs.next())
{
integralQty = rs.getDouble(1);
System.out.println("integralQty :"+integralQty);
//System.out.println("integralQty :"+integralQty);
}
if(integralQty == 0)
{
......@@ -3469,7 +3481,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
if (rs.next())
{
integralQty = rs.getDouble(1);
System.out.println("integralQty :"+integralQty);
//System.out.println("integralQty :"+integralQty);
}
}
}
......@@ -3477,11 +3489,11 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
if (integralQty > 0)
{
remainder1 = mod % integralQty;
System.out.println("remainder1 :"+remainder1);
//System.out.println("remainder1 :"+remainder1);
noArt3 =(mod - remainder1) / integralQty;
System.out.println("noArt3 :"+noArt3);
//System.out.println("noArt3 :"+noArt3);
noArt2 = (int)noArt3;
System.out.println("noArt2 :"+noArt2);
//System.out.println("noArt2 :"+noArt2);
}
if (noArt2 > 0)
{
......
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