Commit 78081f20 authored by pbhosale's avatar pbhosale

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@211621 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7d996590
update system_events set service_code = 'poic_default_ejb', comp_type = 'EJB', comp_name = 'PayrollSplitgenAccIC'
where obj_name = 'payroll_splitgen_acc' and event_code = 'post_item_change';
update system_events set service_code = 'prv_default_ejb', comp_type = 'EJB', comp_name = 'PayrollSplitgenAccIC'
where obj_name = 'payroll_splitgen_acc' and event_code = 'pre_validate';
update system_events set service_code = 'pr_default_ejb', comp_type = 'EJB', comp_name = 'PayrollSplitgenAccPrc'
where obj_name = 'payroll_splitgen_acc' and event_code = 'process';
Insert into SYSTEM_EVENT_SERVICES (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM,SERVICE_NAMESPACE,RES_ELEM,SOAP_ACTION)
values ('pr_default_ejb','process data','http://localhost:9090/axis/services/ProcessService','BASE','process','String','S',null,null,to_date('22-JUN-18','DD-MON-RR'),'HRISHIKESH','HRISHIKESH',null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE)
values ('pr_default_ejb',1,'COMPONENT_TYPE','I','Component Type','S',null,to_date('22-JUN-18','DD-MON-RR'),'HRISHIKESH','HRISHIKESH','EJB');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE)
values ('pr_default_ejb',2,'COMPONENT_NAME','I','Component Name','S',null,to_date('22-JUN-18','DD-MON-RR'),'BASE ','BASE ',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE)
values ('pr_default_ejb',3,'XML_DATA','I','XML data of form no 1','S',null,to_date('22-JUN-18','DD-MON-RR'),'HRISHIKESH','HRISHIKESH',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE)
values ('pr_default_ejb',4,'XML_DATA_ALL','I','XML data of form no 2','S',null,to_date('22-JUN-18','DD-MON-RR'),'HRISHIKESH','HRISHIKESH',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE)
values ('pr_default_ejb',5,'WINDOW_NAME','I','Object Context','S',null,to_date('22-JUN-18','DD-MON-RR'),'HRISHIKESH','HRISHIKESH',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE)
values ('pr_default_ejb',6,'XTRA_PARAMS','I','Extra Arguments','S',null,to_date('22-JUN-18','DD-MON-RR'),'HRISHIKESH','HRISHIKESH',null);
----------------------------------------------------- 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_payroll_single','2','2','M','seq10',null,null,null,null,null,'N',to_date('26-11-14','DD-MM-RR'),'BASE ','BASE ','0',null,null,null,null,null,null,null,'N','N',null,'0','0',null,null,null,null,null,null,null,null,null,'0',null,'ADM',null,null,null,null,null,null,null,null,null,'F',null,null,null,null,null,null,null,null,null,null,'0',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,'Y',null,null,null,null,null,null,null,null,null,null,null,null,null,null,'compact',null,'C',null,null,null,null,null);
------------------------------------------------------ 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,MOB_DEPLY,ENT_TYPES) values ('ADP',4,6,5,0,0,'w_payroll_single','Complete Process','Complete Process','ADP.4.6.5.0.0','CompletePayrollProcess.png','CompletePayrollProcesswht.png',null,'P',null,null,null,'B',null,null,'B','0 ');
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,MOB_DEPLY,ENT_TYPES) values ('HRM',4,6,5,0,0,'w_payroll_single','Complete Process',null,'HRM.4.6.5.0.0','CompletePayrollProcess.png','CompletePayrollProcesswht.png',null,'P',null,null,null,'B',null,null,'B','0 ');
----------------------------------------------------- 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,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW,AUTO_ADDON_ENTRY,DUPLICATE_ADD,DEFAULT_ROW_CNT,FREEZE_COL_POS,IS_MANDATORY,TRAN_ID_COL,SELECTION_OPT,KEY_INFO,THUMB_OBJ,THUMB_IMAGE_COL,THUMB_ALT_COL,FORM_NAME,FORM_ICON,FORM_VIEW_OPTS,X_COLUMN,Y_COLUMN,ACTION_ARG) values ('w_payroll_single','Complete Process','d_payroll_single_filt',null,null,null,null,null,'1','F',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,'DetailForm.png',null,null,null,null);
----------------------------------------------------- OBJ_ACTIONS
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,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,PAGE_CONTEXT,TYPE,ACTION_ARG,SWIPE_POSITION,MULTI_ROW_OPT,ACTION_ID,DEF_NODATA,IN_PROC_INTRUPT,ESTIMATED_TIME,ACTION_GROUP,DISPLAY_OPT,DISPLAY_MODE,SHOW_CONFIRM,REC_SPECIFIC) values ('payroll_single',8,'ibase/resource/objaction/copyTransaction.svg','Adding New','a','a','A','Copy Transaction','1',null,null,'S',null,null,null,null,null,null,null,null,null,null,null,null,'0',null,null,null,null,null,null,'1',null,null);
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,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,PAGE_CONTEXT,TYPE,ACTION_ARG,SWIPE_POSITION,MULTI_ROW_OPT,ACTION_ID,DEF_NODATA,IN_PROC_INTRUPT,ESTIMATED_TIME,ACTION_GROUP,DISPLAY_OPT,DISPLAY_MODE,SHOW_CONFIRM,REC_SPECIFIC) values ('payroll_single',39,'ibase/resource/objaction/exprtExl.svg','Export To Excel','a','a','B','Export2XLS','1',null,null,'S',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'2',null,1);
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,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,PAGE_CONTEXT,TYPE,ACTION_ARG,SWIPE_POSITION,MULTI_ROW_OPT,ACTION_ID,DEF_NODATA,IN_PROC_INTRUPT,ESTIMATED_TIME,ACTION_GROUP,DISPLAY_OPT,DISPLAY_MODE,SHOW_CONFIRM,REC_SPECIFIC) values ('payroll_single',40,'ibase/resource/objaction/Audit-trail.svg','View Audit Trail','audit_trail','1','X','Audit Trail','1','1','1','U',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'2',null,null);
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,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,PAGE_CONTEXT,TYPE,ACTION_ARG,SWIPE_POSITION,MULTI_ROW_OPT,ACTION_ID,DEF_NODATA,IN_PROC_INTRUPT,ESTIMATED_TIME,ACTION_GROUP,DISPLAY_OPT,DISPLAY_MODE,SHOW_CONFIRM,REC_SPECIFIC) values ('payroll_single',41,'ibase/resource/objaction/add.svg','Adding New','a','a','A','Add','2',null,null,'S',null,null,null,null,null,null,null,null,null,null,null,null,'0',null,null,null,null,null,null,'4',null,null);
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,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,PAGE_CONTEXT,TYPE,ACTION_ARG,SWIPE_POSITION,MULTI_ROW_OPT,ACTION_ID,DEF_NODATA,IN_PROC_INTRUPT,ESTIMATED_TIME,ACTION_GROUP,DISPLAY_OPT,DISPLAY_MODE,SHOW_CONFIRM,REC_SPECIFIC) values ('payroll_single',42,'ibase/resource/objaction/edit.svg','Editing Existing Record','a','a','E','Edit','2',null,null,'S',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'4','000',null);
Insert into OBJ_ACTIONS (OBJ_NAME,LINE_NO,IMAGE,DESCRIPTION,SERVICE_CODE,INTERACTIVE,RIGHTS_CHAR,TITLE,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,PAGE_CONTEXT,TYPE,ACTION_ARG,SWIPE_POSITION,MULTI_ROW_OPT,ACTION_ID,DEF_NODATA,IN_PROC_INTRUPT,ESTIMATED_TIME,ACTION_GROUP,DISPLAY_OPT,DISPLAY_MODE,SHOW_CONFIRM,REC_SPECIFIC) values ('payroll_single',43,'ibase/resource/objaction/email.svg','Email Template','a','a','R','Email','2','6',null,'U',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'4',null,null);
----------------------------------------------------- OBJ_ITEMCHANGE
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('payroll_single','1','emp_code__fr',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('payroll_single','1','emp_code__to',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('payroll_single','1','itm_default',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('payroll_single','1','prd_code__fr',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('payroll_single','1','prd_code__to',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('payroll_single','1','proc_group__from',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('payroll_single','1','proc_group__to',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('payroll_single','1','site_code__fr',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('payroll_single','1','site_code__to',null);
Insert into OBJ_ITEMCHANGE (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('payroll_single','1','type',null);
----------------------------------------------------- SYSTEM_EVENTS
Insert into SYSTEM_EVENTS (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,OVERWRITE_CORE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('payroll_single','post_item_change','1','poic_default_ejb',null,'0',to_date('04-12-07','DD-MM-RR'),'BASE ','BASE','2','JB','ibase.webitm.ejb.adm.PayrollSinglePrcIC',null);
Insert into SYSTEM_EVENTS (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,OVERWRITE_CORE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('payroll_single','post_validate','1','post_gen_val',null,'0',to_date('04-12-07','DD-MM-RR'),'system ','system','2','JB','ibase.webitm.ejb.sys.GenValidate',null);
Insert into SYSTEM_EVENTS (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,OVERWRITE_CORE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('payroll_single','pre_validate','1','prv_default_ejb',null,'0',to_date('04-12-07','DD-MM-RR'),'BASE ','BASE','2','JB','ibase.webitm.ejb.adm.PayrollSinglePrcIC',null);
Insert into SYSTEM_EVENTS (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,OVERWRITE_CORE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('payroll_single','process','1','pr_default_ejb',null,'0',to_date('04-12-07','DD-MM-RR'),'Base ','Base','2','JB','ibase.webitm.ejb.adm.PayrollSinglePrc',null);
---------------------------------------------------- SYSTEM_EVENT_SERVICES
Insert into SYSTEM_EVENT_SERVICES (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM,SERVICE_NAMESPACE,RES_ELEM,SOAP_ACTION) values ('pr_default_ejb','process data','http://localhost:9090/axis/services/ProcessService','BASE','process','String','S',null,null,to_date('22-06-18','DD-MM-RR'),'HRISHIKESH','HRISHIKESH',null,null,null);
Insert into SYSTEM_EVENT_SERVICES (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM,SERVICE_NAMESPACE,RES_ELEM,SOAP_ACTION) values ('prv_default_ejb','prv_default_ejb','http://localhost:9090/axis/services/ValidatorService',null,'wfValData','String','S',null,null,to_date('22-03-19','DD-MM-RR'),'BASE ','BASE',null,null,null);
Insert into SYSTEM_EVENT_SERVICES (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM,SERVICE_NAMESPACE,RES_ELEM,SOAP_ACTION) values ('poic_default_ejb','itemchanged','http://localhost:9090/axis/services/ValidatorService',null,'itemChanged','String','S',null,null,to_date('22-03-19','DD-MM-RR'),'BASE ','BASE',null,null,null);
Insert into SYSTEM_EVENT_SERVICES (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM,SERVICE_NAMESPACE,RES_ELEM,SOAP_ACTION) values ('post_gen_val','validation','http://localhost:9090/axis/services/ValidatorService','BASE iformation','wfValData','String','S',null,null,to_date('21-05-16','DD-MM-RR'),'BASE ','VAIBHAV',null,null,null);
---------------------------------------------------- SYSTEM_SERVICE_ARGS
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pr_default_ejb',1,'COMPONENT_TYPE','I','Component Type','S',null,to_date('22-06-18','DD-MM-RR'),'HRISHIKESH','HRISHIKESH','JB');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pr_default_ejb',2,'COMPONENT_NAME','I','Component Name','S',null,to_date('22-06-18','DD-MM-RR'),'BASE ','BASE ',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pr_default_ejb',3,'XML_DATA','I','XML data of form no 1','S',null,to_date('22-06-18','DD-MM-RR'),'HRISHIKESH','HRISHIKESH',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pr_default_ejb',4,'XML_DATA_ALL','I','XML data of form no 2','S',null,to_date('22-06-18','DD-MM-RR'),'HRISHIKESH','HRISHIKESH',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pr_default_ejb',5,'WINDOW_NAME','I','Object Context','S',null,to_date('22-06-18','DD-MM-RR'),'HRISHIKESH','HRISHIKESH',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('pr_default_ejb',6,'XTRA_PARAMS','I','Extra Arguments','S',null,to_date('22-06-18','DD-MM-RR'),'HRISHIKESH','HRISHIKESH',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('post_gen_val',1,'COMPONENT_TYPE','I',null,'C.String',null,to_date('21-05-16','DD-MM-RR'),'VAIBHAV ','VAIBHAV','JB');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('post_gen_val',2,'COMPONENT_NAME','I',null,'C.String',null,to_date('21-05-16','DD-MM-RR'),'VAIBHAV ','VAIBHAV','ibase.webitm.ejb.sys.GenValidate');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('post_gen_val',3,'XML_DATA','I',null,'S',null,to_date('21-05-16','DD-MM-RR'),'VAIBHAV ','VAIBHAV',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('post_gen_val',4,'XML_DATA_ALL','I',null,'S',null,to_date('21-05-16','DD-MM-RR'),'VAIBHAV ','VAIBHAV',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('post_gen_val',5,'XML_DATA_ALL','I',null,'S',null,to_date('21-05-16','DD-MM-RR'),'VAIBHAV ','VAIBHAV',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('post_gen_val',6,'OBJ_CONTEXT','I',null,'S',null,to_date('21-05-16','DD-MM-RR'),'VAIBHAV ','VAIBHAV',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('post_gen_val',7,'WIN_NAME','I',null,'S',null,to_date('21-05-16','DD-MM-RR'),'VAIBHAV ','VAIBHAV',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('post_gen_val',8,'XTRA_PARAMS','I',null,'S',null,to_date('21-05-16','DD-MM-RR'),'VAIBHAV ','VAIBHAV',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('post_gen_val',9,'ACTION','I',null,'S',null,to_date('19-05-15','DD-MM-RR'),'BASE ','BASE',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',1,'COMPONENT_TYPE','I',null,'S',null,null,null,null,'JB');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',2,'COMPONENT_NAME','I',null,'S',null,null,null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',3,'XML_DATA','I',null,'S',null,null,null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',4,'XML_DATA_1','I',null,'S',null,null,null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',5,'XML_DATA_ALL','I',null,'S',null,null,null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',6,'OBJ_CONTEXT','I',null,'S',null,null,null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',7,'FOCUSED_COLUMN','I',null,'S',null,null,null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',8,'EDIT_FLAG','I',null,'S',null,null,null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('poic_default_ejb',9,'XTRA_PARAMS','I',null,'S',null,null,null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',1,'COMPONENT_TYPE','I',null,'S',null,to_date('01-06-12','DD-MM-RR'),'Manohar ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',2,'COMPONENT_NAME','I',null,'S',null,to_date('01-06-12','DD-MM-RR'),'Manohar ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',3,'XML_DATA','I',null,'S',null,to_date('01-06-12','DD-MM-RR'),'Manohar ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',4,'XML_DATA_1','I',null,'S',null,to_date('01-06-12','DD-MM-RR'),'Manohar ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',5,'XML_DATA_ALL','I',null,'S',null,to_date('01-06-12','DD-MM-RR'),'Manohar ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',6,'OBJ_CONTEXT','I',null,'S',null,to_date('01-06-12','DD-MM-RR'),'Manohar ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',7,'EDIT_FLAG','I',null,'S',null,to_date('01-06-12','DD-MM-RR'),'Manohar ','Manohar',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prv_default_ejb',8,'XTRA_PARAMS','I',null,'S',null,to_date('01-06-12','DD-MM-RR'),'Manohar ','Manohar',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,OBJ_NAME__DS,DATA_MODEL_NAME,VALIDATE_DATA,ITEM_CHANGE,MSG_NO,FILTER_EXPR,LAYOUT) values ('PROC_GROUP__TO','W_PAYROLL_SINGLE','SELECT FLD_VALUE,DESCR FROM GENCODES WHERE FLD_NAME = ''PROC_GROUP''',null,'PROC GRP TO',0,0,to_date('23-05-06','DD-MM-RR'),null,null,null,null,null,0,null,null,null,null,null,null,'2',null,'3','ProcImages','fld_value','descr','2 ',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 ('PROC_GROUP__FROM','W_PAYROLL_SINGLE','SELECT FLD_VALUE,DESCR FROM GENCODES WHERE FLD_NAME = ''PROC_GROUP''',null,'PROC GRP FROM',0,0,to_date('23-05-06','DD-MM-RR'),null,null,null,null,null,0,null,null,null,null,null,null,'2',null,'3','ProcImages','fld_value','descr','2 ',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 ('EMP_CODE__FR','W_PAYROLL_SINGLE','Select emp_code, emp_fname ,emp_lname from employee ',null,'Employee code',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','EmpImages','emp_code','emp_fname','2 ',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 ('EMP_CODE__TO','W_PAYROLL_SINGLE','Select emp_code, emp_fname ,emp_lname from employee ',null,'Employee code',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','EmpImages','emp_code','emp_fname','2 ',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 ('SITE_CODE__FR','W_PAYROLL_SINGLE','select site_code AS SITE_CODE__FR,descr from site where case when site_type is null then '' '' else site_type end <> ''I''',null,null,0,0,to_date('25-10-13','DD-MM-RR'),'BASE ','BASE ','1',null,null,null,null,null,null,null,null,0,'2',null,'3','SiteImages','site_code_fr','descr','2 ',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 ('SITE_CODE__TO','W_PAYROLL_SINGLE','select site_code AS SITE_CODE__FR,descr from site where case when site_type is null then '' '' else site_type end <> ''I''',null,null,0,0,to_date('25-10-13','DD-MM-RR'),'BASE ','BASE ','1',null,null,null,null,null,null,null,null,0,'2',null,'3','SiteImages','site_code_fr','descr','2 ',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 ('PRD_CODE__FR','W_PAYROLL_SINGLE','SELECT CODE,DESCR FROM PERIOD ORDER BY CODE','trainneed','Train need',0,0,null,'Skumar ','Skumar ','0',null,null,null,null,null,null,null,null,null,'2',null,'2','PrdImages','code','descr','2 ',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 ('PRD_CODE__TO','W_PAYROLL_SINGLE','Select code as prd_code, descr from period',null,'Period Code',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','PrdImages','prd_code','descr','2 ',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 ('PRD_CODE__ARR','W_PAYROLL_SINGLE','Select code as prd_code, descr from period',null,'Period Code',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','PrdImages','prd_code','descr','2 ',null,null,null,null,null,null,null);
----------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Sybase_eDataWindow>
<Sybase_eDataWindow>
<Release>9</Release>
<BaseDefinition>
<units>1</units>
<timer_interval>0</timer_interval>
<color>79741120</color>
<processing>0</processing>
<HTMLDW>no</HTMLDW>
<print>
<documentname></documentname>
<printername></printername>
<orientation>0</orientation>
<margin>
<left>24</left>
<right>24</right>
<top>24</top>
<bottom>24</bottom>
</margin>
<paper>
<source>0</source>
<size>0</size>
</paper>
<prompt>no</prompt>
<canusedefaultprinter>yes</canusedefaultprinter>
<buttons>no</buttons>
<preview.buttons>no</preview.buttons>
<cliptext>no</cliptext>
<overrideprintjob>no</overrideprintjob>
</print>
</BaseDefinition>
<Summary>
<height>1</height>
<color>536870912</color>
</Summary>
<Footer>
<height>0</height>
<color>536870912</color>
</Footer>
<Detail>
<height>219</height>
<color>536870912</color>
</Detail>
<TableDefinition>
<table_column>
<type size="10">char</type>
<updatewhereclause>no</updatewhereclause>
<name>emp_code__fr</name>
<dbname>EMP_CODE__FR</dbname>
</table_column>
<table_column>
<type size="10">char</type>
<updatewhereclause>no</updatewhereclause>
<name>emp_code__to</name>
<dbname>EMP_CODE__TO</dbname>
</table_column>
<table_column>
<type size="6">char</type>
<updatewhereclause>no</updatewhereclause>
<name>prd_code__fr</name>
<dbname>PRD_CODE__FR</dbname>
</table_column>
<table_column>
<type size="6">char</type>
<updatewhereclause>no</updatewhereclause>
<name>prd_code__to</name>
<dbname>PRD_CODE__TO</dbname>
</table_column>
<table_column>
<type size="5">char</type>
<updatewhereclause>no</updatewhereclause>
<name>site_code__fr</name>
<dbname>SITE_CODE__FR</dbname>
</table_column>
<table_column>
<type size="5">char</type>
<updatewhereclause>no</updatewhereclause>
<name>site_code__to</name>
<dbname>SITE_CODE__TO</dbname>
</table_column>
<table_column>
<type>datetime</type>
<updatewhereclause>no</updatewhereclause>
<name>payroll_date</name>
<dbname>PAYROLL_DATE</dbname>
</table_column>
<table_column>
<type size="2">char</type>
<updatewhereclause>no</updatewhereclause>
<name>type</name>
<dbname>TYPE</dbname>
<initial>AR</initial>
<values>
<item display="Arrears" data="AR"/>
</values>
</table_column>
<table_column>
<type size="6">char</type>
<updatewhereclause>no</updatewhereclause>
<name>prd_code__arr</name>
<dbname>PRD_CODE__ARR</dbname>
</table_column>
<table_column>
<type size="5">char</type>
<updatewhereclause>no</updatewhereclause>
<name>proc_group__from</name>
<dbname>proc_group__from</dbname>
</table_column>
<table_column>
<type size="5">char</type>
<updatewhereclause>no</updatewhereclause>
<name>proc_group__to</name>
<dbname>proc_group__to</dbname>
</table_column>
<table_column>
<type size="15">char</type>
<updatewhereclause>no</updatewhereclause>
<name>emp_name__fr</name>
<dbname>emp_name__fr</dbname>
</table_column>
<table_column>
<type size="15">char</type>
<updatewhereclause>no</updatewhereclause>
<name>emp_name__to</name>
<dbname>emp_name__to</dbname>
</table_column>
<table_column>
<type size="10">char</type>
<updatewhereclause>no</updatewhereclause>
<name>fr_prd_descr</name>
<dbname>fr_prd_descr</dbname>
</table_column>
<table_column>
<type size="10">char</type>
<updatewhereclause>no</updatewhereclause>
<name>to_prd_descr</name>
<dbname>to_prd_descr</dbname>
</table_column>
<table_column>
<type size="60">char</type>
<updatewhereclause>no</updatewhereclause>
<name>fr_site_descr</name>
<dbname>fr_site_descr</dbname>
</table_column>
<table_column>
<type size="60">char</type>
<updatewhereclause>no</updatewhereclause>
<name>to_site_descr</name>
<dbname>to_site_descr</dbname>
</table_column>
<table_column>
<type size="120">char</type>
<updatewhereclause>no</updatewhereclause>
<name>proc_group__fr_name</name>
<dbname>proc_group__fr_name</dbname>
</table_column>
<table_column>
<type size="120">char</type>
<updatewhereclause>no</updatewhereclause>
<name>proc_group__to_name</name>
<dbname>proc_group__to_name</dbname>
</table_column>
</TableDefinition>
<TextObject>
<band>Detail</band>
<alignment>1</alignment>
<text>Type :</text>
<border>0</border>
<color>0</color>
<x>322</x>
<y>11</y>
<height>16</height>
<width>34</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>type_t</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>79741120</color>
</background>
</TextObject>
<TextObject>
<band>Detail</band>
<alignment>1</alignment>
<text>Processing Date :</text>
<border>0</border>
<color>0</color>
<x>50</x>
<y>11</y>
<height>16</height>
<width>98</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>payroll_date_t</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>79741120</color>
</background>
</TextObject>
<ColumnObject>
<band>Detail</band>
<id>7</id>
<alignment>0</alignment>
<tabsequence>10</tabsequence>
<border>0</border>
<color>0</color>
<x>153</x>
<y>11</y>
<height>16</height>
<width>57</width>
<format>[shortdate] [time]</format>
<html>
<valueishtml>0</valueishtml>
</html>
<name>payroll_date</name>
<visible>1</visible>
<EditStyle name="datetime" style="editmask">
<mask>dd/mm/yy</mask>
<imemode>0</imemode>
<focusrectangle>no</focusrectangle>
</EditStyle>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>16777215</color>
</background>
</ColumnObject>
<ColumnObject>
<band>Detail</band>
<id>8</id>
<alignment>0</alignment>
<tabsequence>20</tabsequence>
<border>0</border>
<color>0</color>
<x>361</x>
<y>11</y>
<height>16</height>
<width>124</width>
<format>[general]</format>
<html>
<valueishtml>0</valueishtml>
</html>
<name>type</name>
<visible>1</visible>
<EditStyle style="ddlb">
<limit>0</limit>
<allowedit>no</allowedit>
<case>any</case>
<imemode>0</imemode>
</EditStyle>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>16777215</color>
</background>
</ColumnObject>
<ColumnObject>
<band>Detail</band>
<id>9</id>
<alignment>0</alignment>
<tabsequence>110</tabsequence>
<border>0</border>
<color>0</color>
<x>435</x>
<y>189</y>
<height>16</height>
<width>54</width>
<format>[general]</format>
<html>
<valueishtml>0</valueishtml>
</html>
<protect expression="if(type = &apos;AR&apos;, 0, 1)">0</protect>
<name>prd_code__arr</name>
<visible>1</visible>
<EditStyle style="edit">
<limit>6</limit>
<case>upper</case>
<focusrectangle>no</focusrectangle>
<autoselect>yes</autoselect>
<autohscroll>yes</autohscroll>
<imemode>0</imemode>
</EditStyle>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>16777215</color>
</background>
</ColumnObject>
<TextObject>
<band>Detail</band>
<alignment>1</alignment>
<text>Arrears to be considered in the period &gt;&gt;</text>
<border>0</border>
<color>16711680</color>
<x>88</x>
<y>189</y>
<height>16</height>
<width>343</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>t_5</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>79741120</color>
</background>
</TextObject>
<TextObject>
<band>Detail</band>
<alignment>1</alignment>
<text>Period &gt;&gt;</text>
<border>0</border>
<color>16711680</color>
<x>38</x>
<y>82</y>
<height>16</height>
<width>66</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>t_8</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>79741120</color>
</background>
</TextObject>
<TextObject>
<band>Detail</band>
<alignment>1</alignment>
<text>Employee &gt;&gt; </text>
<border>0</border>
<color>16711680</color>
<x>8</x>
<y>51</y>
<height>16</height>
<width>96</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>t_6</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>79741120</color>
</background>
</TextObject>
<LineObject>
<band>Detail</band>
<x1>41</x1>
<y1>36</y1>
<x2>526</x2>
<y2>36</y2>
<name>l_1</name>
<visible>1</visible>
<slideleft>yes</slideleft>
<pen>
<style>0</style>
<width>1</width>
<color>8388608</color>
</pen>
<background>
<mode>2</mode>
<color>12632256</color>
</background>
</LineObject>
<TextObject>
<band>Detail</band>
<alignment>1</alignment>
<text>Site &gt;&gt;</text>
<border>0</border>
<color>16711680</color>
<x>47</x>
<y>110</y>
<height>16</height>
<width>57</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>t_7</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>79741120</color>
</background>
</TextObject>
<TextObject>
<band>Detail</band>
<alignment>1</alignment>
<text>Proc. Group &gt;&gt;</text>
<border>0</border>
<color>16711680</color>
<x>8</x>
<y>140</y>
<height>16</height>
<width>96</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>proc_group_t</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>79741120</color>
</background>
</TextObject>
<TextObject>
<band>Detail</band>
<alignment>1</alignment>
<text>From :</text>
<border>0</border>
<color>0</color>
<x>107</x>
<y>51</y>
<height>16</height>
<width>36</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>t_2</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>79741120</color>
</background>
</TextObject>
<TextObject>
<band>Detail</band>
<alignment>1</alignment>
<text>From :</text>
<border>0</border>
<color>0</color>
<x>107</x>
<y>82</y>
<height>16</height>
<width>36</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>t_9</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>79741120</color>
</background>
</TextObject>
<TextObject>
<band>Detail</band>
<alignment>1</alignment>
<text>From :</text>
<border>0</border>
<color>0</color>
<x>107</x>
<y>110</y>
<height>16</height>
<width>36</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>site_code__fr_t</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>79741120</color>
</background>
</TextObject>
<TextObject>
<band>Detail</band>
<alignment>1</alignment>
<text>From :</text>
<border>0</border>
<color>0</color>
<x>107</x>
<y>140</y>
<height>16</height>
<width>36</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>proc_group__from_t</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>79741120</color>
</background>
</TextObject>
<ColumnObject>
<band>Detail</band>
<id>1</id>
<alignment>0</alignment>
<tabsequence>30</tabsequence>
<border>0</border>
<color>0</color>
<x>147</x>
<y>51</y>
<height>16</height>
<width>55</width>
<format>[general]</format>
<html>
<valueishtml>0</valueishtml>
</html>
<name>emp_code__fr</name>
<visible>1</visible>
<EditStyle style="edit">
<limit>10</limit>
<case>upper</case>
<focusrectangle>no</focusrectangle>
<autoselect>yes</autoselect>
<autohscroll>yes</autohscroll>
<imemode>0</imemode>
</EditStyle>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>16777215</color>
</background>
</ColumnObject>
<ColumnObject>
<band>Detail</band>
<id>3</id>
<alignment>0</alignment>
<tabsequence>50</tabsequence>
<border>0</border>
<color>0</color>
<x>147</x>
<y>82</y>
<height>16</height>
<width>55</width>
<format>[general]</format>
<html>
<valueishtml>0</valueishtml>
</html>
<name>prd_code__fr</name>
<visible>1</visible>
<EditStyle style="edit">
<limit>0</limit>
<case>any</case>
<autoselect>yes</autoselect>
<imemode>0</imemode>
</EditStyle>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>16777215</color>
</background>
</ColumnObject>
<ColumnObject>
<band>Detail</band>
<id>5</id>
<alignment>0</alignment>
<tabsequence>70</tabsequence>
<border>0</border>
<color>0</color>
<x>147</x>
<y>110</y>
<height>16</height>
<width>55</width>
<format>[general]</format>
<html>
<valueishtml>0</valueishtml>
</html>
<name>site_code__fr</name>
<visible>1</visible>
<EditStyle style="edit">
<limit>5</limit>
<case>upper</case>
<focusrectangle>no</focusrectangle>
<autoselect>yes</autoselect>
<autohscroll>yes</autohscroll>
<imemode>0</imemode>
</EditStyle>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>16777215</color>
</background>
</ColumnObject>
<ColumnObject>
<band>Detail</band>
<id>10</id>
<alignment>0</alignment>
<tabsequence>90</tabsequence>
<border>0</border>
<color>0</color>
<x>147</x>
<y>140</y>
<height>16</height>
<width>55</width>
<format>[general]</format>
<html>
<valueishtml>0</valueishtml>
</html>
<name>proc_group__from</name>
<visible>1</visible>
<EditStyle style="edit">
<limit>5</limit>
<case>upper</case>
<focusrectangle>no</focusrectangle>
<autoselect>yes</autoselect>
<autohscroll>yes</autohscroll>
<imemode>0</imemode>
</EditStyle>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>2</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>16777215</color>
</background>
</ColumnObject>
<ColumnObject>
<band>Detail</band>
<id>12</id>
<alignment>0</alignment>
<tabsequence>32766</tabsequence>
<border>0</border>
<color>255</color>
<x>207</x>
<y>51</y>
<height>16</height>
<width>137</width>
<format>[general]</format>
<html>
<valueishtml>0</valueishtml>
</html>
<name>emp_name__fr</name>
<visible>1</visible>
<EditStyle style="edit">
<limit>0</limit>
<case>any</case>
<autoselect>yes</autoselect>
<imemode>0</imemode>
</EditStyle>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>67108864</color>
</background>
</ColumnObject>
<ColumnObject>
<band>Detail</band>
<id>14</id>
<alignment>0</alignment>
<tabsequence>32766</tabsequence>
<border>0</border>
<color>255</color>
<x>207</x>
<y>82</y>
<height>16</height>
<width>137</width>
<format>[general]</format>
<html>
<valueishtml>0</valueishtml>
</html>
<name>fr_prd_descr</name>
<visible>1</visible>
<EditStyle style="edit">
<limit>0</limit>
<case>any</case>
<autoselect>yes</autoselect>
<imemode>0</imemode>
</EditStyle>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>67108864</color>
</background>
</ColumnObject>
<ColumnObject>
<band>Detail</band>
<id>16</id>
<alignment>0</alignment>
<tabsequence>32766</tabsequence>
<border>0</border>
<color>255</color>
<x>207</x>
<y>111</y>
<height>16</height>
<width>137</width>
<format>[general]</format>
<html>
<valueishtml>0</valueishtml>
</html>
<name>fr_site_descr</name>
<visible>1</visible>
<EditStyle style="edit">
<limit>0</limit>
<case>any</case>
<autoselect>yes</autoselect>
<imemode>0</imemode>
</EditStyle>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>67108864</color>
</background>
</ColumnObject>
<ColumnObject>
<band>Detail</band>
<id>18</id>
<alignment>0</alignment>
<tabsequence>32766</tabsequence>
<border>0</border>
<color>255</color>
<x>207</x>
<y>140</y>
<height>16</height>
<width>137</width>
<format>[general]</format>
<html>
<valueishtml>0</valueishtml>
</html>
<name>proc_group__fr_name</name>
<visible>1</visible>
<EditStyle style="edit">
<limit>0</limit>
<case>any</case>
<autoselect>yes</autoselect>
<imemode>0</imemode>
</EditStyle>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>67108864</color>
</background>
</ColumnObject>
<TextObject>
<band>Detail</band>
<alignment>1</alignment>
<text>to :</text>
<border>0</border>
<color>0</color>
<x>351</x>
<y>51</y>
<height>16</height>
<width>21</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>t_1</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>79741120</color>
</background>
</TextObject>
<TextObject>
<band>Detail</band>
<alignment>1</alignment>
<text>to :</text>
<border>0</border>
<color>0</color>
<x>351</x>
<y>82</y>
<height>16</height>
<width>21</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>t_10</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>79741120</color>
</background>
</TextObject>
<TextObject>
<band>Detail</band>
<alignment>1</alignment>
<text>to :</text>
<border>0</border>
<color>0</color>
<x>351</x>
<y>111</y>
<height>16</height>
<width>21</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>site_code__to_t</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>79741120</color>
</background>
</TextObject>
<TextObject>
<band>Detail</band>
<alignment>1</alignment>
<text>to :</text>
<border>0</border>
<color>0</color>
<x>351</x>
<y>140</y>
<height>16</height>
<width>21</width>
<html>
<valueishtml>0</valueishtml>
</html>
<name>proc_group__to_t</name>
<visible>1</visible>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>79741120</color>
</background>
</TextObject>
<ColumnObject>
<band>Detail</band>
<id>2</id>
<alignment>0</alignment>
<tabsequence>40</tabsequence>
<border>0</border>
<color>0</color>
<x>376</x>
<y>51</y>
<height>16</height>
<width>55</width>
<format>[general]</format>
<html>
<valueishtml>0</valueishtml>
</html>
<name>emp_code__to</name>
<visible>1</visible>
<EditStyle style="edit">
<limit>10</limit>
<case>upper</case>
<focusrectangle>no</focusrectangle>
<autoselect>yes</autoselect>
<autohscroll>yes</autohscroll>
<imemode>0</imemode>
</EditStyle>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>16777215</color>
</background>
</ColumnObject>
<ColumnObject>
<band>Detail</band>
<id>4</id>
<alignment>0</alignment>
<tabsequence>60</tabsequence>
<border>0</border>
<color>0</color>
<x>376</x>
<y>82</y>
<height>16</height>
<width>55</width>
<format>[general]</format>
<html>
<valueishtml>0</valueishtml>
</html>
<name>prd_code__to</name>
<visible>1</visible>
<EditStyle style="edit">
<limit>0</limit>
<case>any</case>
<autoselect>yes</autoselect>
<imemode>0</imemode>
</EditStyle>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>16777215</color>
</background>
</ColumnObject>
<ColumnObject>
<band>Detail</band>
<id>6</id>
<alignment>0</alignment>
<tabsequence>80</tabsequence>
<border>0</border>
<color>0</color>
<x>376</x>
<y>111</y>
<height>16</height>
<width>55</width>
<format>[general]</format>
<html>
<valueishtml>0</valueishtml>
</html>
<name>site_code__to</name>
<visible>1</visible>
<EditStyle style="edit">
<limit>5</limit>
<case>upper</case>
<focusrectangle>no</focusrectangle>
<autoselect>yes</autoselect>
<autohscroll>yes</autohscroll>
<imemode>0</imemode>
</EditStyle>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>16777215</color>
</background>
</ColumnObject>
<ColumnObject>
<band>Detail</band>
<id>11</id>
<alignment>0</alignment>
<tabsequence>100</tabsequence>
<border>0</border>
<color>0</color>
<x>376</x>
<y>140</y>
<height>16</height>
<width>55</width>
<format>[general]</format>
<html>
<valueishtml>0</valueishtml>
</html>
<name>proc_group__to</name>
<visible>1</visible>
<EditStyle style="edit">
<limit>5</limit>
<case>upper</case>
<focusrectangle>no</focusrectangle>
<autoselect>yes</autoselect>
<autohscroll>yes</autohscroll>
<imemode>0</imemode>
</EditStyle>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>2</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>16777215</color>
</background>
</ColumnObject>
<ColumnObject>
<band>Detail</band>
<id>13</id>
<alignment>0</alignment>
<tabsequence>32766</tabsequence>
<border>0</border>
<color>255</color>
<x>436</x>
<y>51</y>
<height>16</height>
<width>137</width>
<format>[general]</format>
<html>
<valueishtml>0</valueishtml>
</html>
<name>emp_name__to</name>
<visible>1</visible>
<EditStyle style="edit">
<limit>0</limit>
<case>any</case>
<autoselect>yes</autoselect>
<imemode>0</imemode>
</EditStyle>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>67108864</color>
</background>
</ColumnObject>
<ColumnObject>
<band>Detail</band>
<id>15</id>
<alignment>0</alignment>
<tabsequence>32766</tabsequence>
<border>0</border>
<color>255</color>
<x>436</x>
<y>82</y>
<height>16</height>
<width>137</width>
<format>[general]</format>
<html>
<valueishtml>0</valueishtml>
</html>
<name>to_prd_descr</name>
<visible>1</visible>
<EditStyle style="edit">
<limit>0</limit>
<case>any</case>
<autoselect>yes</autoselect>
<imemode>0</imemode>
</EditStyle>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>67108864</color>
</background>
</ColumnObject>
<ColumnObject>
<band>Detail</band>
<id>17</id>
<alignment>0</alignment>
<tabsequence>32766</tabsequence>
<border>0</border>
<color>255</color>
<x>436</x>
<y>111</y>
<height>16</height>
<width>137</width>
<format>[general]</format>
<html>
<valueishtml>0</valueishtml>
</html>
<name>to_site_descr</name>
<visible>1</visible>
<EditStyle style="edit">
<limit>0</limit>
<case>any</case>
<autoselect>yes</autoselect>
<imemode>0</imemode>
</EditStyle>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>67108864</color>
</background>
</ColumnObject>
<ColumnObject>
<band>Detail</band>
<id>19</id>
<alignment>0</alignment>
<tabsequence>32766</tabsequence>
<border>0</border>
<color>255</color>
<x>436</x>
<y>140</y>
<height>16</height>
<width>137</width>
<format>[general]</format>
<html>
<valueishtml>0</valueishtml>
</html>
<name>proc_group__to_name</name>
<visible>1</visible>
<EditStyle style="edit">
<limit>0</limit>
<case>any</case>
<autoselect>yes</autoselect>
<imemode>0</imemode>
</EditStyle>
<font>
<face>Times New Roman</face>
<height>-10</height>
<weight>400</weight>
<family>1</family>
<pitch>2</pitch>
<charset>0</charset>
</font>
<background>
<mode>2</mode>
<color>67108864</color>
</background>
</ColumnObject>
<HtmlTable>
<border>1</border>
</HtmlTable>
<HtmlGen>
<clientevents>1</clientevents>
<clientvalidation>1</clientvalidation>
<clientcomputedfields>1</clientcomputedfields>
<clientformatting>0</clientformatting>
<clientscriptable>0</clientscriptable>
<generatejavascript>1</generatejavascript>
<encodeselflinkargs>1</encodeselflinkargs>
<netscapelayers>0</netscapelayers>
</HtmlGen>
<Export.XML>
<headgroups>1</headgroups>
<includewhitespace>0</includewhitespace>
<metadatatype>0</metadatatype>
<savemetadata>0</savemetadata>
</Export.XML>
<Import.XML>
</Import.XML>
<Export.PDF>
<method>0</method>
<distill.custompostscript>0</distill.custompostscript>
<xslfop.print>0</xslfop.print>
</Export.PDF>
</Sybase_eDataWindow>
$PBExportHeader$d_payroll_single_filt.srd
$PBExportComments$Parameters data window for payroll generation.
release 9;
datawindow(units=1 timer_interval=0 color=67108864 processing=0 HTMLDW=no print.printername="" print.documentname="" print.orientation = 0 print.margin.left = 24 print.margin.right = 24 print.margin.top = 24 print.margin.bottom = 24 print.paper.source = 0 print.paper.size = 0 print.canusedefaultprinter=yes print.prompt=no print.buttons=no print.preview.buttons=no print.cliptext=no print.overrideprintjob=no print.collate=yes hidegrayline=no )
summary(height=0 color="536870912" )
footer(height=0 color="536870912" )
detail(height=373 color="536870912" )
table(column=(type=char(10) updatewhereclause=no name=emp_code__fr dbname="EMP_CODE__FR" )
column=(type=char(10) updatewhereclause=no name=emp_code__to dbname="EMP_CODE__TO" )
column=(type=char(6) updatewhereclause=no name=prd_code__fr dbname="PRD_CODE__FR" )
column=(type=char(6) updatewhereclause=no name=prd_code__to dbname="PRD_CODE__TO" )
column=(type=char(5) updatewhereclause=no name=site_code__fr dbname="SITE_CODE__FR" )
column=(type=char(5) updatewhereclause=no name=site_code__to dbname="SITE_CODE__TO" )
column=(type=datetime updatewhereclause=no name=payroll_date dbname="PAYROLL_DATE" )
column=(type=char(2) updatewhereclause=no name=type dbname="TYPE" initial="PP" values="Arrears AR/Payroll Projection PP/Payroll PY/" )
column=(type=char(6) updatewhereclause=no name=prd_code__arr dbname="PRD_CODE__ARR" )
column=(type=char(5) updatewhereclause=no name=proc_group__from dbname="proc_group__from" )
column=(type=char(5) updatewhereclause=no name=proc_group__to dbname="proc_group__to" )
column=(type=char(1) updatewhereclause=no name=consider_attd dbname="consider_attd" initial="N" values="Yes Y/No N/" )
column=(type=char(1) updatewhereclause=no name=dataowrite dbname="dataowrite" values="Yes Y/No N/" )
column=(type=char(31) updatewhereclause=no name=emp_name__fr dbname="emp_name__fr" )
column=(type=char(31) updatewhereclause=no name=emp_name__to dbname="emp_name__to" )
column=(type=char(10) updatewhereclause=no name=fr_prd_descr dbname="fr_prd_descr" )
column=(type=char(10) updatewhereclause=no name=to_prd_descr dbname="to_prd_descr" )
column=(type=char(60) updatewhereclause=no name=fr_site_descr dbname="fr_site_descr" )
column=(type=char(60) updatewhereclause=no name=to_site_descr dbname="to_site_descr" )
column=(type=char(120) updatewhereclause=no name=proc_group__fr_name dbname="proc_group__fr_name" )
column=(type=char(120) updatewhereclause=no name=proc_group__to_name dbname="proc_group__to_name" )
column=(type=char(1) updatewhereclause=no name=cbx_ip dbname="cbx_ip" initial="Y" values="Interest Y/Interest N" )
column=(type=char(1) updatewhereclause=no name=cbx_pp dbname="cbx_pp" initial="Y" values="Projection Y/Projection N" )
column=(type=char(1) updatewhereclause=no name=cbx_py dbname="cbx_py" initial="Y" values="Payroll Y/Payroll N" )
column=(type=char(1) updatewhereclause=no name=cbx_ap dbname="cbx_ap" initial="N" values="Arrears (All) Y/Arrears (All) N" )
column=(type=char(1) updatewhereclause=no name=cbx_ap_changes dbname="cbx_ap_changes" initial="Y" values="Arrears (Changes) 0/Arrears (Changes) 0" )
)
groupbox(band=detail text=""border="5" color="33554432" x="0" y="5" height="231" width="611" name=gb_1 visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="67108864" )
groupbox(band=detail text=""border="5" color="33554432" x="3" y="240" height="55" width="609" name=gb_2 visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="67108864" )
line(band=detail x1="45" y1="39" x2="530" y2="39" name=l_1 visible="1" slideleft=yes pen.style="0" pen.width="1" pen.color="8388608" background.mode="2" background.color="12632256" )
column(band=detail id=16 alignment="0" tabsequence=32766 border="5" color="255" x="209" y="76" height="18" width="139" format="[general]" html.valueishtml="0" name=fr_prd_descr visible="1" edit.limit=0 edit.case=any edit.autoselect=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="67108864" )
column(band=detail id=14 alignment="0" tabsequence=32766 border="5" color="255" x="209" y="46" height="18" width="139" format="[general]" html.valueishtml="0" name=emp_name__fr visible="1" edit.limit=0 edit.case=any edit.autoselect=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="67108864" )
column(band=detail id=18 alignment="0" tabsequence=32766 border="5" color="255" x="209" y="107" height="18" width="139" format="[general]" html.valueishtml="0" name=fr_site_descr visible="1" edit.limit=0 edit.case=any edit.autoselect=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="67108864" )
column(band=detail id=20 alignment="0" tabsequence=32766 border="5" color="255" x="209" y="136" height="18" width="139" format="[general]" html.valueishtml="0" name=proc_group__fr_name visible="1" edit.limit=0 edit.case=any edit.autoselect=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="67108864" )
column(band=detail id=15 alignment="0" tabsequence=32766 border="5" color="255" x="440" y="46" height="18" width="136" format="[general]" html.valueishtml="0" name=emp_name__to visible="1" edit.limit=0 edit.case=any edit.autoselect=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="67108864" )
column(band=detail id=17 alignment="0" tabsequence=32766 border="5" color="255" x="440" y="75" height="18" width="136" format="[general]" html.valueishtml="0" name=to_prd_descr visible="1" edit.limit=0 edit.case=any edit.autoselect=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="67108864" )
column(band=detail id=19 alignment="0" tabsequence=32766 border="5" color="255" x="440" y="107" height="18" width="136" format="[general]" html.valueishtml="0" name=to_site_descr visible="1" edit.limit=0 edit.case=any edit.autoselect=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="67108864" )
column(band=detail id=21 alignment="0" tabsequence=32766 border="5" color="255" x="440" y="135" height="18" width="136" format="[general]" html.valueishtml="0" name=proc_group__to_name visible="1" edit.limit=0 edit.case=any edit.autoselect=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="67108864" )
column(band=detail id=7 alignment="0" tabsequence=10 border="5" color="0" x="152" y="14" height="16" width="57" format="[shortdate] [time]" html.valueishtml="0" name=payroll_date visible="1" edit.name="datetime" editmask.mask="dd/mm/yy" editmask.imemode=0 editmask.focusrectangle=no font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=1 alignment="0" tabsequence=30 border="5" color="0" x="151" y="46" height="18" width="55" format="[general]" html.valueishtml="0" name=emp_code__fr visible="1" edit.limit=10 edit.case=upper edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=3 alignment="0" tabsequence=50 border="5" color="0" x="151" y="75" height="18" width="55" format="[general]" html.valueishtml="0" name=prd_code__fr visible="1" edit.limit=6 edit.case=upper edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=5 alignment="0" tabsequence=70 border="5" color="0" x="151" y="106" height="18" width="55" format="[general]" html.valueishtml="0" name=site_code__fr visible="1" edit.limit=5 edit.case=upper edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=10 alignment="0" tabsequence=90 border="5" color="0" x="151" y="136" height="18" width="55" format="[general]" html.valueishtml="0" name=proc_group__from visible="1" edit.limit=5 edit.case=upper edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=8 alignment="0" tabsequence=20 border="5" color="0" x="382" y="14" height="16" width="124" format="[general]" html.valueishtml="0" name=type visible="1" ddlb.limit=0 ddlb.allowedit=no ddlb.case=any ddlb.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=2 alignment="0" tabsequence=40 border="5" color="0" x="380" y="46" height="18" width="55" format="[general]" html.valueishtml="0" name=emp_code__to visible="1" edit.limit=10 edit.case=upper edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=4 alignment="0" tabsequence=60 border="5" color="0" x="380" y="75" height="18" width="55" format="[general]" html.valueishtml="0" name=prd_code__to visible="1" edit.limit=6 edit.case=upper edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=6 alignment="0" tabsequence=80 border="5" color="0" x="380" y="106" height="18" width="55" format="[general]" html.valueishtml="0" name=site_code__to visible="1" edit.limit=5 edit.case=upper edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=11 alignment="0" tabsequence=100 border="5" color="0" x="380" y="136" height="18" width="55" format="[general]" html.valueishtml="0" name=proc_group__to visible="1" edit.limit=5 edit.case=upper edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=9 alignment="0" tabsequence=110 border="5" color="0" x="440" y="164" height="17" width="75" format="[general]" html.valueishtml="0" protect="0~tif(type = 'AR', 0, 1)" name=prd_code__arr visible="1" edit.limit=6 edit.case=upper edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=12 alignment="0" tabsequence=120 border="5" color="0" x="440" y="188" height="15" width="75" format="[general]" html.valueishtml="0" name=consider_attd visible="1" ddlb.limit=1 ddlb.allowedit=no ddlb.case=upper ddlb.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=13 alignment="0" tabsequence=130 border="5" color="0" x="440" y="211" height="16" width="75" format="[general]" html.valueishtml="0" name=dataowrite visible="1" ddlb.limit=0 ddlb.allowedit=no ddlb.case=any ddlb.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
text(band=detail alignment="1" text="Processing Date :" border="5" color="0" x="50" y="14" height="16" width="98" html.valueishtml="0" name=payroll_date_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
text(band=detail alignment="1" text="From :" border="5" color="0" x="110" y="46" height="18" width="36" html.valueishtml="0" name=emp_code__fr_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
text(band=detail alignment="1" text="Employee >> " border="5" color="16711680" x="13" y="46" height="18" width="96" html.valueishtml="0" name=emp_code_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
text(band=detail alignment="1" text="Period >>" border="5" color="16711680" x="35" y="75" height="18" width="73" html.valueishtml="0" name=prd_code_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
text(band=detail alignment="1" text="From :" border="5" color="0" x="111" y="76" height="18" width="36" html.valueishtml="0" name=prd_code__fr_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
text(band=detail alignment="1" text="Site >>" border="5" color="16711680" x="51" y="106" height="18" width="57" html.valueishtml="0" name=site_code_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
text(band=detail alignment="1" text="From :" border="5" color="0" x="113" y="108" height="18" width="36" html.valueishtml="0" name=site_code__fr_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
text(band=detail alignment="1" text="Proc. Group >>" border="5" color="16711680" x="12" y="136" height="18" width="96" html.valueishtml="0" name=proc_group_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
text(band=detail alignment="1" text="From :" border="5" color="0" x="111" y="136" height="18" width="36" html.valueishtml="0" name=proc_group__from_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
text(band=detail alignment="1" text="Type :" border="5" color="0" x="341" y="14" height="16" width="36" html.valueishtml="0" name=type_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
text(band=detail alignment="1" text="to :" border="5" color="0" x="355" y="46" height="18" width="21" html.valueishtml="0" name=emp_code__to_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
text(band=detail alignment="1" text="to :" border="5" color="0" x="355" y="75" height="18" width="21" html.valueishtml="0" name=prd_code__to_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
text(band=detail alignment="1" text="to :" border="5" color="0" x="354" y="105" height="18" width="21" html.valueishtml="0" name=site_code__to_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
text(band=detail alignment="1" text="to :" border="5" color="0" x="355" y="136" height="18" width="21" html.valueishtml="0" name=proc_group__to_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
text(band=detail alignment="1" text="Arrears to be considered in the period >>" border="5" color="16711680" x="103" y="164" height="16" width="333" html.valueishtml="0" name=prd_code__arr_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
text(band=detail alignment="1" text="Consider attendance for projection >>" border="5" color="16711680" x="100" y="188" height="16" width="335" html.valueishtml="0" name=consider_attd_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
text(band=detail alignment="1" text="Overwrite Data >>" border="5" color="16711680" x="101" y="212" height="16" width="335" html.valueishtml="0" name=dataowrite_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
column(band=detail id=26 alignment="0" tabsequence=160 border="5" color="0" x="442" y="245" height="16" width="130" format="[general]" html.valueishtml="0" name=cbx_ap_changes visible="1" checkbox.text="Arrears (Changes)" checkbox.on="0" checkbox.off="0" checkbox.scale=no checkbox.threed=yes font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="1" background.color="553648127" )
column(band=detail id=24 alignment="0" tabsequence=140 border="5" color="0" x="237" y="247" height="16" width="68" format="[general]" html.valueishtml="0" name=cbx_py visible="1" checkbox.text="Payroll" checkbox.on="Y" checkbox.off="N" checkbox.scale=no checkbox.threed=yes font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="1" background.color="553648127" )
column(band=detail id=25 alignment="0" tabsequence=150 border="5" color="0" x="237" y="270" height="16" width="96" format="[general]" html.valueishtml="0" name=cbx_ap visible="1" checkbox.text="Arrears (All)" checkbox.on="Y" checkbox.off="N" checkbox.scale=no checkbox.threed=yes font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="1" background.color="553648127" )
column(band=detail id=23 alignment="0" tabsequence=32766 border="5" color="0" x="21" y="270" height="16" width="78" format="[general]" html.valueishtml="0" name=cbx_pp visible="1" checkbox.text="Projection" checkbox.on="Y" checkbox.off="N" checkbox.scale=no checkbox.threed=yes font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="1" background.color="553648127" )
column(band=detail id=22 alignment="3" tabsequence=32766 border="5" color="0" x="21" y="247" height="16" width="77" format="[general]" html.valueishtml="0" name=cbx_ip visible="1" checkbox.text="Interest" checkbox.on="Y" checkbox.off="N" checkbox.scale=no checkbox.threed=yes font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="1" background.color="553648127" )
htmltable(border="1" )
htmlgen(clientevents="1" clientvalidation="1" clientcomputedfields="1" clientformatting="0" clientscriptable="0" generatejavascript="1" encodeselflinkargs="1" netscapelayers="0" )
export.xml(headgroups="1" includewhitespace="0" metadatatype=0 savemetadata=0 )
import.xml()
export.pdf(method=0 distill.custompostscript="0" xslfop.print="0" )
\ No newline at end of file
/*
AllowDednSalComp.java
HashMap adCompsInfo = new HashMap();
HashMap payCompInfo = new HashMap();
*/
package ibase.webitm.ejb.adm;
import java.lang.reflect.Array;
import java.sql.*;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.sys.UtilMethods;
import ibase.webitm.utility.ITMException;
public class AllowDednSalComp
{
AdmCommon admCommon = new AdmCommon();
UtilMethods utilMethods = new UtilMethods();
private String replaceIF(String input) throws ITMException
{
try
{
int index= input.indexOf("(");
String substr = input.substring(0, index+1);
System.out.println(substr);
if(!substr.contains("SELECT"))
substr = substr.replace(" ", "");
String substr1 = input.substring(index+1);
input = substr + substr1;
if(input.indexOf("IF(")>=0)
input = input.replace("IF(", "iif(");
if(input.indexOf("ISNULL(")>=0)
input = input.replace("ISNULL(", "isnull(");
if(input.indexOf("ISNULL (")>=0)
input = input.replace("ISNULL (", "isnull(");
System.out.println(input);
}
catch(Exception e)
{
throw new ITMException(e);
}
return input;
}
//Modified by Rohini T on [09/08/19][Start]
public LinkedHashMap getAdCompInfo(String processType, Connection conn) throws ITMException
{
LinkedHashMap adCompsInfo = new LinkedHashMap();
System.out.println("Inside getAdCompInfo(String processType, Connection conn) method::::s");
try
{
adCompsInfo = getAdCompInfo(processType, "ZZZ", conn);
}
catch (Exception e)
{
System.out.println(":::" + getClass().getSimpleName() + "::"+ e.getMessage());
e.printStackTrace();
throw new ITMException(e);
}
return adCompsInfo;
}
//Modified by Rohini T on [09/08/19][End]
public LinkedHashMap getAdCompInfo(String processType, String seqNo, Connection conn) throws ITMException
{
String sdCodesSql = "";
//HashMap adCompsInfo = new HashMap();
LinkedHashMap adCompsInfo = new LinkedHashMap<>();
LinkedHashMap adCompMap = new LinkedHashMap();
PreparedStatement pstAdCodes = null;
ResultSet rstAdCodes = null;
System.out.println("Inside getAdCompInfo(String processType, String seqNo, Connection conn) ::::s");
try
{
double rndTo = 0d;
System.out.println("seqNo::::"+seqNo);//need to chnage below sql
sdCodesSql = "SELECT AD_CODE,SH_DESCR,DESCR,TYPE,SEQ_NO,RND_OFF,RND_TO,PROP_YN,PROP_ON,PAYABLE,POST_YN,SLAB_OPTION,BASE_FORMULA,SLAB_FORMULA,RES_FORMULA,BAL_OPT,FOR_CONDN,SQL_EXPR,SQL_INPUT,MIN_VAL,MAX_VAL,IT_PROJ,IT_SECTION,PRT_SEQ,DROP_YN,COST_COMPANY,SPLIT_YN,ACCT_CODE__SAL,CCTR_CODE__SAL,CHG_DATE,CHG_USER,CHG_TERM,PAY_TAX,TAUTH_CODE,DIRECT_VOUCHER,DELETE_ARR,BAL_FROM,BAL_TO,DROP_OPT,DROP_SEQ,FREQUENCY,IT_PROOF_REQ,PRINT_OPT,GEN_NEGT_ARR,UDF_TYPE,APPLICABLE_IN_FFS,INPUT_TYPE,APPLICABLE_TO FROM ALLWDEDN WHERE NVL(SEQ_NO , ' ') < ?"
//+" AND ad_code in('DW008','DW002','DW009','CW005','DW009_S','D0005','DW005','DW006','DW001','DW010''DW015','CW001')"
+ " ORDER BY CASE WHEN SEQ_NO IS NULL THEN ' ' ELSE SEQ_NO END, AD_CODE";
//sdCodesSql = "SELECT AD_CODE,SH_DESCR,DESCR,TYPE,SEQ_NO,RND_OFF,RND_TO,PROP_YN,PROP_ON,PAYABLE,POST_YN,SLAB_OPTION,BASE_FORMULA,SLAB_FORMULA,RES_FORMULA,BAL_OPT,FOR_CONDN,SQL_EXPR,SQL_INPUT,MIN_VAL,MAX_VAL,IT_PROJ,IT_SECTION,PRT_SEQ,DROP_YN,COST_COMPANY,SPLIT_YN,ACCT_CODE__SAL,CCTR_CODE__SAL,CHG_DATE,CHG_USER,CHG_TERM,PAY_TAX,TAUTH_CODE,DIRECT_VOUCHER,DELETE_ARR,BAL_FROM,BAL_TO,DROP_OPT,DROP_SEQ,FREQUENCY,IT_PROOF_REQ,PRINT_OPT,GEN_NEGT_ARR,UDF_TYPE,APPLICABLE_IN_FFS,INPUT_TYPE,APPLICABLE_TO FROM ALLWDEDN WHERE NVL(SEQ_NO , ' ') < ? and rownum <100 ORDER BY CASE WHEN SEQ_NO IS NULL THEN ' ' ELSE SEQ_NO END, AD_CODE";
pstAdCodes = conn.prepareStatement(sdCodesSql);
pstAdCodes.setString(1, seqNo);
rstAdCodes = pstAdCodes.executeQuery();
while (rstAdCodes.next())
{
String strAdCode = rstAdCodes.getString("AD_CODE").trim();
String strShDescr = rstAdCodes.getString("SH_DESCR");
String strDescr = rstAdCodes.getString("DESCR");
String strType = rstAdCodes.getString("TYPE");
String strSeqNo = rstAdCodes.getString("SEQ_NO");
String strRndOff = rstAdCodes.getString("RND_OFF");
String strPropYn = rstAdCodes.getString("PROP_YN");
String strPropOn = rstAdCodes.getString("PROP_ON");
String strPayable = rstAdCodes.getString("PAYABLE");
String strPostYn = rstAdCodes.getString("POST_YN");
String strSlabOption = rstAdCodes.getString("SLAB_OPTION");
String strBaseFormula = rstAdCodes.getString("BASE_FORMULA");
//Added By Varsha V on 19-07-19 to replace IF with IIF
System.out.println("strBaseFormula::::inside getAdCompInfo before"+strBaseFormula);
if(strBaseFormula != null && strBaseFormula.trim().length() > 0)
{
strBaseFormula = replaceIF(strBaseFormula.trim().toUpperCase());
System.out.println("strBaseFormula::::inside getAdCompInfo after"+strBaseFormula);
}
//Ended By Varsha V on 19-07-19 to replace IF with IIF
String strSlabFormula = rstAdCodes.getString("SLAB_FORMULA");
System.out.println("strSlabFormula::::inside getAdCompInfo before"+strSlabFormula);
//Added By Varsha V on 19-07-19 to replace IF with IIF
if(strSlabFormula != null && strSlabFormula.trim().length() > 0)
{
strSlabFormula = replaceIF(strSlabFormula.trim().toUpperCase());
System.out.println("strSlabFormula::::inside getAdCompInfo after"+strSlabFormula);
}
//Ended By Varsha V on 19-07-19 to replace IF with IIF
String strResFormula = rstAdCodes.getString("RES_FORMULA");
System.out.println("strResFormula::::inside getAdCompInfo before"+strResFormula);
//Added By Varsha V on 19-07-19 to replace IF with IIF
if(strResFormula != null && strResFormula.trim().length() > 0)
{
strResFormula = replaceIF(strResFormula.trim().toUpperCase());
System.out.println("strResFormula::::inside getAdCompInfo after"+strResFormula);
}
//Ended By Varsha V on 19-07-19 to replace IF with IIF
String strBalOpt = rstAdCodes.getString("BAL_OPT");
String strForCondn = rstAdCodes.getString("FOR_CONDN");
String strSqlExpr = rstAdCodes.getString("SQL_EXPR");
String strSqlInput = rstAdCodes.getString("SQL_INPUT");
String strMinVal = rstAdCodes.getString("MIN_VAL");
String strMaxVal = rstAdCodes.getString("MAX_VAL");
String strItProj = rstAdCodes.getString("IT_PROJ");
String strItSection = rstAdCodes.getString("IT_SECTION");
String strPrtSeq = rstAdCodes.getString("PRT_SEQ");
String strDropYn = rstAdCodes.getString("DROP_YN");
String strCostCompany = rstAdCodes.getString("COST_COMPANY");
String strSplitYn = rstAdCodes.getString("SPLIT_YN");
String strAcctCodeSal = rstAdCodes.getString("ACCT_CODE__SAL");
String strCctrCodeSal = rstAdCodes.getString("CCTR_CODE__SAL");
String strPayTax = rstAdCodes.getString("PAY_TAX");
String strTauthCode = rstAdCodes.getString("TAUTH_CODE");
String strDirectVoucher = rstAdCodes.getString("DIRECT_VOUCHER");
String strDeleteArr = rstAdCodes.getString("DELETE_ARR");
String strDropOpt = rstAdCodes.getString("DROP_OPT");
String strDropSeq = rstAdCodes.getString("DROP_SEQ");
String strFrequency = rstAdCodes.getString("FREQUENCY");
String strItProofReq = rstAdCodes.getString("IT_PROOF_REQ");
String strPrintOpt = rstAdCodes.getString("PRINT_OPT");
String strGenNegtArr = rstAdCodes.getString("GEN_NEGT_ARR");
String strUdfType = rstAdCodes.getString("UDF_TYPE");
String strApplicableInFfs = rstAdCodes.getString("APPLICABLE_IN_FFS");
String strInputType = rstAdCodes.getString("INPUT_TYPE");
String strApplicableTo = rstAdCodes.getString("APPLICABLE_TO");
rndTo = rstAdCodes.getDouble("RND_TO");
adCompMap = new LinkedHashMap();
adCompMap.put("AD_CODE" , checkNull(strAdCode));
adCompMap.put(strAdCode + "_B" , 0d);
adCompMap.put(strAdCode + "_S" , 0d);
adCompMap.put(strAdCode , 0d);
adCompMap.put("SH_DESCR" , checkNull(strShDescr));
adCompMap.put("DESCR" , checkNull(strDescr));
adCompMap.put("TYPE" , checkNull(strType));
adCompMap.put("SEQ_NO" , checkNull(strSeqNo));
adCompMap.put("RND_OFF" , checkNull(strRndOff));
adCompMap.put("PROP_YN" , checkNull(strPropYn));
adCompMap.put("PROP_ON" , checkNull(strPropOn));
adCompMap.put("PAYABLE" , checkNull(strPayable));
adCompMap.put("POST_YN" , checkNull(strPostYn));
adCompMap.put("SLAB_OPTION" , checkNull(strSlabOption));
adCompMap.put("BASE_FORMULA" , checkNull(strBaseFormula).trim().toUpperCase());
adCompMap.put("SLAB_FORMULA" , checkNull(strSlabFormula).trim().toUpperCase());
adCompMap.put("RES_FORMULA" , checkNull(strResFormula).trim().toUpperCase());
adCompMap.put("BAL_OPT" , checkNull(strBalOpt));
adCompMap.put("FOR_CONDN" , checkNull(strForCondn));
adCompMap.put("SQL_EXPR" , checkNull(strSqlExpr));
adCompMap.put("SQL_INPUT" , checkNull(strSqlInput).trim().toUpperCase());
adCompMap.put("MIN_VAL" , checkNull(strMinVal));
adCompMap.put("MAX_VAL" , checkNull(strMaxVal));
adCompMap.put("IT_PROJ" , checkNull(strItProj));
adCompMap.put("IT_SECTION" , checkNull(strItSection));
adCompMap.put("PRT_SEQ" , checkNull(strPrtSeq));
adCompMap.put("DROP_YN" , checkNull(strDropYn));
adCompMap.put("COST_COMPANY" , checkNull(strCostCompany));
adCompMap.put("SPLIT_YN" , checkNull(strSplitYn));
adCompMap.put("ACCT_CODE__SAL" , checkNull(strAcctCodeSal));
adCompMap.put("CCTR_CODE__SAL" , checkNull(strCctrCodeSal));
adCompMap.put("PAY_TAX" , checkNull(strPayTax));
adCompMap.put("TAUTH_CODE" , checkNull(strTauthCode));
adCompMap.put("DIRECT_VOUCHER" , checkNull(strDirectVoucher));
adCompMap.put("DELETE_ARR" , checkNull(strDeleteArr));
adCompMap.put("DROP_OPT" , checkNull(strDropOpt));
adCompMap.put("DROP_SEQ" , checkNull(strDropSeq));
adCompMap.put("FREQUENCY" , checkNull(strFrequency));
adCompMap.put("IT_PROOF_REQ" , checkNull(strItProofReq));
adCompMap.put("PRINT_OPT" , checkNull(strPrintOpt));
adCompMap.put("GEN_NEGT_ARR" , checkNull(strGenNegtArr));
adCompMap.put("UDF_TYPE" , checkNull(strUdfType));
adCompMap.put("APPLICABLE_IN_FFS" , checkNull(strApplicableInFfs));
adCompMap.put("INPUT_TYPE" , checkNull(strInputType));
adCompMap.put("APPLICABLE_TO" , checkNull(strApplicableTo));
adCompMap.put("RND_TO" , new Double(rndTo));
adCompsInfo.put(strAdCode , adCompMap);
}
//System.out.println("adCompsInfo:::::"+adCompsInfo);
if (rstAdCodes != null)
{
rstAdCodes.close();
rstAdCodes = null;
}
if (pstAdCodes != null)
{
pstAdCodes.close();
pstAdCodes = null;
}
}
catch(Exception e)
{
System.out.println(":::" + getClass().getSimpleName() + "::"+ e.getMessage());
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if (rstAdCodes != null)
{
rstAdCodes.close();
rstAdCodes = null;
}
if (pstAdCodes != null)
{
pstAdCodes.close();
pstAdCodes = null;
}
}
catch(Exception e1)
{
System.out.println(":::" + getClass().getSimpleName() + "::"+ e1.getMessage());
e1.printStackTrace();
}
}
return adCompsInfo;
}
public LinkedHashMap getPayCompInfo(String processType, String argPayTable, String payInfoLevel, String argEmpCode, String argCadreCode, String argGradeCode, String argMthCode, String argPrdCode, String argAcctPrd, String isSplit, java.sql.Timestamp argFromDate, java.sql.Timestamp argToDate, LinkedHashMap payCompMapAll, LinkedHashMap adCompsInfo, String xtraParams, Connection conn) throws ITMException
{
LinkedHashMap payAdMap = new LinkedHashMap();
LinkedHashMap payAdMapOrg = new LinkedHashMap(); // Modified by Piyush on 07/09/2019[To allow multiple rows from payb structures]
LinkedHashMap retPayCompMap = new LinkedHashMap();
String sdCodesSql = "";
LinkedHashMap adCompMap = new LinkedHashMap();
PreparedStatement pstAdCodes = null;
ResultSet rstAdCodes = null;
LinkedHashMap payCompMap = null;
// Modified by Piyush on 07/09/2019[To allow multiple rows from payb structures].Start
LinkedHashMap payCompMapOrg = null;
// Modified by Piyush on 07/09/2019[To allow multiple rows from payb structures].End
try
{
double rndTo = 0d;
double payAmount = 0d;
double minBasic = 0d;
double maxBasic = 0d;
double minAmount = 0d;
double maxAmount = 0d;
java.sql.Timestamp effDate = null;
java.sql.Timestamp expDate = null;
payCompMap = (LinkedHashMap) payCompMapAll.get("PAYMAP");
if(payCompMap == null)
{
payCompMap = new LinkedHashMap();
}
// Modified by Piyush on 07/09/2019[To allow multiple rows from payb structures].Start
payCompMapOrg = (LinkedHashMap) payCompMapAll.get("PAYMAP");
if(payCompMapOrg == null)
{
payCompMapOrg = new LinkedHashMap();
}
// Modified by Piyush on 07/09/2019[To allow multiple rows from payb structures].End
if("CA".equalsIgnoreCase(payInfoLevel))
{
sdCodesSql = "SELECT AD_CODE, TYPE, AMOUNT, MIN_BASIC, MAX_BASIC, MIN_AMT, MAX_AMT, PROP_YN, "
+ "EFF_DATE, EXP_DATE FROM CADRE_AD WHERE PAY_TABLE = ? AND CADRE_CODE = ? AND "
+ "((EFF_DATE <= ? AND EXP_DATE >= ?) OR (EFF_DATE <= ? AND EXP_DATE >= ?) OR "
+ "(EFF_DATE >= ? AND EFF_DATE <= ? AND EXP_DATE >= EFF_DATE) OR (EXP_DATE >= ? "
+ "AND EXP_DATE <= ? AND EFF_DATE <= EXP_DATE) )";
pstAdCodes = conn.prepareStatement(sdCodesSql);
pstAdCodes.setString(1 , argPayTable);
pstAdCodes.setString(2 , argCadreCode);
pstAdCodes.setTimestamp(3 , argFromDate);
pstAdCodes.setTimestamp(4 , argFromDate);
pstAdCodes.setTimestamp(5 , argToDate);
pstAdCodes.setTimestamp(6 , argToDate);
pstAdCodes.setTimestamp(7 , argFromDate);
pstAdCodes.setTimestamp(8 , argToDate);
pstAdCodes.setTimestamp(9 , argFromDate);
pstAdCodes.setTimestamp(10 , argToDate);
}
else if("GA".equalsIgnoreCase(payInfoLevel))
{
sdCodesSql = "SELECT AD_CODE, TYPE, AMOUNT, MIN_BASIC, MAX_BASIC, MIN_AMT, MAX_AMT, PROP_YN, "
+ "EFF_DATE, EXP_DATE FROM GRADE_AD WHERE PAY_TABLE = ? AND GRADE_CODE = ? AND "
+ "((EFF_DATE <= ? AND EXP_DATE >= ?) OR (EFF_DATE <= ? AND EXP_DATE >= ?) OR "
+ "(EFF_DATE >= ? AND EFF_DATE <= ? AND EXP_DATE >= EFF_DATE) OR (EXP_DATE >= ? "
+ "AND EXP_DATE <= ? AND EFF_DATE <= EXP_DATE) )";
pstAdCodes = conn.prepareStatement(sdCodesSql);
pstAdCodes.setString(1 , argPayTable);
pstAdCodes.setString(2 , argGradeCode);
pstAdCodes.setTimestamp(3 , argFromDate);
pstAdCodes.setTimestamp(4 , argFromDate);
pstAdCodes.setTimestamp(5 , argToDate);
pstAdCodes.setTimestamp(6 , argToDate);
pstAdCodes.setTimestamp(7 , argFromDate);
pstAdCodes.setTimestamp(8 , argToDate);
pstAdCodes.setTimestamp(9 , argFromDate);
pstAdCodes.setTimestamp(10 , argToDate);
}
else if("EA".equalsIgnoreCase(payInfoLevel))
{
//sdCodesSql = "SELECT AD_CODE, TYPE, AMOUNT, MIN_BASIC, MAX_BASIC, MIN_AMT, MAX_AMT, PROP_YN, EFF_DATE, EXP_DATE, CONFIRMED, REF_TYPE, REF_NO FROM EMPLOYEE_AD WHERE PAY_TABLE = ? AND EMP_CODE = ? AND ((EFF_DATE <= ? AND EXP_DATE >= ?) OR (EFF_DATE <= ? AND EXP_DATE >= ?) OR (EFF_DATE >= ? AND EFF_DATE <= ? AND EXP_DATE >= EFF_DATE) OR (EXP_DATE >= ? AND EXP_DATE <= ? AND EFF_DATE <= EXP_DATE) ) and (REF_TYPE <> 'O' OR (REF_TYPE = 'O' AND CONFIRMED = 'Y'))";
sdCodesSql = "SELECT AD_CODE, TYPE, AMOUNT, MIN_BASIC, MAX_BASIC, MIN_AMT, MAX_AMT, PROP_YN, "
+ "EFF_DATE, EXP_DATE, REF_TYPE, REF_NO FROM EMPLOYEE_AD WHERE EMP_CODE = ? "
+ "AND ((EFF_DATE <= ? AND EXP_DATE >= ?) OR (EFF_DATE <= ? AND EXP_DATE >= ?) OR "
+ "(EFF_DATE >= ? AND EFF_DATE <= ? AND EXP_DATE >= EFF_DATE) OR (EXP_DATE >= ? "
+ "AND EXP_DATE <= ? AND EFF_DATE <= EXP_DATE) ) and (REF_TYPE <> 'O' OR "
+ "(REF_TYPE = 'O' AND CONFIRMED = 'Y'))";
pstAdCodes = conn.prepareStatement(sdCodesSql);
//pstAdCodes.setString(1 , argPayTable);
pstAdCodes.setString(1 , argEmpCode);
pstAdCodes.setTimestamp(2 , argFromDate);
pstAdCodes.setTimestamp(3 , argFromDate);
pstAdCodes.setTimestamp(4 , argToDate);
pstAdCodes.setTimestamp(5 , argToDate);
pstAdCodes.setTimestamp(6 , argFromDate);
pstAdCodes.setTimestamp(7 , argToDate);
pstAdCodes.setTimestamp(8 , argFromDate);
pstAdCodes.setTimestamp(9 , argToDate);
}
if("CMA".equalsIgnoreCase(payInfoLevel))
{
sdCodesSql = "SELECT AD_CODE, TYPE, AMOUNT, MIN_BASIC, MAX_BASIC, MIN_AMT, MAX_AMT, PROP_YN, "
+ "EFF_DATE, EXP_DATE FROM CADRE_MTHAD WHERE PAY_TABLE = ? AND CADRE_CODE = ? AND "
+ "((EFF_DATE <= ? AND EXP_DATE >= ?) OR (EFF_DATE <= ? AND EXP_DATE >= ?) OR "
+ "(EFF_DATE >= ? AND EFF_DATE <= ? AND EXP_DATE >= EFF_DATE) OR (EXP_DATE >= ? "
+ "AND EXP_DATE <= ? AND EFF_DATE <= EXP_DATE) AND MONTH_CODE = ? )";
pstAdCodes = conn.prepareStatement(sdCodesSql);
pstAdCodes.setString(1 , argPayTable);
pstAdCodes.setString(2 , argCadreCode);
pstAdCodes.setTimestamp(3 , argFromDate);
pstAdCodes.setTimestamp(4 , argFromDate);
pstAdCodes.setTimestamp(5 , argToDate);
pstAdCodes.setTimestamp(6 , argToDate);
pstAdCodes.setTimestamp(7 , argFromDate);
pstAdCodes.setTimestamp(8 , argToDate);
pstAdCodes.setTimestamp(9 , argFromDate);
pstAdCodes.setTimestamp(10 , argToDate);
pstAdCodes.setString(11 , argMthCode);
}
else if("GMA".equalsIgnoreCase(payInfoLevel))
{
sdCodesSql = "SELECT AD_CODE, TYPE, AMOUNT, MIN_BASIC, MAX_BASIC, MIN_AMT, MAX_AMT, PROP_YN, "
+ "EFF_DATE, EXP_DATE FROM GRADE_MTHAD WHERE PAY_TABLE = ? AND GRADE_CODE = ? AND "
+ "((EFF_DATE <= ? AND EXP_DATE >= ?) OR (EFF_DATE <= ? AND EXP_DATE >= ?) OR "
+ "(EFF_DATE >= ? AND EFF_DATE <= ? AND EXP_DATE >= EFF_DATE) OR (EXP_DATE >= ? "
+ "AND EXP_DATE <= ? AND EFF_DATE <= EXP_DATE) AND MONTH_CODE = ? )";
pstAdCodes = conn.prepareStatement(sdCodesSql);
pstAdCodes.setString(1 , argPayTable);
pstAdCodes.setString(2 , argGradeCode);
pstAdCodes.setTimestamp(3 , argFromDate);
pstAdCodes.setTimestamp(4 , argFromDate);
pstAdCodes.setTimestamp(5 , argToDate);
pstAdCodes.setTimestamp(6 , argToDate);
pstAdCodes.setTimestamp(7 , argFromDate);
pstAdCodes.setTimestamp(8 , argToDate);
pstAdCodes.setTimestamp(9 , argFromDate);
pstAdCodes.setTimestamp(10 , argToDate);
pstAdCodes.setString(11 , argMthCode);
}
else if("EMA".equalsIgnoreCase(payInfoLevel))
{
//sdCodesSql = "SELECT AD_CODE, TYPE, AMOUNT, MIN_BASIC, MAX_BASIC, MIN_AMT, MAX_AMT, PROP_YN, EFF_DATE, EXP_DATE, CONFIRMED, REF_TYPE, REF_NO FROM EMPLOYEE_MTHAD WHERE PAY_TABLE = ? AND EMP_CODE = ? AND ((EFF_DATE <= ? AND EXP_DATE >= ?) OR (EFF_DATE <= ? AND EXP_DATE >= ?) OR (EFF_DATE >= ? AND EFF_DATE <= ? AND EXP_DATE >= EFF_DATE) OR (EXP_DATE >= ? AND EXP_DATE <= ? AND EFF_DATE <= EXP_DATE) ) and (REF_TYPE <> 'O' OR (REF_TYPE = 'O' AND CONFIRMED = 'Y'))";
sdCodesSql = "SELECT AD_CODE, TYPE, AMOUNT, MIN_BASIC, MAX_BASIC, MIN_AMT, MAX_AMT, PROP_YN, "
+ "EFF_DATE, EXP_DATE, REF_TYPE, REF_NO FROM EMPLOYEE_MTHAD WHERE "
+ "EMP_CODE = ? AND ((EFF_DATE <= ? AND EXP_DATE >= ?) OR (EFF_DATE <= ? AND "
+ "EXP_DATE >= ?) OR (EFF_DATE >= ? AND EFF_DATE <= ? AND EXP_DATE >= EFF_DATE) "
+ "OR (EXP_DATE >= ? AND EXP_DATE <= ? AND EFF_DATE <= EXP_DATE) ) and "
+ "(REF_TYPE <> 'O' OR (REF_TYPE = 'O' AND "
//+ "CONFIRMED = 'Y'))";
+ "MONTH_CODE = ?))";
pstAdCodes = conn.prepareStatement(sdCodesSql);
//pstAdCodes.setString(1 , argPayTable);
pstAdCodes.setString(1 , argEmpCode);
pstAdCodes.setTimestamp(2 , argFromDate);
pstAdCodes.setTimestamp(3 , argFromDate);
pstAdCodes.setTimestamp(4 , argToDate);
pstAdCodes.setTimestamp(5 , argToDate);
pstAdCodes.setTimestamp(6 , argFromDate);
pstAdCodes.setTimestamp(7 , argToDate);
pstAdCodes.setTimestamp(8 , argFromDate);
pstAdCodes.setTimestamp(9 , argToDate);
pstAdCodes.setString(10 , argMthCode);
}
rstAdCodes = pstAdCodes.executeQuery();
while (rstAdCodes.next())
{
String strRefType = "";
String strRefNo = "";
String strAdCode = rstAdCodes.getString("AD_CODE").trim();
String strApplType = checkNull(rstAdCodes.getString("TYPE"));
payAmount = rstAdCodes.getDouble("AMOUNT");
minBasic = rstAdCodes.getDouble("MIN_BASIC");
maxBasic = rstAdCodes.getDouble("MAX_BASIC");
minAmount = rstAdCodes.getDouble("MIN_AMT");
maxAmount = rstAdCodes.getDouble("MAX_AMT");
String strApplPropYn = checkNull(rstAdCodes.getString("PROP_YN"));
effDate = rstAdCodes.getTimestamp("EFF_DATE");
expDate = rstAdCodes.getTimestamp("EXP_DATE");
if("EMA".equalsIgnoreCase(payInfoLevel) || "EA".equalsIgnoreCase(payInfoLevel))
{
strRefType = checkNull(rstAdCodes.getString("REF_TYPE"));
strRefNo = checkNull(rstAdCodes.getString("REF_NO"));
}
if (expDate.before(argToDate))
{
isSplit = "Y";
}
adCompMap = (LinkedHashMap) adCompsInfo.get(strAdCode);
String strType = (String) adCompMap.get("TYPE");
String strRndOff = (String) adCompMap.get("RND_OFF");
String strPropYn = (String) adCompMap.get("PROP_YN");
String strPropOn = (String) adCompMap.get("PROP_ON");
rndTo = ((Double) adCompMap.get("RND_TO")).doubleValue();
String strBaseFormula = (String) adCompMap.get("BASE_FORMULA");
String strPayable = (String) adCompMap.get("PAYABLE");
String strPostYn = (String) adCompMap.get("POST_YN");
String strSeqNo = (String) adCompMap.get("SEQ_NO");
String strAcctCodeSal = (String) adCompMap.get("ACCT_CODE__SAL");
String strCctrCodeSal = (String) adCompMap.get("CCTR_CODE__SAL");
String strSlabOption = (String) adCompMap.get("SLAB_OPTION");
String strSlabFormula = (String) adCompMap.get("SLAB_FORMULA");
String strResFormula = (String) adCompMap.get("RES_FORMULA");
String strBalOpt = (String) adCompMap.get("BAL_OPT");
String strForCondn = (String) adCompMap.get("FOR_CONDN");
String strSqlExpr = (String) adCompMap.get("SQL_EXPR");
String strSqlInput = (String) adCompMap.get("SQL_INPUT");
String strMinVal = (String) adCompMap.get("MIN_VAL");
String strMaxVal = (String) adCompMap.get("MAX_VAL");
String strItProj = (String) adCompMap.get("IT_PROJ");
payAdMap = new LinkedHashMap();
payAdMap.put("AD_CODE" , checkNull(strAdCode));
payAdMap.put("TYPE" , checkNull(strType));
payAdMap.put("RND_OFF" , checkNull(strRndOff));
payAdMap.put("PROP_YN" , checkNull(strPropYn));
payAdMap.put("PROP_ON" , checkNull(strPropOn));
payAdMap.put("RND_TO" , new Double(rndTo));
payAdMap.put("BASE_FORMULA" , checkNull(strBaseFormula));
payAdMap.put("PAYABLE" , checkNull(strPayable));
payAdMap.put("POST_YN" , checkNull(strPostYn));
payAdMap.put("SEQ_NO" , checkNull(strSeqNo));
payAdMap.put("ACCT_CODE__SAL" , checkNull(strAcctCodeSal));
payAdMap.put("CCTR_CODE__SAL" , checkNull(strCctrCodeSal));
payAdMap.put("SLAB_OPTION" , checkNull(strSlabOption));
payAdMap.put("SLAB_FORMULA" , checkNull(strSlabFormula));
payAdMap.put("RES_FORMULA" , checkNull(strResFormula));
payAdMap.put("BAL_OPT" , checkNull(strBalOpt));
payAdMap.put("FOR_CONDN" , checkNull(strForCondn));
payAdMap.put("SQL_EXPR" , checkNull(strSqlExpr));
payAdMap.put("SQL_INPUT" , checkNull(strSqlInput));
payAdMap.put("MIN_VAL" , checkNull(strMinVal));
payAdMap.put("MAX_VAL" , checkNull(strMaxVal));
payAdMap.put("TYPE_S" , checkNull(strApplType));
payAdMap.put("AMOUNT" , new Double(payAmount));
payAdMap.put("MIN_BASIC" , new Double(minBasic));
payAdMap.put("MAX_BASIC" , new Double(maxBasic));
payAdMap.put("MIN_AMT" , new Double(minAmount));
payAdMap.put("MAX_AMT" , new Double(maxAmount));
payAdMap.put("PROP_YN_S" , checkNull(strApplType));
payAdMap.put("IT_PROJ" , checkNull(strItProj));
payAdMap.put("REF_TYPE" , checkNull(strRefType));
payAdMap.put("REF_NO" , checkNull(strRefNo));
payAdMap.put("EFF_DATE" , effDate);
payAdMap.put("EXP_DATE" , expDate);
// Modified by Piyush on 07/09/2019[To allow duplicate keys - First find in original map, if existing then replace else add].Start
/*
if("D".equalsIgnoreCase(strRefType))
{
payCompMap.put(strAdCode+"#D" , payAdMap);
}
else
{
payCompMap.put(strAdCode , payAdMap);
}
*/
ArrayList payCompRows = new ArrayList();
if(payCompMap.containsKey(strAdCode))
{
payCompRows = (ArrayList) payCompMap.get(strAdCode);
if(!payCompMapOrg.containsKey(strAdCode) || "D".equalsIgnoreCase(strRefType))
{
payCompRows.add(payAdMap);
}
else
{
payCompRows.set(0, payAdMap) ;
}
}
else
{
payCompRows.add(payAdMap);
}
payCompMap.put(strAdCode , payCompRows);
// Modified by Piyush on 07/09/2019[To allow duplicate keys - First find in original map, if existing then replace else add].End
//adCompMap.clear();
}
if (rstAdCodes != null)
{
rstAdCodes.close();
rstAdCodes = null;
}
if (pstAdCodes != null)
{
pstAdCodes.close();
pstAdCodes = null;
}
retPayCompMap.put("PAYMAP" , payCompMap);
retPayCompMap.put("ISSPLIT" , isSplit);
}
catch(Exception e)
{
System.out.println(":::" + getClass().getSimpleName() + "::"+ e.getMessage());
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
//Removed by Varsha because its changing main map
//adCompMap.clear();
//adCompMap = null;
if (rstAdCodes != null)
{
rstAdCodes.close();
rstAdCodes = null;
}
if (pstAdCodes != null)
{
pstAdCodes.close();
pstAdCodes = null;
}
}
catch(Exception e1)
{
System.out.println(":::" + getClass().getSimpleName() + "::"+ e1.getMessage());
e1.printStackTrace();
}
}
return retPayCompMap;
}
public String checkNull(String argStr)
{
if(argStr == null)
{
argStr = "";
}
return argStr;
}
//Modify by Varsha V on 22-07-19
//public HashMap calcSalCompValue(String argProcType, HashMap argAdCompsInfo, HashMap argPayCompMap, HashMap argEmpDataMap, String[] argStrVars, double[] argDblVars, Connection argConn, String argXtraParms) throws ITMException, ScriptException
public LinkedHashMap calcSalCompValue(String argProcType, LinkedHashMap argAdCompsInfo, LinkedHashMap argPayCompMap, LinkedHashMap argEmpDataMap, ArrayList argStrVars, ArrayList argStrDate, ArrayList argDblVars, Connection argConn, String argXtraParms, String lsSplit, double mTotDays, String runMode, String considerAttd, HRLogWriter hrLogWriter, Connection logConn) throws ITMException, ScriptException
{
int noOfKeys = 0;
int noOfPayRows = 0;
double dPayAmt = 0d;
double dPayMinAmt = 0d;
double dPayMaxAmt = 0d;
double dPayMinBaseAmt = 0d;
double dPayMaxBaseAmt = 0d;
double dResAmt = 0d;
double dBaseAmt = 0d;
double dSlabAmt = 0d;
double dCompAmt = 0d;
double retVal = 0d;
double lAmount = 0d;
double rndTo = 0d;
double opaidDays = 0d;
double oworkDays = 0d;
double olvesTaken = 0d;
double owoffDays = 0d;
double ototDays = 0d;
double mamount = 0d;
double allwamt = 0d;
double dednamt = 0d;
double owoffdays = 0d;
String errorCode = "";
String strRunPrd = "";
String dprop = "";
String dpropon = "";
String ldEffDateStr = "";
String ldExpDateStr = "";
String strEmpCode = "";
String dpropyn = "";
String rndOff = "";
String sql = "";
String prdCodeArr = "";
String addescr = "";
String nAdCode = "";
Timestamp ldEffDate = null;
Timestamp ldExpDate = null;
Timestamp tsFrDateOfRunPrd = null;
Timestamp tsToDateOfRunPrd = null;
Timestamp joinDateTm = null;
Timestamp relieveDateTm = null;
Timestamp retirementDateTm = null;
Timestamp ldFrDate = null;
Timestamp ldToDate = null;
LinkedHashMap retMap = new LinkedHashMap();
LinkedHashMap adMap = new LinkedHashMap();
LinkedHashMap payAdMap = new LinkedHashMap();
LinkedHashMap payrollDetDataMap = null;
LinkedHashMap payrollDetDataMapAll = new LinkedHashMap();
LinkedHashMap calcPropAmtMap = null;
Object[] keyArray = null;
Object[] keyArray1 = null;
ScriptEngineManager manager = new ScriptEngineManager();
// ScriptEngine exprsEngine = manager.getEngineByName("js");
ScriptEngine exprsEngine = manager.getEngineByName("JavaScript");
//Added by Varsha V on 22-07-19
exprsEngine.eval("function IIF(a,b,c) {return a?b:c}");
exprsEngine.eval("function ISNULL(a) {return a==null?true:false}");
//Ended by Varsha V on 22-07-19
AdmCommon admCommon = new AdmCommon();
PayrollSplitgenAccPrc payrollPrc = new PayrollSplitgenAccPrc();
UtilMethods utilMethods = new UtilMethods();
//PreparedStatement pstmt = null, pstmt1 = null;
ResultSet rs = null;
DecimalFormat format = new DecimalFormat("##.00");
int detCount = 0;
//Modified by Rohini T on [08/08/19][Start]
E12GenericUtility genericUtility = new E12GenericUtility();
//Modified by Rohini T on [08/08/19][End]
System.out.println("argAdCompsInfo::::"+argAdCompsInfo + "\n Size of argAdCompsInfo :: ["+argAdCompsInfo.size()+"]");
//System.out.println("argPayCompMap::::"+argPayCompMap);
//System.out.println("argEmpDataMap::::"+argEmpDataMap);
System.out.println("::argProcType"+argProcType+"::lsSplit::"+lsSplit+"::mTotDays::"+mTotDays+"::runMode::"+runMode+"::considerAttd::"+considerAttd);
System.out.println("argStrVars"+argStrVars);
System.out.println("argStrDate"+argStrDate);
System.out.println("argDblVars"+argDblVars);
System.out.println("::argXtraParms::"+argXtraParms);
// Modified by Piyush on 07/09/2019 [to create all ad code maps for select in formula]
LinkedHashMap allInputMap = new LinkedHashMap();
ArrayList payAdList = null;
try
{
/*sql = "select date_join, relieve_date, retirement_date from employee where emp_code = ? ";
pstmt = argConn.prepareStatement(sql);*/
/*sql = "select descr from allwdedn where ad_code = ?";
pstmt1 = argConn.prepareStatement(sql);*/
keyArray = argEmpDataMap.keySet().toArray();
noOfKeys = keyArray.length;
System.out.println("noOfKeys:::argEmpDataMap:"+noOfKeys);
strRunPrd = (String) argEmpDataMap.get("PRD_CODE");
strEmpCode = (String) argEmpDataMap.get("EMP_CODE");
//Modified by Rohini T on [08/08/19][Start]
if(argEmpDataMap.get("FROM_DATE") != null)
{
String frDate = String.valueOf(argEmpDataMap.get("FROM_DATE"));
//tsFrDateOfRunPrd = Timestamp.valueOf(genericUtility.getValidDateString(frDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
tsFrDateOfRunPrd = (Timestamp) argEmpDataMap.get("FROM_DATE");
}
if(argEmpDataMap.get("TO_DATE") != null)
{
String toDate = String.valueOf(argEmpDataMap.get("TO_DATE"));
//tsToDateOfRunPrd = Timestamp.valueOf(genericUtility.getValidDateString(toDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
tsToDateOfRunPrd = (Timestamp) argEmpDataMap.get("TO_DATE");
}
//Added by Varsha V
if(argEmpDataMap.get("DATE_JOIN") != null)
{
String toDate = String.valueOf(argEmpDataMap.get("DATE_JOIN"));
//joinDateTm = Timestamp.valueOf(genericUtility.getValidDateString(toDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
joinDateTm = (Timestamp) argEmpDataMap.get("DATE_JOIN");
}
if(argEmpDataMap.get("RELIEVE_DATE") != null)
{
String toDate = String.valueOf(argEmpDataMap.get("RELIEVE_DATE"));
//relieveDateTm = Timestamp.valueOf(genericUtility.getValidDateString(toDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
relieveDateTm = (Timestamp) argEmpDataMap.get("RELIEVE_DATE");
}
if(argEmpDataMap.get("RETIREMENT_DATE") != null)
{
String toDate = String.valueOf(argEmpDataMap.get("RETIREMENT_DATE"));
//retirementDateTm = Timestamp.valueOf(genericUtility.getValidDateString(toDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
retirementDateTm = (Timestamp) argEmpDataMap.get("RETIREMENT_DATE");
}
//Ended by Varsha V
//tsFrDateOfRunPrd = (Timestamp) argEmpDataMap.get("FROM_DATE");
//tsToDateOfRunPrd = (Timestamp) argEmpDataMap.get("TO_DATE");
//Modified by Rohini T on [08/08/19][End]
prdCodeArr = (String) argEmpDataMap.get("PRD_CODE__ACC");
for (int i = 0; i < noOfKeys; i++)
{
String dataKey = Array.get(keyArray,i).toString();
Object dataObject = argEmpDataMap.get(dataKey);
exprsEngine.put(dataKey, dataObject);
allInputMap.put(dataKey, dataObject); // Modified by Piyush on 07/09/2019 [to create all ad code maps for select in formula]
}
keyArray = argAdCompsInfo.keySet().toArray();
noOfKeys = keyArray.length;
System.out.println("noOfKeys:::::"+noOfKeys);
for (int i = 0; i < noOfKeys; i++)
{
System.out.println("Inside for....");
/*pstmt.setString(1, strEmpCode);
rs = pstmt.executeQuery();
if(rs.next())
{
joinDateTm = rs.getTimestamp("date_join");
relieveDateTm = rs.getTimestamp("relieve_date");
retirementDateTm = rs.getTimestamp("retirement_date");
}
if(rs != null)
{
rs.close();
rs = null;
}
pstmt.clearParameters();*/
System.out.println("::joinDateTm::"+joinDateTm+"::relieveDateTm::"+relieveDateTm+"::retirementDateTm::"+retirementDateTm);
//String adKey = Array.get(keyArray,i).toString();
String adKey = keyArray[i].toString();
System.out.println("adKey::"+adKey);
adMap = (LinkedHashMap) argAdCompsInfo.get(adKey);
System.out.println("adMap in calcSalCompValue ::: ["+adMap+"]");
String strCompCode = (String) adMap.get("AD_CODE");
//Added by Varsha V
addescr = (String) adMap.get("DESCR");
System.out.println("strCompCode::"+strCompCode);
//payAdMap = (LinkedHashMap) argPayCompMap.get(strCompCode);
//System.out.println("payAdMap::::"+payAdMap);
//if(payAdMap == null)
if(!argPayCompMap.containsKey(strCompCode))
{
exprsEngine.put(strCompCode, 0d);
exprsEngine.put(strCompCode + "_B", 0d);
exprsEngine.put(strCompCode + "_S", 0d);
// Modified by Piyush on 07/09/2019 [to create all ad code maps for select in formula].Start
allInputMap.put(strCompCode, 0d);
allInputMap.put(strCompCode + "_B", 0d);
allInputMap.put(strCompCode + "_S", 0d);
// Modified by Piyush on 07/09/2019 [to create all ad code maps for select in formula].End
continue;
}
//Modified by Piyush on 07/09/2019[Access Arraylist].Start
payAdList = null;
payAdList = (ArrayList) argPayCompMap.get(strCompCode);
noOfPayRows = payAdList.size();
for(int rNo = 0;rNo < noOfPayRows;rNo++)
{
payAdMap = null;
payAdMap = (LinkedHashMap) payAdList.get(rNo);
System.out.println("payAdMap::::"+payAdMap);
//Modified by Piyush on 07/09/2019[Access Arraylist].End
String strAdType = checkNull((String) payAdMap.get("TYPE_S"));
String strBaseFormula = checkNull((String) adMap.get("BASE_FORMULA"));
String strSlabFormula = checkNull((String) adMap.get("SLAB_FORMULA"));
String strResFormula = checkNull((String) adMap.get("RES_FORMULA"));
String strSqlInput = checkNull((String) adMap.get("SQL_INPUT"));
//Modified by Rohini T on [09/08/19][Start]
dPayAmt = Double.parseDouble(setNullToZero(payAdMap.get("AMOUNT").toString()));
dPayMinAmt = Double.parseDouble(setNullToZero(payAdMap.get("MIN_AMT").toString()));
dPayMaxAmt = Double.parseDouble(setNullToZero(payAdMap.get("MAX_AMT").toString()));
dPayMinBaseAmt = Double.parseDouble(setNullToZero(payAdMap.get("MIN_BASIC").toString()));
dPayMaxBaseAmt = Double.parseDouble(setNullToZero(payAdMap.get("MAX_BASIC").toString()));
// dPayAmt = (double) payAdMap.get("AMOUNT");
// dPayMinAmt = (double) payAdMap.get("MIN_AMT");
// dPayMaxAmt = (double) payAdMap.get("MAX_AMT");
// dPayMinBaseAmt = (double) payAdMap.get("MIN_BASIC");
// dPayMaxBaseAmt = (double) payAdMap.get("MAX_BASIC");
// //Modified by Rohini T on [09/08/19][End]
String strSlabOption = checkNull((String) adMap.get("SLAB_OPTION"));
System.out.println("strBaseFormula::"+strBaseFormula+"strSlabFormula::"+strSlabFormula+"strResFormula::"+strResFormula);
dBaseAmt = 0d;
if(strBaseFormula.length() > 0)
{
System.out.println("Inside strBaseFormula if.....");
try
{
System.out.println("exprsEngine::::"+exprsEngine.toString());
System.out.println("strBaseFormula:::123:"+strBaseFormula);
String strResult = String.valueOf(exprsEngine.eval(strBaseFormula));
System.out.println("strResult::::123"+strResult);
if(strResult == null || strResult.trim().length() == 0)
{
dBaseAmt = 0d;
}
else
{
if ("NaN".equalsIgnoreCase(strResult))
{
errorCode = "VPPAYPRC01\tResult is non numeric - Error in base formula of AD Code [" + strCompCode + "]";
break;
}
else
{
try
{
dBaseAmt = Double.parseDouble(strResult);
System.out.println("dBaseAmt::::"+dBaseAmt);
}
catch(Exception dsParseEx)
{
errorCode = "VPPAYPRC01\tException in converting base formula result [" + strResult + "] of AD Code [" + strCompCode + "]\r\n" + dsParseEx.getMessage();
break;
}
}
}
}
catch(Exception bEvalEx)
{
errorCode = "VPPAYPRC01\tException in base formula of AD Code [" + strCompCode + "]\r\n" + bEvalEx.getMessage();
break;
}
}
System.out.println("Evaluated values for BASE "+strCompCode+"_B is "+dBaseAmt);
exprsEngine.put(strCompCode + "_B", dBaseAmt);
// Modified by Piyush on 07/09/2019 [to create all ad code maps for select in formula].Start
allInputMap.put(strCompCode + "_B", dBaseAmt);
// Modified by Piyush on 07/09/2019 [to create all ad code maps for select in formula].End
dSlabAmt = 0d;
if("C".equalsIgnoreCase(strSlabOption) || "D".equalsIgnoreCase(strSlabOption))
{
System.out.println("Inside strSlabOption if.....");
if(strSlabFormula.length() > 0)
{
try
{
String strResult = String.valueOf(exprsEngine.eval(strSlabFormula));
if(strResult == null || strResult.trim().length() == 0)
{
dSlabAmt = 0d;
}
else
{
if ("NaN".equalsIgnoreCase(strResult))
{
errorCode = "VPPAYPRC01\tResult is non numeric - Error in slab formula of AD Code [" + strCompCode + "]";
break;
}
else
{
try
{
dSlabAmt = Double.parseDouble(strResult);
dSlabAmt = admCommon.gfGetSlabAmt(strCompCode, tsFrDateOfRunPrd, strSlabOption, dSlabAmt, dBaseAmt, argConn);
}
catch(Exception dsParseEx)
{
errorCode = "VPPAYPRC01\tException in converting slab formula result [" + strResult + "] of AD Code [" + strCompCode + "]\r\n" + dsParseEx.getMessage();
break;
}
}
}
}
catch(Exception bEvalEx)
{
errorCode = "VPPAYPRC01\tException in slab formula of AD Code [" + strCompCode + "]\r\n" + bEvalEx.getMessage();
break;
}
}
}
System.out.println("Evaluated values for SLAB "+strCompCode+"_S is "+dSlabAmt);
exprsEngine.put(strCompCode + "_S", dSlabAmt);
// Modified by Piyush on 07/09/2019 [to create all ad code maps for select in formula].Start
allInputMap.put(strCompCode + "_S", dSlabAmt);
// Modified by Piyush on 07/09/2019 [to create all ad code maps for select in formula].End
dResAmt = 0d;
dprop = "";
dpropon = "";
retVal = 0d; // Modified by Piyush on 07/09/2019 [To initialize the variable]
//if("F".equalsIgnoreCase(strAdType) ) changed by Varsha V as per nvo on 24-07-19
if("F".equalsIgnoreCase(strAdType) || ("P".equalsIgnoreCase(strAdType) && dPayAmt != 0))
{
System.out.println("Inside strAdType if.....");
dprop = checkNull((String) payAdMap.get("PROP_YN_S"));
dpropon = checkNull((String) payAdMap.get("PROP_ON"));
//Added By Varsha V on 24-07-19
while(true)
{
if(dPayMinBaseAmt != 0 || dPayMaxBaseAmt != 0)
{
// Modified by Piyush on 07/09/2019[Wrong condition. Should be or not &]
// if(dSlabAmt < dPayMinBaseAmt && dSlabAmt >= dPayMaxBaseAmt)
if(dSlabAmt < dPayMinBaseAmt || dSlabAmt >= dPayMaxBaseAmt)
{
break;
}
}
//Ended By Varsha V on 24-07-19
dResAmt = dPayAmt;
if("P".equalsIgnoreCase(strAdType))
{
dResAmt = dBaseAmt * dPayAmt / 100;
}
if("Y".equalsIgnoreCase(dprop))
{
// Modifid by Piyush on 07/09/2019 [The dates are timestamp only and are in dbformat in map, so no need to bellow codes].Start
/*
ldEffDateStr = checkNull((String) payAdMap.get("EFF_DATE"));
ldExpDateStr = checkNull((String) payAdMap.get("EXP_DATE"));
if(ldEffDateStr.trim().length() > 0)
{
ldEffDate = Timestamp.valueOf(ldEffDateStr);
}
if(ldExpDateStr.trim().length() > 0)
{
ldExpDate = Timestamp.valueOf(ldExpDateStr);
}
*/
ldEffDate = (Timestamp) payAdMap.get("EFF_DATE");
ldExpDate = (Timestamp) payAdMap.get("EXP_DATE");
// Modifid by Piyush on 07/09/2019 [The dates are timestamp only and are in dbformat in map, so no need to bellow codes].End
//Modify by Varsha V on 10-09-2019 to call common method --[START]
/*if(ldEffDate != null && ldExpDate != null)
{
if("N".equalsIgnoreCase(lsSplit) || ((ldEffDate.before(tsFrDateOfRunPrd) || ldEffDate.equals(tsFrDateOfRunPrd)) && (ldExpDate.after(tsToDateOfRunPrd) || ldExpDate.equals(tsToDateOfRunPrd))))
{
dResAmt = gbfGetPropAmt(dpropon, (double)argEmpDataMap.get("PAID_DAYS"), (double)argEmpDataMap.get("WORK_DAYS"), joinDateTm, relieveDateTm, tsFrDateOfRunPrd, tsToDateOfRunPrd, mTotDays, dResAmt, runMode, considerAttd);
}
else if(!("U".equalsIgnoreCase(runMode)) && !("Y".equalsIgnoreCase(considerAttd)))
{
ldFrDate = tsFrDateOfRunPrd;
ldToDate = tsToDateOfRunPrd;
if(ldEffDate.after(ldFrDate))
{
// Modified by Piyush on 07/09/2019[Assigned to wrong variable]
// tsFrDateOfRunPrd = ldEffDate;
ldFrDate = ldEffDate;
}
if(ldExpDate.before(ldToDate))
{
// Modified by Piyush on 07/09/2019[Assigned to wrong variable]
// tsToDateOfRunPrd = ldExpDate;
ldToDate = ldExpDate;
}
//calcPropAmt(joinDateTm, ldFrDate, ldToDate, mTotDays, relieveDateTm, retirementDateTm);
gbfGetCalDays(argEmpDataMap,joinDateTm, ldFrDate, ldToDate, mTotDays, relieveDateTm, retirementDateTm);
opaidDays = oworkDays;
owoffdays = 0; // oworkDays = 0; // Modified by Piyush on 07/09/2019[Wrong variable is used]
olvesTaken = 0;
//dResAmt = calcPropAmt(dpropon, opaidDays, oworkDays, ldFrDate, ldToDate, ldFrDate, ldToDate, mTotDays, dResAmt, runMode, considerAttd);
dResAmt = gbfGetPropAmt(dpropon, opaidDays, oworkDays, ldFrDate, ldToDate, ldFrDate, ldToDate, mTotDays, dResAmt, runMode, considerAttd);
}
else
{
ldFrDate = ldEffDate;
ldToDate = ldExpDate;
if(ldFrDate.before(tsFrDateOfRunPrd))
{
ldFrDate = tsFrDateOfRunPrd;
}
if(ldToDate.after(tsToDateOfRunPrd))
{
ldToDate = tsToDateOfRunPrd;
}
//retMap = payrollPrc.gbfGetSplitAttd(strRunPrd, strEmpCode, ldFrDate, ldToDate, oworkDays, olvesTaken, owoffDays, opaidDays, argEmpDataMap, argConn);
retMap = gbfGetSplitAttd(strRunPrd, strEmpCode, ldFrDate, ldToDate, oworkDays, olvesTaken, owoffDays, opaidDays, argEmpDataMap, argConn);
if(retMap != null)
{
errorCode = retMap.get("errorcode").toString();
oworkDays = Double.parseDouble(setNullToZero(retMap.get("work_days").toString()));
olvesTaken = Double.parseDouble(setNullToZero(retMap.get("lves_taken").toString()));
owoffDays = Double.parseDouble(setNullToZero(retMap.get("woff_days").toString()));
opaidDays = Double.parseDouble(setNullToZero(retMap.get("paid_days").toString()));
}
if(errorCode == null || errorCode.trim().length() == 0)
{
ototDays = utilMethods.DaysAfter(ldEffDate, ldExpDate)+1;
//dResAmt = calcPropAmt(dpropon, opaidDays, oworkDays, joinDateTm, relieveDateTm, ldFrDate, ldToDate, mTotDays, dResAmt, runMode, considerAttd);
dResAmt = gbfGetPropAmt(dpropon, opaidDays, oworkDays, joinDateTm, relieveDateTm, ldFrDate, ldToDate, mTotDays, dResAmt, runMode, considerAttd);
}
else
{
hrLogWriter.gbfErrWrite(strRunPrd, strEmpCode, argProcType, errorCode, "E", 2, logConn);
errorCode = null; // Modified by Piyush on 07/09/2019 [As per PB Code]
break;
}
}
}*/
calcPropAmtMap = calcPropAmt(payAdMap, argEmpDataMap, mTotDays, dResAmt, dpropon, lsSplit, runMode, considerAttd, logConn);
errorCode = calcPropAmtMap.get("ERRORCODE").toString();
if(errorCode != null && errorCode.trim().length() > 0)
{
hrLogWriter.gbfErrWrite(strRunPrd, strEmpCode, argProcType, errorCode, "E", 2, logConn);
errorCode = null; // Modified by Piyush on 07/09/2019 [As per PB Code]
break;
}
else
{
try {
dResAmt = Double.parseDouble(calcPropAmtMap.get("AMOUNT").toString());
}
catch(Exception e) {
dResAmt = 0;
}
}
//Modify by Varsha V on 10-09-2019 to call common method --[END]
}
break;
}
if(errorCode != null && errorCode.trim().length() > 0) {
break;
}
// Modified by Piyush on 07/09/2019 [No further evaluation is required but just set amount in map as per PB code].Start
/*
try
{
String strResult = String.valueOf(exprsEngine.eval(dResAmt+""));
if(strResult == null || strResult.trim().length() == 0)
{
dResAmt = 0d;
}
else
{
if ("NaN".equalsIgnoreCase(strResult))
{
errorCode = "VPPAYPRC01\tResult is non numeric - AD Code [" + strCompCode + "]";
break;
}
else
{
try
{
dResAmt = Double.parseDouble(strResult);
}
catch(Exception dsParseEx)
{
errorCode = "VPPAYPRC01\tException in converting result [" + strResult + "] of AD Code [" + strCompCode + "]\r\n" + dsParseEx.getMessage();
break;
}
}
}
}
catch(Exception bEvalEx)
{
errorCode = "VPPAYPRC01\tException in of AD Code [" + strCompCode + "]\r\n" + bEvalEx.getMessage();
break;
}
*/
System.out.println("Evaluated values for RESULT 1 "+strCompCode+" is "+dResAmt);
exprsEngine.put(strCompCode , dResAmt);
allInputMap.put(strCompCode , dResAmt);
retVal = dResAmt;
// Modified by Piyush on 07/09/2019 [No further evaluation is required but just set amount in map as per PB code].End
}
else if(strResFormula != null && strResFormula.trim().length() > 0)
{
System.out.println("Inside strResFormula if.....");
dprop = checkNull((String) payAdMap.get("PROP_YN_S"));
dpropon = checkNull((String) payAdMap.get("PROP_ON"));
if(strResFormula.startsWith("SELECT "))
{
retMap = null;
// Modified by Piyush on 07/09/2019 [to create all ad code maps for select in formula].Start
// retMap = admCommon.gfGetResSqlNvo(strResFormula, adMap.get("SQL_INPUT").toString(), argEmpDataMap, "w_payroll_splitgen_acc", argStrVars, argStrDate, argDblVars, argConn);
retMap = admCommon.gfGetResSqlNvo(strResFormula, adMap.get("SQL_INPUT").toString(), allInputMap, "w_payroll_splitgen_acc", argStrVars, argStrDate, argDblVars, argConn);
if(retMap.containsKey("errorcode"))
{
errorCode = retMap.get("errorcode").toString();
if(errorCode != null && errorCode.trim().length() > 0)
{
break;
}
}
if(retMap.containsKey("value"))
{
retVal = Double.parseDouble(setNullToZero(retMap.get("value").toString()));
// Modified by Piyush on 07/09/2019 [No further evaluation is required but just set amount in map as per PB code].Start
/*
try
{
String strResult = String.valueOf(exprsEngine.eval(retVal+""));
if(strResult == null || strResult.trim().length() == 0)
{
dResAmt = 0d;
}
else
{
if ("NaN".equalsIgnoreCase(strResult))
{
errorCode = "VPPAYPRC01\tResult is non numeric - AD Code [" + strCompCode + "]";
break;
}
else
{
try
{
dResAmt = Double.parseDouble(strResult);
}
catch(Exception dsParseEx)
{
errorCode = "VPPAYPRC01\tException in converting gfGetResSqlNvo result [" + strResult + "] of AD Code [" + strCompCode + "]\r\n" + dsParseEx.getMessage();
break;
}
}
}
}
catch(Exception bEvalEx)
{
errorCode = "VPPAYPRC01\tException in of AD Code [" + strCompCode + "]\r\n" + bEvalEx.getMessage();
break;
}
*/
exprsEngine.put(strCompCode , retVal);
allInputMap.put(strCompCode , retVal);
dResAmt = retVal;
// Modified by Piyush on 07/09/2019 [No further evaluation is required but just set amount in map as per PB code].End
}
// Modified by Piyush on 07/09/2019 [No further evaluation is required but just set amount in map as per PB code].Start
else
{
retVal = 0d;
dResAmt = 0d;
exprsEngine.put(strCompCode , retVal);
allInputMap.put(strCompCode , retVal);
}
// Modified by Piyush on 07/09/2019 [No further evaluation is required but just set amount in map as per PB code].End
}
else
{
try
{
String strResult = String.valueOf(exprsEngine.eval(strResFormula));
if(strResult == null || strResult.trim().length() == 0)
{
dResAmt = 0d;
}
else
{
if ("NaN".equalsIgnoreCase(strResult))
{
errorCode = "VPPAYPRC01\tResult is non numeric - Error in result formula of AD Code [" + strCompCode + "]";
break;
}
else
{
try
{
dResAmt = Double.parseDouble(strResult);
}
catch(Exception rsParseEx)
{
errorCode = "VPPAYPRC01\tException in converting slab formula result [" + strResult + "] of AD Code [" + strCompCode + "]\r\n" + rsParseEx.getMessage();
break;
}
}
}
}
catch(Exception bEvalEx)
{
errorCode = "VPPAYPRC01\tException in result formula of AD Code [" + strCompCode + "]\r\n" + bEvalEx.getMessage();
break;
}
// Modified by Piyush on 07/09/2019 [No further evaluation is required but just set amount in map as per PB code].Start
exprsEngine.put(strCompCode , dResAmt);
allInputMap.put(strCompCode , dResAmt);
retVal = dResAmt;
// Modified by Piyush on 07/09/2019 [No further evaluation is required but just set amount in map as per PB code].End
}
// Modified by Piyush on 07/09/2019 [No further evaluation is required but just set amount in map as per PB code].Start
if (exprsEngine.get(strCompCode) != null)
{
try
{
dResAmt = Double.parseDouble(setNullToZero(exprsEngine.get(strCompCode).toString()));
retVal = dResAmt;
}
catch(Exception rsParseEx)
{
dResAmt = 0d;
retVal = 0d;
}
}
// Modified by Piyush on 07/09/2019 [No further evaluation is required but just set amount in map as per PB code].End
if(lsSplit.equalsIgnoreCase("N"))
{
if("Y".equalsIgnoreCase(payAdMap.get("PROP_YN").toString()))
{
//retVal = calcPropAmt(payAdMap.get("PROP_ON").toString(), (double) argEmpDataMap.get("PAID_DAYS"), (double) argEmpDataMap.get("WORK_DAYS"), joinDateTm, relieveDateTm, tsFrDateOfRunPrd, tsToDateOfRunPrd, mTotDays, retVal, runMode, considerAttd);
retVal = gbfGetPropAmt(payAdMap.get("PROP_ON").toString(), (double) argEmpDataMap.get("PAID_DAYS"), (double) argEmpDataMap.get("WORK_DAYS"), joinDateTm, relieveDateTm, tsFrDateOfRunPrd, tsToDateOfRunPrd, mTotDays, retVal, runMode, considerAttd);
// Modified by Piyush on 07/09/2019 [No further evaluation is required but just set amount in map as per PB code].Start
/*
try
{
String strResult = String.valueOf(exprsEngine.eval(retVal+""));
if(strResult == null || strResult.trim().length() == 0)
{
dResAmt = 0d;
}
else
{
if ("NaN".equalsIgnoreCase(strResult))
{
errorCode = "VPPAYPRC01\tResult is non numeric - AD Code [" + strCompCode + "]";
break;
}
else
{
try
{
dResAmt = Double.parseDouble(strResult);
}
catch(Exception dsParseEx)
{
errorCode = "VPPAYPRC01\tException in converting gbfGetPropAmt result [" + strResult + "] of AD Code [" + strCompCode + "]\r\n" + dsParseEx.getMessage();
break;
}
}
}
}
catch(Exception bEvalEx)
{
errorCode = "VPPAYPRC01\tException in gbfGetPropAmt of AD Code [" + strCompCode + "]\r\n" + bEvalEx.getMessage();
break;
}
*/
exprsEngine.put(strCompCode , retVal);
allInputMap.put(strCompCode , retVal);
dResAmt = retVal;
// Modified by Piyush on 07/09/2019 [No further evaluation is required but just set amount in map as per PB code].End
}
}
else if(!("U".equalsIgnoreCase(runMode)) && !("Y".equalsIgnoreCase(considerAttd)))
{
if("Y".equalsIgnoreCase(payAdMap.get("PROP_YN").toString()))
{
/*ldFrDate = tsFrDateOfRunPrd;
ldToDate = tsToDateOfRunPrd;
if(ldEffDate.after(ldFrDate))
{
// Modified by Piysuh on 07/09/2019[Assigned to wrong variable]
// tsFrDateOfRunPrd = ldEffDate;
ldFrDate = ldEffDate;
}
if(ldExpDate.before(ldToDate))
{
// Modified by Piysuh on 07/09/2019[Assigned to wrong variable]
// tsToDateOfRunPrd = ldExpDate;
ldToDate = ldExpDate;
}
//calcPropAmt(joinDateTm, ldFrDate, ldToDate, mTotDays, relieveDateTm, retirementDateTm);
gbfGetCalDays(argEmpDataMap,joinDateTm, ldFrDate, ldToDate, mTotDays, relieveDateTm, retirementDateTm);
opaidDays = oworkDays;
oworkDays = 0;
olvesTaken = 0;
//dResAmt = calcPropAmt(dpropon, opaidDays, oworkDays, ldFrDate, ldToDate, ldFrDate, ldToDate, mTotDays, dResAmt, runMode, considerAttd);
dResAmt = gbfGetPropAmt(dpropon, opaidDays, oworkDays, ldFrDate, ldToDate, ldFrDate, ldToDate, mTotDays, dResAmt, runMode, considerAttd);
*/
calcPropAmtMap = calcPropAmt(payAdMap, argEmpDataMap, mTotDays, dResAmt, dpropon, lsSplit, runMode, considerAttd, logConn);
errorCode = calcPropAmtMap.get("ERRORCODE").toString();
if(errorCode != null && errorCode.trim().length() > 0)
{
hrLogWriter.gbfErrWrite(strRunPrd, strEmpCode, argProcType, errorCode, "E", 2, logConn);
errorCode = null; // Modified by Piyush on 07/09/2019 [As per PB Code]
break;
}
else
{
ototDays = utilMethods.DaysAfter(ldEffDate, ldExpDate)+1;
try {
dResAmt = Double.parseDouble(calcPropAmtMap.get("AMOUNT").toString());
}
catch(Exception e) {
dResAmt = 0;
}
}
//Modify by Varsha V on 10-09-2019 to call common method --[END]
// Modified by Piyush on 07/09/2019 [No further evaluation is required but just set amount in map as per PB code].start
/*
try
{
String strResult = String.valueOf(exprsEngine.eval(dResAmt+""));
if(strResult == null || strResult.trim().length() == 0)
{
dResAmt = 0d;
}
else
{
if ("NaN".equalsIgnoreCase(strResult))
{
errorCode = "VPPAYPRC01\tResult is non numeric - AD Code [" + strCompCode + "]";
break;
}
else
{
try
{
dResAmt = Double.parseDouble(strResult);
}
catch(Exception dsParseEx)
{
errorCode = "VPPAYPRC01\tException in converting gbfGetPropAmt result [" + strResult + "] of AD Code [" + strCompCode + "]\r\n" + dsParseEx.getMessage();
break;
}
}
}
}
catch(Exception bEvalEx)
{
errorCode = "VPPAYPRC01\tException in gbfGetPropAmt of AD Code [" + strCompCode + "]\r\n" + bEvalEx.getMessage();
break;
}
*/
exprsEngine.put(strCompCode , dResAmt);
allInputMap.put(strCompCode , dResAmt);
retVal = dResAmt;
// Modified by Piyush on 07/09/2019 [No further evaluation is required but just set amount in map as per PB code].End
}
}
else
{
dpropyn = checkNull((String) payAdMap.get("PROP_YN"));
if("Y".equalsIgnoreCase(dpropyn))
{
// Modifid by Piyush on 07/09/2019 [The dates are timestamp only and are in dbformat in map, so no need to bellow codes].Start
/*
ldEffDateStr = checkNull((String) payAdMap.get("EFF_DATE"));
ldExpDateStr = checkNull((String) payAdMap.get("EXP_DATE"));
if(ldEffDateStr.trim().length() > 0)
{
ldEffDate = Timestamp.valueOf(ldEffDateStr);
}
if(ldExpDateStr.trim().length() > 0)
{
ldExpDate = Timestamp.valueOf(ldExpDateStr);
}
*/
ldEffDate = (Timestamp) payAdMap.get("EFF_DATE");
ldExpDate = (Timestamp) payAdMap.get("EXP_DATE");
// Modifid by Piyush on 07/09/2019 [The dates are timestamp only and are in dbformat in map, so no need to bellow codes].End
//Modify by Varsha V on 10-09-2019 to call common method --[START]
/*ldFrDate = ldEffDate;
ldToDate = ldExpDate;
if(ldFrDate.before(tsFrDateOfRunPrd))
{
ldFrDate = tsFrDateOfRunPrd;
}
if(ldToDate.after(tsToDateOfRunPrd))
{
ldToDate = tsToDateOfRunPrd;
}
//retMap = payrollPrc.gbfGetSplitAttd(strRunPrd, strEmpCode, ldFrDate, ldToDate, oworkDays, olvesTaken, owoffDays, opaidDays, argEmpDataMap, argConn);
retMap = gbfGetSplitAttd(strRunPrd, strEmpCode, ldFrDate, ldToDate, oworkDays, olvesTaken, owoffDays, opaidDays, argEmpDataMap, argConn);
if(retMap != null)
{
errorCode = retMap.get("errorcode").toString();
oworkDays = Double.parseDouble(setNullToZero(retMap.get("work_days").toString()));
olvesTaken = Double.parseDouble(setNullToZero(retMap.get("lves_taken").toString()));
owoffDays = Double.parseDouble(setNullToZero(retMap.get("woff_days").toString()));
opaidDays = Double.parseDouble(setNullToZero(retMap.get("paid_days").toString()));
}
if(errorCode == null || errorCode.trim().length() == 0)
{
ototDays = utilMethods.DaysAfter(ldEffDate, ldExpDate)+1;
//dResAmt = calcPropAmt(dpropon, opaidDays, oworkDays, joinDateTm, relieveDateTm, ldFrDate, ldToDate, mTotDays, dResAmt, runMode, considerAttd);
dResAmt = gbfGetPropAmt(dpropon, opaidDays, oworkDays, joinDateTm, relieveDateTm, ldFrDate, ldToDate, mTotDays, dResAmt, runMode, considerAttd);
}
else
{
hrLogWriter.gbfErrWrite(strRunPrd, strEmpCode, argProcType, errorCode, "E", 2, logConn);
break;
}*/
calcPropAmtMap = calcPropAmt(payAdMap, argEmpDataMap, mTotDays, dResAmt, dpropon, lsSplit, runMode, considerAttd, logConn);
errorCode = calcPropAmtMap.get("ERRORCODE").toString();
if(errorCode != null && errorCode.trim().length() > 0)
{
hrLogWriter.gbfErrWrite(strRunPrd, strEmpCode, argProcType, errorCode, "E", 2, logConn);
errorCode = null; // Modified by Piyush on 07/09/2019 [As per PB Code]
break;
}
else
{
ototDays = utilMethods.DaysAfter(ldEffDate, ldExpDate)+1;
try {
dResAmt = Double.parseDouble(calcPropAmtMap.get("AMOUNT").toString());
}
catch(Exception e) {
dResAmt = 0;
}
}
//Modify by Varsha V on 10-09-2019 to call common method --[END]
// Modified by Piyush on 07/09/2019 [No further evaluation is required but just set amount in map as per PB code].Start
/*
try
{
String strResult = String.valueOf(exprsEngine.eval(dResAmt+""));
if(strResult == null || strResult.trim().length() == 0)
{
dResAmt = 0d;
}
else
{
if ("NaN".equalsIgnoreCase(strResult))
{
errorCode = "VPPAYPRC01\tResult is non numeric - AD Code [" + strCompCode + "]";
break;
}
else
{
try
{
dResAmt = Double.parseDouble(strResult);
}
catch(Exception dsParseEx)
{
errorCode = "VPPAYPRC01\tException in converting gbfGetPropAmt result [" + strResult + "] of AD Code [" + strCompCode + "]\r\n" + dsParseEx.getMessage();
break;
}
}
}
}
catch(Exception bEvalEx)
{
errorCode = "VPPAYPRC01\tException in gbfGetPropAmt of AD Code [" + strCompCode + "]\r\n" + bEvalEx.getMessage();
break;
}
*/
System.out.println("Evaluated values for RESULT 2"+strCompCode+" is "+dResAmt);
exprsEngine.put(strCompCode , dResAmt);
allInputMap.put(strCompCode , dResAmt);
retVal = dResAmt;
// Modified by Piyush on 07/09/2019 [No further evaluation is required but just set amount in map as per PB code].End
}
}
}
System.out.println("Evaluated values for RESULT "+strCompCode+" is "+dResAmt);
exprsEngine.put(strCompCode, dResAmt);
// Modified by Piyush on 07/09/2019 [to create all ad code maps for select in formula].Start
allInputMap.put(strCompCode, dResAmt);
// Modified by Piyush on 07/09/2019 [to create all ad code maps for select in formula].End
//dw_payrollwork1 : argEmpDataMap, dw_payrollwork : payAdMap
String key = strRunPrd+"-"+strEmpCode+"-"+strCompCode;
if(!payrollDetDataMapAll.containsKey(key)) {
System.out.println("Inside payrollDetDataMapAll if.....");
payrollDetDataMap = new LinkedHashMap();
payrollDetDataMap.put("PRD_CODE", strRunPrd);
payrollDetDataMap.put("EMP_CODE", strEmpCode);
payrollDetDataMap.put("AD_CODE", strCompCode);
if(argProcType.equalsIgnoreCase("AR"))
payrollDetDataMap.put("PRD_CODE__ACC", prdCodeArr);
if(argProcType.equalsIgnoreCase("PY") || argProcType.equalsIgnoreCase("AR"))
{
payrollDetDataMap.put("REF_TYPE", payAdMap.get("REF_TYPE"));
payrollDetDataMap.put("REF_NO", payAdMap.get("REF_NO"));
}
/*pstmt1.setString(1, strCompCode);
rs = pstmt1.executeQuery();
if(rs.next())
{
addescr = checkNull(rs.getString("descr"));
}*/
payrollDetDataMap.put("DESCR", addescr);
payrollDetDataMap.put("SEQ_NO", payAdMap.get("SEQ_NO"));
payrollDetDataMap.put("TYPE", payAdMap.get("TYPE"));
payrollDetDataMap.put("PAYABLE", payAdMap.get("PAYABLE"));
payrollDetDataMap.put("BASE_AMT", dBaseAmt);
payrollDetDataMap.put("SLAB_AMT", dSlabAmt);
// Modified by Piyush on 07/09/2019[It should be result amount]
// payrollDetDataMap.put("RESULT_AMT", adMap.get(strCompCode));
payrollDetDataMap.put("RESULT_AMT", dResAmt);
payrollDetDataMap.put("POST_YN", payAdMap.get("POST_YN"));
rndOff = (payAdMap.get("RND_OFF") == null ? "" : payAdMap.get("RND_OFF").toString());
//rndOff = argPayCompMap.get("RND_OFF").toString();
rndTo = Double.parseDouble(setNullToZero(payAdMap.get("RND_TO").toString()));
payrollDetDataMap.put("RND_OFF", rndOff);
payrollDetDataMap.put("RND_TO", rndTo);
payrollDetDataMap.put("CALC_AMT", dResAmt);
lAmount = 0;
}
else
{
System.out.println("Inside payrollDetDataMapAll else.....");
rndOff = payAdMap.get("RND_OFF").toString();
rndTo = Double.parseDouble(setNullToZero(payAdMap.get("RND_TO").toString()));
lAmount = Double.parseDouble(setNullToZero(payrollDetDataMap.get("amount").toString()));
}
if(!"N".equalsIgnoreCase(rndOff))
{
mamount = admCommon.gfGetRndAmt(Double.parseDouble(setNullToZero(adMap.get(strCompCode).toString())), rndOff, rndTo);
System.out.println("mamount:::"+mamount);
}
else
{
mamount = Double.parseDouble(setNullToZero(adMap.get(strCompCode).toString()));
mamount = Double.valueOf(format.format(mamount));
System.out.println("mamount:::"+mamount);
}
dResAmt = mamount + lAmount;
if("F".equalsIgnoreCase(strAdType) || ("P".equalsIgnoreCase(strAdType) && dPayAmt != 0))
{
nAdCode = checkNull(payAdMap.get("AD_CODE").toString());
if(!(nAdCode.equalsIgnoreCase(strCompCode)) && (dPayMinAmt != 0 || dPayMaxAmt != 0))
{
if(dPayMinAmt != 0 && dResAmt < dPayMinAmt)
{
dResAmt = dPayMinAmt;
}
if(dPayMaxAmt != 0 && dResAmt > dPayMaxAmt)
{
dResAmt = dPayMaxAmt;
}
}
}
payrollDetDataMap.put("AMOUNT", dResAmt);
try
{
String strResult = String.valueOf(exprsEngine.eval(dResAmt+""));
System.out.println("strResult:::"+strResult);
if(strResult == null || strResult.trim().length() == 0)
{
dResAmt = 0d;
}
else
{
if ("NaN".equalsIgnoreCase(strResult))
{
errorCode = "VPPAYPRC01\tResult is non numeric - AD Code [" + strCompCode + "]";
break;
}
else
{
try
{
dResAmt = Double.parseDouble(strResult);
}
catch(Exception dsParseEx)
{
errorCode = "VPPAYPRC01\tException in converting result [" + strResult + "] of AD Code [" + strCompCode + "]\r\n" + dsParseEx.getMessage();
break;
}
}
}
}
catch(Exception bEvalEx)
{
errorCode = "VPPAYPRC01\tException in AD Code [" + strCompCode + "]\r\n" + bEvalEx.getMessage();
break;
}
if("AR".equalsIgnoreCase(argProcType))
{
System.out.println("Inside argProcType if......");
retMap = payrollPrc.gbfSetArrDet(strRunPrd, strEmpCode, strCompCode, prdCodeArr, payrollDetDataMap, argConn);
if(retMap != null)
{
payrollDetDataMap = (LinkedHashMap)retMap.get("payrollDetMap");
retVal = Integer.parseInt(setNullToZero(retMap.get("retVal").toString()));
if(retVal != 0)
{
errorCode = "VTARR1";
break;
}
}
mamount = payrollPrc.gbfGetNewAmount(strCompCode, rndOff, rndTo, lAmount, adMap);
}
if("A".equalsIgnoreCase(payAdMap.get("PAYABLE").toString()))
{
allwamt = allwamt + mamount;
System.out.println("allwamt:::"+allwamt);
}
else if("D".equalsIgnoreCase(payAdMap.get("PAYABLE").toString()))
{
dednamt = dednamt + mamount;
System.out.println("dednamt:::"+dednamt);
}
String mapKey = strRunPrd+"-"+strEmpCode+"-"+strCompCode;
System.out.println("mapKey:::"+mapKey);
payrollDetDataMapAll.put(mapKey, payrollDetDataMap);
System.out.println("payrollDetDataMapAll:::"+payrollDetDataMapAll);
}
if(errorCode != null && errorCode.trim().length() > 0)
{
break;
}
}
retMap.put("payrollDetDataMapAll", payrollDetDataMapAll);
retMap.put("errorcode", errorCode);
retMap.put("allwamt", allwamt);
retMap.put("dednamt", dednamt);
retMap.put("mamount", mamount);
System.out.println("retMap"+retMap);
}
catch(Exception e)
{
System.out.println(":::" + getClass().getSimpleName() + "::"+ e.getMessage());
e.printStackTrace();
throw new ITMException(e);
}
return retMap;
}
public String setNullToZero(String input)
{
if(input == null || input.trim().length() == 0)
return "0";
else
return input.trim();
}
public double gbfGetCalDays (LinkedHashMap argEmpDataMap, Timestamp adJoinDate, Timestamp adPrdFrDate, Timestamp adPrdToDate, double aiTotDays, Timestamp adRelieveDate, Timestamp adRetirementDt) throws ITMException
{
System.out.println("Calling gbfGetCalDays (Timestamp adJoinDate, Timestamp adPrdFrDate, Timestamp adPrdToDate, double aiTotDays, Timestamp adRelieveDate, Timestamp adRetirementDt) of AllowDednSalComp");
Timestamp ldFrDate = null, ldToDate = null;
double calDays = 0d;
boolean lbRecalcDays = false;
String isProjectOnJoindateForNewJoinee = "N";
String isProjectTillReldateForRelemp = "N";
String isProjectTillReldateForReTemp = "N";
try {
ldFrDate = adPrdFrDate;
ldToDate = adPrdToDate;
calDays = aiTotDays;
if(argEmpDataMap.containsKey("isProjectOnJoindateForNewJoinee") && argEmpDataMap.get("isProjectOnJoindateForNewJoinee") != null)
{
isProjectOnJoindateForNewJoinee = (String) argEmpDataMap.get("isProjectOnJoindateForNewJoinee");
}
if(argEmpDataMap.containsKey("isProjectTillReldateForRelemp") && argEmpDataMap.get("isProjectTillReldateForRelemp") != null)
{
isProjectTillReldateForRelemp = (String) argEmpDataMap.get("isProjectTillReldateForRelemp");
}
if(argEmpDataMap.containsKey("isProjectTillReldateForReTemp") && argEmpDataMap.get("isProjectTillReldateForReTemp") != null)
{
isProjectTillReldateForReTemp = (String) argEmpDataMap.get("isProjectTillReldateForReTemp");
}
if("Y".equalsIgnoreCase(isProjectOnJoindateForNewJoinee) && adJoinDate.after(adPrdFrDate) && (adJoinDate.before(adPrdToDate) || adJoinDate.equals(adPrdToDate)))
{
ldFrDate = adJoinDate;
lbRecalcDays = true;
}
if("Y".equalsIgnoreCase(isProjectTillReldateForRelemp) && adRelieveDate != null && (adRelieveDate.after(adPrdFrDate) || adRelieveDate.equals(adPrdFrDate)) && (adRelieveDate.before(adPrdToDate) || adRelieveDate.equals(adPrdToDate)))
{
ldToDate = adRelieveDate;
lbRecalcDays = true;
}
if("Y".equalsIgnoreCase(isProjectTillReldateForReTemp) && adRetirementDt != null && adRelieveDate == null && (adRetirementDt.after(adPrdFrDate) || adRetirementDt.equals(adPrdFrDate)) && (adRetirementDt.before(adPrdToDate) || adRetirementDt.equals(adPrdToDate)))
{
ldToDate = adRetirementDt;
lbRecalcDays = true;
}
if(lbRecalcDays)
{
calDays = utilMethods.DaysAfter(new Date(ldFrDate.getTime()), new Date(ldToDate.getTime())) + 1;
if(calDays > aiTotDays)
{
calDays = aiTotDays;
}
}
}
catch(Exception e)
{
throw new ITMException(e);
}
return calDays;
}
private double gbfGetCalDays (LinkedHashMap argEmpDataMap, Timestamp adJoinDate, Timestamp adPrdFrDate, Timestamp adPrdToDate, double aiTotDays) throws ITMException
{
System.out.println("Calling gbfGetCalDays (Timestamp adJoinDate, Timestamp adPrdFrDate, Timestamp adPrdToDate, double aiTotDays) of AllowDednSalComp");
Date joinDate = null;
Date prdToDate = null;
double calDays = 0;
String isProjectOnJoindateForNewJoinee = "N";
String isProjectTillReldateForRelemp = "N";
String isProjectTillReldateForReTemp = "N";
try {
calDays = aiTotDays;
if(argEmpDataMap.containsKey("isProjectOnJoindateForNewJoinee") && argEmpDataMap.get("isProjectOnJoindateForNewJoinee") != null)
{
isProjectOnJoindateForNewJoinee = (String) argEmpDataMap.get("isProjectOnJoindateForNewJoinee");
}
if(argEmpDataMap.containsKey("isProjectTillReldateForRelemp") && argEmpDataMap.get("isProjectTillReldateForRelemp") != null)
{
isProjectTillReldateForRelemp = (String) argEmpDataMap.get("isProjectTillReldateForRelemp");
}
if(argEmpDataMap.containsKey("isProjectTillReldateForReTemp") && argEmpDataMap.get("isProjectTillReldateForReTemp") != null)
{
isProjectTillReldateForReTemp = (String) argEmpDataMap.get("isProjectTillReldateForReTemp");
}
if("Y".equalsIgnoreCase(isProjectOnJoindateForNewJoinee) && (adJoinDate.after(adPrdFrDate) || adJoinDate.equals(adPrdFrDate)) && (adJoinDate.before(adPrdToDate) || adJoinDate.equals(adPrdToDate)))
{
joinDate = new Date(adJoinDate.getTime());
prdToDate = new Date(adPrdToDate.getTime());
calDays = utilMethods.DaysAfter(joinDate, prdToDate) + 1;
}
}
catch(Exception e)
{
throw new ITMException(e);
}
return calDays;
}
private LinkedHashMap calcPropAmt(LinkedHashMap argPayAdMap, LinkedHashMap argEmpDataMap, double argTotDays, double argAmount, String argPropOn, String argSplitFlag, String argRunMode, String argConsiderAttdFlag, Connection logConn) throws ITMException
{
System.out.println("Calling calcPropAmt(LinkedHashMap argPayAdMap, LinkedHashMap argEmpDataMap, double argTotDays, double argAmount, String argPropOn, String argSplitFlag, String argRunMode, String argConsiderAttdFlag, Connection logConn) of AllowDednSalComp");
Timestamp tsFrDateOfRunPrd = null;
Timestamp tsToDateOfRunPrd = null;
Timestamp ldEffDate = null;
Timestamp ldExpDate = null;
Timestamp joinDateTm = null;
Timestamp relieveDateTm = null;
Timestamp retirementDateTm = null;
Timestamp ldFrDate = null;
Timestamp ldToDate = null;
double workDays = 0d;
double paidDays = 0d;
double woffDays = 0d;
double leaveDays = 0d;
double totDays = 0d;
double propAmt = 0d;
String strRunPrd = "";
String strEmpCode = "";
String errorCode = "";
UtilMethods utilMethods = new UtilMethods();
E12GenericUtility genericUtility = new E12GenericUtility();
LinkedHashMap retMap = new LinkedHashMap();
try
{
totDays = argTotDays;
strRunPrd = (String) argEmpDataMap.get("PRD_CODE");
strEmpCode = (String) argEmpDataMap.get("EMP_CODE");
if(argEmpDataMap.get("FROM_DATE") != null)
{
String frDate = String.valueOf(argEmpDataMap.get("FROM_DATE"));
//tsFrDateOfRunPrd = Timestamp.valueOf(genericUtility.getValidDateString(frDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
tsFrDateOfRunPrd = (Timestamp) argEmpDataMap.get("FROM_DATE");
}
if(argEmpDataMap.get("TO_DATE") != null)
{
String toDate = String.valueOf(argEmpDataMap.get("TO_DATE"));
//tsToDateOfRunPrd = Timestamp.valueOf(genericUtility.getValidDateString(toDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
tsToDateOfRunPrd = (Timestamp) argEmpDataMap.get("TO_DATE");
}
//Added by Varsha V
if(argEmpDataMap.get("DATE_JOIN") != null)
{
String toDate = String.valueOf(argEmpDataMap.get("DATE_JOIN"));
//joinDateTm = Timestamp.valueOf(genericUtility.getValidDateString(toDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
joinDateTm = (Timestamp) argEmpDataMap.get("DATE_JOIN");
}
if(argEmpDataMap.get("RELIEVE_DATE") != null)
{
String toDate = String.valueOf(argEmpDataMap.get("RELIEVE_DATE"));
//relieveDateTm = Timestamp.valueOf(genericUtility.getValidDateString(toDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
relieveDateTm = (Timestamp) argEmpDataMap.get("RELIEVE_DATE");
}
if(argEmpDataMap.get("RETIREMENT_DATE") != null)
{
String toDate = String.valueOf(argEmpDataMap.get("RETIREMENT_DATE"));
//retirementDateTm = Timestamp.valueOf(genericUtility.getValidDateString(toDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
retirementDateTm = (Timestamp) argEmpDataMap.get("RETIREMENT_DATE");
}
ldEffDate = (Timestamp) argPayAdMap.get("EFF_DATE");
ldExpDate = (Timestamp) argPayAdMap.get("EXP_DATE");
if(ldEffDate != null && ldExpDate != null)
{
if("N".equalsIgnoreCase(argSplitFlag) || ((ldEffDate.before(tsFrDateOfRunPrd) || ldEffDate.equals(tsFrDateOfRunPrd)) && (ldExpDate.after(tsToDateOfRunPrd) || ldExpDate.equals(tsToDateOfRunPrd))))
{
paidDays = (double)argEmpDataMap.get("PAID_DAYS");
workDays = (double)argEmpDataMap.get("WORK_DAYS");
}
else if(!("U".equalsIgnoreCase(argRunMode)) && !("Y".equalsIgnoreCase(argConsiderAttdFlag)))
{
ldFrDate = tsFrDateOfRunPrd;
ldToDate = tsToDateOfRunPrd;
if(ldEffDate.after(ldFrDate))
{
ldFrDate = ldEffDate;
}
if(ldExpDate.before(ldToDate))
{
ldToDate = ldExpDate;
}
workDays = gbfGetCalDays(argEmpDataMap, joinDateTm, ldFrDate, ldToDate, argTotDays, relieveDateTm, retirementDateTm);
paidDays = workDays;
}
else
{
ldFrDate = ldEffDate;
ldToDate = ldExpDate;
if(ldFrDate.before(tsFrDateOfRunPrd))
{
ldFrDate = tsFrDateOfRunPrd;
}
if(ldToDate.after(tsToDateOfRunPrd))
{
ldToDate = tsToDateOfRunPrd;
}
totDays = utilMethods.DaysAfter(ldEffDate, ldExpDate) + 1;
//retMap = payrollPrc.gbfGetSplitAttd(strRunPrd, strEmpCode, ldFrDate, ldToDate, workDays, leaveDays, woffDays, paidDays, argEmpDataMap, argConn);
retMap = gbfGetSplitAttd(strRunPrd, strEmpCode, ldFrDate, ldToDate, workDays, leaveDays, woffDays, paidDays, argEmpDataMap, logConn);
if(retMap != null)
{
errorCode = retMap.get("errorcode").toString();
workDays = Double.parseDouble(setNullToZero(retMap.get("work_days").toString()));
leaveDays = Double.parseDouble(setNullToZero(retMap.get("lves_taken").toString()));
woffDays = Double.parseDouble(setNullToZero(retMap.get("woff_days").toString()));
paidDays = Double.parseDouble(setNullToZero(retMap.get("paid_days").toString()));
}
}
if(errorCode == null || errorCode.trim().length() == 0)
{
propAmt = gbfGetPropAmt(argPropOn, paidDays, workDays, joinDateTm, relieveDateTm, ldFrDate, ldToDate, totDays, argAmount, argRunMode, argConsiderAttdFlag);
}
}
}
catch(Exception e)
{
System.out.println(":::" + getClass().getSimpleName() + "::"+ e.getMessage());
e.printStackTrace();
throw new ITMException(e);
}
retMap.clear();
retMap.put("ERRORCODE" , errorCode);
retMap.put("AMOUNT" , new Double(propAmt));
return retMap;
}
private double gbfGetPropAmt(String propOn, double paidDays, double workDays, Timestamp joinDate, Timestamp relieveDate, Timestamp prdFrDate, Timestamp prdToDate, double totDays, double acAmount, String runMode, String considerAttd) throws ITMException
{
System.out.println("Calling gbfGetPropAmt(String propOn, double paidDays, double workDays, Timestamp joinDate, Timestamp relieveDate, Timestamp prdFrDate, Timestamp prdToDate, double totDays, double acAmount, String runMode, String considerAttd) of AllowDednSalComp");
double amount = 0.0;
Timestamp temp1 = null, temp2 = null, temp3 = null, temp4 = null;
long calDaysInOrg = 0;
try
{
if("W".equalsIgnoreCase(propOn))
{
amount = (acAmount * workDays/totDays);
}
else if("C".equalsIgnoreCase(propOn))
{
temp3 = prdFrDate;
temp4 = prdToDate;
temp1 = temp3;
temp2 = temp4;
if("U".equalsIgnoreCase(runMode) || "Y".equalsIgnoreCase(considerAttd))
{
if(joinDate != null && joinDate.after(temp3))
{
temp1 = joinDate;
}
if(relieveDate != null && relieveDate.before(temp4))
{
temp2 = relieveDate;
}
}
// Modified by Piyush on 07/09/2019 [Add one day to consider both date]
// calDaysInOrg = utilMethods.DaysAfter(temp1, temp2);
calDaysInOrg = utilMethods.DaysAfter(temp1, temp2) + 1;
amount = acAmount * calDaysInOrg/totDays;
}
else
{
amount = acAmount * paidDays/totDays;
}
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
System.out.println("amount from gbfGetPropAmt :: ["+amount+"]");
return amount;
}
private LinkedHashMap gbfGetSplitAttd(String prdCode, String empCode, Timestamp frDate, Timestamp toDate, double workDays, double lveTaken, double woffDays, double paidDays, LinkedHashMap argEmpDataMap, Connection conn) throws ITMException, SQLException
{
System.out.println("Calling gbfGetSplitAttd(String prdCode, String empCode, Timestamp frDate, Timestamp toDate, double workDays, double lveTaken, double woffDays, double paidDays, LinkedHashMap argEmpDataMap, Connection conn) of AllowDednSalComp");
String errorCode = "" ;
String lsProcessAttd = "";
String workSite = "";
String cCadre = "";
String cGrade = "";
String sql = "";
PreparedStatement pstmt = null, pstmt1 = null;
ResultSet rs = null, rs1 = null;
LinkedHashMap retMap = new LinkedHashMap();
try
{
workSite = (String) argEmpDataMap.get("SITE_CODE__WORK");
cCadre = (String) argEmpDataMap.get("CADRE");
cGrade = (String) argEmpDataMap.get("GRADE");
lsProcessAttd = admCommon.getAdmEnv(workSite, cCadre, cGrade, "PROCESS_ATTD", frDate, conn);
if(lsProcessAttd != null && lsProcessAttd.equalsIgnoreCase("NULLFOUND"))
{
lsProcessAttd = admCommon.getEnv("999999", "PROCESS_ATTD", conn);
if(lsProcessAttd != null && lsProcessAttd.equalsIgnoreCase("NULLFOUND"))
{
// Modified by Piysuh on 07/09/2019 [To set proper error]
// errorCode = "VSENVAR1";
errorCode = "VSENVAR1~t Variable (PROCESS_ATTD) is not defined properly";
}
}
else if(utilMethods.left(lsProcessAttd, 4).equalsIgnoreCase("ERR"))
{
errorCode = utilMethods.mid(lsProcessAttd, 5);
}
if(errorCode == null || errorCode.trim().length()==0)
{
sql = "select sum(case when work_days is null then 0 else work_days end) as work_days, " +
" sum(case when paid_days is null then 0 else paid_days end) as paid_days, " +
" sum(case when hol_woff_days is null then 0 else hol_woff_days end) as hol_woff_days, " +
" sum(case when leave_days is null then 0 else leave_days end) as leave_days" +
" from attd_reg where emp_code = ? and attd_date between ? and ?";
pstmt1 = conn.prepareStatement(sql);
sql = "select work_days, paid_days, woff_days, lves_taken from attendance_mon_split " +
"where prd_code = ? and emp_code = ? " +
"and fr_date = :ad_frdate and to_date = :ad_todate";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, prdCode);
pstmt.setString(2, empCode);
pstmt.setTimestamp(3, frDate);
pstmt.setTimestamp(4, toDate);
rs = pstmt.executeQuery();
if (rs.next()) {
workDays = rs.getDouble("work_days");
paidDays = rs.getDouble("paid_days");
woffDays = rs.getDouble("woff_days");
lveTaken = rs.getDouble("lves_taken");
errorCode = "";
}
else if("Y".equalsIgnoreCase(lsProcessAttd))
{
pstmt1.setString(1, empCode);
pstmt1.setTimestamp(2, frDate);
pstmt1.setTimestamp(3, toDate);
rs1 = pstmt1.executeQuery();
if (rs1.next()) {
workDays = rs1.getDouble("work_days");
paidDays = rs1.getDouble("paid_days");
woffDays = rs1.getDouble("hol_woff_days");
lveTaken = rs1.getDouble("leave_days");
errorCode = "";
}
else
{
errorCode = "SPLITATTD";
}
if(rs1 != null)
{
rs1.close();
rs1 = null;
}
pstmt1.clearParameters();
}
else
{
errorCode = "SPLITATTD";
}
if(rs1 != null)
{
rs1.close();
rs1 = null;
}
if(pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
retMap.put("work_days", workDays);
retMap.put("paid_days", paidDays);
retMap.put("woff_days", woffDays);
retMap.put("lves_taken", lveTaken);
retMap.put("errorcode", errorCode);
}
catch(Exception e)
{
throw new ITMException(e);
}
finally
{
if(rs1 != null)
{
rs1.close();
rs1 = null;
}
if(pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
System.out.println("retMap from GbfGetSplitAttd :: ["+retMap+"]");
return retMap;
}
}
package ibase.webitm.ejb.adm;
import java.lang.reflect.Array;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import ibase.utility.E12GenericUtility;
import ibase.webitm.bean.adm.LogWriterDatabase;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.sys.UtilMethods;
import ibase.webitm.utility.ITMException;
public class InterestProcess extends ValidatorEJB
{
E12GenericUtility genericUtility = new E12GenericUtility();
LogWriterDatabase logWriter = new LogWriterDatabase();
UtilMethods utilmethod = new UtilMethods();
ITMDBAccessEJB itmDBAccess = new ITMDBAccessEJB();
AdmCommon admCommon = new AdmCommon();
String isLogLocationType = logWriter.getLogLocationType();
Timestamp idProcessDate = logWriter.getStartDateTime();
String isLogServerAddr = logWriter.getLogServerAddress();
String isWSRLogFname = logWriter.getWsrLogFileName();
String isLogObjName = logWriter.getObjName();
String isActivity = logWriter.getActivity();
String isProcId = logWriter.getProcessId();
String isLogFileName = logWriter.getLogFileName();
String isProcMode = "D";
//gbf_loan_confirm_no_edi = loanConfirmNoEdi
public String loanConfirmNoEdi(String lsLoanNo, Timestamp ldEff, Timestamp ldExp, double lcIntAmt, String lsScheme, String empCode, int aiCommit, String xtraParams, Connection conn) throws ITMException
{
String lsAdCodeDed = "", lsAdCodeInt = "", lsErrCode = "", ediOption = "";
String lsIntTerm = "", lsPrdCode = "", lsMonth = "", lsCalBase = "";
String userId = "";
long ll_rows, ll_cnt, ll_rejected, ll_confirmed = 0, ll_temp, ll_cnt1 = 0;
Timestamp ldChg = null;
Timestamp ldStart = null;
Timestamp ldToday = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
String sql = "", errString = "";
try
{
System.out.println("---Inside InterestProcess loanConfirmNoEdi-- ");
ldToday = utilmethod.dateTime(utilmethod.today(), utilmethod.now());
ldChg = utilmethod.dateTime(utilmethod.today(), utilmethod.now());
sql = "select ad_code__ded, ad_code__int from loan_scheme where scheme_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsScheme);
rs = pstmt.executeQuery();
if(rs.next())
{
lsAdCodeDed = checkNull(rs.getString("ad_code__ded"));
lsAdCodeInt = checkNull(rs.getString("ad_code__int"));
}
else
{
errString = itmDBAccess.getErrorString("", "VTSCHNO1", "", "", conn);
return errString;
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
sql = "select int_term, start_reco from loans where loan_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsLoanNo);
rs = pstmt.executeQuery();
if(rs.next())
{
lsIntTerm = checkNull(rs.getString("int_term"));
ldStart = rs.getTimestamp("start_reco");
}
else
{
errString = itmDBAccess.getErrorString("", "VTLOAN3", "", "", conn);
return errString;
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
sql = "select cal_base from interestterm where int_term = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsIntTerm);
rs = pstmt.executeQuery();
if(rs.next())
{
lsCalBase = checkNull(rs.getString("cal_base"));
}
else
{
errString = itmDBAccess.getErrorString("", "VTITERM1", "", "", conn);
return errString;
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if("E".equalsIgnoreCase(lsCalBase))
{
sql = "update loans set balance_amt = balance_amt + ?," +
" date__interest = ?" +
" where loan_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, lcIntAmt);
pstmt.setTimestamp(2, ldExp);
pstmt.setString(3, lsLoanNo);
int cnt = pstmt.executeUpdate();
if(cnt == 0)
{
errString = itmDBAccess.getErrorString("", "VTLOAN3", "", "", conn);
return errString;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
sql = "update allowdedn_bal set amount = amount + ?," +
" amt_bal = amt_bal + ?" +
" where emp_code = ?" +
" and ad_code = ?" +
" and ref_type = 'L'" +
" and ref_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, lcIntAmt);
pstmt.setDouble(2, lcIntAmt);
pstmt.setString(3, empCode);
pstmt.setString(4, lsAdCodeDed);
pstmt.setString(5, lsLoanNo);
int cnt1 = pstmt.executeUpdate();
if(cnt1 == 0)
{
errString = itmDBAccess.getErrorString("", "DS000NR", "", "", conn);
return errString;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
else
{
sql = "update loans set date__interest = ? where loan_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, ldExp);
pstmt.setString(2, lsLoanNo);
int count = pstmt.executeUpdate();
if(count == 0)
{
errString = itmDBAccess.getErrorString("", "VTLOAN3", "", "", conn);
return errString;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
if((ldStart.before(ldEff) || ldStart.equals(ldEff)) && "E".equalsIgnoreCase(lsCalBase))
{
sql = "select code from period where fr_date = ? and to_date = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, ldEff);
pstmt.setTimestamp(2, ldExp);
rs = pstmt.executeQuery();
if(rs.next())
{
lsPrdCode = checkNull(rs.getString("code"));
if(lsPrdCode != null || lsPrdCode.trim().length() > 0)
{
errString = itmDBAccess.getErrorString("", "VMPRD1", "", "", conn);
return errString;
}
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
//lsMonth = right(trim(lsPrdCode), 2);
lsMonth = lsPrdCode;
sql = "select count(*) as count from employee_mthad where emp_code = ? and month_code = ?" +
" and ad_code = ? and eff_date = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode);
pstmt.setString(2, lsMonth);
pstmt.setString(3, lsAdCodeInt);
pstmt.setTimestamp(4, ldEff);
rs = pstmt.executeQuery();
if(rs.next())
{
ll_cnt1 = rs.getInt("count");
if(ll_cnt1 > 0)
{
errString = itmDBAccess.getErrorString("", "VTMTHAD", "", "", conn);
return errString;
}
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(ll_cnt1 == 0)
{
sql = "insert into employee_mthad (emp_code, month_code, ad_code," +
" eff_date, exp_date, type, amount, min_basic, max_basic," +
" min_amt, max_amt, prop_yn, chg_date, chg_user, chg_term, ref_type, ref_no)" +
" values ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode);
pstmt.setString(2, lsMonth);
pstmt.setString(3, lsAdCodeInt);
pstmt.setTimestamp(4, ldEff);
pstmt.setTimestamp(5, ldExp);
pstmt.setString(6, "F");
pstmt.setDouble(7, lcIntAmt);
pstmt.setDouble(8, 0.0);
pstmt.setDouble(9, 0.0);
pstmt.setDouble(10, 0.0);
pstmt.setDouble(11, 0.0);
pstmt.setString(12, "N");
pstmt.setTimestamp(13, ldToday);
pstmt.setString(14,genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode"));
pstmt.setString(15,genericUtility.getValueFromXTRA_PARAMS(xtraParams,"termId"));
pstmt.setString(16, "N");
pstmt.setString(17, lsLoanNo);
rs = pstmt.executeQuery();
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
else
{
sql = "update employee_mthad set amount = amount + ?, ref_type = 'N', ref_no = ?" +
" where emp_code = ? and month_code = ? and ad_code = ? and eff_date = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, lcIntAmt);
pstmt.setString(2, lsLoanNo);
pstmt.setString(3, empCode);
pstmt.setString(4, lsMonth);
pstmt.setString(5, lsAdCodeInt);
pstmt.setTimestamp(6, ldEff);
int updCnt = pstmt.executeUpdate();
if (updCnt == 1)
{
System.out.println("Updated Into EMPLOYEE_MTHAD Table Successgully......! [updCnt] :: "+ updCnt);
}
else if (updCnt == 0)
{
errString = itmDBAccess.getErrorString("", "DS000NR", "", "", conn);
return errString;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
}
sql = "update loans_interest set confirmed = 'Y' where loan_no = ? and date__from = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsLoanNo);
pstmt.setTimestamp(2, ldEff);
int cnt = pstmt.executeUpdate();
if(cnt == 0)
{
errString = itmDBAccess.getErrorString("", "DS000NR", "", "", conn);
return errString;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
ll_confirmed = ll_confirmed + 1;
if(errString.trim().length() > 0)
{
System.out.println("Rollbacking transaction");
conn.rollback();
}
else
{
conn.commit();
}
}
catch(Exception e)
{
System.out.println("Exception :InterestProcess :loanConfirmNoEdi :" + e.getMessage() + ":");
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();
throw new ITMException(e);
}
}
return errString;
}
// empLoanIntProc = gbf_emploan_int_proc
// dw_interest.dataobject=d_interest_process
public String empLoanIntProc(String loanFr, String loanTo, String empFr, String empTo, String prdCode, String overWrite, String siteFr,
String siteTo, String procGrpFr, String procGrpTo, String xtraParams, Connection conn) throws RemoteException,ITMException
{
String lsEmpCode = "", lsLoanNo = "", lsIntTerm = "", lsFindStr = "", ls_String = "", lsSchemeNo = "",
lsErrstr = "" , lsPrd = "", lsSuccstr = "", lsFilename = "", lsSeverity = "I", intTermPrv = "", refNo = "", refType = "";
int llRows = 0, llCnt = 0, llRows1 = 0, ll_rowcnt = 0 , llDetRow = 0;
Timestamp ldStartreco = null, ldBalDate = null, ldFrom = null, ldFrom1 = null, ldTo = null, chgDate = null, ldFrdt = null;
Timestamp ldInterestDate = null, ldIssue = null , ldRelieve = null, ldTodate = null, refDate = null;
double lcBalAmt = 0.0, lcIntPerc = 0.0, lcIntAmt = 0.0 , lcLoanAmt = 0.0, amount = 0.0, intPercPrv = 0.0,
intAmtPrv = 0.0, intAmtDiff = 0.0;
int liNoDays = 0 , liPyrl = 0, liLogfile_ptr = 0, liFilewrite = 0;
int lineNo = 0;
String errCode = "", errString = "", sql = "";
String confirmed = "", chgUser = "", chgTerm = "";
String empFname = "", empLname = "", schDescr = "";
String loginCode = "" , termId = "";
PreparedStatement pstmt = null;
PreparedStatement pstmtPayrollCnt = null;
PreparedStatement pstmtLoanRegCnt = null;
PreparedStatement pstmtLoanIntDel = null;
PreparedStatement pstmtInsertLonsInt = null;
PreparedStatement pstmtLoanIntDetDel = null;
PreparedStatement pstmtInsertLonsIntDet = null;
ResultSet rs = null;
ResultSet rsPayrollCnt = null;
ResultSet rsLoanRegCnt = null;
//ResultSet rsLoanIntDel = null;
Map lstr_ret = null;
Map intrstPrcDetMap = null;
Map dwLoansMap = null;
Map cursorMap = null;
Map intrstPrcMap = null;
HashMap dwLoanInfoMap = null;
ITMDBAccessEJB itmDBAccess = new ITMDBAccessEJB();
HashMap dwInterestDetMap = null;
HashMap dwInterestMap = null;
try {
System.out.println("--------Inside Try Block of InterestProcess empLoanIntProc method---------");
loginCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode");
chgDate = utilmethod.dateTime(utilmethod.today(), utilmethod.now());
chgUser = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"userId");
chgTerm = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"termId");
if (loginCode == null || loginCode.trim().length() == 0)
{
loginCode = "SYSTEM";
}
if (termId == null || termId.trim().length() == 0)
{
termId = "SYSTEM";
}
dwInterestMap = new HashMap();
dwInterestDetMap = new HashMap();
// dw_interest.retrieve()
sql = "SELECT count(*) as count" +
" FROM loans_interest, loans, employee, loan_scheme" +
" WHERE ( loans_interest.loan_no = loans.loan_no ) and" +
" ( loans.emp_code = employee.emp_code ) and" +
" ( loans.scheme_no = loan_scheme.scheme_no ) and" +
" ( ( loans_interest.loan_no >= ? and loans_interest.loan_no <= ? ) AND" +
" ( loans.emp_code >= ? and loans.emp_code <= ? ) AND" +
" ( nvl( loans_interest.confirmed , 'N' ) <> 'Y' ) AND" +
" ( employee.pay_site between ? and ? ) AND" +
" ( employee.proc_group between ? and ? ) )";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loanFr);
pstmt.setString(2, loanTo);
pstmt.setString(3, empFr);
pstmt.setString(4, empTo);
pstmt.setString(5, siteFr);
pstmt.setString(6, siteTo);
pstmt.setString(7, procGrpFr);
pstmt.setString(8, procGrpTo);
rs = pstmt.executeQuery();
int cnt = 0;
if(rs.next())
{
cnt = rs.getInt("count");
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt > 0 && "N".equalsIgnoreCase(overWrite))
{
errString = itmDBAccess.getErrorString("", "VTDATA", "", "", conn);
return errString;
}
sql = "SELECT FR_DATE, TO_DATE FROM PERIOD WHERE CODE = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, prdCode);
rs = pstmt.executeQuery();
if(rs.next())
{
ldFrom1 = rs.getTimestamp("fr_date");
ldTo = rs.getTimestamp("to_date");
}
else
{
errString = itmDBAccess.getErrorString("", "VTPRD1", "", "", conn);
return errString;
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
// dw_loans.retrieve()
dwLoansMap = new HashMap();
//dwLoanInfoMap = new HashMap<>();
sql = "SELECT EMPLOYEE.EMP_CODE, LOANS.LOAN_NO, LOANS.START_RECO, LOANS.INT_TERM, LOANS.BALANCE_AMT, LOANS.DATE__BALANCE, LOANS.INTEREST," +
" LOANS.DATE__INTEREST, LOANS.SCHEME_NO, LOANS.LOAN_AMT, LOANS.ISSUE_DATE, EMPLOYEE.RELIEVE_DATE FROM LOANS, EMPLOYEE" +
" WHERE ( LOANS.EMP_CODE = EMPLOYEE.EMP_CODE ) AND" +
" ( ( LOANS.LOAN_NO >= ? ) AND" +
" ( LOANS.LOAN_NO <= ?) AND" +
" ( LOANS.EMP_CODE >= ? ) AND" +
" ( LOANS.EMP_CODE <= ? ) AND" +
" (( LOANS.STATUS = 'A' ) OR" +
" ( LOANS.STATUS = 'E' AND (SELECT COUNT(1) FROM LOAN_REG WHERE LOAN_REG.LOAN_NO = LOANS.LOAN_NO" +
" AND CASE WHEN LOAN_REG.INT_CALCULATED IS NULL THEN 'N' ELSE LOAN_REG.INT_CALCULATED END <> 'Y') > 0 ))" +
" AND ( EMPLOYEE.PAY_SITE BETWEEN ? AND ? ) AND" +
" ( EMPLOYEE.PROC_GROUP BETWEEN ? AND ? ) )" +
" AND CASE WHEN LOANS.INTEREST IS NULL THEN 0 ELSE LOANS.INTEREST END <> 0" +
" AND (EMPLOYEE.RELIEVE_DATE IS NULL OR EMPLOYEE.RELIEVE_DATE >= ?)" +
" ORDER BY LOANS.EMP_CODE ASC, LOANS.ISSUE_DATE ASC";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loanFr);
pstmt.setString(2, loanTo);
pstmt.setString(3, empFr);
pstmt.setString(4, empTo);
pstmt.setString(5, siteFr);
pstmt.setString(6, siteTo);
pstmt.setString(7, procGrpFr);
pstmt.setString(8, procGrpTo);
pstmt.setTimestamp(9, ldFrom1);
rs = pstmt.executeQuery();
int cnt2 = 0;
while(rs.next())
{
cnt2++;
dwLoanInfoMap = new HashMap();
lsLoanNo = checkNull(rs.getString("loan_no"));
dwLoanInfoMap.put("emp_code", checkNull(rs.getString("emp_code")));
dwLoanInfoMap.put("loan_no", lsLoanNo);
dwLoanInfoMap.put("start_reco", rs.getTimestamp("start_reco"));
dwLoanInfoMap.put("int_term", checkNull(rs.getString("int_term")));
dwLoanInfoMap.put("balance_amt", ((Double) rs.getDouble("balance_amt")).doubleValue());
dwLoanInfoMap.put("date__balance", rs.getTimestamp("date__balance"));
dwLoanInfoMap.put("interest", ((Double) rs.getDouble("interest")).doubleValue());
dwLoanInfoMap.put("date__interest", rs.getTimestamp("date__interest"));
dwLoanInfoMap.put("scheme_no", checkNull(rs.getString("scheme_no")));
dwLoanInfoMap.put("loan_amt", ((Double) rs.getDouble("loan_amt")).doubleValue());
dwLoanInfoMap.put("issue_date", rs.getTimestamp("issue_date"));
dwLoanInfoMap.put("relieve_date", rs.getTimestamp("relieve_date"));
System.out.println("dwLoanInfoMap:::: " + dwLoanInfoMap);
dwLoansMap.put(lsLoanNo, dwLoanInfoMap);
dwLoanInfoMap = null;
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt2 == 0)
{
if(isProcMode != null && "D".equalsIgnoreCase(isProcMode))
{
errString = itmDBAccess.getErrorString("", "VTINTCALC2", "", "", conn);
}
return errString;
}
logWriter.setTotalRows(0);
logWriter.setRowsProcessed(0);
logWriter.setRowsIgnored(0);
logWriter.setRowsRejected(0);
lstr_ret = new HashMap();
sql = "select count(*) as cnt from payroll where emp_code = ? and prd_code >= ? and voucher_no is not null";
pstmtPayrollCnt = conn.prepareStatement(sql);
sql = "select count( loan_no ) as cnt from loan_int_reg where loan_no = ?";
pstmtLoanRegCnt = conn.prepareStatement(sql);
sql = "delete from loans_interest_det a where a.loan_no = ? and (select count(1) from loans_interest b where b.loan_no = a.loan_no and b.prd_code = a.prd_code and nvl( confirmed , 'N' ) <> 'Y') > 0";
pstmtLoanIntDetDel = conn.prepareStatement(sql);
sql = "delete from loans_interest a where a.loan_no = ? and nvl( confirmed , 'N' ) <> 'Y'";
pstmtLoanIntDel = conn.prepareStatement(sql);
sql = "insert into loans_interest( loan_no , prd_code , date__from , date__to , no_days ," +
" int_term , int_perc , amount , interest_amt , confirmed ," +
" chg_date , chg_user , chg_term )" +
" values ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? )";
pstmtInsertLonsInt = conn.prepareStatement(sql);
llRows = cnt2;
Object[] loansArray = dwLoansMap.keySet().toArray();
for(llCnt = 0; llCnt < llRows; llCnt++)
{
String jobId = logWriter.getJobID();
if(jobId != null && jobId.trim().length() > 0)
{
if(admCommon.gfJobTerminateRequested(jobId, conn))
{
logWriter.setJobTerminateRequested("Y");
break;
}
}
errCode = "";
lcBalAmt = 0.0;
dwInterestMap.clear();
dwInterestDetMap.clear();
lsLoanNo = Array.get(loansArray,llCnt).toString();
dwLoanInfoMap = (HashMap) dwLoansMap.get(lsLoanNo);
lsSchemeNo = checkNull((String) dwLoanInfoMap.get("scheme_no"));
lcIntPerc = ((Double) dwLoanInfoMap.get("interest")).doubleValue();
ldStartreco = (Timestamp) dwLoanInfoMap.get("start_reco");
lsIntTerm = checkNull((String) dwLoanInfoMap.get("int_term"));
lcBalAmt = ((Double) dwLoanInfoMap.get("balance_amt")).doubleValue();
ldBalDate = (Timestamp) dwLoanInfoMap.get("date__balance");
ldInterestDate = (Timestamp) dwLoanInfoMap.get("date__interest");
ldIssue = (Timestamp) dwLoanInfoMap.get("issue_date");
ldRelieve = (Timestamp) dwLoanInfoMap.get("relieve_date");
lsEmpCode = checkNull((String) dwLoanInfoMap.get("emp_code"));
lcLoanAmt = ((Double) dwLoanInfoMap.get("loan_amt")).doubleValue();
System.out.println("ldInterestDate===> " +ldInterestDate);
logWriter.setTotalRows(logWriter.getTotalRows()+1);
while (1 == 1)
{
liPyrl = 0;
if(isProcMode == null || !"F".equalsIgnoreCase(isProcMode))
{
pstmtPayrollCnt.setString(1, lsEmpCode);
pstmtPayrollCnt.setString(2, prdCode);
rsPayrollCnt = pstmtPayrollCnt.executeQuery();
while (rsPayrollCnt.next())
{
liPyrl = rsPayrollCnt.getInt("cnt");
}
rsPayrollCnt.close();
pstmtPayrollCnt.clearParameters();
if(liPyrl > 0)
{
/*errCode = "VTPAYCONF";
break;*/
errString = itmDBAccess.getErrorString("", "VTPAYCONF", "", "", conn);
return errString;
}
}
pstmtLoanRegCnt.setString(1, lsLoanNo);
rsLoanRegCnt = pstmtLoanRegCnt.executeQuery();
ll_rowcnt = 0;
if(rsLoanRegCnt.next())
{
ll_rowcnt = rsLoanRegCnt.getInt("cnt");
}
rsLoanRegCnt.close();
pstmtLoanRegCnt.clearParameters();
if(ll_rowcnt == 0)
{
ldFrom = ldInterestDate;
}
else
{
ldFrom = utilmethod.dateTime(utilmethod.RelativeDate(utilmethod.dateTime(ldInterestDate), 1));
System.out.println("ldFrom == "+ldFrom);
}
if(ldRelieve != null && ldRelieve.before(ldTo))
{
ldTodate = ldRelieve;
if((ldFrom.after(ldTodate) || ldFrom.equals(ldTodate)) && ll_rowcnt == 0)
{
break;
}
}
else
{
ldTodate = ldTo;
}
lstr_ret.clear();
System.out.println("ldFrom = "+ldFrom+" ldToDate = "+ldTodate);
if(ldFrom.before(ldTodate) || ldFrom.equals(ldTodate))
{
lstr_ret = calcIntOnLoan(lsLoanNo, ldIssue, lsIntTerm, lcIntPerc, ldInterestDate, ldFrom1, ldTodate, prdCode, dwInterestDetMap, lcLoanAmt, lcBalAmt, xtraParams, conn);
System.out.println("1. lstr_ret returned from calcIntOnLoan method == "+lstr_ret);
errCode = (String) lstr_ret.get("ERRORCODE");
System.out.println("1. ERRORCODE returned from calcIntOnLoan method = " + errCode);
lcIntAmt = ((Double) lstr_ret.get("interest")).doubleValue();
System.out.println("1. LcInterestAmt returned from calcIntOnLoan method = " + lcIntAmt);
dwInterestDetMap = (HashMap) lstr_ret.get("dw_interest_det");
//dwInterestDetMap = (HashMap) lstr_ret.put("dw_interest_det",dwInterestDetMap);
System.out.println("1. dwInterestDetMap returned from calcIntOnLoan method === " + dwInterestDetMap);
if(errCode != null && errCode.trim().length() > 0)
{
break;
}
}
else
{
break;
}
pstmtLoanIntDetDel.setString(1, lsLoanNo);
int intDetDelCnt = pstmtLoanIntDetDel.executeUpdate();
pstmtLoanIntDetDel.clearParameters();
System.out.println("Data deleted from loans_interest_det successfully: [" + intDetDelCnt + "]");
pstmtLoanIntDel.setString(1, lsLoanNo);
int intDelCnt = pstmtLoanIntDel.executeUpdate();
pstmtLoanIntDel.clearParameters();
System.out.println("Data deleted from loans_interest successfully: [" + intDelCnt + "]");
chgDate = utilmethod.dateTime(utilmethod.today(), utilmethod.now());
pstmtInsertLonsInt.setString(1, lsLoanNo);
pstmtInsertLonsInt.setString(2, prdCode);
pstmtInsertLonsInt.setTimestamp(3, ldFrom1);
pstmtInsertLonsInt.setTimestamp(4, ldTo);
pstmtInsertLonsInt.setDouble(5, liNoDays);
pstmtInsertLonsInt.setString(6, lsIntTerm);
pstmtInsertLonsInt.setDouble(7, lcIntPerc);
pstmtInsertLonsInt.setDouble(8, lcBalAmt);
pstmtInsertLonsInt.setDouble(9, lcIntAmt);
pstmtInsertLonsInt.setString(10, "N");
pstmtInsertLonsInt.setTimestamp(11, chgDate);
pstmtInsertLonsInt.setString(12, loginCode);
pstmtInsertLonsInt.setString(13, chgTerm);
int updCnt = pstmtInsertLonsInt.executeUpdate();
pstmtInsertLonsInt.clearParameters();
if(updCnt == 1)
{
System.out.println("Data inserted into loans interest table successfully : ["+updCnt+" ]");
//conn.commit();
lineNo = 1;
sql = "Insert into loans_interest_det (prd_code, loan_no, line_no, date__from, date__to, no_days, int_term__prev, int_term, int_perc__prev,"
+ " int_perc, amount, interest_amt__prev, interest_amt, interest_amt__diff, ref_type, ref_no, ref_date, chg_date, chg_user, chg_term)"
+ " values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
pstmtInsertLonsIntDet = conn.prepareStatement(sql);
pstmtInsertLonsIntDet.setString(1, prdCode);
pstmtInsertLonsIntDet.setString(2, lsLoanNo);
pstmtInsertLonsIntDet.setInt(3, lineNo++);
pstmtInsertLonsIntDet.setTimestamp(4, ldFrom1);
pstmtInsertLonsIntDet.setTimestamp(5, ldTodate);
pstmtInsertLonsIntDet.setInt(6, liNoDays);
pstmtInsertLonsIntDet.setString(7, lsIntTerm);
pstmtInsertLonsIntDet.setString(8, lsIntTerm);
pstmtInsertLonsIntDet.setDouble(9, lcIntPerc);
pstmtInsertLonsIntDet.setDouble(10, lcIntPerc);
pstmtInsertLonsIntDet.setDouble(11, lcBalAmt);
pstmtInsertLonsIntDet.setDouble(12, 0);
pstmtInsertLonsIntDet.setDouble(13, lcIntAmt);
pstmtInsertLonsIntDet.setDouble(14, lcIntAmt);
pstmtInsertLonsIntDet.setString(15, "N");
pstmtInsertLonsIntDet.setString(16, refNo);
pstmtInsertLonsIntDet.setTimestamp(17, refDate);
pstmtInsertLonsIntDet.setTimestamp(18, chgDate);
pstmtInsertLonsIntDet.setString(19,loginCode);
pstmtInsertLonsIntDet.setString(20,chgTerm);
int updIntDetMapCnt = pstmtInsertLonsIntDet.executeUpdate();
pstmtInsertLonsIntDet.clearParameters();
if(updIntDetMapCnt == 1)
{
System.out.println("Data inserted into loans_interest_det table successfully : ["+updIntDetMapCnt+" ]");
//conn.commit();
errCode = null;
errCode = loanConfirm(lsLoanNo, ldFrom1, ldTo, lcIntAmt, lsSchemeNo, lsEmpCode, 1, "Y", xtraParams, conn);
}
}
else if(updCnt != 1)
{
System.out.println("Data insertion into loans interest table Failed..");
errString = itmDBAccess.getErrorString("", "DS000NR", "", "", conn);
return errString;
}
// HashMap interestDetMap = (HashMap) lstr_ret.put("dw_interest_det", dwInterestDetMap);
// System.out.println("the values inside interestDetMap = "+interestDetMap);
/*int updIntDetMapCnt = dwInterestDetMap.size();
if(updIntDetMapCnt == 1)
{
errCode = null;
errCode = loanConfirm(lsLoanNo, ldFrom1, ldTo, lcIntAmt, lsSchemeNo, lsEmpCode, 1, "Y", xtraParams, conn);
}*/
else
{
break;
}
break;
}
if(errCode != null && errCode.trim().length() > 0)
{
System.out.println("Errorcode is = "+errCode);
errString = errString + "Employee Code : "+lsEmpCode.trim()+ " Loan No. : "+lsLoanNo.trim()+ " - "+errCode;
logWriter.setStatusDetail(errString);
logWriter.setErrorCode("");
logWriter.setStatusType("E");
conn.rollback();
logWriter.setRowsRejected(logWriter.getRowsRejected() + 1);
return errString;
//continue;
}
else
{
lsSuccstr = "Emp : "+lsEmpCode.trim()+ " Loan No. : "+lsLoanNo+ " - Interest Process Completed";
logWriter.setStatusDetail(lsSuccstr);
logWriter.setErrorCode("");
logWriter.setStatusType("I");
conn.commit();
logWriter.setRowsRejected(logWriter.getRowsRejected() + 1);
}
}
if(logWriter.getJobTerminateRequested() == "Y")
{
logWriter.setStatusDetail("Interest Process Terminated on request");
logWriter.setErrorCode("");
logWriter.setStatusType("I");
}
}
catch (Exception e)
{
System.out.println("Exception in InterestProcess : empLoanIntProc "+ e.getMessage() + ":");
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)
{
errString = e.getMessage();
e.printStackTrace();
throw new ITMException(e);
}
}
return errString;
}
//calcIntOnReco = gbf_calc_int_on_reco
public Map calcIntOnReco(String asLoanNo, String asIntTerm, double acIntPerc, Timestamp adLastIntDate, Timestamp adFrDt, Timestamp adToDt,
String asPrdCode, HashMap adsIntDet, String xtraParams, Connection conn) throws RemoteException, ITMException
{
double lcInt = 0.0, lcRecoAmt = 0.0, lcTotInt = 0.0;
Timestamp ldRecoDate = null, ldToDt = null, ldFromDt = null, ldRefDate = null, ldToday = null, ldIssuDate= null;
int liCount = 0, liSign = 1, liNoDays = 0, liLineNo = 0;
String lsRecoNo = "", lsRefSer = "", lsRefNo = "", lsErrCode= "";
int ll_row = 0;
PreparedStatement pstmt = null;
ResultSet rs = null;
Map lstrRet = null;
String sql = "", chgUser = "", chgTerm = "";
try
{
System.out.println("*** Inside calcIntOnReco method ***");
chgUser = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"userId");
chgTerm = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"termId");
lstrRet = new HashMap<>();
while(1==1)
{
sql = "select issue_date from loans where loan_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, asLoanNo);
rs = pstmt.executeQuery();
if(rs.next())
{
ldIssuDate = rs.getTimestamp("issue_date");
lsErrCode = "DS000";
lstrRet.put("ls_errcode" , lsErrCode);
return lstrRet;
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
sql = "select max(line_no) from loans_interest_det where prd_code = ? and loan_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, asPrdCode);
pstmt.setString(2, asLoanNo);
rs = pstmt.executeQuery();
if(rs.next())
{
liLineNo = rs.getInt("line_no");
lsErrCode = "DS000";
lstrRet.put("ls_errcode" , lsErrCode);
return lstrRet;
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
sql = "select count(*) as count from loan_reco where loan_no = ? "
+ "and (int_calculated is null or int_calculated <> 'Y') and confirmed = 'Y'";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, asLoanNo);
rs = pstmt.executeQuery();
if(rs.next())
{
liCount = rs.getInt("count");
lsErrCode = "DS000";
lstrRet.put("ls_errcode" , lsErrCode);
return lstrRet;
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
sql = "select reco_no, reco_date, tran_ser__pay, ref_no__pay, reco_amt from loan_reco where loan_no = ? "
+ "and (int_calculated is null or int_calculated <> 'Y') and confirmed = 'Y' ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, asLoanNo);
rs = pstmt.executeQuery();
if(rs.next())
{
lsRecoNo = checkNull(rs.getString("reco_no"));
ldRecoDate = rs.getTimestamp("reco_date");
lsRefSer = checkNull(rs.getString("tran_ser__pay"));
lsRefNo = checkNull(rs.getString("ref_no__pay"));
lcRecoAmt = ((Double) rs.getDouble("reco_amt")).doubleValue();
lsErrCode = "DS000";
lstrRet.put("ls_errcode" , lsErrCode);
return lstrRet;
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if((lsRefSer != null && lsRefSer.trim().length() > 0) && (lsRefNo != null && lsRefNo.trim().length() > 0))
{
sql = "select ref_date from misc_payables where tran_ser = ? and ref_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsRefSer);
pstmt.setString(2, lsRefNo);
rs = pstmt.executeQuery();
if(rs.next())
{
ldRecoDate = rs.getTimestamp("ref_date");
lsErrCode = "DS000NR";// ~t Ref series or ref.no. not found in misc_payable table";
lstrRet.put("ls_errcode" , lsErrCode);
return lstrRet;
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
liSign = 1;
ldRefDate = ldRecoDate;
if(ldRecoDate.before(adLastIntDate) || ldRecoDate.equals(adLastIntDate))
{
ldFromDt = ldRecoDate;
ldToDt = adLastIntDate;
liSign = -1;
}
else if(ldRecoDate.after(adLastIntDate))
{
if(adLastIntDate.equals(ldIssuDate))
{
ldFromDt = adLastIntDate;
}
else
{
ldFromDt = utilmethod.dateTime(utilmethod.RelativeDate(utilmethod.date(adLastIntDate), 1));
System.out.println("From Date == "+ldFromDt);
}
ldToDt = ldRecoDate;
liSign = 1;
}
if(ldFromDt.before(ldToDt) || ldFromDt.equals(ldToDt))
{
liNoDays = utilmethod.DaysAfter(utilmethod.date(ldFromDt), utilmethod.date(ldToDt)) + 1;
lcInt = admCommon.gbfCalcInterest(asIntTerm, liNoDays, acIntPerc, lcRecoAmt, conn);
if(lcInt == -1)
{
lsErrCode = "VTINTCALC1";
lstrRet.put("ls_errcode" , lsErrCode);
return lstrRet;
}
if(lsRefNo == null)
{
lsRefNo = lsRecoNo;
lsRefSer = "LNRECO";
}
lcInt = lcInt * liSign;
lcTotInt = lcTotInt + lcInt;
liLineNo = liLineNo + 1;
System.out.println("lcInt == "+lcInt+" lcTotInt == "+lcTotInt+" liLineNo == "+liLineNo);
ldToday = utilmethod.dateTime(utilmethod.today(),utilmethod.now());
adsIntDet = new HashMap<>();
adsIntDet.put("prd_code", asPrdCode);
adsIntDet.put("loan_no", asLoanNo);
adsIntDet.put("line_no", liLineNo);
adsIntDet.put("date__from", ldFromDt);
adsIntDet.put("date__to", ldToDt);
adsIntDet.put("no_days", liNoDays);
adsIntDet.put("int_term__prev", "");
adsIntDet.put("int_term", asIntTerm);
adsIntDet.put("int_perc__prev", 0);
adsIntDet.put("int_perc", ((Double) acIntPerc).doubleValue());
adsIntDet.put("amount", ((Double) lcRecoAmt).doubleValue());
adsIntDet.put("interest_amt__prev", 0);
adsIntDet.put("interest_amt", ((Double) lcInt).doubleValue());
adsIntDet.put("interest_amt__diff", ((Double) lcInt).doubleValue());
adsIntDet.put("ref_type", "LNRECO");
adsIntDet.put("ref_no", lsRecoNo);
adsIntDet.put("ref_date", ldRefDate);
adsIntDet.put("chg_date", ldToday);
adsIntDet.put("chg_term", chgTerm);
adsIntDet.put("chg_user", chgUser);
/*String strPrimKey = asPrdCode.trim() + asLoanNo.trim() + liLineNo;
lstrRet.put(strPrimKey, adsIntDet);*/
lstrRet.put("dwAdsIntDet", adsIntDet);
sql = "update loan_reco set int_calculated = 'Y' where reco_no = ? and (int_calculated is null or int_calculated <> 'Y') and confirmed = 'Y' ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsRecoNo);
int updCnt = pstmt.executeUpdate();
if(updCnt == 0)
{
lsErrCode = "DS000NR";// ~t Updation failed in loan_reco table";
lstrRet.put("ls_errcode" , lsErrCode);
return lstrRet;
}
}
}
}
catch (Exception e)
{
System.out.println("Exception in InterestProcess : calcIntOnReco "+ e.getMessage() + ":");
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();
throw new ITMException(e);
}
}
//return lstrRet;
}
//calcIntOnLoan = gbf_calc_int_on_loan
//lds_loan_reg = ldsLoanRegMap
public Map calcIntOnLoan(String asLoanNo, Timestamp adIssueDate, String asIntTerm, double acIntPerc,
Timestamp adLastIntDate, Timestamp adFrDt, Timestamp adToDt, String asPrdCode, HashMap adsIntDet,
double acLoanAmt, double acLoanBal, String xtraParams, Connection conn) throws RemoteException, ITMException
{
int llRowCnt1 = 0, llRowCnt2 = 0, llRow1 = 0, llRow2 = 0, llRow3 = 0;
int liNoDays = 0, liPrevNoDays = 0, liLineNo = 0;
Timestamp ldFromDate = null, ldTrDt = null, ldTrDt1 = null, ldTrDt2 = null;
Timestamp ldFrDt = null, ldPrevFrDt = null, ldToDt = null, ldPrevToDt = null, chgDate = null;
double lcAmtBal = 0.0, lcPrevAmtBal = 0d, lcIntAmt = 0.0, lcPrevIntAmt = 0d, lcIntPer = 0d, lcPrevIntPer = 0.0,
lcAmtReco = 0.0, lcTrAmt = 0.0, lcIntDiff = 0.0, lcIntDiffTot = 0.0;
String lsErrCode = "", lsFilter1 = "", lsFilter2 = "", lsIntTerm = "", lsPrevIntTerm = "", lsIntCalc = "";
String sql = "", sqlInsrt = "";
String tranNo = "", tranType = "", chgUser = "", chgTerm = "";
PreparedStatement pstmt = null, pstmt1 = null, pstmt2 = null;
PreparedStatement pstmtLoanIntReg = null;
PreparedStatement pstmtLoanReg = null;
PreparedStatement pstmtLoanIntRegInsrt = null;
ResultSet rsLoanReg = null;
ResultSet rs = null, rs1 = null, rs2 = null;
ResultSet rsLoanIntReg = null;
Map ldsLoanRegMap = null;
Map ldsLoanIntRegMap = null;
Map ldsLoanIntReg1Map = null;
Map ldsLoansReg = null;
Map ldsLoansIntReg = null;
Map lstrRet = null;
ArrayList loanRegList = new ArrayList();
ArrayList loanIntRegList = new ArrayList();
StringBuffer xmlBuff=new StringBuffer();
SimpleDateFormat sdfYYYYMMDD = new SimpleDateFormat("yyyy-MM-dd");
ArrayList loanRegKey = new ArrayList();
ArrayList loanIntRegKey = new ArrayList();
int iLastIntDate = 0;
try
{
System.out.println("Inside calcIntOnLoan method----");
System.out.println("Xtraparams == "+xtraParams);
chgUser = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode");
chgTerm = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"termId");
chgDate = utilmethod.dateTime(utilmethod.today(), utilmethod.now());
System.out.println("chgUser = "+chgUser+ " chgTerm = "+chgTerm+ " chgDate = "+chgDate);
String strAdLastIntDate = sdfYYYYMMDD.format(adLastIntDate);
System.out.println("strAdLastIntDate == "+strAdLastIntDate);
Date date = sdfYYYYMMDD.parse(strAdLastIntDate);
System.out.println("date == "+date);
iLastIntDate = (int) date.getTime();
System.out.println("iLastIntDate == "+iLastIntDate);
ldsLoansReg = new HashMap();
ldsLoansIntReg = new HashMap();
lstrRet = new HashMap();
sqlInsrt = "Insert into loan_int_reg (loan_no, from_date, to_date, int_term, int_rate, no_of_days, amount, int_amount, chg_date, chg_user, chg_term) "
+ "values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
pstmtLoanIntRegInsrt = conn.prepareStatement(sqlInsrt);
//Fetched query from datawindow = d_loan_reg
sql = "SELECT loan_reg.loan_no," +
" loan_reg.tran_no," +
" loan_reg.tran_date," +
" loan_reg.tran_type," +
" loan_reg.amount," +
" loan_reg.int_calculated," +
" loan_reg.chg_date," +
" loan_reg.chg_user," +
" loan_reg.chg_term," +
" loan_reg.loan_no as loan_no_o," +
" loan_reg.tran_no as tran_no_o," +
" loan_reg.tran_date as tran_date_o," +
" loan_reg.tran_type as tran_type_o," +
" 0 as row_status" +
" FROM loan_reg" +
" WHERE loan_no = ?" +
" ORDER BY loan_reg.tran_date ASC";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, asLoanNo);
rs = pstmt.executeQuery();
int loanRegCnt = 0;
double loanRegAmt = 0d;
double loanRegTotAmt = 0d;
while(rs.next())
{
loanRegCnt++;
asLoanNo = checkNull(rs.getString("loan_no"));
tranNo = checkNull(rs.getString("tran_no"));
ldTrDt = rs.getTimestamp("tran_date");
String strTranDate = sdfYYYYMMDD.format(ldTrDt);
loanRegAmt = ((Double) rs.getDouble("amount")).doubleValue();
loanRegTotAmt = loanRegTotAmt + loanRegAmt;
System.out.println("loanRegTotAmt = "+loanRegTotAmt);
ldsLoanRegMap = new HashMap();
ldsLoanRegMap.put("loan_no", asLoanNo);
ldsLoanRegMap.put("tran_no", tranNo);
ldsLoanRegMap.put("tran_date", ldTrDt);
ldsLoanRegMap.put("tran_type", checkNull(rs.getString("tran_type")));
ldsLoanRegMap.put("amount", loanRegAmt);
ldsLoanRegMap.put("int_calculated", rs.getString("int_calculated"));
ldsLoanRegMap.put("chg_date", rs.getTimestamp("chg_date"));
ldsLoanRegMap.put("chg_user", checkNull(rs.getString("chg_user")));
ldsLoanRegMap.put("chg_term", checkNull(rs.getString("chg_term")));
ldsLoanRegMap.put("loan_no_o", asLoanNo);
ldsLoanRegMap.put("tran_no_o", tranNo);
ldsLoanRegMap.put("tran_date_o", ldTrDt);
ldsLoanRegMap.put("tran_type_o ", checkNull(rs.getString("tran_type")));
ldsLoanRegMap.put("row_status", 0);
System.out.println("ldsLoanRegMap:::: " + ldsLoanRegMap);
ldsLoansReg.put(strTranDate + tranNo.trim(), ldsLoanRegMap);
loanRegKey.add(strTranDate + tranNo.trim());
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
lcAmtBal = acLoanAmt;
lcIntPer = acIntPerc;
System.out.println("lcAmtBal = "+lcAmtBal+" lcIntPer = "+lcIntPer);
System.out.println("acLoanBal = "+acLoanBal);
System.out.println("loanRegCnt = "+loanRegCnt);
if(loanRegCnt < 1)
{
if(acLoanAmt != acLoanBal)
{
System.out.println("Errr!!!");
lsErrCode = "VTLNBAL1"; //Loan Balance Do Not Match With Loan Reg. Table For Loan No.
lstrRet.put("ERRORCODE" , lsErrCode);
lstrRet.put("interest" , 0.0);
lstrRet.put("dw_interest_det" , adsIntDet);
//lstrRet.put("dw_interest_det" , ldsLoansReg);
return lstrRet;
}
}
else
{
lcAmtBal = acLoanAmt - loanRegTotAmt;
System.out.println("lcAmountBalance = "+lcAmtBal+" \nAcLoanAmount = "+acLoanAmt+" \nLoanRegTotalAmount = "+loanRegTotAmt);
System.out.println("lcAmtBal after acLoanAmt - LoanRegTotAmt = "+lcAmtBal);
if (lcAmtBal != acLoanBal)
{
lsErrCode = "VTLNBAL1"; //Loan Balance Do Not Match With Loan Reg. Table For Loan No.
lstrRet.put("ERRORCODE" , lsErrCode);
lstrRet.put("interest" , 0.0);
lstrRet.put("dw_interest_det" , adsIntDet);
//lstrRet.put("dw_interest_det" , ldsLoansReg);
return lstrRet;
}
}
//Fetched query from datawindow = d_loan_int_reg
sql = "SELECT loan_int_reg.loan_no," +
" from_date as o_from_date," +
" to_date as o_to_date," +
" int_term as o_int_term," +
" int_rate as o_int_rate," +
" no_of_days as o_no_of_days," +
" amount as o_amount," +
" int_amount as o_int_amount," +
" loan_int_reg.from_date," +
" loan_int_reg.to_date," +
" loan_int_reg.int_term," +
" loan_int_reg.int_rate," +
" loan_int_reg.no_of_days," +
" loan_int_reg.amount," +
" loan_int_reg.int_amount," +
" loan_int_reg.chg_date," +
" loan_int_reg.chg_user," +
" loan_int_reg.chg_term ," +
" loan_int_reg.loan_no as loan_no_o," +
" from_date as from_date_o," +
" 0 as row_status" +
" FROM loan_int_reg" +
" WHERE loan_no = ? order by from_date";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, asLoanNo);
rs = pstmt.executeQuery();
int intRegRowNo = 0;
Timestamp intFromDate = null;
Timestamp intToDate = null;
Timestamp intMaxToDate = null;
while(rs.next())
{
ldsLoanIntRegMap = new HashMap<>();
intRegRowNo = intRegRowNo + 1;
ldFromDate = rs.getTimestamp("from_date");
intToDate = rs.getTimestamp("to_date");
if (intRegRowNo == 1 )
{
intMaxToDate = intToDate;
}
else if(intToDate.after(intMaxToDate))
{
intMaxToDate = intToDate;
}
String strIntFromDate = sdfYYYYMMDD.format(ldFromDate);
ldsLoanIntRegMap.put("loan_no", checkNull(rs.getString("loan_no")));
ldsLoanIntRegMap.put("o_from_date", rs.getTimestamp("from_date"));
ldsLoanIntRegMap.put("o_to_date", rs.getTimestamp("to_date"));
ldsLoanIntRegMap.put("o_int_term", checkNull(rs.getString("int_term")));
ldsLoanIntRegMap.put("o_int_rate", ((Double) rs.getDouble("int_rate")).doubleValue());
ldsLoanIntRegMap.put("o_no_of_days", ((Double) rs.getDouble("no_of_days")).doubleValue());
ldsLoanIntRegMap.put("o_amount", ((Double) rs.getDouble("amount")).doubleValue());
ldsLoanIntRegMap.put("from_date", ldFromDate);
ldsLoanIntRegMap.put("to_date", rs.getTimestamp("to_date"));
ldsLoanIntRegMap.put("int_term", checkNull(rs.getString("int_term")));
ldsLoanIntRegMap.put("int_rate", ((Double) rs.getDouble("int_rate")).doubleValue());
ldsLoanIntRegMap.put("no_of_days", ((Double) rs.getDouble("no_of_days")).doubleValue());
ldsLoanIntRegMap.put("amount", ((Double) rs.getDouble("amount")).doubleValue());
ldsLoanIntRegMap.put("int_amount", ((Double) rs.getDouble("int_amount")).doubleValue());
ldsLoanIntRegMap.put("chg_date", rs.getTimestamp("chg_date"));
ldsLoanIntRegMap.put("chg_user", checkNull(rs.getString("chg_user")));
ldsLoanIntRegMap.put("chg_term", checkNull(rs.getString("chg_term")));
ldsLoanIntRegMap.put("row_status", 0);
System.out.println("ldsLoanIntRegMap:::: " + ldsLoanIntRegMap);
ldsLoansIntReg.put(strIntFromDate, ldsLoanIntRegMap);
loanIntRegKey.add(strIntFromDate);
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(intMaxToDate == null)
{
ldFromDate = adLastIntDate;
}
else if(!adLastIntDate.equals(intMaxToDate))
{
lsErrCode = "VTINTDT1";//Last Date Of Interest Do Not Match With Loan Interest Reg. Table For Loan No.
lstrRet.put("ERRORCODE" , lsErrCode);
lstrRet.put("interest" , 0.0);
lstrRet.put("dw_interest_det" , adsIntDet);
//lstrRet.put("dw_interest_det" , ldsLoansIntReg);
return lstrRet;
}
else
{
ldFromDate = utilmethod.RelativeDate(adLastIntDate, 1);
System.out.println("ldFromDate=== > "+ldFromDate);
}
if(loanRegCnt < 1)
{
liNoDays = (int) (utilmethod.DaysAfter(ldFromDate, adToDt) + 1);
lcIntAmt = admCommon.gbfCalcInterest(asIntTerm, liNoDays, lcIntPer, lcAmtBal, conn);
System.out.println("Value of lcIntAmt = "+lcIntAmt);
pstmtLoanIntRegInsrt.setString(1, asLoanNo);
pstmtLoanIntRegInsrt.setTimestamp(2, ldFromDate);
pstmtLoanIntRegInsrt.setTimestamp(3, adToDt);
pstmtLoanIntRegInsrt.setString(4, asIntTerm);
pstmtLoanIntRegInsrt.setDouble(5, lcIntPer);
pstmtLoanIntRegInsrt.setInt(6, liNoDays);
pstmtLoanIntRegInsrt.setDouble(7, lcAmtBal);
pstmtLoanIntRegInsrt.setDouble(8, lcIntAmt);
pstmtLoanIntRegInsrt.setTimestamp(9, chgDate);
pstmtLoanIntRegInsrt.setString(10, chgUser);
pstmtLoanIntRegInsrt.setString(11, chgTerm);
llRowCnt2 = pstmtLoanIntRegInsrt.executeUpdate();
pstmtLoanIntRegInsrt.clearParameters();
if(llRowCnt2 == 0)
{
lsErrCode = "Error";
lstrRet.put("ERRORCODE" , lsErrCode);
lstrRet.put("interest" , 0.0);
lstrRet.put("dw_interest_det" , adsIntDet);
//lstrRet.put("dw_interest_det" , ldsLoansIntReg);
return lstrRet;
}
else
{
System.out.println("Data Inserted into loans_int_reg table successfully ["+llRowCnt2+"]");
//conn.commit();
}
}
int keySize = loanRegKey.size();
int keySizeLoanIntReg = loanIntRegKey.size();
int iTranDate = 0;
int iToDate = 0;
lcAmtReco = 0d;
double lcRegAmt = 0d;
Timestamp tsRegTrDate = null;
Timestamp tsRegTrDate1 = null;
Timestamp tsRegTrDate2 = null;
Timestamp tsIntRegToDate = null;
int j = 0;
for (int i = 0; i < keySize; i++)
{
String strLoanRegKey = (String) loanRegKey.get(i);
System.out.println("strLoanRegKey == "+strLoanRegKey);
iTranDate = Integer.parseInt(strLoanRegKey.substring(0 , 7));
if(iTranDate < iLastIntDate)
{
HashMap ldsLoansRegData = (HashMap) ldsLoansReg.get(strLoanRegKey);
String intCalculated = (String) ldsLoansRegData.get("int_calculated");
if (intCalculated != null && intCalculated.equalsIgnoreCase("Y"))
{
continue;
}
lcRegAmt = (double) ldsLoansRegData.get("amount");
tsRegTrDate = (Timestamp) ldsLoansRegData.get("tran_date");
lcAmtReco = lcAmtReco + lcRegAmt;
j = i +1;
if ( j < keySize)
{
String strLoanRegKey1 = (String) loanRegKey.get(j);
HashMap ldsLoansRegData1 = (HashMap) ldsLoansReg.get(strLoanRegKey1);
tsRegTrDate2 = (Timestamp) ldsLoansRegData1.get("tran_date");
if(tsRegTrDate.equals(tsRegTrDate2))
{
ldsLoansRegData.put("int_calculated" , "Y");
ldsLoansRegData.put("chg_date" , chgDate);
ldsLoansRegData.put("chg_user" , chgUser);
ldsLoansRegData.put("chg_term" , chgTerm);
ldsLoansRegData.put("row_status" , 2);
ldsLoansReg.put(strLoanRegKey , ldsLoansRegData);
continue;
}
}
else
{
tsRegTrDate2 = null;
}
// Start
tsRegTrDate1 = utilmethod.RelativeDate(tsRegTrDate, 1);
for(int k = 0; k < keySizeLoanIntReg; k++)
{
String strLoanIntRegKey = (String) loanIntRegKey.get(k);
HashMap ldsLoansIntRegData = (HashMap) ldsLoansIntReg.get(strLoanIntRegKey);
tsIntRegToDate = (Timestamp) ldsLoansIntRegData.get("to_date");
if(tsIntRegToDate.after(tsRegTrDate))
{
ldFrDt = (Timestamp) ldsLoansIntRegData.get("from_date");
ldToDt = (Timestamp) ldsLoansIntRegData.get("to_date");
lcPrevAmtBal = (double) ldsLoansIntRegData.get("amount");
lcPrevIntAmt = (double) ldsLoansIntRegData.get("int_amount");
lcIntPer = (double) ldsLoansIntRegData.get("int_rate");
liNoDays = (int) ldsLoansIntRegData.get("no_of_days");
lsIntTerm = (String) ldsLoansIntRegData.get("int_term");
if(tsRegTrDate1.after(ldFrDt))
{
lcAmtBal = lcPrevAmtBal;
liNoDays = (int) (utilmethod.DaysAfter(ldFrDt, tsRegTrDate) + 1);
lcIntAmt = admCommon.gbfCalcInterest(lsIntTerm, liNoDays, lcIntPer, lcAmtBal, conn);
ldsLoansIntRegData.put("to_date", tsRegTrDate);
ldsLoansIntRegData.put("no_of_days", liNoDays);
ldsLoansIntRegData.put("int_amount", lcIntAmt);
ldsLoansIntRegData.put("chg_date", chgDate);
ldsLoansIntRegData.put("chg_user", chgUser);
ldsLoansIntRegData.put("chg_term", chgTerm);
ldsLoansIntRegData.put("row_status" , 2);
ldsLoansIntReg.put(strLoanIntRegKey, ldsLoansIntRegData);
lcAmtBal = lcAmtBal - lcAmtReco;
liNoDays = (int) (utilmethod.DaysAfter(tsRegTrDate1, ldToDt) + 1);
lcIntAmt = admCommon.gbfCalcInterest(lsIntTerm, liNoDays, lcIntPer, lcAmtBal, conn);
String strLoanIntRegKey1 = sdfYYYYMMDD.format(tsRegTrDate1);
// HashMap ldsLoansIntRegData1 = (HashMap) ldsLoansIntReg.get(strLoanIntRegKey1);
HashMap ldsLoansIntRegData1 = new HashMap();
ldsLoansIntRegData1.put("loan_no", asLoanNo);
ldsLoansIntRegData1.put("from_date", tsRegTrDate1);
ldsLoansIntRegData1.put("to_date", ldToDt);
ldsLoansIntRegData1.put("int_term", lsIntTerm);
ldsLoansIntRegData1.put("int_rate", lcIntPer);
ldsLoansIntRegData1.put("no_of_days", liNoDays);
ldsLoansIntRegData1.put("amount", lcAmtBal);
ldsLoansIntRegData1.put("int_amount", lcIntAmt);
ldsLoansIntRegData1.put("chg_date", chgDate);
ldsLoansIntRegData1.put("chg_user", chgUser);
ldsLoansIntRegData1.put("chg_term", chgTerm);
ldsLoansIntRegData1.put("row_status" , 1);
ldsLoansIntReg.put(strLoanIntRegKey1, ldsLoansIntRegData1);
}
else if(tsRegTrDate1.before(ldFrDt) || tsRegTrDate1.equals(ldFrDt))
{
lcAmtBal = lcPrevAmtBal - lcAmtReco;
lcIntAmt = admCommon.gbfCalcInterest(lsIntTerm, liNoDays, lcIntPer, lcAmtBal, conn);
ldsLoansIntRegData.put("amount", lcAmtBal);
ldsLoansIntRegData.put("int_amount", lcIntAmt);
ldsLoansIntRegData.put("chg_date", chgDate);
ldsLoansIntRegData.put("chg_user", chgUser);
ldsLoansIntRegData.put("chg_term", chgTerm);
ldsLoansIntRegData.put("row_status" , 2);
ldsLoansIntReg.put(strLoanIntRegKey, ldsLoansIntRegData);
}
if(tsRegTrDate2.before(ldToDt))
{
break;
}
}
}
lcAmtBal = 0d;
lcAmtReco = 0d;
lcIntAmt = 0d;
ldsLoansIntReg = (HashMap) admCommon.sortMap((HashMap) ldsLoansIntReg);
loanIntRegKey.clear();
Set<String> keys = ldsLoansIntReg.keySet();
for(String key: keys)
{
loanIntRegKey.add(key);
}
System.out.println("Sorted map loanIntRegSorted = "+ldsLoansIntReg);
ldsLoansRegData.put("int_calculated" , "Y");
ldsLoansRegData.put("chg_date" , chgDate);
ldsLoansRegData.put("chg_user" , chgUser);
ldsLoansRegData.put("chg_term" , chgTerm);
ldsLoansRegData.put("row_status" , 2);
ldsLoansReg.put(strLoanRegKey, ldsLoansRegData);
// End
}
}
lcAmtReco = 0d;
ldFromDate = adLastIntDate;
lcAmtBal = acLoanAmt;
for (int i = 0; i < keySize; i++)
{
String strLoanRegKey = (String) loanRegKey.get(i);
HashMap ldsLoansRegData = (HashMap) ldsLoansReg.get(strLoanRegKey);
tsRegTrDate = (Timestamp) ldsLoansRegData.get("tran_date");
j = i + 1;
if ( j < keySize)
{
String strLoanRegKey1 = (String) loanRegKey.get(j);
HashMap ldsLoansRegData1 = (HashMap) ldsLoansReg.get(strLoanRegKey1);
tsRegTrDate2 = (Timestamp) ldsLoansRegData1.get("tran_date");
}
else
{
tsRegTrDate2 = null;
}
lcTrAmt = (double) ldsLoansRegData.get("amount");
if(tsRegTrDate.before(ldFromDate) || tsRegTrDate.equals(ldFromDate))
{
lcAmtBal = lcAmtBal - lcTrAmt;
ldsLoansRegData.put("int_calculated" , "Y");
ldsLoansRegData.put("chg_date" , chgDate);
ldsLoansRegData.put("chg_user" , chgUser);
ldsLoansRegData.put("chg_term" , chgTerm);
ldsLoansRegData.put("row_status" , 2);
ldsLoansReg.put(strLoanRegKey , ldsLoansRegData);
continue;
}
else if(tsRegTrDate.after(adToDt) || tsRegTrDate.equals(adToDt))
{
break;
}
if(!ldFromDate.equals(adIssueDate))
{
ldFromDate = utilmethod.RelativeDate(ldFromDate, 1);
}
if(lcAmtBal != 0)
{
liNoDays = (int) (utilmethod.DaysAfter(ldFromDate, tsRegTrDate) + 1);
lcIntAmt = admCommon.gbfCalcInterest(asIntTerm, liNoDays, acIntPerc, lcAmtBal, conn);
String strLoanIntRegKey2 = sdfYYYYMMDD.format(ldFromDate);
HashMap ldsLoansIntRegData1 = (HashMap) ldsLoansIntReg.get(strLoanIntRegKey2);
ldsLoansIntRegData1.put("loan_no", asLoanNo);
ldsLoansIntRegData1.put("from_date", ldFromDate);
ldsLoansIntRegData1.put("to_date", tsRegTrDate);
ldsLoansIntRegData1.put("int_term", asIntTerm);
ldsLoansIntRegData1.put("int_rate", acIntPerc);
ldsLoansIntRegData1.put("no_of_days", liNoDays);
ldsLoansIntRegData1.put("amount", lcAmtBal);
ldsLoansIntRegData1.put("int_amount", lcIntAmt);
ldsLoansIntRegData1.put("chg_date", chgDate);
ldsLoansIntRegData1.put("chg_user", chgUser);
ldsLoansIntRegData1.put("chg_term", chgTerm);
ldsLoansIntRegData1.put("row_status" , 1);
ldsLoansIntReg.put(strLoanIntRegKey2, ldsLoansIntRegData1);
}
ldFromDate = tsRegTrDate;
lcAmtBal = lcAmtBal - lcTrAmt;
ldsLoansRegData.put("int_calculated" , "Y");
ldsLoansRegData.put("chg_date" , chgDate);
ldsLoansRegData.put("chg_user" , chgUser);
ldsLoansRegData.put("chg_term" , chgTerm);
ldsLoansRegData.put("row_status" , 2);
ldsLoansReg.put(strLoanRegKey , ldsLoansRegData);
}
sql = "select count(*) as count from loan_int_reg where loan_no = ?";
pstmt1 = conn.prepareStatement(sql);
sql = "select to_date from period where ? between fr_date and to_date";
pstmt2 = conn.prepareStatement(sql);
if(lcAmtBal != 0)
{
while (ldFromDate.before(adToDt))
{
if(!ldFromDate.equals(adIssueDate))
{
ldFromDate = utilmethod.RelativeDate(ldFromDate, 1);
}
else
{
pstmt1.setString(1, asLoanNo);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
llRowCnt2 = rs.getInt("count");
}
rs1.close();
pstmt1.clearParameters();
if(llRowCnt2 > 0)
{
ldFromDate = utilmethod.RelativeDate(ldFromDate, 1);
}
}
pstmt2.setTimestamp(1, ldFromDate);
rs2 = pstmt2.executeQuery();
if(rs2.next())
{
ldToDt = rs2.getTimestamp("to_date");
System.out.println("ldToDt === > "+ldToDt);
break;
}
rs2.close();
pstmt2.clearParameters();
if(adToDt.before(ldToDt))
{
ldToDt = adToDt;
}
liNoDays = (int) utilmethod.DaysAfter(ldFromDate, ldToDt) + 1;
lcIntAmt = admCommon.gbfCalcInterest(asIntTerm, liNoDays, acIntPerc, lcAmtBal, conn);
String strLoanIntRegKey3 = sdfYYYYMMDD.format(ldFromDate);
HashMap ldsLoansIntRegData2 = (HashMap) ldsLoansIntReg.get(strLoanIntRegKey3);
ldsLoansIntRegData2.put("loan_no", asLoanNo);
ldsLoansIntRegData2.put("from_date", ldFromDate);
ldsLoansIntRegData2.put("to_date", ldToDt);
ldsLoansIntRegData2.put("int_term", asIntTerm);
ldsLoansIntRegData2.put("int_rate", acIntPerc);
ldsLoansIntRegData2.put("no_of_days", liNoDays);
ldsLoansIntRegData2.put("amount", lcAmtBal);
ldsLoansIntRegData2.put("int_amount", lcIntAmt);
ldsLoansIntRegData2.put("chg_date", chgDate);
ldsLoansIntRegData2.put("chg_user", chgUser);
ldsLoansIntRegData2.put("chg_term", chgTerm);
ldsLoansIntRegData2.put("row_status" , 1);
ldsLoansIntReg.put(strLoanIntRegKey3, ldsLoansIntRegData2);
ldFromDate = ldToDt;
}
}
if(lsErrCode == null || lsErrCode.trim().length() == 0)
{
lsErrCode = "";
for(int i = 0; i < keySize; i++)
{
String strLoanRegRowStatus = (String) loanRegKey.get(i);
System.out.println("strLoanRegRowStatus == "+strLoanRegRowStatus);
HashMap ldsLoansRegData = (HashMap) ldsLoansReg.get(strLoanRegRowStatus);
String loanRegRowStatus = (String) ldsLoansRegData.get("row_status");
if(loanRegRowStatus.equalsIgnoreCase("1"))
{
for(int li = 0; li < keySizeLoanIntReg; li++)
{
String strLoanIntRegRowStatus = (String) loanIntRegKey.get(li);
System.out.println("strLoanIntRegRowStatus = "+strLoanIntRegRowStatus);
HashMap ldsLoansIntRegData = (HashMap) ldsLoansIntReg.get(strLoanIntRegRowStatus);
String loanIntRegRowStatus = (String) ldsLoansIntRegData.get("row_status");
if(loanIntRegRowStatus.equalsIgnoreCase("1"))
{
lcIntDiff = 0d;
lcIntDiffTot = 0d;
liLineNo = 0;
lcPrevIntAmt = (double) ldsLoansIntRegData.get("o_int_amount");
lcIntAmt = (double) ldsLoansIntRegData.get("int_amount");
if(lcPrevIntAmt == lcIntAmt)
{
continue;
}
ldPrevFrDt = (Timestamp) ldsLoansIntRegData.get("o_from_date");
ldPrevToDt = (Timestamp) ldsLoansIntRegData.get("o_to_date");
lsPrevIntTerm = (String) ldsLoansIntRegData.get("o_int_term");
lcPrevIntPer = (double) ldsLoansIntRegData.get("o_int_rate");
liPrevNoDays = (int) ldsLoansIntRegData.get("o_no_of_days");
lcPrevIntAmt = (double) ldsLoansIntRegData.get("o_int_amount");
lcPrevAmtBal = (double) ldsLoansIntRegData.get("o_amount");
ldFrDt = (Timestamp) ldsLoansIntRegData.get("from_date");
ldToDt = (Timestamp) ldsLoansIntRegData.get("to_date");
lsIntTerm = (String) ldsLoansIntRegData.get("int_term");
lcIntPer = (double) ldsLoansIntRegData.get("int_rate");
liNoDays = (int) ldsLoansIntRegData.get("no_of_days");
lcIntAmt = (double) ldsLoansIntRegData.get("int_amount");
lcAmtBal = (double) ldsLoansIntRegData.get("amount");
if(liPrevNoDays != 0)
{
lcIntDiff = 0 -lcPrevIntAmt;
lcIntDiffTot = lcIntDiffTot + lcIntDiff;
liLineNo = liLineNo + 1;
chgDate = utilmethod.dateTime(utilmethod.today(), utilmethod.now());
adsIntDet = new HashMap<>();
adsIntDet.put("prd_code", asPrdCode);
adsIntDet.put("loan_no", asLoanNo);
adsIntDet.put("line_no", liLineNo);
adsIntDet.put("date__from", ldPrevFrDt);
adsIntDet.put("date__to", ldPrevToDt);
adsIntDet.put("no_days", liPrevNoDays);
adsIntDet.put("int_term__prev", lsPrevIntTerm);
adsIntDet.put("int_term", lsPrevIntTerm);
adsIntDet.put("int_perc__prev", lcPrevIntPer);
adsIntDet.put("int_perc", lcPrevIntPer);
adsIntDet.put("amount", lcPrevAmtBal);
adsIntDet.put("interest_amt__prev", lcPrevIntAmt);
adsIntDet.put("interest_amt", 0);
adsIntDet.put("interest_amt__diff", lcIntDiff);
adsIntDet.put("chg_date", chgDate);
adsIntDet.put("chg_term", chgTerm);
adsIntDet.put("chg_user", chgUser);
String strAdsIntDet1 = asPrdCode.trim() + asLoanNo.trim() + liLineNo;
lstrRet.put(strAdsIntDet1, adsIntDet);
return lstrRet;
}
lcIntDiff = lcIntAmt;
lcIntDiffTot = lcIntDiffTot + lcIntDiff;
liLineNo = liLineNo + 1;
chgDate = utilmethod.dateTime(utilmethod.today(), utilmethod.now());
adsIntDet = new HashMap<>();
adsIntDet.put("prd_code", asPrdCode);
adsIntDet.put("loan_no", asLoanNo);
adsIntDet.put("line_no", liLineNo);
adsIntDet.put("date__from", ldFrDt);
adsIntDet.put("date__to", ldToDt);
adsIntDet.put("no_days", liNoDays);
adsIntDet.put("int_term__prev", lsIntTerm);
adsIntDet.put("int_term", lsIntTerm);
adsIntDet.put("int_perc__prev", lcIntPer);
adsIntDet.put("int_perc", lcIntPer);
adsIntDet.put("amount", lcAmtBal);
adsIntDet.put("interest_amt__prev", 0);
adsIntDet.put("interest_amt", lcIntAmt);
adsIntDet.put("interest_amt__diff", lcIntDiff);
adsIntDet.put("chg_date", chgDate);
adsIntDet.put("chg_term", chgTerm);
adsIntDet.put("chg_user", chgUser);
String strAdsIntDet2 = asPrdCode.trim() + asLoanNo.trim() + liLineNo;
lstrRet.put(strAdsIntDet2, adsIntDet);
return lstrRet;
}
else
{
lsErrCode = "DS000 "+ "Loan Register Update Error For Loan No. :" + asLoanNo;
lstrRet.put("ERRORCODE" , lsErrCode);
lstrRet.put("interest" , 0.0);
lstrRet.put("dw_interest_det" , adsIntDet);
return lstrRet;
}
}
}
else
{
lsErrCode = "DS000 "+ "Loan Register Update Error For Loan No. :" + asLoanNo;
lstrRet.put("ERRORCODE" , lsErrCode);
lstrRet.put("interest" , 0.0);
lstrRet.put("dw_interest_det" , adsIntDet);
return lstrRet;
}
}
}
lsErrCode = (String) lstrRet.get("ERRORCODE");
if(lsErrCode != null && lsErrCode.trim().length() > 0)
{
lstrRet.put("interest" , 0.0);
}
else
{
lstrRet.put("interest" , lcIntDiffTot);
}
}
catch (Exception e)
{
System.out.println("Exception in InterestProcess : calcIntOnLoan "+ e.getMessage() + ":");
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();
throw new ITMException(e);
}
}
lstrRet.put("ERRORCODE" , lsErrCode);
lstrRet.put("interest" , lcIntDiffTot);
lstrRet.put("dw_interest_det" , adsIntDet);
return lstrRet;
}
//gbf_loan_confirm = loanConfirm
//lds_interest_process = interestProcessMap
//lds_interest_process_det = interestProcessDetMap
//lds_mthad = mthadMap
public String loanConfirm(String lsLoanNo, Timestamp ldEff, Timestamp ldExp, double lcIntAmt, String lsScheme, String lsEmpCode, int aiCommit,
String asGenerateEdi, String xtraParams, Connection conn) throws RemoteException, ITMException
{
String lsAdcodeDed = "", lsAdcodeInt = "", lsErrcode = "", ediOption = "";
String lsIntTerm = "", lsPrdCode = "", lsMonthCode = "", lsCalBase = "", lsRecoNo = "";
int llRows = 0, llCnt = 0, llRejected = 0, llConfirmed = 0, llTemp = 0, llCnt1 = 0;
Timestamp ldChgDate = null, ldToday = null, ldStart = null, ldIssue = null, ldDateFrom = null, ldDateTo = null, refDate = null;
double noOfDays = 0.0, intPerc = 0.0, intAmt = 0.0, amount = 0.0, intAmtPrev = 0.0, intPercPrev = 0.0, intAmtDiff = 0.0;
PreparedStatement pstmt = null, pstmt1 = null;
ResultSet rs = null, rs1 = null;
Map interestProcessMap = null;
Map interestProcessDetMap = null;
Map mthadMap = null;
Map intProcess = null;
Map intProcDet = null;
String sql = "",sql1 = "";
String confirmed = "", chgUser = "", chgTerm = "", empFname = "", empLname = "", schDescr = "", lsIntTermPrev = "",
refNo = "", refType = "";
int lineNo = 0;
HashMap intProcDetRowMap = null;
try
{
chgUser = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode");
chgTerm = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"termId");
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
ldToday = utilmethod.dateTime(utilmethod.today(), utilmethod.now());
ldChgDate = utilmethod.dateTime(utilmethod.today(), utilmethod.now());
//interestProcessMap = new HashMap();
intProcess = new HashMap<>();
//interestProcessDetMap = new HashMap<>();
intProcDet = new HashMap<>();
System.out.println("ldEff = "+ldEff+" \nldExp = "+ldExp);
/*while(1 == 1)
{*/
sql = "select code from period where fr_date <= ? and to_date >= ?";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, ldEff);
pstmt.setTimestamp(2, ldExp);
rs = pstmt.executeQuery();
System.out.println("Sql of period table = "+sql);
if(rs.next())
{
lsPrdCode = checkNull(rs.getString("code"));
System.out.println("lsPrdCode = "+lsPrdCode);
//break;
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(lsPrdCode == null || lsPrdCode.trim().length() == 0)
{
lsErrcode = "VMPRD1";
return lsErrcode;
}
sql = "update loans_interest set confirmed = 'Y' where loan_no = ? and date__from = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsLoanNo);
pstmt.setTimestamp(2, ldEff);
int updcnt = pstmt.executeUpdate();
if(updcnt == 0)
{
lsErrcode = "DS000NR";
return lsErrcode;
//break;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
//lds_interest_process.Retrieve(ls_loanno,ld_eff)
sql = "SELECT loans_interest.loan_no," +
" loans_interest.date__from," +
" loans_interest.date__to," +
" loans_interest.no_days," +
" loans_interest.int_term," +
" loans_interest.int_perc," +
" loans_interest.interest_amt," +
" loans_interest.confirmed," +
" loans_interest.chg_date," +
" loans_interest.chg_user," +
" loans_interest.chg_term," +
" loans_interest.amount," +
" loans.scheme_no," +
" loans.emp_code," +
" employee.emp_fname," +
" employee.emp_lname," +
" loan_scheme.descr," +
" loans_interest.prd_code" +
" FROM loans_interest, loans, employee, loan_scheme" +
" WHERE ( loans_interest.loan_no = loans.loan_no ) and" +
" ( loans.emp_code = employee.emp_code ) and" +
" ( loans.scheme_no = loan_scheme.scheme_no ) and" +
" ( ( loans_interest.loan_no = ? ) AND" +
" ( loans_interest.date__from = ? ) ) ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsLoanNo);
pstmt.setTimestamp(2, ldEff);
rs = pstmt.executeQuery();
int intProcCnt = 0;
while(rs.next())
{
intProcCnt++;
//lsLoanNo = checkNull(rs.getString("loan_no"));
ldDateFrom = rs.getTimestamp("date__from");
interestProcessMap = new HashMap();
interestProcessMap.put("loan_no", lsLoanNo);
interestProcessMap.put("date__from", ldDateFrom);
interestProcessMap.put("date__to", rs.getTimestamp("date__to"));
interestProcessMap.put("no_days", ((Double) rs.getDouble("no_days")).doubleValue());
interestProcessMap.put("int_term", checkNull(rs.getString("int_term")));
interestProcessMap.put("int_perc", ((Double) rs.getDouble("int_perc")).doubleValue());
interestProcessMap.put("interest_amt", ((Double) rs.getDouble("interest_amt")).doubleValue());
interestProcessMap.put("confirmed", checkNull(rs.getString("confirmed")));
interestProcessMap.put("chg_date", rs.getTimestamp("chg_date"));
interestProcessMap.put("chg_user", checkNull(rs.getString("chg_user")));
interestProcessMap.put("chg_term", checkNull(rs.getString("chg_term")));
interestProcessMap.put("amount", ((Double) rs.getDouble("amount")).doubleValue());
interestProcessMap.put("scheme_no", checkNull(rs.getString("scheme_no")));
interestProcessMap.put("emp_code", checkNull(rs.getString("emp_code")));
interestProcessMap.put("emp_fname", checkNull(rs.getString("emp_fname")));
interestProcessMap.put("emp_lname", checkNull(rs.getString("emp_lname")));
interestProcessMap.put("descr", checkNull(rs.getString("descr")));
interestProcessMap.put("prd_code", checkNull(rs.getString("prd_code")));
System.out.println("interestProcessMap:::: " + interestProcessMap);
intProcess.put(lsLoanNo.trim() + ldDateFrom, interestProcessMap);
interestProcessMap = null;
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
//lds_interest_process_det.Retrieve(ls_prdcode , ls_loanno)
sql1 = "SELECT loans_interest_det.prd_code," +
" loans_interest_det.loan_no," +
" loans_interest_det.line_no," +
" loans_interest_det.date__from," +
" loans_interest_det.date__to," +
" loans_interest_det.no_days," +
" loans_interest_det.int_term__prev," +
" loans_interest_det.int_term," +
" loans_interest_det.int_perc__prev," +
" loans_interest_det.int_perc," +
" loans_interest_det.amount," +
" loans_interest_det.interest_amt__prev," +
" loans_interest_det.interest_amt," +
" loans_interest_det.interest_amt__diff," +
" loans_interest_det.ref_type," +
" loans_interest_det.ref_no," +
" loans_interest_det.ref_date," +
" loans_interest_det.chg_date," +
" loans_interest_det.chg_user," +
" loans_interest_det.chg_term" +
" FROM loans_interest_det" +
" WHERE ( prd_code = ? ) AND" +
" ( loan_no = ? )";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, lsPrdCode);
pstmt1.setString(2, lsLoanNo);
System.out.println("sql1 = "+sql1);
rs1 = pstmt1.executeQuery();
int intProcDetCnt = 0;
if(rs1.next())
{
System.out.println("Inside while of loans_interest_det");
intProcDetCnt++;
//lsPrdCode = checkNull(rs1.getString("prd_code"));
//lsLoanNo = checkNull(rs1.getString("loan_no"));
lineNo = rs1.getInt("line_no");
interestProcessDetMap = new HashMap<>();
interestProcessDetMap.put("prd_code", lsPrdCode);
interestProcessDetMap.put("loan_no", lsLoanNo);
interestProcessDetMap.put("line_no", lineNo);
interestProcessDetMap.put("date__from", rs1.getTimestamp("date__from"));
interestProcessDetMap.put("date__to", rs1.getTimestamp("date__to"));
interestProcessDetMap.put("no_days", ((Double) rs1.getDouble("no_days")).doubleValue());
interestProcessDetMap.put("int_term__prev", checkNull(rs1.getString("int_term__prev")));
interestProcessDetMap.put("int_term", checkNull(rs1.getString("int_term")));
interestProcessDetMap.put("int_perc__prev", ((Double) rs1.getDouble("int_perc__prev")).doubleValue());
interestProcessDetMap.put("int_perc", ((Double) rs1.getDouble("int_perc")).doubleValue());
interestProcessDetMap.put("amount", ((Double) rs1.getDouble("amount")).doubleValue());
interestProcessDetMap.put("interest_amt__prev", ((Double) rs1.getDouble("interest_amt__prev")).doubleValue());
interestProcessDetMap.put("interest_amt", ((Double) rs1.getDouble("interest_amt")).doubleValue());
interestProcessDetMap.put("interest_amt__diff", ((Double) rs1.getDouble("interest_amt__diff")).doubleValue());
interestProcessDetMap.put("ref_type", checkNull(rs1.getString("ref_type")));
interestProcessDetMap.put("ref_no", checkNull(rs1.getString("ref_no")));
interestProcessDetMap.put("ref_date", rs1.getTimestamp("ref_date"));
interestProcessDetMap.put("chg_date", rs1.getTimestamp("chg_date"));
interestProcessDetMap.put("chg_user", checkNull(rs1.getString("chg_user")));
interestProcessDetMap.put("chg_term", checkNull(rs1.getString("chg_term")));
System.out.println("interestProcessDetMap == "+interestProcessDetMap);
//intProcDet.put(lsPrdCode.trim() + lsLoanNo.trim(), interestProcessDetMap);
intProcDet.put(intProcDetCnt, interestProcessDetMap);
interestProcessDetMap = null;
}
if (rs1 != null)
{
rs1.close();
rs1 = null;
}
if (pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
sql = "select ad_code__ded, ad_code__int from loan_scheme where scheme_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsScheme);
rs = pstmt.executeQuery();
if(rs.next())
{
lsAdcodeDed = checkNull(rs.getString("ad_code__ded"));
lsAdcodeInt = checkNull(rs.getString("ad_code__int"));
}
else
{
lsErrcode = "VTSCHNO1";
return lsErrcode;
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
sql = "select int_term, start_reco, issue_date from loans where loan_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsLoanNo);
rs = pstmt.executeQuery();
if(rs.next())
{
lsIntTerm = checkNull(rs.getString("int_term"));
ldStart = rs.getTimestamp("start_reco");
ldIssue = rs.getTimestamp("issue_date");
}
else
{
lsErrcode = "VTLOAN3";
return lsErrcode;
//break;
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
sql = "select cal_base from interestterm where int_term = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsIntTerm);
rs = pstmt.executeQuery();
if(rs.next())
{
lsCalBase = checkNull(rs.getString("cal_base"));
}
else
{
lsErrcode = "VTITERM1";
return lsErrcode;
//break;
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if (lsCalBase == "E" || "E".equalsIgnoreCase(lsCalBase))
{
sql = "update loans set date__interest = ? where loan_no = ? and date__interest < ?";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, ldExp);
pstmt.setString(2, lsLoanNo);
pstmt.setTimestamp(3, ldExp);
int cnt = pstmt.executeUpdate();
if(cnt < 0)
{
lsErrcode = "DS000";
return lsErrcode;
//break;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
else
{
sql = "update loans set date__interest = ? where loan_no = ? and date__interest < ?";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, ldExp);
pstmt.setString(2, lsLoanNo);
pstmt.setTimestamp(3, ldExp);
int cnt = 0;
if(cnt < 0)
{
lsErrcode = "DS000";
return lsErrcode;
//break;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
if (isProcMode != "F" || !"F".equalsIgnoreCase(isProcMode) && asGenerateEdi == "Y" || !"Y".equalsIgnoreCase(asGenerateEdi))
{
lsMonthCode = utilmethod.right(lsPrdCode.trim(), 2);
System.out.println("Month Code = "+lsMonthCode);
sql = "select count(*) as count from employee_mthad where emp_code = ? and month_code = ? and ad_code = ? and eff_date = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsEmpCode);
pstmt.setString(2, lsMonthCode);
pstmt.setString(3, lsAdcodeInt);
pstmt.setTimestamp(4, ldEff);
rs = pstmt.executeQuery();
if(rs.next())
{
llCnt1 = rs.getInt("count");
}
else
{
lsErrcode = "VTMTHAD";
return lsErrcode;
//break;
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(llCnt1 == 0)
{
sql = "insert into employee_mthad ( emp_code, month_code, ad_code, eff_date, exp_date, type," +
" amount, min_basic, max_basic, min_amt, max_amt, prop_yn, chg_date, chg_user, chg_term, ref_type, ref_no)" +
" values ( ?, ?, ?, ?, ?, 'F', ?, null, null, null, null, 'N', ?, ?, ?, 'N', ?)";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsEmpCode);
pstmt.setString(2, lsMonthCode);
pstmt.setString(3, lsAdcodeInt);
pstmt.setTimestamp(4, ldEff);
pstmt.setTimestamp(5, ldExp);
pstmt.setDouble(6, lcIntAmt);
pstmt.setTimestamp(7, ldToday);
pstmt.setString(8, chgUser);
pstmt.setString(9, chgTerm);
pstmt.setString(10, lsLoanNo);
int cnt = pstmt.executeUpdate();
if(cnt > 0)
{
System.out.println("Inserted into employee_mthad successfully ["+cnt+"]");
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
else
{
sql = "update employee_mthad set amount = amount + ?, ref_type = ?, ref_no = ? where emp_code = ? and month_code = ? "
+ "and ad_code = ? and eff_date = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, lcIntAmt);
pstmt.setString(2, "N");
pstmt.setString(3, lsLoanNo);
pstmt.setString(4, lsEmpCode);
pstmt.setString(5, lsMonthCode);
pstmt.setString(6, lsAdcodeInt);
pstmt.setTimestamp(7, ldEff);
int cnt = pstmt.executeUpdate();
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt == 0)
{
lsErrcode = "DS000NR";
return lsErrcode;
//break;
}
}
}
sql = "update loan_reco set int_calculated = 'Y' where reco_no = ?";
pstmt = conn.prepareStatement(sql);
llRows = intProcDet.size();
System.out.println("------> llRows count = "+llRows);
for(llCnt = 1; llCnt <= llRows; llCnt++)
{
intProcDetRowMap = (HashMap) intProcDet.get(llCnt);
System.out.println("intProcDet = "+intProcDet);
System.out.println("intProcDetRowMap == "+intProcDetRowMap);
if(intProcDetRowMap.get("ref_type").equals("LNRECO"))
{
lsRecoNo = (String) intProcDetRowMap.get(refType);
lsErrcode = "";
pstmt.setString(1, lsRecoNo);
int updCnt = pstmt.executeUpdate();
pstmt.clearParameters();
if(updCnt > 0)
{
lsErrcode = "DS000NR - Loan Reco Not Foudn For Reco.No. : " +lsRecoNo;
return lsErrcode;
//break;
}
}
}
if(lsErrcode != null && lsErrcode.trim().length() > 0)
{
return lsErrcode;
//break;
}
llConfirmed = llConfirmed + 1;
if(asGenerateEdi == "Y" || "Y".equalsIgnoreCase(asGenerateEdi))
{
sql = "select edi_option from transetup where tran_window = 'w_interest_process_load'";
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
{
ediOption = checkNull(rs.getString("edi_option"));
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
/*if(ediOption == "1")
{
ls_errcode = nvo_func_adv.nf_create_edi_multi('w_interest_process_load', &
lds_interest_process.describe("datawindow.syntax") &
+ '~r' + lds_interest_process.describe("datawindow.syntax.data"), &
'A', edioption, 2, &
lds_interest_process_det.describe("datawindow.syntax") &
+ '~r' + lds_interest_process_det.describe("datawindow.syntax.data"), &
'', '', '', '', '')
}
else if(ediOption == "2")
{
nvo_func_adv.post nf_create_edi_multi('w_interest_process_load', &
lds_interest_process.describe("datawindow.syntax") &
+ '~r' + lds_interest_process.describe("datawindow.syntax.data"), &
'A', edioption, 2, &
lds_interest_process_det.describe("datawindow.syntax") &
+ '~r' + lds_interest_process_det.describe("datawindow.syntax.data"), &
'', '', '', '', '')
}*/
if(lsErrcode != null && lsErrcode.trim().length() > 0)
{
return lsErrcode;
//break;
}
if((isProcMode != "F" || !"F".equalsIgnoreCase(isProcMode)) && (ldStart.before(ldEff) || ldStart.equals(ldEff)) && "E".equalsIgnoreCase(lsCalBase) || !"E".equalsIgnoreCase(lsCalBase))
{
sql = "select edi_option from transetup where tran_window = 'w_emp_mthad'";
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
{
ediOption = checkNull(rs.getString("edi_option"));
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(ediOption == "1" || ediOption == "2")
{
//Fetched query from d_emp_mthad_edit
sql = "SELECT employee_mthad.emp_code," +
" employee_mthad.month_code," +
" employee_mthad.ad_code," +
" employee_mthad.eff_date," +
" employee_mthad.exp_date," +
" employee_mthad.type," +
" employee_mthad.prop_yn," +
" employee_mthad.chg_date," +
" employee_mthad.chg_user," +
" employee_mthad.chg_term," +
" allwdedn.descr," +
" employee_mthad.amount," +
" employee_mthad.min_basic," +
" employee_mthad.max_basic," +
" employee_mthad.min_amt," +
" employee_mthad.max_amt," +
" employee.pay_site," +
" employee_mthad.ref_type," +
" employee_mthad.ref_no" +
" FROM employee_mthad, allwdedn, employee" +
" WHERE ( employee_mthad.ad_code = allwdedn.ad_code ) and" +
" ( employee_mthad.emp_code = employee.emp_code ) and" +
" ( ( employee_mthad.emp_code = ? ) AND" +
" ( employee_mthad.month_code = ? ) AND" +
" ( employee_mthad.ad_code = ? ) AND" +
" ( employee_mthad.eff_date = ? ) )";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsEmpCode);
pstmt.setString(2, lsMonthCode);
pstmt.setString(3, lsAdcodeDed);
pstmt.setTimestamp(4, ldEff);
rs = pstmt.executeQuery();
while(rs.next())
{
lsEmpCode = checkNull(rs.getString("emp_code"));
lsMonthCode = checkNull(rs.getString("month_code"));
lsAdcodeDed = checkNull(rs.getString("ad_code"));
ldEff = rs.getTimestamp("eff_date");
mthadMap = new HashMap<>();
mthadMap.put("emp_code", lsEmpCode);
mthadMap.put("month_code", lsMonthCode);
mthadMap.put("ad_code", lsAdcodeDed);
mthadMap.put("eff_date", ldEff);
mthadMap.put("exp_date", rs.getTimestamp("exp_date"));
mthadMap.put("type", checkNull(rs.getString("type")));
mthadMap.put("prop_yn", checkNull(rs.getString("prop_yn")));
mthadMap.put("chg_date", rs.getTimestamp("chg_date"));
mthadMap.put("chg_user", checkNull(rs.getString("chg_user")));
mthadMap.put("chg_term", checkNull(rs.getString("chg_term")));
mthadMap.put("descr", checkNull(rs.getString("descr")));
mthadMap.put("amount", rs.getDouble("amount"));
mthadMap.put("min_basic", rs.getDouble("min_basic"));
mthadMap.put("max_basic", rs.getDouble("max_basic"));
mthadMap.put("min_amt", rs.getDouble("min_amt"));
mthadMap.put("max_amt", rs.getDouble("max_amt"));
mthadMap.put("pay_site", checkNull(rs.getString("pay_site")));
mthadMap.put("ref_type", checkNull(rs.getString("ref_type")));
mthadMap.put("ref_no", checkNull(rs.getString("ref_type")));
mthadMap.clear();
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
}
}
//}
if(interestProcessMap != null){
interestProcessMap.clear();
}
if(intProcess != null){
intProcess.clear();
}
if(interestProcessDetMap != null){
interestProcessDetMap.clear();
}
if(intProcDet != null){
intProcDet.clear();
}
if(lsErrcode != null && lsErrcode.trim().length() > 0)
{
if(aiCommit == 2)
{
conn.rollback();
}
}
else
{
if(aiCommit == 2)
{
conn.commit();
}
}
}
catch (Exception e)
{
System.out.println("Exception in InterestProcess : loanConfirm "+ e.getMessage() + ":");
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();
throw new ITMException(e);
}
}
return lsErrcode;
}
//gbf_set_log_properties_by_caller = gbfSetLogPropertiesByCaller
public void gbfSetLogPropertiesByCaller(HRLogWriter logwriterDb)
{
//Modified By Poonam B on[27/08/2019][Start]
//LogWriterDatabase istrLogWriter = new LogWriterDatabase();
HRLogWriter istrLogWriter = new HRLogWriter();
//Modified By Poonam B on[27/08/2019][Start]
try
{
System.out.println("Inside InterestProcess.gbfSetLogPropertiesByCaller()");
istrLogWriter.setJobID(logwriterDb.getJobID());
istrLogWriter.setLineNo(logwriterDb.getLineNo());
istrLogWriter.setObjName(logwriterDb.getObjName());
//Modified By Poonam B on[27/08/2019][Start]
//if(istrLogWriter.getTransactionCreatedBy() == null && logwriterDb.getTransactionCreatedBy() != null)
if(logwriterDb.getTransactionCreatedBy() == null && logwriterDb.getTransactionCreatedBy() != null)
{
//Modified By Poonam B on[27/08/2019][END]
istrLogWriter.setTransactionCreatedBy(logwriterDb.getTransactionCreatedBy());
istrLogWriter.setTransactionCreatedBy("caller");
}
if(logwriterDb.getLogFileName() != null && logwriterDb.getLogFileName().trim().length() > 0)
{
istrLogWriter.setLogFileName(logwriterDb.getLogFileName());
istrLogWriter.setLogFileCreatedBy("caller");
}
if(logwriterDb.getFilePointer() != 0 && logwriterDb.getFilePointer() > 0)
{
istrLogWriter.setFilePointer(logwriterDb.getFilePointer());
istrLogWriter.setLogFileCreatedBy("caller");
}
if(logwriterDb.getWsrLogFileName() != null && logwriterDb.getWsrLogFileName().trim().length() > 0)
{
istrLogWriter.setWsrLogFileName(logwriterDb.getWsrLogFileName());
}
if(logwriterDb.getLogLocationType() != null && logwriterDb.getLogLocationType().trim().length() > 0)
{
istrLogWriter.setLogLocationType(logwriterDb.getLogLocationType());
istrLogWriter.setLogServerAddress(logwriterDb.getLogServerAddress());
}
istrLogWriter.setProcessId(logwriterDb.getProcessId());
istrLogWriter.setLogLineNo(logwriterDb.getLogLineNo());
if(logwriterDb.getStartDateTime() != null)
{
istrLogWriter.setStartDateTime(logwriterDb.getStartDateTime());
}
//Added By Poonam B on[27/08/2019][Start]
if(logwriterDb.getJobID() != null && logwriterDb.getJobID().trim().length() > 0)
{
istrLogWriter.setJobID(logwriterDb.getJobID());
}
//Added By Poonam B on[27/08/2019][END]
}
catch (Exception e)
{
System.out.println("Exception in InterestProcess.gbfSetLogPropertiesByCaller()" + e);
e.printStackTrace();
}
}
public String checkNull(String argStr)
{
if(argStr == null)
{
argStr = "";
}
return argStr;
}
}
package ibase.webitm.ejb.adm;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.HashMap;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import ibase.webitm.ejb.adm.*;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.adm.HRLogWriter;
//import ibase.webitm.bean.adm.LogWriterDatabase;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ProcessEJB;
import ibase.webitm.ejb.adm.adv.LogWriter;
import ibase.webitm.ejb.adm.adv.PayrollVoucherConf;
import ibase.webitm.ejb.fin.FinCommon;
import ibase.webitm.ejb.sys.UtilMethods;
import ibase.webitm.utility.ITMException;
public class InterestProcessConfPrc extends ProcessEJB
{
E12GenericUtility genericUtility = new E12GenericUtility();
AdmCommon admCommon = new AdmCommon();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
UtilMethods utilMethod = new UtilMethods();
FinCommon finCommon = new FinCommon();
PayrollVoucherConf PayrollVoucherConf = new PayrollVoucherConf();
HRLogWriter logWriter = null;
//LogWriterDatabase logWriter = null;
int rowCount = 0, rowcnt = 0;
String userId = "", chgTerm = "", loginSite = "";
int iiInterval, iiPctComplete = 0;
String isSingle = "N";
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException, ITMException
{
Document headerDom = null;
Document detailDom = null;
String retStr = "";
logWriter = new HRLogWriter();
Connection conn = null;
Connection logConn = null;
String chgTerm = "", loginSite = "", userId = "", jobId = "", objName = "";
try
{
conn = getConnection();
System.out.println("Conn ["+conn+"]");
if (xmlString != null && xmlString.trim().length() > 0)
{
headerDom = genericUtility.parseString(xmlString);
System.out.println("headerDom ["+headerDom+"]");
}
if (xmlString2 != null && xmlString2.trim().length() > 0)
{
detailDom = genericUtility.parseString(xmlString2);
System.out.println("detailDom ["+detailDom+"]");
}
logConn = getConnection();
userId = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"));
chgTerm = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId"));
loginSite = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode"));
jobId = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "job_id"));
objName = getObjNameFromDom(headerDom, "objName");
logWriter.setTotalRows(0);
logWriter.setRowsProcessed(0);
logWriter.setRowsIgnored(0);
logWriter.setRowsRejected(0);
logWriter.setProcessId("InterestProcess");
logWriter.initializeHRLogWriter(objName, jobId, userId, chgTerm, "InterestProcess", "INTPROC", loginSite, logConn);
retStr = process(headerDom, detailDom, windowName, xtraParams, logWriter, conn, logConn);
System.out.println("Return from InterestProcessConfPrc :::: "+retStr);
if(retStr != null && retStr.trim().length() > 0)
{
retStr = itmDBAccessEJB.getErrorString("", retStr, "", "", logConn);
conn.rollback();
//logWriter = admCommon.gbfErrWrite("", "", "", errString, "E", logWriter, logConn);
logWriter.gbfErrWrite("", "", "", retStr, "E", logConn);
}
if(retStr == null || retStr.trim().length() == 0)
{
conn.commit();
retStr = itmDBAccessEJB.getErrorString("", "VTCONF", userId, "", logConn);
return retStr;
}
}
catch (Exception e)
{
System.out.println("Exception :InterestProcessConfPrc :process(String xmlString, String xmlString2, String windowName, String xtraParams):"
+ e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}
System.out.println("returning from Process "+retStr);
return retStr;
}
/*public String process(Document dom, Document dom1, Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws ITMException
{*/
public String process(Document headerDom, Document detailDom, String windowName, String xtraParams, HRLogWriter logWriter, Connection conn, Connection logConn) throws RemoteException, ITMException
{
String lsSysErrStr = "" , lsErrText = "";
int liLogFilePtr = -1;
//int liLogFilePtr = 0;
HashMap gbflogWriterMap = null;
//logWriter = new HRLogWriter();
String errString = "", objName = "", currentProcess = "", processId = "", activity = "", fileNameStartWith = "";
String jobId = "";
try
{
System.out.println("<<< Inside InterestProcessConfPrc.process() >>>");
userId = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"));
chgTerm = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId"));
loginSite = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode"));
gbflogWriterMap = new HashMap<>();
objName = getObjNameFromDom(headerDom, "objName");
logWriter.setCurrentProcess("InterestProcess");
logWriter.setActivity("InterestProcess");
logWriter.setProcessId("InterestProcess");
logWriter.setFileNameStartWith("INTPROC");
currentProcess = logWriter.getCurrentProcess();
activity = logWriter.getActivity();
processId = logWriter.getProcessId();
fileNameStartWith = logWriter.getFileNameStartWith();
System.out.println("objName : "+objName+" \ncurrentProcess = "+currentProcess+" \nactivity = "+activity+" \nprocessId = "+processId+" \nfileNameStartWith = "+fileNameStartWith);
System.out.println("userId : "+userId+ " \nloginSite = "+loginSite+" \nxtraParams = "+xtraParams);
/*gbflogWriterMap.put("objName", objName);
gbflogWriterMap.put("currentProcess", currentProcess);
gbflogWriterMap.put("activity", activity);
gbflogWriterMap.put("processId", processId);
gbflogWriterMap.put("userId", userId);
gbflogWriterMap.put("loginSite", loginSite);
gbflogWriterMap.put("xtraParams", xtraParams);
gbflogWriterMap.put("fileNameStartName", fileNameStartWith);
logWriter.setObjName(objName);
logWriter.setCurrentProcess(currentProcess);
logWriter.setActivity(activity);
logWriter.setProcessId(processId);
logWriter.setUserId(userId);
logWriter.setFileNameStartWith(fileNameStartWith);*/
//logWriter = admCommon.initializeLogWriter(gbflogWriterMap, headerDom, conn);
//---Commented below method as suggested by Piyush Sir [Start]
//logWriter.initializeHRLogWriter(objName, jobId, userId, chgTerm, "InterestProcess", "INTPROC", loginSite, logConn);
//---Commented below method as suggested by Piyush Sir [End]
liLogFilePtr = logWriter.getLogWriterFlag();
if (liLogFilePtr < 0)
{
gbfReleaseLogWriter(headerDom, logWriter, conn);
// return is_errxml
}
errString = processInterest(headerDom, detailDom, windowName, xtraParams, logWriter, conn, logConn);
gbfReleaseLogWriter(headerDom, logWriter, conn);
System.out.println("InterestProcessConfPrc.process() errString is ====> "+errString);
}
catch (Exception e)
{
System.out.println("Exception in InterestProcessConfPrc : process(with connection param) "+ e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}
return errString;
}
public int gbfReleaseLogWriter(Document headerDom, HRLogWriter logWriter, Connection logConn) throws ITMException
{
int liRet = 1;
String lsLogStr = "", frEmp = "", toEmp = "", fromPrd = "", toPrd = "", frSite = "", toSite = "", mtype = "";
int rowsRejected = 0, rowsProcessed = 0;
try
{
frEmp = checkNull(genericUtility.getColumnValue("emp_code__fr", headerDom));
toEmp = checkNull(genericUtility.getColumnValue("emp_code__to", headerDom));
if (frEmp == null || frEmp.trim().length() == 0)
{
frEmp = "0";
}
if (toEmp == null || toEmp.trim().length() == 0)
{
toEmp = "Z";
}
fromPrd = checkNull(genericUtility.getColumnValue("prd_code__fr", headerDom));
toPrd = checkNull(genericUtility.getColumnValue("prd_code__to", headerDom));
frSite = checkNull(genericUtility.getColumnValue("site_code__fr", headerDom));
toSite = checkNull(genericUtility.getColumnValue("site_code__to", headerDom));
if (frSite == null || frSite.trim().length() == 0)
{
frSite = "0";
}
if (toSite == null || toSite.trim().length() == 0)
{
toSite = "Z";
}
mtype = checkNull(genericUtility.getColumnValue("type", headerDom));
rowsProcessed = logWriter.getRowsProcessed();
rowsRejected = logWriter.getRowsRejected();
System.out.println("rowsProcessed==>" + rowsProcessed + " rowsRejected==>" + rowsRejected);
lsLogStr = "Total Employees: " + String.valueOf(rowsProcessed + rowsRejected) + " Processed: " + rowsProcessed
+ " Rejected: " + rowsRejected;
//gbf_err_write("","",mtype,ls_log_str , "I")
//logWriter = admCommon.gbfErrWrite("", "", mtype, lsLogStr, "I",logWriter,logConn);
logWriter.gbfErrWrite("", "", mtype, lsLogStr, "I",logConn);
if (frSite.trim().toUpperCase().equalsIgnoreCase(toSite.trim().toUpperCase()))
{
lsLogStr = "Processing Over for Site: " + frSite;
}
else
{
lsLogStr = "Processing Over for Sites between: " + frSite + " To: " + toSite;
}
//gbf_err_write("","",mtype,ls_log_str , "I")
//logWriter = admCommon.gbfErrWrite("", "", mtype, lsLogStr, "I",logWriter,logConn);
logWriter.gbfErrWrite("", "", mtype, lsLogStr, "I",logConn);
/*if istr_log_writer.transaction_created_by = "self" then
if not isnull(istr_log_writer.transaction) and isvalid(istr_log_writer.transaction) then
commit using istr_log_writer.transaction;
disconnect using istr_log_writer.transaction;
setnull(istr_log_writer.transaction)
end if
end if
if istr_log_writer.inet_created_by = "self" then
if not isnull(istr_log_writer.io_inet) and isvalid(istr_log_writer.io_inet) then
destroy istr_log_writer.inet_ret
destroy istr_log_writer.io_inet
setnull(istr_log_writer.inet_ret)
setnull(istr_log_writer.io_inet)
end if
end if
if istr_log_writer.logfile_created_by = "self" then
if not isnull(istr_log_writer.file_pointer) and istr_log_writer.file_pointer > 0 then
fileclose(istr_log_writer.file_pointer)
setnull(istr_log_writer.file_pointer)
end if
end if*/
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
System.out.println("liRet from gbfReleaseLogWriter == "+liRet);
return liRet;
}
//gbf_process_interest = processInterest
private String processInterest(Document headerDom, Document detailDom, String windowName, String xtraParams, HRLogWriter logWriter, Connection conn, Connection logConn) throws RemoteException, ITMException
{
String lsLoanFr = "", lsLoanTo = "", lsPrdCode = "",lsEmpCode = "", lsEmpCodeFr = "", lsEmpCodeTo = "", lsErrCode = "", lsLoanNo = "",
lsIntTerm = "", lsSiteCode = "", lsSiteCodeTo = "", lsScheme = "", lsFileName = "";
String lsProcGrpFr = "", lsProcGrpTo = "", lsLogFile = "", lsLogStr = "", lsIsInetLocal = "N" , lsSeverity = "I";
int llRows = 0, llCnt = 0, llRows1 = 0, llRowcnt = 0, llRowcnt1 = 0;
Timestamp ldStartReco = null, ldBal = null, ldFrom = null, ldFrom1 = null, ldTo = null, ldChg = null, ldEff = null, ldExp = null;
double lcBalAmt = 0.0, lcIntPerc = 0.0, lcIntAmt = 0.0;
int liNoDays = 0, liLogFilePtr = 0, liFileWrite = -1, liFileClose = 0;
//logWriter = new LogWriterDatabase();
UtilMethods utilMethod = new UtilMethods();
InterestProcess interestProcess = null;
String isLogLocationType = "", isLogServerAddr = "", isWsrLogFname = "", isLogObjName = "", isActivity = "", isProcId = "", lsLogFileName = "";
Timestamp idProcessDate = null;
try
{
System.out.println("---Inside try block of InterestProcessConfPrc.processInterest()---");
lsLoanFr = checkNull(genericUtility.getColumnValue("from_loanno", headerDom));
lsLoanTo = checkNull(genericUtility.getColumnValue("to_loanno", headerDom));
lsPrdCode = checkNull(genericUtility.getColumnValue("prd_code", headerDom));
lsEmpCode = checkNull(genericUtility.getColumnValue("emp_code", headerDom));
lsEmpCodeFr = lsEmpCode;
lsEmpCode = checkNull(genericUtility.getColumnValue("emp_code_to", headerDom));
lsEmpCodeTo = lsEmpCode;
lsSiteCode = checkNull(genericUtility.getColumnValue("site_code", headerDom));
lsSiteCodeTo = checkNull(genericUtility.getColumnValue("site_code__to", headerDom));
lsProcGrpFr = checkNull(genericUtility.getColumnValue("proc_group__fr", headerDom));
lsProcGrpTo = checkNull(genericUtility.getColumnValue("proc_group__to", headerDom));
if(lsEmpCode == null || lsEmpCode.trim().length() == 0)
{
lsEmpCodeTo = "ZZZZZZZZZZ";
lsEmpCodeFr = "0";
}
if(lsLoanTo == null || lsLoanTo.trim().length() == 0)
{
lsLoanTo = "ZZZZZZZZZZZZZZZ";
}
if(lsLoanFr == null || lsLoanFr.trim().length() == 0)
{
lsLoanFr = "0";
}
if(lsSiteCode == null || lsSiteCode.trim().length() == 0)
{
lsSiteCode = "0";
}
if(lsSiteCodeTo == null || lsSiteCodeTo.trim().length() == 0)
{
lsSiteCodeTo = "ZZZZZ";
}
if(lsProcGrpFr == null || lsProcGrpFr.trim().length() == 0)
{
lsProcGrpFr = "0";
}
if(lsProcGrpTo == null || lsProcGrpTo.trim().length() == 0)
{
lsProcGrpTo = "ZZZZZ";
}
interestProcess = new InterestProcess();
lsErrCode = "";
if(liFileWrite == -1)
{
lsErrCode = "VEFWRERR"; //Failed to write interest log file
}
liLogFilePtr = logWriter.getFilePointer();
isLogLocationType = logWriter.getLogLocationType();
//idProcessDate = utilMethod.dateTime(logWriterDb.getStartDateTime());
idProcessDate = logWriter.getStartDateTime();
isLogServerAddr = logWriter.getLogServerAddress();
isWsrLogFname = logWriter.getLogFileName();
isLogObjName = logWriter.getObjName();
isActivity = logWriter.getActivity();
isProcId = logWriter.getProcessId();
//inetRet = logWriterDb.getInetCreatedBy();
//ioInet = logWriterDb.getInetCreatedBy();
lsLogFileName = logWriter.getLogFileName();
System.out.println("liLogFilePtr = "+liLogFilePtr+" \nisLogLocationType = "+isLogLocationType+" \nidProcessDate = "+idProcessDate+
" \nisLogServerAddr = "+isLogServerAddr+" \nisWsrLogFname = "+isWsrLogFname+" \nisLogObjName = "+isLogObjName+" \nisActivity = "+isActivity+
" \nisProcId = "+isProcId+" \nlsLogFileName ="+lsLogFileName);
logWriter.setFilePointer(liLogFilePtr);
logWriter.setLogLocationType(isLogLocationType);
logWriter.setStartDateTime(idProcessDate);
logWriter.setLogServerAddress(isLogServerAddr);
logWriter.setWsrLogFileName(isWsrLogFname);
logWriter.setObjName(isLogObjName);
logWriter.setActivity(isActivity);
logWriter.setProcessId(isProcId);
logWriter.setLogFileName(lsLogFileName);
interestProcess.isLogLocationType = isLogLocationType;
interestProcess.idProcessDate = idProcessDate;
interestProcess.isLogServerAddr = isLogServerAddr;
interestProcess.isWSRLogFname = isWsrLogFname;
interestProcess.isLogObjName = isLogObjName;
interestProcess.isActivity = isActivity;
interestProcess.isProcId = isProcId;
/*logWriterDb.setLogLocationType(interestProcess.isLogLocationType);
logWriterDb.setStartDateTime(interestProcess.idProcessDate);
logWriterDb.setLogServerAddress(interestProcess.isLogServerAddr);
logWriterDb.setWsrLogFileName(interestProcess.isWSRLogFname);
logWriterDb.setObjName(interestProcess.isLogObjName);
logWriterDb.setActivity(interestProcess.isActivity);
logWriterDb.setProcessId(interestProcess.isProcId);
logWriterDb.setLogFileName(lsLogFileName);*/
/**/
if("Y".equalsIgnoreCase(isSingle))
{
interestProcess.isProcMode = "I";
}
interestProcess.isLogFileName = lsLogFileName;
lsLogStr = "Interest Process is Started";
logWriter.setStatusDetail(lsLogStr);
logWriter.setErrorCode("");
logWriter.setStatusType("I");
//logWriter = admCommon.gfLogWriter(logWriter, conn);
logWriter.gfLogWriter(conn);
lsErrCode = logWriter.getReturnUpdError();
if(lsErrCode != null && lsErrCode.trim().length() > 0)
{
//logWriter = admCommon.gbfErrWrite(lsPrdCode, lsEmpCode, "", "DS000", "E", 2,logWriter, logConn);
logWriter.gbfErrWrite(lsPrdCode, lsEmpCode, "", "DS000", "E", 2,logConn);
lsErrCode = itmDBAccessEJB.getErrorString("", "DS000", userId, "", conn);
return lsErrCode;
}
interestProcess.gbfSetLogPropertiesByCaller(logWriter);
lsErrCode = interestProcess.empLoanIntProc(lsLoanFr, lsLoanTo, lsEmpCodeFr, lsEmpCodeTo, lsPrdCode, "Y", lsSiteCode, lsSiteCodeTo, lsProcGrpFr, lsProcGrpTo, xtraParams, conn);
//gbfSetLogPropertiesFromTarget(lv_loanobj);
gbfSetLogPropertiesFromTarget();
int rowsProcessed = logWriter.getRowsProcessed();
int rowsRejected = logWriter.getRowsRejected();
lsLogStr = "Total Loans: "+(Integer.toString(rowsProcessed) + Integer.toString(rowsRejected)).trim()+" Processed: "+Integer.toString(rowsProcessed).trim()+" Rejected: "+Integer.toString(rowsRejected).trim();
logWriter.setStatusDetail(lsLogStr);
logWriter.setErrorCode("");
logWriter.setStatusType("I");
//logWriter = admCommon.gfLogWriter(logWriter, conn);
logWriter.gfLogWriter(conn);
lsErrCode = logWriter.getReturnUpdError();
if(lsErrCode != null && lsErrCode.trim().length() > 0)
{
//logWriter = admCommon.gbfErrWrite(lsPrdCode, lsEmpCode, "", "DS000", "E", 2,logWriter, logConn);
logWriter.gbfErrWrite(lsPrdCode, lsEmpCode, "", "DS000", "E", 2,logConn);
lsErrCode = itmDBAccessEJB.getErrorString("", "DS000", userId, "", conn);
return lsErrCode;
}
if(lsErrCode != null && lsErrCode.trim().length() > 0 && !"VTINTCALC2".equalsIgnoreCase(lsErrCode))
{
conn.rollback();
lsLogStr = lsLogStr + "~r~nErrors:~r~n" + lsErrCode;
lsSeverity = "E";
logWriter.setStatusDetail(lsLogStr);
logWriter.setErrorCode(lsErrCode);
logWriter.setStatusType(lsSeverity);
//logWriter = admCommon.gfLogWriter(logWriter, conn);
logWriter.gfLogWriter(conn);
lsLogStr = "Interest Process is Completed";
logWriter.setStatusDetail(lsLogStr);
logWriter.setErrorCode("");
logWriter.setStatusType("I");
//logWriter = admCommon.gfLogWriter(logWriter, conn);
logWriter.gfLogWriter(conn);
lsErrCode = "Errors "+lsErrCode;
//gbf_insert_err(lsErrCode,"");
lsErrCode = logWriter.getReturnUpdError();
if(lsErrCode != null && lsErrCode.trim().length() > 0)
{
//logWriter = admCommon.gbfErrWrite(lsPrdCode, lsEmpCode, "", "VTCONF", "I", 1,logWriter, logConn);
logWriter.gbfErrWrite(lsPrdCode, lsEmpCode, "", "VTCONF", "I", 1,logConn);
lsErrCode = itmDBAccessEJB.getErrorString("", "VTCONF", userId, "", conn);
return lsErrCode;
}
return lsErrCode;
}
else if("VTINTCALC2".equalsIgnoreCase(lsErrCode))
{
lsLogStr = "No loans to process interest or interest is already processed";
logWriter.setStatusDetail(lsLogStr);
logWriter.setErrorCode("");
logWriter.setStatusType("I");
//logWriter = admCommon.gfLogWriter(logWriter, conn);
logWriter.gfLogWriter(conn);
lsErrCode = logWriter.getReturnUpdError();
if(lsErrCode != null && lsErrCode.trim().length() > 0)
{
//logWriter = admCommon.gbfErrWrite(lsPrdCode, lsEmpCode, "", "No loans to process interest or interest is already processed", "E", 2,logWriter, logConn);
logWriter.gbfErrWrite(lsPrdCode, lsEmpCode, "", "No loans to process interest or interest is already processed", "E", 2,logConn);
lsErrCode = itmDBAccessEJB.getErrorString("", "VTINTCALC2", userId, "", conn);
return lsErrCode;
}
/*lsLogStr = "Interest Process is Completed";
logWriterDb.setStatusDetail(lsLogStr);
logWriterDb.setErrorCode("");
logWriterDb.setStatusType("I");
admCommon.gfLogWriter(logWriterDb, conn);*/
return lsErrCode;
}
else
{
lsLogStr = "Interest Process is Completed";
logWriter.setStatusDetail(lsLogStr);
logWriter.setErrorCode("");
logWriter.setStatusType("I");
//logWriter = admCommon.gfLogWriter(logWriter, conn);
logWriter.gfLogWriter(conn);
lsErrCode = logWriter.getReturnUpdError();
if(lsErrCode != null && lsErrCode.trim().length() > 0)
{
//logWriter = (admCommon.gbfErrWrite(lsPrdCode, lsEmpCode, "", "VTCONF", "I", 1,logWriter, logConn));
logWriter.gbfErrWrite(lsPrdCode, lsEmpCode, "", "VTCONF", "I", 1,logConn);
lsErrCode = itmDBAccessEJB.getErrorString("", "VTCONF", userId, "", conn);
return lsErrCode;
}
}
}
catch (Exception e)
{
System.out.println("Exception in InterestProcessConfPrc : processInterest "+ e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}
return lsErrCode;
}
//gbf_serve_log_properties_to_caller = gbfServeLogPropertiesToCaller
/*public LogWriterDatabase gbfServeLogPropertiesToCaller()
{
//LogWriterDatabase istrLogWriter = new LogWriterDatabase();
logWriter = new LogWriterDatabase();
return logWriter;
//return istrLogWriter;
}*/
public HRLogWriter gbfServeLogPropertiesToCaller()
{
//LogWriterDatabase istrLogWriter = new LogWriterDatabase();
logWriter = new HRLogWriter();
return logWriter;
//return istrLogWriter;
}
//gbf_set_log_properties_by_caller = gbfSetLogPropertiesByCaller
//public void gbfSetLogPropertiesByCaller(LogWriterDatabase logwriterDb)
public void gbfSetLogPropertiesByCaller(HRLogWriter logwriterDb)
{
//LogWriterDatabase istrLogWriter = new LogWriterDatabase();
//logWriter = new LogWriterDatabase();
logWriter = new HRLogWriter();
try
{
System.out.println("Inside InterestProcessConfPrc.gbf_set_log_properties_by_caller()");
logWriter.setJobID(logwriterDb.getJobID());
logWriter.setLineNo(logwriterDb.getLineNo());
logWriter.setObjName(logwriterDb.getObjName());
//Modified By Poonam B on[26/08/2019][Start]
//if(logWriter.getTransactionCreatedBy() == null && logwriterDb.getTransactionCreatedBy() != null)
if(logwriterDb.getTransactionCreatedBy() == null && logwriterDb.getTransactionCreatedBy() != null)
//Modified By Poonam B on[26/08/2019][End]
{
logWriter.setTransactionCreatedBy(logwriterDb.getTransactionCreatedBy());
logWriter.setTransactionCreatedBy("caller");
}
if(logwriterDb.getLogFileName() != null && logwriterDb.getLogFileName().trim().length() > 0)
{
logWriter.setLogFileName(logwriterDb.getLogFileName());
logWriter.setLogFileCreatedBy("caller");
}
if(logwriterDb.getFilePointer() != 0 && logwriterDb.getFilePointer() > 0)
{
logWriter.setFilePointer(logwriterDb.getFilePointer());
logWriter.setLogFileCreatedBy("caller");
}
if(logwriterDb.getWsrLogFileName() != null && logwriterDb.getWsrLogFileName().trim().length() > 0)
{
logWriter.setWsrLogFileName(logwriterDb.getWsrLogFileName());
}
if(logwriterDb.getLogLocationType() != null && logwriterDb.getLogLocationType().trim().length() > 0)
{
logWriter.setLogLocationType(logwriterDb.getLogLocationType());
logWriter.setLogServerAddress(logwriterDb.getLogServerAddress());
}
logWriter.setProcessId(logwriterDb.getProcessId());
logWriter.setLogLineNo(logwriterDb.getLogLineNo());
if(logwriterDb.getStartDateTime() != null)
{
logWriter.setStartDateTime(logwriterDb.getStartDateTime());
}
//Added By Poonam B on[27/08/2019][Start]
if(logwriterDb.getJobID() != null && logwriterDb.getJobID().trim().length() > 0)
{
logWriter.setJobID(logwriterDb.getJobID());
}
//Added By Poonam B on[27/08/2019][END]
}
catch (Exception e)
{
System.out.println("InterestProcessConfPrc.gbf_set_log_properties_by_caller()" + e);
e.printStackTrace();
}
System.out.println("InterestProcessConfPrc.gbf_set_log_properties_by_caller()======= Completed");
}
//gbf_set_logproperties_from_target = gbfSetLogPropertiesFromTarget
public void gbfSetLogPropertiesFromTarget()
{
System.out.println("InterestProcessConfPrc.gbfSetLogPropertiesFromTarget()");
//LogWriterDatabase lstrLogWriter = new LogWriterDatabase();
logWriter = new HRLogWriter();
logWriter = gbfServeLogPropertiesToCaller();
//lstrLogWriter = gbfServeLogPropertiesToCaller();
}
private String getObjNameFromDom(Document dom, String attribute) throws RemoteException, ITMException
{
String objName = "";
try
{
NodeList detailList = null;
Node currDetail = null, reqDetail = null;
int detailListLength = 0;
detailList = dom.getElementsByTagName("Detail1");
detailListLength = detailList.getLength();
for (int ctr = 0; ctr < detailListLength; ctr++)
{
currDetail = detailList.item(ctr);
objName = currDetail.getAttributes().getNamedItem(attribute).getNodeValue();
}
}
catch (Exception e)
{
e.printStackTrace();
}
return objName;
}
private String checkNull(String input)
{
return input == null ? "" : input;
}
}
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.util.HashMap;
import java.util.Map;
import javax.ejb.Stateless;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import ibase.utility.E12GenericUtility;
import ibase.utility.UserInfoBean;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ProcessEJB;
import ibase.webitm.ejb.sys.UtilMethods;
import ibase.webitm.utility.ITMException;
@Stateless
public class PayrollArrearsProcessingPrc extends ProcessEJB implements PayrollArrearsProcessingPrcLocal,PayrollArrearsProcessingPrcRemote
{
E12GenericUtility genericUtility = new E12GenericUtility();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
PayrollSplitgenAccPrc splitgenAcc = new PayrollSplitgenAccPrc();
AdmCommon admCommon = new AdmCommon();
HRLogWriter hrLogWriter = new HRLogWriter();
UtilMethods utilMethod = new UtilMethods();
String userId = "", chgTerm = "", loginSite = "";
String isOwrite = "N";
boolean ibTodoprojection = true;
String isLogfileName = "";
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException, ITMException
{
Document detailDom = null;
Document headerDom = null;
String retStr = "";
String retErrStr = "";
Connection conn = null;
Connection logConn = null;
String objName = "",activity = "",fileNameStartName = "";
String jobID = "";
try
{
System.out.println("****Arrears process Method called*****");
conn = getConnection();
logConn = getConnection();
System.out.println("Conn ["+conn+"]");
System.out.println("logConn ["+logConn+"]");
System.out.println("xmlString:::" + xmlString);
if (xmlString != null && xmlString.trim().length() > 0)
{
headerDom = genericUtility.parseString(xmlString);
System.out.println("headerDom ["+headerDom+"]");
}
if (xmlString2 != null && xmlString2.trim().length() > 0)
{
detailDom = genericUtility.parseString(xmlString2);
System.out.println("detailDom ["+detailDom+"]");
}
userId = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"));
chgTerm = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId"));
loginSite = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode"));
objName = getObjNameFromDom(headerDom, "objName");
System.out.println("objName coming from getObjNameFromDom method:::: " + objName);
hrLogWriter.setActivity("ArrearsProcess");
hrLogWriter.setFileNameStartWith("CHGARRPROC_");
activity = hrLogWriter.getActivity();
fileNameStartName = hrLogWriter.getFileNameStartWith();
hrLogWriter.initializeHRLogWriter(objName, jobID, userId, chgTerm, activity, fileNameStartName, loginSite, logConn);
retErrStr = process(headerDom, detailDom, windowName, xtraParams,hrLogWriter, conn,logConn);
System.out.println("Process for PayrollArrearsProcessingPrc :::: " + retStr);
if(retErrStr != null && retErrStr.trim().length() > 0)
{
conn.rollback();
System.out.println("Connection has been rollback..!!!!!");
retStr = itmDBAccessEJB.getErrorString("", retErrStr , userId, "", conn);
}
else
{
conn.commit();
System.out.println("Connection committed successfully..!!!!!");
retStr = itmDBAccessEJB.getErrorString("", "VTARRSUC" , userId, "", conn);// to flash messsage when process complete..
}
}
catch (Exception e)
{
System.out.println("Exception :PayrollArrearsProcessingPrc :process(String xmlString, String xmlString2, String windowName, String xtraParams):"
+ e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if(conn != null)
{
conn.close();
conn = null;
}
if(logConn != null)
{
logConn.close();
logConn = null;
}
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
}
return retStr;
}// END OF PROCESS
public String process(Document headerDom, Document detailDom, String windowName, String xtraParams,HRLogWriter hrLogWriter, Connection conn, Connection logConn) throws RemoteException, ITMException
{
UserInfoBean userinfo = new UserInfoBean();
ResultSet rs = null, rs1 = null;
PreparedStatement pstmt = null, pstmt1 = null;
String currentProcess = "", processId = "";
String lsSysErrStr = "" , lsErrText = "";
String lsLogStr = "";
String mtype = "";
String errString = "",errorCode = "";
HashMap gbflogWriterMap = null;
int liRet = 0;
try
{
System.out.println("****Inside PayrollArrearsProcessingPrc process method called*****");
userId = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"));
chgTerm = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId"));
loginSite = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode"));
gbflogWriterMap = new HashMap();
//objName = getObjNameFromDom(headerDom, "objName");
//System.out.println("objName coming from getObjNameFromDom method:::: " + objName);
hrLogWriter.setCurrentProcess("ChangeArrearsProcess");
//hrLogWriter.setActivity("ArrearsProcess");
hrLogWriter.setProcessId("ChangeArrearsProcess");
//hrLogWriter.setFileNameStartWith("CHGARRPROC_");
currentProcess = hrLogWriter.getCurrentProcess();
//activity = hrLogWriter.getActivity();
processId = hrLogWriter.getProcessId();
//fileNameStartName = hrLogWriter.getFileNameStartWith();
/*gbflogWriterMap.put("objName", objName);
gbflogWriterMap.put("currentProcess", currentProcess);
gbflogWriterMap.put("activity", activity);
gbflogWriterMap.put("processId", processId);
gbflogWriterMap.put("userId", userId);
gbflogWriterMap.put("loginSite", loginSite);
gbflogWriterMap.put("xtraParams", xtraParams);
gbflogWriterMap.put("fileNameStartName", fileNameStartName);
logWriter = admCommon.initializeLogWriter(gbflogWriterMap,headerDom, logConn);*/
//hrLogWriter.initializeHRLogWriter(objName, jobID, userId, chgTerm, activity, fileNameStartName, loginSite, logConn);
/*errorCode = logWriter.getReturnUpdError();
if(errorCode != null && errorCode.trim().length() > 0)
{
errString = itmDBAccessEJB.getErrorString("", errorCode, userId, "", conn);
return errString;
}*/
liRet = hrLogWriter.getLogWriterFlag();
System.out.println("liRet:::: " + liRet);
if (liRet < 0)
{
gbfReleaseLogWriter();
return errString;
}
mtype = checkNull(genericUtility.getColumnValue("type", headerDom));
System.out.println("mtype::: " + mtype);
hrLogWriter = gbfErrWrite("", "", "Process Started", "I",hrLogWriter,logConn);
errorCode = hrLogWriter.getReturnUpdError();
if(errorCode != null && errorCode.trim().length() > 0)
{
errString = errorCode;
return errString;
}
errString = gbfProcessChangeArrears(headerDom, xtraParams,hrLogWriter, conn,logConn);
System.out.println("errString coming from gbfProcessChangeArrears::: " + errString);
if("Y".equalsIgnoreCase(hrLogWriter.getJobTerminateRequested()))
{
hrLogWriter = gbfErrWrite("", "","Process Terminated on request" ,"I",hrLogWriter,logConn) ;
errorCode = hrLogWriter.getReturnUpdError();
if(errorCode != null && errorCode.trim().length() > 0)
{
errString = errorCode;
return errString;
}
}
/*catch (corbacommfailure ccf)
ls_syserrstr = "CORBA_COM_FAILURE : " + ccf.text
catch (corbatransactionrolledback ctr)
ls_syserrstr = "CORBA_TRANSACTION_ROLLBACK : " + ctr.text
catch (corbaobjectnotexist cone)
ls_syserrstr = "CORBA_OBJECT_NOT_EXIST : " + cone.text
catch (corbanopermission cnp)
ls_syserrstr = "CORBA_NO_PERMISSION : " + cnp.text
catch (CORBAUserException cue)
ls_syserrstr = "CORBA_USER_EXCEPTION : " + cue.text
catch (CORBASystemException cse)
ls_syserrstr = "CORBA_SYSTEM_EXCEPTION : " + cse.text
catch (Exception oe)
ls_syserrstr = "OTHER_EXCEPTION : " + oe.text
catch (DivideByZeroError dbz)
ls_syserrstr = "DEVIDE_BY_ZERO : " + dbz.text
catch (NullObjectError noe)
ls_syserrstr = "NULL_OBJECT : " + noe.text
catch (PBXRuntimeError pre)
ls_syserrstr = "PBX_RUNTIME_ERROR: " + pre.text
catch (DWRuntimeError dre)
ls_syserrstr = "DW_RUNTIME_ERROR : " + dre.text
catch (OLERuntimeError ore)
ls_syserrstr = "OLE_RUNTIME_ERROR : " + ore.text
catch (RuntimeError re)
ls_syserrstr = "RUNTIME_ERROR : " + re.text
catch (Throwable te)
ls_syserrstr = "THROWABLE_ERROR : " + te.text
end try
if not isnull(ls_syserrstr) and len(trim(ls_syserrstr)) > 0 then
f_get_token(is_errxml , "<Errors>~r~n")
ls_errtext = f_get_token(is_errxml , "</Errors>~r~n")
is_errxml = ls_errtext
gbf_insert_err("SYSERROR~t" + ls_syserrstr , '')
gbf_build_errxml()
end if*/
lsLogStr = "Total Employees: " + String.valueOf(hrLogWriter.getRowsProcessed() + hrLogWriter.getRowsRejected()).trim() + " Processed: " + String.valueOf(hrLogWriter.getRowsProcessed()).trim() + " Rejected: " + String.valueOf(hrLogWriter.getRowsRejected()).trim();
hrLogWriter = gbfErrWrite("", "", lsLogStr, "I", hrLogWriter, logConn);
hrLogWriter = gbfErrWrite("", "", "Process Over", "I", hrLogWriter, logConn);
gbfReleaseLogWriter();
}//END TRY PROCESS
catch (Exception e)
{
System.out.println("Exception :PayrollArrearsProcessingPrc :process(Document headerDom, Document detailDom, String windowName, String xtraParams, Connection conn, Connection logConn):"
+ e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}
return errString;
}
private String gbfProcessChangeArrears(Document headerDom,String xtraParams,HRLogWriter hrLogWriter, Connection conn,Connection logConn) throws RemoteException, ITMException
{
String lsEmpcodeFr = "", lsEmpcodeTo = "", lsPrdcodeArr = "", lsSitecodeFr = "", lsSitecodeTo = "", lsProcFr = "", lsProcTo = "";
String lsEmpcode = "", lsPrdcode = "", mtype = "";
Timestamp ldPaydt = null;
String payrollDate = "",jobId = "";
String errString = "", lsErrcode = "" , lsVoucherNo = "";
int rowCount = 0, rowcnt = 0;
int currentFormNo = 0;
String lsCurrmthPPFlag = "";
String lsEmpCode1 = "";
String sql = "";
StringBuffer valueXmlString = null;
StringBuffer valueXmlString1 = null;
StringBuffer valueXmlStringArr = null;
Document arrHeaderDom = null;
PreparedStatement pstmt = null;
PreparedStatement pstmtvouchNo = null;
ResultSet rs = null;
Map map = null;
HashMap headerRowMap = null;
HashMap rowMap = null;
String valueXmlStr = null;
try
{
System.out.println("****Inside gbfProcessChangeArrears Method *****");
map = new HashMap();
headerRowMap = new HashMap();
rowMap = new HashMap();
valueXmlString = new StringBuffer("<DocumentRoot><description>Datawindow Root</description><group0>");
valueXmlString.append("<description>Group0 description</description>").append("<Header0>");
valueXmlString.append("<description>Header0 members</description>");
valueXmlString.append("<Detail1 dbID=\"\" domID=\"1\" objContext=\"1\" objName=\"payroll_arrears_processing\">");
valueXmlString.append("<attribute pkNames=\"\" selected=\"\" status=\"\" updateFlag=\"\"/>");
valueXmlStr = valueXmlString.toString();
lsEmpcodeFr = checkNull(genericUtility.getColumnValue("emp_code__fr", headerDom));
lsEmpcodeTo = checkNull(genericUtility.getColumnValue("emp_code__to", headerDom));
if (lsEmpcodeFr == null || lsEmpcodeFr.trim().length() == 0)
{
lsEmpcodeFr = "0";
}
if (lsEmpcodeTo == null || lsEmpcodeTo.trim().length() == 0)
{
lsEmpcodeTo = "Z";
}
lsProcFr = checkNull(genericUtility.getColumnValue("proc_group__from", headerDom));
lsProcTo = checkNull(genericUtility.getColumnValue("proc_group__to", headerDom));
if (lsProcFr == null || lsProcFr.trim().length() == 0)
{
lsProcFr = "0";
}
if (lsProcTo == null || lsProcTo.trim().length() == 0)
{
lsProcTo = "ZZZZZ";
}
lsPrdcodeArr = checkNull(genericUtility.getColumnValue("prd_code__arr", headerDom));
lsSitecodeFr = checkNull(genericUtility.getColumnValue("site_code__fr", headerDom));
lsSitecodeTo = checkNull(genericUtility.getColumnValue("site_code__to", headerDom));
payrollDate = checkNull(genericUtility.getColumnValue("payroll_date", headerDom));
if (lsSitecodeFr == null || lsSitecodeFr.trim().length() == 0)
{
lsSitecodeFr = "0";
}
if (lsSitecodeTo == null || lsSitecodeTo.trim().length() == 0)
{
lsSitecodeTo = "ZZZZZ";
}
lsCurrmthPPFlag = checkNull(genericUtility.getColumnValue("currmth_pp_flag", headerDom));
if (lsCurrmthPPFlag == null || lsCurrmthPPFlag.trim().length() == 0)
{
lsCurrmthPPFlag = "N";
}
System.out.println("lsCurrmthPPFlag::::[" + lsCurrmthPPFlag + "]");
sql = " SELECT DISTINCT payarr_to_proc.emp_code,payarr_to_proc.prd_code,payarr_to_proc.proc_type " +
"FROM employee,payarr_to_proc WHERE " +
"( employee.emp_code = payarr_to_proc.emp_code ) and " +
"( ( payarr_to_proc.emp_code >= ? ) AND ( payarr_to_proc.emp_code <= ? ) AND " +
"( employee.proc_group >= ? ) AND ( employee.proc_group <= ? ) AND " +
"( payarr_to_proc.status = 'U' ) AND ( employee.pay_site between ? and ? ) AND " +
"( payarr_to_proc.proc_type = 'AR' ) AND " +
"case when employee.status is null then ' ' else employee.status end <> 'S' ) " +
"ORDER BY payarr_to_proc.emp_code ASC,payarr_to_proc.prd_code ASC";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsEmpcodeFr);
pstmt.setString(2, lsEmpcodeTo);
pstmt.setString(3, lsProcFr);
pstmt.setString(4, lsProcTo);
pstmt.setString(5, lsSitecodeFr);
pstmt.setString(6, lsSitecodeTo);
rs = pstmt.executeQuery();
while(rs.next())
{
rowCount++;
map = new HashMap();
map.put("emp_code", checkNull(rs.getString("emp_code")));
map.put("prd_code", checkNull(rs.getString("prd_code")));
map.put("proc_type",checkNull(rs.getString("proc_type")));
System.out.println("map:::: " + map);
headerRowMap.put(rowCount, map);
map = null;
}
System.out.println("headerRowMap ::: " + headerRowMap);
close(pstmt,rs);
if(rowCount == 0)
{
close(pstmt,rs);
errString = "NORECFND";
return errString;
}
splitgenAcc.isOwrite = "Y";
isLogfileName = hrLogWriter.getLogFileName();
//splitgenAcc.isLogfileName = isLogfileName;
splitgenAcc.isCaller = "CHANGEARREARSPROCESS";
rowcnt = headerRowMap.size();
System.out.println("rowcnt---[" + rowcnt + "]");
System.out.println("headerRowMap:::: " + headerRowMap);
sql = "select voucher_no from payroll where prd_code = ? and emp_code = ? ";
pstmtvouchNo = conn.prepareStatement(sql);
for(int i=1;i<=rowcnt;i++)
{
rowMap = (HashMap) headerRowMap.get(i);
System.out.println("rowMap:::: " + i + " = " + rowMap);
jobId = hrLogWriter.getJobID();
System.out.println("jobId:::: " + jobId);
if(jobId != null && jobId.trim().length() > 0)
{
if(admCommon.gfJobTerminateRequested(jobId ,logConn))
{
hrLogWriter.setJobTerminateRequested("Y");
break;
}
}
lsEmpcode = (String) rowMap.get("emp_code");
lsPrdcode = (String) rowMap.get("prd_code");
mtype = (String) rowMap.get("proc_type");
if(lsPrdcode.compareTo(lsPrdcodeArr) > 0)
{
continue;
}
try
{
lsVoucherNo = null;
pstmtvouchNo.setString(1, lsPrdcode);
pstmtvouchNo.setString(2, lsEmpcode);
rs = pstmtvouchNo.executeQuery();
if(rs.next())
{
lsVoucherNo = checkNull(rs.getString("voucher_no"));
}
if(rs != null)
{
rs.close();
rs = null;
}
pstmtvouchNo.clearParameters();
if(lsVoucherNo == null || lsVoucherNo.trim().length() == 0)
{
continue;
}
}
catch (SQLException e)
{
e.printStackTrace();
if(rs != null)
{
rs.close();
rs = null;
}
pstmtvouchNo.clearParameters();
errString = "DS000";
hrLogWriter.setRowsRejected(hrLogWriter.getRowsRejected() + 1);
hrLogWriter.setTotalRows(hrLogWriter.getTotalRows() + 1);
break;
}
hrLogWriter.setTotalRows(hrLogWriter.getTotalRows() + 1);
if("Y".equalsIgnoreCase(lsCurrmthPPFlag))
{
if(!lsEmpCode1.trim().equalsIgnoreCase(lsEmpcode.trim()))
{
lsEmpCode1 = lsEmpcode;
splitgenAcc.isPayarrProc = "N";
valueXmlString1 = new StringBuffer();
valueXmlString1.append("<payroll_date><![CDATA[").append(payrollDate).append("]]></payroll_date>");
valueXmlString1.append("<type><![CDATA[").append("PP").append("]]></type>");
valueXmlString1.append("<emp_code__fr><![CDATA[").append(lsEmpcode).append("]]></emp_code__fr>");
valueXmlString1.append("<emp_code__to><![CDATA[").append(lsEmpcode).append("]]></emp_code__to>");
valueXmlString1.append("<prd_code__fr><![CDATA[").append(lsPrdcodeArr).append("]]></prd_code__fr>");
valueXmlString1.append("<prd_code__to><![CDATA[").append(lsPrdcodeArr).append("]]></prd_code__to>");
valueXmlString1.append("<site_code__fr><![CDATA[").append(lsSitecodeFr).append("]]></site_code__fr>");
valueXmlString1.append("<site_code__to><![CDATA[").append(lsSitecodeTo).append("]]></site_code__to>");
valueXmlString1.append("<proc_group__from><![CDATA[").append(lsProcFr).append("]]></proc_group__from>");
valueXmlString1.append("<proc_group__to><![CDATA[").append(lsProcTo).append("]]></proc_group__to>");
valueXmlString1.append("<prd_code__arr><![CDATA[").append(lsPrdcodeArr).append("]]></prd_code__arr>");
valueXmlString1.append("<dataowrite><![CDATA[").append("Y").append("]]></dataowrite>");
valueXmlString1.append("</Detail1></Header0></group0></DocumentRoot>");
valueXmlStringArr = new StringBuffer();
valueXmlStringArr.append(valueXmlStr).append(valueXmlString1);
System.out.println("valueXmlStringArr::: " + valueXmlStringArr);
if(valueXmlStringArr != null)
{
arrHeaderDom = genericUtility.parseString(valueXmlStringArr.toString());
}
splitgenAcc.gbfSetLogPropertiesByCaller(hrLogWriter);
lsErrcode = splitgenAcc.gbfProcessPayroll(arrHeaderDom,arrHeaderDom,xtraParams,hrLogWriter,conn,logConn);
//gbf_set_logproperties_from_target(splitgenAcc);
if(lsErrcode != null && lsErrcode.trim().length() > 0)
{
errString = lsErrcode;
hrLogWriter.setRowsRejected(hrLogWriter.getRowsRejected() + 1);
break;
}
}
}
jobId = hrLogWriter.getJobID();
System.out.println("jobId:::: " + jobId);
if(jobId != null && jobId.trim().length() > 0)
{
if(admCommon.gfJobTerminateRequested(jobId ,logConn))
{
hrLogWriter.setJobTerminateRequested("Y");
break;
}
}
splitgenAcc.isPayarrProc = "N";
valueXmlString1 = new StringBuffer();
valueXmlString1.append("<payroll_date><![CDATA[").append(payrollDate).append("]]></payroll_date>");
valueXmlString1.append("<type><![CDATA[").append("PP").append("]]></type>");
valueXmlString1.append("<emp_code__fr><![CDATA[").append(lsEmpcode).append("]]></emp_code__fr>");
valueXmlString1.append("<emp_code__to><![CDATA[").append(lsEmpcode).append("]]></emp_code__to>");
valueXmlString1.append("<prd_code__fr><![CDATA[").append(lsPrdcode).append("]]></prd_code__fr>");
valueXmlString1.append("<prd_code__to><![CDATA[").append(lsPrdcode).append("]]></prd_code__to>");
valueXmlString1.append("<site_code__fr><![CDATA[").append(lsSitecodeFr).append("]]></site_code__fr>");
valueXmlString1.append("<site_code__to><![CDATA[").append(lsSitecodeTo).append("]]></site_code__to>");
valueXmlString1.append("<proc_group__from><![CDATA[").append(lsProcFr).append("]]></proc_group__from>");
valueXmlString1.append("<proc_group__to><![CDATA[").append(lsProcTo).append("]]></proc_group__to>");
valueXmlString1.append("<prd_code__arr><![CDATA[").append(lsPrdcodeArr).append("]]></prd_code__arr>");
valueXmlString1.append("<dataowrite><![CDATA[").append("Y").append("]]></dataowrite>");
valueXmlString1.append("</Detail1></Header0></group0></DocumentRoot>");
valueXmlStringArr = new StringBuffer();
valueXmlStringArr.append(valueXmlStr).append(valueXmlString1);
System.out.println("valueXmlStringArr::: " + valueXmlStringArr);
if(valueXmlStringArr != null)
{
arrHeaderDom = genericUtility.parseString(valueXmlStringArr.toString());
}
splitgenAcc.gbfSetLogPropertiesByCaller(hrLogWriter);
lsErrcode = splitgenAcc.gbfProcessPayroll(arrHeaderDom,arrHeaderDom,xtraParams,hrLogWriter,conn,logConn);
//gbf_set_logproperties_from_target(splitgenAcc);
if(lsErrcode != null && lsErrcode.trim().length() > 0)
{
errString = lsErrcode;
hrLogWriter.setRowsRejected(hrLogWriter.getRowsRejected() + 1);
break;
}
jobId = hrLogWriter.getJobID();
System.out.println("jobId:::: " + jobId);
if(jobId != null && jobId.trim().length() > 0)
{
if(admCommon.gfJobTerminateRequested(jobId ,logConn))
{
hrLogWriter.setJobTerminateRequested("Y");
break;
}
}
splitgenAcc.isPayarrProc = "Y";
valueXmlString1 = new StringBuffer();
valueXmlString1.append("<payroll_date><![CDATA[").append(payrollDate).append("]]></payroll_date>");
valueXmlString1.append("<type><![CDATA[").append(mtype).append("]]></type>");
valueXmlString1.append("<emp_code__fr><![CDATA[").append(lsEmpcode).append("]]></emp_code__fr>");
valueXmlString1.append("<emp_code__to><![CDATA[").append(lsEmpcode).append("]]></emp_code__to>");
valueXmlString1.append("<prd_code__fr><![CDATA[").append(lsPrdcode).append("]]></prd_code__fr>");
valueXmlString1.append("<prd_code__to><![CDATA[").append(lsPrdcode).append("]]></prd_code__to>");
valueXmlString1.append("<site_code__fr><![CDATA[").append(lsSitecodeFr).append("]]></site_code__fr>");
valueXmlString1.append("<site_code__to><![CDATA[").append(lsSitecodeTo).append("]]></site_code__to>");
valueXmlString1.append("<proc_group__from><![CDATA[").append(lsProcFr).append("]]></proc_group__from>");
valueXmlString1.append("<proc_group__to><![CDATA[").append(lsProcTo).append("]]></proc_group__to>");
valueXmlString1.append("<prd_code__arr><![CDATA[").append(lsPrdcodeArr).append("]]></prd_code__arr>");
valueXmlString1.append("<dataowrite><![CDATA[").append("Y").append("]]></dataowrite>");
valueXmlString1.append("</Detail1></Header0></group0></DocumentRoot>");
valueXmlStringArr = new StringBuffer();
valueXmlStringArr.append(valueXmlStr).append(valueXmlString1);
System.out.println("valueXmlStringArr::: " + valueXmlStringArr);
if(valueXmlStringArr != null)
{
arrHeaderDom = genericUtility.parseString(valueXmlStringArr.toString());
}
splitgenAcc.gbfSetLogPropertiesByCaller(hrLogWriter);
lsErrcode = splitgenAcc.gbfProcessPayroll(arrHeaderDom,arrHeaderDom,xtraParams,hrLogWriter,conn,logConn);
//gbf_set_logproperties_from_target(splitgenAcc);
if(lsErrcode != null && lsErrcode.trim().length() > 0)
{
errString = lsErrcode;
break;
}
if(utilMethod.pos(errString, "<error id='PAYNOREC1'") == 0)
{
if(utilMethod.pos(errString, "<error id='PAYNOREC1'") == 0)
{
if(errString != null && errString.trim().length() > 0)
{
hrLogWriter.setRowsRejected(hrLogWriter.getRowsRejected() + 1);
break;
}
else
{
hrLogWriter.setRowsProcessed(hrLogWriter.getRowsProcessed() + 1);
}
}
else
{
hrLogWriter.setRowsRejected(hrLogWriter.getRowsRejected() + 1);
}
}
else
{
hrLogWriter.setRowsRejected(hrLogWriter.getRowsRejected() + 1);
}
}//End of for loop
if(pstmtvouchNo != null)
{
pstmtvouchNo.close();
pstmtvouchNo = null;
}
}//END TRY
catch (Exception e)
{
System.out.println("Exception :PayrollArrearsProcessingPrc :gbfProcessChangeArrears(): " + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if(pstmtvouchNo != null)
{
pstmtvouchNo.close();
pstmtvouchNo = null;
}
close(pstmt,rs);
}
catch (Exception e1)
{
e1.printStackTrace();
throw new ITMException(e1);
}
}
return errString;
}
public HRLogWriter gbfErrWrite (String asType, String asEmpCode, String asErrcode, String asMsgType,HRLogWriter hrLogWriter,Connection logConn) throws ITMException
{
String lsStr = "" , lsErr = "" , lsErrcode = "";
try
{
System.out.println("Inside admCommon gbfErrWrite method with 4 parameters....");
lsStr = asErrcode;
hrLogWriter.setActivity("Change Arrears");
if(asEmpCode != null && asEmpCode.trim().length() > 0)
{
lsErr = " Emp : " + asEmpCode + " - ";
}
asErrcode = admCommon.getToken(lsStr,"~t");
hrLogWriter.setStatusDetail(lsErr.trim() + hrLogWriter.getActivity() + " " + lsStr);
hrLogWriter.setErrorCode(lsErrcode);
hrLogWriter.setStatusType(asMsgType);
lsErrcode = "";
hrLogWriter.gfLogWriter(logConn);
lsErrcode = hrLogWriter.getReturnUpdError();
System.out.println("lsErrcode coming from gfLogWriter Method:::: " + lsErrcode);
if(lsErrcode != null && lsErrcode.trim().length() > 0)
{
hrLogWriter.setReturnUpdError(lsErrcode);
hrLogWriter.setLogWriterFlag(-1);
}
else
{
hrLogWriter.setLogWriterFlag(1);
}
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
return hrLogWriter;
}
public int gbfReleaseLogWriter() throws ITMException
{
int liRet = 1;
try
{
/*if istr_log_writer.transaction_created_by = "self" then
if not isnull(istr_log_writer.transaction) and isvalid(istr_log_writer.transaction) then
commit using istr_log_writer.transaction;
disconnect using istr_log_writer.transaction;
setnull(istr_log_writer.transaction)
end if
end if
if istr_log_writer.inet_created_by = "self" then
if not isnull(istr_log_writer.io_inet) and isvalid(istr_log_writer.io_inet) then
destroy istr_log_writer.inet_ret
destroy istr_log_writer.io_inet
setnull(istr_log_writer.inet_ret)
setnull(istr_log_writer.io_inet)
end if
end if
if istr_log_writer.logfile_created_by = "self" then
if not isnull(istr_log_writer.file_pointer) and istr_log_writer.file_pointer > 0 then
fileclose(istr_log_writer.file_pointer)
setnull(istr_log_writer.file_pointer)
end if
end if*/
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
return liRet;
}
public void gbfSetLogPropertiesByCaller(HRLogWriter logwriterDb)
{
try
{
System.out.println("Inside PayrollArrearsProcessingPrc.gbf_set_log_properties_by_caller()");
hrLogWriter.setJobID(logwriterDb.getJobID());
hrLogWriter.setLineNo(logwriterDb.getLineNo());
hrLogWriter.setObjName(logwriterDb.getObjName());
if(hrLogWriter.getTransactionCreatedBy() == null && logwriterDb.getTransactionCreatedBy() != null)
{
hrLogWriter.setTransactionCreatedBy(logwriterDb.getTransactionCreatedBy());
hrLogWriter.setTransactionCreatedBy("caller");
}
if(logwriterDb.getLogFileName() != null && logwriterDb.getLogFileName().trim().length() > 0)
{
hrLogWriter.setLogFileName(logwriterDb.getLogFileName());
hrLogWriter.setLogFileCreatedBy("caller");
}
if(logwriterDb.getFilePointer() != 0 && logwriterDb.getFilePointer() > 0)
{
hrLogWriter.setFilePointer(logwriterDb.getFilePointer());
hrLogWriter.setLogFileCreatedBy("caller");
}
if(logwriterDb.getWsrLogFileName() != null && logwriterDb.getWsrLogFileName().trim().length() > 0)
{
hrLogWriter.setWsrLogFileName(logwriterDb.getWsrLogFileName());
}
if(logwriterDb.getLogLocationType() != null && logwriterDb.getLogLocationType().trim().length() > 0)
{
hrLogWriter.setLogLocationType(logwriterDb.getLogLocationType());
hrLogWriter.setLogServerAddress(logwriterDb.getLogServerAddress());
}
hrLogWriter.setProcessId(logwriterDb.getProcessId());
hrLogWriter.setLogLineNo(logwriterDb.getLogLineNo());
if(logwriterDb.getStartDateTime() != null)
{
hrLogWriter.setStartDateTime(logwriterDb.getStartDateTime());
}
if(logwriterDb.getJobID() != null && logwriterDb.getJobID().trim().length() > 0)
{
hrLogWriter.setJobID(logwriterDb.getJobID());
}
}
catch (Exception e)
{
System.out.println("PayrollArrearsProcessingPrc.gbf_set_log_properties_by_caller()" + e);
e.printStackTrace();
}
}
private String getObjNameFromDom(Document dom, String attribute) throws RemoteException, ITMException
{
String objName = "";
try
{
NodeList detailList = null;
Node currDetail = null, reqDetail = null;
int detailListLength = 0;
detailList = dom.getElementsByTagName("Detail1");
detailListLength = detailList.getLength();
for (int ctr = 0; ctr < detailListLength; ctr++)
{
currDetail = detailList.item(ctr);
objName = currDetail.getAttributes().getNamedItem(attribute).getNodeValue();
}
}
catch (Exception e)
{
e.printStackTrace();
}
return objName;
}
private void close(PreparedStatement pstmt,ResultSet rs) throws SQLException
{
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
}
private String checkNull(String input)
{
if (input == null)
{
input = "";
}
else
{
input = input.trim();
}
return input;
}
}
package ibase.webitm.ejb.adm;
import java.rmi.RemoteException;
import javax.ejb.Local;
import ibase.webitm.ejb.ProcessLocal;
import ibase.webitm.utility.ITMException;
@Local
public interface PayrollArrearsProcessingPrcLocal extends ProcessLocal
{
public String process() throws RemoteException,ITMException;
public String process(String xmlString, String xmlString2,String windowName, String xtraParams) throws RemoteException,ITMException;
public String getData(String xmlString, String xmlString2,String windowName, String xtraParams) throws RemoteException,ITMException;
}
package ibase.webitm.ejb.adm;
import java.rmi.RemoteException;
import javax.ejb.Remote;
import ibase.webitm.ejb.ProcessRemote;
import ibase.webitm.utility.ITMException;
@Remote
public interface PayrollArrearsProcessingPrcRemote extends ProcessRemote
{
public String process() throws RemoteException,ITMException;
public String process(String xmlString, String xmlString2,String windowName, String xtraParams) throws RemoteException,ITMException;
public String getData(String xmlString, String xmlString2,String windowName, String xtraParams) throws RemoteException,ITMException;
}
/*
Window Name : w_payroll_single
Auther : Poonam
*/
package ibase.webitm.ejb.adm;
import java.io.IOException;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import javax.ejb.Stateless;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import ibase.utility.E12GenericUtility;
import ibase.utility.UserInfoBean;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ProcessEJB;
import ibase.webitm.ejb.sys.UtilMethods;
import ibase.webitm.utility.ITMException;
@Stateless
public class PayrollSinglePrc extends ProcessEJB implements PayrollSinglePrcLocal,PayrollSinglePrcRemote
{
E12GenericUtility genericUtility = new E12GenericUtility();
AdmCommon admCommon = new AdmCommon();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
UtilMethods utilMethod = new UtilMethods();
PayrollSplitgenAccPrc payrollSplitgenAccPrc = null;
InterestProcessConfPrc interestProcessConfPrc = null;
InterestProcess interestProcess = null;
PayrollArrearsProcessingPrc payrollArrearsProcessingPrc = null;
HRLogWriter hrLogWriter = null;
UserInfoBean userinfo = null;
String isLogLocationType = "N";
String userId = "", chgTerm = "", loginSite = "",jobId = "", objName = "";
String isLogObjname = "payroll_single";
/*String isActivity = "CompleteProcess";
String isProcId = "CompletePayrollProcess";
String isLogServerAddress = "";
String isWsrLogfname = "";*/
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException
{
System.out.println("PayrollSinglePrc process(String xmlString, String xmlString2, String windowName, String xtraParams) called.............!");
Document detailDom = null;
Document headerDom = null;
String retStr = "";
String retErrStr = "";
String fileNameStartWith = "";
String activity = "";
Connection conn = null;
Connection logConn = null;
hrLogWriter = new HRLogWriter();
try
{
System.out.println("****PayrollSinglePrc process Method called*****");
conn = getConnection();
logConn = getConnection();
System.out.println("Conn ["+conn+"]");
System.out.println("logConn ["+logConn+"]");
System.out.println("xmlString:::" + xmlString);
if (xmlString != null && xmlString.trim().length() != 0)
{
headerDom = genericUtility.parseString(xmlString);
System.out.println("headerDom ["+ genericUtility.serializeDom(headerDom)+"]");
}
if (xmlString2 != null && xmlString2.trim().length() != 0)
{
detailDom = genericUtility.parseString(xmlString2);
System.out.println("detailDom ["+genericUtility.serializeDom(detailDom)+"]");
}
userId = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"));
chgTerm = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId"));
loginSite = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode"));
jobId = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "job_id"));
System.out.println("jobId:::::::::::::::::::" +jobId );
objName = getObjNameFromDom(headerDom, "objName");
hrLogWriter.setTotalRows(0);
hrLogWriter.setRowsProcessed(0);
hrLogWriter.setRowsIgnored(0);
hrLogWriter.setRowsRejected(0);
hrLogWriter.setActivity("CompleteProcess");
activity = hrLogWriter.getActivity();
hrLogWriter.setProcessId("CompletePayrollProcess");
hrLogWriter.setFileNameStartWith("CHGARRPROC_");
fileNameStartWith = hrLogWriter.getFileNameStartWith();
hrLogWriter.initializeHRLogWriter(objName, jobId, userId, chgTerm, activity, fileNameStartWith, loginSite, logConn);
retErrStr = gbfProcess(headerDom, detailDom, windowName, xtraParams, hrLogWriter, conn,logConn);
System.out.println("Process for PayrollSinglePrc :::: " + retErrStr);
if(retErrStr != null && retErrStr.trim().length() > 0)
{
conn.rollback();
System.out.println("Connection has been rollback..!!!!!");
retStr = itmDBAccessEJB.getErrorString("", retErrStr, userId, "", logConn);
hrLogWriter.gbfErrWrite("","", "", retErrStr,"", logConn);
}
else
{
conn.commit();
System.out.println("Connection committed successfully..!!!!!");
retStr = itmDBAccessEJB.getErrorString("", "VPPPSINGL1" , userId, "", conn);
}
}
catch (Exception e)
{
System.out.println("Exception :PayrollSinglePrc :process(String xmlString, String xmlString2, String windowName, String xtraParams):"
+ e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if(conn != null)
{
conn.close();
conn = null;
}
if(logConn != null)
{
logConn.close();
logConn = null;
}
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
}
return retStr;
}
public String gbfProcess(Document headerDom, Document detailDom, String windowName, String xtraParams, HRLogWriter hrLogWriter, Connection conn, Connection logConn) throws ITMException, IOException
{
interestProcess = new InterestProcess();
ResultSet rs = null;
PreparedStatement pstmt = null;
SimpleDateFormat sdf = null;
Timestamp payrollDate = null;
Document arrHeaderDom = null;
Document headerDom1 = null;
NodeList detailList = null;
StringBuffer valueXmlString1 = null;
StringBuffer valueXmlString = null;
String valueXmlStr = null ;
Node currDetail = null;
String currErrorId = "";
StringBuffer valueXmlStringArr = null;
String lsPayrollProjYn = "Y";
String processType = "";
String sql = "";
String jobID = "";
String errString = "",errorCode = "";
String empCodeFr = "";
String empCodeTo = "";
String prdCodeFr = "";
String prdCodeArr = "";
String siteCodeFr = "";
String siteCodeTo = "";
String procGrpFrom = "";
String procGrpTo = "";
String payrollDateStr = "";
String todayDateStr = "";
String lsFileName = "";
String isLogObjName = "";
String isProcId = "";
String isWsrLogFname = "";
int liFile = 0;
String liFileClose = "";
String cbxApChanges = "";
String cbxAp = "";
String cbxIp = "";
String cbxPp = "";
String cbxPy = "";
String lsLogStr = "";
int cnt = 0;
int filePtr = 0;
try
{
System.out.println("****Inside PayrollSinglePrc process method called*****");
payrollSplitgenAccPrc = new PayrollSplitgenAccPrc();
interestProcessConfPrc = new InterestProcessConfPrc();
payrollArrearsProcessingPrc = new PayrollArrearsProcessingPrc();
jobId = hrLogWriter.getJobID();
System.out.println("jobId:::::::::::::::::::" +jobId );
valueXmlString = new StringBuffer("<DocumentRoot><description>Datawindow Root</description><group0>");
valueXmlString.append("<description>Group0 description</description>").append("<Header0>");
valueXmlString.append("<description>Header0 members</description>");
valueXmlString.append("<Detail1 dbID=\"\" domID=\"1\" objContext=\"1\" objName=\"payroll_single\">");
valueXmlString.append("<attribute pkNames=\"\" selected=\"\" status=\"\" updateFlag=\"\"/>");
valueXmlStr = valueXmlString.toString();
do
{
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
todayDateStr = sdf.format(new java.util.Date());
interestProcessConfPrc.isSingle = "Y";
payrollSplitgenAccPrc.isSingle = "Y";
payrollSplitgenAccPrc.isCaller = "SINGLE";
empCodeFr = checkNull(genericUtility.getColumnValue("emp_code__fr", headerDom));
empCodeTo = checkNull(genericUtility.getColumnValue("emp_code__to", headerDom));
if(empCodeFr == null || empCodeFr.trim().length() == 0)
{
empCodeFr = "0";
}
if(empCodeTo == null || empCodeTo.trim().length() == 0)
{
empCodeTo = "ZZZZZ";
}
prdCodeFr = checkNull(genericUtility.getColumnValue("prd_code__fr", headerDom));
prdCodeArr = checkNull(genericUtility.getColumnValue("prd_code__arr", headerDom));
siteCodeFr = checkNull(genericUtility.getColumnValue("site_code__fr", headerDom));
siteCodeTo = checkNull(genericUtility.getColumnValue("site_code__to", headerDom));
if(siteCodeFr == null || siteCodeFr.trim().length() == 0)
{
siteCodeFr = "0";
}
if(siteCodeTo == null || siteCodeTo.trim().length() == 0)
{
siteCodeTo = "ZZZZZ";
}
procGrpFrom = checkNull(genericUtility.getColumnValue("proc_group__from", headerDom));
procGrpTo = checkNull(genericUtility.getColumnValue("proc_group__to", headerDom));
if(procGrpFrom == null || procGrpFrom.trim().length() == 0)
{
procGrpFrom = "0";
}
if(procGrpTo == null || procGrpTo.trim().length() == 0)
{
procGrpTo = "ZZZZZ";
}
payrollDateStr = checkNull(genericUtility.getColumnValue("payroll_date", headerDom));
if(payrollDateStr != null && payrollDateStr.trim().length() > 0)
{
payrollDate = Timestamp.valueOf(genericUtility.getValidDateTimeString(payrollDateStr,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()));
}
System.out.println("payrollDate:::::::::::::" +payrollDate);
//hrLogWriter.initializeHRLogWriter(objName, jobID, userId, chgTerm, activity, fileNameStartName, loginSite, conn);
liFile = hrLogWriter.getLogWriterFlag();
if(liFile == -1)
{
gbfReleaseLogWriter(headerDom, hrLogWriter, conn);
return errString;
}
else
{
lsFileName = hrLogWriter.getLogFileName();
isLogObjName = hrLogWriter.getObjName();
isProcId = hrLogWriter.getProcessId();
filePtr = hrLogWriter.getFilePointer();
interestProcess.isLogFileName = lsFileName;
payrollSplitgenAccPrc.isFilename = lsFileName;
payrollArrearsProcessingPrc.isLogfileName = lsFileName;
payrollSplitgenAccPrc.isFilename = isLogObjName;
payrollSplitgenAccPrc.isProcId = isProcId;
isWsrLogFname = hrLogWriter.getWsrLogFileName();
if (siteCodeFr.trim().toUpperCase().equalsIgnoreCase(siteCodeTo.trim().toUpperCase()))
{
lsLogStr = "Complete Payroll Processing Started for Site: " + siteCodeFr;
}
else
{
lsLogStr = "Complete Payroll Processing Started for Sites between: " +siteCodeFr+ " To:" +siteCodeTo;
}
hrLogWriter.gbfErrWrite("", "", "", lsLogStr, "I",logConn);
}
cbxApChanges = checkNull(genericUtility.getColumnValue("cbx_ap_changes", headerDom));
cbxAp = checkNull(genericUtility.getColumnValue("cbx_ap", headerDom));
if("Y".equalsIgnoreCase(cbxApChanges) || "Y".equalsIgnoreCase(cbxAp))
{
if(prdCodeArr == null || prdCodeArr.trim().length() == 0 || prdCodeArr.compareTo(prdCodeFr) < 0)
{
errorCode = "VTARRPRD";
}
else
{
sql = " select count(*) as cnt from period where code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, prdCodeArr);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("cnt");
}
if (rs != null )
{
rs.close();
rs = null;
}
if (pstmt != null )
{
pstmt.close();
pstmt = null;
}
if (cnt == 0)
{
errorCode = "VMARRPRD";
}
}
if(errorCode != null && errorCode.trim().length() > 0)
{
if (siteCodeFr.trim().toUpperCase().equalsIgnoreCase(siteCodeTo.trim().toUpperCase()))
{
lsLogStr = "Complete Payroll Processing Started for Site: " + siteCodeFr;
}
else
{
lsLogStr = "Complete Payroll Processing Started for Sites between: " +siteCodeFr+ " To:" +siteCodeTo;
}
hrLogWriter.gbfErrWrite("", "", "", lsLogStr, "I",logConn);
gbfReleaseLogWriter(headerDom, hrLogWriter, logConn);
return errorCode;
}
}
// -------------- InterestProcessConfPrc.java--------------------------
cbxIp = checkNull(genericUtility.getColumnValue("cbx_ip", headerDom));// Interest Processing
cbxPp = checkNull(genericUtility.getColumnValue("cbx_pp", headerDom));// Payroll Projection
cbxPy = checkNull(genericUtility.getColumnValue("cbx_py", headerDom));//Payroll Processing
if (("Y".equalsIgnoreCase(cbxIp)) && (("Y".equalsIgnoreCase(cbxPp)) || ("Y".equalsIgnoreCase(cbxPy))))
{
interestProcessConfPrc.isSingle = "Y";
valueXmlString1 = new StringBuffer();
valueXmlString1.append("<prd_code>").append("<![CDATA[" + prdCodeFr +"]]>").append("</prd_code>");
valueXmlString1.append("<emp_code>").append("<![CDATA[" + empCodeFr +"]]>").append("</emp_code>");
valueXmlString1.append("<emp_code_to>").append("<![CDATA[" + empCodeTo +"]]>").append("</emp_code_to>");
valueXmlString1.append("<site_code__fr>").append("<![CDATA[" + siteCodeFr +"]]>").append("</site_code__fr>");
valueXmlString1.append("<site_code__to>").append("<![CDATA[" + siteCodeTo +"]]>").append("</site_code__to>");
valueXmlString1.append("<proc_group__fr>").append("<![CDATA[" + procGrpFrom +"]]>").append("</proc_group__fr>");
valueXmlString1.append("<proc_group__to>").append("<![CDATA[" + procGrpTo +"]]>").append("</proc_group__to>");
valueXmlString1.append("<dataowrite><![CDATA[").append("Y").append("]]></dataowrite>");
valueXmlString1.append("</Detail1></Header0></group0></DocumentRoot>");
valueXmlStringArr = new StringBuffer();
valueXmlStringArr.append(valueXmlStr).append(valueXmlString1);
System.out.println("valueXmlStringArr::: " + valueXmlStringArr);
if(valueXmlStringArr != null)
{
arrHeaderDom = genericUtility.parseString(valueXmlStringArr.toString());
}
interestProcessConfPrc.gbfSetLogPropertiesByCaller(hrLogWriter);
errString = interestProcessConfPrc.process(arrHeaderDom, arrHeaderDom, windowName, xtraParams, hrLogWriter, conn, logConn);
gbfSetLogPropertiesByCaller(hrLogWriter);
if(errString != null && errString.trim().length() > 0)
{
headerDom1 = genericUtility.parseString(errString);
detailList = headerDom1.getElementsByTagName("error");
currDetail = detailList.item(0);
currErrorId = currDetail.getAttributes().getNamedItem("id").getNodeValue();
System.out.println("currErrorId getting from errString:::: " + currErrorId);
errorCode = currErrorId;
hrLogWriter.gbfErrWrite("", "", "", errorCode, "I",logConn);
}
}
if(hrLogWriter.getJobID() != null && (hrLogWriter.getJobID().trim().length()) > 0)
{
if(hrLogWriter.gfJobterminateRequested(hrLogWriter.getJobID(), logConn))
{
hrLogWriter.setJobTerminateRequested("Y");
break;
}
}
// -------------- PayrollSplitgenAccPrc.java--------------------------
cbxPp = checkNull(genericUtility.getColumnValue("cbx_pp", headerDom));// Payroll Projection
cbxAp = checkNull(genericUtility.getColumnValue("cbx_ap", headerDom));// Arrears Processing
cbxApChanges = checkNull(genericUtility.getColumnValue("cbx_ap_changes", headerDom));//Changed Arrears Processing
cbxPy = checkNull(genericUtility.getColumnValue("cbx_py", headerDom)); // Payroll Processing
if("Y".equalsIgnoreCase(cbxPp))
{
if(("Y".equalsIgnoreCase(cbxPy)) || ("Y".equalsIgnoreCase(cbxAp)) || ("N".equalsIgnoreCase(cbxPy) && "N".equalsIgnoreCase(cbxAp) && "N".equalsIgnoreCase(cbxApChanges)))
{
lsPayrollProjYn = "N";
payrollSplitgenAccPrc.isOwrite = "Y";
processType = "PP";
valueXmlString1 = new StringBuffer();
valueXmlString1.append("<type>").append("<![CDATA[" + processType +"]]>").append("</type>");
valueXmlString1.append("<payroll_date>").append("<![CDATA[" + payrollDateStr +"]]>").append("</payroll_date>");
valueXmlString1.append("<emp_code__fr>").append("<![CDATA[" + empCodeFr +"]]>").append("</emp_code__fr>");
valueXmlString1.append("<emp_code__to>").append("<![CDATA[" + empCodeTo +"]]>").append("</emp_code__to>");// changed 1
valueXmlString1.append("<prd_code__fr>").append("<![CDATA[" + prdCodeFr +"]]>").append("</prd_code__fr>");
valueXmlString1.append("<prd_code__to>").append("<![CDATA[" + prdCodeFr +"]]>").append("</prd_code__to>");
valueXmlString1.append("<site_code__fr>").append("<![CDATA[" + siteCodeFr +"]]>").append("</site_code__fr>"); // changed 3
valueXmlString1.append("<site_code__to>").append("<![CDATA[" + siteCodeTo +"]]>").append("</site_code__to>");
valueXmlString1.append("<proc_group__from>").append("<![CDATA[" + procGrpFrom +"]]>").append("</proc_group__from>");// changed 2
valueXmlString1.append("<proc_group__to>").append("<![CDATA[" + procGrpTo +"]]>").append("</proc_group__to>");
valueXmlString1.append("<prd_code__arr>").append("<![CDATA[" + prdCodeArr +"]]>").append("</prd_code__arr>");
valueXmlString1.append("<dataowrite><![CDATA[").append("Y").append("]]></dataowrite>");
valueXmlString1.append("</Detail1></Header0></group0></DocumentRoot>");
valueXmlStringArr = new StringBuffer();
valueXmlStringArr.append(valueXmlStr).append(valueXmlString1);
System.out.println("valueXmlStringArr::: " + valueXmlStringArr);
if(valueXmlStringArr != null)
{
arrHeaderDom = genericUtility.parseString(valueXmlStringArr.toString());
}
payrollSplitgenAccPrc.gbfSetLogPropertiesByCaller(hrLogWriter);
errorCode = payrollSplitgenAccPrc.gbfProcessPayroll(arrHeaderDom, arrHeaderDom, xtraParams, hrLogWriter, conn, logConn);
gbfSetLogPropertiesFromTarget();
if(errorCode != null && errorCode.trim().length() > 0 )
{
if (siteCodeFr.trim().toUpperCase().equalsIgnoreCase(siteCodeTo.trim().toUpperCase()))
{
lsLogStr = "Complete Payroll Processing Started for Site: " + siteCodeFr;
}
else
{
lsLogStr = "Complete Payroll Processing Started for Sites between: " +siteCodeFr+ " To:" +siteCodeTo;
}
hrLogWriter.gbfErrWrite("", "", "", lsLogStr, "I",logConn);
gbfReleaseLogWriter(headerDom, hrLogWriter, logConn);
return errorCode;
}
}
else if("Y".equalsIgnoreCase(cbxApChanges))
{
lsPayrollProjYn = "Y";
}
else
{
lsPayrollProjYn = "N";
}
}
if(hrLogWriter.getJobID() != null && hrLogWriter.getJobID().trim().length() > 0)
{
if(hrLogWriter.gfJobterminateRequested(jobID, logConn))
{
hrLogWriter.setJobTerminateRequested("Y");
break;
}
}
// -------------- PayrollArrearsProcessingPrc.java--------------------------
cbxApChanges = checkNull(genericUtility.getColumnValue("cbx_ap_changes", headerDom));//Changed Arrears Processing
if("Y".equalsIgnoreCase(cbxApChanges))
{
payrollArrearsProcessingPrc.ibTodoprojection = true;
processType = "AR";
valueXmlString1 = new StringBuffer();
valueXmlString1.append("<type>").append("<![CDATA[" + processType +"]]>").append("</type>");
valueXmlString1.append("<payroll_date>").append("<![CDATA[" + payrollDateStr +"]]>").append("</payroll_date>");
valueXmlString1.append("<emp_code__fr>").append("<![CDATA[" + empCodeFr +"]]>").append("</emp_code__fr>");
valueXmlString1.append("<emp_code__to>").append("<![CDATA[" + empCodeTo +"]]>").append("</emp_code__to>"); // changed 4
valueXmlString1.append("<site_code__fr>").append("<![CDATA[" + siteCodeFr +"]]>").append("</site_code__fr>");// changed 5
valueXmlString1.append("<site_code__to>").append("<![CDATA[" + siteCodeTo +"]]>").append("</site_code__to>");
valueXmlString1.append("<proc_group__from>").append("<![CDATA[" + procGrpFrom +"]]>").append("</proc_group__from>");
valueXmlString1.append("<proc_group__to>").append("<![CDATA[" + procGrpTo +"]]>").append("</proc_group__to>");
valueXmlString1.append("<prd_code__arr>").append("<![CDATA[" + prdCodeArr +"]]>").append("</prd_code__arr>");
valueXmlString1.append("<currmth_pp_flag>").append("<![CDATA[" + lsPayrollProjYn +"]]>").append("</currmth_pp_flag>");
valueXmlString1.append("<dataowrite><![CDATA[").append("Y").append("]]></dataowrite>");
valueXmlString1.append("</Detail1></Header0></group0></DocumentRoot>");
valueXmlStringArr = new StringBuffer();
valueXmlStringArr.append(valueXmlStr).append(valueXmlString1);
System.out.println("valueXmlStringArr::: " + valueXmlStringArr);
if(valueXmlStringArr != null)
{
arrHeaderDom = genericUtility.parseString(valueXmlStringArr.toString());
}
payrollArrearsProcessingPrc.gbfSetLogPropertiesByCaller(hrLogWriter);
errorCode = payrollArrearsProcessingPrc.process(arrHeaderDom, arrHeaderDom, windowName,xtraParams, hrLogWriter, conn, logConn);
gbfSetLogPropertiesFromTarget();
payrollSplitgenAccPrc.isCaller = "SINGLE";
if(errorCode != null && errorCode.trim().length() > 0 )
{
if (siteCodeFr.trim().toUpperCase().equalsIgnoreCase(siteCodeTo.trim().toUpperCase()))
{
lsLogStr = "Complete Payroll Processing Started for Site: " + siteCodeFr;
}
else
{
lsLogStr = "Complete Payroll Processing Started for Sites between: " +siteCodeFr+ " To:" +siteCodeTo;
}
hrLogWriter.gbfErrWrite("", "", "", lsLogStr, "I",logConn);
gbfReleaseLogWriter(headerDom, hrLogWriter, logConn);
return errorCode;
}
}
if(hrLogWriter.getJobID() != null && hrLogWriter.getJobID().trim().length() > 0)
{
if(hrLogWriter.gfJobterminateRequested(jobID, logConn))
{
hrLogWriter.setJobTerminateRequested("Y");
break;
}
}
// -------------- PayrollSplitgenAccPrc.java--------------------------
cbxAp = checkNull(genericUtility.getColumnValue("cbx_ap", headerDom));// Arrears Processing
if("Y".equalsIgnoreCase(cbxAp))
{
payrollSplitgenAccPrc.isOwrite = "Y";
processType = "AR";
valueXmlString1 = new StringBuffer();
valueXmlString1.append("<type>").append("<![CDATA[" + processType +"]]>").append("</type>");
valueXmlString1.append("<payroll_date>").append("<![CDATA[" + payrollDateStr +"]]>").append("</payroll_date>");
valueXmlString1.append("<emp_code__fr>").append("<![CDATA[" + empCodeFr +"]]>").append("</emp_code__fr>");
valueXmlString1.append("<emp_code__to>").append("<![CDATA[" + empCodeTo +"]]>").append("</emp_code__to>"); // changed 6
valueXmlString1.append("<prd_code__fr>").append("<![CDATA[" + prdCodeFr +"]]>").append("</prd_code__fr>");
valueXmlString1.append("<prd_code__to>").append("<![CDATA[" + prdCodeFr +"]]>").append("</prd_code__to>");
valueXmlString1.append("<site_code__fr>").append("<![CDATA[" + siteCodeFr +"]]>").append("</site_code__fr>"); // changed 7
valueXmlString1.append("<site_code__to>").append("<![CDATA[" + siteCodeTo +"]]>").append("</site_code__to>");
valueXmlString1.append("<proc_group__from>").append("<![CDATA[" + procGrpFrom +"]]>").append("</proc_group__from>");
valueXmlString1.append("<proc_group__to>").append("<![CDATA[" + procGrpTo +"]]>").append("</proc_group__to>");
valueXmlString1.append("<prd_code__arr>").append("<![CDATA[" + prdCodeArr +"]]>").append("</prd_code__arr>");
valueXmlString1.append("<dataowrite><![CDATA[").append("Y").append("]]></dataowrite>");
valueXmlString1.append("</Detail1></Header0></group0></DocumentRoot>");
valueXmlStringArr = new StringBuffer();
valueXmlStringArr.append(valueXmlStr).append(valueXmlString1);
System.out.println("valueXmlStringArr::: " + valueXmlStringArr);
if(valueXmlStringArr != null)
{
arrHeaderDom = genericUtility.parseString(valueXmlStringArr.toString());
}
payrollSplitgenAccPrc.gbfSetLogPropertiesByCaller(hrLogWriter);
errorCode = payrollSplitgenAccPrc.gbfProcessPayroll(arrHeaderDom, arrHeaderDom, xtraParams, hrLogWriter, conn, logConn);
gbfSetLogPropertiesFromTarget();
if(errorCode != null && errorCode.trim().length() > 0 )
{
if (siteCodeFr.trim().toUpperCase().equalsIgnoreCase(siteCodeTo.trim().toUpperCase()))
{
lsLogStr = "Complete Payroll Processing Started for Site: " + siteCodeFr;
}
else
{
lsLogStr = "Complete Payroll Processing Started for Sites between: " +siteCodeFr+ " To:" +siteCodeTo;
}
hrLogWriter.gbfErrWrite("", "", "", lsLogStr, "I",logConn);
gbfReleaseLogWriter(headerDom, hrLogWriter, logConn);
return errorCode;
}
}
if(hrLogWriter.getJobID() != null && hrLogWriter.getJobID().trim().length() > 0)
{
if(hrLogWriter.gfJobterminateRequested(jobID, logConn))
{
hrLogWriter.setJobTerminateRequested("Y");
break;
}
}
// -------------- PayrollSplitgenAccPrc.java --------------------------
cbxPy = checkNull(genericUtility.getColumnValue("cbx_py", headerDom)); // Payroll Processing
if(cbxPy.equalsIgnoreCase("Y"))
{
payrollSplitgenAccPrc.isOwrite = "Y";
processType = "PY";
valueXmlString1 = new StringBuffer();
valueXmlString1.append("<type>").append("<![CDATA[" + processType +"]]>").append("</type>");
valueXmlString1.append("<payroll_date>").append("<![CDATA[" + payrollDateStr +"]]>").append("</payroll_date>");
valueXmlString1.append("<emp_code__fr>").append("<![CDATA[" + empCodeFr +"]]>").append("</emp_code__fr>");
valueXmlString1.append("<emp_code__to>").append("<![CDATA[" + empCodeTo +"]]>").append("</emp_code__to>"); // changed 8
valueXmlString1.append("<prd_code__fr>").append("<![CDATA[" + prdCodeFr +"]]>").append("</prd_code__fr>");
valueXmlString1.append("<prd_code__to>").append("<![CDATA[" + prdCodeFr +"]]>").append("</prd_code__to>");
valueXmlString1.append("<site_code__fr>").append("<![CDATA[" + siteCodeFr +"]]>").append("</site_code__fr>");// changed 9
valueXmlString1.append("<site_code__to>").append("<![CDATA[" + siteCodeTo +"]]>").append("</site_code__to>");
valueXmlString1.append("<proc_group__from>").append("<![CDATA[" + procGrpFrom +"]]>").append("</proc_group__from>");
valueXmlString1.append("<proc_group__to>").append("<![CDATA[" + procGrpTo +"]]>").append("</proc_group__to>");
valueXmlString1.append("<prd_code__arr>").append("<![CDATA[" + prdCodeArr +"]]>").append("</prd_code__arr>");
valueXmlString1.append("<dataowrite><![CDATA[").append("Y").append("]]></dataowrite>");
valueXmlString1.append("</Detail1></Header0></group0></DocumentRoot>");
valueXmlStringArr = new StringBuffer();
valueXmlStringArr.append(valueXmlStr).append(valueXmlString1);
System.out.println("valueXmlStringArr::: " + valueXmlStringArr);
if(valueXmlStringArr != null)
{
arrHeaderDom = genericUtility.parseString(valueXmlStringArr.toString());
}
payrollSplitgenAccPrc.gbfSetLogPropertiesByCaller(hrLogWriter);
errorCode = payrollSplitgenAccPrc.gbfProcessPayroll(arrHeaderDom, arrHeaderDom, xtraParams, hrLogWriter, conn, logConn);
gbfSetLogPropertiesFromTarget();
if(errorCode != null && errorCode.trim().length() > 0 )
{
if (siteCodeFr.trim().toUpperCase().equalsIgnoreCase(siteCodeTo.trim().toUpperCase()))
{
lsLogStr = "Complete Payroll Processing Started for Site: " + siteCodeFr;
}
else
{
lsLogStr = "Complete Payroll Processing Started for Sites between: " +siteCodeFr+ " To:" +siteCodeTo;
}
hrLogWriter.gbfErrWrite("", "", "", lsLogStr, "I",logConn);
gbfReleaseLogWriter(headerDom, hrLogWriter, logConn);
return errorCode;
}
}
break;
}
while(true);
if(hrLogWriter.getJobTerminateRequested().equalsIgnoreCase("Y"))
{
hrLogWriter.gbfErrWrite("","" ,"","Complete Payroll Process Terminated on request", "I", logConn);
}
if (siteCodeFr.trim().toUpperCase().equalsIgnoreCase(siteCodeTo.trim().toUpperCase()))
{
lsLogStr = "Complete Payroll Processing Started for Site: " + siteCodeFr;
}
else
{
lsLogStr = "Complete Payroll Processing Started for Sites between: " +siteCodeFr+ " To:" +siteCodeTo;
}
hrLogWriter.gbfErrWrite("", "", "", lsLogStr, "I",logConn);
gbfReleaseLogWriter(headerDom, hrLogWriter, logConn);
}
catch (Exception e)
{
System.out.println("Exception :PayrollSinglePrc :process(Document headerDom, Document detailDom, String windowName, String xtraParams, Connection conn, Connection logConn):"
+ e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}
return errorCode;
}
private String getObjNameFromDom(Document dom, String attribute) throws RemoteException, ITMException
{
String objName = "";
try
{
NodeList detailList = null;
Node currDetail = null;
int detailListLength = 0;
detailList = dom.getElementsByTagName("Detail1");
detailListLength = detailList.getLength();
for (int ctr = 0; ctr < detailListLength; ctr++)
{
currDetail = detailList.item(ctr);
objName = currDetail.getAttributes().getNamedItem(attribute).getNodeValue();
}
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
return objName;
}
public void gbfSetLogPropertiesByCaller(HRLogWriter logwriterDb)
{
hrLogWriter = new HRLogWriter();
try
{
System.out.println("Inside PayrollSinglePrc.gbf_set_log_properties_by_caller()");
hrLogWriter.setJobID(logwriterDb.getJobID());
hrLogWriter.setLineNo(logwriterDb.getLineNo());
hrLogWriter.setObjName(logwriterDb.getObjName());
if(logwriterDb.getTransactionCreatedBy() == null && logwriterDb.getTransactionCreatedBy() != null)
{
hrLogWriter.setTransactionCreatedBy(logwriterDb.getTransactionCreatedBy());
hrLogWriter.setTransactionCreatedBy("caller");
}
if(logwriterDb.getLogFileName() != null && logwriterDb.getLogFileName().trim().length() > 0)
{
hrLogWriter.setLogFileName(logwriterDb.getLogFileName());
hrLogWriter.setLogFileCreatedBy("caller");
}
if(logwriterDb.getFilePointer() != 0 && logwriterDb.getFilePointer() > 0)
{
hrLogWriter.setFilePointer(logwriterDb.getFilePointer());
hrLogWriter.setLogFileCreatedBy("caller");
}
if(logwriterDb.getWsrLogFileName() != null && logwriterDb.getWsrLogFileName().trim().length() > 0)
{
hrLogWriter.setWsrLogFileName(logwriterDb.getWsrLogFileName());
}
if(logwriterDb.getLogLocationType() != null && logwriterDb.getLogLocationType().trim().length() > 0)
{
hrLogWriter.setLogLocationType(logwriterDb.getLogLocationType());
hrLogWriter.setLogServerAddress(logwriterDb.getLogServerAddress());
}
hrLogWriter.setProcessId(logwriterDb.getProcessId());
hrLogWriter.setLogLineNo(logwriterDb.getLogLineNo());
if(logwriterDb.getStartDateTime() != null)
{
hrLogWriter.setStartDateTime(logwriterDb.getStartDateTime());
}
if(logwriterDb.getJobID() != null && logwriterDb.getJobID().trim().length() > 0)
{
hrLogWriter.setJobID(logwriterDb.getJobID());
}
}
catch (Exception e)
{
System.out.println("PayrollSinglePrc.gbf_set_log_properties_by_caller()" + e);
e.printStackTrace();
}
System.out.println("PayrollSinglePrc.gbf_set_log_properties_by_caller()======= Completed");
}
public int gbfReleaseLogWriter(Document headerDom, HRLogWriter hrLogWriter, Connection logConn) throws ITMException
{
int liRet = 1;
String lsLogStr = "", frEmp = "", toEmp = "", fromPrd = "", toPrd = "", frSite = "", toSite = "", mtype = "";
int rowsRejected = 0, rowsProcessed = 0;
try
{
frEmp = checkNull(genericUtility.getColumnValue("emp_code__fr", headerDom));
toEmp = checkNull(genericUtility.getColumnValue("emp_code__to", headerDom));
if (frEmp == null || frEmp.trim().length() == 0)
{
frEmp = "0";
}
if (toEmp == null || toEmp.trim().length() == 0)
{
toEmp = "Z";
}
fromPrd = checkNull(genericUtility.getColumnValue("prd_code__fr", headerDom));
toPrd = checkNull(genericUtility.getColumnValue("prd_code__to", headerDom));
frSite = checkNull(genericUtility.getColumnValue("site_code__fr", headerDom));
toSite = checkNull(genericUtility.getColumnValue("site_code__to", headerDom));
if (frSite == null || frSite.trim().length() == 0)
{
frSite = "0";
}
if (toSite == null || toSite.trim().length() == 0)
{
toSite = "Z";
}
mtype = checkNull(genericUtility.getColumnValue("type", headerDom));
rowsProcessed = hrLogWriter.getRowsProcessed();
rowsRejected = hrLogWriter.getRowsRejected();
System.out.println("rowsProcessed==>" + rowsProcessed + " rowsRejected==>" + rowsRejected);
lsLogStr = "Total Employees: " + String.valueOf(rowsProcessed + rowsRejected) + " Processed: " + rowsProcessed
+ " Rejected: " + rowsRejected;
hrLogWriter.gbfErrWrite("", "", mtype, lsLogStr, "I",logConn);
if (frSite.trim().toUpperCase().equalsIgnoreCase(toSite.trim().toUpperCase()))
{
lsLogStr = "Processing Over for Site: " + frSite;
}
else
{
lsLogStr = "Processing Over for Sites between: " + frSite + " To: " + toSite;
}
hrLogWriter.gbfErrWrite("", "", mtype, lsLogStr, "I",logConn);
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
return liRet;
}
public HRLogWriter gbfServeLogPropertiesToCaller()
{
HRLogWriter hrLogWriter = new HRLogWriter();
return hrLogWriter;
}
public void gbfSetLogPropertiesFromTarget()
{
System.out.println("PayrollSinglePrc.gbfSetLogPropertiesFromTarget()");
HRLogWriter lstrLogWriter = new HRLogWriter();
lstrLogWriter = gbfServeLogPropertiesToCaller();
}
private String checkNull(String input)
{
return input == null ? "" : input;
}
}
/*
Window Name : w_payroll_single
Auther : Poonam
*/
package ibase.webitm.ejb.adm;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.text.SimpleDateFormat;
import org.w3c.dom.Document;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.fin.FinCommon;
import ibase.webitm.ejb.sys.UtilMethods;
import ibase.webitm.utility.ITMException;
public class PayrollSinglePrcIC extends ValidatorEJB implements PayrollSinglePrcICLocal, PayrollSinglePrcICRemote
{
E12GenericUtility genericUtility = new E12GenericUtility();
AdmCommon admCommon = new AdmCommon();
UtilMethods utilmethod = new UtilMethods();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
FinCommon finCommon = new FinCommon();
public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException
{
Document dom = null;
Document domhr = null;
Document domAll = null;
String retString = "";
try
{
System.out.println("************** Inside itemChanged method of PayrollSinglePrcIC ****************");
if(xmlString != null && xmlString.trim().length() > 0)
{
dom = genericUtility.parseString(xmlString);
}
if(xmlString1 != null && xmlString1.trim().length() > 0)
{
domhr = genericUtility.parseString(xmlString1);
}
if(xmlString2 != null && xmlString2.trim().length() > 0)
{
domAll = genericUtility.parseString(xmlString2);
}
retString = itemChanged(dom,domhr,domAll,objContext,currentColumn,editFlag,xtraParams);
System.out.println("retString:::::::::: "+retString);
}
catch(Exception e)
{
System.out.println(":::" + getClass().getSimpleName() + "::"+ e.getMessage());
e.getMessage();
throw new ITMException(e);
}
return retString;
}
public String itemChanged(Document dom, Document dom1, Document dom2,String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException
{
PreparedStatement pstmt = null;
ResultSet rs = null;
SimpleDateFormat sdf = null;
Connection connection = null;
int currentFormNo = 0;
int usr_lev = 0;
String mlevl = null;
String sql = "";
String userId = "";
String loginSite = "";
String prdCode = "";
String prdDescr = "", siteDescr = "";
String currDate = "";
String empCodeFr = "",empFname = "", empLname = "", empCodeTo = "";
String prdCodeFrDescr = "", prdCodeFr = "";
String prdCodeToDescr = "", prdCodeTo = "";
String prdCodeType = "", type = "";
String siteCdFrDescr = "", siteCodeFr = "";
String siteCdToDescr = "", siteCodeTo = "";
String procGrpFrmDescr = "", procGrpFrm = "";
String procGrpToDescr = "", procGrpTo = "";
StringBuffer valueXmlString = new StringBuffer();
try
{
connection = getConnection();
if (objContext != null && objContext.trim().length() > 0)
{
currentFormNo = Integer.parseInt(objContext);
}
System.out.println("[" + this.getClass().getSimpleName() + "] [itemChanged(D)]:currentFormNo:" + currentFormNo);
System.out.println("currentColumn:::::" + currentColumn);
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
System.out.println("userId::::::::::::::::" +userId);
valueXmlString = new StringBuffer("<?xml version=\"1.0\" encoding=''?>\r\n<Root>\r\n<header>\r\n<editFlag>");
valueXmlString.append(editFlag).append("</editFlag>\r\n</header>\r\n");
sdf = new SimpleDateFormat(genericUtility.getDispDateFormat());
currDate = sdf.format(new java.util.Date());
if(mlevl == null)
{
sql = "select usr_lev from users where code = ?";
pstmt = connection.prepareStatement(sql);
pstmt.setString(1, userId);
rs = pstmt.executeQuery();
if (rs.next())
{
usr_lev = rs.getInt("usr_lev");
System.out.println("usr_lev >> ["+usr_lev+"]");
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
switch (currentFormNo)
{
case 1:
valueXmlString.append("<Detail1>\r\n");
if (currentColumn.trim().equals("itm_default"))
{
System.out.println("--------Inside itm_default--------");
System.out.println("xtraParams------- "+xtraParams);
valueXmlString.append("<prd_code__to protect=\"1\"><![CDATA[]]></prd_code__to>\r\n");
valueXmlString.append("<prd_code__arr protect=\"0\"><![CDATA[]]></prd_code__arr>\r\n");
valueXmlString.append("<type protect=\"1\"><![CDATA[]]></type>\r\n");
sql = "select prd_code from parameter";
pstmt = connection.prepareStatement(sql);
rs = pstmt.executeQuery();
if (rs.next())
{
prdCode = checkNull(rs.getString("prd_code"));
System.out.println("prdCode >> ["+prdCode+"]");
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
valueXmlString.append("<prd_code__fr><![CDATA[").append(prdCode).append("]]></prd_code__fr>");
valueXmlString.append("<prd_code__to><![CDATA[").append(prdCode).append("]]></prd_code__to>");
valueXmlString.append("<prd_code__arr><![CDATA[").append(prdCode).append("]]></prd_code__arr>");
sql = "select descr from period where code = ?";
pstmt = connection.prepareStatement(sql);
pstmt.setString(1, prdCode);
rs = pstmt.executeQuery();
if (rs.next())
{
prdDescr = checkNull(rs.getString("descr"));
System.out.println("prdDescr >> ["+prdDescr+"]");
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
valueXmlString.append("<fr_prd_descr><![CDATA[").append(prdDescr).append("]]></fr_prd_descr>");
valueXmlString.append("<to_prd_descr><![CDATA[").append(prdDescr).append("]]></to_prd_descr>");
valueXmlString.append("<payroll_date><![CDATA[").append(currDate).append("]]></payroll_date>");
if(usr_lev > 1)
{
valueXmlString.append("<site_code__fr><![CDATA[").append("").append("]]></site_code__fr>\r\n");
valueXmlString.append("<site_code__to><![CDATA[").append("").append("]]></site_code__to>\r\n");
}
loginSite = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
System.out.println("loginSite ==== "+loginSite);
if(loginSite != null && loginSite.trim().length() > 0)
{
valueXmlString.append("<site_code__fr><![CDATA[").append(loginSite).append("]]></site_code__fr>\r\n");
valueXmlString.append("<site_code__to><![CDATA[").append(loginSite).append("]]></site_code__to>\r\n");
sql = "select descr from site where site_code = ?";
pstmt = connection.prepareStatement(sql);
pstmt.setString(1, loginSite);
rs = pstmt.executeQuery();
if (rs.next())
{
siteDescr = checkNull(rs.getString("descr"));
System.out.println("siteDescr >> ["+siteDescr+"]");
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
valueXmlString.append("<fr_site_descr><![CDATA[").append(siteDescr).append("]]></fr_site_descr>\r\n");
valueXmlString.append("<to_site_descr><![CDATA[").append(siteDescr).append("]]></to_site_descr>\r\n");
}
valueXmlString.append("<consider_attd><![CDATA[").append("N").append("]]></consider_attd>\r\n");
valueXmlString.append("<cbx_ip protect=\"1\"><![CDATA[").append("Y").append("]]></cbx_ip>\r\n");
valueXmlString.append("<cbx_pp protect=\"1\"><![CDATA[").append("Y").append("]]></cbx_pp>\r\n");
valueXmlString.append("<cbx_py><![CDATA[").append("Y").append("]]></cbx_py>\r\n");
valueXmlString.append("<cbx_ap><![CDATA[").append("N").append("]]></cbx_ap>\r\n");
valueXmlString.append("<cbx_ap_changes><![CDATA[").append("Y").append("]]></cbx_ap_changes>\r\n");
}
if (currentColumn.trim().equals("emp_code__fr"))
{
empCodeFr = checkNull(genericUtility.getColumnValue("emp_code__fr", dom));
sql = "select emp_fname, emp_lname from employee where emp_code = ?";
pstmt = connection.prepareStatement(sql);
pstmt.setString(1, empCodeFr);
rs = pstmt.executeQuery();
if (rs.next())
{
empFname = checkNull(rs.getString("emp_fname"));
empLname = checkNull(rs.getString("emp_lname"));
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("empFname >> ["+empFname+"]");
System.out.println("empLname >> ["+empLname+"]");
valueXmlString.append("<emp_name__fr><![CDATA[").append(empFname+" "+empLname).append("]]></emp_name__fr>\r\n");
}
if (currentColumn.trim().equals("emp_code__to"))
{
empCodeTo = checkNull(genericUtility.getColumnValue("emp_code__to", dom));
sql = "select emp_fname, emp_lname from employee where emp_code = ?";
pstmt = connection.prepareStatement(sql);
pstmt.setString(1, empCodeTo);
rs = pstmt.executeQuery();
if (rs.next())
{
empFname = checkNull(rs.getString("emp_fname"));
empLname = checkNull(rs.getString("emp_lname"));
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("empFname >> ["+empFname+"]");
System.out.println("empLname >> ["+empLname+"]");
valueXmlString.append("<emp_name__to><![CDATA[").append(empFname+" "+empLname).append("]]></emp_name__to>\r\n");
}
if (currentColumn.trim().equals("prd_code__fr"))
{
prdCodeFr = checkNull(genericUtility.getColumnValue("prd_code__fr", dom));
sql = "select descr from period where code = ?";
pstmt = connection.prepareStatement(sql);
pstmt.setString(1, prdCodeFr);
rs = pstmt.executeQuery();
if (rs.next())
{
prdCodeFrDescr = checkNull(rs.getString("descr"));
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("prdCodeFrDescr >> ["+prdCodeFrDescr+"]");
valueXmlString.append("<fr_prd_descr><![CDATA[").append(prdCodeFrDescr).append("]]></fr_prd_descr>\r\n");
valueXmlString.append("<prd_code__to><![CDATA[").append(prdCodeFr).append("]]></prd_code__to>\r\n");
valueXmlString.append("<to_prd_descr><![CDATA[").append(prdCodeFrDescr).append("]]></to_prd_descr>\r\n");
}
if (currentColumn.trim().equals("prd_code__to"))
{
prdCodeTo = checkNull(genericUtility.getColumnValue("prd_code__to", dom));
sql = "select descr from period where code = ?";
pstmt = connection.prepareStatement(sql);
pstmt.setString(1, prdCodeTo);
rs = pstmt.executeQuery();
if (rs.next())
{
prdCodeToDescr = checkNull(rs.getString("descr"));
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("prdCodeToDescr >> ["+prdCodeToDescr+"]");
valueXmlString.append("<to_prd_descr><![CDATA[").append(prdCodeToDescr).append("]]></to_prd_descr>\r\n");
}
if (currentColumn.trim().equals("type"))
{
type = checkNull(genericUtility.getColumnValue("type", dom));
sql = "select prd_code from parameter ";
pstmt = connection.prepareStatement(sql);
rs = pstmt.executeQuery();
if (rs.next())
{
prdCodeType = checkNull(rs.getString("prd_code"));
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("prdCodeType >> ["+prdCodeType+"]");
if (type == "AR" || type == "AP")
{
valueXmlString.append("<prd_code__arr><![CDATA[").append(prdCodeType).append("]]></prd_code__arr>\r\n");
}
}
if (currentColumn.trim().equals("site_code__fr"))
{
siteCodeFr = checkNull(genericUtility.getColumnValue("site_code__fr", dom));
sql = "select descr from site where site_code = ?";
pstmt = connection.prepareStatement(sql);
pstmt.setString(1, siteCodeFr);
rs = pstmt.executeQuery();
if (rs.next())
{
siteCdFrDescr = checkNull(rs.getString("descr"));
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("siteCdFrDescr >> ["+siteCdFrDescr+"]");
valueXmlString.append("<fr_site_descr><![CDATA[").append(siteCdFrDescr).append("]]></fr_site_descr>\r\n");
}
if (currentColumn.trim().equals("site_code__to"))
{
siteCodeTo = checkNull(genericUtility.getColumnValue("site_code__to", dom));
sql = "select descr from site where site_code = ?";
pstmt = connection.prepareStatement(sql);
pstmt.setString(1, siteCodeTo);
rs = pstmt.executeQuery();
if (rs.next())
{
siteCdToDescr = checkNull(rs.getString("descr"));
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("siteCdToDescr >> ["+siteCdToDescr+"]");
valueXmlString.append("<to_site_descr><![CDATA[").append(siteCdToDescr).append("]]></to_site_descr>\r\n");
}
if (currentColumn.trim().equals("proc_group__from"))
{
procGrpFrm = checkNull(genericUtility.getColumnValue("proc_group__from", dom));
sql = "select descr from gencodes where fld_name='PROC_GROUP' and fld_value = ?";
pstmt = connection.prepareStatement(sql);
pstmt.setString(1, procGrpFrm);
rs = pstmt.executeQuery();
if (rs.next())
{
procGrpFrmDescr = checkNull(rs.getString("descr"));
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("procGrpFrmDescr >> ["+procGrpFrmDescr+"]");
valueXmlString.append("<proc_group__fr_name><![CDATA[").append(procGrpFrmDescr).append("]]></proc_group__fr_name>\r\n");
}
if (currentColumn.trim().equals("proc_group__to"))
{
procGrpTo = checkNull(genericUtility.getColumnValue("proc_group__to", dom));
sql = "select descr from gencodes where fld_name='PROC_GROUP' and fld_value = ?";
pstmt = connection.prepareStatement(sql);
pstmt.setString(1, procGrpTo);
rs = pstmt.executeQuery();
if (rs.next())
{
procGrpToDescr = checkNull(rs.getString("descr"));
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("procGrpToDescr >> ["+procGrpToDescr+"]");
valueXmlString.append("<proc_group__to_name><![CDATA[").append(procGrpToDescr).append("]]></proc_group__to_name>\r\n");
}
valueXmlString.append("</Detail1>\r\n");
}
valueXmlString.append("</Root>\r\n");
}catch (Exception e) {
System.out.println("Exception in EJB["+this.getClass().getSimpleName()+"]:[" + e.getMessage()+"]");
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try {
if(connection != null)
{
connection.close();
connection = null;
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("Closed all Database Resource...!");
} catch (Exception e) {
System.out.println("Exception in EJB["+this.getClass().getSimpleName()+"]::itemChanged::[" + e.getMessage()+"]");
throw new ITMException(e);
}
}
return valueXmlString.toString();
}
public static String checkNull(String input) {
return input == null ? "" : input.trim();
}
}
package ibase.webitm.ejb.adm;
import java.rmi.RemoteException;
import org.w3c.dom.Document;
import ibase.webitm.ejb.ValidatorLocal;
import ibase.webitm.utility.ITMException;
public interface PayrollSinglePrcICLocal extends ValidatorLocal
{
public String itemChanged() 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;
}
\ No newline at end of file
package ibase.webitm.ejb.adm;
import java.rmi.RemoteException;
import org.w3c.dom.Document;
import ibase.webitm.ejb.ValidatorRemote;
import ibase.webitm.utility.ITMException;
public interface PayrollSinglePrcICRemote extends ValidatorRemote
{
public String itemChanged() 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;
}
\ No newline at end of file
package ibase.webitm.ejb.adm;
import java.rmi.RemoteException;
import ibase.webitm.ejb.ProcessLocal;
import ibase.webitm.utility.ITMException;
public interface PayrollSinglePrcLocal extends ProcessLocal
{
public String process() throws RemoteException,ITMException;
public String process(String xmlString, String xmlString2,String windowName, String xtraParams) throws RemoteException,ITMException;
}
package ibase.webitm.ejb.adm;
import java.rmi.RemoteException;
import ibase.webitm.ejb.ProcessRemote;
import ibase.webitm.utility.ITMException;
public interface PayrollSinglePrcRemote extends ProcessRemote
{
public String process() throws RemoteException,ITMException;
public String process(String xmlString, String xmlString2,String windowName, String xtraParams) throws RemoteException,ITMException;
}
package ibase.webitm.ejb.adm;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException;
public class PayrollSplitgenAccIC extends ValidatorEJB implements PayrollSplitgenAccRemote, PayrollSplitgenAccLocal {
public String itemChanged(String xmlString, String xmlString1,
String xmlString2, String objContext, String currentColumn,
String editFlag, String xtraParams) throws RemoteException,
ITMException {
Document dom1 = null;
Document dom = null;
Document dom2 = null;
String valueXmlString = "";
E12GenericUtility genericUtility = new E12GenericUtility();
System.out.println("xmlString :: ["+xmlString+"] \nxmlString1 :: ["+xmlString1+"] \nxmlString2 :: ["+xmlString2+"]");
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);
}
valueXmlString = itemChanged(dom, dom1, dom2, objContext,
currentColumn, editFlag, xtraParams);
} catch (Exception e) {
System.out.println("Exception :PayrollSplitgenAccIC :itemChanged(String,String):"+ e.getMessage() + ":");
valueXmlString = genericUtility.createErrorString(e);
e.printStackTrace();
}
System.out.println("returning from PayrollSplitgenAccIC itemChanged");
return (valueXmlString);
}
public String itemChanged(Document dom, Document dom1, Document dom2,
String objContext, String currentColumn, String editFlag,
String xtraParams) throws RemoteException, ITMException {
Connection connectionObject = null;
int currentFormNo = 0;
StringBuffer valueXmlString = null;
ResultSet resultSet = null;
PreparedStatement pstmt = null;
String sql = " ";
int userLevel = 0;
String userId = "", prdCode = "", todayDateStr = "", prdDescr = "", loginSiteCode = "", siteDescr = "",
empCodeFr = "", empCodeTo = "", type = "", siteCode = "";
String empFName = "", empLName = "", empFullName = "", procGroup = "", procGroupDescr = "";
E12GenericUtility genericUtility = new E12GenericUtility();
SimpleDateFormat sdf = null;
Date todayDate = null;
try {
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
todayDate = new Date();
todayDateStr = sdf.format(todayDate);
System.out.println("currentFormNo...." + currentFormNo);
connectionObject = getConnection();
if (objContext != null && objContext.trim().length() > 0) {
currentFormNo = Integer.parseInt(objContext);
}
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode");
loginSiteCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginSiteCode");
valueXmlString = new StringBuffer("<?xml version=\"1.0\"?><Root><Header><editFlag>");
valueXmlString.append(editFlag).append("</editFlag></Header>");
System.out.println("current form no: " + currentFormNo);
if(userLevel == 0)
{
sql = "select usr_lev from users where code = ?";
pstmt = connectionObject.prepareStatement(sql);
pstmt.setString(1, userId);
resultSet = pstmt.executeQuery();
if(resultSet.next())
{
userLevel = resultSet.getInt("usr_lev");
}
if(resultSet != null)
{
resultSet.close();
resultSet = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
switch (currentFormNo) {
case 1:
{
System.out.println("Case1");
valueXmlString.append("<Detail1>");
if (currentColumn.trim().equals("itm_default"))
{
sql = "select prd_code from parameter";
pstmt = connectionObject.prepareStatement(sql);
resultSet = pstmt.executeQuery();
if(resultSet.next())
{
prdCode = checkNull(resultSet.getString("prd_code"));
}
if(resultSet != null)
{
resultSet.close();
resultSet = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
valueXmlString.append("<emp_name__fr>").append("<![CDATA[" + "" + "]]>").append("</emp_name__fr>");
valueXmlString.append("<emp_name__to>").append("<![CDATA[" + "" + "]]>").append("</emp_name__to>");
valueXmlString.append("<payroll_date>").append("<![CDATA[" + todayDateStr + "]]>").append("</payroll_date>");
valueXmlString.append("<prd_code__fr>").append("<![CDATA[" + prdCode + "]]>").append("</prd_code__fr>");
valueXmlString.append("<prd_code__to>").append("<![CDATA[" + prdCode + "]]>").append("</prd_code__to>");
sql = "select descr from period where code = ? ";
pstmt = connectionObject.prepareStatement(sql);
pstmt.setString(1, prdCode);
resultSet = pstmt.executeQuery();
if(resultSet.next())
{
prdDescr = checkNull(resultSet.getString("descr"));
}
if(resultSet != null)
{
resultSet.close();
resultSet = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
valueXmlString.append("<fr_prd_descr>").append("<![CDATA[" + prdDescr + "]]>").append("</fr_prd_descr>");
valueXmlString.append("<to_prd_descr>").append("<![CDATA[" + prdDescr + "]]>").append("</to_prd_descr>");
if(loginSiteCode != null && loginSiteCode.trim().length() > 0)
{
sql = "select descr from site where site_code = ? ";
pstmt = connectionObject.prepareStatement(sql);
pstmt.setString(1, loginSiteCode);
resultSet = pstmt.executeQuery();
if(resultSet.next())
{
siteDescr = checkNull(resultSet.getString("descr"));
}
if(resultSet != null)
{
resultSet.close();
resultSet = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
if(userLevel > 1)
{
valueXmlString.append("<site_code__fr protect='1'>").append("<![CDATA[" + loginSiteCode + "]]>").append("</site_code__fr>");
valueXmlString.append("<site_code__to protect='1'>").append("<![CDATA[" + loginSiteCode + "]]>").append("</site_code__to>");
valueXmlString.append("<fr_site_descr>").append("<![CDATA[" + siteDescr + "]]>").append("</fr_site_descr>");
valueXmlString.append("<to_site_descr>").append("<![CDATA[" + siteDescr + "]]>").append("</to_site_descr>");
}
else
{
valueXmlString.append("<site_code__fr protect='0'>").append("<![CDATA[" + loginSiteCode + "]]>").append("</site_code__fr>");
valueXmlString.append("<site_code__to protect='0'>").append("<![CDATA[" + loginSiteCode + "]]>").append("</site_code__to>");
valueXmlString.append("<fr_site_descr>").append("<![CDATA[" + siteDescr + "]]>").append("</fr_site_descr>");
valueXmlString.append("<to_site_descr>").append("<![CDATA[" + siteDescr + "]]>").append("</to_site_descr>");
}
}
else if (currentColumn.trim().equals("emp_code__fr"))
{
empCodeFr = checkNull(genericUtility.getColumnValue("emp_code__fr", dom, currentFormNo+""));
sql = "select emp_fname, emp_lname from employee where emp_code = ?";
pstmt = connectionObject.prepareStatement(sql);
pstmt.setString(1, empCodeFr);
resultSet = pstmt.executeQuery();
if(resultSet.next())
{
empFName = checkNull(resultSet.getString("emp_fname"));
empLName = checkNull(resultSet.getString("emp_lname"));
empFullName = empFName + " " + empLName;
}
if(resultSet != null)
{
resultSet.close();
resultSet = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
valueXmlString.append("<emp_name__fr>").append("<![CDATA[" + empFullName + "]]>").append("</emp_name__fr>");
}
else if (currentColumn.trim().equals("emp_code__to"))
{
empCodeTo = checkNull(genericUtility.getColumnValue("emp_code__to", dom, currentFormNo+""));
sql = "select emp_fname, emp_lname from employee where emp_code = ?";
pstmt = connectionObject.prepareStatement(sql);
pstmt.setString(1, empCodeTo);
resultSet = pstmt.executeQuery();
if(resultSet.next())
{
empFName = checkNull(resultSet.getString("emp_fname"));
empLName = checkNull(resultSet.getString("emp_lname"));
empFullName = empFName + " " + empLName;
}
if(resultSet != null)
{
resultSet.close();
resultSet = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
valueXmlString.append("<emp_name__to>").append("<![CDATA[" + empFullName + "]]>").append("</emp_name__to>");
}
else if (currentColumn.trim().equals("prd_code__fr") || currentColumn.trim().equals("prd_code__to"))
{
prdCode = checkNull(genericUtility.getColumnValue(currentColumn.trim(), dom, currentFormNo+""));
sql = "select descr from period where code = ?";
pstmt = connectionObject.prepareStatement(sql);
pstmt.setString(1, prdCode);
resultSet = pstmt.executeQuery();
if(resultSet.next())
{
prdDescr = checkNull(resultSet.getString("descr"));
}
if(resultSet != null)
{
resultSet.close();
resultSet = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(currentColumn.trim().equalsIgnoreCase("prd_code__fr"))
valueXmlString.append("<fr_prd_descr>").append("<![CDATA[" + prdDescr + "]]>").append("</fr_prd_descr>");
else if(currentColumn.trim().equalsIgnoreCase("prd_code__to"))
valueXmlString.append("<to_prd_descr>").append("<![CDATA[" + prdDescr + "]]>").append("</to_prd_descr>");
}
else if (currentColumn.trim().equals("type"))
{
type = checkNull(genericUtility.getColumnValue("type", dom, currentFormNo+""));
sql = "select prd_code from parameter";
pstmt = connectionObject.prepareStatement(sql);
resultSet = pstmt.executeQuery();
if(resultSet.next())
{
prdCode = checkNull(resultSet.getString("prd_code"));
}
if(resultSet != null)
{
resultSet.close();
resultSet = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(type.equalsIgnoreCase("AR") || type.equalsIgnoreCase("AP"))
{
valueXmlString.append("<prd_code__arr protect='0'>").append("<![CDATA[" + prdCode + "]]>").append("</prd_code__arr>");
}
else
{
valueXmlString.append("<prd_code__arr protect='1'>").append("<![CDATA[" + prdCode + "]]>").append("</prd_code__arr>");
}
if(type.equalsIgnoreCase("PP"))
{
valueXmlString.append("<consider_attd protect='0'>").append("<![CDATA[" + checkNull(genericUtility.getColumnValue("consider_attd", dom)) + "]]>").append("</consider_attd>");
}
else
{
valueXmlString.append("<consider_attd protect='1'>").append("<![CDATA[" + "N" + "]]>").append("</consider_attd>");
}
}
else if (currentColumn.trim().equals("site_code__fr") || currentColumn.trim().equals("site_code__to"))
{
siteCode = checkNull(genericUtility.getColumnValue(currentColumn.trim(), dom, currentFormNo+""));
sql = "select descr from site where site_code = ?";
pstmt = connectionObject.prepareStatement(sql);
pstmt.setString(1, siteCode);
resultSet = pstmt.executeQuery();
if(resultSet.next())
{
siteDescr = checkNull(resultSet.getString("descr"));
}
if(resultSet != null)
{
resultSet.close();
resultSet = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(currentColumn.trim().equalsIgnoreCase("site_code__fr"))
valueXmlString.append("<fr_site_descr>").append("<![CDATA[" + siteDescr + "]]>").append("</fr_site_descr>");
else if(currentColumn.trim().equalsIgnoreCase("site_code__to"))
valueXmlString.append("<to_site_descr>").append("<![CDATA[" + siteDescr + "]]>").append("</to_site_descr>");
}
else if (currentColumn.trim().equals("proc_group__from") || currentColumn.trim().equals("proc_group__to"))
{
procGroup = checkNull(genericUtility.getColumnValue(currentColumn.trim(), dom, currentFormNo+""));
sql = "select descr from gencodes where fld_name='PROC_GROUP' and fld_value = ?";
pstmt = connectionObject.prepareStatement(sql);
pstmt.setString(1, procGroup);
resultSet = pstmt.executeQuery();
if(resultSet.next())
{
procGroupDescr = checkNull(resultSet.getString("descr"));
}
if(resultSet != null)
{
resultSet.close();
resultSet = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(currentColumn.trim().equalsIgnoreCase("proc_group__from"))
valueXmlString.append("<proc_group__fr_name>").append("<![CDATA[" + procGroupDescr + "]]>").append("</proc_group__fr_name>");
else if(currentColumn.trim().equalsIgnoreCase("proc_group__to"))
valueXmlString.append("<proc_group__to_name>").append("<![CDATA[" + procGroupDescr + "]]>").append("</proc_group__to_name>");
}
}
valueXmlString.append("</Detail1>");
break;
}
valueXmlString.append("</Root>");
} catch (Exception e) {
System.out.println("Exception :PayrollSplitgenAccIC :itemChanged(Document,String):"+ e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
} finally {
try {
if (connectionObject != null) {
if (resultSet != null)
{
resultSet.close();
resultSet = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
connectionObject.close();
connectionObject = null;
}
} catch (Exception e)
{
e.printStackTrace();
}
}
System.out.println("\n****ValueXmlString :" + valueXmlString + ":********");
return valueXmlString.toString();
}
public String wfValData() throws RemoteException, ITMException {
return "";
}
public String wfValData(String xmlString, String xmlString1,
String xmlString2, String objContext, String editFlag,
String xtraParams) throws RemoteException,
ITMException {
System.out.println(xmlString);
Document dom = null;
Document dom1 = null;
Document dom2 = null;
String errString = null;
E12GenericUtility genericUtility = new E12GenericUtility();
System.out.println("xmlString :: ["+xmlString+"] \nxmlString1 :: ["+xmlString1+"] \nxmlString2 :: ["+xmlString2+"]");
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);
}
errString = wfValData(dom, dom1, dom2, objContext, editFlag,
xtraParams);
System.out.println("ErrString :" + errString);
} catch (Exception e) {
System.out
.println("Exception :PayrollSplitgenAccIC :wfValData(String xmlString):"
+ e.getMessage() + ":");
errString = genericUtility.createErrorString(e);
e.printStackTrace();
}
System.out.println("returning from PayrollSplitgenAccIC wfvaldata");
return errString;
}
public String wfValData(Document dom, Document dom1, Document dom2,
String objContext, String editFlag, String xtraParams)
throws RemoteException, ITMException {
String errString = "";
Connection connectionObject = null;
ResultSet resultSet = null;
PreparedStatement pstmt = null;
String childNodeName = null;
NodeList parentNodeList = null;
Node parentNode = null;
NodeList childNodeList = null;
Node childNode = null;
int currentFormNo = 0;
String userId = "", payrollDate = "", errCode = "", errorType = "", prdCode = "", sql = "", type = "", prdCodeArr = "";
int childNodeLength = 0, ctr = 0, cnt = 0;
ArrayList<String> errList = new ArrayList<String>();
ArrayList<String> errFields = new ArrayList<String>();
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
E12GenericUtility genericUtility = new E12GenericUtility();
try {
connectionObject = getConnection();
userId = 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("payroll_date".equalsIgnoreCase(childNodeName))
{
payrollDate = genericUtility.getColumnValue("payroll_date", dom);
if(payrollDate == null || payrollDate.trim().length() == 0)
{
errCode = "VEDAT2";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
errorType = errorType(connectionObject, errCode);
if(errorType.equalsIgnoreCase("E"))
{
break;
}
}
}
else if("type".equalsIgnoreCase(childNodeName))
{
}
else if(("prd_code__fr".equalsIgnoreCase(childNodeName)) || ("prd_code__to".equalsIgnoreCase(childNodeName)))
{
prdCode = checkNull(genericUtility.getColumnValue(childNodeName,dom));
System.out.println("prdCode >>>>> ["+prdCode.length()+"]");
cnt = 0;
sql = "select count(*) as cnt from period where code = ?";
pstmt = connectionObject.prepareStatement(sql);
pstmt.setString(1,prdCode);
resultSet = pstmt.executeQuery();
if(resultSet.next())
{
cnt = resultSet.getInt("cnt");
}
if(resultSet != null)
{
resultSet.close();
resultSet = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt == 0)
{
errCode = "VMPRD1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
errorType = errorType(connectionObject, errCode);
if(errorType.equalsIgnoreCase("E"))
{
break;
}
}
else
{
int prdCodeFr = 0, prdCodeTo = 0;
prdCodeFr = checkInt(genericUtility.getColumnValue("prd_code__fr",dom));
prdCodeTo = checkInt(genericUtility.getColumnValue("prd_code__to",dom));
if(prdCodeFr > prdCodeTo)
{
errCode = "VMPRD2";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
errorType = errorType(connectionObject, errCode);
if(errorType.equalsIgnoreCase("E"))
{
break;
}
}
}
}
else if("prd_code__arr".equalsIgnoreCase(childNodeName))
{
type = checkNull(genericUtility.getColumnValue("type",dom));
prdCodeArr = checkNull(genericUtility.getColumnValue("prd_code__arr",dom));
if(("AR".equalsIgnoreCase(type)) && (prdCodeArr == null || prdCodeArr.trim().length() == 0))
{
errCode = "VTARRPRD";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
errorType = errorType(connectionObject, errCode);
if(errorType.equalsIgnoreCase("E"))
{
break;
}
}
else if(prdCodeArr.trim().length() > 0)
{
cnt = 0;
sql = "select count(*) as cnt from period where code = ?";
pstmt = connectionObject.prepareStatement(sql);
pstmt.setString(1,prdCodeArr);
resultSet = pstmt.executeQuery();
if(resultSet.next())
{
cnt = resultSet.getInt("cnt");
}
if(resultSet != null)
{
resultSet.close();
resultSet = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt == 0)
{
errCode = "VMARRPRD";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
errorType = errorType(connectionObject, errCode);
if(errorType.equalsIgnoreCase("E"))
{
break;
}
}
}
}
}
}
break;
}
int errListSize = errList.size();
System.out.println("errListSize::::::::::"+errListSize);
int count = 0;
String errFldName = null;
if (errList != null && errListSize > 0)
{
for (count = 0; count < errListSize; count++)
{
errCode = errList.get(count);
errFldName = errFields.get(count);
System.out.println(" testing :errCode .:" + errCode);
errString = getErrorString(errFldName, errCode, userId);
System.out.println("errString>>>>>>>>>"+errString);
errorType = errorType(connectionObject, errCode);
if (errString.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);
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)
{
System.out.println("Exception :PayrollSplitgenAccIC :wfValData(Document,String):"+ e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}finally
{
try
{
if (connectionObject != null)
{
if (resultSet != null) {
resultSet.close();
resultSet = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
connectionObject.close();
connectionObject = null;
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
errString = errStringXml.toString();
System.out.println("testing : final errString : " + errString);
return errString;
}
private String checkNull(String input)
{
return (input == null)? "" : input ;
}
private int checkInt(String input)
{
int parsedValue = 0;
try {
parsedValue = (input == null)? 0 : Integer.parseInt(input);
}
catch(Exception e)
{
System.out.println("Invalid Integer format");
}
return parsedValue;
}
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 = rs.getString("MSG_TYPE");
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != 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;
}
}
package ibase.webitm.ejb.adm;
import java.rmi.RemoteException;
import ibase.webitm.ejb.ValidatorLocal;
import ibase.webitm.utility.ITMException;
import javax.ejb.Local;
import org.w3c.dom.Document;
@Local
public interface PayrollSplitgenAccLocal extends ValidatorLocal {
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;
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;
}
This source diff could not be displayed because it is too large. You can view the blob instead.
package ibase.webitm.ejb.adm;
import java.rmi.RemoteException;
import org.w3c.dom.*;
import ibase.webitm.utility.ITMException;
import javax.ejb.Local;
@Local
public interface PayrollSplitgenAccPrcLocal extends ibase.webitm.ejb.ProcessLocal
{
public String process(Document dom, Document dom2, String windowName, String xtraParams) throws RemoteException,ITMException;
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
}
\ No newline at end of file
package ibase.webitm.ejb.adm;
import java.rmi.RemoteException;
import org.w3c.dom.*;
import ibase.webitm.utility.ITMException;
import javax.ejb.Remote;
@Remote
public interface PayrollSplitgenAccPrcRemote extends ibase.webitm.ejb.ProcessRemote
{
public String process(Document dom, Document dom2, String windowName, String xtraParams) throws RemoteException,ITMException;
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
}
\ No newline at end of file
package ibase.webitm.ejb.adm;
import java.rmi.RemoteException;
import ibase.webitm.ejb.ValidatorRemote;
import ibase.webitm.utility.ITMException;
import javax.ejb.Remote;
import org.w3c.dom.Document;
@Remote
public interface PayrollSplitgenAccRemote extends ValidatorRemote
{
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;
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;
}
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