Commit 1a2c2228 authored by rtelang's avatar rtelang

w_loan_reco.sql

- Changes done in system entries.
LoanRecoConf.java
LoanRecoConfLocal.java
LoanRecoConfRemote.java
LoanRecoIC.java
LoanRecoICLocal.java
LoanRecoICRemote.java
- Sun Migration of Direct Loan Recovery

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@205511 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ce75cd1a
------------------------------------Modified by Rohini T on [16/08/19][Start]-----------------------------------------
------------------------------------------------------ITM2MENU-----------------------------------------------
Insert into ITM2MENU (APPLICATION,LEVEL_1,LEVEL_2,LEVEL_3,LEVEL_4,LEVEL_5,WIN_NAME,DESCR,COMMENTS,MENU_PATH,ICON_PATH,CLOSE_ICON,OPEN_ICON,OBJ_TYPE,CHG_DATE,CHG_TERM,CHG_USER,MOB_DEPLOY,DEFAULT_STATE,DEF_ACTION) values ('HRM',3,17,3,0,0,'w_loan_reco','Direct Loan recovery',null,'HRM.3.17.3.0.0',null,null,null,'T',null,null,null,null,null,null);
UPDATE ITM2MENU SET ENT_TYPES='0',MOB_DEPLOY='B' WHERE WIN_NAME='w_loan_reco';
-----------------------------------------------------TRANSETUP---------------------------------------------
Insert into TRANSETUP (TRAN_WINDOW,SAVE_FLAG,VAL_FLAG,KEY_FLAG,KEY_STRING,UDF_1,UDF_2,UDF_3,UDF_4,UDF_5,REPEATE_ADD,CHG_DATE,CHG_USER,CHG_TERM,EDI_OPTION,SITE_ACC_COL,CONFIRM_COL,CONFIRM_VAL,REPEAT_ADD_DET,REPEATADDDET,LOAD_MODE,AUTO_CONFIRM,LEDG_POST_CONF,CHG_DATE_ON_CONF,TRAN_ID_COL,MAIL_OPTION,CONFIRM_MODE,GARBAGE_OPT,VAL_FLAG_EDI,VERIFY_PASSWORD,CUST_ACC_COL,SALES_PERS_ACC_COL,SUPP_ACC_COL,ITEM_SER_ACC_CODE,EMP_ACC_COL,ITEM_SER_ACC_COL,WORKFLOW_OPT,TABLE_NAME,APPLICATION,TABLE_DESC,TRAN_DATE_COL,TRAN_ID__FROM,TRAN_ID__TO,TABLE_NAME_DET1,TABLE_NAME_DET2,TABLE_NAME_DET3,MULTITIRE_OPT,REF_SER,VIEW_MODE,TAX_FORMS,SIGN_STATUS,USER_TRAN_WINDOW,CUSTOM_PREVIEW_OBJ,IGNOREERRLIST_ONLOAD,CHILDDATA_ARGOPT,EDIT_TMPLT,WRKFLW_INIT,EDITTAX,FORMAL_ARGS,AUDIT_TRAIL_OPT,EDIT_OPT,CACHE_OPT,OPTIMIZE_MODE,EDIT_EXPR,RATE_COL,QTY_COL,EDIT_EXPR_INP,RCP_CACHE_STATUS,PRINT_CONTROL,TRANSFER_MODE,PROFILE_ID__RES,TRAN_COMPL_MSG,PERIOD_OPTION,WRKFLW_PRIORITY,EXEC_TYPE,DISP_META_DATA,ALLOW_ATTACH,START_FORM,ISATTACHMENT,HEADER_FORM_NO,CONFIRM_DATE_COL,CONFIRM_BY_COL,MSG_ONSAVE,WF_STATUS,RESTART_FORM,CMS_PATH,BROW_DATA_DEF,DEF_VIEW,VIEW_OPTS,ISGWTINITIATED,DEFAULT_DATA_ROW,IN_WF_VAL,IN_WF_COL,CANCEL_VAL,CANCEL_COL,THUMB_ALT_COL,THUMB_IMAGE_COL,THUMB_OBJ,ATTACH_COUNT_MIN,FUNCTION_TYPE,COMPL_ACTION,DEFAULT_EDITOR,MSG_NO,OBJ_TYPE,STATUS_COL,ENABLE_EDITOR,OFFLINE_OPT,CLOSE_COL,CLOSE_VAL) values ('w_loan_reco','2','2','A','_sppay_site,LR,_ppreco_date,seq04',null,null,null,null,null,'N',to_date('17-10-01','DD-MM-RR'),'BASE ','97PIYUSH ','0','EMPLOYEE.PAY_SITE','confirmed','Y',null,null,null,null,'N','N','reco_no','0','0',null,null,null,null,null,null,null,null,null,'0','LOAN_RECO','ADM',null,null,null,null,null,null,null,null,'L-RECO','F',null,null,null,null,null,null,null,null,null,null,'0','3',null,null,null,null,null,null,null,null,null,null,null,'W',null,null,null,null,null,null,null,null,null,null,null,null,null,'Y','L',null,null,null,null,null,null,null,null,null,null,null,null,null,'compact',null,'C',null,'C',null,null,null);
-----------------------------------------------------OBJ_FORMS---------------------------------------------
Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,SCAN_FLAG,SCAN_METADATA,AUTO_ACCEPT_SCAN,PROPERTY_INFO,SCAN_DELIMITER,EXT_COM,EXT_METADATA,EXT_SETUP,AFTER_SAVE,COLUMN_ON_SAVE,AUTO_ACCEPT_WEIGHDATA,RATE_COL,QTY_COL,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW,AUTO_ADDON_ENTRY,FREEZE_COL_POS,DEFAULT_ROW_CNT,IS_MANDATORY,TRAN_ID_COL,KEY_INFO,SELECTION_OPT,THUMB_OBJ,THUMB_IMAGE_COL,FORM_NAME,FORM_ICON,THUMB_ALT_COL) values ('w_loan_reco','Loans Recovery','d_loan_dir_reco_brow','d_loan_dir_reco_edit',null,null,null,null,'1',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);
update obj_forms set DISP_METADATA='<html><b>&nbsp;Recovery No&nbsp;:&nbsp;</b>{reco_no}&nbsp;<b>Loan No</b>&nbsp;:{loan_no}&nbsp;<b>Employee Code</b>&nbsp;:{emp_code}&nbsp;<b>Scheme No</b>&nbsp;:{scheme_no}</html>' ,SCR_FLAG = 'F' WHERE WIN_NAME='w_loan_reco';
-----------------------------------------------------OBJ_ACTIONS------------------------------------------
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,RIGHTS_CHAR,INTERACTIVE,SERVICE_CODE,DESCRIPTION,TITLE,IMAGE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER,IS_CONFIRMATION_REQ,SEP_DUTY_OPT,RE_AUTH_OPT,SHOW_IN_PANEL,SWIPE_POSITION,MULTI_ROW_OPT,ACTION_ID,DEF_NODATA) values ('loan_reco',21,'Q','1','audit_trail','View Audit Trail','View Audit','menu.bmp','1','1','1','U',null,to_date('2018-09-12','RRRR-MM-DD'),'VAIBHAV ','VAIBHAV ',null,null,null,null,null,null,null,null);
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,RIGHTS_CHAR,INTERACTIVE,SERVICE_CODE,DESCRIPTION,TITLE,IMAGE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER,IS_CONFIRMATION_REQ,SEP_DUTY_OPT,RE_AUTH_OPT,SHOW_IN_PANEL,SWIPE_POSITION,MULTI_ROW_OPT,ACTION_ID,DEF_NODATA) values ('loan_reco',2,'E','a','a','Editing Existing Record','Edit','edit.gif','1',null,null,'S',null,null,null,null,null,null,null,null,null,null,null,null);
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,RIGHTS_CHAR,INTERACTIVE,SERVICE_CODE,DESCRIPTION,TITLE,IMAGE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER,IS_CONFIRMATION_REQ,SEP_DUTY_OPT,RE_AUTH_OPT,SHOW_IN_PANEL,SWIPE_POSITION,MULTI_ROW_OPT,ACTION_ID,DEF_NODATA) values ('loan_reco',1,'A','a','a','Adding New','Add','add.gif','1',null,null,'S',null,null,null,null,null,null,null,null,null,null,null,null);
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,RIGHTS_CHAR,INTERACTIVE,SERVICE_CODE,DESCRIPTION,TITLE,IMAGE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER,IS_CONFIRMATION_REQ,SEP_DUTY_OPT,RE_AUTH_OPT,SHOW_IN_PANEL,SWIPE_POSITION,MULTI_ROW_OPT,ACTION_ID,DEF_NODATA) values ('loan_reco',5,'F','a','pre_confirm','Confirmation','Confirm','confirm~normal.gif','1','2',null,'U',null,null,null,null,null,null,null,null,null,null,null,null);
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,RIGHTS_CHAR,INTERACTIVE,SERVICE_CODE,DESCRIPTION,TITLE,IMAGE,FORM_NO,SERVICE_HANDLER,PLACEMENT,ACTION_TYPE,TRAN_TYPE,CHG_DATE,CHG_TERM,CHG_USER,IS_CONFIRMATION_REQ,SEP_DUTY_OPT,RE_AUTH_OPT,SHOW_IN_PANEL,SWIPE_POSITION,MULTI_ROW_OPT,ACTION_ID,DEF_NODATA) values ('loan_reco',22,'O','1','export_excel','Export Excel','Export','Download.gif','1','1','1','U',null,null,null,null,null,null,null,null,null,null,null,null);
update obj_actions set IMAGE = 'ibase/resource/objaction/add.svg' where obj_name ='loan_reco' and LINE_NO ='1';
update obj_actions set IMAGE = 'ibase/resource/objaction/edit.svg' where obj_name ='loan_reco' and LINE_NO ='2';
update obj_actions set IMAGE = 'ibase/resource/objaction/confirm.svg' where obj_name ='loan_reco' and LINE_NO ='5';
update obj_actions set IMAGE = 'ibase/resource/objaction/Audit-trail.svg' where obj_name ='loan_reco' and LINE_NO ='21';
update obj_actions set IMAGE = 'ibase/resource/objaction/exprtExl.svg' where obj_name ='loan_reco' and LINE_NO ='22';
-----------------------------------------------------OBJ_ITEMCHANGE-----------------------------------------
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('loan_reco','1 ','itm_default','Y');
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('loan_reco','1 ','loan_no','Y');
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('loan_reco','1 ','ref_no__pay','Y');
-----------------------------------------------------
----------------------------------------SYSTEM_EVENTS--------------------------------
Insert into SYSTEM_EVENTS (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('loan_reco','post_item_change','1','poic_adm_default_1',null,to_date('2015-02-12','RRRR-MM-DD'),'BASE ','BASE','2','0','WSR','nvo_bo_loan_reco',null);
Insert into SYSTEM_EVENTS (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('loan_reco','pre_confirm','1','prcm_adm_default_1',null,to_date('2015-02-12','RRRR-MM-DD'),'BASE ','BASE','2','0','WSR','nvo_business_object_adm_loan_reco',null);
Insert into SYSTEM_EVENTS (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('loan_reco','pre_validate','1','prv_adm_default_1',null,to_date('2015-02-12','RRRR-MM-DD'),'BASE ','BASE','2','0','WSR','nvo_bo_loan_reco',null);
Insert into SYSTEM_EVENTS (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('loan_reco','post_validate','1','post_gen_val',null,to_date('2015-02-12','RRRR-MM-DD'),'BASE ','BASE','2','0','EJB','GenValidate',null);
Insert into SYSTEM_EVENTS (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,OVERWRITE_CORE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('loan_reco','export_excel','1','export_excel_adm',null,to_date('2018-02-03','RRRR-MM-DD'),'VAIBHAV ','VAIBHAV',null,null,null,null,null);
UPDATE SYSTEM_EVENTS SET COMP_NAME='ibase.webitm.ejb.adm.LoanRecoIC',COMP_TYPE='JB' ,SERVICE_CODE='poic_default_ejb' WHERE OBJ_NAME='loan_reco' AND EVENT_CODE='post_item_change';
UPDATE SYSTEM_EVENTS SET COMP_NAME='ibase.webitm.ejb.adm.LoanRecoIC',COMP_TYPE='JB' ,SERVICE_CODE='prv_default_ejb' WHERE OBJ_NAME='loan_reco' AND EVENT_CODE='pre_validate';
UPDATE SYSTEM_EVENTS SET COMP_NAME='ibase.webitm.ejb.adm.adv.LoanRecoConf',COMP_TYPE='JB' ,SERVICE_CODE='prcm_default_ejb' WHERE OBJ_NAME='loan_reco' AND EVENT_CODE='pre_confirm';
-----------------------------------------MESSAGES-------------------------------------
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 ('VMLOAN1 ','Invalid Loan !','Entered loan number not present in master.','E',null,null,null,null,to_date('1999-10-22','RRRR-MM-DD'),'SUN ','RITESH ',null,null);
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 ('VMLOAN2 ','Invalid recovery amount','Recovery amount exceeds the balance amount for the loan','E','Y',null,null,null,to_date('2000-01-26','RRRR-MM-DD'),'SUN ','NILES1 ',null,null);
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 ('VTRCPT9 ','Invalid Receipt No','The receipt no. you have entered does not exist in the receipt table or is not confirmed or the reference is already used','E',null,null,null,null,to_date('2001-03-19','RRRR-MM-DD'),'EXPORT ','PINAKIN1 ',null,null);
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 ('VTRCPT10 ','Amount / employee mismatch','The receipt amount does not match the recovery amount / employee code mismatch','E',null,null,null,null,to_date('2000-02-01','RRRR-MM-DD'),'SUN ','NILESHPC ',null,null);
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 ('VTPAYMIS10','Invalid Payable Ref. No.','Ref. No. cannot be blank, should be valid Ref. No.','E','Y',null,null,null,to_date('2002-11-28','RRRR-MM-DD'),'SUN ','98NILESH ',null,null);
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 ('VTPAYMIS9 ','Invalid Misc. Payable!','The entered Ref. No. does not exist in Misc. Payable.','E','Y',null,null,null,to_date('2001-02-20','RRRR-MM-DD'),'SUN ','NILESH12 ',null,null);
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 ('VTPAYSUNTY','Invalid Misc. Payable!','The Sundry Type/Code of entered Ref. No. not match with the Loan Sundry Type/Code.','E','Y',null,null,null,to_date('2001-02-20','RRRR-MM-DD'),'SUN ','NILESH12 ',null,null);
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 ('VTPAYBAL ','Invalid Recovery Amount!','Entered Recovery Amount is more than Misc. Payable Balance Amount.','E','Y',null,null,null,to_date('2001-02-20','RRRR-MM-DD'),'SUN ','NILESH12 ',null,null);
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 ('VTMCONF20 ','Invalid Transaction !','Selected Transaction Not Found','E','Y',null,null,null,to_date('2006-03-03','RRRR-MM-DD'),'BASE217 ','Gulzar ',null,null);
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 ('VTMCONF1 ','Transaction already confirmed.','This transaction has already been confirmed, cannot be edited or confirmed again.','E','Y',null,null,null,to_date('2011-09-18','RRRR-MM-DD'),'SUN ','HDP ',null,null);
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 ('VPNOBAL1 ','NO BALANCE','VPNOBAL1 NO BALANCE FOUND FOR LOAN.','E',null,null,null,null,to_date('2000-05-30','RRRR-MM-DD'),'SUN ','NILESHPC ',null,null);
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 ('VTEMPSPA09','Transaction confirmed','Selected transaction successfully confirmed.','P','Y',null,null,null,to_date('10-03-15','DD-MM-RR'),'BASE ','BASE ',null,null);
-----------------------------------------------------------POPHELP------------------------------------------------
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) values ('LOAN_NO','W_LOAN_RECO','select loan_no, loans.scheme_no,loan_scheme.descr, loans.emp_code AS EmpCode,rtrim(emp_fname)||'' '' || rtrim(emp_lname) AS NAME ,issue_date,loan_amt from loans,employee,loan_scheme WHERE loans.emp_code = employee.emp_code and loans.scheme_no = loan_scheme.scheme_no and loans.status =''A''',null,'Loan No',0,0,to_date('2018-05-15','RRRR-MM-DD'),'VAIBHAV ','VAIBHAV ','0',null,null,null,null,null,'0',null,null,null,'0',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 ('TRAN_SER__PAY','W_LOAN_RECO','select ref_ser, descr from refser',null,'Referance Series',0,0,to_date('27-05-00','DD-MM-RR'),'SUN ','CLIENT1','0',null,null,null,null,null,null,null,null,null,'2',null,'3','RefSerImages','ref_ser','descr','2 ',null,null,null,null,null,null,null);
COMMIT;
-----------------------------------Modified by Rohini T on [16/08/19][End]-----------------------------------------
package ibase.webitm.ejb.adm;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException;
public class LoanRecoIC extends ValidatorEJB implements LoanRecoICLocal,LoanRecoICRemote
{
E12GenericUtility genericUtility = new E12GenericUtility();
AdmCommon admCommon = new AdmCommon();
ITMDBAccessEJB itmdbAccessEJB = new ITMDBAccessEJB();
public String wfValData(String xmlString,String xmlString1,String xmlString2,String objContext,String editFlag,String xtraParams)throws RemoteException,ITMException
{
Document dom = null;
Document dom1 = null;
Document dom2 = null;
String retString = null;
try
{
if(xmlString != null && xmlString.trim().length() > 0)
{
dom = genericUtility.parseString(xmlString);
}
if(xmlString1 != null && xmlString1.trim().length() > 0)
{
dom1 = genericUtility.parseString(xmlString1);
}
if(xmlString2 != null && xmlString2.trim().length() > 0)
{
dom2 = genericUtility.parseString(xmlString2);
}
retString = wfValData(dom,dom1,dom2,objContext,editFlag,xtraParams);
System.out.println("retString of LoanRecoIC -->wfValData:::"+retString);
} catch (Exception e)
{
System.out.println(":::LoanRecoIC:::"+e.getMessage());
e.getMessage();
throw new ITMException(e);
}
return retString;
}
public String wfValData(Document dom,Document dom1,Document dom2,String objContext,String editFlag,String xtraParams) throws RemoteException,ITMException
{
Node parentNode = null,childNode = null;
NodeList parentNodeList = null;
NodeList childNodeList = null;
String childNodeName = "",errCode = "",errorType = "";
ArrayList<String> errList = new ArrayList<String>();
ArrayList<String> errFields = new ArrayList<String>();
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
int currentFormNo = 0;
int childNodeLength = 0;
int cnt = 0;
int ctr = 0;
int count = 0;
int balAmt = 0;
int recoAmount = 0;
int netAmtBc = 0;
int lcBalAmt = 0;
String errString = "";
String userId = "";
String loginCode = "";
String sql = "";
String loanNo = "";
String msgType = "";
String recoAmt = "";
String tranIdRcp = "";
String empCode = "";
String sundryCode = "";
String refNoPay = "";
String tranSerPay = "";
String sundryType = "";
try
{
conn = getConnection();
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
loginCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
if(objContext != null && objContext.trim().length() > 0)
{
currentFormNo = Integer.parseInt(objContext);
}
System.out.println("currentFormNo:::::::"+currentFormNo);
switch(currentFormNo)
{
case 1:
{
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeLength = childNodeList.getLength();
for(ctr = 0; ctr < childNodeLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
System.out.println(">>>>>> childNodeName: ["+childNodeName+"]");
if("loan_no".equalsIgnoreCase(childNodeName))
{
System.out.println("Inside loan_no itemchange........");
loanNo = checkNull(genericUtility.getColumnValue("loan_no", dom));
System.out.println("loan_no:::::"+loanNo);
sql = "select count(*) from loans where loan_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loanNo);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("count::::"+count);
if(count == 0)
{
errCode = "VMLOAN1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
msgType = errorType(conn, errCode);
if (msgType.equalsIgnoreCase("E"))
{
break;
}
}
}
else if("reco_amt".equalsIgnoreCase(childNodeName))
{
System.out.println("Inside reco_amt itemchange........");
loanNo = checkNull(genericUtility.getColumnValue("loan_no", dom));
recoAmt = checkNull(genericUtility.getColumnValue("reco_amt", dom));
try
{
recoAmount = (recoAmt != null && recoAmt.trim().length() > 0 ) ?Integer.parseInt(recoAmt):0;
}
catch (Exception e)
{
recoAmount = 0;
e.getMessage();
}
System.out.println("loan_no:::::"+loanNo+"recoAmt::::::"+recoAmt);
sql = "select balance_amt from loans where loan_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loanNo);
rs = pstmt.executeQuery();
if(rs.next())
{
balAmt = rs.getInt(1);
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(recoAmount > balAmt)
{
errCode = "VMLOAN2";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
msgType = errorType(conn, errCode);
if (msgType.equalsIgnoreCase("E"))
{
break;
}
}
}
else if("tran_id__rcp".equalsIgnoreCase(childNodeName))
{
System.out.println("Inside tran_id__rcp itemchange........");
tranIdRcp = checkNull(genericUtility.getColumnValue("tran_id__rcp", dom));
recoAmt = checkNull(genericUtility.getColumnValue("reco_amt", dom));
empCode = checkNull(genericUtility.getColumnValue("emp_code", dom));
try
{
recoAmount = (recoAmt != null && recoAmt.trim().length() > 0 ) ?Integer.parseInt(recoAmt):0;
}
catch (Exception e)
{
recoAmount = 0;
e.getMessage();
}
sql = "select count(*) from misc_receipt where tran_id = ? and confirmed = 'Y' ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranIdRcp);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("count::::"+count);
if(count == 0)
{
errCode = "VTRCPT9";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
msgType = errorType(conn, errCode);
if (msgType.equalsIgnoreCase("E"))
{
break;
}
}
else
{
sql = "select sundry_code, net_amt__bc - adj_amt from misc_receipt where tran_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranIdRcp);
rs = pstmt.executeQuery();
if (rs.next())
{
sundryCode = checkNull(rs.getString(1));
netAmtBc = rs.getInt(2);
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(recoAmount > netAmtBc || sundryCode.trim() != empCode.trim() )
{
errCode = "VTRCPT10";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
msgType = errorType(conn, errCode);
if (msgType.equalsIgnoreCase("E"))
{
break;
}
}
}
}
else if("ref_no__pay".equalsIgnoreCase(childNodeName))
{
System.out.println("Inside ref_no__pay itemchange........");
refNoPay = checkNull(genericUtility.getColumnValue("ref_no__pay", dom));
tranSerPay = checkNull(genericUtility.getColumnValue("tran_ser__pay", dom));
recoAmt = checkNull(genericUtility.getColumnValue("reco_amt", dom));
empCode = checkNull(genericUtility.getColumnValue("emp_code", dom));
System.out.println("empCode::::"+empCode);
try
{
recoAmount = (recoAmt != null && recoAmt.trim().length() > 0 ) ?Integer.parseInt(recoAmt):0;
}
catch (Exception e)
{
recoAmount = 0;
e.getMessage();
}
if(refNoPay == null || refNoPay.trim().length() == 0)
{
errCode = "VTPAYMIS10";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
msgType = errorType(conn, errCode);
if (msgType.equalsIgnoreCase("E"))
{
break;
}
}
else
{
sql = "select count(*) from misc_payables where tran_ser = ? and ref_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranSerPay);
pstmt.setString(2, refNoPay);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(count == 0)
{
errCode = "VTPAYMIS9";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
msgType = errorType(conn, errCode);
if (msgType.equalsIgnoreCase("E"))
{
break;
}
}
else
{
sql = "select sundry_type, sundry_code, nvl(tot_amt,0) - nvl(adj_amt,0) from misc_payables where tran_ser = ? and ref_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranSerPay);
pstmt.setString(2, refNoPay);
rs = pstmt.executeQuery();
if(rs.next())
{
sundryType = checkNull(rs.getString(1));
sundryCode = checkNull(rs.getString(2));
lcBalAmt = rs.getInt(3);
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("sundryType::::"+sundryType);
System.out.println("sundryCode::::"+sundryCode);
if((!"E".equalsIgnoreCase(sundryType)) || (!sundryCode.trim().equalsIgnoreCase(empCode.trim())) )
{
errCode = "VTPAYSUNTY";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
msgType = errorType(conn, errCode);
if (msgType.equalsIgnoreCase("E"))
{
break;
}
}
else if(recoAmount > lcBalAmt)
{
errCode = "VTPAYBAL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
msgType = errorType(conn, errCode);
if (msgType.equalsIgnoreCase("E"))
{
break;
}
}
}
}
}
}
break;
}
}
System.out.println("errList....."+errList.toString());
int errListSize = errList.size();
System.out.println("errListSize......"+errListSize);
cnt = 0;
String errFldName = "";
if ( errList != null && errListSize > 0 )
{
for (cnt = 0; cnt < errListSize; cnt++ )
{
errCode = errList.get(cnt);
errFldName = errFields.get(cnt);
System.out.println("errCode .........." + errCode);
errString = itmdbAccessEJB.getErrorString("", errCode, userId, "", conn);
errorType = errorType( conn, errCode );
if (errString != null && errString.trim().length() > 0)
{
String bifurErrString = errString.substring( errString.indexOf("<Errors>") + 8, errString.indexOf("<trace>"));
bifurErrString =bifurErrString+errString.substring( errString.indexOf("</trace>") + 8, errString.indexOf("</Errors>"));
errStringXml.append(bifurErrString);
System.out.println("errStringXml .........."+errStringXml);
errString = "";
}
if ( errorType.equalsIgnoreCase("E"))
{
break;
}
}
errList.clear();
errList = null;
errFields.clear();
errFields = null;
errStringXml.append("</Errors></Root>\r\n");
}
else
{
errStringXml = new StringBuffer( "" );
}
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try {
if ( rs != null )
{
rs.close();
rs = null;
}
if ( pstmt != null )
{
pstmt.close();
pstmt = null;
}
if ( conn != null )
{
conn.close();
conn = null;
}
}
catch(Exception e)
{
System.out.println("[LoanRecoIC][wfValData]Exception ::"+e);
e.printStackTrace();
throw new ITMException(e);
}
}
errString = errStringXml.toString();
System.out.println("testing : final errString : " + errString);
return errString;
}
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn,String editFlag, String xtraParams) throws RemoteException,ITMException
{
System.out.println("Came Inside 1 itemChanged:::");
Document dom = null;
Document dom1 = null;
Document dom2 = null;
String errFields = null;
try
{
System.out.println("xmlString [" + xmlString + "]");
System.out.println("xmlString1 [" + xmlString1 + "]");
System.out.println("xmlString2 [" + xmlString2 + "]");
if (xmlString != null && xmlString.trim().length() != 0)
{
dom = genericUtility.parseString(xmlString);
}
if (xmlString1 != null && xmlString1.trim().length() != 0)
{
dom1 = genericUtility.parseString(xmlString1);
}
if (xmlString2 != null && xmlString2.trim().length() != 0)
{
dom2 = genericUtility.parseString(xmlString2);
}
errFields = itemChanged(dom, dom1, dom2, objContext, currentColumn,editFlag, xtraParams);
System.out.println("errFields :" + errFields);
}
catch (Exception e)
{
System.out.println("Exception :LoanRecoIC :" + e.getMessage()+ ":");
errFields = genericUtility.createErrorString(e);
throw new ITMException(e);
}
return errFields;
}
public String itemChanged(Document dom, Document dom1, Document dom2,String objContext, String currentColumn, String editFlag,String xtraParams) throws RemoteException, ITMException
{
System.out.println("Item Changes Call..................");
NodeList parentNodeList = null;
Node parentNode = null;
Node childNode = null;
NodeList childNodeList = null;
StringBuffer valueXmlString = new StringBuffer();
Connection conn = null;
PreparedStatement pstmt=null;
ResultSet rs = null;
String sql = "";
String userId = "";
String empCodeAprv = "";
String loginSite = "";
String childNodeName = "";
String columnValue = "";
String todayDate = "";
String loanNo = "";
String SchemeNo = "";
String empCode = "";
String empFname = "";
String empLname = "";
String paySite = "";
String adCode = "";
String mallwdednShDescr = "";
String tranSerPay = "";
String refNoPay = "";
String issueDt = "";
String dateBl = "";
int currentFormNo = 0;
int ctr = 0;
int interest = 0;
double loanAmt = 0;
double mmonInst = 0;
double balAmt = 0;
SimpleDateFormat sdf = null;
Timestamp issueDate = null;
Timestamp dateBal = null;
try
{
conn = getConnection();
userId = getValueFromXTRA_PARAMS(xtraParams,"loginCode");
empCodeAprv= getValueFromXTRA_PARAMS(xtraParams,"loginEmpCode");
loginSite = getValueFromXTRA_PARAMS(xtraParams,"loginSiteCode");
if(objContext != null && objContext.trim().length()>0)
{
currentFormNo = Integer.parseInt(objContext);
}
valueXmlString = new StringBuffer("<?xml version=\"1.0\"?><Root><header><editFlag>");
valueXmlString.append(editFlag).append("</editFlag></header>");
System.out.println("Form No:::"+currentFormNo);
switch(currentFormNo)
{
case 1:
{
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
ctr = 0;
int childNodeListLength = childNodeList.getLength();
do
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if(childNodeName.equals(currentColumn))
{
if (childNode.getFirstChild() != null)
{
columnValue=childNode.getFirstChild().getNodeValue().trim();
}
}
ctr++;
}while(ctr < childNodeListLength && !childNodeName.equals(currentColumn));
System.out.println("current column="+currentColumn);
valueXmlString.append("<Detail1>");
if (currentColumn.trim().equalsIgnoreCase("itm_default"))
{
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
todayDate = sdf.format(new java.util.Date());
valueXmlString.append("<reco_date><![CDATA[").append(todayDate).append("]]></reco_date>\r\n");
valueXmlString.append("<reco_amt><![CDATA[").append("0").append("]]></reco_amt>\r\n");
}
else if (currentColumn.trim().equalsIgnoreCase("loan_no"))
{
loanNo = genericUtility.getColumnValue("loan_no", dom);
sql = "SELECT loans.scheme_no, loans.emp_code, loans.start_reco, loans.loan_amt, loans.interest, loans.mon_inst, balance_amt, date__balance from loans WHERE loans.loan_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loanNo);
rs = pstmt.executeQuery();
if(rs.next())
{
SchemeNo = checkNull(rs.getString(1));
empCode = checkNull(rs.getString(2));
issueDate = rs.getTimestamp(3);
loanAmt = rs.getDouble(4);
interest = rs.getInt(5);
mmonInst = rs.getDouble(6);
balAmt = rs.getDouble(7);
dateBal = rs.getTimestamp(8);
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
sql = "SELECT emp_fname, emp_lname, pay_site from employee WHERE emp_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode);
rs = pstmt.executeQuery();
if(rs.next())
{
empFname = checkNull(rs.getString(1));
empLname = checkNull(rs.getString(2));
paySite = checkNull(rs.getString(3));
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
sql = " SELECT loan_scheme.ad_code__ded FROM loan_scheme WHERE loan_scheme.scheme_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, SchemeNo);
rs = pstmt.executeQuery();
if(rs.next())
{
adCode = checkNull(rs.getString(1));
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
sql = "SELECT allwdedn.sh_descr FROM allwdedn WHERE allwdedn.ad_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, adCode);
rs = pstmt.executeQuery();
if(rs.next())
{
mallwdednShDescr = checkNull(rs.getString(1));
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(issueDate != null)
{
issueDt = getCurrdateAppFormat(issueDate);
}
if(dateBal != null)
{
dateBl = getCurrdateAppFormat(dateBal);
}
valueXmlString.append("<scheme_no><![CDATA[").append(SchemeNo).append("]]></scheme_no>\r\n");
valueXmlString.append("<emp_code><![CDATA[").append(empCode).append("]]></emp_code>\r\n");
valueXmlString.append("<start_date><![CDATA[").append(issueDt).append("]]></start_date>\r\n");
valueXmlString.append("<loan_amt><![CDATA[").append(loanAmt).append("]]></loan_amt>\r\n");
valueXmlString.append("<loan_interest><![CDATA[").append(interest).append("]]></loan_interest>\r\n");
valueXmlString.append("<mon_inst><![CDATA[").append(mmonInst).append("]]></mon_inst>\r\n");
valueXmlString.append("<emp_name><![CDATA[").append(empFname).append("]]></emp_name>\r\n");
valueXmlString.append("<emp_lname><![CDATA[").append(empLname).append("]]></emp_lname>\r\n");
valueXmlString.append("<pay_site><![CDATA[").append(paySite).append("]]></pay_site>\r\n");
valueXmlString.append("<ad_code><![CDATA[").append(adCode).append("]]></ad_code>\r\n");
valueXmlString.append("<allwdedn_sh_descr><![CDATA[").append(mallwdednShDescr).append("]]></allwdedn_sh_descr>\r\n");
valueXmlString.append("<balance_amt><![CDATA[").append(balAmt).append("]]></balance_amt>\r\n");
valueXmlString.append("<date__balance><![CDATA[").append(dateBl).append("]]></date__balance>\r\n");
}
else if (currentColumn.trim().equalsIgnoreCase("ref_no__pay"))
{
tranSerPay = genericUtility.getColumnValue("tran_ser__pay", dom);
empCode = genericUtility.getColumnValue("emp_code", dom);
refNoPay = genericUtility.getColumnValue("ref_no__pay", dom);
sql = "select nvl(tot_amt,0) - nvl(adj_amt,0) from misc_payables where tran_ser = ? and ref_no = ? and sundry_type = 'E' and sundry_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranSerPay);
pstmt.setString(2, refNoPay);
pstmt.setString(3, empCode);
rs = pstmt.executeQuery();
if(rs.next())
{
balAmt = rs.getDouble(1);
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
valueXmlString.append("<bal_amt><![CDATA[").append(balAmt).append("]]></bal_amt>\r\n");
}
}
valueXmlString.append("</Detail1>\r\n");
break;
}
valueXmlString.append("</Root>");
System.out.println("valueXmlString"+valueXmlString);
}
catch(Exception e)
{
System.out.println("Exception ::"+e.getMessage());
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(conn != null)
{
conn.close();
conn = null;
}
}
catch (SQLException e)
{
e.printStackTrace();
throw new ITMException(e);
}
}
return valueXmlString.toString();
}
private String checkNull(String input)
{
if (input == null)
{
input = "";
}
else
{
input = input.trim();
}
return input;
}
private String errorType(Connection conn, String errorCode) throws ITMException
{
String msgType = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
String sql = "SELECT MSG_TYPE FROM MESSAGES WHERE MSG_NO = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, errorCode);
rs = pstmt.executeQuery();
if (rs.next())
{
msgType = checkNull(rs.getString("MSG_TYPE"));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
catch (Exception ex)
{
ex.printStackTrace();
throw new ITMException(ex);
}
finally
{
try
{
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
}
return msgType;
}
private String getCurrdateAppFormat(java.sql.Timestamp inputDate) throws ITMException
{
String retDate ="";
System.out.println("Comming Date[In DB Format] :::"+inputDate.toString());
try
{
retDate = genericUtility.getValidDateString(inputDate.toString(), genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat());
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
System.out.println("Retturning Date :::"+retDate);
return (retDate);
}
}
package ibase.webitm.ejb.adm;
import java.rmi.RemoteException;
import javax.ejb.Local;
import org.w3c.dom.Document;
import ibase.webitm.ejb.ValidatorLocal;
import ibase.webitm.utility.ITMException;
@Local
public interface LoanRecoICLocal extends ValidatorLocal
{
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn,String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(Document dom, Document dom1, Document dom2,String objContext, String currentColumn, String editFlag,String xtraParams) throws RemoteException, ITMException;
}
package ibase.webitm.ejb.adm;
import java.rmi.RemoteException;
import javax.ejb.Remote;
import org.w3c.dom.Document;
import ibase.webitm.ejb.ValidatorLocal;
import ibase.webitm.utility.ITMException;
@Remote
public interface LoanRecoICRemote extends ValidatorLocal
{
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn,String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(Document dom, Document dom1, Document dom2,String objContext, String currentColumn, String editFlag,String xtraParams) throws RemoteException, ITMException;
}
package ibase.webitm.ejb.adm.adv;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Timestamp;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ActionHandlerEJB;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.utility.ITMException;
public class LoanRecoConf extends ActionHandlerEJB implements LoanRecoConfLocal,LoanRecoConfRemote
{
ITMDBAccessEJB itmdbAccess=new ITMDBAccessEJB();
E12GenericUtility genericUtility = new E12GenericUtility();
String userId = "";
String chgTerm = "";
String loginEmpCode = "";
public String confirm(String tranId, String xtraParams, String forcedFlag) throws RemoteException,ITMException
{
String retString = null;
Connection conn = null;
try
{
conn = getConnection();
System.out.println("Conn==>[" + conn + "]");
retString = gbfPostLogic(tranId, tranId,xtraParams,forcedFlag,conn);
System.out.println("returning String from EmployeeSepConfirm :confirm():==>[" + retString + "]");
if(retString == null || retString.trim().length() == 0)
{
conn.commit();
retString = itmdbAccess.getErrorString("", "VTEMPSPA09", "", "", conn);//Transaction successfully completed.
}
else
{
conn.rollback();
}
}
catch(Exception e)
{
System.out.println("Exception :EmployeeSepConfirm :confirm() :" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if(conn != null)
{
conn.close();
conn = null;
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
return retString;
}
public String gbfPostLogic(String asTranidFr,String asTranidTo,String xtraParams,String forcedFlag,Connection conn) throws ITMException
{
String errString = "";
String runMode = "";
String lsRecono = "";
String sql = "";
String lsConf = "";
ResultSet rs = null;
PreparedStatement pstmt = null;
try
{
System.out.println("Inside Post Logic Method..!!!!");
userId = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"));
chgTerm = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId"));
loginEmpCode = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode"));
runMode = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "runMode"));
System.out.println("userId==>" + userId);
System.out.println("loginEmpCode==>" + loginEmpCode + " runMode==>" + runMode);
System.out.println("asTranidFr:::"+asTranidFr+"asTranidTo:::::::"+asTranidTo);
if(asTranidFr.equalsIgnoreCase(asTranidTo))
{
lsRecono = asTranidFr;
System.out.println("lsRecono::::::"+lsRecono);
sql = "select confirmed from loan_reco where reco_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsRecono);
rs = pstmt.executeQuery();
if(rs.next())
{
lsConf = checkNull(rs.getString(1));
}
else
{
errString = itmdbAccess.getErrorString("", "VTMCONF20", userId, "", conn);
return errString;
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("lsConf::::::::"+lsConf);
if("Y".equalsIgnoreCase(lsConf ))
{
errString = itmdbAccess.getErrorString("", "VTMCONF1", userId, "", conn);
return errString;
}
else
{
errString = gbfLoanRecoRetrieve(lsRecono,lsRecono,conn);
}
}
if(errString != null && errString.trim().length() > 0)
{
conn.rollback();
return errString;
}
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch(Exception e1)
{
e1.printStackTrace();
}
}
return errString;
}
public String gbfLoanRecoRetrieve(String lsReconoFr,String lsReconoTo,Connection conn) throws ITMException
{
PreparedStatement pstmt = null;
ResultSet rs = null;
String errString = "";
String sql = "";
String lsRecono = "";
int cntRows = 0;
System.out.println("lsReconoFr:::::::"+lsReconoFr+"lsReconoTo:::::"+lsReconoTo);
try
{
sql = "select reco_no from loan_reco where reco_no >= ? and reco_no <= ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsReconoFr);
pstmt.setString(2, lsReconoTo);
rs = pstmt.executeQuery();
while(rs.next())
{
lsRecono = checkNull(rs.getString(1));
sql = "update loan_reco set confirmed = 'Y', conf_date = ? ,emp_code__aprv = ? where reco_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, new Timestamp(System.currentTimeMillis()));
pstmt.setString(2, loginEmpCode);
pstmt.setString(3, lsRecono);
cntRows = pstmt.executeUpdate();
System.out.println("row update into loan_reco ="+cntRows);
errString = gbfPostLoanReco(lsRecono , conn);
}
if( pstmt != null )
{
pstmt.close();
pstmt = null;
}
if(errString != null && errString.trim().length() > 0)
{
conn.rollback();
return errString;
}
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
return errString;
}
public String gbfPostLoanReco(String lsRecono,Connection conn) throws ITMException
{
String errString = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
String sql = "";
String empCode = "";
String lsLoanno = "";
String lsTranser = "";
String lsRefno = "";
String lsAdcode = "";
String lsConf = "";
String lsSundrytype = "";
String lsSundrycode = "";
String lsStatus = "";
Timestamp ldRecodate = null;
Timestamp ldStartdate = null;
Timestamp ldConfdate = null;
Timestamp ldRefdate = null;
double lcRecoamt = 0;
double lcBalamt = 0;
double lcAdbal = 0;
double lcLoanbal = 0;
int cntRows = 0;
try
{
do
{
sql = "select emp_code, loan_no, ad_code, reco_date, start_date, confirmed , conf_date , tran_ser__pay, ref_no__pay, reco_amt from loan_reco where reco_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsRecono);
rs = pstmt.executeQuery();
if(rs.next())
{
empCode = checkNull(rs.getString(1));
lsLoanno = checkNull(rs.getString(2));
lsAdcode = checkNull(rs.getString(3));
ldRecodate = rs.getTimestamp(4);
ldStartdate = rs.getTimestamp(5);
lsConf = checkNull(rs.getString(6));
ldConfdate = rs.getTimestamp(7);
lsTranser = checkNull(rs.getString(8));
lsRefno = checkNull(rs.getString(9));
lcRecoamt = rs.getDouble(10);
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("empCode::::"+empCode+"::lsLoanno:::"+lsLoanno+"::lsAdcode::"+lsAdcode+"::ldRecodate::"+ldRecodate+"::ldStartdate::"+ldStartdate);
System.out.println("lsConf::::"+lsConf+"::ldConfdate::"+ldConfdate+"::lsTranser::"+lsTranser+"::lsRefno::"+lsRefno+"::lcRecoamt::"+lcRecoamt);
if((lsTranser != null && lsTranser.trim().length() > 0) && (lsRefno != null) && lsRefno.trim().length() > 0)
{
sql = "select sundry_type, sundry_code, nvl(tot_amt,0) - nvl(adj_amt,0) , ref_date from misc_payables where tran_ser = ? and ref_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsTranser);
pstmt.setString(2, lsRefno);
rs = pstmt.executeQuery();
if(rs.next())
{
lsSundrytype = checkNull(rs.getString(1));
lsSundrycode = checkNull(rs.getString(2));
lcBalamt = rs.getDouble(3);
ldRefdate = rs.getTimestamp(4);
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("lsSundrytype::"+lsSundrytype+"::lsSundrycode::"+lsSundrycode+"::lcBalamt::"+lcBalamt+"::ldRefdate::"+ldRefdate);
//if(!("E".equalsIgnoreCase(lsSundrytype))|| (!lsSundrycode.trim().equalsIgnoreCase(empCode)))
if((!"E".equalsIgnoreCase(lsSundrytype)) || (!lsSundrycode.trim().equalsIgnoreCase(empCode.trim())) )
{
errString = itmdbAccess.getErrorString("", "VTPAYSUNTY", userId, "", conn);
break;
}
else if(lcRecoamt > lcBalamt)
{
errString = itmdbAccess.getErrorString("", "VTPAYBAL", userId, "", conn);
break;
}
else
{
if(lcRecoamt == lcBalamt)
{
lsStatus = "A";
}
else
{
lsStatus = "P";
}
sql = "update misc_payables set adj_amt = adj_amt + ?,status = ?, status_date = ? where tran_ser = ? and ref_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, lcRecoamt);
pstmt.setString(2, lsStatus);
pstmt.setTimestamp(3, ldConfdate);
pstmt.setString(4, lsTranser);
pstmt.setString(5, lsRefno);
cntRows = pstmt.executeUpdate();
System.out.println("row update into misc_payables ="+cntRows);
if(cntRows == 0)
{
errString = itmdbAccess.getErrorString("", "DS000NR", userId, "", conn);
break;
}
}
}
sql = "select amt_bal from allowdedn_bal where ref_type = 'L' and ref_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsLoanno);
rs = pstmt.executeQuery();
if(rs.next())
{
lcAdbal = rs.getDouble(1);
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("lcAdbal::"+lcAdbal);
if(lcAdbal < lcRecoamt)
{
errString = itmdbAccess.getErrorString("", "VPNOBAL1", userId, "", conn);
break;
}
else
{
sql = "update allowdedn_bal set amt_adj = amt_adj + ?, amt_bal = amt_bal - ? where ref_type = 'L' and ref_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, lcRecoamt);
pstmt.setDouble(2, lcRecoamt);
pstmt.setString(3, lsLoanno);
cntRows = pstmt.executeUpdate();
System.out.println("row update into allowdedn_bal ="+cntRows);
if(cntRows == 0)
{
errString = itmdbAccess.getErrorString("", "DS000NR", userId, "", conn);
break;
}
lcLoanbal = 0;
sql = "select balance_amt from loans where loan_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsLoanno);
rs = pstmt.executeQuery();
if(rs.next())
{
lcLoanbal = rs.getDouble(1);
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("lcLoanbal::"+lcLoanbal);
lcLoanbal = lcLoanbal - lcRecoamt;
System.out.println("lcLoanbal:::::after deduction"+lcLoanbal);
if(lcLoanbal < 0)
{
errString = itmdbAccess.getErrorString("", "VPNOBAL1", userId, "", conn);
break;
}
if(lcLoanbal > 0)
{
sql = "update loans set balance_amt = balance_amt - ?, date__balance = ? where loan_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, lcRecoamt);
pstmt.setTimestamp(2, ldRecodate);
pstmt.setString(3, lsLoanno);
cntRows = pstmt.executeUpdate();
System.out.println("row update into loans:::::if ="+cntRows);
}
else
{
sql = "update loans set balance_amt = balance_amt - ?, date__balance = ?, status = 'E' where loan_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, lcRecoamt);
pstmt.setTimestamp(2, ldRecodate);
pstmt.setString(3, lsLoanno);
cntRows = pstmt.executeUpdate();
System.out.println("row update into loans::::::else ="+cntRows);
}
if(cntRows == 0)
{
errString = itmdbAccess.getErrorString("", "DS000NR", userId, "", conn);
break;
}
}
if(ldRefdate == null)
{
ldRefdate = ldRecodate;
System.out.println("ldRefdate:::::from loan_reco");
}
sql = "insert into loan_reg( loan_no , tran_no , tran_date , tran_type , amount , int_calculated , chg_date , chg_user , chg_term ) values( ? , ? , ? , 'R' , ? , 'N' , ? , ? , ? )";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsLoanno);
pstmt.setString(2, lsRecono);
pstmt.setTimestamp(3, ldRefdate);
pstmt.setDouble(4, lcRecoamt);
pstmt.setTimestamp(5, new java.sql.Timestamp(System.currentTimeMillis()));
pstmt.setString(6, userId);
pstmt.setString(7, chgTerm);
cntRows = pstmt.executeUpdate();
System.out.println("Number of row inserted into loan_reg = "+cntRows);
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cntRows == 0)
{
errString = itmdbAccess.getErrorString("", "DS000", userId, "", conn);
break;
}
break;
}
while(true);
if(errString != null && errString.trim().length() > 0)
{
conn.rollback();
}
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
return errString;
}
private String checkNull(String input)
{
if (input == null)
{
input = "";
}
else
{
input = input.trim();
}
return input;
}
}
package ibase.webitm.ejb.adm.adv;
import java.rmi.RemoteException;
import javax.ejb.Local;
import ibase.webitm.ejb.ActionHandlerLocal;
import ibase.webitm.utility.ITMException;
@Local
public interface LoanRecoConfLocal extends ActionHandlerLocal
{
public String confirm(String tranId, String xtraParams, String forcedFlag) throws RemoteException,ITMException;
}
package ibase.webitm.ejb.adm.adv;
import java.rmi.RemoteException;
import javax.ejb.Remote;
import ibase.webitm.ejb.ActionHandlerLocal;
import ibase.webitm.ejb.ActionHandlerRemote;
import ibase.webitm.utility.ITMException;
@Remote
public interface LoanRecoConfRemote extends ActionHandlerRemote
{
public String confirm(String tranId, String xtraParams, String forcedFlag) throws RemoteException,ITMException;
}
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