Commit 72dd9f7b authored by ngadkari's avatar ngadkari

new scheme_balance changes in wfValData neture column

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@191703 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4347f967
...@@ -2483,8 +2483,12 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -2483,8 +2483,12 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
// ---------------------------- Nandkumar Gadkari -------------on 03/10/18---------start-------------------- // ---------------------------- Nandkumar Gadkari -------------on 03/10/18---------start--------------------
else if (childNodeName.equalsIgnoreCase("nature")) { else if (childNodeName.equalsIgnoreCase("nature")) {
double totFreeQty = 0, unConfTotFreeQty = 0 , freeQty = 0, prvFreeQty = 0, rate1 = 0,qty=0.0; // -------------------------------------------------------------------------------------------
String lineNo = "", browItemCode = "", currLineNo = "";
double totFreeQty = 0, unConfTotFreeQty = 0 , freeQty = 0, prvFreeQty = 0, rate1 = 0,qty=0.0,mRate = 0.00,value=0.0,valueAmount=0.0;
String lineNo = "", browItemCode = "", currLineNo = "",ldtDateStr = "",lsPriceList = "",retlSchmRateBase="";
Timestamp ldtPlDate = null,ldPlistDate = null;
nature = checkNullandTrim(genericUtility.getColumnValue("nature", dom)); nature = checkNullandTrim(genericUtility.getColumnValue("nature", dom));
itemCodeOrd = checkNull(genericUtility.getColumnValue("item_code__ord", dom)); itemCodeOrd = checkNull(genericUtility.getColumnValue("item_code__ord", dom));
siteCode = checkNull(genericUtility.getColumnValue("site_code", dom1)); siteCode = checkNull(genericUtility.getColumnValue("site_code", dom1));
...@@ -2507,8 +2511,53 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -2507,8 +2511,53 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
System.out.println("quantity==" + qty); System.out.println("quantity==" + qty);
System.out.println("orderDate==" + orderDate); System.out.println("orderDate==" + orderDate);
if ("V".equalsIgnoreCase(nature.trim())) if ("V".equalsIgnoreCase(nature.trim()))
{ {
retlSchmRateBase = checkNullandTrim(distCommon.getDisparams( "999999", "RETL_SCHM_RATE_BASE", conn ));
//----------------------------------------------------
if (genericUtility.getColumnValue("pl_date", dom1) != null
&& genericUtility.getColumnValue("pl_date", dom1).trim().length() > 0) {
ldtPlDate = Timestamp
.valueOf(genericUtility.getValidDateString(genericUtility.getColumnValue("pl_date", dom1),
genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
if (ldtPlDate != null) {
ldtDateStr = genericUtility.getColumnValue("order_date", dom1);
} else {
ldtDateStr = genericUtility.getColumnValue("pl_date", dom1);
}
ldPlistDate = orderDate;
if("S".equalsIgnoreCase(retlSchmRateBase))
{
lsPriceList = checkNull(genericUtility.getColumnValue("price_list", dom1));
}
if("M".equalsIgnoreCase(retlSchmRateBase))
{
lsPriceList = checkNullandTrim(distCommon.getDisparams( "999999", "MRP", conn ));
}
if (lsPriceList != null || lsPriceList.trim().length() > 0)
{
mRate = distCommon.pickRate(lsPriceList, ldtDateStr, itemCodeOrd, "", "L", qty, conn);
System.out.print("mRate gbfICquantity++++++++" + mRate);
System.out.print("mqty++++++++" + qty);
}
valueAmount= qty * mRate;
//---------------------------------------------------
sql = " SELECT BALANCE_FREE_VALUE - USED_FREE_VALUE FROM SCHEME_BALANCE WHERE BALANCE_FREE_VALUE - USED_FREE_VALUE > 0 " sql = " SELECT BALANCE_FREE_VALUE - USED_FREE_VALUE FROM SCHEME_BALANCE WHERE BALANCE_FREE_VALUE - USED_FREE_VALUE > 0 "
...@@ -2530,7 +2579,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -2530,7 +2579,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
pstmt = null; pstmt = null;
if(freeQty > 0) if(freeQty > 0)
{ {
sql = " select sum(case when nature ='V' then quantity else 0 end) as unconfirmFreeQty " + sql = " select a.price_list,a.pl_date,b.quantity , a.order_date" +
" 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 = ? "
+ " and a.cust_code = ? and a.sale_order <> ? and a.order_date between ? and ?" + " and a.cust_code = ? and a.sale_order <> ? and a.order_date between ? and ?"
+ " and (case when a.confirmed is null then 'N' else a.confirmed end )= 'N' and b.nature in ('V')"; + " and (case when a.confirmed is null then 'N' else a.confirmed end )= 'N' and b.nature in ('V')";
...@@ -2542,10 +2591,47 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -2542,10 +2591,47 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
pstmt1.setTimestamp(4, orderDate); pstmt1.setTimestamp(4, orderDate);
pstmt1.setTimestamp(5, orderDate); pstmt1.setTimestamp(5, orderDate);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
if (rs1.next()) { while (rs1.next()) {
unConfTotFreeQty = rs1.getDouble("unconfirmFreeQty"); lsPriceList = rs1.getString(1);
System.out.println("unConfTotFreeQty separte free" + unConfTotFreeQty); ldtPlDate = rs1.getTimestamp(2);
qty = rs1.getDouble(3);
orderDate = rs1.getTimestamp(4);
if (ldtPlDate != null) {
ldtDateStr = sdf.format(orderDate);
} else {
ldtDateStr = sdf.format(ldtPlDate);
}
ldPlistDate = orderDate;
if("S".equalsIgnoreCase(retlSchmRateBase))
{
lsPriceList = checkNull(genericUtility.getColumnValue("price_list", dom1));
}
if("M".equalsIgnoreCase(retlSchmRateBase))
{
lsPriceList = checkNullandTrim(distCommon.getDisparams( "999999", "MRP", conn ));
}
if (lsPriceList != null || lsPriceList.trim().length() > 0)
{
mRate = distCommon.pickRate(lsPriceList, ldtDateStr, itemCodeOrd, "", "L", qty, conn);
System.out.print("mRate gbfICquantity++++++++" + mRate);
System.out.print("mqty++++++++" + qty);
}
value= qty * mRate;
unConfTotFreeQty= unConfTotFreeQty + value;
System.out.println("unConfTotFreeQty separte free" + lsPriceList +ldtPlDate+ qty );
} }
pstmt1.close(); pstmt1.close();
...@@ -2553,6 +2639,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -2553,6 +2639,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
pstmt1 = null; pstmt1 = null;
rs1 = null; rs1 = null;
//-----------------------------
//--------------------------- //---------------------------
Node currDetail1 = null; Node currDetail1 = null;
...@@ -2561,8 +2648,26 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -2561,8 +2648,26 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
currLineNo = checkNull(genericUtility.getColumnValue("line_no", dom)); currLineNo = checkNull(genericUtility.getColumnValue("line_no", dom));
NodeList detailList1 = dom2.getElementsByTagName("Detail2"); NodeList detailList1 = dom2.getElementsByTagName("Detail2");
int noOfDetails = detailList1.getLength(); int noOfDetails = detailList1.getLength();
lsPriceList = checkNull(genericUtility.getColumnValue("price_list", dom1));
if (genericUtility.getColumnValue("pl_date", dom1) != null
&& genericUtility.getColumnValue("pl_date", dom1).trim().length() > 0) {
ldtPlDate = Timestamp
.valueOf(genericUtility.getValidDateString(genericUtility.getColumnValue("pl_date", dom1),
genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
if (ldtPlDate != null) {
ldtDateStr = genericUtility.getColumnValue("order_date", dom1);
} else {
ldtDateStr = genericUtility.getColumnValue("pl_date", dom1);
}
ldPlistDate = orderDate;
for (int ctr1 = 0; ctr1 < noOfDetails; ctr1++) { for (int ctr1 = 0; ctr1 < noOfDetails; ctr1++) {
currDetail1 = detailList1.item(ctr1); currDetail1 = detailList1.item(ctr1);
...@@ -2570,7 +2675,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -2570,7 +2675,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
lineNo = checkNullandTrim(genericUtility.getColumnValueFromNode("line_no", currDetail1)); lineNo = checkNullandTrim(genericUtility.getColumnValueFromNode("line_no", currDetail1));
nature = checkNull(genericUtility.getColumnValueFromNode("nature", currDetail1)); nature = checkNull(genericUtility.getColumnValueFromNode("nature", currDetail1));
browItemCode = checkNull(genericUtility.getColumnValueFromNode("item_code", currDetail1)); browItemCode = checkNull(genericUtility.getColumnValueFromNode("item_code", currDetail1));
quantity = checkDoubleNull(genericUtility.getColumnValueFromNode("quantity", currDetail1)); quantity = checkDoubleNull(genericUtility.getColumnValueFromNode("ord_value", currDetail1));
System.out.println("rate1: ====" + rate1 + "]lineNo" + lineNo + "quantity"+quantity); System.out.println("rate1: ====" + rate1 + "]lineNo" + lineNo + "quantity"+quantity);
...@@ -2579,8 +2684,21 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -2579,8 +2684,21 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
if (!currLineNo.trim().equalsIgnoreCase(lineNo.trim())) { if (!currLineNo.trim().equalsIgnoreCase(lineNo.trim())) {
System.out.println("Insideif00000forSCHEME_BALANCE "); System.out.println("Insideif00000forSCHEME_BALANCE ");
if (nature.equals("V")) { if (nature.equals("V")) {
prvFreeQty = prvFreeQty + quantity;
if("M".equalsIgnoreCase(retlSchmRateBase))
{
lsPriceList = checkNullandTrim(distCommon.getDisparams( "999999", "MRP", conn ));
}
if (lsPriceList != null || lsPriceList.trim().length() > 0)
{
mRate = distCommon.pickRate(lsPriceList, ldtDateStr, browItemCode, "", "L", quantity, conn);
System.out.print("mRate gbfICquantity++++++++" + mRate);
System.out.print("mqty++++++++" + quantity);
}
value =quantity * mRate;
prvFreeQty =prvFreeQty + value;
} }
System.out.println( System.out.println(
"prvFreeQty insdie V[" + prvFreeQty+ "]"); "prvFreeQty insdie V[" + prvFreeQty+ "]");
...@@ -2588,7 +2706,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -2588,7 +2706,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
} }
} }
if ((qty +unConfTotFreeQty + prvFreeQty ) > freeQty) { if ((valueAmount +unConfTotFreeQty + prvFreeQty ) > freeQty) {
errCode = "VTFREEQTY1";// Entered free quantity is errCode = "VTFREEQTY1";// Entered free quantity is
// greater than scheme's free // greater than scheme's free
// quantity // quantity
...@@ -10841,6 +10959,23 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -10841,6 +10959,23 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
if (currentColumn.trim().equalsIgnoreCase("nature")) { if (currentColumn.trim().equalsIgnoreCase("nature")) {
valueXmlString = (gbfIcNature(valueXmlString, dom, dom1, dom2, editFlag, xtraParams, objContext, valueXmlString = (gbfIcNature(valueXmlString, dom, dom1, dom2, editFlag, xtraParams, objContext,
conn)); conn));
//Nandkumar Gadkari on 04/10/18----------------------
double mRate= 0.0;
String nature="";
nature = checkNull(genericUtility.getColumnValue("nature", dom));
if ("V".equalsIgnoreCase(nature) || "I".equalsIgnoreCase(nature))
{
valueXmlString.append("<rate>").append("<![CDATA[" + mRate + "]]>").append("</rate>");
setNodeValue(dom, "rate", getAbsString(String.valueOf(mRate)));
valueXmlString.append("<rate__stduom>").append("<![CDATA[" + mRate + "]]>")
.append("</rate__stduom>");
}
//Nandkumar Gadkari on 04/10/18----------------------
} }
if (currentColumn.trim().equalsIgnoreCase("price_list__disc")) { if (currentColumn.trim().equalsIgnoreCase("price_list__disc")) {
// valueXmlString.append(gbfIcSiteCode(valueXmlString,dom,dom1,dom2,editFlag, // valueXmlString.append(gbfIcSiteCode(valueXmlString,dom,dom1,dom2,editFlag,
......
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