Commit 979d6d42 authored by Mohammed Dohadwala's avatar Mohammed Dohadwala

Added Validation for customer group.

parent 230f9dcb
......@@ -167,6 +167,46 @@ public class ReqForQuotationIC 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 groupCode = "select group_code from customer where cust_code= ?";
// PreparedStatement quotationcodePs = connection.prepareStatement(groupCode);
// quotationcodePs.setString(1, quotationcode);
// ResultSet quotationcodeRs = quotationcodePs.executeQuery();
String quotationtypeSql = "select count(group_code) as customergroupcount from customer where group_code= ?";
PreparedStatement quotationtypePs = connection.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)
{
errString = getErrorString("cust_code", "INVCG", userId);
break;
}
}
if(quotationtypeRs != null)
{
quotationtypeRs.close();
quotationtypeRs = null;
}
if(quotationtypePs != null)
{
quotationtypePs.close();
quotationtypePs = null;
}
}
}
if( childNodeName.equalsIgnoreCase("sales_pers") )
{
......@@ -435,7 +475,7 @@ public class ReqForQuotationIC extends ValidatorEJB {
}
BaseLogger.log("3", null, null, "ReqForQuotationIC in condition itemCode wfValData phyAttrVal::: [" + phyAttrVal + "]");
if(phyAttrVal.equalsIgnoreCase("SRNA")) {
errString = getErrorString("rate_quot", "INVQR", userId);
errString = getErrorString("rate_quot", "INEFSR", userId);
BaseLogger.log("3", null, null, "ReqForQuotationIC in PHY_ATTRIB_19 details null errString:: [" + errString + "]");
break;
......
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