Commit b9f57a77 authored by wansari's avatar wansari

D16JSUN0002 In branch updated source to get price list and discount from...

D16JSUN0002  In branch updated source to get price list and discount from datbase in case of edit mode.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@104906 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d904c10b
......@@ -623,7 +623,7 @@ public class ScontractGwtIC extends ValidatorEJB implements ScontractGwtICLocal,
for (int selectedRow = 0; selectedRow < parentNodeListLength; selectedRow++)
{
itemCode = "";rateOpt = "";lineNo = "";selected = "";
itemCode = "";rateOpt = "";lineNo = "";selected = "";priceList = "";
deleteFlag = false;
parentNode = parentNodeList.item(selectedRow);
......@@ -675,6 +675,10 @@ public class ScontractGwtIC extends ValidatorEJB implements ScontractGwtICLocal,
{
ValidUpto = checkNullAndTrim(childNode.getFirstChild().getNodeValue());
}
else if(childNode != null && "price_list".equalsIgnoreCase(childNode.getNodeName()) && childNode.getFirstChild() != null)
{
priceList = checkNullAndTrim(childNode.getFirstChild().getNodeValue());
}
}
System.out.println("Item Code ["+itemCode+"] Line Number["+lineNo+"] Rate Opt["+rateOpt+"]");
......@@ -798,6 +802,30 @@ public class ScontractGwtIC extends ValidatorEJB implements ScontractGwtICLocal,
{
recordList.add(itemCode);
}
if(priceList != null && priceList.length() > 0)
{
sql = " SELECT COUNT(*) FROM PRICELIST_MST WHERE PRICE_LIST = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, priceList);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
if(cnt == 0 )
{
return getError(" \n Line Number: "+lineNo+", Item Code: "+itemCode+" ", "STKVALPRAE", conn);
}
}
if(rs!=null)
{
rs.close();rs = null;
}
if(pstmt!=null)
{
pstmt.close();pstmt = null;
}
}
}
}
......@@ -1429,7 +1457,7 @@ public class ScontractGwtIC extends ValidatorEJB implements ScontractGwtICLocal,
valueXmlString.append("<confirmed>").append("<![CDATA[N]]>").append("</confirmed>");
valueXmlString.append("<edit_status>").append("<![CDATA["+editFlag+"]]>").append("</edit_status>");
}
else if(currentColumn.trim().equalsIgnoreCase("cust_code"))
else if(currentColumn.trim().equalsIgnoreCase("cust_code") || currentColumn.trim().equalsIgnoreCase("cust_type"))
{
String contractDateAppl = "";
custCode = genericUtility.getColumnValue("cust_code", dom);
......@@ -2887,7 +2915,7 @@ public class ScontractGwtIC extends ValidatorEJB implements ScontractGwtICLocal,
valueXmlString.append("<tax_class >").append("<![CDATA[" + taxClass + "]]>").append("</tax_class>");
valueXmlString.append("<tax_env >").append("<![CDATA[" + taxEnv + "]]>").append("</tax_env>");
priceList = genericUtility.getColumnValue("PRICE_LIST", dom1);
/*priceList = genericUtility.getColumnValue("PRICE_LIST", dom1);
priceListClg = genericUtility.getColumnValue("PRICE_LIST__CLG", dom1);
//String quantityStr = genericUtility.getColumnValue("QUANTITY", dom).trim();
String quantityStr = genericUtility.getColumnValue("QUANTITY", dom);
......@@ -2923,7 +2951,7 @@ public class ScontractGwtIC extends ValidatorEJB implements ScontractGwtICLocal,
else
{
valueXmlString.append("<rate__clg >").append("<![CDATA[" + rate + "]]>").append("</rate__clg>");
}
}*/
//Changed by wasim for rate [START]
//Commented temporary
......@@ -2933,7 +2961,7 @@ public class ScontractGwtIC extends ValidatorEJB implements ScontractGwtICLocal,
pos = reStr.indexOf("</Detail3>");
reStr = reStr.substring(0,pos);
valueXmlString.append(reStr);*/
try
/*try
{
num = Integer.parseInt(genericUtility.getColumnValue("rate", dom));
}
......@@ -2988,10 +3016,10 @@ public class ScontractGwtIC extends ValidatorEJB implements ScontractGwtICLocal,
if(priceListClg == null || priceListClg.trim().length() == 0)
{
valueXmlString.append("<rate__clg >").append("<![CDATA[" + num + "]]>").append("</rate__clg>");
}
}*/
//Changed by wasim for rate [END]
if(itemCode != null && itemCode.trim().length() > 0 )
/*if(itemCode != null && itemCode.trim().length() > 0 )
{
contractDateStr = genericUtility.getValidDateString(genericUtility.getColumnValue("contract_date", dom1) , genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat());
contractDate = Timestamp.valueOf(contractDateStr + " 00:00:00.0");
......@@ -3152,7 +3180,7 @@ public class ScontractGwtIC extends ValidatorEJB implements ScontractGwtICLocal,
else
{
nespRate = 0;
}
}*/
valueXmlString.append("<rate__nesp >").append("<![CDATA[" + nespRate + "]]>").append("</rate__nesp>");
valueXmlString.append("<chg_date >").append("<![CDATA["+ldDate+"]]>").append("</chg_date>");
......
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