Commit bb79655f authored by Mohammed Dohadwala's avatar Mohammed Dohadwala

Added Validation for customer group.

parent 979d6d42
......@@ -207,6 +207,44 @@ public class ReqForQuotationWiz extends ValidatorEJB{
}
}
if( childNodeName.equalsIgnoreCase("quot_type") )
{
String customerCode = checkNull(genericUtility.getColumnValue("cust_code", dom));
String quotationtype = checkNull(genericUtility.getColumnValue("quot_type", dom));
BaseLogger.log("3", null, null, "ReqForQuotationIC quotationtype wfValData case 1 [" + quotationtype + "]");
if (quotationtype.equalsIgnoreCase("G"))
{
String quotationtypeSql = "select count(group_code) as customergroupcount from customer where group_code= ?";
PreparedStatement quotationtypePs = connectionObject.prepareStatement(quotationtypeSql);
quotationtypePs.setString(1, customerCode);
ResultSet quotationtypeRs = quotationtypePs.executeQuery();
while(quotationtypeRs.next())
{
int customergroupcount = quotationtypeRs.getInt("customergroupcount");
BaseLogger.log("3", null, null, "ReqForQuotationIC group_count wfValData case 1 quotationtypeRs::[" + customergroupcount + "]");
if(customergroupcount<=1)
{
errCode="INVCG";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
if(quotationtypeRs != null)
{
quotationtypeRs.close();
quotationtypeRs = null;
}
if(quotationtypePs != null)
{
quotationtypePs.close();
quotationtypePs = null;
}
}
}
if( childNodeName.equalsIgnoreCase("site_code") )
{
String siteCode = checkNull(genericUtility.getColumnValue("site_code", dom));
......@@ -492,6 +530,37 @@ public class ReqForQuotationWiz extends ValidatorEJB{
BaseLogger.log("3", null, null, "ReqForQuotationWiz in competitor details null errString:: [" + errString + "]");
}
}
String itemCode = checkNull(genericUtility.getColumnValue("item_code", dom));
String phyAttrVal = "";
BaseLogger.log("3", null, null, "ReqForQuotationIC in condition itemCode wfValData itemCode::: [" + itemCode + "]");
String phyAttrValSql = "select PHY_ATTRIB_19 from item where item_code = ?";
PreparedStatement phyAttrValPs = connectionObject.prepareStatement(phyAttrValSql);
phyAttrValPs.setString(1, itemCode);
ResultSet phyAttrValRs = phyAttrValPs.executeQuery();
while(phyAttrValRs.next()) {
phyAttrVal = checkNull(phyAttrValRs.getString("PHY_ATTRIB_19"));
}
BaseLogger.log("3", null, null, "ReqForQuotationIC in condition itemCode wfValData phyAttrVal::: [" + phyAttrVal + "]");
if(phyAttrVal.equalsIgnoreCase("SRNA")) {
errString = getErrorString("rate_quot", "INVQR", userId);
BaseLogger.log("3", null, null, "ReqForQuotationIC in PHY_ATTRIB_19 details null errString:: [" + errString + "]");
break;
}
if(phyAttrValPs != null)
{
phyAttrValPs.close();
phyAttrValPs = null;
}
if(phyAttrValRs != null)
{
phyAttrValRs.close();
phyAttrValRs = null;
}
}
//Added changes on 25-March-26 by Ajit [Start]
......@@ -1031,6 +1100,9 @@ public class ReqForQuotationWiz extends ValidatorEJB{
if ("itm_default".equalsIgnoreCase(currentColumn.trim())) {
int domId = 0;
int lineNo = 0;
String setSrPtrAll = checkNull(genericUtility.getColumnValue("set_sr_ptr_all", dom1, "1"));
BaseLogger.log("3", null, null, "ReqForQuotationWiz in itm default setSrPtrAll:: " + setSrPtrAll);
String custCode = checkNull(genericUtility.getColumnValue("cust_code", dom1));
String itemSer = checkNull(genericUtility.getColumnValue("item_ser",dom1,"1"));
BaseLogger.log("3", null, null, "ReqForQuotationWiz in itm default ");
......@@ -1254,7 +1326,16 @@ public class ReqForQuotationWiz extends ValidatorEJB{
valueXmlString.append("<ptd>").append("<![CDATA["+ptd+"]]>").append("</ptd>\r\n");
valueXmlString.append("<pts>").append("<![CDATA["+pts+"]]>").append("</pts>\r\n");
valueXmlString.append("<ptr>").append("<![CDATA["+rate+"]]>").append("</ptr>\r\n");
valueXmlString.append("<rate_quot>").append("<![CDATA[]]>").append("</rate_quot>");
if (setSrPtrAll.trim().equalsIgnoreCase("Y"))
{
valueXmlString.append("<rate_quot>").append("<![CDATA[" + rate + "]]>").append("</rate_quot>");
}
else
{
valueXmlString.append("<rate_quot>").append("<![CDATA[]]>").append("</rate_quot>");
}
valueXmlString.append("<qty_quot>").append("<![CDATA[0]]>").append("</qty_quot>");
valueXmlString.append("<competitor_rate>").append("<![CDATA[]]>").append("</competitor_rate>");
valueXmlString.append("<competitor_name>").append("<![CDATA[]]>").append("</competitor_name>");
......@@ -1313,6 +1394,28 @@ public class ReqForQuotationWiz extends ValidatorEJB{
String itemCode = checkNull(genericUtility.getColumnValue("item_code", dom));
String rateApprv = checkNull(genericUtility.getColumnValue("rate_apprv", dom));
String ratePtr = checkNull(genericUtility.getColumnValue("ptr", dom));
String rateQuotStr = checkNull(genericUtility.getColumnValue("rate_quot", dom));
String qtyStr = checkNull(genericUtility.getColumnValue("qty_quot", dom));
int qty = 0;
int rateQuotInt = 0;
int value = 0;
BaseLogger.log("3", null, null, "ReqForQuotationWiz in qty_quot condition qtyStr:: " + qtyStr);
BaseLogger.log("3", null, null,
"ReqForQuotationWiz in qty_quot condition rateQuotStr:: " + rateQuotStr);
try {
qty = (qtyStr != null && qtyStr.trim().length() > 0) ? Integer.parseInt(qtyStr.trim()) : 0;
rateQuotInt = (rateQuotStr != null && rateQuotStr.trim().length() > 0)
? Integer.parseInt(rateQuotStr.trim())
: 0;
value = qty*rateQuotInt;
BaseLogger.log("3", null, null, "ReqForQuotationWiz in qty:: " + qty + " rateQuotInt::"
+ rateQuotInt + " value::" + value);
} catch (Exception e) {
BaseLogger.log("3", null, null, "Error parsing margin values");
}
BaseLogger.log("3", null, null, "ReqForQuotationIC in rate_quot:: "+rateQuot+" rateApprv::"+rateApprv+ " ratePtr::"+ratePtr+" itemCode::"+itemCode);
BaseLogger.log("3", null, null, "ReqForQuotationWiz in rate_quot:: "+rateQuot+" rateApprv::"+rateApprv+ " ratePtr::"+ratePtr);
......@@ -1403,9 +1506,20 @@ public class ReqForQuotationWiz extends ValidatorEJB{
BaseLogger.log("3", null, null, "revisedPtr::" + revisedPtr + " revisedPts::" + revisedPts + " revisedPtd::" + revisedPtd);
BaseLogger.log("3", null, null, "revisedPtr::" + revisedPtr + " revisedPts::" + revisedPts + " revisedPtd:: " + revisedPtd + "]");
valueXmlString.append("<revised_ptr>").append("<![CDATA[" + revisedPtr + "]]>").append("</revised_ptr>\r\n");
valueXmlString.append("<revised_pts>").append("<![CDATA[" + revisedPts + "]]>").append("</revised_pts>\r\n");
valueXmlString.append("<revised_ptd>").append("<![CDATA[" + revisedPtd + "]]>").append("</revised_ptd>\r\n");
String domId = checkNull(genericUtility.getColumnValue("domid", dom));
BaseLogger.log("3", null, null, "domId::>>"+domId);
valueXmlString.append("<Detail" + objContext + " domID='" + domId + "' objContext='" + currentFormNo + "' objName=\"rfq_wiz\" selected=\"N\">\r\n");
valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"tran_id:line_no\"/>\r\n");
valueXmlString.append("<revised_ptr><![CDATA[" + revisedPtr + "]]></revised_ptr>\r\n");
valueXmlString.append("<revised_pts><![CDATA[" + revisedPts + "]]></revised_pts>\r\n");
valueXmlString.append("<revised_ptd><![CDATA[" + revisedPtd + "]]></revised_ptd>\r\n");
valueXmlString.append("<value><![CDATA[" + value + "]]></value>\r\n");
valueXmlString.append("</Detail" + objContext + ">");
}
......
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