Commit 5727128f authored by prane's avatar prane

price_list__disc is specified in SO header, system should protect the discount column in detail

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@191618 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 2aa401b9
......@@ -10143,8 +10143,8 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
//////// Nandkumar Gadkari-----start
/* if (lsContractNo != null && lsContractNo.trim().length() > 0) { */
valueXmlString.append("<discount >").append("<![CDATA[" + lcDiscount + "]]>")
.append("</discount>");
valueXmlString.append("<discount protect = \"1\">").append("<![CDATA[" + lcDiscount + "]]>")
.append("</discount>");//Changed by PavanR 04oct18[to protect discount if discount auto-populated]
setNodeValue(dom, "discount", getAbsString(String.valueOf(lcDiscount)));
/* } */
......@@ -10288,13 +10288,22 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
System.out.println("lcDiscount:::::::::" + lcDiscount);
// nandkumar Gadkari end---------
//Changed by PavanR 04oct18[to protect discount if discount auto-populated]
lsDiscPriceList = checkNull(genericUtility.getColumnValue("price_list__disc", dom1));
System.out.println("lsDiscPriceList" + lsDiscPriceList);
if (lcDiscount == 0 && (lsContractNo == null || lsContractNo.trim().length() == 0)) {
valueXmlString.append("<discount>").append("<![CDATA[" + lcPlistDisc + "]]>")
.append("</discount>");
System.out.println("PavanRane :: 10295 [" +lcPlistDisc+"]");
if(lsDiscPriceList != null && lsDiscPriceList.trim().length() > 0)
{
valueXmlString.append("<discount protect = \"1\">").append("<![CDATA[" + lcPlistDisc + "]]>").append("</discount>");
}else
{
valueXmlString.append("<discount protect = \"0\">").append("<![CDATA[" + lcPlistDisc + "]]>").append("</discount>");
}
setNodeValue(dom, "discount", getAbsString(String.valueOf(lcPlistDisc)));
}
lsDiscPriceList = checkNull(genericUtility.getColumnValue("price_list__disc", dom1));
System.out.println("lsDiscPriceList" + lsDiscPriceList);
//lsDiscPriceList = checkNull(genericUtility.getColumnValue("price_list__disc", dom1));
//System.out.println("lsDiscPriceList" + lsDiscPriceList);
lcRate = Double.parseDouble(genericUtility.getColumnValue("rate", dom));
System.out.println("rate in item code IC" + lcRate);
if ("M".equalsIgnoreCase(distCommon.getPriceListType(lsDiscPriceList, conn))) {
......@@ -10345,8 +10354,14 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
System.out.println("rate itemChanged Called IC" + valueXmlString.toString());
//////// Nandkumar Gadkari-----start COMMENTED
valueXmlString.append("<discount>").append("<![CDATA[" + 0 + "]]>").append("</discount>");
//Changed by PavanR 04oct18[to protect discount if discount auto-populated]
if(lsDiscPriceList != null && lsDiscPriceList.trim().length() > 0)
{
valueXmlString.append("<discount protect = \"1\">").append("<![CDATA[" + 0 + "]]>").append("</discount>");
//////// Nandkumar Gadkari-----end
}else{
valueXmlString.append("<discount protect = \"0\">").append("<![CDATA[" + 0 + "]]>").append("</discount>");
}
}
lcQtyStd = Double.parseDouble(checkDouble(genericUtility.getColumnValue("quantity__stduom", dom1)));
......@@ -10492,8 +10507,8 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
valueXmlString.append("<rate>").append("<![CDATA[" + lcRate + "]]>").append("</rate>");
System.out.println("lsContractNo::::::::::" + lsContractNo);
valueXmlString.append("<discount>").append("<![CDATA[" + lcDiscount + "]]>")
//Changed by PavanR 04oct18[to protect discount if discount auto-populated]
valueXmlString.append("<discount protect = \"1\">").append("<![CDATA[" + lcDiscount + "]]>")
.append("</discount>");
valueXmlString.append("<tax_class>").append("<![CDATA[" + lsTaxClass + "]]>")
......@@ -12416,17 +12431,30 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
ldtDateStr = mOrdDateStr;
}
lsPriceList = checkNull(genericUtility.getColumnValue("price_list", dom1));
System.out.println("lsPriceList rate" + lsPriceList);
String discPriceList = checkNull(genericUtility.getColumnValue("price_list__disc", dom1));
System.out.println("lsPriceList rate" + lsPriceList + " discPriceList " + discPriceList);
if (lsPriceList == null || lsPriceList.trim().length() == 0) {
lcPlistDisc = getDiscount(itemCode, lsUnit, mQty, dom, dom1, dom2, conn);
valueXmlString.append("<discount>").append("<![CDATA[" + lcPlistDisc + "]]>").append("</discount>");
//Changed by PavanR 04oct18[to protect discount if discount auto-populated]
if(discPriceList != null && discPriceList.trim().length() > 0)
{
valueXmlString.append("<discount protect = \"1\">").append("<![CDATA[" + lcPlistDisc + "]]>").append("</discount>");
}else{
valueXmlString.append("<discount protect = \"0\">").append("<![CDATA[" + lcPlistDisc + "]]>").append("</discount>");
}
System.out.println("lcPlistDisc2:::::::::" + lcPlistDisc);
}
if ("M".equalsIgnoreCase(getPriceList(itemCode, lsUnit, lsDiscPricelist, ldPlistDate, conn))) {
ldRate = 0.00;
valueXmlString.append("<rate>").append("<![CDATA[" + ldRate + "]]>").append("</rate>");
//////// Nandkumar Gadkari-----start COMMENTED
valueXmlString.append("<discount>").append("<![CDATA[" + '0' + "]]>").append("</discount>");
//Changed by PavanR 04oct18[to protect discount if discount auto-populated]
if(discPriceList != null && discPriceList.trim().length() > 0)
{
valueXmlString.append("<discount protect = \"1\">").append("<![CDATA[" + '0' + "]]>").append("</discount>");
}else{
valueXmlString.append("<discount protect = \"0\">").append("<![CDATA[" + '0' + "]]>").append("</discount>");
}
//////// Nandkumar Gadkari-----end
}
// changes by mayur on 25/10/17
......@@ -12716,7 +12744,13 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
calRate(checkDoubleNull(lsPlistDis), ldRate);
valueXmlString.append("<rate>").append("<![CDATA[" + ldRate + "]]>").append("</rate>");
//////// Nandkumar Gadkari-----start COMMENTED
valueXmlString.append("<discount>").append("<![CDATA[" + "0" + "]]>").append("</discount>");
//Changed by PavanR 04oct18[to protect discount if discount auto-populated]
if (lsPlistDis != null && lsPlistDis.trim().length() > 0) {
valueXmlString.append("<discount protect = \"1\">").append("<![CDATA[" + "0" + "]]>").append("</discount>");
}else{
valueXmlString.append("<discount protect = \"0\">").append("<![CDATA[" + "0" + "]]>").append("</discount>");
}
//valueXmlString.append("<discount>").append("<![CDATA[" + "0" + "]]>").append("</discount>");
//////// Nandkumar Gadkari-----end
}
......@@ -12856,27 +12890,40 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
valueXmlString.append("<quantity__stduom>").append("<![CDATA[" + mNum + "]]>")
.append("</quantity__stduom>");
setNodeValue(dom, "quantity__stduom", getAbsString(String.valueOf(mNum)));
lsPlistDiscount = genericUtility.getColumnValue("price_list__disc", dom1);
System.out.println("lsPlistDiscount" + lsPlistDiscount);
/// Nandkumar Gadkari-----------start-----
if (lsContractNo == null || lsContractNo.trim().length() == 0)
{
lsPlistDisc = String.valueOf(getDiscount(lsItemCodeOrd, mVal, mQty, dom, dom1, dom2, conn));
valueXmlString.append("<discount>").append("<![CDATA[" + lsPlistDisc + "]]>").append("</discount>");
//Changed by PavanRane 04oct18[to protect discount if discount auto-populated]
lsPlistDisc = String.valueOf(getDiscount(lsItemCodeOrd, mVal, mQty, dom, dom1, dom2, conn));
if(lsPlistDiscount != null && lsPlistDiscount.trim().length() > 0)
{
valueXmlString.append("<discount protect = \"1\">").append("<![CDATA[" + lsPlistDisc + "]]>").append("</discount>");
}else{
valueXmlString.append("<discount protect = \"0\">").append("<![CDATA[" + lsPlistDisc + "]]>").append("</discount>");
}
setNodeValue(dom, "discount", getAbsString(String.valueOf(lsPlistDisc)));
System.out.println("lsPlistDisc1::::::::::::" + lsPlistDisc);
}
// ///Nandkumar Gadkari-----------end-----
lsPlistDiscount = genericUtility.getColumnValue("price_list__disc", dom1);
System.out.println("lsPlistDiscount" + lsPlistDiscount);
//lsPlistDiscount = genericUtility.getColumnValue("price_list__disc", dom1);
//System.out.println("lsPlistDiscount" + lsPlistDiscount);
if ("M".equalsIgnoreCase(distCommon.getPriceListType(lsPlistDisc, conn))) {
ldRate = idRateWtDiscount;
lsDiscFalg = false;
valueXmlString.append("<rate>").append("<![CDATA[" + ldRate + "]]>").append("</rate>");
setNodeValue(dom, "rate", getAbsString(String.valueOf(ldRate)));
//////// Nandkumar Gadkari-----start COMMENTED
valueXmlString.append("<discount>").append("<![CDATA[" + '0' + "]]>").append("</discount>");
if(lsPlistDiscount != null && lsPlistDiscount.trim().length() > 0)
{
valueXmlString.append("<discount protect = \"1\">").append("<![CDATA[" + '0' + "]]>").append("</discount>");
}else{
valueXmlString.append("<discount protect = \"0\">").append("<![CDATA[" + '0' + "]]>").append("</discount>");
}
setNodeValue(dom, "discount", getAbsString("0"));
//////// Nandkumar Gadkari-----end
}
......
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