Commit f8628199 authored by rtelang's avatar rtelang

SalesBudgetCustIC.java

MESSAGES.SQL
-Added validation of customer code and position code

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@198057 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ce451a0c
...@@ -92,6 +92,10 @@ public class SalesBudgetCustIC extends ValidatorEJB implements SalesBudgetCustIC ...@@ -92,6 +92,10 @@ public class SalesBudgetCustIC extends ValidatorEJB implements SalesBudgetCustIC
ArrayList <String>errFields = new ArrayList <String> (); ArrayList <String>errFields = new ArrayList <String> ();
StringBuffer errStringXml = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root><Errors>"); StringBuffer errStringXml = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root><Errors>");
//Modified by Rohini T on 5/March/2019[START]
String posCode = "";
//Modified by Rohini T on 5/March/2019[END]
try try
{ {
SimpleDateFormat simpleDateFormatObj = new SimpleDateFormat(genericUtility.getApplDateFormat()); SimpleDateFormat simpleDateFormatObj = new SimpleDateFormat(genericUtility.getApplDateFormat());
...@@ -263,6 +267,74 @@ conn = getConnection(); ...@@ -263,6 +267,74 @@ conn = getConnection();
errFields.add( childNodeName.toLowerCase() ); errFields.add( childNodeName.toLowerCase() );
} }
} }
//Modified by Rohini T on 5/March/2019[START]
else if(childNodeName.equalsIgnoreCase("cust_code"))
{
custCode = genericUtility.getColumnValue("cust_code", dom);
System.out.println("custCode--->["+custCode+"]");
if(custCode != null && custCode.length() > 0)
{
sql= "select count(*) from customer where cust_code = ? and (case when black_listed is null then 'N' else BLACK_LISTED end) = 'N'";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,custCode);
rs=pstmt.executeQuery();
if(rs.next())
{
cnt1=rs.getInt(1);
}
if(rs!=null)
{
rs.close();
rs=null;
}
if(pstmt!=null)
{
pstmt.close();
pstmt=null;
}
System.out.println("Count value for custCode--->"+cnt1);
if(cnt1 == 0)
{
errCode = "VTIVCC";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
}
}
else if(childNodeName.equalsIgnoreCase("pos_code"))
{
posCode = genericUtility.getColumnValue("pos_code", dom);
if(posCode != null && posCode.length() > 0)
{
sql= "select count(*) from org_structure where pos_code = ? and active = 'Y'";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,posCode);
rs=pstmt.executeQuery();
if(rs.next())
{
cnt1=rs.getInt(1);
}
if(rs!=null)
{
rs.close();
rs=null;
}
if(pstmt!=null)
{
pstmt.close();
pstmt=null;
}
System.out.println("Count value for posCode--->"+cnt1);
if(cnt1 == 0)
{
errCode = "INVPOSCODE";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
}
}
//Modified by Rohini T on 5/March/2019[END]
} //end for loop } //end for loop
break; break;
...@@ -275,6 +347,8 @@ conn = getConnection(); ...@@ -275,6 +347,8 @@ conn = getConnection();
{ {
childNode = childNodeList.item(ctr); childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
//Modified by Rohini T on 5/March/2019[START]
/*
if (childNodeName.equalsIgnoreCase("cust_code")) if (childNodeName.equalsIgnoreCase("cust_code"))
{ {
custCode = checkNull(genericUtility.getColumnValue("cust_code",dom)); custCode = checkNull(genericUtility.getColumnValue("cust_code",dom));
...@@ -300,7 +374,8 @@ conn = getConnection(); ...@@ -300,7 +374,8 @@ conn = getConnection();
errList.add( errCode ); errList.add( errCode );
errFields.add( childNodeName.toLowerCase() ); errFields.add( childNodeName.toLowerCase() );
} }
} } */
//Modified by Rohini T on 5/March/2019[end]
if (childNodeName.equalsIgnoreCase("prd_code")) if (childNodeName.equalsIgnoreCase("prd_code"))
{ {
prdCode = checkNull(genericUtility.getColumnValue("prd_code",dom)); prdCode = checkNull(genericUtility.getColumnValue("prd_code",dom));
......
...@@ -34,4 +34,86 @@ insert into messages (msg_no,msg_str,msg_descr,msg_type,msg_opt,msg_time,alarm,e ...@@ -34,4 +34,86 @@ insert into messages (msg_no,msg_str,msg_descr,msg_type,msg_opt,msg_time,alarm,e
values ('VTADJAMT1','Adjusted amount is greater','Adjustment amount can not e greater than the net amount.','E','Y',null,null,null,sysdate,'BASE','BASE',null,null); values ('VTADJAMT1','Adjusted amount is greater','Adjustment amount can not e greater than the net amount.','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);
commit; commit;
--Added by Anjali R. on [28/02/2019][Added msg for misc_rcp to show error if adjustment amount is greater than net amount ][End] --Added by Anjali R. on [28/02/2019][Added msg for misc_rcp to show error if adjustment amount is greater than net amount ][End]
\ No newline at end of file
--Added by Rohini T. on [05/03/2019][Start]
Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION) values ('INVPOSCODE','ENTER A POSITION CODE','INVALID POSITION CODE !','E',null,null,null,null,null,null,null,null,null);
INSERT
INTO POPHELP
(
FIELD_NAME,
MOD_NAME,
SQL_STR,
DW_OBJECT,
MSG_TITLE,
WIDTH,
HEIGHT,
CHG_DATE,
CHG_USER,
CHG_TERM,
DIST_OPT,
FILTER_STRING,
SQL_INPUT,
DEFAULT_COL,
POP_ALIGN,
QUERY_MODE,
PAGE_CONTEXT,
POPHELP_COLS,
POPHELP_SOURCE,
MULTI_OPT,
HELP_OPTION,
POPUP_XSL_NAME,
AUTO_FILL_LEN,
THUMB_OBJ,
THUMB_IMAGE_COL,
THUMB_ALT_COL,
AUTO_MIN_LENGTH,
OBJ_NAME__DS,
DATA_MODEL_NAME,
VALIDATE_DATA,
ITEM_CHANGE,
MSG_NO,
FILTER_EXPR,
LAYOUT
)
VALUES
(
'POS_CODE',
'W_SALES_BUDGET_CUST',
'select pos_code,descr from org_structure where active = Y',
NULL,
'POSITION CODE',
'0',
'0',
sysdate,
'BASE',
'BASE',
'1',
NULL,
NULL,
'1',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
'2',
NULL,
'3',
'pos_code',
'pos_code',
'descr',
'2',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
);
--Added by Rohini T. on [05/03/2019][End]
\ No newline at end of file
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