Commit 25fc318e authored by jshaikh's avatar jshaikh
parent b26d8ca7
...@@ -1862,7 +1862,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -1862,7 +1862,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
schAttr = checkNull(genericUtility.getColumnValue("sch_attr", dom)); schAttr = checkNull(genericUtility.getColumnValue("sch_attr", dom));
System.out.println("schAttr::[" + schAttr + "]"); System.out.println("schAttr::[" + schAttr + "]");
nature = checkNull(genericUtility.getColumnValue("nature", dom)); nature = checkNull(genericUtility.getColumnValue("nature", dom));
//------Added by Jaffar S. //------Added by Jaffar S. on 29-01-19
System.out.println("lbOrdFlg ----- "+lbOrdFlg); System.out.println("lbOrdFlg ----- "+lbOrdFlg);
System.out.println("nature ----- "+nature); System.out.println("nature ----- "+nature);
if(lbOrdFlg == true) if(lbOrdFlg == true)
...@@ -15742,9 +15742,10 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -15742,9 +15742,10 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
saleOrder = ""; saleOrder = "";
} }
if (lbParent == false) { if (lbParent == false) {
sql = "select sum(case when nature ='C' then quantity else 0 end) as unconfirmChargeQty ," sql = "select sum(case when nature ='C' then quantity else 0 end) as unconfirmChargeQty, "
+ " sum(case int cnt = 0,cntof = 0,cntpur = 0;\n" + //--- Commented by Jaffar S on 30-01-19 for fixing the below line which was already presented when the component has been developed
" when nature ='F' then quantity else 0 end) as unconfirmFreeQty ," //+ " sum(case int cnt = 0,cntof = 0,cntpur = 0;\n" +
+ "sum(case when nature ='F' then quantity else 0 end) as unconfirmFreeQty, "
+ "sum(case when nature ='B' then quantity else 0 end)as unconfirmBonusQty, " + "sum(case when nature ='B' then quantity else 0 end)as unconfirmBonusQty, "
+ "sum(case when nature ='S' then quantity else 0 end)as unconfirmSampleQty " + "sum(case when nature ='S' then quantity else 0 end)as unconfirmSampleQty "
+ "from sorder a,sorddet b where a.sale_order = b.sale_order and a.site_code = ? " + "from sorder a,sorddet b where a.sale_order = b.sale_order and a.site_code = ? "
...@@ -15817,7 +15818,9 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -15817,7 +15818,9 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
+ " sum(case when nature ='B' then quantity else 0 end)- sum(case when nature ='B' then qty_desp else 0 end) as confirmBonusQty," + " sum(case when nature ='B' then quantity else 0 end)- sum(case when nature ='B' then qty_desp else 0 end) as confirmBonusQty,"
+ " sum(case when nature ='S' then quantity else 0 end)- sum(case when nature ='S' then qty_desp else 0 end) as confirmSampleQty " + " sum(case when nature ='S' then quantity else 0 end)- sum(case when nature ='S' then qty_desp else 0 end) as confirmSampleQty "
+ "from sorditem ,SORDER where sorditem.sale_order = SORDER.SALE_ORDER AND sorditem.site_code = ? AND SORDER.cust_code =? " + "from sorditem ,SORDER where sorditem.sale_order = SORDER.SALE_ORDER AND sorditem.site_code = ? AND SORDER.cust_code =? "
+ "and sorditem.sale_order <> ? and sorditem.line_type <> 'B' and sorditem.order_date between '? and ? " //-----Commented and changes made by Jaffar S on 30-01-19 for fixing the below line of the query which was presented from the beginning of the developed component
//+ "and sorditem.sale_order <> ? and sorditem.line_type <> 'B' and sorditem.order_date between '? and ? "
+ "and sorditem.sale_order <> ? and sorditem.line_type <> 'B' and sorditem.order_date between ? and ? "
+ "and (sorditem.item_code in (select item_code from item where item_code__parent =?) OR sorditem.item_code = ?)" + "and (sorditem.item_code in (select item_code from item where item_code__parent =?) OR sorditem.item_code = ?)"
+ " and sorditem.nature in ('C' ,?) "; + " and sorditem.nature in ('C' ,?) ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -15831,10 +15834,19 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -15831,10 +15834,19 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
pstmt.setString(8, nature); pstmt.setString(8, nature);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) { if (rs.next()) {
ConfTotChargeQty = rs.getDouble("unconfirmChargeQty"); //---Commented & changed by Jaffar S on 30-01-19 for using the correct alias which is used in above query [Start]
/*ConfTotChargeQty = rs.getDouble("unconfirmChargeQty");
ConfTotFreeQty = rs.getDouble("unconfirmFreeQty"); ConfTotFreeQty = rs.getDouble("unconfirmFreeQty");
ConfTotSampleQty = rs.getDouble("unconfirmSampleQty"); ConfTotSampleQty = rs.getDouble("unconfirmSampleQty");
ConfTotBonusQty = rs.getDouble("unconfirmBonusQty"); ConfTotBonusQty = rs.getDouble("unconfirmBonusQty");*/
ConfTotChargeQty = rs.getDouble("confirmChargeQty");
ConfTotFreeQty = rs.getDouble("confirmFreeQty");
ConfTotSampleQty = rs.getDouble("confirmSampleQty");
ConfTotBonusQty = rs.getDouble("confirmBonusQty");
//---Commented & changed by Jaffar S on 30-01-19 for using the correct alias which is used in above query [End]
} }
pstmt.close(); pstmt.close();
rs.close(); rs.close();
...@@ -15923,7 +15935,8 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -15923,7 +15935,8 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
+ " And case when max_qty is null then 0 else max_qty end"; + " And case when max_qty is null then 0 else max_qty end";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, schemeCode1); pstmt.setString(1, schemeCode1);
pstmt.setDouble(1, chargeQty); //pstmt.setDouble(1, chargeQty);--------Commented & fixed by Jaffar S on 30-01-19 (Same parameter Index was set from beginning)
pstmt.setDouble(2, chargeQty);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) { if (rs.next()) {
cnt = rs.getInt(1); cnt = rs.getInt(1);
...@@ -15941,9 +15954,10 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -15941,9 +15954,10 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
System.out System.out
.println("Chargeable quantity of group of items is not eligible for the free quantity"); .println("Chargeable quantity of group of items is not eligible for the free quantity");
} }
sql = "select bom.batch_qty,bomdet.qty_per,bomdet.min_qty ,bomdet.app_min_qty,bomdet.app_max_qty,bomdet.round ,bomdet.round_to from bom, bomdet where bom.bom_code = bomdet.bom_code and bomdet.bom_code = ? and bomdet.nature = ?"; sql = "select bom.batch_qty,bomdet.qty_per,bomdet.min_qty,bomdet.app_min_qty,bomdet.app_max_qty,bomdet.round,bomdet.round_to from bom, bomdet where bom.bom_code = bomdet.bom_code and bomdet.bom_code = ? and bomdet.nature = ?";
pstmt.setString(1, schemeCode1); pstmt.setString(1, schemeCode1);
pstmt.setString(1, nature); //pstmt.setString(1, nature);--------Commented & fixed by Jaffar S on 30-01-19 (Same parameter Index was set from beginning)
pstmt.setString(2, nature);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) { if (rs.next()) {
batQty = rs.getDouble("batch_qty"); batQty = rs.getDouble("batch_qty");
......
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