Commit bf4f204f authored by kmandhre's avatar kmandhre

bug fix


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92984 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 57ac59dc
......@@ -377,12 +377,12 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
ordQty = Double.parseDouble(qtyStr); //SHIFTED BY ALKA ON 24/07/07 FROM BELOW
System.out.println("ordQty ::"+ordQty); //SHIFTED BY ALKA ON 24/07/07 FROM BELOW
// ADDED BY ALKA ON 19/07/07 FOR SELECTED STOCK TO BE ENTERED IN THE DETAIL IF THE QUANTITY IS 0
// ADDED BY ALKA ON 19/07/07 FOR SELECTED STOCK TO BE ENTERED IN THE DETAIL IF THE QUANTITY IS 0
detailList = selDataDom.getElementsByTagName("Detail");
int noOfDetails = detailList.getLength();
for (int ctr = 0; ctr < noOfDetails; ctr++) {
currDetail = detailList.item(ctr);
// stkQty = stkQty + Double.parseDouble((genericUtility.getColumnValueFromNode("quantity", currDetail)));
// stkQty = stkQty + Double.parseDouble((genericUtility.getColumnValueFromNode("quantity", currDetail)));
stkQty = stkQty + Double.parseDouble((genericUtility.getColumnValueFromNode("balance_qty", currDetail)));
}
//System.out.println("stkQty :" + stkQty);
......@@ -406,7 +406,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
}
System.out.println("quantity from dom at the start of the forloop :::: " + ordQty);
System.out.println("remainingQty at the start of the forloop :::: " + remainingQty);
// ADDITION ENDED BY ALKA 19/07/07
// ADDITION ENDED BY ALKA 19/07/07
if (tranType != null && tranType.trim().length() > 0)
{
......@@ -424,14 +424,14 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
detailList = selDataDom.getElementsByTagName("Detail");
detailListLength = detailList.getLength();
System.out.println("DetailLength ::"+detailListLength);
// ordQty = Double.parseDouble(qtyStr);
// System.out.println("ordQty ::"+ordQty);
// ordQty = Double.parseDouble(qtyStr);
// System.out.println("ordQty ::"+ordQty);
for (int ctr = 0;ctr < detailListLength && remainingQty > 0; ctr++)
{
// if (ordQty <= 0)
// {
// break;
// }
// if (ordQty <= 0)
// {
// break;
// }
currDetail = detailList.item(ctr);
pickQtyStr = genericUtility.getColumnValueFromNode("balance_qty",currDetail);
locCode = genericUtility.getColumnValueFromNode("loc_code",currDetail);
......@@ -449,12 +449,12 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
}
pickQty = Double.parseDouble(pickQtyStr);
/* if (pickQty > ordQty)
/* if (pickQty > ordQty)
{
pickQty = ordQty;
}
System.out.println("pickQty ::"+pickQty+"ordQty ::"+ordQty);
*/
*/
if (pickQty > remainingQty)
{
pickQty = remainingQty;
......@@ -499,7 +499,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
valueXmlString.append("<loc_code isSrvCallOnChg='1'>").append("<![CDATA[").append(locCode).append("]]>").append("</loc_code>");
valueXmlString.append("<lot_no isSrvCallOnChg='1'>").append("<![CDATA[").append(lotNo).append("]]>").append("</lot_no>");
valueXmlString.append("<lot_sl isSrvCallOnChg='1'>").append("<![CDATA[").append(lotSl).append("]]>").append("</lot_sl>");
// ordQty = ordQty - pickQty;
// ordQty = ordQty - pickQty;
remainingQty = remainingQty - pickQty; //ADDED BY ALKA ON 03/08/07 FOR THE VARIABLE CHANGED FOR REMAINING QTY -- FOR DETAIL TO BE UPDATED EVEN IF NO QTY ENTERED.
valueXmlString.append("</Detail>");
}
......@@ -676,9 +676,11 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
String checkIntegralQty = "",lineNoOrd ="",sql = "",pickQtyStr = "", batchNo = "", grade = "", mfgDate1 = "";
String locCode = "",lotNo = "",lotSl = "",errCode = "", errString = "", expDate1 = null, retestDate1 = "";
String dimension = "",descr = "",dimension1 = "";
String listType = "";
NodeList detailList = null;
Node currDetail = null;
int detailListLength = 0, cnt = 0;
int counter = 0;//added by kunal on 24/04/13 ;
Connection conn = null;
PreparedStatement pstmt = null, pstmt1 = null;
ResultSet rs = null, rs1 = null;
......@@ -958,7 +960,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
sql2 = " select price_list__clg from distorder where dist_order = ? ";
pstmt2 = conn.prepareStatement(sql2);
pstmt2.setString(1,distOrder);
rs2 = pstmt.executeQuery();
rs2 = pstmt2.executeQuery(); //bug fix done by kunal on 24/04/13 replace pstmt to pstmt2
if (rs2.next())
{
priceListClg=rs2.getString(1);
......@@ -967,16 +969,17 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
rs2.close();
pstmt2 = null;
rs2 = null;
System.out.println("971 priceListClg ="+priceListClg);
if ((priceListClg != null) && ( priceListClg.trim().length() > 0 ))
{
sql2 = " select count(1) from pricelist where price_list = ? " +
" and list_type = 'I' ";
pstmt2 = conn.prepareStatement(sql2);
pstmt2.setString(1,priceListClg);
rs2 = pstmt.executeQuery();
rs2 = pstmt2.executeQuery();
if (rs2.next())
{
cnt=rs2.getInt(1);
counter =rs2.getInt(1);
}
pstmt2.close();
rs2.close();
......@@ -985,7 +988,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
System.out.println("@@@@@@ 1 qty::"+ qty);
if ( cnt > 0 )
if ( counter > 0 )
{
if ( lotSl == null )
{
......@@ -999,9 +1002,11 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
}
else
{
listType = distcommon.getPriceListType(priceListClg,conn);
System.out.println("listType="+listType);
//rate = pickRate(priceList, tranDate, rs.getString("item_code"), rs.getString("lot_no"),'L');
//mrate = i_nvo_gbf_func.gbf_pick_rate(mprice_list, mtran_date, mitem_code, mlot_no,'L') //Commented on 07/04/2k5 by Ruchira
rateClg = distcommon.pickRate( priceListClg, tranDate, itemCode_1, lotNo_1,"I", qty, conn );
rateClg = distcommon.pickRate( priceListClg, tranDate, itemCode_1, lotNo_1,listType, qty, conn );
//mrate_clg = i_nvo_gbf_func.gbf_pick_rate(mprice_list__clg, mtran_date, mitem_code, mlot_no,'I',lc_qty) //Added on 07/04/2k5 by Ruchira
System.out.println("@@@@@2::rateClg["+rateClg+"]");
}
......@@ -1013,7 +1018,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
pstmt2 = conn.prepareStatement(sql2);
pstmt2.setString(1,distOrder);
pstmt2.setString(2,lineNoOrd_1); //lineNoOrd
rs2 = pstmt.executeQuery();
rs2 = pstmt2.executeQuery();
if (rs2.next())
{
rateClg = rs2.getInt("rate__clg");
......@@ -1614,19 +1619,19 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
}
*/
// sql1 = " SELECT CASE WHEN TRACK_SHELF_LIFE IS NULL THEN 'N' ELSE TRACK_SHELF_LIFE END, "
// + " CASE WHEN SUPP_SOUR IS NULL THEN 'M' ELSE SUPP_SOUR END "
// + " FROM ITEM WHERE ITEM_CODE = '" + itemCode + "'";
//
// System.out.println("sql1 :" + sql1);
// rs1 = stmt1.executeQuery(sql1);
// if (rs1.next())
// {
// trackShelfLife = rs1.getString( 1 );
// System.out.println("trackShelfLife : " + trackShelfLife);
// suppSour = rs1.getString( 2 );
// System.out.println("suppSour : " + suppSour);
// }
// sql1 = " SELECT CASE WHEN TRACK_SHELF_LIFE IS NULL THEN 'N' ELSE TRACK_SHELF_LIFE END, "
// + " CASE WHEN SUPP_SOUR IS NULL THEN 'M' ELSE SUPP_SOUR END "
// + " FROM ITEM WHERE ITEM_CODE = '" + itemCode + "'";
//
// System.out.println("sql1 :" + sql1);
// rs1 = stmt1.executeQuery(sql1);
// if (rs1.next())
// {
// trackShelfLife = rs1.getString( 1 );
// System.out.println("trackShelfLife : " + trackShelfLife);
// suppSour = rs1.getString( 2 );
// System.out.println("suppSour : " + suppSour);
// }
//System.out.println("rate1 :" + rate1);
sql = " SELECT (CASE WHEN ACTIVE IS NULL THEN 'Y' ELSE ACTIVE END) ACT, MIN_SHELF_LIFE, "
......@@ -2903,7 +2908,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
{
Node updatedNode = dom.importNode(childNode1, true);
//System.out.println("updatedNode :"+updatedNode);
// (dom.getElementsByTagName("Detail2").item(0)).replaceChild(updatedNode, parentNodeList.item(ctr));
// (dom.getElementsByTagName("Detail2").item(0)).replaceChild(updatedNode, parentNodeList.item(ctr));
//System.out.println("update Node :"+updatedNode+" \n old Child Node :"+childNode+" \n childNode1 :"+childNode);
//System.out.println("Before Replacing the dom :"+dom.getElementsByTagName("Detail2").item(0));
(dom.getElementsByTagName("Detail2").item(0)).replaceChild(updatedNode, childNode);
......@@ -3198,8 +3203,8 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,priceList);
pstmt.setString(2,itemCode);
// pstmt.setDate(3,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(4,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(3,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(4,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
//Commented and Added on 04/04/06
pstmt.setTimestamp(3,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.setTimestamp(4,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
......@@ -3231,8 +3236,8 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,priceListParent);
pstmt.setString(2,itemCode);
// pstmt.setDate(3,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(4,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(3,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(4,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
pstmt.setTimestamp(3,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.setTimestamp(4,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
rs = pstmt.executeQuery();
......@@ -3275,8 +3280,8 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,priceList);
pstmt.setString(2,itemCode);
// pstmt.setDate(3,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(4,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(3,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(4,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
pstmt.setTimestamp(3,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.setTimestamp(4,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
rs = pstmt.executeQuery();
......@@ -3306,8 +3311,8 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
System.out.println("sql :"+sql);
pstmt.setString(1,priceListParent);
pstmt.setString(2,itemCode);
// pstmt.setDate(3,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(4,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(3,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(4,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
pstmt.setTimestamp(3,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.setTimestamp(4,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
......@@ -3333,8 +3338,8 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
pstmt.setString(2,itemCode);
pstmt.setString(3,lotNo);
pstmt.setString(4,lotNo);
// pstmt.setDate(5,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(6,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(5,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(6,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
pstmt.setTimestamp(5,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.setTimestamp(6,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
rs = pstmt.executeQuery();
......@@ -3369,8 +3374,8 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
pstmt.setString(2,itemCode);
pstmt.setString(3,lotNo);
pstmt.setString(4,lotNo);
// pstmt.setDate(5,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(6,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(5,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(6,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
pstmt.setTimestamp(5,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.setTimestamp(6,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
......@@ -3423,8 +3428,8 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
pstmt.setString(2,itemCode);
pstmt.setString(3,lotNo);
pstmt.setString(4,lotNo);
// pstmt.setDate(5,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(6,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(5,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(6,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
pstmt.setTimestamp(5,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.setTimestamp(6,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
rs = pstmt.executeQuery();
......@@ -3461,8 +3466,8 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
pstmt.setString(2,itemCode);
pstmt.setString(3,lotNo);
pstmt.setString(4,lotNo);
// pstmt.setDate(5,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(6,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(5,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(6,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
pstmt.setTimestamp(5,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.setTimestamp(6,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
......@@ -3510,8 +3515,8 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,priceList);
pstmt.setString(2,itemCode);
// pstmt.setDate(3,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(4,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(3,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(4,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
pstmt.setTimestamp(3,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.setTimestamp(4,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
......@@ -3545,8 +3550,8 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
pstmt.setString(1,priceListParent);
pstmt.setString(2,itemCode);
pstmt.setString(3,String.valueOf(type));
// pstmt.setDate(4,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(5,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(4,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
// pstmt.setDate(5,java.sql.Date.valueOf(new SimpleDateFormat(genericUtility.getDBDateFormat()).format(tranDate)));
pstmt.setTimestamp(4,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.setTimestamp(5,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
......
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