/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@localhost SQL SECURITY DEFINER */
/*!50001 VIEW `interview_mst_vw` AS select `interview_mst`.`INTERVIEW_ID` AS `INTERVIEW_ID`,`interview_mst`.`APPL_ID` AS `APPL_ID`,`interview_mst`.`CNDDT_ID` AS `CNDDT_ID`,(select `candidate_mst`.`CANDIDATE_NAME` from `candidate_mst` where (`candidate_mst`.`CANDIDATE_ID` = `interview_mst`.`CNDDT_ID`)) AS `CANDIDATE_NAME`,`interview_mst`.`INTERVIEW_NAME` AS `INTERVIEW_NAME`,cast(`interview_mst`.`INTERVIEW_DATE` as date) AS `INTERVIEW_DATE`,`interview_mst`.`INTERVIEW_TIME` AS `INTERVIEW_TIME`,`interview_mst`.`VACANCY_ID` AS `VACANCYID`,(select `vacancy_mst`.`VACANCY_NAME` from `vacancy_mst` where (`vacancy_mst`.`VACANCY_ID` = `VACANCYID`)) AS `VACANCY_NM`,`interview_mst`.`NOTE` AS `NOTE`,`interview_mst`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`interview_mst`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`interview_mst`.`OA_BRAND_ID` AS `BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_NM`,`interview_mst`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`interview_mst`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`interview_mst`.`CREATED_ON` AS `CREATED_ON`,`interview_mst`.`UPDATED_ON` AS `UPDATED_ON`,`interview_mst`.`IS_DELETED` AS `IS_DELETED` from `interview_mst` */;

--
-- Final view structure for view `interviewer_dtl_vw`
--

/*!50001 DROP VIEW IF EXISTS `interviewer_dtl_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `interviewer_dtl_vw` AS select `interviewer_dtl`.`INTERVIEWER_DTL_ID` AS `interviewer_dtl_id`,`interviewer_dtl`.`INTERVIEW_ID` AS `INTERVIEW`,(select `interview_mst`.`INTERVIEW_NAME` from `interview_mst` where (`interview_mst`.`INTERVIEW_ID` = `INTERVIEW`)) AS `INTERVIEW_NAME`,`interviewer_dtl`.`INTERVIEWER_ID` AS `INTERVIEWER_ID`,(select group_concat(`user_mst`.`USER_NAME` separator ',') from `user_mst` where find_in_set(`user_mst`.`USER_ID`,`interviewer_dtl`.`INTERVIEWER_ID`)) AS `INTERVIEWER_NAME`,(select `interview_mst_vw`.`CANDIDATE_NAME` from `interview_mst_vw` where (`interview_mst_vw`.`INTERVIEW_ID` = `interviewer_dtl`.`INTERVIEW_ID`)) AS `CONTCT_NM`,`interviewer_dtl`.`COMMENTS` AS `COMMENTS`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `interviewer_dtl`.`INTERVIEW_ROUND`)) AS `INTERVIEW_ROUND`,if((`interviewer_dtl`.`ELIGIBLE_HIRE` = 0),'No','Yes') AS `ELIGIBLE_HIRE`,`interviewer_dtl`.`EXPECTED_CTC` AS `EXPECTED_CTC`,`interviewer_dtl`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`interviewer_dtl`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`interviewer_dtl`.`OA_BRAND_ID` AS `BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_NM`,`interviewer_dtl`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`interviewer_dtl`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`interviewer_dtl`.`CREATED_ON` AS `CREATED_ON`,`interviewer_dtl`.`UPDATED_ON` AS `UPDATED_ON`,`interviewer_dtl`.`IS_DELETED` AS `IS_DELETED` from `interviewer_dtl` */;

--
-- Final view structure for view `inv_template_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `inv_template_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `inv_template_mst_vw` AS select `inv_template_mst`.`TEMPLATE_ID` AS `TEMPLATE_ID`,`inv_template_mst`.`TEMPLATE_CD` AS `TEMPLATE_CD`,`inv_template_mst`.`TEMPLATE_NAME` AS `TEMPLATE_NAME`,`inv_template_mst`.`TEMPLATE_TYPE` AS `TEMPLATE_TYPE`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `inv_template_mst`.`TEMPLATE_TYPE`)) AS `TEMPLATE_TYPE_NM`,`inv_template_mst`.`COUNTRY_ID` AS `COUNTRY_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `inv_template_mst`.`COUNTRY_ID`)) AS `COUNTRY_ID_NM`,`inv_template_mst`.`TEMPLATE_IMAGE` AS `TEMPLATE_IMAGE`,`inv_template_mst`.`OA_ID` AS `OA_ID`,`inv_template_mst`.`USER_ID` AS `USER_ID`,`inv_template_mst`.`CREATED_BY` AS `CREATED_BY`,`inv_template_mst`.`UPDATED_BY` AS `UPDATED_BY`,`inv_template_mst`.`CREATED_ON` AS `CREATED_ON`,`inv_template_mst`.`UPDATED_ON` AS `UPDATED_ON`,`inv_template_mst`.`IS_DELETED` AS `IS_DELETED`,`inv_template_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID` from `inv_template_mst` */;

--
-- Final view structure for view `investment_declaration_rules_vw`
--

/*!50001 DROP VIEW IF EXISTS `investment_declaration_rules_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `investment_declaration_rules_vw` AS select `br`.`BENEFIT_RULES_ID` AS `BENEFIT_RULES_ID`,`br`.`RULE_TYPE_ID` AS `RULE_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `br`.`RULE_TYPE_ID`)) AS `RULE_TYPE_NM`,`br`.`SECTION_ID` AS `SECTION_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `br`.`SECTION_ID`)) AS `SECTION`,`br`.`CALCULATION_FACTOR` AS `CALCULATION_FACTOR`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `br`.`CALCULATION_FACTOR`)) AS `CALCULATION_FACTOR_NM`,`br`.`LOWER_LIMIT` AS `LOWER_LIMIT`,`br`.`UPPER_LIMIT` AS `UPPER_LIMIT`,`br`.`VALUES` AS `VALUES`,`br`.`GENDER` AS `GENDER`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `br`.`GENDER`)) AS `GENDER_NM`,if((`br`.`OPEN_LIMIT` = 1),'Yes','No') AS `OPEN_LIMIT`,`br`.`COMMENT` AS `COMMENT`,`br`.`MONTH` AS `MONTH`,`br`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`br`.`OA_BRAND_ID` AS `BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_NM`,`br`.`USER_ID` AS `USERID`,`br`.`IS_DELETED` AS `IS_DELETED`,`br`.`CREATED_ON` AS `CREATED_ON`,`br`.`CREATED_BY` AS `CREATED_BY`,`br`.`UPDATED_ON` AS `UPDATED_ON`,`br`.`UPDATED_BY` AS `UPDATED_BY` from (`pay_component_benefit_rules` `br` join `independent_mst` `im` on((`im`.`MSTR_ID` = `br`.`RULE_TYPE_ID`))) where (`im`.`MSTR_CD` = 'BRTYIDR') */;

--
-- Final view structure for view `invoice_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `invoice_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `invoice_mst_vw` AS select `im`.`invoice_id` AS `invoice_id`,`im`.`invoice_no` AS `invoice_no`,(select concat(`im`.`invoice_prefix`,' ',`im`.`invoice_no`)) AS `invoice_nooo`,`im`.`company_id` AS `company_id`,(select `company_details`.`company_name` from `company_details` where (`company_details`.`cmpy_id` = `im`.`company_id`)) AS `Company_name`,`im`.`inv_status` AS `inv_status`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `im`.`inv_status`)) AS `Invoice_Status`,`im`.`invoice_date` AS `invoice_date`,`im`.`start_date` AS `start_date`,`im`.`end_date` AS `end_date`,`im`.`for_description` AS `for_description`,`im`.`vat_percent` AS `vat_percent`,`im`.`vat_amount` AS `vat_amount`,`im`.`total_amt` AS `total_amt`,`im`.`invoice_amount` AS `invoice_amount`,`im`.`created_on` AS `created_on`,`im`.`created_by` AS `created_by`,`im`.`UPDATED_ON` AS `UPDATED_ON`,`im`.`UPDATED_BY` AS `UPDATED_BY`,`im`.`FY_ID` AS `FY_ID`,`im`.`project_id` AS `project_id`,`im`.`due_days` AS `due_days`,`im`.`due_date` AS `due_date`,(select `project_details`.`project_name` from `project_details` where (`project_details`.`id` = `im`.`project_id`)) AS `PRoject_name`,`im`.`payment_paid` AS `payment_paid`,`im`.`balance` AS `balance`,`im`.`OA_ID` AS `org_id`,(select `ob`.`OA_BRAND_LOGO` from `oa_brands` `ob` where ((`ob`.`OA_ID` = `im`.`OA_ID`) and (`ob`.`OA_BRAND_ID` = `im`.`OA_BRAND_ID`))) AS `OA_BRAND_LOGO`,`im`.`inv_unit` AS `inv_unit`,`im`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`im`.`OA_CD` AS `org_cd`,(select `oais`.`ORG_TEMPLATE` from `org_acc_invoice_settings` `oais` where ((`oais`.`OA_ID` = `im`.`OA_ID`) and (`oais`.`OA_BRAND_ID` = `im`.`OA_BRAND_ID`) and (`oais`.`TEMPLATE_SETTING_ID` = 5560))) AS `org_template`,(select `oais`.`MAIL_PDF` from `org_acc_invoice_settings` `oais` where ((`oais`.`OA_ID` = `im`.`OA_ID`) and (`oais`.`OA_BRAND_ID` = `im`.`OA_BRAND_ID`) and (`oais`.`TEMPLATE_SETTING_ID` = 5560))) AS `mail_pdf`,`im`.`generated` AS `generated`,if((`im`.`generated` = 0),'No','Yes') AS `isgenerated`,`im`.`MARK_SEND` AS `MARK_SEND`,if((`im`.`MARK_SEND` = 0),'No','Yes') AS `MARK_SENT`,`im`.`invoice_prefix` AS `invoice_prefix`,`im`.`GENERATED_PATH` AS `GENERATED_PATH`,`im`.`IS_DELETED` AS `IS_DELETED`,`im`.`USER_ID` AS `USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `im`.`USER_ID`)) AS `USER_NAME` from `invoice_mst` `im` */;

--
-- Final view structure for view `issue_impact_level_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `issue_impact_level_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `issue_impact_level_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 240) */;

--
-- Final view structure for view `issue_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `issue_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `issue_mst_vw` AS select `issue_mst`.`ISSUE_ID` AS `ISSUE_ID`,`issue_mst`.`PROJECT_ID` AS `PROJECT_ID`,`issue_mst`.`RAISED_ON_DATE` AS `RAISED_ON_DATE`,`issue_mst`.`ORIGINATOR_USER_ID` AS `ORIGINATOR_USER_ID`,`issue_mst`.`ISSUE_DESC` AS `ISSUE_DESC`,`issue_mst`.`ISSUE_STATUS_ID` AS `ISSUE_STATUS_ID`,`issue_mst`.`IMPACT_LEVEL_ID` AS `IMPACT_LEVEL_ID`,`issue_mst`.`MITIGATION_ACTION` AS `MITIGATION_ACTION`,`issue_mst`.`OWNER_USER_ID` AS `OWNER_USER_ID`,`issue_mst`.`LAST_REVIEW_DATE` AS `LAST_REVIEW_DATE`,`issue_mst`.`OA_ID` AS `OA_ID`,`issue_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`issue_mst`.`IS_DELETED` AS `IS_DELETED`,`issue_mst`.`CREATED_BY` AS `CREATED_BY`,`issue_mst`.`UPDATED_BY` AS `UPDATED_BY`,`issue_mst`.`CREATED_ON` AS `CREATED_ON`,`issue_mst`.`UPDATED_ON` AS `UPDATED_ON` from `issue_mst` */;

--
-- Final view structure for view `issue_owner_user_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `issue_owner_user_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `issue_owner_user_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 241) */;

--
-- Final view structure for view `issue_status_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `issue_status_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `issue_status_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 239) */;

--
-- Final view structure for view `it_type__mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `it_type__mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `it_type__mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 266) */;

--
-- Final view structure for view `iteration_status_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `iteration_status_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `iteration_status_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 256) */;

--
-- Final view structure for view `job_applicant_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `job_applicant_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `job_applicant_mst_vw` AS select `em`.`EMP_ID` AS `EMP_ID`,`em`.`EMP_NBR` AS `EMP_NBR`,`em`.`EMP_INITIALS` AS `EMP_INITIALS`,(select concat(ifnull(`em`.`EMP_NAME`,''),' ',ifnull(`em`.`EMP_MIDDLE_NM`,''),' ',ifnull(`em`.`EMPLST_NM`,''))) AS `EMP_FULL_NAME`,`em`.`EMP_NAME` AS `EMP_NAME`,`em`.`EMP_MIDDLE_NM` AS `EMP_MIDDLE_NM`,`em`.`EMPLST_NM` AS `EMPLST_NM`,`em`.`OA_CNTCT_EML_ID` AS `EMAIL_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`COUNTRY_CODE`)) AS `COUNTRY_CD`,`em`.`OA_CNTCT_PHONE_ID` AS `OA_CNTCT_PHONE_ID`,(select `phone_nbr_mst`.`PHONE_NBR` from `phone_nbr_mst` where (`phone_nbr_mst`.`PHONE_NBR_ID` = (select `contact_phones`.`PHONE_NBR_ID` from `contact_phones` where (`contact_phones`.`CNTCT_PHONE_ID` = (select `oa_contact_phones`.`CNTCT_PHONE_ID` from `oa_contact_phones` where (`oa_contact_phones`.`OA_CNTCT_PHONE_ID` = `em`.`OA_CNTCT_PHONE_ID`)))))) AS `PHONE_NUMBER`,(select concat(`COUNTRY_CD`,' ',`PHONE_NUMBER`)) AS `FULL_PHONE_NBR`,if((`em`.`IS_MANAGER` = 1),'Yes','No') AS `IS_MANAGER`,`em`.`MANAGER_ID` AS `MANAGER_ID`,(select concat(`emm`.`EMP_NAME`,' ',`emm`.`EMPLST_NM`) from `job_applicant_mst` `emm` where (`emm`.`EMP_ID` = `em`.`MANAGER_ID`)) AS `MANAGER_NM`,`em`.`DOB` AS `DOB`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`GENDER_ID`)) AS `GENDER`,`em`.`MARITAL_STATUS_ID` AS `MARITAL_STATUS_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`MARITAL_STATUS_ID`)) AS `MARITAL_STATUS`,`em`.`CAST_ID` AS `CAST_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`CAST_ID`)) AS `CAST`,`em`.`RAISE_ID` AS `RAISE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`RAISE_ID`)) AS `RAISE`,`em`.`ETHINICITY_ID` AS `ETHINICITY_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`ETHINICITY_ID`)) AS `ETHINICITY`,(select `job_mst`.`DEPARTMENT_ID` from `job_mst` where (`job_mst`.`EMP_ID` = `em`.`EMP_ID`) order by `job_mst`.`JOB_ID` desc limit 1) AS `DEPARTMENTID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `DEPARTMENTID`)) AS `DEPARTMENT`,(select `job_mst`.`COST_CENTER` from `job_mst` where (`job_mst`.`EMP_ID` = `em`.`EMP_ID`) order by `job_mst`.`JOB_ID` desc limit 1) AS `COST_CENTER`,(select `emp_reporting_locations`.`LOCATION_ID` from `emp_reporting_locations` where (`emp_reporting_locations`.`EMP_ID` = `em`.`EMP_ID`) order by `emp_reporting_locations`.`EMP_REPORTING_LOCATIONS_ID` desc limit 1) AS `LOCATIONID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `LOCATIONID`)) AS `LOCATION_NAME`,(select `job_mst`.`DESIGNATION_ID` from `job_mst` where (`job_mst`.`EMP_ID` = `em`.`EMP_ID`) order by `job_mst`.`JOB_ID` desc limit 1) AS `DESIGNATIONID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `DESIGNATIONID`)) AS `DESIGNATION`,(select `job_mst`.`DATE_OF_JOINING` from `job_mst` where (`job_mst`.`EMP_ID` = `em`.`EMP_ID`) order by `job_mst`.`JOB_ID` desc limit 1) AS `DATE_OF_JOINING`,(select `bank_dtl`.`ACCOUNT_NO` from `bank_dtl` where (`bank_dtl`.`EMP_ID` = `em`.`EMP_ID`) order by `bank_dtl`.`BANK_ID` desc limit 1) AS `ACCOUNT_NO`,`em`.`EMP_PAN_NBR` AS `EMP_PAN_NBR`,(select `job_mst_vw`.`EMP_GRADE_ID` from `job_mst_vw` where (`job_mst_vw`.`EMP_ID` = `em`.`EMP_ID`) order by `job_mst_vw`.`JOB_ID` desc limit 1) AS `EMP_GRADE_ID`,(select `job_mst_vw`.`EMP_GRADE` from `job_mst_vw` where (`job_mst_vw`.`EMP_ID` = `em`.`EMP_ID`) order by `job_mst_vw`.`JOB_ID` desc limit 1) AS `EMP_GRADE`,`em`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `COMPANY_NAME`,(select `contact_address_vw`.`FULL_ADDRESS` from `contact_address_vw` where ((`contact_address_vw`.`OABRANDID` = `contact_address_vw`.`OABRANDID`) and (`contact_address_vw`.`CNTCT_ADD_TYPE_ID` = (select `independent_mst`.`MSTR_ID` from `independent_mst` where (`independent_mst`.`MSTR_CD` = 'CATO')))) limit 1) AS `OFFICE_ADDRESS`,(select `email_address_mst`.`EMAIL_ADD` from `email_address_mst` where (`email_address_mst`.`EMAIL_ADD_ID` = (select `contact_emails`.`EMAIL_ADD_ID` from `contact_emails` where (`contact_emails`.`CNTCT_EML_ID` = (select `oa_contact_emails`.`CNTCT_EML_ID` from `oa_contact_emails` where (`oa_contact_emails`.`OA_CNTCT_EML_ID` = `em`.`OA_CNTCT_EML_ID`)))))) AS `EMAIL_ADD`,`em`.`OA_CNTCTS_ID` AS `OACNTCTSID`,(select `oa_contacts`.`CNTCT_ID` from `oa_contacts` where (`oa_contacts`.`OA_CNTCTS_ID` = `OACNTCTSID`) order by `oa_contacts`.`OA_CNTCTS_ID` desc limit 1) AS `OA_CNTCTS`,(select `job_mst`.`EMP_TYPE_ID` from `job_mst` where (`job_mst`.`EMP_ID` = `em`.`EMP_ID`) order by `job_mst`.`JOB_ID` desc limit 1) AS `EMPTYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `EMPTYPE_ID`)) AS `EMPLOYMENT_TYPE`,(select `job_mst`.`EMP_STATUS_ID` from `job_mst` where (`job_mst`.`EMP_ID` = `em`.`EMP_ID`) order by `job_mst`.`JOB_ID` desc limit 1) AS `EMPSTATUSID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `EMPSTATUSID`)) AS `EMPLOYMENT_STATUS`,(select `job_mst_vw`.`CONFIRMATION_DATE` from `job_mst_vw` where (`job_mst_vw`.`EMP_ID` = `em`.`EMP_ID`) order by `job_mst_vw`.`JOB_ID` desc limit 1) AS `CONFIRMATION_DATE`,(select `job_mst_vw`.`LAST_APPRAISAL_DATE` from `job_mst_vw` where (`job_mst_vw`.`EMP_ID` = `em`.`EMP_ID`) order by `job_mst_vw`.`JOB_ID` desc limit 1) AS `LAST_APPRAISAL_DATE`,(select `job_mst_vw`.`APPRAISAL_TYPE` from `job_mst_vw` where (`job_mst_vw`.`EMP_ID` = `em`.`EMP_ID`) order by `job_mst_vw`.`JOB_ID` desc limit 1) AS `APPRAISAL_TYPE_ID`,(select `job_mst_vw`.`APPRAISAL_TYPE_NM` from `job_mst_vw` where (`job_mst_vw`.`EMP_ID` = `em`.`EMP_ID`) order by `job_mst_vw`.`JOB_ID` desc limit 1) AS `APPRAISALTYPE`,(select `emp_termination_dtl_vw`.`RESIGNED_ON` from `emp_termination_dtl_vw` where (`emp_termination_dtl_vw`.`EMP_ID` = `em`.`EMP_ID`) order by `emp_termination_dtl_vw`.`TERMINATION_ID` desc limit 1) AS `RESIGNATION_DATE`,(select `emp_termination_dtl_vw`.`TERMINATION_DATE` from `emp_termination_dtl_vw` where (`emp_termination_dtl_vw`.`EMP_ID` = `em`.`EMP_ID`) order by `emp_termination_dtl_vw`.`TERMINATION_ID` desc limit 1) AS `TERMINATION_DATE`,(select `emp_termination_dtl_vw`.`EMP_TERMINATION_ID` from `emp_termination_dtl_vw` where (`emp_termination_dtl_vw`.`EMP_ID` = `em`.`EMP_ID`) order by `emp_termination_dtl_vw`.`TERMINATION_ID` desc limit 1) AS `TERMINATION_ID`,(select `emp_termination_dtl_vw`.`EMP_TERMINATION` from `emp_termination_dtl_vw` where (`emp_termination_dtl_vw`.`EMP_ID` = `em`.`EMP_ID`) order by `emp_termination_dtl_vw`.`TERMINATION_ID` desc limit 1) AS `TERMINATION`,(select `contact_address_vw`.`FULL_ADDRESS` from `contact_address_vw` where (`contact_address_vw`.`USERID` = `em`.`USER_ID`) limit 1) AS `RESIDENTIAL_ADDRESS`,(select `emp_education`.`EDU_QUAL_ID` from `emp_education` where (`emp_education`.`EMP_ID` = `em`.`EMP_ID`) order by `emp_education`.`ID` desc limit 1) AS `EDUQUALID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `EDUQUALID`)) AS `EDUCATION`,(select `emp_education`.`MAJOR` from `emp_education` where (`emp_education`.`EMP_ID` = `em`.`EMP_ID`) order by `emp_education`.`ID` desc limit 1) AS `EDUCATION_NAME`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`BLOOD_GRP`)) AS `BLOOD_GRP`,(select `bank_dtl`.`BANK_NM` from `bank_dtl` where (`bank_dtl`.`EMP_ID` = `em`.`EMP_ID`) order by `bank_dtl`.`BANK_ID` desc limit 1) AS `BANK_NAME`,(select `bank_dtl`.`IFSC_CD` from `bank_dtl` where (`bank_dtl`.`EMP_ID` = `em`.`EMP_ID`) order by `bank_dtl`.`BANK_ID` desc limit 1) AS `IFSC_CODE`,`em`.`REF_EMP_ID` AS `REF_EMP_ID`,(select `contact_mst`.`CNTCT_FRST_NM` from `contact_mst` where (`contact_mst`.`CNTCT_ID` = `OA_CNTCTS`)) AS `CNTCT_NM`,(select `dependent_dtl_vw`.`CNTCT_FULL_NM` from `dependent_dtl_vw` where (`dependent_dtl_vw`.`EMP_ID` = `em`.`EMP_ID`) order by `dependent_dtl_vw`.`EMP_ID` desc limit 1) AS `CNTCT_FULL_NM`,`em`.`OA_CNTCT_ADD_ID` AS `OACNTCTADDID`,(select `oa_contact_address`.`CNTCT_ADD_ID` from `oa_contact_address` where (`oa_contact_address`.`OA_CNTCT_ADD_ID` = `OACNTCTADDID`)) AS `OA_CNTCT_ADD`,(select `contact_address`.`ADD_ID` from `contact_address` where (`contact_address`.`CNTCT_ADD_ID` = `OA_CNTCT_ADD`)) AS `CNTCT_ADD`,(select concat(`address_mst`.`FLAT_NO`,`address_mst`.`HOUSE_NO`,`address_mst`.`HOUSE_NAME`,`address_mst`.`ADDRESS_LINE_1`,`address_mst`.`ADDRESS_LINE_2`,`address_mst`.`ADDRESS_LINE_3`,`address_mst`.`ADDRESS_LINE_4`,`address_mst`.`ADDRESS_LINE_5`) from `address_mst` where (`address_mst`.`ADDRESS_ID` = `CNTCT_ADD`)) AS `CNTCT_ADDRESS`,`em`.`EMP_SSN_NBR` AS `EMP_SSN_NBR`,`em`.`EMP_SIN_NBR` AS `EMP_SIN_NBR`,`em`.`EMP_OTHER_ID` AS `EMP_OTHER_ID`,`em`.`EMP_DRI_LICE_NBR` AS `EMP_DRI_LICE_NBR`,`em`.`EMP_DRI_LICE_EXP_DATE` AS `EMP_DRI_LICE_EXP_DATE`,if((`em`.`EMP_MILITARY_SERVICE` = 1),'Yes','No') AS `EMP_MILITARY_SERVICE`,`em`.`EMP_STATUS_ID` AS `EMP_STATUS_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`EMP_STATUS_ID`)) AS `EMP_STATUS`,`em`.`JOB_TITLE_ID` AS `JOB_TITLE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`JOB_TITLE_ID`)) AS `JOB_TITLE`,`em`.`JOB_CAT_ID` AS `JOB_CAT_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`JOB_CAT_ID`)) AS `JOB_CAT`,`em`.`WORK_STATION` AS `WORK_STATION`,`em`.`OA_CNTCT_EML_ID` AS `OA_CNTCT_EML_ID`,`em`.`GENDER_ID` AS `GENDER_ID`,`em`.`HR_EXECUTIVE_ID` AS `HR_EXECUTIVE_ID`,(select concat(`emm`.`EMP_NAME`,' ',`emm`.`EMPLST_NM`) from `job_applicant_mst` `emm` where (`emm`.`EMP_ID` = `em`.`HR_EXECUTIVE_ID`)) AS `HR_EXECUTIVE`,if((`em`.`IS_SMOKER` = 1),'Yes','No') AS `IS_SMOKER`,(select `immigration_dtl_vw`.`IMMIGRATION_NO` from `immigration_dtl_vw` where ((`immigration_dtl_vw`.`EMP_ID` = `em`.`EMP_ID`) and (`immigration_dtl_vw`.`IMMIGRATION_TYP_ID` = (select `independent_mst`.`MSTR_ID` from `independent_mst` where (`independent_mst`.`MSTR_CD` = 'ITPS') limit 1))) order by `immigration_dtl_vw`.`EMP_ID` desc limit 1) AS `PASSPORT_NO`,`em`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`em`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`em`.`SKYPE_ID` AS `SKYPE_ID`,`em`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`em`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`em`.`CREATED_ON` AS `CREATED_ON`,`em`.`UPDATED_ON` AS `UPDATED_ON`,`em`.`IS_DELETED` AS `IS_DELETED` from `job_applicant_mst` `em` where (`em`.`IS_DELETED` = 0) */;

--
-- Final view structure for view `job_applicant_new_vw`
--

/*!50001 DROP VIEW IF EXISTS `job_applicant_new_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `job_applicant_new_vw` AS select `em`.`EMP_ID` AS `EMP_ID`,`em`.`EMP_NBR` AS `EMP_NBR`,`em`.`EMP_INITIALS` AS `EMP_INITIALS`,(select concat(ifnull(`em`.`EMP_NAME`,''),' ',ifnull(`em`.`EMP_MIDDLE_NM`,''),' ',ifnull(`em`.`EMPLST_NM`,''))) AS `EMP_FULL_NAME`,`em`.`EMP_NAME` AS `EMP_NAME`,`em`.`EMP_MIDDLE_NM` AS `EMP_MIDDLE_NM`,`em`.`EMPLST_NM` AS `EMPLST_NM`,`em`.`OA_CNTCT_EML_ID` AS `OA_CNTCT_EML_ID`,(select `email_address_mst`.`EMAIL_ADD` from `email_address_mst` where (`email_address_mst`.`EMAIL_ADD_ID` = (select `contact_emails`.`EMAIL_ADD_ID` from `contact_emails` where (`contact_emails`.`CNTCT_EML_ID` = (select `oa_contact_emails`.`CNTCT_EML_ID` from `oa_contact_emails` where (`oa_contact_emails`.`OA_CNTCT_EML_ID` = `em`.`OA_CNTCT_EML_ID`)))))) AS `EMAIL_ADD`,`em`.`OA_CNTCT_PHONE_ID` AS `OA_CNTCT_PHONE_ID`,(select `phone_nbr_mst`.`PHONE_NBR` from `phone_nbr_mst` where (`phone_nbr_mst`.`PHONE_NBR_ID` = (select `contact_phones`.`PHONE_NBR_ID` from `contact_phones` where (`contact_phones`.`CNTCT_PHONE_ID` = (select `oa_contact_phones`.`CNTCT_PHONE_ID` from `oa_contact_phones` where (`oa_contact_phones`.`OA_CNTCT_PHONE_ID` = `em`.`OA_CNTCT_PHONE_ID`)))))) AS `PHONE_NBR`,(select concat((select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`COUNTRY_CODE`)),' ',`PHONE_NBR`)) AS `FULL_PHONE_NBR`,if((`em`.`IS_MANAGER` = 1),'Yes','No') AS `IS_MANAGER`,`em`.`MANAGER_ID` AS `MANAGER_ID`,(select `job_applicant_mst`.`EMP_NAME` from `job_applicant_mst` where (`job_applicant_mst`.`EMP_ID` = `em`.`MANAGER_ID`)) AS `MANAGER`,`em`.`DOB` AS `DOB`,`em`.`GENDER_ID` AS `GENDER_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`GENDER_ID`)) AS `GENDER`,`em`.`MARITAL_STATUS_ID` AS `MARITAL_STATUS_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`MARITAL_STATUS_ID`)) AS `MARITAL_STATUS`,`em`.`CAST_ID` AS `CAST_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`CAST_ID`)) AS `CAST`,`em`.`RAISE_ID` AS `RAISE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`RAISE_ID`)) AS `RAISE`,`em`.`ETHINICITY_ID` AS `ETHINICITY_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`ETHINICITY_ID`)) AS `ETHINICITY`,`em`.`BLOOD_GRP` AS `BLOOD_GRP_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`BLOOD_GRP`)) AS `BLOOD_GRP_NM`,if((`em`.`IS_SMOKER` = 1),'Yes','No') AS `IS_SMOKER`,`em`.`EMP_SSN_NBR` AS `EMP_SSN_NBR`,`em`.`EMP_SIN_NBR` AS `EMP_SIN_NBR`,`em`.`EMP_PAN_NBR` AS `EMP_PAN_NBR`,`em`.`EMP_DRI_LICE_NBR` AS `EMP_DRI_LICE_NBR`,`em`.`EMP_DRI_LICE_EXP_DATE` AS `EMP_DRI_LICE_EXP_DATE`,if((`em`.`EMP_MILITARY_SERVICE` = 1),'Yes','No') AS `EMP_MILITARY_SERVICE`,`em`.`HR_EXECUTIVE_ID` AS `HR_EXECUTIVE_ID`,`em`.`EMP_STATUS_ID` AS `EMP_STATUS_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`EMP_STATUS_ID`)) AS `EMP_STATUS`,`em`.`SKYPE_ID` AS `SKYPE_ID`,`em`.`BEST_TIME_TO_CALL` AS `BEST_TIME_TO_CALL`,if((`em`.`RELOCATE` = 0),'No','Yes') AS `RELOCATE`,`em`.`CURRENT_PAY` AS `CURRENT_PAY`,`em`.`DESIRE_PAY` AS `DESIRE_PAY`,`em`.`KEYSKILLS` AS `KEYSKILLS`,`em`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`em`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`em`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`em`.`IS_DELETED` AS `IS_DELETED` from `job_applicant_mst` `em` where (`em`.`IS_DELETED` = 0) */;

--
-- Final view structure for view `job_appoint_vw`
--

/*!50001 DROP VIEW IF EXISTS `job_appoint_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `job_appoint_vw` AS select `job_offered`.`JOB_OFFERED_ID` AS `JOB_OFFERED_ID`,`job_offered`.`CANDIDATE` AS `CANDIDATE`,(select concat(`job_applicant_mst`.`EMP_NAME`,' ',ifnull(`job_applicant_mst`.`EMP_MIDDLE_NM`,''),' ',ifnull(`job_applicant_mst`.`EMPLST_NM`,'')) from `job_applicant_mst` where (`job_applicant_mst`.`EMP_ID` = `job_offered`.`CANDIDATE`)) AS `CANDIDATE_NAME`,`job_offered`.`JOB_OFFERED` AS `JOB_OFFERED`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `job_offered`.`JOB_OFFERED`) limit 1) AS `JOB_OFFERED_NM`,`job_offered`.`SALARY_OFFERED` AS `SALARY_OFFERED`,`job_offered`.`DAT_OF_JOINING` AS `DAT_OF_JOINING`,`job_offered`.`GENERATED` AS `generated`,if((`job_offered`.`APPOINT_GENERATED` = 0),'No','Yes') AS `isgenerated`,`job_offered`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`job_offered`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`job_offered`.`BRAND_ID` AS `BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `job_offered`.`BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `job_offered`.`BRAND_ID`)) AS `OA_BRAND_NM`,`job_offered`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`job_offered`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`job_offered`.`CREATED_ON` AS `CREATED_ON`,`job_offered`.`UPDATED_ON` AS `UPDATED_ON`,`job_offered`.`IS_DELETED` AS `IS_DELETED` from `job_offered` */;

--
-- Final view structure for view `job_category_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `job_category_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `job_category_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 264) */;

--
-- Final view structure for view `job_category_vw`
--

/*!50001 DROP VIEW IF EXISTS `job_category_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `job_category_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 159) */;

--
-- Final view structure for view `job_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `job_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `job_mst_vw` AS select `jm`.`JOB_ID` AS `JOB_ID`,`jm`.`EMP_ID` AS `EMPLOYEE_ID`,(select concat(`emp_mst`.`EMP_NAME`,' ',`emp_mst`.`EMPLST_NM`) from `emp_mst` where (`emp_mst`.`EMP_ID` = `jm`.`EMP_ID`)) AS `EMP_NM`,`jm`.`EMP_STATUS_ID` AS `EMPSTATUSID`,`jm`.`EMP_GROSS_SALARY` AS `EMP_GROSS_SALARY`,`jm`.`EMP_STATUS_ID` AS `EMP_STATUS_ID`,`jm`.`EMP_TYPE_ID` AS `EMP_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `EMPSTATUSID`)) AS `STATUS_NAME`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `jm`.`EMP_TYPE_ID`)) AS `TYPE_NAME`,`jm`.`EMP_CAT_ID` AS `EMP_CAT_ID`,`jm`.`DEPARTMENT_ID` AS `DEPARTMENT_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `jm`.`DEPARTMENT_ID`)) AS `DEPARTMENT_NAME`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `jm`.`DESIGNATION_ID`)) AS `DESIGNATION_NAME`,`jm`.`COST_CENTER` AS `COST_CENTER`,`jm`.`HOLIDAY_GRP_ID` AS `HOLIDAY_GRP_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `jm`.`HOLIDAY_GRP_ID`)) AS `HOLIDAY_GRP`,`jm`.`DESIGNATION_ID` AS `DESIGNATION_ID`,`jm`.`EMP_ID` AS `EMP_ID`,`jm`.`JOB_TITLE_ID` AS `JOB_TITLE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `jm`.`JOB_TITLE_ID`)) AS `JOB_TITLE`,`jm`.`JOB_CAT_ID` AS `JOB_CAT_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `jm`.`JOB_CAT_ID`)) AS `JOB_CATEGORY`,`jm`.`WORK_STATION` AS `WORK_STATION`,`jm`.`EMP_BAND_ID` AS `EMP_BAND_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `jm`.`EMP_BAND_ID`)) AS `EMP_BAND`,`jm`.`EMP_GRADE_ID` AS `EMP_GRADE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `jm`.`EMP_GRADE_ID`)) AS `EMP_GRADE`,`jm`.`POSITION_ID` AS `position_id`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `jm`.`POSITION_ID`)) AS `POSTION_NM`,`jm`.`CURRENCY_ID` AS `currency_id`,(select `currency_mst`.`CURR_NAME` from `currency_mst` where (`currency_mst`.`CURR_ID` = `jm`.`CURRENCY_ID`)) AS `CURRENCY_NM`,`jm`.`DATE_OF_JOINING` AS `DATE_OF_JOINING`,`jm`.`CREATED_BY` AS `Created_By_User_id`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `Created_By_User_id`)) AS `CREATED_BY_USER_NAME`,`jm`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`jm`.`CREATED_ON` AS `CREATED_ON`,`jm`.`UPDATED_ON` AS `UPDATED_ON`,`jm`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`jm`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`jm`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`jm`.`IS_DELETED` AS `IS_DELETED`,`jm`.`CONFIRMATION_DATE` AS `CONFIRMATION_DATE`,`jm`.`LAST_APPRAISAL_DATE` AS `LAST_APPRAISAL_DATE`,`jm`.`APPRAISAL_TYPE` AS `APPRAISAL_TYPE`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `jm`.`APPRAISAL_TYPE`)) AS `APPRAISAL_TYPE_NM`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `jm`.`WORK_LOCATION`)) AS `WORK_LOCATION`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD` from `job_mst` `jm` */;

--
-- Final view structure for view `job_offered_vw`
--

/*!50001 DROP VIEW IF EXISTS `job_offered_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `job_offered_vw` AS select `job_offered`.`JOB_OFFERED_ID` AS `JOB_OFFERED_ID`,`job_offered`.`CANDIDATE` AS `CANDIDATE`,(select `job_applicant_new_vw`.`EMP_FULL_NAME` from `job_applicant_new_vw` where (`job_applicant_new_vw`.`EMP_ID` = `job_offered`.`CANDIDATE`)) AS `CANDIDATE_NAME`,`job_offered`.`JOB_OFFERED` AS `JOB_OFFERED`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `job_offered`.`JOB_OFFERED`) limit 1) AS `JOB_OFFERED_NM`,`job_offered`.`SALARY_OFFERED` AS `SALARY_OFFERED`,`job_offered`.`DAT_OF_JOINING` AS `DAT_OF_JOINING`,`job_offered`.`MANAGER_ID` AS `MANAGER_ID`,(select concat(`emp_mst`.`EMP_NAME`,' ',`emp_mst`.`EMP_MIDDLE_NM`,' ',`emp_mst`.`EMPLST_NM`) from `emp_mst` where (`emp_mst`.`EMP_ID` = `job_offered`.`MANAGER_ID`)) AS `MANAGER_NM`,`job_offered`.`GENERATED` AS `generated`,if((`job_offered`.`GENERATED` = 0),'No','Yes') AS `isgenerated`,`job_offered`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`job_offered`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`job_offered`.`BRAND_ID` AS `BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `job_offered`.`BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `job_offered`.`BRAND_ID`)) AS `OA_BRAND_NM`,`job_offered`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`job_offered`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`job_offered`.`CREATED_ON` AS `CREATED_ON`,`job_offered`.`UPDATED_ON` AS `UPDATED_ON`,`job_offered`.`IS_DELETED` AS `IS_DELETED` from `job_offered` */;

--
-- Final view structure for view `job_offered_vw280817`
--

/*!50001 DROP VIEW IF EXISTS `job_offered_vw280817`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `job_offered_vw280817` AS select `job_offered`.`JOB_OFFERED_ID` AS `JOB_OFFERED_ID`,`job_offered`.`CANDIDATE` AS `CANDIDATE`,(select concat(`emp_mst`.`EMP_NAME`,' ',`emp_mst`.`EMPLST_NM`) from `emp_mst` where (`emp_mst`.`REF_EMP_ID` = `job_offered`.`USER_ID`)) AS `CANDIDATE_NAME`,`job_offered`.`JOB_OFFERED` AS `JOB_OFFERED`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `job_offered`.`JOB_OFFERED`)) AS `JOB_OFFERED_NM`,`job_offered`.`SALARY_OFFERED` AS `SALARY_OFFERED`,`job_offered`.`DAT_OF_JOINING` AS `DAT_OF_JOINING`,`job_offered`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`job_offered`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`job_offered`.`BRAND_ID` AS `BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `job_offered`.`BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `job_offered`.`BRAND_ID`)) AS `OA_BRAND_NM`,`job_offered`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`job_offered`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`job_offered`.`CREATED_ON` AS `CREATED_ON`,`job_offered`.`UPDATED_ON` AS `UPDATED_ON`,`job_offered`.`IS_DELETED` AS `IS_DELETED` from `job_offered` */;

--
-- Final view structure for view `job_title_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `job_title_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `job_title_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 158) */;

--
-- Final view structure for view `job_title_vw`
--

/*!50001 DROP VIEW IF EXISTS `job_title_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `job_title_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 158) */;

--
-- Final view structure for view `kns_category_vw`
--

/*!50001 DROP VIEW IF EXISTS `kns_category_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `kns_category_vw` AS select `kns_category`.`SKILL_CATEGORY_ID` AS `SKILL_CATEGORY_ID`,`kns_category`.`SKILL_CAT_NM` AS `SKILL_CAT_NM`,`kns_category`.`SKILL_TYP_ID` AS `SKILL_TYP_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `kns_category`.`SKILL_TYP_ID`)) AS `SKILL_TYP_NM`,`kns_category`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`kns_category`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`kns_category`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`kns_category`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`kns_category`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`kns_category`.`CREATED_ON` AS `CREATED_ON`,`kns_category`.`UPDATED_ON` AS `UPDATED_ON`,`kns_category`.`IS_DELETED` AS `IS_DELETED` from `kns_category` */;

--
-- Final view structure for view `kns_employee_vw`
--

/*!50001 DROP VIEW IF EXISTS `kns_employee_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `kns_employee_vw` AS select `knse`.`EMP_ID` AS `EMP_ID`,`knse`.`REF_EMP_ID` AS `REF_EMP_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `knse`.`REF_EMP_ID`)) AS `REF_EMP_NM`,`knse`.`REF_EMP_CD` AS `REF_EMP_CD`,`knse`.`EMP_NM` AS `EMP_NM`,if((`knse`.`IS_MANAGER` = 1),'Yes','No') AS `IS_MANAGER`,`knse`.`MANAGER_ID` AS `MANAGER_ID`,(select `knsem`.`EMP_NM` from `kns_employee` `knsem` where (`knsem`.`EMP_ID` = `knse`.`MANAGER_ID`)) AS `MANAGER_NM`,(select `user_mst`.`IS_PREDEFINED` from `user_mst` where (`user_mst`.`USER_ID` = `knse`.`REF_EMP_ID`)) AS `IS_PREDEFINED`,`knse`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `emp_mst`.`EMP_STATUS_ID` from `emp_mst` where (`emp_mst`.`REF_EMP_ID` = `knse`.`REF_EMP_ID`) limit 1) AS `EMP_STATUS_ID`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`knse`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`knse`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`knse`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`knse`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`knse`.`CREATED_ON` AS `CREATED_ON`,`knse`.`UPDATED_ON` AS `UPDATED_ON`,`knse`.`IS_DELETED` AS `IS_DELETED` from `kns_employee` `knse` */;

--
-- Final view structure for view `kns_project_details_vw`
--

/*!50001 DROP VIEW IF EXISTS `kns_project_details_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `kns_project_details_vw` AS select `kns_project_details`.`SKILL_PRJ_ID` AS `SKILL_PRJ_ID`,`kns_project_details`.`PRJ_NM` AS `PRJ_NM`,`kns_project_details`.`CLIENT_NM` AS `CLIENT_NM`,`kns_project_details`.`DOMAIN` AS `DOMAIN`,`kns_project_details`.`ROLE` AS `ROLE`,`kns_project_details`.`DURATION` AS `DURATION`,`kns_project_details`.`DURATION_UNIT_ID` AS `DURATION_UNIT_ID`,`kns_project_details`.`TEAM_SIZE` AS `TEAM_SIZE`,`kns_project_details`.`LOCATION` AS `LOCATION`,`kns_project_details`.`STATUS_ID` AS `STATUS_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `kns_project_details`.`STATUS_ID`)) AS `STATUS_NM`,`kns_project_details`.`DESCRIPTION` AS `DESCRIPTION`,`kns_project_details`.`EMP_ID` AS `EMPID`,(select `kns_employee`.`EMP_NM` from `kns_employee` where (`kns_employee`.`EMP_ID` = `EMPID`)) AS `EMP_NM`,`kns_project_details`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`kns_project_details`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`kns_project_details`.`APPROVER_ID` AS `APPROVER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `kns_project_details`.`APPROVER_ID`)) AS `APPROVER_NM`,(select `emp_mst`.`EMP_NAME` from `emp_mst` where (`emp_mst`.`REF_EMP_ID` = `kns_project_details`.`APPROVER_ID`)) AS `APPROVER_NAME`,`kns_project_details`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`kns_project_details`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`kns_project_details`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`kns_project_details`.`CREATED_ON` AS `CREATED_ON`,`kns_project_details`.`UPDATED_ON` AS `UPDATED_ON`,`kns_project_details`.`IS_DELETED` AS `IS_DELETED` from `kns_project_details` */;

--
-- Final view structure for view `kns_skills_vw`
--

/*!50001 DROP VIEW IF EXISTS `kns_skills_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `kns_skills_vw` AS select `kns_skills`.`SKILL_DTL_ID` AS `SKILL_DTL_ID`,`kns_skills`.`SKILL_CAT_ID` AS `SKILL_CAT_ID`,(select `kns_category`.`SKILL_CAT_NM` from `kns_category` where (`kns_category`.`SKILL_CATEGORY_ID` = `kns_skills`.`SKILL_CAT_ID`)) AS `SKILL_CAT_NM`,`kns_skills`.`SKILL_NAME` AS `SKILL_NAME`,`kns_skills`.`VERSION` AS `VERSION`,`kns_skills`.`SKILL_PROFICIENCY_ID` AS `SKILL_PROFICIENCY_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `kns_skills`.`SKILL_PROFICIENCY_ID`)) AS `SKILL_PROFICIENCY_NM`,`kns_skills`.`EXPERIENCE` AS `EXPERIENCE`,`kns_skills`.`SKILL_LEVEL_ID` AS `SKILL_LEVEL_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `kns_skills`.`SKILL_LEVEL_ID`)) AS `SKILL_LEVEL_NM`,`kns_skills`.`SKILL_STATUS_ID` AS `SKILL_STATUS_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `kns_skills`.`SKILL_STATUS_ID`)) AS `SKILL_STATUS_NM`,`kns_skills`.`SKILL_TYP_ID` AS `SKILL_TYP_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `kns_skills`.`SKILL_TYP_ID`)) AS `SKILL_TYP_NM`,`kns_skills`.`EMP_ID` AS `EMPID`,`kns_skills`.`EMP_ID` AS `EMP_ID`,(select `kns_employee`.`EMP_NM` from `kns_employee` where (`kns_employee`.`EMP_ID` = `EMPID`)) AS `EMP_NM`,`kns_skills`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`kns_skills`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`kns_skills`.`APPROVER_ID` AS `APPROVER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `kns_skills`.`APPROVER_ID`)) AS `APPROVER_NM`,(select `emp_mst`.`EMP_NAME` from `emp_mst` where (`emp_mst`.`REF_EMP_ID` = `kns_skills`.`APPROVER_ID`) limit 1) AS `APPROVER_NAME`,`kns_skills`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`kns_skills`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`kns_skills`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`kns_skills`.`CREATED_ON` AS `CREATED_ON`,`kns_skills`.`UPDATED_ON` AS `UPDATED_ON`,`kns_skills`.`IS_DELETED` AS `IS_DELETED` from `kns_skills` */;

--
-- Final view structure for view `language_competency_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `language_competency_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `language_competency_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 167) */;

--
-- Final view structure for view `language_competency_vw`
--

/*!50001 DROP VIEW IF EXISTS `language_competency_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `language_competency_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 167) */;

--
-- Final view structure for view `language_fluency_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `language_fluency_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `language_fluency_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 166) */;

--
-- Final view structure for view `language_fluency_vw`
--

/*!50001 DROP VIEW IF EXISTS `language_fluency_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `language_fluency_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 166) */;

--
-- Final view structure for view `language_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `language_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `language_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 165) */;

--
-- Final view structure for view `language_vw`
--

/*!50001 DROP VIEW IF EXISTS `language_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `language_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 165) */;

--
-- Final view structure for view `late_coming_daily_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `late_coming_daily_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `late_coming_daily_summary_vw` AS select `emp_attendance_record`.`ATTND_EMP_ID` AS `ATTND_EMP_ID`,`emp_attendance_record`.`ATTEND_CALENDAR_ID` AS `ATTEND_CALENDAR_ID`,`emp_attendance_record`.`PUNCH_IN_UTC_TIME` AS `PUNCH_IN_UTC_TIME`,(select `calendar`.`DAY_NAME` from `calendar` where (`calendar`.`CALENDAR_ID` = `emp_attendance_record`.`ATTEND_CALENDAR_ID`)) AS `DAY_NM`,(select `attendance_employee`.`EMP_NM` from `attendance_employee` where (`attendance_employee`.`ATTND_EMP_ID` = `emp_attendance_record`.`ATTND_EMP_ID`)) AS `ATTND_EMP_NAME`,(select `attendance_employee`.`MANAGER_ID` from `attendance_employee` where (`attendance_employee`.`ATTND_EMP_ID` = `emp_attendance_record`.`ATTND_EMP_ID`)) AS `MANAGER_ID`,(select `attendance_employee`.`EMP_NM` from `attendance_employee` where (`attendance_employee`.`ATTND_EMP_ID` = (select `attendance_employee`.`MANAGER_ID` from `attendance_employee` where (`attendance_employee`.`ATTND_EMP_ID` = `emp_attendance_record`.`ATTND_EMP_ID`)))) AS `MANAGER_NM`,(select `shift_mst`.`SHIFT_START_TIME` from (((`attendance_employee` join `emp_mst` on((`emp_mst`.`REF_EMP_ID` = `attendance_employee`.`REF_EMP_ID`))) join `emp_work_shift` on((`emp_work_shift`.`EMP_NUMBER` = `emp_mst`.`EMP_ID`))) join `shift_mst` on((`shift_mst`.`SHIFT_ID` = `emp_work_shift`.`WORK_SHIFT_ID`))) where (`emp_attendance_record`.`ATTND_EMP_ID` = `attendance_employee`.`ATTND_EMP_ID`)) AS `SHIFT_TIME`,(select if((timediff(cast(`emp_attendance_record`.`PUNCH_IN_USER_TIME` as time),`SHIFT_TIME`) < '00:00:00'),'00:00:00',timediff(cast(`emp_attendance_record`.`PUNCH_IN_USER_TIME` as time),`SHIFT_TIME`))) AS `LATE_BY`,`emp_attendance_record`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `emp_attendance_record`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `emp_attendance_record`.`OA_ID`)) AS `OA_NM`,`emp_attendance_record`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `emp_attendance_record`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `emp_attendance_record`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`emp_attendance_record`.`USER_ID` AS `USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `emp_attendance_record`.`USER_ID`)) AS `USER_NM` from `emp_attendance_record` where (cast(`emp_attendance_record`.`PUNCH_IN_UTC_TIME` as date) = curdate()) */;

--
-- Final view structure for view `late_coming_monthly_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `late_coming_monthly_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `late_coming_monthly_summary_vw` AS select `late_coming_monthly_summary`.`LCMSID` AS `LCMSID`,`late_coming_monthly_summary`.`ATTND_EMP_ID` AS `ATTND_EMP_ID`,`late_coming_monthly_summary`.`ATTND_EMP_NAME` AS `ATTND_EMP_NAME`,`late_coming_monthly_summary`.`MONTH` AS `MONTH`,`late_coming_monthly_summary`.`MONTH` AS `July`,`late_coming_monthly_summary`.`YEAR` AS `YEAR`,`late_coming_monthly_summary`.`CONSECUTIVE_DAYS_COUNT` AS `CONSECUTIVE_DAYS_COUNT`,`late_coming_monthly_summary`.`NONCONSECUTIVE_DAYS_COUNT` AS `NONCONSECUTIVE_DAYS_COUNT`,`late_coming_monthly_summary`.`DEDUCT_DAYS` AS `DEDUCT_DAYS`,`late_coming_monthly_summary`.`NO_OF_LATE_DAYS` AS `NO_OF_LATE_DAYS`,`late_coming_monthly_summary`.`DEDUCT_RULE` AS `DEDUCT_RULE`,`late_coming_monthly_summary`.`LATE_RULE` AS `LATE_RULE`,`late_coming_monthly_summary`.`GRASSE_MIN` AS `GRASSE_MIN`,`late_coming_monthly_summary`.`FROM_HR` AS `FROM_HR`,`late_coming_monthly_summary`.`TO_HR` AS `TO_HR`,`late_coming_monthly_summary`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `late_coming_monthly_summary`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `late_coming_monthly_summary`.`OA_ID`)) AS `OA_NM`,`late_coming_monthly_summary`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `late_coming_monthly_summary`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `late_coming_monthly_summary`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`late_coming_monthly_summary`.`USER_ID` AS `USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `late_coming_monthly_summary`.`USER_ID`)) AS `USER_NM` from `late_coming_monthly_summary` */;

--
-- Final view structure for view `late_coming_rules_vw`
--

/*!50001 DROP VIEW IF EXISTS `late_coming_rules_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `late_coming_rules_vw` AS select `late_coming_rules`.`LATE_COMING_ID` AS `LATE_COMING_ID`,`late_coming_rules`.`GRADE_ID` AS `GRADE_ID`,`late_coming_rules`.`GRADE_ID` AS `July`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `late_coming_rules`.`GRADE_ID`)) AS `GRADE`,`late_coming_rules`.`DAY_TYPE` AS `DAY_TYPE`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `late_coming_rules`.`DAY_TYPE`)) AS `DAY_TYP_NM`,`late_coming_rules`.`FROM_HR` AS `FROM_HR`,`late_coming_rules`.`TO_HR` AS `TO_HR`,`late_coming_rules`.`GRASE_MIN` AS `GRASE_MIN`,`late_coming_rules`.`DEDUCT_DAYS` AS `DEDUCT_DAYS`,`late_coming_rules`.`CON_LATE_DAYS` AS `CONN_LATE_DAYS`,`late_coming_rules`.`IS_DELETED` AS `IS_DELETED`,`late_coming_rules`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`late_coming_rules`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`late_coming_rules`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`late_coming_rules`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`late_coming_rules`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NAME`,`late_coming_rules`.`CREATED_ON` AS `CREATED_ON`,`late_coming_rules`.`UPDATED_ON` AS `UPDATED_ON` from `late_coming_rules` */;

--
-- Final view structure for view `late_coming_team_monthly_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `late_coming_team_monthly_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `late_coming_team_monthly_summary_vw` AS select `late_coming_team_monthly_summary`.`LCSID` AS `LCSID`,`late_coming_team_monthly_summary`.`ATTND_EMP_ID` AS `ATTND_EMP_ID`,`late_coming_team_monthly_summary`.`ATTND_EMP_NAME` AS `ATTND_EMP_NAME`,`late_coming_team_monthly_summary`.`MANAGER_ID` AS `MANAGER_ID`,(select `attendance_employee`.`EMP_NM` from `attendance_employee` where (`attendance_employee`.`ATTND_EMP_ID` = `late_coming_team_monthly_summary`.`MANAGER_ID`)) AS `MANAGER_NM`,`late_coming_team_monthly_summary`.`MONTH` AS `MONTH`,`late_coming_team_monthly_summary`.`YEAR` AS `YEAR`,`late_coming_team_monthly_summary`.`CONSECUTIVE_DAYS_COUNT` AS `CONSECUTIVE_DAYS_COUNT`,`late_coming_team_monthly_summary`.`NONCONSECUTIVE_DAYS_COUNT` AS `NONCONSECUTIVE_DAYS_COUNT`,`late_coming_team_monthly_summary`.`DEDUCT_DAYS` AS `DEDUCT_DAYS`,`late_coming_team_monthly_summary`.`NO_OF_LATE_DAYS` AS `NO_OF_LATE_DAYS`,`late_coming_team_monthly_summary`.`DEDUCT_RULE` AS `DEDUCT_RULE`,`late_coming_team_monthly_summary`.`LATE_RULE` AS `LATE_RULE`,`late_coming_team_monthly_summary`.`GRASSE_MIN` AS `GRASSE_MIN`,`late_coming_team_monthly_summary`.`FROM_HR` AS `FROM_HR`,`late_coming_team_monthly_summary`.`TO_HR` AS `TO_HR`,`late_coming_team_monthly_summary`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `late_coming_team_monthly_summary`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `late_coming_team_monthly_summary`.`OA_ID`)) AS `OA_NM`,`late_coming_team_monthly_summary`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `late_coming_team_monthly_summary`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `late_coming_team_monthly_summary`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`late_coming_team_monthly_summary`.`USER_ID` AS `USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `late_coming_team_monthly_summary`.`USER_ID`)) AS `USER_NM` from `late_coming_team_monthly_summary` */;

--
-- Final view structure for view `late_coming_team_weekly_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `late_coming_team_weekly_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `late_coming_team_weekly_summary_vw` AS select `late_coming_team_weekly_summary`.`LCSID` AS `LCSID`,`late_coming_team_weekly_summary`.`ATTND_EMP_ID` AS `ATTND_EMP_ID`,`late_coming_team_weekly_summary`.`ATTND_EMP_NAME` AS `ATTND_EMP_NAME`,`late_coming_team_weekly_summary`.`MANAGER_ID` AS `MANAGER_ID`,(select `attendance_employee`.`EMP_NM` from `attendance_employee` where (`attendance_employee`.`ATTND_EMP_ID` = `late_coming_team_weekly_summary`.`MANAGER_ID`)) AS `MANAGER_NM`,`late_coming_team_weekly_summary`.`MONTH` AS `MONTH`,`late_coming_team_weekly_summary`.`YEAR` AS `YEAR`,`late_coming_team_weekly_summary`.`CONSECUTIVE_DAYS_COUNT` AS `CONSECUTIVE_DAYS_COUNT`,`late_coming_team_weekly_summary`.`NONCONSECUTIVE_DAYS_COUNT` AS `NONCONSECUTIVE_DAYS_COUNT`,`late_coming_team_weekly_summary`.`DEDUCT_DAYS` AS `DEDUCT_DAYS`,`late_coming_team_weekly_summary`.`NO_OF_LATE_DAYS` AS `NO_OF_LATE_DAYS`,`late_coming_team_weekly_summary`.`DEDUCT_RULE` AS `DEDUCT_RULE`,`late_coming_team_weekly_summary`.`LATE_RULE` AS `LATE_RULE`,`late_coming_team_weekly_summary`.`GRASSE_MIN` AS `GRASSE_MIN`,`late_coming_team_weekly_summary`.`FROM_HR` AS `FROM_HR`,`late_coming_team_weekly_summary`.`TO_HR` AS `TO_HR`,`late_coming_team_weekly_summary`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `late_coming_team_weekly_summary`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `late_coming_team_weekly_summary`.`OA_ID`)) AS `OA_NM`,`late_coming_team_weekly_summary`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `late_coming_team_weekly_summary`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `late_coming_team_weekly_summary`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`late_coming_team_weekly_summary`.`USER_ID` AS `USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `late_coming_team_weekly_summary`.`USER_ID`)) AS `USER_NM` from `late_coming_team_weekly_summary` */;

--
-- Final view structure for view `late_coming_weekly_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `late_coming_weekly_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `late_coming_weekly_summary_vw` AS select `late_coming_weekly_summary`.`LCWSID` AS `LCWSID`,`late_coming_weekly_summary`.`ATTND_EMP_ID` AS `ATTND_EMP_ID`,`late_coming_weekly_summary`.`ATTND_EMP_NAME` AS `ATTND_EMP_NAME`,`late_coming_weekly_summary`.`MONTH` AS `MONTH`,`late_coming_weekly_summary`.`YEAR` AS `YEAR`,`late_coming_weekly_summary`.`CONSECUTIVE_DAYS_COUNT` AS `CONSECUTIVE_DAYS_COUNT`,`late_coming_weekly_summary`.`NONCONSECUTIVE_DAYS_COUNT` AS `NONCONSECUTIVE_DAYS_COUNT`,`late_coming_weekly_summary`.`DEDUCT_DAYS` AS `DEDUCT_DAYS`,`late_coming_weekly_summary`.`WEEK` AS `WEEK`,`late_coming_weekly_summary`.`NO_OF_LATE_DAYS` AS `NO_OF_LATE_DAYS`,`late_coming_weekly_summary`.`DEDUCT_RULE` AS `DEDUCT_RULE`,`late_coming_weekly_summary`.`LATE_RULE` AS `LATE_RULE`,`late_coming_weekly_summary`.`GRASSE_MIN` AS `GRASSE_MIN`,`late_coming_weekly_summary`.`FROM_HR` AS `FROM_HR`,`late_coming_weekly_summary`.`TO_HR` AS `TO_HR`,`late_coming_weekly_summary`.`OA_ID` AS `OA_ID`,`late_coming_weekly_summary`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`late_coming_weekly_summary`.`USER_ID` AS `USER_ID` from `late_coming_weekly_summary` */;

--
-- Final view structure for view `leave_cancellation_vw`
--

/*!50001 DROP VIEW IF EXISTS `leave_cancellation_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `leave_cancellation_vw` AS select `leave_request_vw`.`LEAVE_REQUEST_ID` AS `LEAVE_REQUEST_ID`,`leave_request_vw`.`LEAVE_TYP` AS `LEAVE_TYP`,`leave_request_vw`.`LEAVE_PERIOD` AS `LEAVE_PERIOD`,`leave_request_vw`.`EMP_NM` AS `EMP_NM`,`leave_request_vw`.`LEAVES_APPLIED` AS `LEAVES_APPLIED`,`leave_request_vw`.`START_DATE` AS `START_DATE`,`leave_request_vw`.`END_DATE` AS `END_DATE`,`leave_request_vw`.`HALF_DAY` AS `HALF_DAY`,`leave_request_vw`.`LEAVE_STATUS_NM` AS `LEAVE_STATUS_NM`,`leave_request_vw`.`OAID` AS `OAID`,`leave_request_vw`.`OA_CD` AS `OA_CD`,`leave_request_vw`.`OA_NM` AS `OA_NM`,`leave_request_vw`.`OABRANDID` AS `OABRANDID`,`leave_request_vw`.`OA_BRAND_CD` AS `OA_BRAND_CD`,`leave_request_vw`.`OA_BRAND_NM` AS `OA_BRAND_NM`,`leave_request_vw`.`USERID` AS `USERID`,`leave_request_vw`.`USER_NM` AS `USER_NM`,`leave_request_vw`.`CREATED_BY_USER_ID` AS `CREATED_BY_USER_ID`,`leave_request_vw`.`CREATED_BY_USER_NAME` AS `CREATED_BY_USER_NAME`,`leave_request_vw`.`UPDATED_BY_USER_ID` AS `UPDATED_BY_USER_ID`,`leave_request_vw`.`UPDATED_BY_USER_NAME` AS `UPDATED_BY_USER_NAME` from `leave_request_vw` where ((`leave_request_vw`.`IS_DELETED` = 0) and ((`leave_request_vw`.`LEAVE_STATUS` = (select `independent_mst`.`MSTR_ID` from `independent_mst` where (`independent_mst`.`MSTR_CD` = 'LEPE'))) or ((`leave_request_vw`.`LEAVE_STATUS` = (select `independent_mst`.`MSTR_ID` from `independent_mst` where (`independent_mst`.`MSTR_CD` = 'LEAC'))) and (`leave_request_vw`.`START_DATE` >= curdate())))) */;

--
-- Final view structure for view `leave_designation_setting_vw`
--

/*!50001 DROP VIEW IF EXISTS `leave_designation_setting_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `leave_designation_setting_vw` AS select `LDS`.`LEAVE_DESIGNATION_ID` AS `LEAVE_DESIGNATION_ID`,`LDS`.`LEAVE_ID` AS `LEAVE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `LDS`.`LEAVE_ID`)) AS `LEAVE_NM`,(select `LD`.`LEAVE_TYPE_ID` from `leavetype_dtl` `LD` where (`LD`.`LEAVE_TYPE_DTL_ID` = `LDS`.`LEAVE_ID`)) AS `LEAVE_TYP_ID`,(select `IM`.`MSTR_NM` from `independent_mst` `IM` where (`IM`.`MSTR_ID` = `LDS`.`LEAVE_TYP_ID`)) AS `LEAVE_TYP_NM`,`LDS`.`DESIGNATION_ID` AS `DESIGNATION_ID`,(select `IM`.`MSTR_NM` from `independent_mst` `IM` where (`IM`.`MSTR_ID` = `LDS`.`DESIGNATION_ID`)) AS `DESIGNATION_NM`,`LDS`.`YEAR` AS `YEAR`,`LDS`.`YEAR` AS `CAL_YEAR`,(select `period_mst`.`FISCAL_PERIOD_DESC` from `period_mst` where (`period_mst`.`PERIOD_ID` = `CAL_YEAR`)) AS `PERIOD`,`LDS`.`LEAVE_NO` AS `LEAVE_NO`,`LDS`.`LEAVE_NO` AS `MAX_NO_OF_LEAVE`,`LDS`.`IS_DELETED` AS `IS_DELETED`,`LDS`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`LDS`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`LDS`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`LDS`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`LDS`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NAME`,`LDS`.`CREATED_ON` AS `CREATED_ON`,`LDS`.`UPDATED_ON` AS `UPDATED_ON` from `leave_designation_setting` `LDS` */;

--
-- Final view structure for view `leave_employee_vw`
--

/*!50001 DROP VIEW IF EXISTS `leave_employee_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `leave_employee_vw` AS select `LE`.`LEAVE_EMP_ID` AS `LEAVE_EMP_ID`,`LE`.`REF_EMP_ID` AS `REF_EMP_ID`,`LE`.`REF_EMP_CD` AS `REF_EMP_CD`,`LE`.`EMP_NM` AS `EMP_NM`,(select concat(`emp_mst`.`EMP_NAME`,' ',`emp_mst`.`EMPLST_NM`) from `emp_mst` where (`emp_mst`.`REF_EMP_ID` = `LE`.`REF_EMP_ID`) limit 1) AS `REF_EMP_NM`,(select `emp_mst_vw`.`DATE_OF_JOINING` from `emp_mst_vw` where (`emp_mst_vw`.`REF_EMP_ID` = `LE`.`REF_EMP_ID`) limit 1) AS `DATE_OF_JOINING`,`LE`.`MANAGER_ID` AS `MANAGER_ID`,(select `LEM`.`EMP_NM` from `leave_employee` `LEM` where (`LEM`.`LEAVE_EMP_ID` = `LE`.`MANAGER_ID`)) AS `MANAGER_NM`,if((`LE`.`IS_MANAGER` = 1),'Yes','No') AS `IS_MANAGER`,(select `emp_mst`.`EMP_STATUS_ID` from `emp_mst` where (`emp_mst`.`REF_EMP_ID` = `LE`.`REF_EMP_ID`) limit 1) AS `EMP_STATUS_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = (select `emp_mst`.`EMP_STATUS_ID` from `emp_mst` where (`emp_mst`.`REF_EMP_ID` = `LE`.`REF_EMP_ID`) limit 1))) AS `EMP_STATUS`,`LE`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`LE`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`LE`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`LE`.`IS_DELETED` AS `IS_DELETED`,`LE`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`LE`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`LE`.`CREATEDON` AS `CREATEDON`,`LE`.`UPDATEDON` AS `UPDATEDON` from `leave_employee` `LE` */;

--
-- Final view structure for view `leave_monthly_credit_vw`
--

/*!50001 DROP VIEW IF EXISTS `leave_monthly_credit_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `leave_monthly_credit_vw` AS select `leave_monthly_credit`.`LEAVE_MONTHLY_CREDIT_ID` AS `LEAVE_MONTHLY_CREDIT_ID`,`leave_monthly_credit`.`LEAVE_TYPE_ID` AS `LEAVE_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `leave_monthly_credit`.`LEAVE_TYPE_ID`)) AS `LEAVE_TYPE`,`leave_monthly_credit`.`LEAVE_PERIOD_ID` AS `LEAVE_PERIOD_ID`,(select `period_mst`.`FISCAL_PERIOD_DESC` from `period_mst` where (`period_mst`.`PERIOD_ID` = `leave_monthly_credit`.`LEAVE_PERIOD_ID`)) AS `LEAVE_PERIOD`,`leave_monthly_credit`.`LEAVE_EMP_ID` AS `LEAVE_EMP_ID`,`leave_monthly_credit`.`LEAVE_EMP_ID` AS `LEAVEEMPID`,(select `leave_employee`.`EMP_NM` from `leave_employee` where (`leave_employee`.`LEAVE_EMP_ID` = `LEAVEEMPID`)) AS `LEAVE_EMP`,`leave_monthly_credit`.`YEAR` AS `YEAR`,`leave_monthly_credit`.`MONTH` AS `MONTH`,`leave_monthly_credit`.`DATE_CREDITED_ON` AS `DATE_CREDITED_ON`,`leave_monthly_credit`.`NO_OF_DAYS_CREDITED` AS `NO_OF_DAYS_CREDITED`,`leave_monthly_credit`.`IS_DELETED` AS `IS_DELETED`,`leave_monthly_credit`.`OA_ID` AS `OA_ID`,`leave_monthly_credit`.`USER_ID` AS `USER_ID`,`leave_monthly_credit`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`leave_monthly_credit`.`CREATED_BY` AS `CREATED_BY`,`leave_monthly_credit`.`UPDATED_BY` AS `UPDATED_BY`,`leave_monthly_credit`.`CREATED_ON` AS `CREATED_ON`,`leave_monthly_credit`.`UPDATED_ON` AS `UPDATED_ON` from `leave_monthly_credit` */;

--
-- Final view structure for view `leave_period_mst`
--

/*!50001 DROP VIEW IF EXISTS `leave_period_mst`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `leave_period_mst` AS select `PMV`.`PERIOD_ID` AS `LEAVE_PERIOD_ID`,`PMV`.`PERIOD_START_DATE` AS `LEAVE_PERIOD_START_DATE`,`PMV`.`PERIOD_END_DATE` AS `LEAVE_PERIOD_END_DATE`,`PMV`.`PERIOD_TYPE_ID` AS `PERIOD_TYPE_ID`,`PMV`.`PERIOD_TYP_CD` AS `PERIOD_TYP_CD`,`PMV`.`PERIOD_TYP` AS `PERIOD_TYP`,`PMV`.`FISCAL_PERIOD_DESC` AS `FISCAL_PERIOD_DESC`,`PMV`.`PERIOD_STATUS_ID` AS `PERIOD_STATUS_ID`,`PMV`.`PERIOD_STATUS_CD` AS `PERIOD_STATUS_CD`,`PMV`.`PERIOD_STATUS` AS `PERIOD_STATUS`,`PMV`.`OAID` AS `OAID`,`PMV`.`OA_CD` AS `OA_CD`,`PMV`.`OA_NM` AS `OA_NM`,`PMV`.`USERID` AS `USERID`,`PMV`.`USER_NM` AS `USER_NM`,`PMV`.`OABRANDID` AS `OABRANDID`,`PMV`.`OA_BRAND_CD` AS `OA_BRAND_CD`,`PMV`.`OA_BRAND_NM` AS `OA_BRAND_NM`,`PMV`.`CREATED_BY_USER_ID` AS `CREATED_BY_USER_ID`,`PMV`.`CREATED_BY_USER_NAME` AS `CREATED_BY_USER_NAME`,`PMV`.`UPDATED_BY_USER_ID` AS `UPDATED_BY_USER_ID`,`PMV`.`UPDATED_BY_USER_NAME` AS `UPDATED_BY_USER_NAME`,`PMV`.`CREATED_ON` AS `CREATED_ON`,`PMV`.`UPDATED_ON` AS `UPDATED_ON`,`PMV`.`IS_DELETED` AS `IS_DELETED` from `period_mst_vw` `PMV` where (`PMV`.`PERIOD_TYP_CD` = 'OPTLP') */;

--
-- Final view structure for view `leave_period_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `leave_period_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `leave_period_mst_vw` AS select `PMV`.`PERIOD_ID` AS `PERIOD_ID`,`PMV`.`PERIOD_TYPE_ID` AS `PERIOD_TYPE_ID`,`PMV`.`PERIOD_TYP_CD` AS `PERIOD_TYP_CD`,`PMV`.`PERIOD_TYP` AS `PERIOD_TYP`,`PMV`.`PERIOD_START_DATE` AS `PERIOD_START_DATE`,`PMV`.`PERIOD_END_DATE` AS `PERIOD_END_DATE`,`PMV`.`FISCAL_PERIOD_DESC` AS `FISCAL_PERIOD_DESC`,`PMV`.`PERIOD_STATUS_ID` AS `PERIOD_STATUS_ID`,`PMV`.`PERIOD_STATUS_CD` AS `PERIOD_STATUS_CD`,`PMV`.`PERIOD_STATUS` AS `PERIOD_STATUS`,`PMV`.`OAID` AS `OAID`,`PMV`.`OA_CD` AS `OA_CD`,`PMV`.`OA_NM` AS `OA_NM`,`PMV`.`USERID` AS `USERID`,`PMV`.`USER_NM` AS `USER_NM`,`PMV`.`OABRANDID` AS `OABRANDID`,`PMV`.`OA_BRAND_CD` AS `OA_BRAND_CD`,`PMV`.`OA_BRAND_NM` AS `OA_BRAND_NM`,`PMV`.`CREATED_BY_USER_ID` AS `CREATED_BY_USER_ID`,`PMV`.`CREATED_BY_USER_NAME` AS `CREATED_BY_USER_NAME`,`PMV`.`UPDATED_BY_USER_ID` AS `UPDATED_BY_USER_ID`,`PMV`.`UPDATED_BY_USER_NAME` AS `UPDATED_BY_USER_NAME`,`PMV`.`CREATED_ON` AS `CREATED_ON`,`PMV`.`UPDATED_ON` AS `UPDATED_ON`,`PMV`.`IS_DELETED` AS `IS_DELETED` from `period_mst_vw` `PMV` where (`PMV`.`PERIOD_TYP_CD` = 'OPTLP') */;

--
-- Final view structure for view `leave_quota_new_vw`
--

/*!50001 DROP VIEW IF EXISTS `leave_quota_new_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `leave_quota_new_vw` AS select `leave_quota_vw`.`LEAVE_QUOTE_ID` AS `LEAVE_QUOTE_ID`,`leave_quota_vw`.`LEAVE_TYPE_ID` AS `LEAVE_TYPE_ID`,`leave_quota_vw`.`LEAVE_PERIOD_ID` AS `LEAVE_PERIOD_ID`,`leave_quota_vw`.`LEAVE_PERIOD_NM` AS `LEAVE_PERIOD_NM`,`leave_quota_vw`.`LEAVE_EMP_ID` AS `LEAVE_EMP_ID`,`leave_quota_vw`.`LEAVE_TYP` AS `LEAVE_TYP`,`leave_quota_vw`.`LEAVEPERIODID` AS `LEAVEPERIODID`,`leave_quota_vw`.`LEAVE_PERIOD` AS `LEAVE_PERIOD`,`leave_quota_vw`.`LEAVEEMPID` AS `LEAVEEMPID`,`leave_quota_vw`.`EMP_ID` AS `EMP_ID`,`leave_quota_vw`.`EMP_NM` AS `EMP_NM`,`leave_quota_vw`.`EMPLOYEE_NAME` AS `EMPLOYEE_NAME`,(select `leave_quota_vw`.`NO_OF_DAYS_ALLOTED` from `leave_quota_vw` where (`leave_quota_vw`.`LEAVE_TYPE_ID` = 3114) limit 1) AS `PAID LEAVE`,`leave_quota_vw`.`NO_OF_DAYS_ALLOTED` AS `NO_OF_DAYS_ALLOTED`,`leave_quota_vw`.`MONTHLY_LEAVE_ALLOWNACE` AS `MONTHLY_LEAVE_ALLOWNACE`,`leave_quota_vw`.`LEAVE_BROUGHT_FORWARD` AS `LEAVE_BROUGHT_FORWARD`,`leave_quota_vw`.`LEAVE_CARRIED_FORWARD` AS `LEAVE_CARRIED_FORWARD`,`leave_quota_vw`.`TOTAL_BALANCE` AS `TOTAL_BALANCE`,`leave_quota_vw`.`LEAVE_TAKEN` AS `LEAVE_TAKEN`,`leave_quota_vw`.`AVAILABLE_BALANCE` AS `AVAILABLE_BALANCE`,`leave_quota_vw`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`leave_quota_vw`.`OAID` AS `OAID`,`leave_quota_vw`.`OA_CD` AS `OA_CD`,`leave_quota_vw`.`OA_NM` AS `OA_NM`,`leave_quota_vw`.`USERID` AS `USERID`,`leave_quota_vw`.`USER_NM` AS `USER_NM`,`leave_quota_vw`.`OABRANDID` AS `OABRANDID`,`leave_quota_vw`.`OA_BRAND_CD` AS `OA_BRAND_CD`,`leave_quota_vw`.`OA_BRAND_NM` AS `OA_BRAND_NM`,`leave_quota_vw`.`CREATED_BY_USER_ID` AS `CREATED_BY_USER_ID`,`leave_quota_vw`.`CREATED_BY_USER_NAME` AS `CREATED_BY_USER_NAME`,`leave_quota_vw`.`UPDATED_BY_USER_ID` AS `UPDATED_BY_USER_ID`,`leave_quota_vw`.`UPDATED_BY_USER_NAME` AS `UPDATED_BY_USER_NAME`,`leave_quota_vw`.`Created_On` AS `Created_On`,`leave_quota_vw`.`Updated_On` AS `Updated_On`,`leave_quota_vw`.`IS_DELETED` AS `IS_DELETED` from `leave_quota_vw` */;

--
-- Final view structure for view `leave_quota_vw`
--

/*!50001 DROP VIEW IF EXISTS `leave_quota_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `leave_quota_vw` AS select `lq`.`LEAVE_QUOTE_ID` AS `LEAVE_QUOTE_ID`,(select `emp_mst`.`EMP_NBR` from `emp_mst` where (`emp_mst`.`REF_EMP_ID` = (select `leave_employee`.`REF_EMP_ID` from `leave_employee` where (`leave_employee`.`LEAVE_EMP_ID` = `lq`.`LEAVE_EMP_ID`) limit 1)) limit 1) AS `EMP_CODE`,`lq`.`LEAVE_EMP_ID` AS `LEAVEEMPID`,`lq`.`LEAVE_EMP_ID` AS `LEAVE_EMP_ID`,(select `leave_employee`.`REF_EMP_ID` from `leave_employee` where (`leave_employee`.`LEAVE_EMP_ID` = `LEAVEEMPID`) limit 1) AS `EMP_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`EMP_ID` = `user_mst`.`USER_ID`) limit 1) AS `EMP_NM`,(select `leave_employee`.`EMP_NM` from `leave_employee` where (`LEAVEEMPID` = `leave_employee`.`LEAVE_EMP_ID`) limit 1) AS `EMPLOYEE_NAME`,`lq`.`LEAVE_PERIOD_ID` AS `LEAVE_PERIOD_ID`,`lq`.`LEAVE_PERIOD_ID` AS `LEAVEPERIODID`,(select `period_mst`.`FISCAL_PERIOD_DESC` from `period_mst` where (`period_mst`.`PERIOD_ID` = `lq`.`LEAVE_PERIOD_ID`) limit 1) AS `LEAVE_PERIOD_NM`,(select concat(cast(`period_mst`.`PERIOD_START_DATE` as date),' - ',cast(`period_mst`.`PERIOD_END_DATE` as date)) from `period_mst` where (`period_mst`.`PERIOD_ID` = `LEAVEPERIODID`) limit 1) AS `LEAVE_PERIOD`,`lq`.`LEAVE_TYPE_ID` AS `LEAVE_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`lq`.`LEAVE_TYPE_ID` = `independent_mst`.`MSTR_ID`) limit 1) AS `LEAVE_TYP`,`lq`.`NO_OF_DAYS_ALLOTED` AS `NO_OF_DAYS_ALLOTED`,`lq`.`MONTHLY_LEAVE_ALLOWNACE` AS `MONTHLY_LEAVE_ALLOWNACE`,`lq`.`LEAVE_BROUGHT_FORWARD` AS `LEAVE_BROUGHT_FORWARD`,`lq`.`ADHOC` AS `ADHOC`,((ifnull(`lq`.`NO_OF_DAYS_ALLOTED`,0) + ifnull(`lq`.`LEAVE_BROUGHT_FORWARD`,0)) + `lq`.`ADHOC`) AS `TOTAL_BALANCE`,(select (ifnull(sum(`leave_requests_dtl`.`LEAVES_APPLIED`),0) + `lq`.`LEAVE_TAKEN`) from `leave_requests_dtl` where ((`leave_requests_dtl`.`USER_ID` = `lq`.`USER_ID`) and (`leave_requests_dtl`.`LEAVE_TYPE_ID` = `lq`.`LEAVE_TYPE_ID`) and (`leave_requests_dtl`.`LEAVE_PERIOD_ID` = `lq`.`LEAVE_PERIOD_ID`) and ((`leave_requests_dtl`.`LEAVE_STATUS` = (select `independent_mst`.`MSTR_ID` from `independent_mst` where (`independent_mst`.`MSTR_CD` = 'LEPE'))) or (`leave_requests_dtl`.`LEAVE_STATUS` = (select `independent_mst`.`MSTR_ID` from `independent_mst` where (`independent_mst`.`MSTR_CD` = 'LEAC')))) and (`leave_requests_dtl`.`IS_DELETED` = 0)) limit 1) AS `LEAVE_TAKEN`,`lq`.`LAPSE_LEAVE` AS `LAPSE_LEAVE`,`lq`.`LEAVE_CARRIED_FORWARD` AS `LEAVE_CARRIED_FORWARD`,(((((ifnull(`lq`.`NO_OF_DAYS_ALLOTED`,0) + ifnull(`lq`.`LEAVE_BROUGHT_FORWARD`,0)) + `lq`.`ADHOC`) - (select (ifnull(sum(`leave_requests_dtl`.`LEAVES_APPLIED`),0) + `lq`.`LEAVE_TAKEN`) from `leave_requests_dtl` where ((`leave_requests_dtl`.`USER_ID` = `lq`.`USER_ID`) and (`leave_requests_dtl`.`LEAVE_TYPE_ID` = `lq`.`LEAVE_TYPE_ID`) and (`leave_requests_dtl`.`LEAVE_PERIOD_ID` = `lq`.`LEAVE_PERIOD_ID`) and ((`leave_requests_dtl`.`LEAVE_STATUS` = (select `independent_mst`.`MSTR_ID` from `independent_mst` where (`independent_mst`.`MSTR_CD` = 'LEPE'))) or (`leave_requests_dtl`.`LEAVE_STATUS` = (select `independent_mst`.`MSTR_ID` from `independent_mst` where (`independent_mst`.`MSTR_CD` = 'LEAC')))) and (`leave_requests_dtl`.`IS_DELETED` = 0)) limit 1)) - `lq`.`LAPSE_LEAVE`) - `lq`.`LEAVE_CARRIED_FORWARD`) AS `AVAILABLE_BALANCE`,((((select (ifnull(sum(`leave_requests_dtl`.`LEAVES_APPLIED`),0) + `lq`.`LEAVE_TAKEN`) from `leave_requests_dtl` where ((`leave_requests_dtl`.`USER_ID` = `lq`.`USER_ID`) and (`leave_requests_dtl`.`LEAVE_TYPE_ID` = `lq`.`LEAVE_TYPE_ID`) and (`leave_requests_dtl`.`LEAVE_PERIOD_ID` = `lq`.`LEAVE_PERIOD_ID`) and ((`leave_requests_dtl`.`LEAVE_STATUS` = (select `independent_mst`.`MSTR_ID` from `independent_mst` where (`independent_mst`.`MSTR_CD` = 'LEPE'))) or (`leave_requests_dtl`.`LEAVE_STATUS` = (select `independent_mst`.`MSTR_ID` from `independent_mst` where (`independent_mst`.`MSTR_CD` = 'LEAC')))) and (`leave_requests_dtl`.`IS_DELETED` = 0)) limit 1) + `lq`.`LAPSE_LEAVE`) + `lq`.`LEAVE_CARRIED_FORWARD`) + (((((ifnull(`lq`.`NO_OF_DAYS_ALLOTED`,0) + ifnull(`lq`.`LEAVE_BROUGHT_FORWARD`,0)) + `lq`.`ADHOC`) - (select (ifnull(sum(`leave_requests_dtl`.`LEAVES_APPLIED`),0) + `lq`.`LEAVE_TAKEN`) from `leave_requests_dtl` where ((`leave_requests_dtl`.`USER_ID` = `lq`.`USER_ID`) and (`leave_requests_dtl`.`LEAVE_TYPE_ID` = `lq`.`LEAVE_TYPE_ID`) and (`leave_requests_dtl`.`LEAVE_PERIOD_ID` = `lq`.`LEAVE_PERIOD_ID`) and ((`leave_requests_dtl`.`LEAVE_STATUS` = (select `independent_mst`.`MSTR_ID` from `independent_mst` where (`independent_mst`.`MSTR_CD` = 'LEPE'))) or (`leave_requests_dtl`.`LEAVE_STATUS` = (select `independent_mst`.`MSTR_ID` from `independent_mst` where (`independent_mst`.`MSTR_CD` = 'LEAC')))) and (`leave_requests_dtl`.`IS_DELETED` = 0)) limit 1)) - `lq`.`LAPSE_LEAVE`) - `lq`.`LEAVE_CARRIED_FORWARD`)) AS `TOTAL_ADJUSTED`,(select `leavetype_dtl_vw`.`ALLOW_NAGATIVE_BALANCE` from `leavetype_dtl_vw` where (`lq`.`LEAVE_TYPE_ID` = `leavetype_dtl_vw`.`Leave_type_id`) limit 1) AS `ALLOW_NAGATIVE_BALANCE`,`lq`.`COMMENTS` AS `COMMENTS`,(select `user_mst`.`IS_PREDEFINED` from `user_mst` where (`user_mst`.`USER_ID` = `lq`.`USER_ID`) limit 1) AS `IS_PREDEFINED`,`lq`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`lq`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`lq`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`lq`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`lq`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`lq`.`CREATED_ON` AS `Created_On`,`lq`.`UPDATED_ON` AS `Updated_On`,`lq`.`IS_DELETED` AS `IS_DELETED` from `leave_quota` `lq` where (`lq`.`IS_DELETED` = 0) */;

--
-- Final view structure for view `leave_request_accepted_vw`
--

/*!50001 DROP VIEW IF EXISTS `leave_request_accepted_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `leave_request_accepted_vw` AS select `leave_request_vw`.`LEAVE_REQUEST_ID` AS `LEAVE_REQUEST_ID`,`leave_request_vw`.`LEAVE_TYPE_ID` AS `LEAVE_TYPE_ID`,`leave_request_vw`.`LEAVE_TYP_CD` AS `LEAVE_TYP_CD`,`leave_request_vw`.`LEAVE_TYP` AS `LEAVE_TYP`,`leave_request_vw`.`LEAVEPERIODID` AS `LEAVEPERIODID`,`leave_request_vw`.`LEAVE_PERIOD` AS `LEAVE_PERIOD`,`leave_request_vw`.`DATE_APPLIED` AS `DATE_APPLIED`,`leave_request_vw`.`LEAVEEMPID` AS `LEAVEEMPID`,`leave_request_vw`.`EMP_ID` AS `EMP_ID`,`leave_request_vw`.`EMP_NM` AS `EMP_NM`,`leave_request_vw`.`LEAVE_REASON` AS `LEAVE_REASON`,`leave_request_vw`.`START_DATE` AS `START_DATE`,`leave_request_vw`.`END_DATE` AS `END_DATE`,`leave_request_vw`.`HALF_DAY` AS `HALF_DAY`,`leave_request_vw`.`LEAVES_APPLIED` AS `LEAVES_APPLIED`,`leave_request_vw`.`LEAVE_STATUS` AS `LEAVE_STATUS`,`leave_request_vw`.`LEAVE_STATUS_CD` AS `LEAVE_STATUS_CD`,`leave_request_vw`.`LEAVE_STATUS_NM` AS `LEAVE_STATUS_NM`,`leave_request_vw`.`LEAVE_COMMENT` AS `LEAVE_COMMENT`,`leave_request_vw`.`OAID` AS `OAID`,`leave_request_vw`.`OA_CD` AS `OA_CD`,`leave_request_vw`.`OA_NM` AS `OA_NM`,`leave_request_vw`.`USERID` AS `USERID`,`leave_request_vw`.`USER_NM` AS `USER_NM`,`leave_request_vw`.`APPROVER_ID` AS `APPROVER_ID`,`leave_request_vw`.`APPROVER_NM` AS `APPROVER_NM`,`leave_request_vw`.`OABRANDID` AS `OABRANDID`,`leave_request_vw`.`OA_BRAND_CD` AS `OA_BRAND_CD`,`leave_request_vw`.`OA_BRAND_NM` AS `OA_BRAND_NM`,`leave_request_vw`.`CREATED_BY_USER_ID` AS `CREATED_BY_USER_ID`,`leave_request_vw`.`CREATED_BY_USER_NAME` AS `CREATED_BY_USER_NAME`,`leave_request_vw`.`UPDATED_BY_USER_ID` AS `UPDATED_BY_USER_ID`,`leave_request_vw`.`UPDATED_BY_USER_NAME` AS `UPDATED_BY_USER_NAME`,`leave_request_vw`.`Created_On` AS `Created_On`,`leave_request_vw`.`Updated_On` AS `Updated_On`,`leave_request_vw`.`IS_DELETED` AS `IS_DELETED` from `leave_request_vw` where (`leave_request_vw`.`LEAVE_STATUS_CD` = 'LEAC') */;

--
-- Final view structure for view `leave_request_pending_vw`
--

/*!50001 DROP VIEW IF EXISTS `leave_request_pending_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `leave_request_pending_vw` AS select `leave_request_vw`.`LEAVE_REQUEST_ID` AS `LEAVE_REQUEST_ID`,`leave_request_vw`.`LEAVE_TYPE_ID` AS `LEAVE_TYPE_ID`,`leave_request_vw`.`LEAVE_TYP_CD` AS `LEAVE_TYP_CD`,`leave_request_vw`.`LEAVE_TYP` AS `LEAVE_TYP`,`leave_request_vw`.`LEAVEPERIODID` AS `LEAVEPERIODID`,`leave_request_vw`.`LEAVE_PERIOD` AS `LEAVE_PERIOD`,`leave_request_vw`.`DATE_APPLIED` AS `DATE_APPLIED`,`leave_request_vw`.`LEAVEEMPID` AS `LEAVEEMPID`,`leave_request_vw`.`EMP_ID` AS `EMP_ID`,`leave_request_vw`.`EMP_NM` AS `EMP_NM`,`leave_request_vw`.`LEAVE_REASON` AS `LEAVE_REASON`,`leave_request_vw`.`START_DATE` AS `START_DATE`,`leave_request_vw`.`END_DATE` AS `END_DATE`,`leave_request_vw`.`HALF_DAY` AS `HALF_DAY`,`leave_request_vw`.`LEAVES_APPLIED` AS `LEAVES_APPLIED`,`leave_request_vw`.`LEAVE_STATUS` AS `LEAVE_STATUS`,`leave_request_vw`.`LEAVE_STATUS_CD` AS `LEAVE_STATUS_CD`,`leave_request_vw`.`LEAVE_STATUS_NM` AS `LEAVE_STATUS_NM`,`leave_request_vw`.`LEAVE_COMMENT` AS `LEAVE_COMMENT`,`leave_request_vw`.`OAID` AS `OAID`,`leave_request_vw`.`OA_CD` AS `OA_CD`,`leave_request_vw`.`OA_NM` AS `OA_NM`,`leave_request_vw`.`USERID` AS `USERID`,`leave_request_vw`.`USER_NM` AS `USER_NM`,`leave_request_vw`.`APPROVER_ID` AS `APPROVER_ID`,`leave_request_vw`.`APPROVER_NM` AS `APPROVER_NM`,`leave_request_vw`.`OABRANDID` AS `OABRANDID`,`leave_request_vw`.`OA_BRAND_CD` AS `OA_BRAND_CD`,`leave_request_vw`.`OA_BRAND_NM` AS `OA_BRAND_NM`,`leave_request_vw`.`CREATED_BY_USER_ID` AS `CREATED_BY_USER_ID`,`leave_request_vw`.`CREATED_BY_USER_NAME` AS `CREATED_BY_USER_NAME`,`leave_request_vw`.`UPDATED_BY_USER_ID` AS `UPDATED_BY_USER_ID`,`leave_request_vw`.`UPDATED_BY_USER_NAME` AS `UPDATED_BY_USER_NAME`,`leave_request_vw`.`Created_On` AS `Created_On`,`leave_request_vw`.`Updated_On` AS `Updated_On`,`leave_request_vw`.`IS_DELETED` AS `IS_DELETED` from `leave_request_vw` where (`leave_request_vw`.`LEAVE_STATUS_CD` = 'LEPE') */;

--
-- Final view structure for view `leave_request_rejected_vw`
--

/*!50001 DROP VIEW IF EXISTS `leave_request_rejected_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `leave_request_rejected_vw` AS select `leave_request_vw`.`LEAVE_REQUEST_ID` AS `LEAVE_REQUEST_ID`,`leave_request_vw`.`LEAVE_TYPE_ID` AS `LEAVE_TYPE_ID`,`leave_request_vw`.`LEAVE_TYP_CD` AS `LEAVE_TYP_CD`,`leave_request_vw`.`LEAVE_TYP` AS `LEAVE_TYP`,`leave_request_vw`.`LEAVEPERIODID` AS `LEAVEPERIODID`,`leave_request_vw`.`LEAVE_PERIOD` AS `LEAVE_PERIOD`,`leave_request_vw`.`DATE_APPLIED` AS `DATE_APPLIED`,`leave_request_vw`.`LEAVEEMPID` AS `LEAVEEMPID`,`leave_request_vw`.`EMP_ID` AS `EMP_ID`,`leave_request_vw`.`EMP_NM` AS `EMP_NM`,`leave_request_vw`.`LEAVE_REASON` AS `LEAVE_REASON`,`leave_request_vw`.`START_DATE` AS `START_DATE`,`leave_request_vw`.`END_DATE` AS `END_DATE`,`leave_request_vw`.`HALF_DAY` AS `HALF_DAY`,`leave_request_vw`.`LEAVES_APPLIED` AS `LEAVES_APPLIED`,`leave_request_vw`.`LEAVE_STATUS` AS `LEAVE_STATUS`,`leave_request_vw`.`LEAVE_STATUS_CD` AS `LEAVE_STATUS_CD`,`leave_request_vw`.`LEAVE_STATUS_NM` AS `LEAVE_STATUS_NM`,`leave_request_vw`.`LEAVE_COMMENT` AS `LEAVE_COMMENT`,`leave_request_vw`.`OAID` AS `OAID`,`leave_request_vw`.`OA_CD` AS `OA_CD`,`leave_request_vw`.`OA_NM` AS `OA_NM`,`leave_request_vw`.`USERID` AS `USERID`,`leave_request_vw`.`USER_NM` AS `USER_NM`,`leave_request_vw`.`APPROVER_ID` AS `APPROVER_ID`,`leave_request_vw`.`APPROVER_NM` AS `APPROVER_NM`,`leave_request_vw`.`OABRANDID` AS `OABRANDID`,`leave_request_vw`.`OA_BRAND_CD` AS `OA_BRAND_CD`,`leave_request_vw`.`OA_BRAND_NM` AS `OA_BRAND_NM`,`leave_request_vw`.`CREATED_BY_USER_ID` AS `CREATED_BY_USER_ID`,`leave_request_vw`.`CREATED_BY_USER_NAME` AS `CREATED_BY_USER_NAME`,`leave_request_vw`.`UPDATED_BY_USER_ID` AS `UPDATED_BY_USER_ID`,`leave_request_vw`.`UPDATED_BY_USER_NAME` AS `UPDATED_BY_USER_NAME`,`leave_request_vw`.`Created_On` AS `Created_On`,`leave_request_vw`.`Updated_On` AS `Updated_On`,`leave_request_vw`.`IS_DELETED` AS `IS_DELETED` from `leave_request_vw` where (`leave_request_vw`.`LEAVE_STATUS_CD` = 'LERE') */;

--
-- Final view structure for view `leave_request_vw`
--

/*!50001 DROP VIEW IF EXISTS `leave_request_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `leave_request_vw` AS select `leave_requests_dtl`.`LEAVE_REQUEST_ID` AS `LEAVE_REQUEST_ID`,`leave_requests_dtl`.`LEAVE_TYPE_ID` AS `LEAVE_TYPE_ID`,(select `independent_mst`.`MSTR_CD` from `independent_mst` where (`leave_requests_dtl`.`LEAVE_TYPE_ID` = `independent_mst`.`MSTR_ID`)) AS `LEAVE_TYP_CD`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`leave_requests_dtl`.`LEAVE_TYPE_ID` = `independent_mst`.`MSTR_ID`)) AS `LEAVE_TYP`,`leave_requests_dtl`.`LEAVE_PERIOD_ID` AS `LEAVEPERIODID`,(select concat(`period_mst`.`FISCAL_PERIOD_DESC`) from `period_mst` where (`period_mst`.`PERIOD_ID` = `LEAVEPERIODID`)) AS `LEAVE_PERIOD`,`leave_requests_dtl`.`DATE_APPLIED` AS `DATE_APPLIED`,`leave_requests_dtl`.`LEAVE_EMP_ID` AS `LEAVEEMPID`,(select `leave_employee`.`REF_EMP_ID` from `leave_employee` where (`leave_employee`.`LEAVE_EMP_ID` = `LEAVEEMPID`)) AS `EMP_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`EMP_ID` = `user_mst`.`USER_ID`)) AS `EMP_NM`,`leave_requests_dtl`.`LEAVE_COMMENTS` AS `LEAVE_REASON`,cast(`leave_requests_dtl`.`START_DATE` as date) AS `START_DATE`,cast(`leave_requests_dtl`.`END_DATE` as date) AS `END_DATE`,if((`leave_requests_dtl`.`HALF_DAY` = 1),'Yes','No') AS `HALF_DAY`,`leave_requests_dtl`.`LEAVES_APPLIED` AS `LEAVES_APPLIED`,`leave_requests_dtl`.`LEAVE_STATUS` AS `LEAVE_STATUS`,(select `independent_mst`.`MSTR_CD` from `independent_mst` where (`leave_requests_dtl`.`LEAVE_STATUS` = `independent_mst`.`MSTR_ID`)) AS `LEAVE_STATUS_CD`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`leave_requests_dtl`.`LEAVE_STATUS` = `independent_mst`.`MSTR_ID`)) AS `LEAVE_STATUS_NM`,`leave_requests_dtl`.`COMMENT` AS `LEAVE_COMMENT`,`leave_requests_dtl`.`LEAVE_PERIOD_ID` AS `LEAVE_PERIOD_ID`,`leave_requests_dtl`.`LEAVE_TYPE_NAME` AS `LEAVE_TYPE_NAME`,`leave_requests_dtl`.`LEAVE_EMP_ID` AS `LEAVE_EMP_ID`,`leave_requests_dtl`.`LEAVE_COMMENTS` AS `LEAVE_COMMENTS`,`leave_requests_dtl`.`COMMENT` AS `COMMENT`,`leave_requests_dtl`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`leave_requests_dtl`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`leave_requests_dtl`.`APPROVER_ID` AS `APPROVER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `leave_requests_dtl`.`APPROVER_ID`)) AS `APPROVER_NM`,`leave_requests_dtl`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`leave_requests_dtl`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`leave_requests_dtl`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`leave_requests_dtl`.`CREATED_ON` AS `Created_On`,`leave_requests_dtl`.`UPDATED_ON` AS `Updated_On`,`leave_requests_dtl`.`IS_DELETED` AS `IS_DELETED` from `leave_requests_dtl` where (`leave_requests_dtl`.`IS_DELETED` = 0) */;

--
-- Final view structure for view `leave_setting_vw`
--

/*!50001 DROP VIEW IF EXISTS `leave_setting_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `leave_setting_vw` AS select `leave_setting`.`LS_ID` AS `LS_ID`,`leave_setting`.`NAME` AS `NAME`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `leave_setting`.`NAME`)) AS `LEAVE_SETTING_NM`,`leave_setting`.`SHORT_NAME` AS `SHORT_NAME`,`leave_setting`.`START` AS `START`,`leave_setting`.`STOP` AS `STOP`,`leave_setting`.`RESET_COUNT` AS `RESET_COUNT`,`leave_setting`.`EXPIRE_TIME` AS `EXPIRE_TIME`,`leave_setting`.`MAX_TIMES_PER_YEAR` AS `MAX_TIMES_PER_YEAR`,`leave_setting`.`MAX_TIMES_PER_MONTH` AS `MAX_TIMES_PER_MONTH`,`leave_setting`.`APPLICABLE_TO` AS `APPLICABLE_TO`,`leave_setting`.`ENCASHABLE` AS `ENCASHABLE`,`leave_setting`.`ENCASHABLE_AFTER` AS `ENCASHABLE_AFTER`,`leave_setting`.`CARRY_FORWARD` AS `CARRY_FORWARD`,`leave_setting`.`ENCASHABLE_UNIT` AS `ENCASHABLE_UNIT`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `leave_setting`.`ENCASHABLE_UNIT`)) AS `ENCASHABLE_UNIT_NM`,`leave_setting`.`EXPIRE_UNIT` AS `EXPIRE_UNIT`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `leave_setting`.`EXPIRE_UNIT`)) AS `EXPIRE_UNIT_NM`,`leave_setting`.`IS_DELETED` AS `IS_DELETED`,`leave_setting`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`leave_setting`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`leave_setting`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`leave_setting`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`leave_setting`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NAME`,`leave_setting`.`CREATED_ON` AS `CREATED_ON`,`leave_setting`.`UPDATED_ON` AS `UPDATED_ON` from `leave_setting` */;

--
-- Final view structure for view `leave_status_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `leave_status_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `leave_status_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 187) */;

--
-- Final view structure for view `leave_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `leave_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `leave_type_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 186) */;

--
-- Final view structure for view `leave_type_setting_dtl_vw`
--

/*!50001 DROP VIEW IF EXISTS `leave_type_setting_dtl_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `leave_type_setting_dtl_vw` AS select `LS`.`LS_ID` AS `LS_ID`,`LS`.`LEAVE_TYPE_DTL_ID` AS `LEAVE_TYPE_DTL_ID`,(select `OALT`.`LEAVE_TYPE_ID` from `leave_type_setting_mst_vw` `OALT` where (`LS`.`LEAVE_TYPE_DTL_ID` = `OALT`.`LEAVE_TYPE_DTL_ID`)) AS `LEAVE_TYPE_ID`,(select `OALT`.`LEAVE_TYP_NM` from `leave_type_setting_mst_vw` `OALT` where (`LS`.`LEAVE_TYPE_DTL_ID` = `OALT`.`LEAVE_TYPE_DTL_ID`)) AS `LEAVE_TYP_NM`,(select `OALT`.`OPERATIONAL_COUNTRY_ID` from `leave_type_setting_mst_vw` `OALT` where (`LS`.`LEAVE_TYPE_DTL_ID` = `OALT`.`LEAVE_TYPE_DTL_ID`)) AS `OPERATIONAL_COUNTRY_ID`,(select `OALT`.`COUNTRY_NM` from `leave_type_setting_mst_vw` `OALT` where (`LS`.`LEAVE_TYPE_DTL_ID` = `OALT`.`LEAVE_TYPE_DTL_ID`)) AS `COUNTRY_NM`,`LS`.`NAME` AS `NAME`,`LS`.`SHORT_NAME` AS `SHORT_NAME`,`LS`.`START` AS `START`,`LS`.`STOP` AS `STOP`,`LS`.`RESET_COUNT` AS `RESET_COUNT`,`LS`.`EXPIRE_TIME` AS `EXPIRE_TIME`,`LS`.`MAX_TIMES_PER_YEAR` AS `MAX_TIMES_PER_YEAR`,`LS`.`MAX_TIMES_PER_MONTH` AS `MAX_TIMES_PER_MONTH`,`LS`.`APPLICABLE_TO` AS `APPLICABLE_TO`,`LS`.`ENCASHABLE` AS `ENCASHABLE`,`LS`.`ENCASHABLE_AFTER` AS `ENCASHABLE_AFTER`,`LS`.`CARRY_FORWARD` AS `CARRY_FORWARD`,`LS`.`IS_DELETED` AS `IS_DELETED`,`LS`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`LS`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`LS`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`LS`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`LS`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NAME`,`LS`.`CREATED_ON` AS `CREATED_ON`,`LS`.`UPDATED_ON` AS `UPDATED_ON` from `leave_setting` `LS` */;

--
-- Final view structure for view `leave_type_setting_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `leave_type_setting_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `leave_type_setting_mst_vw` AS select `leavetype_dtl`.`LEAVE_TYPE_DTL_ID` AS `LEAVE_TYPE_DTL_ID`,`leavetype_dtl`.`LEAVE_TYPE_ID` AS `LEAVE_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`leavetype_dtl`.`LEAVE_TYPE_ID` = `independent_mst`.`MSTR_ID`)) AS `LEAVE_TYP_NM`,`leavetype_dtl`.`OPERATIONAL_COUNTRY_ID` AS `OPERATIONAL_COUNTRY_ID`,(select `location_mst`.`LOC_NAME` from `location_mst` where (`leavetype_dtl`.`OPERATIONAL_COUNTRY_ID` = `location_mst`.`LOC_ID`)) AS `COUNTRY_NM`,if((`leavetype_dtl`.`AVAILABLE_FLAG` = 1),'Yes','No') AS `AVAILABLE_FLAG`,`leavetype_dtl`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`leavetype_dtl`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`leavetype_dtl`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`leavetype_dtl`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`leavetype_dtl`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`leavetype_dtl`.`CREATED_ON` AS `CREATED_ON`,`leavetype_dtl`.`UPDATED_ON` AS `UPDATED_ON`,`leavetype_dtl`.`IS_DELETED` AS `IS_DELETED` from `leavetype_dtl` */;

--
-- Final view structure for view `leavetype_dtl_vw`
--

/*!50001 DROP VIEW IF EXISTS `leavetype_dtl_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `leavetype_dtl_vw` AS select `leavetype_dtl`.`LEAVE_TYPE_DTL_ID` AS `leave_type_dtl_id`,`leavetype_dtl`.`LEAVE_TYPE_ID` AS `Leave_type_id`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`leavetype_dtl`.`LEAVE_TYPE_ID` = `independent_mst`.`MSTR_ID`)) AS `LEAVE_TYP_NM`,`leavetype_dtl`.`OPERATIONAL_COUNTRY_ID` AS `OPERATIONAL_COUNTRY_ID`,`leavetype_dtl`.`NO_OF_DAYS` AS `NO_OF_DAYS`,`leavetype_dtl`.`MONTHLY_LEAVE_ALLOWED` AS `MONTHLY_LEAVE_ALLOWED`,`leavetype_dtl`.`LEAVE_IN_ONE_STRETCH` AS `LEAVE_IN_ONE_STRETCH`,(select `location_mst`.`LOC_NAME` from `location_mst` where (`leavetype_dtl`.`OPERATIONAL_COUNTRY_ID` = `location_mst`.`LOC_ID`)) AS `COUNTRY_NM`,if((`leavetype_dtl`.`AVAILABLE_FLAG` = 1),'Yes','No') AS `available_flag`,if((`leavetype_dtl`.`ADVANCE_LEAVE` = 1),'Yes','No') AS `ADVANCE_LEAVE`,`leavetype_dtl`.`NO_ADVANCE_LEAVE` AS `NO_ADVANCE_LEAVE`,if((`leavetype_dtl`.`ADHOC_ALLOCATION` = 1),'Yes','No') AS `ADHOC_ALLOCATION`,if((`leavetype_dtl`.`APPLICABLE_ON_PROBATION` = 1),'Yes','No') AS `APPLICABLE_ON_PROBATION`,if((`leavetype_dtl`.`APPLICABLE_ON_NOTICE_PERIOD` = 1),'Yes','No') AS `APPLICABLE_ON_NOTICE_PERIOD`,if((`leavetype_dtl`.`LOSS_OF_PAY` = 1),'Yes','No') AS `LOSS_OF_PAY`,if((`leavetype_dtl`.`CARRY_OVER_ALLOWED` = 1),'Yes','No') AS `CARRY_OVER_ALLOWED`,if((`leavetype_dtl`.`ALLOW_NAGATIVE_BALANCE` = 1),'Yes','No') AS `ALLOW_NAGATIVE_BALANCE`,if((`leavetype_dtl`.`ENABLE_MLA` = 1),'Yes','No') AS `ENABLE_MLA`,`leavetype_dtl`.`MLA_LIMIT` AS `MLA_LIMIT`,`leavetype_dtl`.`MAX_CARRY_OVER_LIMIT` AS `MAX_CARRY_OVER_LIMIT`,`leavetype_dtl`.`LEAVE_APPLICABLE_TO_ID` AS `LEAVE_APPLICABLE_TO_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `leavetype_dtl`.`LEAVE_APPLICABLE_TO_ID`)) AS `LEAVE_APPLICABLE_TO`,if((`leavetype_dtl`.`BACK_DATED_LEAVE_ENABLE` = 1),'Yes','No') AS `BACK_DATED_LEAVE_ENABLE`,`leavetype_dtl`.`APPLY_LEAVE_REQ_LIMIT` AS `APPLY_LEAVE_REQ_LIMIT`,`leavetype_dtl`.`APPLY_LEAVE_REQ_LIMIT_UNIT` AS `APPLY_LEAVE_REQ_LIMIT_UNIT`,`leavetype_dtl`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`leavetype_dtl`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`leavetype_dtl`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`leavetype_dtl`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`leavetype_dtl`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`leavetype_dtl`.`CREATED_ON` AS `Created_On`,`leavetype_dtl`.`UPDATED_ON` AS `Updated_On`,`leavetype_dtl`.`IS_DELETED` AS `IS_DELETED` from `leavetype_dtl` */;

--
-- Final view structure for view `letters_settings_vw`
--

/*!50001 DROP VIEW IF EXISTS `letters_settings_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `letters_settings_vw` AS select `letters_settings`.`LETTER_ID` AS `LETTER_ID`,`letters_settings`.`LETTER_TYPE` AS `LETTER_TYPE`,`letters_settings`.`COMPANY_NAME` AS `COMPANY_NAME`,`letters_settings`.`REG_ADDRESS` AS `REG_ADDRESS`,`letters_settings`.`REG_ADDRESS_2` AS `REG_ADDRESS_2`,`letters_settings`.`REG_ADDRESS_3` AS `REG_ADDRESS_3`,`letters_settings`.`POSTAL_CODE` AS `POSTAL_CODE`,`letters_settings`.`CITY` AS `CITY`,`letters_settings`.`COUNTRY` AS `COUNTRY`,`letters_settings`.`COMPANY_LOGO` AS `COMPANY_LOGO`,`letters_settings`.`REFERENCE_PREFIX` AS `REFERENCE_PREFIX`,`letters_settings`.`YEARMONTH` AS `YEARMONTH`,`letters_settings`.`REFERENCE_NO` AS `REFERENCE_NO`,`letters_settings`.`LETTER_CONTENT` AS `LETTER_CONTENT`,`letters_settings`.`AUTHORIZED_SIGNATORY` AS `AUTHORIZED_SIGNATORY`,`letters_settings`.`AUTHORIZED_SIGNATORY_HEAD_LINE` AS `AUTHORIZED_SIGNATORY_HEAD_LINE`,`letters_settings`.`TEMPLATE_ID` AS `TEMPLATE_ID`,`letters_settings`.`FOLDER_LOC` AS `FOLDER_LOC`,`letters_settings`.`INSTRUCTION_LINE_1` AS `INSTRUCTION_LINE_1`,`letters_settings`.`INSTRUCTION_LINE_2` AS `INSTRUCTION_LINE_2`,`letters_settings`.`INSTRUCTION_LINE_3` AS `INSTRUCTION_LINE_3`,`letters_settings`.`INSTRUCTION_LINE_4` AS `INSTRUCTION_LINE_4`,`letters_settings`.`FOOTER_TEXT` AS `FOOTER_TEXT`,`letters_settings`.`EMAIL` AS `EMAIL`,`letters_settings`.`PHONE` AS `PHONE`,`letters_settings`.`FAX` AS `FAX`,`letters_settings`.`WEBSITE_URL` AS `WEBSITE_URL`,`letters_settings`.`MAIL_PDF` AS `MAIL_PDF`,`letters_settings`.`OA_ID` AS `OA_ID`,`letters_settings`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`letters_settings`.`USER_ID` AS `USER_ID`,`letters_settings`.`IS_DELETED` AS `IS_DELETED`,`letters_settings`.`CREATED_ON` AS `CREATED_ON`,`letters_settings`.`CREATED_BY` AS `CREATED_BY`,`letters_settings`.`UPDATED_ON` AS `UPDATED_ON`,`letters_settings`.`UPDATED_BY` AS `UPDATED_BY` from `letters_settings` */;

--
-- Final view structure for view `link_support_to_org_vw`
--

/*!50001 DROP VIEW IF EXISTS `link_support_to_org_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `link_support_to_org_vw` AS select `link_support_to_org`.`LSO_ID` AS `LSO_ID`,`link_support_to_org`.`ORG_ID` AS `ORG_ID`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `link_support_to_org`.`ORG_ID`)) AS `ORG_NM`,`link_support_to_org`.`SUPPORT_ID` AS `SUPPORT_ID`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `link_support_to_org`.`SUPPORT_ID`)) AS `SUPPORT_NM`,`link_support_to_org`.`IS_DELETED` AS `IS_DELETED`,`link_support_to_org`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `link_support_to_org`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `link_support_to_org`.`OA_ID`)) AS `OA_NM`,`link_support_to_org`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `link_support_to_org`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `link_support_to_org`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`link_support_to_org`.`USER_ID` AS `USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `link_support_to_org`.`USER_ID`)) AS `USER_NM`,`link_support_to_org`.`CREATED_ON` AS `CREATED_ON`,`link_support_to_org`.`CREATED_BY` AS `CREATED_BY`,`link_support_to_org`.`UPDATED_ON` AS `UPDATED_ON`,`link_support_to_org`.`UPDATED_BY` AS `UPDATED_BY` from `link_support_to_org` */;

--
-- Final view structure for view `loan_employee_vw`
--

/*!50001 DROP VIEW IF EXISTS `loan_employee_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `loan_employee_vw` AS select `loane`.`LOAN_EMP_ID` AS `LOAN_EMP_ID`,`loane`.`EMP_NM` AS `EMP_NM`,`loane`.`REF_EMP_ID` AS `REF_EMP_ID`,`loane`.`REF_EMP_CD` AS `REF_EMP_CD`,if((`loane`.`IS_MANAGER` = 1),'1','0') AS `IS_MANAGER`,`loane`.`MANAGER_ID` AS `MANAGER_ID`,(select `tem`.`EMP_NM` from `loan_employee` `tem` where (`tem`.`LOAN_EMP_ID` = `loane`.`MANAGER_ID`)) AS `MANAGER_NM`,`loane`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`loane`.`OA_ID` AS `OAID`,(select `emp_mst`.`EMP_STATUS_ID` from `emp_mst` where (`emp_mst`.`REF_EMP_ID` = `loane`.`REF_EMP_ID`) limit 1) AS `EMP_STATUS_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`loane`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`loane`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`loane`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`loane`.`CREATEDON` AS `CREATED_ON`,`loane`.`UPDATEDON` AS `UPDATED_ON`,`loane`.`IS_DELETED` AS `IS_DELETED` from `loan_employee` `loane` */;

--
-- Final view structure for view `loan_interest_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `loan_interest_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `loan_interest_type_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 572) */;

--
-- Final view structure for view `loan_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `loan_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `loan_mst_vw` AS select `loan_mst`.`LOAN_ID` AS `LOAN_ID`,`loan_mst`.`LOAN_DESC` AS `LOAN_DESC`,`loan_mst`.`LOAN_TYPE_ID` AS `LOAN_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `loan_mst`.`LOAN_TYPE_ID`)) AS `LOAN_TYPE_NAME`,`loan_mst`.`LOAN_DISBURSMENT_DATE` AS `LOAN_DISBURSMENT_DATE`,`loan_mst`.`CAL_YEAR` AS `CAL_YEAR`,`loan_mst`.`CAL_MONTH` AS `CAL_MONTH`,`loan_mst`.`CAL_DAY` AS `CAL_DAY`,`loan_mst`.`LOAN_AMT` AS `LOAN_AMT`,`loan_mst`.`LOAN_TENURE` AS `LOAN_TENURE`,`loan_mst`.`LOAN_TENURE_UNIT_ID` AS `LOAN_TENURE_UNIT_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `loan_mst`.`LOAN_TENURE_UNIT_ID`)) AS `LOAN_TENURE_UNIT`,`loan_mst`.`INTREST_RATE` AS `INTREST_RATE`,`loan_mst`.`LOAN_INTREST_TYPE_ID` AS `LOAN_INTREST_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `loan_mst`.`LOAN_INTREST_TYPE_ID`)) AS `LOAN_INTREST_TYPE`,`loan_mst`.`ADV_OR_LOAN_FLAG` AS `ADV_OR_LOAN_FLAG`,`loan_mst`.`INTEREST_PAYBLE` AS `INTEREST_PAYBLE`,`loan_mst`.`INTEREST_AMT_PAID` AS `INTEREST_AMT_PAID`,`loan_mst`.`INTEREST_AMT_DUE` AS `INTEREST_AMT_DUE`,`loan_mst`.`PRINCIPLE_AMT_PAID` AS `PRINCIPLE_AMT_PAID`,`loan_mst`.`PRINCIPLE_AMT_DUE` AS `PRINCIPLE_AMT_DUE`,`loan_mst`.`MONTHLY_INTEREST_RATE` AS `MONTHLY_INTEREST_RATE`,`loan_mst`.`MONTHLY_INTEREST` AS `MONTHLY_INTEREST`,`loan_mst`.`MONTHLY_AMOUNT` AS `MONTHLY_AMOUNT`,`loan_mst`.`TOTAL_INTEREST_PER_YEAR` AS `TOTAL_INTEREST_PER_YEAR`,`loan_mst`.`TOTAL_AMOUNT_PAID_PER_YEAR` AS `TOTAL_AMOUNT_PAID_PER_YEAR`,`loan_mst`.`TOTAL_AMOUNT_PER_YEAR` AS `TOTAL_AMOUNT_PER_YEAR`,`loan_mst`.`TOTAL_AMT_PAID` AS `TOTAL_AMT_PAID`,`loan_mst`.`TOTAL_AMT_DUE` AS `TOTAL_AMT_DUE`,`loan_mst`.`LOAN_REPAY_DAY_OF_MONTH` AS `LOAN_REPAY_DAY_OF_MONTH`,`loan_mst`.`EMP_ID` AS `EMPID`,`loan_mst`.`EMP_ID` AS `EMP_ID`,(select `loan_employee`.`EMP_NM` from `loan_employee` where (`EMPID` = `loan_employee`.`LOAN_EMP_ID`)) AS `EMP_NAME`,`loan_mst`.`REMARK` AS `REMARK`,`loan_mst`.`ACC_GROUP` AS `ACC_GROUP`,`loan_mst`.`SUBACC_GROUP` AS `SUBACC_GROUP`,`loan_mst`.`OPENING_BAL` AS `OPENING_BAL`,`loan_mst`.`OA_ID` AS `OAID`,`loan_mst`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`OAID` = `org_accounts`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`OAID` = `org_accounts`.`OA_ID`)) AS `OA_NM`,`loan_mst`.`OA_BRAND_ID` AS `BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`BRAND_ID` = `oa_brands`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`BRAND_ID` = `oa_brands`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`loan_mst`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`loan_mst`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`loan_mst`.`CREATED_ON` AS `CREATED_ON`,`loan_mst`.`UPDATED_ON` AS `UPDATED_ON`,`loan_mst`.`IS_DELETED` AS `IS_DELETED` from `loan_mst` */;

--
-- Final view structure for view `loan_repayment_dtl_vw`
--

/*!50001 DROP VIEW IF EXISTS `loan_repayment_dtl_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `loan_repayment_dtl_vw` AS select `loan_repayment_dtl`.`LOAN_REPAY_DTL_ID` AS `LOAN_REPAY_DTL_ID`,`loan_repayment_dtl`.`LOAN_ID` AS `LOAN_ID`,`loan_repayment_dtl`.`LOAN_ID` AS `LOANID`,(select `loan_mst`.`LOAN_DESC` from `loan_mst` where (`LOANID` = `loan_mst`.`LOAN_ID`)) AS `LOAN_DESC`,`loan_repayment_dtl`.`LOAN_REPAY_DATE` AS `LOAN_REPAY_DATE`,`loan_repayment_dtl`.`CAL_YEAR` AS `CAL_YEAR`,`loan_repayment_dtl`.`CAL_MONTH` AS `CAL_MONTH`,`loan_repayment_dtl`.`CAL_DAY` AS `CAL_DAY`,`loan_repayment_dtl`.`INSTALMENT_AMT_OPENING_BAL` AS `INSTALMENT_AMT_OPENING_BAL`,`loan_repayment_dtl`.`INTEREST_AMT_OPENING_BAL` AS `INTEREST_AMT_OPENING_BAL`,`loan_repayment_dtl`.`PRINCIPLE_AMT_OPENING_BAL` AS `PRINCIPLE_AMT_OPENING_BAL`,`loan_repayment_dtl`.`INSTALMENT_AMT_PAID` AS `INSTALMENT_AMT_PAID`,`loan_repayment_dtl`.`INTEREST_AMT_PAID` AS `INTEREST_AMT_PAID`,`loan_repayment_dtl`.`PRINCIPLE_AMT_PAID` AS `PRINCIPLE_AMT_PAID`,`loan_repayment_dtl`.`INSTALMENT_AMT_CLOSING_BAL` AS `INSTALMENT_AMT_CLOSING_BAL`,`loan_repayment_dtl`.`INTEREST_AMT_CLOSING_BAL` AS `INTEREST_AMT_CLOSING_BAL`,`loan_repayment_dtl`.`PRINCIPLE_AMT_CLOSING_BAL` AS `PRINCIPLE_AMT_CLOSING_BAL`,`loan_repayment_dtl`.`OA_ID` AS `OAID`,`loan_repayment_dtl`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`OAID` = `org_accounts`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`OAID` = `org_accounts`.`OA_ID`)) AS `OA_NM`,`loan_repayment_dtl`.`OA_BRAND_ID` AS `BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`BRAND_ID` = `oa_brands`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`BRAND_ID` = `oa_brands`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`loan_repayment_dtl`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`loan_repayment_dtl`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`loan_repayment_dtl`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NAME`,`loan_repayment_dtl`.`CREATED_ON` AS `CREATED_ON`,`loan_repayment_dtl`.`UPDATED_ON` AS `UPDATED_ON`,`loan_repayment_dtl`.`IS_DELETED` AS `IS_DELETED` from `loan_repayment_dtl` */;

--
-- Final view structure for view `loan_repayment_schedule_vw`
--

/*!50001 DROP VIEW IF EXISTS `loan_repayment_schedule_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `loan_repayment_schedule_vw` AS select `loan_repayment_schedule`.`LOAN_REPAY_SCHEDULE_ID` AS `LOAN_REPAY_SCHEDULE_ID`,`loan_repayment_schedule`.`LOAN_ID` AS `LOAN_ID`,`loan_repayment_schedule`.`LOAN_ID` AS `LOANID`,(select `loan_mst`.`LOAN_DESC` from `loan_mst` where (`LOANID` = `loan_mst`.`LOAN_ID`)) AS `LOAN_DESC`,`loan_repayment_schedule`.`LOAN_REPAY_DATE` AS `LOAN_REPAY_DATE`,`loan_repayment_schedule`.`CAL_YEAR` AS `CAL_YEAR`,`loan_repayment_schedule`.`CAL_MONTH` AS `CAL_MONTH`,`loan_repayment_schedule`.`CAL_DAY` AS `CAL_DAY`,`loan_repayment_schedule`.`INSTALMENT_AMT_OPENING_BAL` AS `INSTALMENT_AMT_OPENING_BAL`,`loan_repayment_schedule`.`INTEREST_AMT_OPENING_BAL` AS `INTEREST_AMT_OPENING_BAL`,`loan_repayment_schedule`.`PRINCIPLE_AMT_OPENING_BAL` AS `PRINCIPLE_AMT_OPENING_BAL`,`loan_repayment_schedule`.`INSTALMENT_AMT_PAID` AS `INSTALMENT_AMT_PAID`,`loan_repayment_schedule`.`INTEREST_AMT_PAID` AS `INTEREST_AMT_PAID`,`loan_repayment_schedule`.`PRINCIPLE_AMT_PAID` AS `PRINCIPLE_AMT_PAID`,`loan_repayment_schedule`.`INSTALMENT_AMT_CLOSING_BAL` AS `INSTALMENT_AMT_CLOSING_BAL`,`loan_repayment_schedule`.`INTEREST_AMT_CLOSING_BAL` AS `INTEREST_AMT_CLOSING_BAL`,`loan_repayment_schedule`.`PRINCIPLE_AMT_CLOSING_BAL` AS `PRINCIPLE_AMT_CLOSING_BAL`,if((`loan_repayment_schedule`.`PAYMENT_RECEIVED_FLAG` = 0),'Unpaid','Paid') AS `PAYMENT_RECEIVED_FLAG`,`loan_repayment_schedule`.`OA_ID` AS `OAID`,`loan_repayment_schedule`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`OAID` = `org_accounts`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`OAID` = `org_accounts`.`OA_ID`)) AS `OA_NM`,`loan_repayment_schedule`.`OA_BRAND_ID` AS `BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`BRAND_ID` = `oa_brands`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`BRAND_ID` = `oa_brands`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`loan_repayment_schedule`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`loan_repayment_schedule`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`loan_repayment_schedule`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NAME`,`loan_repayment_schedule`.`CREATED_ON` AS `CREATED_ON`,`loan_repayment_schedule`.`UPDATED_ON` AS `UPDATED_ON`,`loan_repayment_schedule`.`IS_DELETED` AS `IS_DELETED` from `loan_repayment_schedule` */;

--
-- Final view structure for view `loan_tenure_unit_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `loan_tenure_unit_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `loan_tenure_unit_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 571) */;

--
-- Final view structure for view `loan_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `loan_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `loan_type_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 570) */;

--
-- Final view structure for view `location_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `location_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `location_mst_vw` AS select `location_mst`.`LOC_ID` AS `LOC_ID`,`location_mst`.`LOC_CODE` AS `LOC_CODE`,`location_mst`.`LOC_NAME` AS `LOC_NAME`,`location_mst`.`LOC_TYPE_ID` AS `LOC_TYPE_ID`,(select `common_type`.`TYP_NM` from `common_type` where (`location_mst`.`LOC_TYPE_ID` = `common_type`.`TYP_ID`)) AS `LOC_TYP_NM`,`location_mst`.`LOC_DIAL_CD` AS `LOC_DIAL_CD`,`location_mst`.`LOC_TIMEZONE_CD` AS `LOC_TIMEZONE_CD`,(select `timezone_mst`.`TIMEZONE` from `timezone_mst` where (`location_mst`.`LOC_TIMEZONE_CD` = `timezone_mst`.`TIME_ZONE_ID`)) AS `TIMEZONE_NM`,`location_mst`.`IS_DELETED` AS `IS_DELETED`,`location_mst`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`location_mst`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`location_mst`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`location_mst`.`CREATEDBY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`location_mst`.`UPDATEDBY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`location_mst`.`CREATEDON` AS `CreatedOn`,`location_mst`.`UPDATEDON` AS `UpdatedOn` from `location_mst` */;

--
-- Final view structure for view `login_status_vw`
--

/*!50001 DROP VIEW IF EXISTS `login_status_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `login_status_vw` AS select `user_mst_vw`.`USER_ID` AS `USER_ID`,`user_mst_vw`.`USER_NAME` AS `USER_NAME`,`user_mst_vw`.`REG_EMAIL_ID` AS `REG_EMAIL_ID`,`user_mst_vw`.`USER_STATUS` AS `USER_STATUS`,`user_mst_vw`.`DMN_NM` AS `DMN_NM`,`user_mst_vw`.`OA_CD` AS `OA_CD`,`user_mst_vw`.`BRAND_ID` AS `BRAND_ID`,`user_mst_vw`.`OA_BRAND_CD` AS `OA_BRAND_CD` from `user_mst_vw` where (((`user_mst_vw`.`IS_ONLINE` = 1) or (`user_mst_vw`.`IS_ONLINE` = 'Yes')) and (`user_mst_vw`.`IS_DELETED` = 0)) */;

--
-- Final view structure for view `long_term_asset_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `long_term_asset_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `long_term_asset_type_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`MSTR_DESC` AS `MSTR_DESC`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`PARENT_MSTR_CD` AS `PARENT_MSTR_CD`,`independent_mst`.`PARENT_MSTR_NM` AS `PARENT_MSTR_NM`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IM_GROUP_CTR` AS `IM_GROUP_CTR`,`independent_mst`.`SEQUENCE` AS `SEQUENCE`,`independent_mst`.`FOR_MODULE` AS `FOR_MODULE`,`independent_mst`.`FOR_SYSTEM` AS `FOR_SYSTEM`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 489) */;

--
-- Final view structure for view `mail_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `mail_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `mail_type_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 101) */;

--
-- Final view structure for view `manager_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `manager_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `manager_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 73) */;

--
-- Final view structure for view `manager_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `manager_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `manager_type_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 171) */;

--
-- Final view structure for view `marks_setup_scholastic_vw`
--

/*!50001 DROP VIEW IF EXISTS `marks_setup_scholastic_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `marks_setup_scholastic_vw` AS select `marks_setup_scholastic`.`MARKS_ID` AS `MARKS_ID`,`marks_setup_scholastic`.`STUDENT_LIST` AS `STUDENT_LIST`,`marks_setup_scholastic`.`MARKS_OBTAIN` AS `MARKS_OBTAIN`,`marks_setup_scholastic`.`GRADE` AS `GRADE`,`marks_setup_scholastic`.`RESULT` AS `RESULT`,`marks_setup_scholastic`.`OA_ID` AS `OA_ID`,`marks_setup_scholastic`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`marks_setup_scholastic`.`USER_ID` AS `USER_ID`,`marks_setup_scholastic`.`IS_DELETED` AS `IS_DELETED`,`marks_setup_scholastic`.`CREATED_ON` AS `CREATED_ON`,`marks_setup_scholastic`.`CREATED_BY` AS `CREATED_BY`,`marks_setup_scholastic`.`UPDATED_ON` AS `UPDATED_ON`,`marks_setup_scholastic`.`UPDATED_BY` AS `UPDATED_BY` from `marks_setup_scholastic` */;

--
-- Final view structure for view `marrital_status_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `marrital_status_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `marrital_status_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 134) */;

--
-- Final view structure for view `member_attachment_vw`
--

/*!50001 DROP VIEW IF EXISTS `member_attachment_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `member_attachment_vw` AS select `member_attachment`.`ID` AS `ID`,`member_attachment`.`FILENAME` AS `FILENAME`,`member_attachment`.`IMAGENAME` AS `IMAGENAME`,`member_attachment`.`TYPE` AS `TYPE`,`member_attachment`.`LINKED_MASTER_DOC_TYPE_ID` AS `LINKED_MASTER_DOC_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `member_attachment`.`LINKED_MASTER_DOC_TYPE_ID`)) AS `LINKED_MASTER_DOC_TYPE`,(select `independent_mst`.`MSTR_CD` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `member_attachment`.`LINKED_MASTER_DOC_TYPE_ID`)) AS `LINKED_MASTER_DOC_TYPE_CD`,`member_attachment`.`LINKED_SYSTEM_ENTITY_TYPE_ID` AS `LINKED_SYSTEM_ENTITY_TYPE_ID`,`member_attachment`.`DOC_TYPE_ID` AS `DOC_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `member_attachment`.`DOC_TYPE_ID`)) AS `DOC_TYPE`,`member_attachment`.`DOC_CATEGORY_ID` AS `DOC_CATEGORY_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `member_attachment`.`DOC_CATEGORY_ID`)) AS `DOC_CATEGORY`,`member_attachment`.`DOC_SUB_CATEGORY_ID` AS `DOC_SUB_CATEGORY_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `member_attachment`.`DOC_SUB_CATEGORY_ID`)) AS `DOC_SUB_CATEGORY`,`member_attachment`.`DOC_STATUS_ID` AS `DOC_STATUS_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `member_attachment`.`DOC_STATUS_ID`)) AS `DOC_STATUS`,`member_attachment`.`USER_GROUP_ID` AS `USER_GROUP_ID`,(select `user_group`.`USER_GRP_NM` from `user_group` where (`user_group`.`USER_GRP_ID` = `member_attachment`.`USER_GROUP_ID`)) AS `USER_GROUP`,`member_attachment`.`IS_PUBLIC` AS `IS_PUBLIC`,`member_attachment`.`IS_DELETED` AS `IS_DELETED`,`member_attachment`.`OA_ID` AS `OA_ID`,`member_attachment`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `member_attachment`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,`member_attachment`.`USER_ID` AS `USER_ID`,`member_attachment`.`CREATED_BY` AS `CREATED_BY`,`member_attachment`.`CREATED_ON` AS `CREATED_ON`,`member_attachment`.`UPDATED_BY` AS `UPDATED_BY`,`member_attachment`.`UPDATED_ON` AS `UPDATED_ON` from `member_attachment` */;

--
-- Final view structure for view `membership_vw`
--

/*!50001 DROP VIEW IF EXISTS `membership_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `membership_vw` AS select `membership`.`MEMBERSHIP_ID` AS `MEMBERSHIP_ID`,`membership`.`EMP_ID` AS `EMP_ID`,(select `emp_mst_vw`.`EMP_FULL_NAME` from `emp_mst_vw` where (`emp_mst_vw`.`EMP_ID` = `membership`.`EMP_ID`)) AS `EMP_FULL_NAME`,`membership`.`MEMBERSHIP` AS `MEMBERSHIP`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `membership`.`MEMBERSHIP`)) AS `MEMBERSHIP_NM`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `membership`.`MEMBERSHIP_FR`)) AS `MEMBERSHIP_FR`,`membership`.`SUBSCRIPTION_PAID_BY` AS `SUBSCRIPTION_PAID_BY`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `membership`.`SUBSCRIPTION_PAID_BY`)) AS `SUBSCRIPTION_PAID_BY_NM`,`membership`.`SUBSCRIPTION_AMOUNT` AS `SUBSCRIPTION_AMOUNT`,`membership`.`CURRENCY_ID` AS `CURRENCY_ID`,(select `currency_mst`.`CURR_NAME` from `currency_mst` where (`currency_mst`.`CURR_ID` = `membership`.`CURRENCY_ID`)) AS `CURRENCY`,`membership`.`SUBSCRIPTION_COMMENCE_DATE` AS `SUBSCRIPTION_COMMENCE_DATE`,`membership`.`SUBSCRIPTION_REVEWAL_DATE` AS `SUBSCRIPTION_REVEWAL_DATE`,`membership`.`PROFILE_SUMMARY` AS `PROFILE_SUMMARY`,`membership`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`membership`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`membership`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`membership`.`IS_DELETED` AS `IS_DELETED`,`membership`.`CREATED_ON` AS `CREATED_ON`,`membership`.`UPDATED_ON` AS `UPDATED_ON`,`membership`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`membership`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME` from `membership` */;

--
-- Final view structure for view `menu_config_vw`
--

/*!50001 DROP VIEW IF EXISTS `menu_config_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `menu_config_vw` AS select `menu_config`.`ID` AS `ID`,`menu_config`.`MSTR_ID` AS `MSTR_ID`,(select `independent_mst`.`MSTR_CD` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `menu_config`.`MSTR_ID`)) AS `MASTER_CODE`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `menu_config`.`MSTR_ID`)) AS `MASTER_NAME`,`menu_config`.`MENU_NM` AS `MENU_NM`,`menu_config`.`ICON` AS `ICON`,`menu_config`.`BLOCK_MENU_ICON` AS `BLOCK_MENU_ICON`,`menu_config`.`MEDIUM_VIEW_ICON` AS `MEDIUM_VIEW_ICON`,`menu_config`.`SMALL_VIEW_ICON` AS `SMALL_VIEW_ICON`,`menu_config`.`URL` AS `URL`,`menu_config`.`MENU_ID` AS `MENU_ID`,`menu_config`.`CLASS` AS `CLASS`,`menu_config`.`SHOW_TAB` AS `SHOW_TAB`,`menu_config`.`sequence` AS `sequence`,`menu_config`.`SHOW_MENU` AS `SHOW_MENU` from `menu_config` */;

--
-- Final view structure for view `menu_hier_vw`
--

/*!50001 DROP VIEW IF EXISTS `menu_hier_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `menu_hier_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 82) */;

--
-- Final view structure for view `menu_item_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `menu_item_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `menu_item_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 30) */;

--
-- Final view structure for view `message_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `message_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `message_mst_vw` AS select `message_mst`.`MSG_ID` AS `MSG_ID`,`message_mst`.`SYSTEM_MSG_ID` AS `SYSTEM_MSG_ID`,`message_mst`.`MSG_SHORT_TEXT` AS `MSG_SHORT_TEXT`,`message_mst`.`MSG_LONG_TEXT` AS `MSG_LONG_TEXT`,`message_mst`.`MSG_TYPE_ID` AS `MSG_TYPE_ID`,(select `common_type`.`TYP_NM` from `common_type` where (`common_type`.`TYP_ID` = `message_mst`.`MSG_TYPE_ID`)) AS `MSG_TYPE_NM`,`message_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`message_mst`.`OA_ID` AS `ORG_ACC_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_NM`,`message_mst`.`OA_BRAND_ID` AS `BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_NM`,`message_mst`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`message_mst`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`message_mst`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`message_mst`.`CREATED_ON` AS `CREATED_ON`,`message_mst`.`UPDATED_ON` AS `UPDATED_ON` from `message_mst` */;

--
-- Final view structure for view `messeges_vw`
--

/*!50001 DROP VIEW IF EXISTS `messeges_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `messeges_vw` AS select `message`.`MSG_ID` AS `MSG_ID`,`message`.`PROJECT_ID` AS `PROJECT_ID`,`message`.`TITLE` AS `TITLE`,`message`.`TEXT` AS `TEXT`,`message`.`TAG` AS `TAG`,`message`.`GROUP_M` AS `GROUP_M`,`message`.`POSTED` AS `POSTED`,`message`.`REPLY_TO` AS `REPLY_TO`,`message`.`USER` AS `USER`,`message`.`USER_NAME` AS `USER_NAME`,`message`.`MILE_ID` AS `MILE_ID`,`message`.`IS_DELETED` AS `IS_DELETED`,`message`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`message`.`OA_ID` AS `OA_ID`,`message`.`USER_ID` AS `USER_ID`,`message`.`CREATED_BY` AS `CREATED_BY`,`message`.`UPDATED_BY` AS `UPDATED_BY`,`message`.`CREATED_ON` AS `CREATED_ON`,`message`.`UPDATED_ON` AS `UPDATED_ON` from `message` */;

--
-- Final view structure for view `mileage_claim_details_vw`
--

/*!50001 DROP VIEW IF EXISTS `mileage_claim_details_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `mileage_claim_details_vw` AS select `mileage_claim_details`.`MILEAGE_CLAIM_DETAILS_ID` AS `MILEAGE_CLAIM_DETAILS_ID`,`mileage_claim_details`.`MILEAGE_CLAIM_ID` AS `MILEAGE_CLAIM_ID`,`mileage_claim_details`.`CLAIM_DATE` AS `CLAIM_DATE`,`mileage_claim_details`.`PERSONAL_NAME` AS `PERSONAL_NAME`,`mileage_claim_details`.`DATE_OF_EXPENSE` AS `DATE_OF_EXPENSE`,`mileage_claim_details`.`VEHICLE_TYPE_ID` AS `VEHICLE_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `mileage_claim_details`.`VEHICLE_TYPE_ID`)) AS `VEHICLE_TYPE_NM`,`mileage_claim_details`.`FROM_DESTINATION` AS `FROM_DESTINATION`,`mileage_claim_details`.`TO_DESTINATION` AS `TO_DESTINATION`,`mileage_claim_details`.`PURPOSE_OF_JOURNEY` AS `PURPOSE_OF_JOURNEY`,`mileage_claim_details`.`NO_OF_PASSENGERS` AS `NO_OF_PASSENGERS`,`mileage_claim_details`.`PARKING_CHARGES` AS `PARKING_CHARGES`,`mileage_claim_details`.`BASE_CURRENCY` AS `BASE_CURRENCY`,`mileage_claim_details`.`CURRENCY_RATE` AS `CURRENCY_RATE`,`mileage_claim_details`.`TOLL_CHARGES` AS `TOLL_CHARGES`,`mileage_claim_details`.`MILES_CLAIMED` AS `MILES_CLAIMED`,`mileage_claim_details`.`FUEL_RECEIPT_ATTACHED` AS `FUEL_RECEIPT_ATTACHED`,`mileage_claim_details`.`CAR_PARKRECEIPT_ATTACHED` AS `CAR_PARKRECEIPT_ATTACHED`,`mileage_claim_details`.`TOLL_RECEIPT_ATTACHED` AS `TOLL_RECEIPT_ATTACHED`,`mileage_claim_details`.`IS_DELETED` AS `IS_DELETED`,`mileage_claim_details`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`mileage_claim_details`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`mileage_claim_details`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`mileage_claim_details`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`mileage_claim_details`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NAME`,`mileage_claim_details`.`CREATED_ON` AS `CREATED_ON`,`mileage_claim_details`.`UPDATED_ON` AS `UPDATED_ON` from `mileage_claim_details` */;

--
-- Final view structure for view `mileage_claim_summary_details_vw`
--

/*!50001 DROP VIEW IF EXISTS `mileage_claim_summary_details_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `mileage_claim_summary_details_vw` AS select `mileage_claim_summary_details`.`MCCD_ID` AS `MCCD_ID`,`mileage_claim_summary_details`.`CLAIM_PERSON` AS `CLAIM_PERSON`,(select `mileage_employee`.`EMP_NM` from `mileage_employee` where (`mileage_employee`.`MIL_EMP_ID` = `mileage_claim_summary_details`.`CLAIM_PERSON`)) AS `CLAIM_PERSON_NM`,`mileage_claim_summary_details`.`TOLL_CHARGES` AS `TOLL_CHARGES`,`mileage_claim_summary_details`.`PARKING_CHARGES` AS `PARKING_CHARGES`,`mileage_claim_summary_details`.`MILEAGE_CLAIMED` AS `MILEAGE_CLAIMED`,`mileage_claim_summary_details`.`FY_ID` AS `FY_ID`,(select `period_mst`.`FISCAL_PERIOD_DESC` from `period_mst` where (`period_mst`.`PERIOD_ID` = `mileage_claim_summary_details`.`FY_ID`)) AS `FINANCIAL_YEAR`,`mileage_claim_summary_details`.`IS_DELETED` AS `IS_DELETED`,`mileage_claim_summary_details`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`mileage_claim_summary_details`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`mileage_claim_summary_details`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NAME`,`mileage_claim_summary_details`.`CREATED_BY` AS `CREATED_BY_USER_ID`,`mileage_claim_summary_details`.`CREATED_ON` AS `CREATED_ON`,`mileage_claim_summary_details`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,`mileage_claim_summary_details`.`UPDATED_ON` AS `UPDATED_ON`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME` from `mileage_claim_summary_details` */;

--
-- Final view structure for view `mileage_claim_vw`
--

/*!50001 DROP VIEW IF EXISTS `mileage_claim_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `mileage_claim_vw` AS select `mileage_claim`.`MILEAGE_CLAIM_ID` AS `MILEAGE_CLAIM_ID`,`mileage_claim`.`CLAIM_TITLE` AS `CLAIM_TITLE`,`mileage_claim`.`TOTAL_MILEAGE_CLAIMED` AS `TOTAL_MILEAGE_CLAIMED`,`mileage_claim`.`HIRED_BY` AS `HIRED_BY`,(select `mileage_employee`.`EMP_NM` from `mileage_employee` where (`mileage_employee`.`MIL_EMP_ID` = `mileage_claim`.`HIRED_BY`)) AS `HIRED_BY_NM`,`mileage_claim`.`TOTAL_MILES` AS `TOTAL_MILES`,`mileage_claim`.`TOTAL_PASSENGER_MILES` AS `TOTAL_PASSENGER_MILES`,`mileage_claim`.`PASSENGER_RATE` AS `PASSENGER_RATE`,`mileage_claim`.`MILEAGE_RATE` AS `MILEAGE_RATE`,`mileage_claim`.`ADDITIONAL_MILEAGE_RATE` AS `ADDITIONAL_MILEAGE_RATE`,`mileage_claim`.`MILEAGE_AMT` AS `MILEAGE_AMT`,`mileage_claim`.`ADDITIONAL_MILEAGE_AMT` AS `ADDITIONAL_MILEAGE_AMT`,`mileage_claim`.`TOTAL_TOLL_CHARGES` AS `TOTAL_TOLL_CHARGES`,`mileage_claim`.`TOTAL_PARKING_CHARGES` AS `TOTAL_PARKING_CHARGES`,`mileage_claim`.`TOTAL_AMOUNT_DUE` AS `TOTAL_AMOUNT_DUE`,`mileage_claim`.`TOTAL_AMOUNT_REIMBURSED` AS `TOTAL_AMOUNT_REIMBURSED`,`mileage_claim`.`MC_STATUS_ID` AS `MC_STATUS_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`mileage_claim`.`MC_STATUS_ID` = `independent_mst`.`MSTR_ID`)) AS `MC_STATUS_NM`,`mileage_claim`.`APPROVER_ID` AS `APPROVER_ID`,`mileage_claim`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`mileage_claim`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`mileage_claim`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NAME`,`mileage_claim`.`CREATED_ON` AS `CREATED_ON`,`mileage_claim`.`CREATED_BY` AS `CREATED_BY_USER_ID`,`mileage_claim`.`UPDATED_ON` AS `UPDATED_ON`,`mileage_claim`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`mileage_claim`.`IS_DELETED` AS `IS_DELETED` from `mileage_claim` */;

--
-- Final view structure for view `mileage_employee_vw`
--

/*!50001 DROP VIEW IF EXISTS `mileage_employee_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `mileage_employee_vw` AS select `me`.`MIL_EMP_ID` AS `MIL_EMP_ID`,`me`.`EMP_NM` AS `EMP_NM`,`me`.`REF_EMP_ID` AS `REF_EMP_ID`,`me`.`REF_EMP_CD` AS `REF_EMP_CD`,(select concat(`emp_mst`.`EMP_NAME`,' ',`emp_mst`.`EMPLST_NM`) from `emp_mst` where (`emp_mst`.`REF_EMP_ID` = `me`.`REF_EMP_ID`) limit 1) AS `EMPLOYEE_NM`,if((`me`.`IS_MANAGER` = 1),'Yes','No') AS `IS_MANAGER`,`me`.`MANAGER_ID` AS `MANAGER_ID`,(select `mem`.`EMP_NM` from `mileage_employee` `mem` where (`mem`.`MIL_EMP_ID` = `me`.`MANAGER_ID`) limit 1) AS `APPROVER_NM`,`me`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`me`.`OA_ID` AS `OAID`,(select `emp_mst`.`EMP_STATUS_ID` from `emp_mst` where (`emp_mst`.`REF_EMP_ID` = `me`.`REF_EMP_ID`) limit 1) AS `EMP_STATUS_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`me`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`me`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`me`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`me`.`CREATEDON` AS `CREATED_ON`,`me`.`UPDATEDON` AS `UPDATED_ON`,`me`.`IS_DELETED` AS `IS_DELETED` from `mileage_employee` `me` */;

--
-- Final view structure for view `mileage_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `mileage_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `mileage_mst_vw` AS select `mileage_mst`.`MILEGE_ID` AS `MILEGE_ID`,(select `expenses_employee`.`EMP_NM` from `expenses_employee` where (`expenses_employee`.`EXP_EMP_ID` = `mileage_mst`.`CLAIMANT`)) AS `CLAIMANT`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `mileage_mst`.`CLAIMANT`)) AS `CLAIMANT_NM`,`mileage_mst`.`DATED` AS `DATED`,`mileage_mst`.`MILEAGE` AS `MILEAGE`,`mileage_mst`.`DESCRIPTION` AS `DESCRIPTION`,`mileage_mst`.`VEHICLE_TYPE` AS `VEHICLE_TYPE`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `mileage_mst`.`VEHICLE_TYPE`)) AS `VEHICLE_TYPE_NM`,`mileage_mst`.`VENDOR_NAME` AS `VENDOR_NAME`,`mileage_mst`.`PROJECT_NAME` AS `PROJECT_NAME`,`cd`.`company_name` AS `COMPANY_NM`,`cd`.`contact_type` AS `CONTACT_TYPE`,if((`cd`.`contact_type` = 61),(select `assignment_details`.`assignment_name` from `assignment_details` where (`assignment_details`.`id` = `mileage_mst`.`PROJECT_NAME`)),(select `project_details`.`project_name` from `project_details` where (`project_details`.`id` = `mileage_mst`.`PROJECT_NAME`))) AS `PROJECT_NM`,`mileage_mst`.`ATTACHMENT` AS `ATTACHMENT`,`mileage_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`mileage_mst`.`OA_ID` AS `OA_ID`,`mileage_mst`.`USER_ID` AS `USER_ID`,`mileage_mst`.`IS_DELETED` AS `IS_DELETED`,`mileage_mst`.`CREATED_ON` AS `CREATED_ON`,`mileage_mst`.`UPDATED_ON` AS `UPDATED_ON`,`mileage_mst`.`CREATED_BY` AS `CREATED_BY`,`mileage_mst`.`UPDATED_BY` AS `UPDATED_BY` from (`mileage_mst` left join `company_details` `cd` on((`cd`.`cmpy_id` = `mileage_mst`.`VENDOR_NAME`))) */;

--
-- Final view structure for view `mileage_rates_vw`
--

/*!50001 DROP VIEW IF EXISTS `mileage_rates_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `mileage_rates_vw` AS select `mileage_rates`.`MILEAGE_RATE_ID` AS `MILEAGE_RATE_ID`,`mileage_rates`.`VEHICLE_TYPE_ID` AS `VEHICLE_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`mileage_rates`.`VEHICLE_TYPE_ID` = `independent_mst`.`MSTR_ID`)) AS `VEHICLE_TYPE__NM`,`mileage_rates`.`LOWER_RANGE` AS `LOWER_RANGE`,`mileage_rates`.`UPPER_RANGE` AS `UPPER_RANGE`,`mileage_rates`.`RATE` AS `RATE`,`mileage_rates`.`RATE_UNIT` AS `RATE_UNIT`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`mileage_rates`.`RATE_UNIT` = `independent_mst`.`MSTR_ID`)) AS `RATE_UNIT_NM`,`mileage_rates`.`TAX_YEAR` AS `TAX_YEAR`,(select `period_mst`.`FISCAL_PERIOD_DESC` from `period_mst` where (`period_mst`.`PERIOD_ID` = `mileage_rates`.`TAX_YEAR`)) AS `TAX_YEAR_PERIOD`,`mileage_rates`.`RATE_TYPE` AS `RATE_TYPE`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`mileage_rates`.`RATE_TYPE` = `independent_mst`.`MSTR_ID`)) AS `RATE_TYPE_NM`,`mileage_rates`.`FY_ID` AS `FY_ID`,(select `period_mst`.`FISCAL_PERIOD_DESC` from `period_mst` where (`period_mst`.`PERIOD_ID` = `mileage_rates`.`FY_ID`)) AS `FINANCIAL_YEAR_PERIOD`,`mileage_rates`.`IS_DELETED` AS `IS_DELETED`,`mileage_rates`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`mileage_rates`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`mileage_rates`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`mileage_rates`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`mileage_rates`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NAME`,`mileage_rates`.`CREATED_ON` AS `CREATED_ON`,`mileage_rates`.`UPDATED_ON` AS `UPDATED_ON` from `mileage_rates` */;

--
-- Final view structure for view `milestone_status_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `milestone_status_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `milestone_status_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 257) */;

--
-- Final view structure for view `milestones_assigned_vw`
--

/*!50001 DROP VIEW IF EXISTS `milestones_assigned_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `milestones_assigned_vw` AS select `milestones_assigned`.`MILESTONE_ID` AS `MILESTONE_ID`,`milestones_assigned`.`USER` AS `USER`,`milestones_assigned`.`MILESTONE` AS `MILESTONE`,`milestones_assigned`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`milestones_assigned`.`OA_ID` AS `OA_ID`,`milestones_assigned`.`USER_ID` AS `USER_ID`,`milestones_assigned`.`CREATED_BY` AS `CREATED_BY`,`milestones_assigned`.`UPDATED_BY` AS `UPDATED_BY`,`milestones_assigned`.`CREATED_ON` AS `CREATED_ON`,`milestones_assigned`.`UPDATED_ON` AS `UPDATED_ON` from `milestones_assigned` */;

--
-- Final view structure for view `milestones_vw`
--

/*!50001 DROP VIEW IF EXISTS `milestones_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `milestones_vw` AS select `milestones`.`MILE_ID` AS `MILE_ID`,`milestones`.`PROJECT_ID` AS `PROJECT_ID`,`milestones`.`NAME` AS `NAME`,`milestones`.`DESC` AS `DESC`,`milestones`.`START` AS `START`,`milestones`.`END` AS `END`,`milestones`.`STATUS` AS `STATUS`,`milestones`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`milestones`.`OA_ID` AS `OA_ID`,`milestones`.`USER_ID` AS `USER_ID`,`milestones`.`CREATED_BY` AS `CREATED_BY`,`milestones`.`UPDATED_BY` AS `UPDATED_BY`,`milestones`.`CREATED_ON` AS `CREATED_ON`,`milestones`.`UPDATED_ON` AS `UPDATED_ON` from `milestones` */;

--
-- Final view structure for view `mngt_hier_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `mngt_hier_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `mngt_hier_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 68) */;

--
-- Final view structure for view `mobile_module_vw`
--

/*!50001 DROP VIEW IF EXISTS `mobile_module_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `mobile_module_vw` AS select `mobile_module`.`id` AS `id`,`mobile_module`.`module_id` AS `module_id`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `mobile_module`.`module_id`) limit 1) AS `module_name`,`mobile_module`.`view_name` AS `view_name`,`mobile_module`.`table_name` AS `table_name`,`mobile_module`.`IS_DELETED` AS `IS_DELETED`,`mobile_module`.`OA_ID` AS `OA_ID`,`mobile_module`.`USER_ID` AS `USER_ID`,`mobile_module`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`mobile_module`.`CREATED_BY` AS `CREATED_BY`,`mobile_module`.`UPDATED_BY` AS `UPDATED_BY`,`mobile_module`.`CREATEDON` AS `CREATEDON`,`mobile_module`.`UPDATEDON` AS `UPDATEDON` from `mobile_module` */;

--
-- Final view structure for view `mode_of_application_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `mode_of_application_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `mode_of_application_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 202) */;

--
-- Final view structure for view `model_obj_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `model_obj_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `model_obj_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 21) */;

--
-- Final view structure for view `module_group_feature_list_vw`
--

/*!50001 DROP VIEW IF EXISTS `module_group_feature_list_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `module_group_feature_list_vw` AS select `MGLR`.`ID` AS `ID`,`MGLR`.`MODULE_NAME` AS `ODULE_NAME`,`MGLR`.`MODULE_ID` AS `MODULE_ID`,`MGLR`.`HIER_PARENT_ENTITY_TYPE_ID` AS `HIER_PARENT_ENTITY_TYPE_ID`,`MGLR`.`HIER_PARENT_ENTITY_TYPE_NM` AS `HIER_PARENT_ENTITY_TYPE_NM`,`MGLR`.`NO_OF_AREAS` AS `NO_OF_AREAS`,`MGLR`.`MODULE_RATE_FACTOR` AS `MODULE_RATE_FACTOR`,`MGLR`.`SUBSCRIPTION_LEVEL_ID` AS `SUBSCRIPTION_LEVEL_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `MGLR`.`SUBSCRIPTION_LEVEL_ID`)) AS `SUBSCRIPTION_LEVEL`,`MGLR`.`SUBSCRIPTION_INDEX` AS `SUBSCRIPTION_INDEX` from `module_group_list_rate` `MGLR` */;

--
-- Final view structure for view `module_group_list_rate_vw`
--

/*!50001 DROP VIEW IF EXISTS `module_group_list_rate_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `module_group_list_rate_vw` AS select `module_group_list_rate`.`ID` AS `ID`,`module_group_list_rate`.`MODULE_NAME` AS `MODULE_NAME`,`module_group_list_rate`.`MODULE_ID` AS `MODULE_ID`,`module_group_list_rate`.`HIER_PARENT_ENTITY_TYPE_ID` AS `HIER_PARENT_ENTITY_TYPE_ID`,`module_group_list_rate`.`HIER_PARENT_ENTITY_TYPE_NM` AS `HIER_PARENT_ENTITY_TYPE_NM`,`module_group_list_rate`.`NO_OF_AREAS` AS `NO_OF_AREAS`,`module_group_list_rate`.`MODULE_RATE_FACTOR` AS `MODULE_RATE_FACTOR`,`module_group_list_rate`.`SUBSCRIPTION_LEVEL_ID` AS `SUBSCRIPTION_LEVEL_ID`,`module_group_list_rate`.`SUBSCRIPTION_INDEX` AS `SUBSCRIPTION_INDEX`,`module_group_list_rate`.`IS_DELETED` AS `IS_DELETED` from `module_group_list_rate` */;

--
-- Final view structure for view `module_group_list_vw`
--

/*!50001 DROP VIEW IF EXISTS `module_group_list_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `module_group_list_vw` AS select `relationship_dtl_vw`.`PARENT_MSTR_NM` AS `MODULE_NAME`,`relationship_dtl_vw`.`PARENT_HIER_ID` AS `MODULE_ID`,`relationship_dtl_vw`.`HIER_PARENT_ENTITY_TYPE_ID` AS `HIER_PARENT_ENTITY_TYPE_ID`,`relationship_dtl_vw`.`HIER_PARENT_ENTITY_TYPE_NM` AS `HIER_PARENT_ENTITY_TYPE_NM`,count(1) AS `NO_OF_AREAS`,count(1) AS `RATE_FACTOR` from `relationship_dtl_vw` where (`relationship_dtl_vw`.`HIER_TYPE_ID` = 74) group by `relationship_dtl_vw`.`PARENT_MSTR_NM`,`relationship_dtl_vw`.`PARENT_HIER_ID`,`relationship_dtl_vw`.`HIER_PARENT_ENTITY_TYPE_ID`,`relationship_dtl_vw`.`HIER_PARENT_ENTITY_TYPE_NM` */;

--
-- Final view structure for view `module_menu_item_vw`
--

/*!50001 DROP VIEW IF EXISTS `module_menu_item_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `module_menu_item_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 83) */;

--
-- Final view structure for view `module_name_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `module_name_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `module_name_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 76) */;

--
-- Final view structure for view `module_setting_vw`
--

/*!50001 DROP VIEW IF EXISTS `module_setting_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `module_setting_vw` AS select `SGM`.`SETTING_GROUP_ID` AS `SETTING_GROUP_ID`,`SGM`.`SETTING_GROUP_NAME_ID` AS `SETTING_GROUP_NAME_ID`,`SGM`.`SETTING_GROUP_NAME_CD` AS `SETTING_GROUP_NAME_CD`,(select `IM`.`MSTR_NM` from `independent_mst` `IM` where (`IM`.`MSTR_ID` = `SGM`.`SETTING_GROUP_NAME_ID`)) AS `SETTING_GROUP`,`SGM`.`SETTING_GROUP_NAME` AS `SETTING_GROUP_NAME`,`SGM`.`SETTING_TYPE_ID` AS `SETTING_TYPE_ID`,`SGM`.`SETTING_TYPE_CD` AS `SETTING_TYPE_CD`,`SGM`.`ENABLED` AS `ENABLED`,(select `IM`.`MSTR_NM` from `independent_mst` `IM` where (`IM`.`MSTR_ID` = `SGM`.`SETTING_TYPE_ID`)) AS `SETTING_TYPE`,`SGM`.`IS_DELETED` AS `IS_DELETED`,`SGM`.`OA_ID` AS `OA_ID`,(select `OA`.`OA_CD` from `org_accounts` `OA` where (`OA`.`OA_ID` = `SGM`.`OA_ID`)) AS `OA_CD`,(select `OA`.`OA_NM` from `org_accounts` `OA` where (`OA`.`OA_ID` = `SGM`.`OA_ID`)) AS `OA_NM`,`SGM`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `OAB`.`OA_BRAND_CD` from `oa_brands` `OAB` where (`OAB`.`OA_BRAND_ID` = `SGM`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `OAB`.`OA_BRAND_NM` from `oa_brands` `OAB` where (`OAB`.`OA_BRAND_ID` = `SGM`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`SGM`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `um`.`USER_NAME` from `user_mst` `um` where (`um`.`USER_ID` = `SGM`.`CREATED_BY`)) AS `CREATED_BY_USER_NAME`,`SGM`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `um`.`USER_NAME` from `user_mst` `um` where (`um`.`USER_ID` = `SGM`.`UPDATED_BY`)) AS `UPDATED_BY_USER_NAME`,`SGM`.`CREATED_ON` AS `CREATED_ON`,`SGM`.`UPDATED_ON` AS `UPDATED_ON` from `setting_group_mst` `SGM` where (`SGM`.`SETTING_TYPE_CD` = 'STUCS') */;

--
-- Final view structure for view `monthly_attendance_record_vw`
--

/*!50001 DROP VIEW IF EXISTS `monthly_attendance_record_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `monthly_attendance_record_vw` AS select `emp_attendance_record_vw`.`OAID` AS `OAID`,`emp_attendance_record_vw`.`OA_CD` AS `OA_CD`,`emp_attendance_record_vw`.`OA_NM` AS `OA_NM`,`emp_attendance_record_vw`.`OABRANDID` AS `OABRANDID`,`emp_attendance_record_vw`.`OA_BRAND_CD` AS `OA_BRAND_CD`,`emp_attendance_record_vw`.`OA_BRAND_NM` AS `OA_BRAND_NM`,`emp_attendance_record_vw`.`ATTND_EMP_ID` AS `ATTND_EMP_ID`,`emp_attendance_record_vw`.`EMPLOYEE_NM` AS `EMPLOYEE_NM`,`emp_attendance_record_vw`.`MANAGER_ID` AS `MANAGER_ID`,`emp_attendance_record_vw`.`IS_MANAGER` AS `IS_MANAGER`,`emp_attendance_record_vw`.`REF_EMP_ID` AS `REF_EMP_ID`,`emp_attendance_record_vw`.`REF_EMP_CD` AS `REF_EMP_CD`,`emp_attendance_record_vw`.`ATTND_STATUS_ID` AS `ATTND_STATUS_ID`,`emp_attendance_record_vw`.`ATTND_STATUS` AS `ATTND_STATUS`,`emp_attendance_record_vw`.`CAL_YEAR` AS `CAL_YEAR`,`emp_attendance_record_vw`.`CAL_MONTH` AS `CAL_MONTH`,sum(`emp_attendance_record_vw`.`HRS`) AS `HRS`,sum(`emp_attendance_record_vw`.`MINS`) AS `MINS`,sum(`emp_attendance_record_vw`.`SECONDS`) AS `SECONDS` from `emp_attendance_record_vw` group by `emp_attendance_record_vw`.`OAID`,`emp_attendance_record_vw`.`OA_CD`,`emp_attendance_record_vw`.`OA_NM`,`emp_attendance_record_vw`.`OABRANDID`,`emp_attendance_record_vw`.`OA_BRAND_CD`,`emp_attendance_record_vw`.`OA_BRAND_NM`,`emp_attendance_record_vw`.`ATTND_EMP_ID`,`emp_attendance_record_vw`.`EMPLOYEE_NM`,`emp_attendance_record_vw`.`MANAGER_ID`,`emp_attendance_record_vw`.`IS_MANAGER`,`emp_attendance_record_vw`.`REF_EMP_ID`,`emp_attendance_record_vw`.`REF_EMP_CD`,`emp_attendance_record_vw`.`ATTND_STATUS_ID`,`emp_attendance_record_vw`.`ATTND_STATUS`,`emp_attendance_record_vw`.`CAL_YEAR`,`emp_attendance_record_vw`.`CAL_MONTH` */;

--
-- Final view structure for view `monthly_pay_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `monthly_pay_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `monthly_pay_summary_vw` AS select `E`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `E`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `E`.`OA_ID`)) AS `OA_NM`,`E`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `E`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `E`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`E`.`EMP_ID` AS `EMP_ID`,(select `emp_mst`.`EMP_NAME` from `emp_mst` where (`emp_mst`.`EMP_ID` = `E`.`EMP_ID`)) AS `EMP_NAME`,`E`.`FINANCIAL_YEAR_ID` AS `FINANCIAL_YEAR_ID`,`E`.`CALENDAR_YEAR` AS `CALENDAR_YEAR`,`E`.`CALENDAR_MONTH` AS `CALENDAR_MONTH`,sum(`E`.`ACTUAL_AMOUNT`) AS `TOTAL_ACTUAL_AMOUNT`,sum(`E`.`EARNED_AMOUNT`) AS `TOTAL_EARNED_AMOUNT` from (`employee_payment_details` `E` join `independent_mst` `IM` on((`IM`.`MSTR_ID` = `E`.`PAY_FREQUENCY`))) where (`IM`.`MSTR_CD` = 'PFMLY') group by `E`.`OA_ID`,`E`.`OA_BRAND_ID`,`E`.`EMP_ID`,`E`.`FINANCIAL_YEAR_ID`,`E`.`PAY_FREQUENCY`,`E`.`CALENDAR_YEAR`,`E`.`CALENDAR_MONTH` */;

--
-- Final view structure for view `mortgage_applicant_vw`
--

/*!50001 DROP VIEW IF EXISTS `mortgage_applicant_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `mortgage_applicant_vw` AS select `mortgage_applicant`.`MTG_APP_ID` AS `MTG_APP_ID`,`mortgage_applicant`.`MORTGAGE_ID` AS `MORTGAGE_ID`,(select concat(ifnull(`mortgage_applicant`.`MTG_FIRSTNAME`,' '),' ',ifnull(`mortgage_applicant`.`MTG_SURNAME`,' '))) AS `FULL_NAME`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`mortgage_applicant`.`MTG_TITLE` = `independent_mst`.`MSTR_ID`)) AS `MTG_TITLE`,`mortgage_applicant`.`MTG_SURNAME` AS `MTG_SURNAME`,`mortgage_applicant`.`MTG_FIRSTNAME` AS `MTG_FIRSTNAME`,`mortgage_applicant`.`MTG_PREVIOUS_NAME` AS `MTG_PREVIOUS_NAME`,`mortgage_applicant`.`MTG_NATIONALITY` AS `MTG_NATIONALITY`,`mortgage_applicant`.`MTG_DATE_OF_BIRTH` AS `MTG_DATE_OF_BIRTH`,`mortgage_applicant`.`MTG_MARITAL_STATUS` AS `MTG_MARITAL_STATUS`,`mortgage_applicant`.`MTG_RELATIONSHIP` AS `MTG_RELATIONSHIP`,`mortgage_applicant`.`MTG_DEPENDENTS` AS `MTG_DEPENDENTS`,`mortgage_applicant`.`MTG_CURRENT_ADD` AS `MTG_CURRENT_ADD`,`mortgage_applicant`.`MTG_POSTCODE` AS `MTG_POSTCODE`,`mortgage_applicant`.`MTG_TELEPHONE` AS `MTG_TELEPHONE`,`mortgage_applicant`.`MTG_MOBLIE` AS `MTG_MOBLIE`,`mortgage_applicant`.`MTG_DATE_MOVED` AS `MTG_DATE_MOVED`,`mortgage_applicant`.`MTG_PREVIOUS_ADDRESS` AS `MTG_PREVIOUS_ADDRESS`,if((`mortgage_applicant`.`MTG_ANTICIPATED_CHANGES` = 1),'Yes','No') AS `MTG_ANTICIPATED_CHANGES`,`mortgage_applicant`.`MTG_PLS_SPECIFY` AS `MTG_PLS_SPECIFY`,`mortgage_applicant`.`IS_DELETED` AS `IS_DELETED`,`mortgage_applicant`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`mortgage_applicant`.`CREATED_BY` AS `CREATED_BY`,`mortgage_applicant`.`UPDATED_BY` AS `UPDATED_BY`,`mortgage_applicant`.`CREATED_ON` AS `CREATED_ON`,`mortgage_applicant`.`UPDATED_ON` AS `UPDATED_ON`,`mortgage_applicant`.`OA_ID` AS `OA_ID`,`mortgage_applicant`.`USER_ID` AS `USER_ID` from `mortgage_applicant` */;

--
-- Final view structure for view `mortgage_buy_required_vw`
--

/*!50001 DROP VIEW IF EXISTS `mortgage_buy_required_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `mortgage_buy_required_vw` AS select `mortgage_buy_required`.`BUY_REQUIRED_ID` AS `BUY_REQUIRED_ID`,`mortgage_buy_required`.`MORTGAGE_ID` AS `MORTGAGE_ID`,concat(`mortgage_applicant`.`MTG_FIRSTNAME`,' ',`mortgage_applicant`.`MTG_SURNAME`) AS `FULL_NAME`,`mortgage_buy_required`.`PURCHASE_PRICE` AS `PURCHASE_PRICE`,`mortgage_buy_required`.`ADVISED_VALUE` AS `ADVISED_VALUE`,`mortgage_buy_required`.`LOAN_RQUIRED` AS `LOAN_RQUIRED`,`mortgage_buy_required`.`ADDRESS` AS `ADDRESS`,`mortgage_buy_required`.`POSTCODE` AS `POSTCODE`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`mortgage_buy_required`.`PROPERTY_TYPE` = `independent_mst`.`MSTR_ID`)) AS `PROPERTY_TYPE`,`mortgage_buy_required`.`CONSTRUCTION_TYPE` AS `CONSTRUCTION_TYPE`,`mortgage_buy_required`.`AGE` AS `AGE`,`mortgage_buy_required`.`DATE_SIGNED_OFF` AS `DATE_SIGNED_OFF`,`mortgage_buy_required`.`DATE_REGISTERED` AS `DATE_REGISTERED`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`mortgage_buy_required`.`TENURE` = `independent_mst`.`MSTR_ID`)) AS `TENURE`,`mortgage_buy_required`.`REMAINING_LEASE` AS `REMAINING_LEASE`,if((`mortgage_buy_required`.`PROPERTY_LETTABLE` = 1),'Yes','No') AS `PROPERTY_LETTABLE`,`mortgage_buy_required`.`COMPLETION_DATE` AS `COMPLETION_DATE`,`mortgage_buy_required`.`BALANCE_FUNDS` AS `BALANCE_FUNDS`,if((`mortgage_buy_required`.`BUILDER_DISCOUNT` = 1),'Yes','No') AS `BUILDER_DISCOUNT`,if((`mortgage_buy_required`.`PROPERTY_TENANTED` = 1),'Yes','No') AS `PROPERTY_TENANTED`,`mortgage_buy_required`.`ADVISED_RENTAL` AS `ADVISED_RENTAL`,`mortgage_buy_required`.`IS_DELETED` AS `IS_DELETED`,`mortgage_buy_required`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`mortgage_buy_required`.`CREATED_BY` AS `CREATED_BY`,`mortgage_buy_required`.`UPDATED_BY` AS `UPDATED_BY`,`mortgage_buy_required`.`CREATED_ON` AS `CREATED_ON`,`mortgage_buy_required`.`UPDATED_ON` AS `UPDATED_ON`,`mortgage_buy_required`.`OA_ID` AS `OA_ID`,`mortgage_buy_required`.`USER_ID` AS `USER_ID` from (`mortgage_buy_required` join `mortgage_applicant` on((`mortgage_buy_required`.`MORTGAGE_ID` = `mortgage_applicant`.`MORTGAGE_ID`))) */;

--
-- Final view structure for view `mortgage_current_mortagage_vw`
--

/*!50001 DROP VIEW IF EXISTS `mortgage_current_mortagage_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `mortgage_current_mortagage_vw` AS select `mortgage_current_mortagage`.`CUURENT_ID` AS `CUURENT_ID`,`mortgage_current_mortagage`.`MORTGAGE_ID` AS `MORTGAGE_ID`,concat(`mortgage_applicant`.`MTG_FIRSTNAME`,' ',`mortgage_applicant`.`MTG_SURNAME`) AS `FULL_NAME`,`mortgage_current_mortagage`.`PROPERTY_VALUE` AS `PROPERTY_VALUE`,`mortgage_current_mortagage`.`CURRENT_LENDER` AS `CURRENT_LENDER`,`mortgage_current_mortagage`.`MORTAGAGE_OUTSTANDING` AS `MORTAGAGE_OUTSTANDING`,`mortgage_current_mortagage`.`TERM_REMAINING_YEARS` AS `TERM_REMAINING_YEARS`,`mortgage_current_mortagage`.`MONTHLY_PAYMENT` AS `MONTHLY_PAYMENT`,`mortgage_current_mortagage`.`CAPTIAL_OUTSTANDING` AS `CAPTIAL_OUTSTANDING`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`mortgage_current_mortagage`.`REPAYMENT_METHOD` = `independent_mst`.`MSTR_ID`)) AS `REPAYMENT_METHOD`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`mortgage_current_mortagage`.`INTEREST_TYPE` = `independent_mst`.`MSTR_ID`)) AS `INTEREST_TYPE`,`mortgage_current_mortagage`.`IS_DELETED` AS `IS_DELETED`,`mortgage_current_mortagage`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`mortgage_current_mortagage`.`CREATED_BY` AS `CREATED_BY`,`mortgage_current_mortagage`.`UPDATED_BY` AS `UPDATED_BY`,`mortgage_current_mortagage`.`CREATED_ON` AS `CREATED_ON`,`mortgage_current_mortagage`.`UPDATED_ON` AS `UPDATED_ON`,`mortgage_current_mortagage`.`OA_ID` AS `OA_ID`,`mortgage_current_mortagage`.`USER_ID` AS `USER_ID` from (`mortgage_current_mortagage` join `mortgage_applicant` on((`mortgage_current_mortagage`.`MORTGAGE_ID` = `mortgage_applicant`.`MORTGAGE_ID`))) */;

--
-- Final view structure for view `mortgage_existing_financial_vw`
--

/*!50001 DROP VIEW IF EXISTS `mortgage_existing_financial_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `mortgage_existing_financial_vw` AS select `mortgage_existing_financial`.`MTG_FINANCIAL_ID` AS `MTG_FINANCIAL_ID`,`mortgage_existing_financial`.`MORTGAGE_ID` AS `MORTGAGE_ID`,concat(`mortgage_applicant`.`MTG_FIRSTNAME`,' ',`mortgage_applicant`.`MTG_SURNAME`) AS `FULL_NAME`,`mortgage_existing_financial`.`EF_PURPOSE` AS `EF_PURPOSE`,`mortgage_existing_financial`.`EF_MONTHLY` AS `EF_MONTHLY`,`mortgage_existing_financial`.`EF_CURRENT_BALANCE` AS `EF_CURRENT_BALANCE`,if((`mortgage_existing_financial`.`EF_ANY_LOAN` = 1),'Yes','No') AS `EF_ANY_LOAN`,`mortgage_existing_financial`.`EF_LOAN_AMOUNT` AS `EF_LOAN_AMOUNT`,if((`mortgage_existing_financial`.`EF_DEFAULT_LOAN` = 1),'Yes','No') AS `EF_DEFAULT_LOAN`,`mortgage_existing_financial`.`EF_PLEASE_DETAILS` AS `EF_PLEASE_DETAILS`,if((`mortgage_existing_financial`.`EF_APP_REFUSED` = 1),'Yes','No') AS `EF_APP_REFUSED`,if((`mortgage_existing_financial`.`EF_REG_AGAINST` = 1),'Yes','No') AS `EF_REG_AGAINST`,if((`mortgage_existing_financial`.`EF_BANKRUPT` = 1),'Yes','No') AS `EF_BANKRUPT`,if((`mortgage_existing_financial`.`EF_PROPERTY_REPOSSESSED` = 1),'Yes','No') AS `EF_PROPERTY_REPOSSESSED`,`mortgage_existing_financial`.`IS_DELETED` AS `IS_DELETED`,`mortgage_existing_financial`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`mortgage_existing_financial`.`CREATED_BY` AS `CREATED_BY`,`mortgage_existing_financial`.`UPDATED_BY` AS `UPDATED_BY`,`mortgage_existing_financial`.`CREATED_ON` AS `CREATED_ON`,`mortgage_existing_financial`.`UPDATED_ON` AS `UPDATED_ON`,`mortgage_existing_financial`.`OA_ID` AS `OA_ID`,`mortgage_existing_financial`.`USER_ID` AS `USER_ID` from (`mortgage_existing_financial` join `mortgage_applicant` on((`mortgage_existing_financial`.`MORTGAGE_ID` = `mortgage_applicant`.`MORTGAGE_ID`))) */;

--
-- Final view structure for view `mortgage_existing_property_vw`
--

/*!50001 DROP VIEW IF EXISTS `mortgage_existing_property_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `mortgage_existing_property_vw` AS select `mortgage_existing_property`.`EXISTING_ID` AS `EXISTING_ID`,`mortgage_existing_property`.`MORTGAGE_ID` AS `MORTGAGE_ID`,concat(`mortgage_applicant`.`MTG_FIRSTNAME`,' ',`mortgage_applicant`.`MTG_SURNAME`) AS `FULL_NAME`,`mortgage_existing_property`.`LOAN_RERQUIRED` AS `LOAN_RERQUIRED`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`mortgage_existing_property`.`REPAYMENT_METHOD` = `independent_mst`.`MSTR_ID`)) AS `REPAYMENT_METHOD`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`mortgage_existing_property`.`INTEREST_TYPE` = `independent_mst`.`MSTR_ID`)) AS `INTEREST_TYPE`,`mortgage_existing_property`.`REFINANCE_MONIES` AS `REFINANCE_MONIES`,`mortgage_existing_property`.`IS_DELETED` AS `IS_DELETED`,`mortgage_existing_property`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`mortgage_existing_property`.`CREATED_BY` AS `CREATED_BY`,`mortgage_existing_property`.`UPDATED_BY` AS `UPDATED_BY`,`mortgage_existing_property`.`CREATED_ON` AS `CREATED_ON`,`mortgage_existing_property`.`UPDATED_ON` AS `UPDATED_ON`,`mortgage_existing_property`.`OA_ID` AS `OA_ID`,`mortgage_existing_property`.`USER_ID` AS `USER_ID` from (`mortgage_existing_property` join `mortgage_applicant` on((`mortgage_existing_property`.`MORTGAGE_ID` = `mortgage_applicant`.`MORTGAGE_ID`))) */;

--
-- Final view structure for view `mortgage_form_vw`
--

/*!50001 DROP VIEW IF EXISTS `mortgage_form_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `mortgage_form_vw` AS select `mortgage_form`.`MORTGAGE_ID` AS `MORTGAGE_ID`,`mortgage_form`.`REF_MORTGAGE_ID` AS `REF_MORTGAGE_ID`,concat(`mortgage_applicant`.`MTG_FIRSTNAME`,' ',`mortgage_applicant`.`MTG_SURNAME`) AS `FULL_NAME`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`mortgage_form`.`MTG_SOUGHT` = `independent_mst`.`MSTR_ID`)) AS `MTG_SOUGHT`,if((`mortgage_form`.`MTG_PURCHASE` = 1),'Yes','No') AS `MTG_PURCHASE`,if((`mortgage_form`.`MTG_REFINANCE` = 1),'Yes','No') AS `MTG_REFINANCE`,`mortgage_form`.`IS_DELETED` AS `IS_DELETED`,`mortgage_form`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`mortgage_form`.`CREATED_BY` AS `CREATED_BY`,`mortgage_form`.`UPDATED_BY` AS `UPDATED_BY`,`mortgage_form`.`CREATED_ON` AS `CREATED_ON`,`mortgage_form`.`UPDATED_ON` AS `UPDATED_ON`,`mortgage_form`.`OA_ID` AS `OA_ID`,`mortgage_form`.`USER_ID` AS `USER_ID` from (`mortgage_form` left join `mortgage_applicant` on((`mortgage_form`.`MORTGAGE_ID` = `mortgage_applicant`.`MORTGAGE_ID`))) */;

--
-- Final view structure for view `mortgage_income_details_vw`
--

/*!50001 DROP VIEW IF EXISTS `mortgage_income_details_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `mortgage_income_details_vw` AS select `mortgage_income_details`.`MTG_INCOME_ID` AS `MTG_INCOME_ID`,`mortgage_income_details`.`MORTGAGE_ID` AS `MORTGAGE_ID`,concat(`mortgage_applicant`.`MTG_FIRSTNAME`,' ',`mortgage_applicant`.`MTG_SURNAME`) AS `FULL_NAME`,`mortgage_income_details`.`INC_OCCUPATION` AS `INC_OCCUPATION`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`mortgage_income_details`.`INC_EMP_STATUS` = `independent_mst`.`MSTR_ID`)) AS `INC_EMP_STATUS`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`mortgage_income_details`.`INC_JOB` = `independent_mst`.`MSTR_ID`)) AS `INC_JOB`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`mortgage_income_details`.`INC_EMP_CONTRACT` = `independent_mst`.`MSTR_ID`)) AS `INC_EMP_CONTRACT`,`mortgage_income_details`.`INC_EMP_TIME` AS `INC_EMP_TIME`,`mortgage_income_details`.`INC_EMP_BASIC` AS `INC_EMP_BASIC`,`mortgage_income_details`.`INC_GUARANTEE_BONUS` AS `INC_GUARANTEE_BONUS`,`mortgage_income_details`.`INC_REGULAR_BONUS` AS `INC_REGULAR_BONUS`,`mortgage_income_details`.`INC_OTHER_INCOME` AS `INC_OTHER_INCOME`,`mortgage_income_details`.`INC_EMPLOYER_ADD` AS `INC_EMPLOYER_ADD`,`mortgage_income_details`.`INC_RETIREMENT_AGE` AS `INC_RETIREMENT_AGE`,if((`mortgage_income_details`.`INC_ACCOUNT_AVAILABLE` = 1),'Yes','No') AS `INC_ACCOUNT_AVAILABLE`,`mortgage_income_details`.`INC_MANY_YEARS` AS `INC_MANY_YEARS`,`mortgage_income_details`.`INC_PROFIT_LAST_YEAR` AS `INC_PROFIT_LAST_YEAR`,`mortgage_income_details`.`INC_PREVIOUS_YEAR` AS `INC_PREVIOUS_YEAR`,`mortgage_income_details`.`INC_YEAR_BEFORE` AS `INC_YEAR_BEFORE`,`mortgage_income_details`.`INC_OTHER_AMOUNT` AS `INC_OTHER_AMOUNT`,`mortgage_income_details`.`IS_DELETED` AS `IS_DELETED`,`mortgage_income_details`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`mortgage_income_details`.`CREATED_BY` AS `CREATED_BY`,`mortgage_income_details`.`UPDATED_BY` AS `UPDATED_BY`,`mortgage_income_details`.`CREATED_ON` AS `CREATED_ON`,`mortgage_income_details`.`UPDATED_ON` AS `UPDATED_ON`,`mortgage_income_details`.`OA_ID` AS `OA_ID`,`mortgage_income_details`.`USER_ID` AS `USER_ID` from (`mortgage_income_details` join `mortgage_applicant` on((`mortgage_income_details`.`MORTGAGE_ID` = `mortgage_applicant`.`MORTGAGE_ID`))) */;

--
-- Final view structure for view `mortgage_purchase_property_vw`
--

/*!50001 DROP VIEW IF EXISTS `mortgage_purchase_property_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `mortgage_purchase_property_vw` AS select `mortgage_purchase_property`.`PURCHASE_ID` AS `PURCHASE_ID`,`mortgage_purchase_property`.`MORTGAGE_ID` AS `MORTGAGE_ID`,concat(`mortgage_applicant`.`MTG_FIRSTNAME`,' ',`mortgage_applicant`.`MTG_SURNAME`) AS `FULL_NAME`,`mortgage_purchase_property`.`PURCHASE_PRICE` AS `PURCHASE_PRICE`,`mortgage_purchase_property`.`LOAN_RERQUIRED` AS `LOAN_RERQUIRED`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`mortgage_purchase_property`.`REPAYMENT_METHOD` = `independent_mst`.`MSTR_ID`)) AS `REPAYMENT_METHOD`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`mortgage_purchase_property`.`INTEREST_TYPE` = `independent_mst`.`MSTR_ID`)) AS `INTEREST_TYPE`,`mortgage_purchase_property`.`ADDRESS` AS `ADDRESS`,`mortgage_purchase_property`.`POSTCODE` AS `POSTCODE`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`mortgage_purchase_property`.`PROPERTY_TYPE` = `independent_mst`.`MSTR_ID`)) AS `PROPERTY_TYPE`,`mortgage_purchase_property`.`CONSTRUCTION_TYPE` AS `CONSTRUCTION_TYPE`,`mortgage_purchase_property`.`AGE` AS `AGE`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`mortgage_purchase_property`.`TENURE` = `independent_mst`.`MSTR_ID`)) AS `TENURE`,`mortgage_purchase_property`.`REMAINING_LEASE` AS `REMAINING_LEASE`,`mortgage_purchase_property`.`COMPLETION_DATE` AS `COMPLETION_DATE`,`mortgage_purchase_property`.`BALANCE_FUNDS` AS `BALANCE_FUNDS`,if((`mortgage_purchase_property`.`BUILDER_DISCOUNT` = 1),'Yes','No') AS `BUILDER_DISCOUNT`,`mortgage_purchase_property`.`IS_DELETED` AS `IS_DELETED`,`mortgage_purchase_property`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`mortgage_purchase_property`.`CREATED_BY` AS `CREATED_BY`,`mortgage_purchase_property`.`UPDATED_BY` AS `UPDATED_BY`,`mortgage_purchase_property`.`CREATED_ON` AS `CREATED_ON`,`mortgage_purchase_property`.`UPDATED_ON` AS `UPDATED_ON`,`mortgage_purchase_property`.`OA_ID` AS `OA_ID`,`mortgage_purchase_property`.`USER_ID` AS `USER_ID` from (`mortgage_purchase_property` join `mortgage_applicant` on((`mortgage_purchase_property`.`MORTGAGE_ID` = `mortgage_applicant`.`MORTGAGE_ID`))) */;

--
-- Final view structure for view `mortgage_self_build_vw`
--

/*!50001 DROP VIEW IF EXISTS `mortgage_self_build_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `mortgage_self_build_vw` AS select `mortgage_self_build`.`SELF_BUILD_ID` AS `SELF_BUILD_ID`,`mortgage_self_build`.`MORTGAGE_ID` AS `MORTGAGE_ID`,concat(`mortgage_applicant`.`MTG_FIRSTNAME`,' ',`mortgage_applicant`.`MTG_SURNAME`) AS `FULL_NAME`,`mortgage_self_build`.`DESCRIPTION_SITE` AS `DESCRIPTION_SITE`,`mortgage_self_build`.`CLIENT_DISTRIBUTION` AS `CLIENT_DISTRIBUTION`,`mortgage_self_build`.`ADVISED_VALUE` AS `ADVISED_VALUE`,`mortgage_self_build`.`PURCHASE_PRICE` AS `PURCHASE_PRICE`,`mortgage_self_build`.`BUILD_COST` AS `BUILD_COST`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`mortgage_self_build`.`PROPERTY_TYPE` = `independent_mst`.`MSTR_ID`)) AS `PROPERTY_TYPE`,`mortgage_self_build`.`LAND_ADVISED_VALUE` AS `LAND_ADVISED_VALUE`,`mortgage_self_build`.`LOAN_REQUIRED` AS `LOAN_REQUIRED`,`mortgage_self_build`.`ADDRESS` AS `ADDRESS`,`mortgage_self_build`.`POSTCODE` AS `POSTCODE`,`mortgage_self_build`.`TITLE_NUMBER` AS `TITLE_NUMBER`,if((`mortgage_self_build`.`CURRENT_RESIDENCE` = 1),'Yes','No') AS `CURRENT_RESIDENCE`,if((`mortgage_self_build`.`BUILDER_IDENTIFIED` = 1),'Yes','No') AS `BUILDER_IDENTIFIED`,if((`mortgage_self_build`.`FIXED_PRICE` = 1),'Yes','no') AS `FIXED_PRICE`,`mortgage_self_build`.`IS_DELETED` AS `IS_DELETED`,`mortgage_self_build`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`mortgage_self_build`.`CREATED_BY` AS `CREATED_BY`,`mortgage_self_build`.`UPDATED_BY` AS `UPDATED_BY`,`mortgage_self_build`.`CREATED_ON` AS `CREATED_ON`,`mortgage_self_build`.`UPDATED_ON` AS `UPDATED_ON`,`mortgage_self_build`.`OA_ID` AS `OA_ID`,`mortgage_self_build`.`USER_ID` AS `USER_ID` from (`mortgage_self_build` join `mortgage_applicant` on((`mortgage_self_build`.`MORTGAGE_ID` = `mortgage_applicant`.`MORTGAGE_ID`))) */;

--
-- Final view structure for view `mydocument_vw`
--

/*!50001 DROP VIEW IF EXISTS `mydocument_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `mydocument_vw` AS select `mydocument`.`DOCUMENT_ID` AS `DOCUMENT_ID`,`mydocument`.`FILE_NAME` AS `FILE_NAME`,`mydocument`.`PARENT_FOLDER` AS `PARENT_FOLDER`,`mydocument`.`ASSIGN_TO_OWNER` AS `ASSIGN_TO_OWNER`,`mydocument`.`ASSIGN_TO_DEPARTMENT` AS `ASSIGN_TO_DEPARTMENT`,`mydocument`.`CATEGORY` AS `CATEGORY`,`mydocument`.`HOW_TO_GUIDE` AS `HOW_TO_GUIDE`,`mydocument`.`PROJECT` AS `PROJECT`,`mydocument`.`DOCUMENT_TYPE` AS `DOCUMENT_TYPE`,`mydocument`.`DESCRIPTION` AS `DESCRIPTION`,`mydocument`.`COMMENT` AS `COMMENT`,`mydocument`.`IS_DELETED` AS `IS_DELETED`,`mydocument`.`OA_ID` AS `OA_ID`,`mydocument`.`USER_ID` AS `USER_ID`,`mydocument`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`mydocument`.`CREATED_BY` AS `CREATED_BY`,`mydocument`.`UPDATED_BY` AS `UPDATED_BY`,`mydocument`.`CREATEDON` AS `CREATEDON`,`mydocument`.`UPDATEDON` AS `UPDATEDON` from `mydocument` */;

--
-- Final view structure for view `myproject_vw`
--

/*!50001 DROP VIEW IF EXISTS `myproject_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `myproject_vw` AS select `myproject`.`PROJECT_ID` AS `PROJECT_ID`,`myproject`.`PROJECT_NAME` AS `PROJECT_NAME`,`myproject`.`DESC` AS `DESC`,`myproject`.`START` AS `START`,`myproject`.`END` AS `END`,`myproject`.`STATUS` AS `STATUS`,`myproject`.`BUDGET` AS `BUDGET`,`myproject`.`OA_ID` AS `OA_ID`,`myproject`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`myproject`.`USER_ID` AS `USER_ID`,`myproject`.`IS_DELETED` AS `IS_DELETED`,`myproject`.`CREATED_BY` AS `CREATED_BY`,`myproject`.`CREATED_ON` AS `CREATED_ON`,`myproject`.`UPDATED_BY` AS `UPDATED_BY`,`myproject`.`UPDATED_ON` AS `UPDATED_ON` from `myproject` */;

--
-- Final view structure for view `myteam_records_vw`
--

/*!50001 DROP VIEW IF EXISTS `myteam_records_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `myteam_records_vw` AS select `emp_mst`.`EMP_ID` AS `EMP_ID`,`emp_mst`.`REF_EMP_ID` AS `REF_EMP_ID`,`emp_mst`.`MANAGER_ID` AS `MANAGER_ID`,(select `emp_mst`.`MANAGER_ID` from `emp_mst` where (`emp_mst`.`REF_EMP_ID` = `emp_mst`.`USER_ID`)) AS `MANAGERID` from `emp_mst` */;

--
-- Final view structure for view `narration_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `narration_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `narration_type_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`MSTR_DESC` AS `MSTR_DESC`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`PARENT_MSTR_CD` AS `PARENT_MSTR_CD`,`independent_mst`.`PARENT_MSTR_NM` AS `PARENT_MSTR_NM`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IM_GROUP_CTR` AS `IM_GROUP_CTR`,`independent_mst`.`SEQUENCE` AS `SEQUENCE`,`independent_mst`.`FOR_MODULE` AS `FOR_MODULE`,`independent_mst`.`FOR_SYSTEM` AS `FOR_SYSTEM`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 486) */;

--
-- Final view structure for view `nationality_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `nationality_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `nationality_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 139) */;

--
-- Final view structure for view `new_party_master_test_vw`
--

/*!50001 DROP VIEW IF EXISTS `new_party_master_test_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `new_party_master_test_vw` AS select `new_party_master_test`.`PERTY_ID` AS `PERTY_ID`,`new_party_master_test`.`PARTY_CODE` AS `PARTY_CODE`,`new_party_master_test`.`PARTY_NAME` AS `PARTY_NAME`,`new_party_master_test`.`CONTACT_PERSON` AS `CONTACT_PERSON`,`new_party_master_test`.`PARTY_PREFIX` AS `PARTY_PREFIX`,`new_party_master_test`.`EMAIL` AS `EMAIL`,`new_party_master_test`.`SECONDARY_EMAIL` AS `SECONDARY_EMAIL`,`new_party_master_test`.`PARTY_DEPARTMENT` AS `PARTY_DEPARTMENT`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`new_party_master_test`.`PARTY_DEPARTMENT` = `independent_mst`.`MSTR_ID`)) AS `DEPARTMENT`,`new_party_master_test`.`ADDRESS_1` AS `ADDRESS_1`,`new_party_master_test`.`ADDRESS_2` AS `ADDRESS_2`,`new_party_master_test`.`POSTCODE` AS `POSTCODE`,`new_party_master_test`.`CITY` AS `CITY`,`new_party_master_test`.`COUNTRY` AS `COUNTRY`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`new_party_master_test`.`COUNTRY` = `independent_mst`.`MSTR_ID`)) AS `COUNTRY_NM`,`new_party_master_test`.`TELEPHONE` AS `TELEPHONE`,`new_party_master_test`.`PARTY_TYPE` AS `PARTY_TYPE`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`new_party_master_test`.`PARTY_TYPE` = `independent_mst`.`MSTR_ID`)) AS `PARTY_TYPE_NM`,`new_party_master_test`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`new_party_master_test`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`new_party_master_test`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`new_party_master_test`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`new_party_master_test`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`new_party_master_test`.`CREATED_ON` AS `CREATED_ON`,`new_party_master_test`.`UPDATED_ON` AS `UPDATED_ON`,`new_party_master_test`.`IS_DELETED` AS `IS_DELETED` from `new_party_master_test` */;

--
-- Final view structure for view `non_personal_contact_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `non_personal_contact_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `non_personal_contact_type_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 138) */;

--
-- Final view structure for view `non_vat_admin_expenses_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `non_vat_admin_expenses_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `non_vat_admin_expenses_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 151) */;

--
-- Final view structure for view `notifications_vw`
--

/*!50001 DROP VIEW IF EXISTS `notifications_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `notifications_vw` AS select `notifications`.`ID` AS `ID`,`notifications`.`TITLE` AS `TITLE`,`notifications`.`MESSAGE` AS `MESSAGE`,`notifications`.`OA_ID` AS `OA_ID`,`notifications`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`notifications`.`USER_ID` AS `USER_ID`,`notifications`.`IS_DELETED` AS `IS_DELETED`,`notifications`.`CREATED_BY` AS `CREATED_BY`,`notifications`.`CREATED_ON` AS `CREATED_ON`,`notifications`.`UPDATED_BY` AS `UPDATED_BY`,`notifications`.`UPDATED_ON` AS `UPDATED_ON` from `notifications` */;

--
-- Final view structure for view `oa_brand_setting_attribute_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `oa_brand_setting_attribute_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `oa_brand_setting_attribute_mst_vw` AS select `oa_brand_setting_attribute_mst`.`OA_BRAND_SETTING_ATTRIBUTE_ID` AS `OA_BRAND_SETTING_ATTRIBUTE_ID`,`oa_brand_setting_attribute_mst`.`SETTING_GROUP_ID` AS `SETTING_GROUP_ID`,(select `setting_group_mst`.`SETTING_GROUP_NAME` from `setting_group_mst` where (`setting_group_mst`.`SETTING_GROUP_ID` = `oa_brand_setting_attribute_mst`.`SETTING_GROUP_ID`)) AS `SETTING_GROUP`,(select `setting_group_mst`.`SETTING_GROUP_NAME_ID` from `setting_group_mst` where (`setting_group_mst`.`SETTING_GROUP_ID` = `oa_brand_setting_attribute_mst`.`SETTING_GROUP_ID`)) AS `SETTING_GROUP_NAME_ID`,(select `independent_mst`.`MSTR_CD` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `SETTING_GROUP_NAME_ID`)) AS `SETTING_GROUP_CD`,`oa_brand_setting_attribute_mst`.`SETTING_ATTRIBUTE_ID` AS `SETTING_ATTRIBUTE_ID`,(select `setting_group_attribute_mst`.`SYSTEM_SETTING_ATTRIBUTE_ID` from `setting_group_attribute_mst` where (`setting_group_attribute_mst`.`SETTING_ATTRIBUTE_ID` = `oa_brand_setting_attribute_mst`.`SETTING_ATTRIBUTE_ID`)) AS `SYSTEM_SETTING_ATTRIBUTE_ID`,(select `independent_mst`.`MSTR_CD` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `SYSTEM_SETTING_ATTRIBUTE_ID`)) AS `SYSTEM_SETTING_ATTRIBUTE_CD`,(select `setting_group_attribute_mst`.`SETTING_ATTRIBUTE_DESC` from `setting_group_attribute_mst` where (`setting_group_attribute_mst`.`SETTING_ATTRIBUTE_ID` = `oa_brand_setting_attribute_mst`.`SETTING_ATTRIBUTE_ID`)) AS `SYSTEM_SETTING_ATTRIBUTE`,`oa_brand_setting_attribute_mst`.`ANSWER_GROUP_ID` AS `ANSWER_GROUP_ID`,`oa_brand_setting_attribute_mst`.`SETTING_ATTRIBUTE_OPTIONS_ID` AS `SETTING_ATTRIBUTE_OPTIONS_ID`,(select `setting_group_attribute_Value_mst`.`INPUT_OPTION_DESC` from `setting_group_attribute_Value_mst` where (`setting_group_attribute_Value_mst`.`SETTING_ATTRIBUTE_OPTIONS_ID` = `oa_brand_setting_attribute_mst`.`SETTING_ATTRIBUTE_OPTIONS_ID`)) AS `SETTING_ATTRIBUTE_OPTIONS`,`oa_brand_setting_attribute_mst`.`COMMENT` AS `COMMENT`,`oa_brand_setting_attribute_mst`.`IS_DELETED` AS `IS_DELETED`,`oa_brand_setting_attribute_mst`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `oa_brand_setting_attribute_mst`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `oa_brand_setting_attribute_mst`.`OA_ID`)) AS `OA_NM`,`oa_brand_setting_attribute_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `oa_brand_setting_attribute_mst`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `oa_brand_setting_attribute_mst`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`oa_brand_setting_attribute_mst`.`CREATED_BY` AS `CREATED_BY`,`oa_brand_setting_attribute_mst`.`CREATED_ON` AS `CREATED_ON`,`oa_brand_setting_attribute_mst`.`UPDATED_BY` AS `UPDATED_BY`,`oa_brand_setting_attribute_mst`.`UPDATED_ON` AS `UPDATED_ON` from `oa_brand_setting_attribute_mst` */;

--
-- Final view structure for view `oa_brand_settings_vw`
--

/*!50001 DROP VIEW IF EXISTS `oa_brand_settings_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `oa_brand_settings_vw` AS select `oa_brand_settings`.`OAB_SETTING_ID` AS `OAB_SETTING_ID`,`oa_brand_settings`.`OABS_ATTRBUTE_ID` AS `OABS_ATTRBUTE_ID`,`oa_brand_settings`.`COMPANY_ATTRIBUTE` AS `COMPANY_ATTRIBUTE`,(select `independent_mst`.`MSTR_CD` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `oa_brand_settings`.`OABS_ATTRBUTE_ID`)) AS `OABS_ATTRBUTE_CD`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `oa_brand_settings`.`OABS_ATTRBUTE_ID`)) AS `OABS_ATTRBUTE_NM`,`oa_brand_settings`.`REF_ID` AS `OABS_SETTING_VALUE_ID`,`oa_brand_settings`.`REF_ID` AS `REF_ID`,(select `independent_mst`.`MSTR_CD` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `OABS_SETTING_VALUE_ID`)) AS `OABS_SETTING_VALUE_CD`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `OABS_SETTING_VALUE_ID`)) AS `OABS_SETTING_VALUE_NM`,`oa_brand_settings`.`OABS_SETTING_VALUE` AS `OABS_SETTING_VALUE`,(select `oa_settings_value_mst`.`SEETTING_VALUE_NM` from `oa_settings_value_mst` where (`oa_settings_value_mst`.`SETTING_VALUE_ID` = `oa_brand_settings`.`OABS_SETTING_VALUE`)) AS `OABS_SETTING_VALUE_NAME`,`oa_brand_settings`.`OA_BRAND_ID` AS `BRAND_ID`,`oa_brand_settings`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_NM`,`oa_brand_settings`.`DESCRIPTION` AS `DESCRIPTION`,`oa_brand_settings`.`VALIDATION` AS `VALIDATION`,if((`oa_brand_settings`.`IS_ACTIVE` = 1),'Yes','No') AS `IS_ACTIVE`,`oa_brand_settings`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`oa_brand_settings`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`oa_brand_settings`.`CREATED_ON` AS `CREATED_ON`,`oa_brand_settings`.`UPDATED_ON` AS `UPDATED_ON`,`oa_brand_settings`.`IS_DELETED` AS `IS_DELETED` from `oa_brand_settings` */;

--
-- Final view structure for view `oa_brands_vw`
--

/*!50001 DROP VIEW IF EXISTS `oa_brands_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `oa_brands_vw` AS select `oa_brands`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`oa_brands`.`OA_BRAND_CD` AS `OA_BRAND_CD`,`oa_brands`.`OA_BRAND_NM` AS `OA_BRAND_NM`,`oa_brands`.`OA_ID` AS `OA_ID`,`oa_brands`.`OA_ID` AS `ORG_ACC_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_NM`,`oa_brands`.`REF_ID` AS `REF_ID`,`oa_brands`.`TELEPHONE` AS `TELEPHONE`,`oa_brands`.`EMAIL` AS `EMAIL`,`oa_brands`.`CONTACT` AS `CONTACT_NAME`,`oa_brands`.`ADDRESS` AS `ADDRESS`,`oa_brands`.`START_DATE` AS `START_DATE`,`oa_brands`.`CESSATION_DATE` AS `CESSATION_DATE`,`oa_brands`.`PAYE_DISTRICT` AS `PAYE_DISTRICT`,`oa_brands`.`TAX_OFFICE_TELEPHONE` AS `TAX_OFFICE_TELEPHONE`,`oa_brands`.`PAYE_OFFICE_NO` AS `PAYE_OFFICE_NO`,`oa_brands`.`PAYE_REFRENCE` AS `PAYE_REFRENCE`,`oa_brands`.`AFFILIATED_BY` AS `AFFILIATED_BY`,`oa_brands`.`AFFILIATION_NO` AS `AFFILIATION_NO`,`oa_brands`.`BOARD` AS `BOARD`,`oa_brands`.`ACCOUNTS_OFFICE_REFERENCE` AS `ACCOUNTS_OFFICE_REFERENCE`,`oa_brands`.`UNIQUE_TAX_REFERENCE` AS `UNIQUE_TAX_REFERENCE`,`oa_brands`.`CORPORATION_TAX_REFERENCE` AS `CORPORATION_TAX_REFERENCE`,`oa_brands`.`PAYROLL_GIVING_REFERENCE` AS `PAYROLL_GIVING_REFERENCE`,`oa_brands`.`TAX_OFFICE_ADDRESS` AS `TAX_OFFICE_ADDRESS`,if((`oa_brands`.`SER_QUALIFIED` = 1),'Yes','No') AS `SER_QUALIFIED`,`oa_brands`.`TAX_PAYMENT_METHOD` AS `TAX_PAYMENT_METHOD_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `TAX_PAYMENT_METHOD_ID`)) AS `TAX_PAYMENT_METHOD`,`oa_brands`.`BANK_NAME` AS `BANK_NAME`,`oa_brands`.`BRANCH_NAME` AS `BRANCH_NAME`,`oa_brands`.`SORT_CODE` AS `SORT_CODE`,`oa_brands`.`ACCOUNT_NAME` AS `ACCOUNT_NAME`,`oa_brands`.`ACCOUNT_NO` AS `ACCOUNT_NO`,`oa_brands`.`PAYMENT_REFERENCE` AS `PAYMENT_REFERENCE`,`oa_brands`.`BUILDING_SOCIETY_REFRENCE` AS `BUILDING_SOCIETY_REFRENCE`,`oa_brands`.`BANK_TELEPHONE` AS `BANK_TELEPHONE`,`oa_brands`.`BANK_ADDRESS` AS `BANK_ADDRESS`,`oa_brands`.`BANK_LEAD_TIME` AS `BANK_LEAD_TIME`,`oa_brands`.`OA_BRAND_LOGO` AS `OA_BRAND_LOGO`,`oa_brands`.`OA_BRAND_INV_TMPLT` AS `OA_BRAND_INV_TMPLT`,if((`oa_brands`.`IS_ACTIVE` = 1),'Yes','No') AS `IS_ACTIVE`,if((`oa_brands`.`IS_PRIMARY` = 1),'Yes','No') AS `IS_PRIMARY`,`oa_brands`.`country` AS `COUNTRY`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `oa_brands`.`country`)) AS `COUNTRY_NM`,`oa_brands`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`oa_brands`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`oa_brands`.`CREATED_ON` AS `CREATED_ON`,`oa_brands`.`UPDATED_ON` AS `UPDATED_ON`,`oa_brands`.`IS_DELETED` AS `IS_DELETED` from `oa_brands` */;

--
-- Final view structure for view `oa_brands_vw_130718`
--

/*!50001 DROP VIEW IF EXISTS `oa_brands_vw_130718`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `oa_brands_vw_130718` AS select `oa_brands`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`oa_brands`.`OA_BRAND_CD` AS `OA_BRAND_CD`,`oa_brands`.`OA_BRAND_NM` AS `OA_BRAND_NM`,`oa_brands`.`OA_ID` AS `OA_ID`,`oa_brands`.`OA_ID` AS `ORG_ACC_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_NM`,`oa_brands`.`REF_ID` AS `REF_ID`,`oa_brands`.`TELEPHONE` AS `TELEPHONE`,`oa_brands`.`EMAIL` AS `EMAIL`,`oa_brands`.`CONTACT` AS `CONTACT_NAME`,`oa_brands`.`ADDRESS` AS `ADDRESS`,`oa_brands`.`START_DATE` AS `START_DATE`,`oa_brands`.`CESSATION_DATE` AS `CESSATION_DATE`,`oa_brands`.`PAYE_DISTRICT` AS `PAYE_DISTRICT`,`oa_brands`.`TAX_OFFICE_TELEPHONE` AS `TAX_OFFICE_TELEPHONE`,`oa_brands`.`PAYE_OFFICE_NO` AS `PAYE_OFFICE_NO`,`oa_brands`.`PAYE_REFRENCE` AS `PAYE_REFRENCE`,`oa_brands`.`ACCOUNTS_OFFICE_REFERENCE` AS `ACCOUNTS_OFFICE_REFERENCE`,`oa_brands`.`UNIQUE_TAX_REFERENCE` AS `UNIQUE_TAX_REFERENCE`,`oa_brands`.`CORPORATION_TAX_REFERENCE` AS `CORPORATION_TAX_REFERENCE`,`oa_brands`.`DESCRIPTION` AS `DESCRIPTION`,`oa_brands`.`PAYROLL_GIVING_REFERENCE` AS `PAYROLL_GIVING_REFERENCE`,`oa_brands`.`BUSINESS_NAME` AS `BUSINESS_NAME`,`oa_brands`.`FRIENDLY_URL` AS `FRIENDLY_URL`,`oa_brands`.`META_TITLE` AS `META_TITLE`,`oa_brands`.`META_DESC` AS `META_DESC`,`oa_brands`.`META_KEY` AS `META_KEY`,`oa_brands`.`FAX` AS `FAX`,`oa_brands`.`ADDRESS_ONE` AS `ADDRESS_ONE`,`oa_brands`.`ADDRESS_TWO` AS `ADDRESS_TWO`,`oa_brands`.`CITY` AS `CITY`,`oa_brands`.`STATE` AS `STATE`,`oa_brands`.`ZIP` AS `ZIP`,`oa_brands`.`FB` AS `FB`,`oa_brands`.`TWITTER` AS `TWITTER`,`oa_brands`.`GOOGEL` AS `GOOGEL`,`oa_brands`.`LINKEDLN` AS `LINKEDLN`,`oa_brands`.`LATTITUDE` AS `LATTITUDE`,`oa_brands`.`LONGITUDE` AS `LONGITUDE`,`oa_brands`.`LINKDLN_COMPANY` AS `LINKDLN_COMPANY`,`oa_brands`.`PINTEREST` AS `PINTEREST`,`oa_brands`.`YOUTUBE` AS `YOUTUBE`,`oa_brands`.`FORSQUARE` AS `FORSQUARE`,`oa_brands`.`INSTAGRAM` AS `INSTAGRAM`,`oa_brands`.`GALLERY1` AS `GALLERY1`,`oa_brands`.`GALLERY2` AS `GALLERY2`,`oa_brands`.`GALLERY3` AS `GALLERY3`,`oa_brands`.`COMPANY_INFO` AS `COMPANY_INFO`,`oa_brands`.`TAX_OFFICE_ADDRESS` AS `TAX_OFFICE_ADDRESS`,`oa_brands`.`SER_QUALIFIED` AS `SER_QUALIFIED`,`oa_brands`.`TAX_PAYMENT_METHOD` AS `TAX_PAYMENT_METHOD`,`oa_brands`.`BANK_NAME` AS `BANK_NAME`,`oa_brands`.`BRANCH_NAME` AS `BRANCH_NAME`,`oa_brands`.`SORT_CODE` AS `SORT_CODE`,`oa_brands`.`ACCOUNT_NAME` AS `ACCOUNT_NAME`,`oa_brands`.`ACCOUNT_NO` AS `ACCOUNT_NO`,`oa_brands`.`WEBSITE` AS `WEBSITE`,`oa_brands`.`KEYWORD` AS `KEYWORD`,`oa_brands`.`PAYMENT_REFERENCE` AS `PAYMENT_REFERENCE`,`oa_brands`.`BUILDING_SOCIETY_REFRENCE` AS `BUILDING_SOCIETY_REFRENCE`,`oa_brands`.`BANK_TELEPHONE` AS `BANK_TELEPHONE`,`oa_brands`.`BANK_ADDRESS` AS `BANK_ADDRESS`,`oa_brands`.`BANK_LEAD_TIME` AS `BANK_LEAD_TIME`,`oa_brands`.`OA_BRAND_LOGO` AS `OA_BRAND_LOGO`,`oa_brands`.`OA_BRAND_INV_TMPLT` AS `OA_BRAND_INV_TMPLT`,if((`oa_brands`.`IS_ACTIVE` = 1),'Yes','No') AS `IS_ACTIVE`,if((`oa_brands`.`IS_PRIMARY` = 1),'Yes','No') AS `IS_PRIMARY`,`oa_brands`.`country` AS `COUNTRY`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `oa_brands`.`country`)) AS `COUNTRY_NM`,`oa_brands`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`oa_brands`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`oa_brands`.`CREATED_ON` AS `CREATED_ON`,`oa_brands`.`UPDATED_ON` AS `UPDATED_ON`,`oa_brands`.`IS_DELETED` AS `IS_DELETED` from `oa_brands` */;

--
-- Final view structure for view `oa_contact_add_phoneno_vw`
--

/*!50001 DROP VIEW IF EXISTS `oa_contact_add_phoneno_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `oa_contact_add_phoneno_vw` AS select `oa_contact_add_phoneno`.`OA_CNTCT_ADD_PHONENO_ID` AS `OA_CNTCT_ADD_PHONENO_ID`,`oa_contact_add_phoneno`.`CNTCT_ADD_PHONENO_ID` AS `CNTCT_ADD_PHONENO_ID`,`oa_contact_add_phoneno`.`IS_PRIMARY_TELNO` AS `IS_PRIMARY_TELNO`,`oa_contact_add_phoneno`.`OA_CNTCT_ID` AS `OA_CNTCT_ID`,(select `oa_contacts`.`CNTCT_ID` from `oa_contacts` where (`oa_contacts`.`OA_CNTCTS_ID` = `oa_contact_add_phoneno`.`OA_CNTCT_ID`)) AS `OACNTCT_ID`,(select `contact_mst`.`CNTCT_FRST_NM` from `contact_mst` where (`contact_mst`.`CNTCT_ID` = `OACNTCT_ID`)) AS `CNTCT_NM`,`oa_contact_add_phoneno`.`OA_ID` AS `ORG_ACC_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_NM`,`oa_contact_add_phoneno`.`OA_BRAND_ID` AS `BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_NM`,`oa_contact_add_phoneno`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`oa_contact_add_phoneno`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`oa_contact_add_phoneno`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`oa_contact_add_phoneno`.`CREATED_ON` AS `Created_On`,`oa_contact_add_phoneno`.`UPDATED_ON` AS `Updated_On`,`oa_contact_add_phoneno`.`IS_DELETED` AS `IS_DELETED` from `oa_contact_add_phoneno` */;

--
-- Final view structure for view `oa_contact_address_vw`
--

/*!50001 DROP VIEW IF EXISTS `oa_contact_address_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@localhost SQL SECURITY DEFINER */
/*!50001 VIEW `oa_contact_address_vw` AS select `oa_contact_address`.`OA_CNTCT_ADD_ID` AS `OA_CNTCT_ADD_ID`,`oa_contact_address`.`CNTCT_ADD_ID` AS `CNTCTADDID`,`oa_contact_address`.`CNTCT_ADD_ID` AS `CNTCT_ADD_ID`,`oa_contact_address`.`CNTCT_ADD_ID` AS `OA_CNTCT_ADD`,(select concat_ws(',',`address_mst`.`FLAT_NO`,`address_mst`.`HOUSE_NO`,`address_mst`.`HOUSE_NAME`,(select concat_ws(',',if((`street_mst`.`STREET_NAME` = ''),NULL,`street_mst`.`STREET_NAME`),if((`street_mst`.`LOCALITY` = ''),NULL,`street_mst`.`LOCALITY`),if((`street_mst`.`AREA` = ''),NULL,`street_mst`.`AREA`)) from `street_mst` where (`street_mst`.`STREET_ID` = `address_mst`.`ADDRESS_LINE_1`)),(select if((`location_mst`.`LOC_NAME` = ''),NULL,`location_mst`.`LOC_NAME`) from `location_mst` where (`location_mst`.`LOC_ID` = `address_mst`.`ADDRESS_LINE_4`))) from `address_mst` where (`address_mst`.`ADDRESS_ID` = `oa_contact_address`.`CNTCT_ADD_ID`)) AS `CNTCT_ADD`,(select `address_mst`.`ADDRESS_LINE_1` from `address_mst` where (`address_mst`.`ADDRESS_ID` = `oa_contact_address`.`CNTCT_ADD_ID`)) AS `ADDRESS_LINE_1`,(select `address_mst`.`ADDRESS_LINE_2` from `address_mst` where (`address_mst`.`ADDRESS_ID` = `oa_contact_address`.`CNTCT_ADD_ID`)) AS `ADDRESS_LINE_2`,`oa_contact_address`.`IS_PRIMARY` AS `IS_PRIMARY`,`oa_contact_address`.`OA_CNTCT_ID` AS `OA_CNTCT_ID`,(select `oa_contacts`.`CNTCT_ID` from `oa_contacts` where (`oa_contacts`.`OA_CNTCTS_ID` = `oa_contact_address`.`OA_CNTCT_ID`)) AS `OACNTCT_ID`,(select `contact_mst`.`CNTCT_FRST_NM` from `contact_mst` where (`contact_mst`.`CNTCT_ID` = `OACNTCT_ID`)) AS `CNTCT_NM`,`oa_contact_address`.`OA_ID` AS `ORG_ACC_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_NM`,`oa_contact_address`.`OA_BRAND_ID` AS `BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_NM`,`oa_contact_address`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`oa_contact_address`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`oa_contact_address`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`oa_contact_address`.`CREATED_ON` AS `Created_On`,`oa_contact_address`.`UPDATED_ON` AS `Updated_On`,`oa_contact_address`.`IS_DELETED` AS `IS_DELETED` from `oa_contact_address` */;

--
-- Final view structure for view `oa_contact_emails_vw`
--

/*!50001 DROP VIEW IF EXISTS `oa_contact_emails_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `oa_contact_emails_vw` AS select `oa_contact_emails`.`OA_CNTCT_EML_ID` AS `OA_CNTCT_EML_ID`,`oa_contact_emails`.`CNTCT_EML_ID` AS `CNTCT_EML_ID`,`oa_contact_emails`.`CNTCT_EML_ID` AS `OA_ACC_CNTCT_EML_ID`,(select `contact_emails`.`EMAIL_ADD_ID` from `contact_emails` where (`contact_emails`.`CNTCT_EML_ID` = `OA_ACC_CNTCT_EML_ID`)) AS `EMAIL_ID`,(select `email_address_mst`.`EMAIL_ADD` from `email_address_mst` where (`EMAIL_ID` = `email_address_mst`.`EMAIL_ADD_ID`)) AS `CNTCT_EMAIL`,if((`oa_contact_emails`.`IS_PRIMARY` = 1),'Yes','No') AS `Is_Primary`,`oa_contact_emails`.`OA_CNTCT_ID` AS `OA_CNTCT_ID`,(select `oa_contacts`.`CNTCT_ID` from `oa_contacts` where (`oa_contacts`.`OA_CNTCTS_ID` = `oa_contact_emails`.`OA_CNTCT_ID`)) AS `OACNTCT_ID`,(select `contact_mst`.`CNTCT_FRST_NM` from `contact_mst` where (`contact_mst`.`CNTCT_ID` = `OACNTCT_ID`)) AS `CNTCT_NM`,`oa_contact_emails`.`OA_ID` AS `ORG_ACC_ID`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_NM`,`oa_contact_emails`.`OA_BRAND_ID` AS `BRAND_ID`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_NM`,`oa_contact_emails`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`oa_contact_emails`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`oa_contact_emails`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,if((`oa_contact_emails`.`IS_EMP` = 1),'Yes','No') AS `IS_EMP`,`oa_contact_emails`.`CREATED_ON` AS `CREATED_ON`,`oa_contact_emails`.`UPDATED_ON` AS `UPDATED_ON`,`oa_contact_emails`.`IS_DELETED` AS `IS_DELETED`,`oa_contact_emails`.`EMAIL_TYPE_ID` AS `EMAIL_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `oa_contact_emails`.`EMAIL_TYPE_ID`)) AS `EMAIL_TYP_NM`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_CD` from `oa_contact_emails` where (`oa_contact_emails`.`IS_EMP` = 1) */;

--
-- Final view structure for view `oa_contact_nationality_vw`
--

/*!50001 DROP VIEW IF EXISTS `oa_contact_nationality_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `oa_contact_nationality_vw` AS select `oa_contact_nationality`.`OA_CNTCT_NATIONALITY_ID` AS `OA_CNTCT_NATIONALITY_ID`,`oa_contact_nationality`.`CNTCT_NATIONALITY_ID` AS `CONTACT_NATIONALITY_ID`,`oa_contact_nationality`.`CNTCT_NATIONALITY_ID` AS `CNTCT_NATIONALITY_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `oa_contact_nationality`.`CNTCT_NATIONALITY_ID`)) AS `CNTCT_NATIONALITY_NM`,`oa_contact_nationality`.`IS_DELETED` AS `IS_DELETED`,`oa_contact_nationality`.`OA_CNTCT_ID` AS `OA_CNTCT_ID`,(select `oa_contacts`.`CNTCT_ID` from `oa_contacts` where (`oa_contacts`.`OA_CNTCTS_ID` = `oa_contact_nationality`.`OA_CNTCT_ID`)) AS `OACNTCT_ID`,(select `contact_mst`.`CNTCT_FRST_NM` from `contact_mst` where (`contact_mst`.`CNTCT_ID` = `OACNTCT_ID`)) AS `CNTCT_NM`,`oa_contact_nationality`.`OA_ID` AS `ORG_ACC_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_NM`,`oa_contact_nationality`.`OA_BRAND_ID` AS `BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_NM`,`oa_contact_nationality`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`oa_contact_nationality`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`oa_contact_nationality`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`oa_contact_nationality`.`CREATED_ON` AS `Created_On`,`oa_contact_nationality`.`UPDATED_ON` AS `Updated_On` from `oa_contact_nationality` */;

--
-- Final view structure for view `oa_contact_phones_vw`
--

/*!50001 DROP VIEW IF EXISTS `oa_contact_phones_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `oa_contact_phones_vw` AS select `oa_contact_phones`.`OA_CNTCT_PHONE_ID` AS `OA_CNTCT_PHONE_ID`,(select `emp_mst_vw`.`EMP_FULL_NAME` from `emp_mst_vw` where (`emp_mst_vw`.`EMP_ID` = `oa_contact_phones`.`EMP_ID`)) AS `EMP_FULL_NAME`,(select `contact_phones`.`PHONE_NBR_ID` from `contact_phones` where (`contact_phones`.`CNTCT_PHONE_ID` = `oa_contact_phones`.`CNTCT_PHONE_ID`)) AS `CNTCTID`,`oa_contact_phones`.`CNTCT_PHONE_ID` AS `CNTCT_PHONE_ID`,`oa_contact_phones`.`COUNTRY_CODE` AS `COUNTRY_CODE`,(select `phone_nbr_mst`.`PHONE_NBR` from `phone_nbr_mst` where (`phone_nbr_mst`.`PHONE_NBR_ID` = `CNTCTID`)) AS `CNTCT_OFFICE_NBR`,(select concat((select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `oa_contact_phones`.`COUNTRY_CODE`)),' ',`CNTCT_OFFICE_NBR`)) AS `OA_ACCT_CNTCT_PHONE_ID`,if((`oa_contact_phones`.`IS_PRIMARY` = 1),'Yes','No') AS `Is_Primary`,`oa_contact_phones`.`EMP_ID` AS `EMP_ID`,`oa_contact_phones`.`IS_DELETED` AS `IS_DELETED`,`oa_contact_phones`.`IS_EMP` AS `IS_EMP`,`oa_contact_phones`.`OA_CNTCT_ID` AS `OA_CNTCT_ID`,(select `oa_contacts`.`CNTCT_ID` from `oa_contacts` where (`oa_contacts`.`OA_CNTCTS_ID` = `oa_contact_phones`.`OA_CNTCT_ID`)) AS `OACNTCT_ID`,(select `contact_mst`.`CNTCT_FRST_NM` from `contact_mst` where (`contact_mst`.`CNTCT_ID` = `OACNTCT_ID`)) AS `CNTCT_NM`,`oa_contact_phones`.`OA_ID` AS `ORG_ACC_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_NM`,`oa_contact_phones`.`OA_BRAND_ID` AS `BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_NM`,`oa_contact_phones`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`oa_contact_phones`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`oa_contact_phones`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`oa_contact_phones`.`CREATED_ON` AS `Created_On`,`oa_contact_phones`.`UPDATED_ON` AS `Updated_On` from `oa_contact_phones` where (`oa_contact_phones`.`IS_EMP` = 1) */;

--
-- Final view structure for view `oa_contacts_vw`
--

/*!50001 DROP VIEW IF EXISTS `oa_contacts_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `oa_contacts_vw` AS select `oa_contacts`.`OA_CNTCTS_ID` AS `OA_CNTCTS_ID`,`oa_contacts`.`OA_CNTCT_RELTYPE_ID` AS `OA_CNTCT_RELTYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `oa_contacts`.`OA_CNTCT_RELTYPE_ID`)) AS `OA_CNTCT_USER_TYP`,`oa_contacts`.`CNTCT_ID` AS `OA_CONTACTS_CNTCT_ID`,`oa_contacts`.`CNTCT_ID` AS `CNTCT_ID`,(select `contact_mst`.`CNTCT_FRST_NM` from `contact_mst` where (`contact_mst`.`CNTCT_ID` = `OA_CONTACTS_CNTCT_ID`)) AS `CNTCT_FULL_NM`,`oa_contacts`.`NON_PRSNL` AS `NON_PRSNL`,`oa_contacts`.`NON_PRSNL_CNTCT_TYP` AS `NON_PRSNL_CNTCT_TYP`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `oa_contacts`.`NON_PRSNL_CNTCT_TYP`)) AS `NON_PRSNL_CNTCT_TYP_NM`,`oa_contacts`.`IS_DELETED` AS `IS_DELETED`,if((`oa_contacts`.`IS_ACTIVE` = 1),'Yes','No') AS `IS_ACTIVE`,`oa_contacts`.`OA_ID` AS `ORG_ACC_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_NM`,`oa_contacts`.`OA_BRAND_ID` AS `BRAND_ID`,`oa_contacts`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_NM`,`oa_contacts`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`oa_contacts`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`oa_contacts`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`oa_contacts`.`CREATED_ON` AS `Created_On`,(select `emp_mst_vw`.`EMP_FULL_NAME` from `emp_mst_vw` where (`emp_mst_vw`.`REF_EMP_ID` = `oa_contacts`.`USER_ID`) limit 1) AS `EMPLOYEE_NAME`,`oa_contacts`.`UPDATED_ON` AS `Updated_On` from `oa_contacts` */;

--
-- Final view structure for view `obj_attrbt_previleges_vw`
--

/*!50001 DROP VIEW IF EXISTS `obj_attrbt_previleges_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `obj_attrbt_previleges_vw` AS select `obj_attrbt_previleges`.`OBJ_ATTRBT_PREVILEGES_ID` AS `OBJ_ATTRBT_PREVILEGES_ID`,`obj_attrbt_previleges`.`OBJ_ID` AS `OBJ_ID`,`obj_attrbt_previleges`.`OBJ_ATTRBT_ID` AS `OBJ_ATTRBT_ID`,`obj_attrbt_previleges`.`OA_ID` AS `OA_ID`,`obj_attrbt_previleges`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`obj_attrbt_previleges`.`USER_ID` AS `USER_ID`,`obj_attrbt_previleges`.`IS_DELETED` AS `IS_DELETED`,`obj_attrbt_previleges`.`CREATED_BY` AS `CREATED_BY`,`obj_attrbt_previleges`.`UPDATED_BY` AS `UPDATED_BY`,`obj_attrbt_previleges`.`CREATED_ON` AS `CREATED_ON`,`obj_attrbt_previleges`.`UPDATED_ON` AS `UPDATED_ON` from `obj_attrbt_previleges` */;

--
-- Final view structure for view `obj_layer_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `obj_layer_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `obj_layer_type_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 17) */;

--
-- Final view structure for view `obj_previleges_role_vw`
--

/*!50001 DROP VIEW IF EXISTS `obj_previleges_role_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `obj_previleges_role_vw` AS select `obj_previleges`.`PRVLG_ID` AS `PRVLG_ID`,`obj_previleges`.`PERMISSIONS_CLASS_ID` AS `PERMISSIONS_CLASS_ID`,`obj_previleges`.`PRVLG_REF_TYPE_ID` AS `PRVLG_REF_TYPE_ID`,(select `common_type`.`TYP_NM` from `common_type` where (`common_type`.`TYP_ID` = `obj_previleges`.`PRVLG_REF_TYPE_ID`)) AS `TYP_NM`,`obj_previleges`.`PRVLG_REF_ID` AS `PRVLG_REF_ID`,`obj_previleges`.`OA_ID` AS `ORG_ACC_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_NM`,`obj_previleges`.`OA_BRAND_ID` AS `BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_NM`,`obj_previleges`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`obj_previleges`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`obj_previleges`.`CREATED_ON` AS `CREATED_ON`,`obj_previleges`.`UPDATED_ON` AS `UPDATED_ON` from `obj_previleges` where `obj_previleges`.`PRVLG_REF_TYPE_ID` in (select `independent_mst`.`MSTR_ID` from `independent_mst` where ((`independent_mst`.`MSTR_CD` = 'PRTRP') and (`independent_mst`.`IS_PREDEFINED` = 1))) */;

--
-- Final view structure for view `obj_previleges_vw`
--

/*!50001 DROP VIEW IF EXISTS `obj_previleges_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `obj_previleges_vw` AS select `obj_previleges`.`PRVLG_ID` AS `PRVLG_ID`,`obj_previleges`.`PERMISSIONS_CLASS_ID` AS `PERMISSIONS_CLASS_ID`,`obj_previleges`.`PRVLG_REF_TYPE_ID` AS `PRVLG_REF_TYPE_ID`,(select `common_type`.`TYP_NM` from `common_type` where (`common_type`.`TYP_ID` = `obj_previleges`.`PRVLG_REF_TYPE_ID`)) AS `TYP_NM`,`obj_previleges`.`PRVLG_REF_ID` AS `PRVLG_REF_ID`,`obj_previleges`.`OA_ID` AS `ORG_ACC_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_NM`,`obj_previleges`.`OA_BRAND_ID` AS `BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_NM`,`obj_previleges`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`obj_previleges`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`obj_previleges`.`CREATED_ON` AS `CREATED_ON`,`obj_previleges`.`UPDATED_ON` AS `UPDATED_ON` from `obj_previleges` */;

--
-- Final view structure for view `odentry_period_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `odentry_period_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `odentry_period_mst_vw` AS select `period_mst_vw`.`PERIOD_ID` AS `PERIOD_ID`,`period_mst_vw`.`PERIOD_TYPE_ID` AS `PERIOD_TYPE_ID`,`period_mst_vw`.`PERIOD_TYP_CD` AS `PERIOD_TYP_CD`,`period_mst_vw`.`PERIOD_TYP` AS `PERIOD_TYP`,`period_mst_vw`.`PERIOD_START_DATE` AS `PERIOD_START_DATE`,`period_mst_vw`.`PERIOD_END_DATE` AS `PERIOD_END_DATE`,`period_mst_vw`.`FISCAL_PERIOD_DESC` AS `FISCAL_PERIOD_DESC`,`period_mst_vw`.`PERIOD_STATUS_ID` AS `PERIOD_STATUS_ID`,`period_mst_vw`.`PERIOD_STATUS_CD` AS `PERIOD_STATUS_CD`,`period_mst_vw`.`PERIOD_STATUS` AS `PERIOD_STATUS`,`period_mst_vw`.`OAID` AS `OAID`,`period_mst_vw`.`OA_CD` AS `OA_CD`,`period_mst_vw`.`OA_NM` AS `OA_NM`,`period_mst_vw`.`USERID` AS `USERID`,`period_mst_vw`.`USER_NM` AS `USER_NM`,`period_mst_vw`.`OABRANDID` AS `OABRANDID`,`period_mst_vw`.`OA_BRAND_CD` AS `OA_BRAND_CD`,`period_mst_vw`.`OA_BRAND_NM` AS `OA_BRAND_NM`,`period_mst_vw`.`CREATED_BY_USER_ID` AS `CREATED_BY_USER_ID`,`period_mst_vw`.`CREATED_BY_USER_NAME` AS `CREATED_BY_USER_NAME`,`period_mst_vw`.`UPDATED_BY_USER_ID` AS `UPDATED_BY_USER_ID`,`period_mst_vw`.`UPDATED_BY_USER_NAME` AS `UPDATED_BY_USER_NAME`,`period_mst_vw`.`CREATED_ON` AS `CREATED_ON`,`period_mst_vw`.`UPDATED_ON` AS `UPDATED_ON`,`period_mst_vw`.`IS_DELETED` AS `IS_DELETED` from `period_mst_vw` where (`period_mst_vw`.`PERIOD_TYP_CD` = 'PTOD') */;

--
-- Final view structure for view `online_chat_support_vw`
--

/*!50001 DROP VIEW IF EXISTS `online_chat_support_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `online_chat_support_vw` AS select `online_chat_support`.`OC_ID` AS `OC_ID`,`online_chat_support`.`URL` AS `URL`,`online_chat_support`.`CHAT_INSTRUCTION` AS `CHAT_INSTRUCTION`,`online_chat_support`.`IS_DELETED` AS `IS_DELETED`,`online_chat_support`.`OA_ID` AS `OA_ID`,`online_chat_support`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`online_chat_support`.`USER_ID` AS `USER_ID`,`online_chat_support`.`UPDATED_ON` AS `UPDATED_ON`,`online_chat_support`.`UPDATED_BY` AS `UPDATED_BY`,`online_chat_support`.`CREATED_ON` AS `CREATED_ON`,`online_chat_support`.`CREATED_BY` AS `CREATED_BY` from `online_chat_support` */;

--
-- Final view structure for view `org_acc_invoice_settings_vw`
--

/*!50001 DROP VIEW IF EXISTS `org_acc_invoice_settings_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `org_acc_invoice_settings_vw` AS select `org_acc_invoice_settings`.`ORG_ACC_INVOICE_SETTING_ID` AS `ORG_ACC_INVOICE_SETTING_ID`,`org_acc_invoice_settings`.`FOLDER_LOC` AS `FOLDER_LOC`,`org_acc_invoice_settings`.`ORG_TEMPLATE` AS `ORG_TEMPLATE`,`org_acc_invoice_settings`.`PAYMENT_TEMPLATE` AS `PAYMENT_TEMPLATE`,`org_acc_invoice_settings`.`CREDITNOTE_TEMPLATE` AS `CREDITNOTE_TEMPLATE`,`org_acc_invoice_settings`.`REG_ADDRESS` AS `REG_ADDRESS`,`org_acc_invoice_settings`.`REG_ADDRESS_2` AS `REG_ADDRESS_2`,`org_acc_invoice_settings`.`REG_ADDRESS_3` AS `REG_ADDRESS_3`,`org_acc_invoice_settings`.`POSTAL_CODE` AS `POSTAL_CODE`,`org_acc_invoice_settings`.`COUNTRY` AS `COUNTRY`,`org_acc_invoice_settings`.`REGISTRATION_NO` AS `REGISTRATION_NO`,`org_acc_invoice_settings`.`VAT_NO` AS `VAT_NO`,`org_acc_invoice_settings`.`STATUS_ID` AS `STATUS_ID`,`org_acc_invoice_settings`.`ACCOUNT_NAME` AS `ACCOUNT_NAME`,`org_acc_invoice_settings`.`ACCOUNT_NO` AS `ACCOUNT_NO`,`org_acc_invoice_settings`.`SORT_CODE` AS `SORT_CODE`,`org_acc_invoice_settings`.`INSTRUCTION_LINE_1` AS `INSTRUCTION_LINE_1`,`org_acc_invoice_settings`.`INSTRUCTION_LINE_2` AS `INSTRUCTION_LINE_2`,`org_acc_invoice_settings`.`INSTRUCTION_LINE_3` AS `INSTRUCTION_LINE_3`,`org_acc_invoice_settings`.`OA_BRAND_NM` AS `OA_BRAND_NM`,`org_acc_invoice_settings`.`OA_BRAND_CD` AS `OA_BRAND_CD`,`org_acc_invoice_settings`.`INSTRUCTION_LINE_4` AS `INSTRUCTION_LINE_4`,`org_acc_invoice_settings`.`CITY` AS `CITY`,`org_acc_invoice_settings`.`MAIL_PDF` AS `MAIL_PDF`,`org_acc_invoice_settings`.`APPLICABLE_TAX` AS `APPLICABLE_TAX`,`org_acc_invoice_settings`.`CST` AS `CST`,`org_acc_invoice_settings`.`PAN` AS `PAN`,`org_acc_invoice_settings`.`USER_ID` AS `USERID`,`org_acc_invoice_settings`.`INVOICE_PREFIX` AS `INVOICE_PREFIX`,`org_acc_invoice_settings`.`TEMPLATE_SETTING_ID` AS `TEMPLATE_SETTING_ID`,`org_acc_invoice_settings`.`ORG_CURRENCY_ID` AS `ORG_CURRENCY_ID`,`org_acc_invoice_settings`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `ACCOUNT_NM`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `ACCOUNT_CD`,`org_acc_invoice_settings`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`org_acc_invoice_settings`.`USER_ID` AS `USER_ID`,`org_acc_invoice_settings`.`IS_DELETED` AS `IS_DELETED`,`org_acc_invoice_settings`.`CREATED_ON` AS `CREATED_ON`,`org_acc_invoice_settings`.`CREATED_BY` AS `CREATED_BY`,`org_acc_invoice_settings`.`UPDATED_ON` AS `UPDATED_ON`,`org_acc_invoice_settings`.`UPDATED_BY` AS `UPDATED_BY` from `org_acc_invoice_settings` */;

--
-- Final view structure for view `org_account_balance_vw`
--

/*!50001 DROP VIEW IF EXISTS `org_account_balance_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `org_account_balance_vw` AS select `OAB`.`OA_BALANCE_ID` AS `OA_BALANCE_ID`,`OAB`.`OA_AMT_DEPOSIT` AS `OA_AMT_DEPOSIT`,`OAB`.`OA_AMT_WITHDRAWAL` AS `OA_AMT_WITHDRAWAL`,(`OAB`.`OA_AMT_DEPOSIT` - `OAB`.`OA_AMT_WITHDRAWAL`) AS `OA_ACCOUNT_BALANCE_AMT`,`OAB`.`OA_BUSINESS_CREDIT_DEPOSIT` AS `OA_BUSINESS_CREDIT_DEPOSIT`,`OAB`.`OA_BUSINESS_CREDIT_WITHDRAWAL` AS `OA_BUSINESS_CREDIT_WITHDRAWAL`,(`OAB`.`OA_BUSINESS_CREDIT_DEPOSIT` - `OAB`.`OA_BUSINESS_CREDIT_WITHDRAWAL`) AS `OA_BUSINESS_CREDIT_BALANCE`,`OAB`.`IS_DELETED` AS `IS_DELETED`,`OAB`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAB`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAB`.`OA_ID`)) AS `OA_NM`,`OAB`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OAB`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OAB`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`OAB`.`CREATED_BY` AS `CREATED_BY`,`OAB`.`CREATED_ON` AS `CREATED_ON`,`OAB`.`UPDATED_BY` AS `UPDATED_BY`,`OAB`.`UPDATED_ON` AS `UPDATED_ON` from `org_account_balance` `OAB` */;

--
-- Final view structure for view `org_account_deposit_dtl_vw`
--

/*!50001 DROP VIEW IF EXISTS `org_account_deposit_dtl_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `org_account_deposit_dtl_vw` AS select `OAD`.`ORG_ACCOUNT_DEPOSIT_ID` AS `ORG_ACCOUNT_DEPOSIT_ID`,date_format(`OAD`.`DEPOSIT_DATE`,get_format(DATE, 'EUR')) AS `DEPOSIT_DATE`,`OAD`.`DEPOSIT_AMT` AS `DEPOSIT_AMT`,`OAD`.`OA_BUSINESS_CREDIT_RATE` AS `OA_BUSINESS_CREDIT_RATE`,`OAD`.`OA_BUSINESS_CREDIT_AMT` AS `OA_BUSINESS_CREDIT_AMT`,`OAD`.`SUBSRIPTION_DEPOSIT_TYPE` AS `SUBSRIPTION_DEPOSIT_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `OAD`.`SUBSRIPTION_DEPOSIT_TYPE`)) AS `SUBSRIPTION_DEPOSIT_TYPE`,`OAD`.`IS_DELETED` AS `IS_DELETED`,`OAD`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAD`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAD`.`OA_ID`)) AS `OA_NM`,`OAD`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OAD`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OAD`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`OAD`.`CREATED_BY` AS `CREATED_BY`,`OAD`.`CREATED_ON` AS `CREATED_ON`,`OAD`.`UPDATED_BY` AS `UPDATED_BY`,`OAD`.`UPDATED_ON` AS `UPDATED_ON` from `org_account_deposit_dtl` `OAD` */;

--
-- Final view structure for view `org_account_rate_vw`
--

/*!50001 DROP VIEW IF EXISTS `org_account_rate_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `org_account_rate_vw` AS select `org_account_rate`.`ORG_ACCOUNT_RATE_ID` AS `ORG_ACCOUNT_RATE_ID`,`org_account_rate`.`CREDIT_RATE_DATE` AS `CREDIT_RATE_DATE`,`org_account_rate`.`CREDIT_RATE_FACTOR` AS `CREDIT_RATE_FACTOR`,`org_account_rate`.`IS_DELETED` AS `IS_DELETED`,`org_account_rate`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `org_account_rate`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `org_account_rate`.`OA_ID`)) AS `OA_NM`,`org_account_rate`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `org_account_rate`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `org_account_rate`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`org_account_rate`.`CREATED_BY` AS `CREATED_BY`,`org_account_rate`.`CREATED_ON` AS `CREATED_ON`,`org_account_rate`.`UPDATED_BY` AS `UPDATED_BY`,`org_account_rate`.`UPDATED_ON` AS `UPDATED_ON` from `org_account_rate` */;

--
-- Final view structure for view `org_account_withdrawal_dtl_vw`
--

/*!50001 DROP VIEW IF EXISTS `org_account_withdrawal_dtl_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `org_account_withdrawal_dtl_vw` AS select `org_account_withdrawal_dtl`.`ORG_ACCOUNT_WITHDRAWAL_ID` AS `ORG_ACCOUNT_WITHDRAWAL_ID`,`org_account_withdrawal_dtl`.`TRANSACTION_DATE` AS `TRANSACTION_DATE`,`org_account_withdrawal_dtl`.`SYSTEM_ID` AS `SYSTEM_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `org_account_withdrawal_dtl`.`SYSTEM_ID`)) AS `SYSTEM`,`org_account_withdrawal_dtl`.`MODULE_ID` AS `MODULE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `org_account_withdrawal_dtl`.`MODULE_ID`)) AS `MODULE`,`org_account_withdrawal_dtl`.`FUNCTIONAL_AREA_ID` AS `FUNCTIONAL_AREA_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `org_account_withdrawal_dtl`.`FUNCTIONAL_AREA_ID`)) AS `FUNCTIONAL_AREA`,`org_account_withdrawal_dtl`.`RATE_FACTOR` AS `RATE_FACTOR`,`org_account_withdrawal_dtl`.`CREDIT_RATE` AS `CREDIT_RATE`,`org_account_withdrawal_dtl`.`CREDIT_AMT` AS `CREDIT_AMT`,`org_account_withdrawal_dtl`.`WITHDRAWAL_AMT` AS `WITHDRAWAL_AMT`,`org_account_withdrawal_dtl`.`IS_SUSPENDED` AS `IS_SUSPENDED`,`org_account_withdrawal_dtl`.`TRANSACTION_STATUS_ID` AS `TRANSACTION_STATUS_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `org_account_withdrawal_dtl`.`TRANSACTION_STATUS_ID`)) AS `TRANSACTION_STATUS`,`org_account_withdrawal_dtl`.`IS_DELETED` AS `IS_DELETED`,`org_account_withdrawal_dtl`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `org_account_withdrawal_dtl`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `org_account_withdrawal_dtl`.`OA_ID`)) AS `OA_NM`,`org_account_withdrawal_dtl`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `org_account_withdrawal_dtl`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `org_account_withdrawal_dtl`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`org_account_withdrawal_dtl`.`CREATED_BY` AS `CREATED_BY`,`org_account_withdrawal_dtl`.`CREATED_ON` AS `CREATED_ON`,`org_account_withdrawal_dtl`.`UPDATED_BY` AS `UPDATED_BY`,`org_account_withdrawal_dtl`.`UPDATED_ON` AS `UPDATED_ON` from `org_account_withdrawal_dtl` */;

--
-- Final view structure for view `org_accounts_vw`
--

/*!50001 DROP VIEW IF EXISTS `org_accounts_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `org_accounts_vw` AS select `org_accounts`.`OA_ID` AS `OA_ID`,`org_accounts`.`OA_CD` AS `OA_CD`,`org_accounts`.`OA_NM` AS `OA_NM`,`org_accounts`.`PARTNER_ID` AS `PARTNER_ID`,`org_accounts`.`OA_EMAIL` AS `OA_EMAIL`,`org_accounts`.`OA_WEB_DOMAIN` AS `OA_WEB_DOMAIN`,`org_accounts`.`OA_CONTACT_NO` AS `OA_CONTACT_NO`,`org_accounts`.`OA_STATUS_ID` AS `OA_STATUS_ID`,`org_accounts`.`OA_ACC_TYPE` AS `OA_ACC_TYPE`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `org_accounts`.`OA_ACC_TYPE`)) AS `ACC_TYPE`,`org_accounts`.`OA_ADDRESS` AS `OA_ADDRESS`,(select `independent_mst`.`MSTR_CD` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `org_accounts`.`OA_STATUS_ID`)) AS `OA_STATUS_CD`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `org_accounts`.`OA_STATUS_ID`)) AS `OA_STATUS_NM`,`org_accounts`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`org_accounts`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`org_accounts`.`CREATED_BY` AS `CREATED_BY`,`org_accounts`.`UPDATED_BY` AS `UPDATED_BY`,`org_accounts`.`CREATED_ON` AS `CREATED_ON`,`org_accounts`.`UPDATED_ON` AS `UPDATED_ON`,`org_accounts`.`IS_DELETED` AS `IS_DELETED` from `org_accounts` */;

--
-- Final view structure for view `orgacct_settings_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `orgacct_settings_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `orgacct_settings_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 41) */;

--
-- Final view structure for view `orgacct_status_vw`
--

/*!50001 DROP VIEW IF EXISTS `orgacct_status_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `orgacct_status_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 42) */;

--
-- Final view structure for view `organisation_period_status_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `organisation_period_status_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `organisation_period_status_mst_vw` AS select `independent_mst_vw`.`MSTR_ID` AS `MSTR_ID`,`independent_mst_vw`.`MSTR_CD` AS `MSTR_CD`,`independent_mst_vw`.`MSTR_NM` AS `MSTR_NM`,`independent_mst_vw`.`MSTR_TYP_ID` AS `MSTR_TYP_ID`,`independent_mst_vw`.`TYP_ID` AS `TYP_ID`,`independent_mst_vw`.`TYP_CD` AS `TYP_CD`,`independent_mst_vw`.`TYP_NM` AS `TYP_NM`,`independent_mst_vw`.`DATA_TYPE` AS `DATA_TYPE`,`independent_mst_vw`.`VISIBLE_TO_USER` AS `VISIBLE_TO_USER`,`independent_mst_vw`.`USER_CAN_CREATE_DATA` AS `USER_CAN_CREATE_DATA`,`independent_mst_vw`.`USER_CAN_EDIT_DATA` AS `USER_CAN_EDIT_DATA`,`independent_mst_vw`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst_vw`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst_vw`.`PARENT_MSTR_NM` AS `PARENT_MSTR_NM`,`independent_mst_vw`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst_vw`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst_vw`.`IS_DEFAULT_FOR_SYNC` AS `IS_DEFAULT_FOR_SYNC`,`independent_mst_vw`.`IM_GROUP_CTR` AS `IM_GROUP_CTR`,`independent_mst_vw`.`MSTR_DESC` AS `MSTR_DESC`,`independent_mst_vw`.`IS_DELETED` AS `IS_DELETED`,`independent_mst_vw`.`APP_ID` AS `APP_ID`,`independent_mst_vw`.`APP_CD` AS `APP_CD`,`independent_mst_vw`.`SEQUENCE` AS `SEQUENCE`,`independent_mst_vw`.`FOR_MODULE` AS `FOR_MODULE`,`independent_mst_vw`.`FOR_SYSTEM` AS `FOR_SYSTEM`,`independent_mst_vw`.`MODULE_CD` AS `MODULE_CD`,`independent_mst_vw`.`ORG_ACC_ID` AS `ORG_ACC_ID`,`independent_mst_vw`.`OA_CD` AS `OA_CD`,`independent_mst_vw`.`OA_NM` AS `OA_NM`,`independent_mst_vw`.`BRAND_ID` AS `BRAND_ID`,`independent_mst_vw`.`OA_BRAND_CD` AS `OA_BRAND_CD`,`independent_mst_vw`.`OA_BRAND_NM` AS `OA_BRAND_NM`,`independent_mst_vw`.`USERID` AS `USERID`,`independent_mst_vw`.`USER_NM` AS `USER_NM`,`independent_mst_vw`.`CREATED_BY_USER_ID` AS `CREATED_BY_USER_ID`,`independent_mst_vw`.`CREATED_BY_USER_NAME` AS `CREATED_BY_USER_NAME`,`independent_mst_vw`.`UPDATED_BY_USER_ID` AS `UPDATED_BY_USER_ID`,`independent_mst_vw`.`UPDATED_BY_USER_NAME` AS `UPDATED_BY_USER_NAME`,`independent_mst_vw`.`CREATED_ON` AS `CREATED_ON`,`independent_mst_vw`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst_vw` where (`independent_mst_vw`.`TYP_ID` = 44) */;

--
-- Final view structure for view `organisation_period_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `organisation_period_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `organisation_period_type_mst_vw` AS select `independent_mst_vw`.`MSTR_ID` AS `MSTR_ID`,`independent_mst_vw`.`MSTR_CD` AS `MSTR_CD`,`independent_mst_vw`.`MSTR_NM` AS `MSTR_NM`,`independent_mst_vw`.`MSTR_TYP_ID` AS `MSTR_TYP_ID`,`independent_mst_vw`.`TYP_ID` AS `TYP_ID`,`independent_mst_vw`.`TYP_CD` AS `TYP_CD`,`independent_mst_vw`.`TYP_NM` AS `TYP_NM`,`independent_mst_vw`.`DATA_TYPE` AS `DATA_TYPE`,`independent_mst_vw`.`VISIBLE_TO_USER` AS `VISIBLE_TO_USER`,`independent_mst_vw`.`USER_CAN_CREATE_DATA` AS `USER_CAN_CREATE_DATA`,`independent_mst_vw`.`USER_CAN_EDIT_DATA` AS `USER_CAN_EDIT_DATA`,`independent_mst_vw`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst_vw`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst_vw`.`PARENT_MSTR_NM` AS `PARENT_MSTR_NM`,`independent_mst_vw`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst_vw`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst_vw`.`IS_DEFAULT_FOR_SYNC` AS `IS_DEFAULT_FOR_SYNC`,`independent_mst_vw`.`IM_GROUP_CTR` AS `IM_GROUP_CTR`,`independent_mst_vw`.`MSTR_DESC` AS `MSTR_DESC`,`independent_mst_vw`.`IS_DELETED` AS `IS_DELETED`,`independent_mst_vw`.`APP_ID` AS `APP_ID`,`independent_mst_vw`.`APP_CD` AS `APP_CD`,`independent_mst_vw`.`SEQUENCE` AS `SEQUENCE`,`independent_mst_vw`.`FOR_MODULE` AS `FOR_MODULE`,`independent_mst_vw`.`FOR_SYSTEM` AS `FOR_SYSTEM`,`independent_mst_vw`.`MODULE_CD` AS `MODULE_CD`,`independent_mst_vw`.`ORG_ACC_ID` AS `ORG_ACC_ID`,`independent_mst_vw`.`OA_CD` AS `OA_CD`,`independent_mst_vw`.`OA_NM` AS `OA_NM`,`independent_mst_vw`.`BRAND_ID` AS `BRAND_ID`,`independent_mst_vw`.`OA_BRAND_CD` AS `OA_BRAND_CD`,`independent_mst_vw`.`OA_BRAND_NM` AS `OA_BRAND_NM`,`independent_mst_vw`.`USERID` AS `USERID`,`independent_mst_vw`.`USER_NM` AS `USER_NM`,`independent_mst_vw`.`CREATED_BY_USER_ID` AS `CREATED_BY_USER_ID`,`independent_mst_vw`.`CREATED_BY_USER_NAME` AS `CREATED_BY_USER_NAME`,`independent_mst_vw`.`UPDATED_BY_USER_ID` AS `UPDATED_BY_USER_ID`,`independent_mst_vw`.`UPDATED_BY_USER_NAME` AS `UPDATED_BY_USER_NAME`,`independent_mst_vw`.`CREATED_ON` AS `CREATED_ON`,`independent_mst_vw`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst_vw` where (`independent_mst_vw`.`TYP_ID` = 43) */;

--
-- Final view structure for view `ot_daily_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `ot_daily_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `ot_daily_summary_vw` AS select `ot_daily_summary`.`ODS_ID` AS `ODS_ID`,`ot_daily_summary`.`ATTEND_CALENDAR_ID` AS `ATTEND_CALENDAR_ID`,`ot_daily_summary`.`DAY_NM` AS `DAY_NM`,`ot_daily_summary`.`ATTND_EMP_ID` AS `ATTND_EMP_ID`,`ot_daily_summary`.`ATTND_EMP_NAME` AS `ATTND_EMP_NAME`,`ot_daily_summary`.`TOTAL_WORKING_HOUR` AS `TOTAL_WORKING_HOUR`,`ot_daily_summary`.`OT_HOUR` AS `OT_HOUR`,`ot_daily_summary`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `ot_daily_summary`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `ot_daily_summary`.`OA_ID`)) AS `OA_NM`,`ot_daily_summary`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `ot_daily_summary`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `ot_daily_summary`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`ot_daily_summary`.`USER_ID` AS `USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `ot_daily_summary`.`USER_ID`)) AS `USER_NM` from `ot_daily_summary` */;

--
-- Final view structure for view `ot_monthly_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `ot_monthly_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `ot_monthly_summary_vw` AS select `ot_monthly_summary`.`OMS_ID` AS `OMS_ID`,`ot_monthly_summary`.`ATTEND_CALENDAR_ID` AS `ATTEND_CALENDAR_ID`,`ot_monthly_summary`.`DAY_NM` AS `DAY_NM`,`ot_monthly_summary`.`ATTND_EMP_ID` AS `ATTND_EMP_ID`,`ot_monthly_summary`.`ATTND_EMP_NAME` AS `ATTND_EMP_NAME`,sum(`ot_monthly_summary`.`TOTAL_WORKING_HOUR`) AS `TOTAL_WORKING_HOUR`,sum(`ot_monthly_summary`.`OT_HOUR`) AS `OT_HOUR`,`ot_monthly_summary`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `ot_monthly_summary`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `ot_monthly_summary`.`OA_ID`)) AS `OA_NM`,`ot_monthly_summary`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `ot_monthly_summary`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `ot_monthly_summary`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`ot_monthly_summary`.`USER_ID` AS `USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `ot_monthly_summary`.`USER_ID`)) AS `USER_NM` from `ot_monthly_summary` group by `ot_monthly_summary`.`ATTND_EMP_ID` */;

--
-- Final view structure for view `ot_rules_vw`
--

/*!50001 DROP VIEW IF EXISTS `ot_rules_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `ot_rules_vw` AS select `ot_rules`.`OT_ID` AS `OT_ID`,`ot_rules`.`GRADE_ID` AS `GRADE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `ot_rules`.`GRADE_ID`)) AS `GRADE`,`ot_rules`.`FROM_HRS` AS `FROM_HRS`,`ot_rules`.`TO_HRS` AS `TO_HRS`,`ot_rules`.`VALUE` AS `VALUE`,`ot_rules`.`DAY_TYPE` AS `DAY_TYPE`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `ot_rules`.`DAY_TYPE`)) AS `DAY_TYP_NM`,`ot_rules`.`OA_START_BY` AS `OA_START_BY`,`ot_rules`.`FIXED_AMT` AS `FIXED_AMT`,`ot_rules`.`FIXED_AMT_FLAG` AS `FIXED_AMT_FLAG`,`ot_rules`.`IS_DELETED` AS `IS_DELETED`,`ot_rules`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`ot_rules`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`ot_rules`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`ot_rules`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`ot_rules`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NAME`,`ot_rules`.`CREATED_ON` AS `CREATED_ON`,`ot_rules`.`UPDATED_ON` AS `UPDATED_ON` from `ot_rules` */;

--
-- Final view structure for view `ot_team_daily_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `ot_team_daily_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `ot_team_daily_summary_vw` AS select `ot_team_daily_summary`.`OTS_ID` AS `OTS_ID`,`ot_team_daily_summary`.`ATTEND_CALENDAR_ID` AS `ATTEND_CALENDAR_ID`,`ot_team_daily_summary`.`DAY_NM` AS `DAY_NM`,`ot_team_daily_summary`.`MANAGER_ID` AS `MANAGER_ID`,(select `attendance_employee`.`EMP_NM` from `attendance_employee` where (`attendance_employee`.`ATTND_EMP_ID` = `ot_team_daily_summary`.`MANAGER_ID`)) AS `MANAGER_NM`,`ot_team_daily_summary`.`ATTND_EMP_ID` AS `ATTND_EMP_ID`,`ot_team_daily_summary`.`ATTND_EMP_NAME` AS `ATTND_EMP_NAME`,`ot_team_daily_summary`.`TOTAL_WORKING_HOUR` AS `TOTAL_WORKING_HOUR`,`ot_team_daily_summary`.`OT_HOUR` AS `OT_HOUR`,`ot_team_daily_summary`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `ot_team_daily_summary`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `ot_team_daily_summary`.`OA_ID`)) AS `OA_NM`,`ot_team_daily_summary`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `ot_team_daily_summary`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `ot_team_daily_summary`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`ot_team_daily_summary`.`USER_ID` AS `USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `ot_team_daily_summary`.`USER_ID`)) AS `USER_NM` from `ot_team_daily_summary` */;

--
-- Final view structure for view `ot_team_monthly_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `ot_team_monthly_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `ot_team_monthly_summary_vw` AS select `ot_team_monthly_summary`.`OTS_ID` AS `OTS_ID`,`ot_team_monthly_summary`.`ATTEND_CALENDAR_ID` AS `ATTEND_CALENDAR_ID`,`ot_team_monthly_summary`.`DAY_NM` AS `DAY_NM`,`ot_team_monthly_summary`.`MANAGER_ID` AS `MANAGER_ID`,(select `attendance_employee`.`EMP_NM` from `attendance_employee` where (`attendance_employee`.`ATTND_EMP_ID` = `ot_team_monthly_summary`.`MANAGER_ID`)) AS `MANAGER_NM`,`ot_team_monthly_summary`.`ATTND_EMP_ID` AS `ATTND_EMP_ID`,`ot_team_monthly_summary`.`ATTND_EMP_NAME` AS `ATTND_EMP_NAME`,`ot_team_monthly_summary`.`TOTAL_WORKING_HOUR` AS `TOTAL_WORKING_HOUR`,`ot_team_monthly_summary`.`OT_HOUR` AS `OT_HOUR`,`ot_team_monthly_summary`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `ot_team_monthly_summary`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `ot_team_monthly_summary`.`OA_ID`)) AS `OA_NM`,`ot_team_monthly_summary`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `ot_team_monthly_summary`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `ot_team_monthly_summary`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`ot_team_monthly_summary`.`USER_ID` AS `USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `ot_team_monthly_summary`.`USER_ID`)) AS `USER_NM` from `ot_team_monthly_summary` */;

--
-- Final view structure for view `ot_team_weekly_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `ot_team_weekly_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `ot_team_weekly_summary_vw` AS select `ot_team_weekly_summary`.`OTS_ID` AS `OTS_ID`,`ot_team_weekly_summary`.`ATTEND_CALENDAR_ID` AS `ATTEND_CALENDAR_ID`,`ot_team_weekly_summary`.`DAY_NM` AS `DAY_NM`,`ot_team_weekly_summary`.`MANAGER_ID` AS `MANAGER_ID`,(select `attendance_employee`.`EMP_NM` from `attendance_employee` where (`attendance_employee`.`ATTND_EMP_ID` = `ot_team_weekly_summary`.`MANAGER_ID`)) AS `MANAGER_NM`,`ot_team_weekly_summary`.`ATTND_EMP_ID` AS `ATTND_EMP_ID`,`ot_team_weekly_summary`.`ATTND_EMP_NAME` AS `ATTND_EMP_NAME`,`ot_team_weekly_summary`.`TOTAL_WORKING_HOUR` AS `TOTAL_WORKING_HOUR`,`ot_team_weekly_summary`.`OT_HOUR` AS `OT_HOUR`,`ot_team_weekly_summary`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `ot_team_weekly_summary`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `ot_team_weekly_summary`.`OA_ID`)) AS `OA_NM`,`ot_team_weekly_summary`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `ot_team_weekly_summary`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `ot_team_weekly_summary`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`ot_team_weekly_summary`.`USER_ID` AS `USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `ot_team_weekly_summary`.`USER_ID`)) AS `USER_NM` from `ot_team_weekly_summary` */;

--
-- Final view structure for view `ot_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `ot_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `ot_type_mst_vw` AS select `independent_mst`.`MSTR_ID` AS `MSTR_ID`,`independent_mst`.`MSTR_CD` AS `MSTR_CD`,`independent_mst`.`MSTR_NM` AS `MSTR_NM`,`independent_mst`.`TYP_ID` AS `TYP_ID`,`independent_mst`.`RECORD_TYP` AS `RECORD_TYP`,`independent_mst`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`independent_mst`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IS_DELETED` AS `IS_DELETED`,`independent_mst`.`OA_ID` AS `OA_ID`,`independent_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`independent_mst`.`USER_ID` AS `USER_ID`,`independent_mst`.`CREATED_BY` AS `CREATED_BY`,`independent_mst`.`UPDATED_BY` AS `UPDATED_BY`,`independent_mst`.`CREATED_ON` AS `CREATED_ON`,`independent_mst`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` where (`independent_mst`.`TYP_ID` = 263) */;

--
-- Final view structure for view `ot_weekly_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `ot_weekly_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `ot_weekly_summary_vw` AS select `ot_weekly_summary`.`OWS_ID` AS `OWS_ID`,`ot_weekly_summary`.`ATTEND_CALENDAR_ID` AS `ATTEND_CALENDAR_ID`,`ot_weekly_summary`.`DAY_NM` AS `DAY_NM`,`ot_weekly_summary`.`ATTND_EMP_ID` AS `ATTND_EMP_ID`,`ot_weekly_summary`.`ATTND_EMP_NAME` AS `ATTND_EMP_NAME`,sum(`ot_weekly_summary`.`TOTAL_WORKING_HOUR`) AS `TOTAL_WORKING_HOUR`,sum(`ot_weekly_summary`.`OT_HOUR`) AS `OT_HOUR`,`ot_weekly_summary`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `ot_weekly_summary`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `ot_weekly_summary`.`OA_ID`)) AS `OA_NM`,`ot_weekly_summary`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `ot_weekly_summary`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `ot_weekly_summary`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`ot_weekly_summary`.`USER_ID` AS `USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `ot_weekly_summary`.`USER_ID`)) AS `USER_NM` from `ot_weekly_summary` group by `ot_weekly_summary`.`ATTND_EMP_ID` */;

--
-- Final view structure for view `outdrentr_employee_vw`
--

/*!50001 DROP VIEW IF EXISTS `outdrentr_employee_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `outdrentr_employee_vw` AS select `oe`.`OD_EMP_ID` AS `OD_EMP_ID`,if((`oe`.`IS_MANAGER` = 1),'Yes','No') AS `IS_MANAGER`,`oe`.`MANAGER_ID` AS `MANAGER_ID`,(select `oem`.`EMP_NM` from `outdrentr_employee` `oem` where (`oem`.`OD_EMP_ID` = `oe`.`MANAGER_ID`)) AS `MANAGER_NM`,`oe`.`REF_EMP_ID` AS `REF_EMP_ID`,`oe`.`REF_EMP_CD` AS `REF_EMP_CD`,`oe`.`EMP_NM` AS `EMP_NM`,(select `emp_mst`.`EMP_STATUS_ID` from `emp_mst` where (`emp_mst`.`REF_EMP_ID` = `oe`.`REF_EMP_ID`) limit 1) AS `EMP_STATUS_ID`,`oe`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`oe`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`oe`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`oe`.`CREATEDON` AS `CreatedOn`,`oe`.`UPDATEDON` AS `UpdatedOn`,`oe`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`oe`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`oe`.`IS_DELETED` AS `IS_DELETED` from `outdrentr_employee` `oe` */;

--
-- Final view structure for view `outdrentr_quota_vw`
--

/*!50001 DROP VIEW IF EXISTS `outdrentr_quota_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `outdrentr_quota_vw` AS select `outdrentr_quota`.`OD_QUOTE_ID` AS `OD_QUOTE_ID`,`outdrentr_quota`.`OD_TYPE_ID` AS `OD_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`outdrentr_quota`.`OD_TYPE_ID` = `independent_mst`.`MSTR_ID`)) AS `OD_TYP`,`outdrentr_quota`.`OD_PERIOD_ID` AS `OD_PERIOD_ID`,(select concat(cast(`period_mst`.`PERIOD_START_DATE` as date),' ',cast(`period_mst`.`PERIOD_END_DATE` as date)) from `period_mst` where (`period_mst`.`PERIOD_ID` = `outdrentr_quota`.`OD_PERIOD_ID`)) AS `OD_PERIOD`,`outdrentr_quota`.`OD_EMP_ID` AS `OD_EMP_ID`,`outdrentr_quota`.`OD_EMP_ID` AS `ODEMPID`,(select `outdrentr_employee`.`REF_EMP_ID` from `outdrentr_employee` where (`outdrentr_employee`.`OD_EMP_ID` = `ODEMPID`)) AS `EMP_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`EMP_ID` = `user_mst`.`USER_ID`)) AS `EMP_NAME`,`outdrentr_quota`.`NO_OF_DAYS_ALLOTED` AS `NO_OF_DAYS_ALLOTED`,`outdrentr_quota`.`OD_BROUGHT_FORWARD` AS `OD_BROUGHT_FORWARD`,`outdrentr_quota`.`OD_CARRIED_FORWARD` AS `OD_CARRIED_FORWARD`,`outdrentr_quota`.`OD_TAKEN` AS `OD_TAKEN`,`outdrentr_quota`.`OD_BALANCE` AS `OD_BALANCE`,`outdrentr_quota`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`outdrentr_quota`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`outdrentr_quota`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`outdrentr_quota`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`outdrentr_quota`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`outdrentr_quota`.`CREATED_ON` AS `Created_On`,`outdrentr_quota`.`UPDATED_ON` AS `Updated_On`,`outdrentr_quota`.`IS_DELETED` AS `IS_DELETED` from `outdrentr_quota` */;

--
-- Final view structure for view `outdrentr_vw`
--

/*!50001 DROP VIEW IF EXISTS `outdrentr_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `outdrentr_vw` AS select `outdrentr`.`OD_REQUEST_ID` AS `OD_REQUEST_ID`,`outdrentr`.`OD_TYPE_ID` AS `OD_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`outdrentr`.`OD_TYPE_ID` = `independent_mst`.`MSTR_ID`)) AS `OD_TYP`,`outdrentr`.`OD_PERIOD_ID` AS `OD_PERIOD_ID`,(select concat(`period_mst`.`PERIOD_START_DATE`,-(`period_mst`.`PERIOD_END_DATE`)) from `period_mst` where (`period_mst`.`PERIOD_ID` = `outdrentr`.`OD_PERIOD_ID`)) AS `OD_PERIOD`,`outdrentr`.`DATE_APPLIED` AS `DATE_APPLIED`,`outdrentr`.`OD_EMP_ID` AS `ODEMPID`,(select `outdrentr_employee`.`REF_EMP_ID` from `outdrentr_employee` where (`outdrentr_employee`.`OD_EMP_ID` = `ODEMPID`)) AS `EMP_ID`,(select `outdrentr_employee`.`EMP_NM` from `outdrentr_employee` where (`EMP_ID` = `outdrentr_employee`.`REF_EMP_ID`)) AS `EMP_NM`,`outdrentr`.`OD_COMMENTS` AS `OD_COMMENTS`,cast(`outdrentr`.`START_DATE` as date) AS `START_DATE`,cast(`outdrentr`.`END_DATE` as date) AS `END_DATE`,`outdrentr`.`HALF_DAY` AS `HALF_DAY`,`outdrentr`.`CREATED_ON` AS `CURRENT_DATE`,`outdrentr`.`OD_STATUS` AS `OD_STATUS`,`outdrentr`.`OD_APPLIED` AS `OD_APPLIED`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`outdrentr`.`OD_STATUS` = `independent_mst`.`MSTR_ID`)) AS `LEAVE_STATUS_NM`,`outdrentr`.`REASON` AS `REASON`,`outdrentr`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`outdrentr`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`outdrentr`.`APPROVER_ID` AS `APPROVER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `outdrentr`.`APPROVER_ID`)) AS `APPROVER_NM`,`outdrentr`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`outdrentr`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`outdrentr`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`outdrentr`.`CREATED_ON` AS `Created_On`,`outdrentr`.`UPDATED_ON` AS `Updated_On`,`outdrentr`.`IS_DELETED` AS `IS_DELETED` from `outdrentr` */;

--
-- Final view structure for view `outdrentrtype_dtl_vw`
--

/*!50001 DROP VIEW IF EXISTS `outdrentrtype_dtl_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `outdrentrtype_dtl_vw` AS select `outdrentrtype_dtl`.`OD_TYPE_DTL_ID` AS `OD_type_dtl_id`,`outdrentrtype_dtl`.`OD_TYPE_ID` AS `OD_type_id`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`outdrentrtype_dtl`.`OD_TYPE_ID` = `independent_mst`.`MSTR_ID`)) AS `OD_TYP_NM`,`outdrentrtype_dtl`.`OPERATIONAL_COUNTRY_ID` AS `OPERATIONAL_COUNTRY_ID`,(select `location_mst`.`LOC_NAME` from `location_mst` where (`outdrentrtype_dtl`.`OPERATIONAL_COUNTRY_ID` = `location_mst`.`LOC_ID`)) AS `COUNTRY_NM`,if((`outdrentrtype_dtl`.`AVAILABLE_FLAG` = 1),'Yes','No') AS `available_flag`,`outdrentrtype_dtl`.`NO_OF_DAYS` AS `NO_OF_DAYS`,`outdrentrtype_dtl`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`outdrentrtype_dtl`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`outdrentrtype_dtl`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`outdrentrtype_dtl`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`outdrentrtype_dtl`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`outdrentrtype_dtl`.`CREATED_ON` AS `Created_On`,`outdrentrtype_dtl`.`UPDATED_ON` AS `Updated_On`,`outdrentrtype_dtl`.`IS_DELETED` AS `IS_DELETED` from `outdrentrtype_dtl` */;

--
-- Final view structure for view `parent_bank_dtl_vw`
--

/*!50001 DROP VIEW IF EXISTS `parent_bank_dtl_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `parent_bank_dtl_vw` AS select `bank_dtl`.`BANK_ID` AS `BANK_ID`,`bank_dtl`.`EMP_ID` AS `EMPID`,(select concat(`emp_mst`.`EMP_NAME`,' ',`emp_mst`.`EMPLST_NM`) from `emp_mst` where (`emp_mst`.`EMP_ID` = `EMPID`)) AS `EMP_NAME`,`bank_dtl`.`BANK_NM` AS `BANK_NM`,`bank_dtl`.`BRANCH_NM` AS `BRANCH_NM`,`bank_dtl`.`BRANCH_ADDRESS` AS `BRANCH_ADDRESS`,`bank_dtl`.`IFSC_CD` AS `IFSC_CD`,`bank_dtl`.`SORT_CD` AS `SORT_CD`,`bank_dtl`.`ACCOUNT_NO` AS `ACCOUNT_NO`,`bank_dtl`.`ACCOUNT_HOLDER_NM` AS `ACCOUNT_HOLDER_NM`,`bank_dtl`.`EMP_ID` AS `EMP_ID`,`bank_dtl`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`bank_dtl`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where ((`oa_brands`.`OA_BRAND_ID` = `OABRANDID`) and (`oa_brands`.`OA_ID` = `OAID`))) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where ((`oa_brands`.`OA_BRAND_ID` = `OABRANDID`) and (`oa_brands`.`OA_ID` = `OAID`))) AS `OA_BRAND_NM`,`bank_dtl`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`bank_dtl`.`IS_DELETED` AS `IS_DELETED`,`bank_dtl`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`bank_dtl`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`bank_dtl`.`CREATEDON` AS `CREATED_ON`,`bank_dtl`.`UPDATEDON` AS `UPDATED_ON` from `bank_dtl` */;

--
-- Final view structure for view `parent_contact_address_vw`
--

/*!50001 DROP VIEW IF EXISTS `parent_contact_address_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `parent_contact_address_vw` AS select `contact_address`.`CNTCT_ADD_ID` AS `CNTCT_ADD_ID`,`contact_address`.`CNTCT_ID` AS `CNTCT_NM_ID`,(select `contact_mst_vw`.`EMP_NAME` from `contact_mst_vw` where (`contact_mst_vw`.`CNTCT_ID` = `CNTCT_NM_ID`)) AS `CNTCT_FULL_NM`,`contact_address`.`CNTCT_ADD_TYPE_ID` AS `CNTCT_ADD_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `contact_address`.`CNTCT_ADD_TYPE_ID`)) AS `CNTCT_ADD_TYPE_NM`,`contact_address`.`ADD_ID` AS `CONTACT_ADD_ID`,(select `address_mst`.`HOUSE_NAME` from `address_mst` where (`address_mst`.`ADDRESS_ID` = `CONTACT_ADD_ID`)) AS `HOUSE_NAME`,(select `address_mst`.`HOUSE_NO` from `address_mst` where (`address_mst`.`ADDRESS_ID` = `CONTACT_ADD_ID`)) AS `HOUSE_NO`,(select `address_mst`.`ADDRESS_LINE_1` from `address_mst` where (`address_mst`.`ADDRESS_ID` = `CONTACT_ADD_ID`)) AS `ADD_LINE_1`,(select `street_mst`.`STREET_NAME` from `street_mst` where (`street_mst`.`STREET_ID` = `ADD_LINE_1`)) AS `STREET_NM`,(select `address_mst`.`ADDRESS_LINE_2` from `address_mst` where (`address_mst`.`ADDRESS_ID` = `CONTACT_ADD_ID`)) AS `ADD_LINE_2`,(select `street_mst`.`LOCALITY` from `street_mst` where (`street_mst`.`STREET_ID` = `ADD_LINE_2`)) AS `AREAR`,(select `address_mst`.`ADDRESS_LINE_3` from `address_mst` where (`address_mst`.`ADDRESS_ID` = `CONTACT_ADD_ID`)) AS `ADD_LINE_3`,(select `street_mst`.`AREA` from `street_mst` where (`street_mst`.`STREET_ID` = `ADD_LINE_3`)) AS `TOWN`,(select `address_mst`.`ADDRESS_LINE_4` from `address_mst` where (`address_mst`.`ADDRESS_ID` = `CONTACT_ADD_ID`)) AS `ADD_LINE_4`,(select `location_mst`.`LOC_NAME` from `location_mst` where (`location_mst`.`LOC_ID` = `ADD_LINE_4`)) AS `ADDD_LINE_4`,(select `address_mst`.`ADDRESS_LINE_5` from `address_mst` where (`address_mst`.`ADDRESS_ID` = `CONTACT_ADD_ID`)) AS `ADD_LINE_5`,(select `location_mst`.`LOC_NAME` from `location_mst` where (`location_mst`.`LOC_ID` = `ADD_LINE_5`)) AS `ADDD_LINE_5`,(select `address_mst`.`CITY` from `address_mst` where (`address_mst`.`ADDRESS_ID` = `CONTACT_ADD_ID`)) AS `CITY_ID`,(select `location_mst`.`LOC_NAME` from `location_mst` where (`location_mst`.`LOC_ID` = `CITY_ID`)) AS `CITY_NM`,(select `address_mst`.`DISTRICT_ID` from `address_mst` where (`address_mst`.`ADDRESS_ID` = `CONTACT_ADD_ID`)) AS `ADD_DISTRICT_ID`,(select `location_mst`.`LOC_NAME` from `location_mst` where (`location_mst`.`LOC_ID` = `ADD_DISTRICT_ID`)) AS `DISTRICT`,(select `address_mst`.`COUNTY_ID` from `address_mst` where (`address_mst`.`ADDRESS_ID` = `CONTACT_ADD_ID`)) AS `ADD_COUNTY_ID`,(select `location_mst`.`LOC_NAME` from `location_mst` where (`location_mst`.`LOC_ID` = `ADD_COUNTY_ID`)) AS `COUNTY`,(select `address_mst`.`COUNTRY` from `address_mst` where (`address_mst`.`ADDRESS_ID` = `CONTACT_ADD_ID`)) AS `COUNTRY_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `COUNTRY_ID`)) AS `COUNTRY_NM`,(select `address_mst`.`POSTCODE` from `address_mst` where (`address_mst`.`ADDRESS_ID` = `CONTACT_ADD_ID`)) AS `POSTCODEID`,(select `postcode_mst`.`POSTCODE` from `postcode_mst` where (`postcode_mst`.`POSTCODE_ID` = `POSTCODEID`)) AS `ADD_POSTCODE`,(select concat(if((isnull(`address_mst`.`HOUSE_NAME`) or (`address_mst`.`HOUSE_NAME` = '')),'',concat(`address_mst`.`HOUSE_NAME`,', ')),if((isnull(`address_mst`.`HOUSE_NO`) or (`address_mst`.`HOUSE_NO` = '')),'',concat(`address_mst`.`HOUSE_NO`,', ')),if((isnull(`STREET_NM`) or (`STREET_NM` = '')),'',concat(`STREET_NM`,', ')),if((isnull(`AREAR`) or (`AREAR` = '')),'',concat(`AREAR`,', ')),if((isnull(`TOWN`) or (`TOWN` = '')),'',concat(`TOWN`,', ')),if((isnull(`ADDD_LINE_4`) or (`ADDD_LINE_4` = '')),'',concat(`ADDD_LINE_4`,', ')),if((isnull(`ADDD_LINE_5`) or (`ADDD_LINE_5` = '')),'',concat(`ADDD_LINE_5`,', ')),if((isnull(`CITY_NM`) or (`CITY_NM` = '')),'',concat(`CITY_NM`,', ')),if((isnull(`DISTRICT`) or (`DISTRICT` = '')),'',concat(`DISTRICT`,', ')),if((isnull(`COUNTY`) or (`COUNTY` = '')),'',concat(`COUNTY`,', ')),if((isnull(`COUNTRY_NM`) or (`COUNTRY_NM` = '')),'',concat(`COUNTRY_NM`,', ')),if((isnull(`ADD_POSTCODE`) or (`ADD_POSTCODE` = '')),'',`ADD_POSTCODE`)) from `address_mst` where (`address_mst`.`ADDRESS_ID` = `CONTACT_ADD_ID`)) AS `FULL_ADDRESS`,if((`contact_address`.`IS_CURRENT_ADD` = 1),'Yes','No') AS `Is_Current_Add`,if((`contact_address`.`IS_PRIMARY_ADD` = 1),'Yes','No') AS `Is_Primary_Add`,`contact_address`.`CNTCT_ID` AS `CNTCT_ID`,`contact_address`.`OA_ID_ORIGINATED` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`contact_address`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`contact_address`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`contact_address`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`CREATED_BY_USER_ID` = `user_mst`.`USER_ID`)) AS `CREATED_BY_USER_NAME`,`contact_address`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`UPDATED_BY_USER_ID` = `user_mst`.`USER_ID`)) AS `UPDATED_BY_USER_NAME`,`contact_address`.`CREATED_ON` AS `Created_On`,`contact_address`.`UPDATED_ON` AS `Updated_On`,`contact_address`.`IS_DELETED` AS `IS_DELETED` from `contact_address` */;

--
-- Final view structure for view `parent_contact_emails_vw`
--

/*!50001 DROP VIEW IF EXISTS `parent_contact_emails_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `parent_contact_emails_vw` AS select `oa_contact_emails`.`OA_CNTCT_EML_ID` AS `OA_CNTCT_EML_ID`,`oa_contact_emails`.`CNTCT_EML_ID` AS `CNTCT_EML_ID`,`oa_contact_emails`.`CNTCT_EML_ID` AS `OA_ACC_CNTCT_EML_ID`,(select `contact_emails`.`EMAIL_ADD_ID` from `contact_emails` where (`contact_emails`.`CNTCT_EML_ID` = `OA_ACC_CNTCT_EML_ID`)) AS `EMAIL_ID`,(select `email_address_mst`.`EMAIL_ADD` from `email_address_mst` where (`EMAIL_ID` = `email_address_mst`.`EMAIL_ADD_ID`)) AS `CNTCT_EMAIL`,if((`oa_contact_emails`.`IS_PRIMARY` = 1),'Yes','No') AS `Is_Primary`,`oa_contact_emails`.`OA_CNTCT_ID` AS `OA_CNTCT_ID`,(select `oa_contacts`.`CNTCT_ID` from `oa_contacts` where (`oa_contacts`.`OA_CNTCTS_ID` = `oa_contact_emails`.`OA_CNTCT_ID`)) AS `OACNTCT_ID`,(select `contact_mst`.`CNTCT_FRST_NM` from `contact_mst` where (`contact_mst`.`CNTCT_ID` = `OACNTCT_ID`)) AS `CNTCT_NM`,`oa_contact_emails`.`OA_ID` AS `ORG_ACC_ID`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_NM`,`oa_contact_emails`.`OA_BRAND_ID` AS `BRAND_ID`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_NM`,`oa_contact_emails`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`oa_contact_emails`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`oa_contact_emails`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,if((`oa_contact_emails`.`IS_EMP` = 1),'Yes','No') AS `IS_EMP`,`oa_contact_emails`.`CREATED_ON` AS `CREATED_ON`,`oa_contact_emails`.`UPDATED_ON` AS `UPDATED_ON`,`oa_contact_emails`.`IS_DELETED` AS `IS_DELETED`,`oa_contact_emails`.`EMAIL_TYPE_ID` AS `EMAIL_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `oa_contact_emails`.`EMAIL_TYPE_ID`)) AS `EMAIL_TYP_NM`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_CD` from `oa_contact_emails` where (`oa_contact_emails`.`IS_EMP` = 1) */;

--
-- Final view structure for view `parent_contact_nationality_vw`
--

/*!50001 DROP VIEW IF EXISTS `parent_contact_nationality_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `parent_contact_nationality_vw` AS select `oa_contact_nationality`.`OA_CNTCT_NATIONALITY_ID` AS `OA_CNTCT_NATIONALITY_ID`,`oa_contact_nationality`.`CNTCT_NATIONALITY_ID` AS `CONTACT_NATIONALITY_ID`,`oa_contact_nationality`.`CNTCT_NATIONALITY_ID` AS `CNTCT_NATIONALITY_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `oa_contact_nationality`.`CNTCT_NATIONALITY_ID`)) AS `CNTCT_NATIONALITY_NM`,`oa_contact_nationality`.`IS_DELETED` AS `IS_DELETED`,`oa_contact_nationality`.`OA_CNTCT_ID` AS `OA_CNTCT_ID`,(select `oa_contacts`.`CNTCT_ID` from `oa_contacts` where (`oa_contacts`.`OA_CNTCTS_ID` = `oa_contact_nationality`.`OA_CNTCT_ID`)) AS `OACNTCT_ID`,(select `contact_mst`.`CNTCT_FRST_NM` from `contact_mst` where (`contact_mst`.`CNTCT_ID` = `OACNTCT_ID`)) AS `CNTCT_NM`,`oa_contact_nationality`.`OA_ID` AS `ORG_ACC_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_NM`,`oa_contact_nationality`.`OA_BRAND_ID` AS `BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_NM`,`oa_contact_nationality`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`oa_contact_nationality`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`oa_contact_nationality`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`oa_contact_nationality`.`CREATED_ON` AS `Created_On`,`oa_contact_nationality`.`UPDATED_ON` AS `Updated_On` from `oa_contact_nationality` */;

--
-- Final view structure for view `parent_dependent_dtl_vw`
--

/*!50001 DROP VIEW IF EXISTS `parent_dependent_dtl_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `parent_dependent_dtl_vw` AS select `dependent_dtl`.`DEPENDENT_DTL_ID` AS `DEPENDENT_DTL_ID`,`dependent_dtl`.`EMP_ID` AS `EMPLOYEE_ID`,(select concat(`emp_mst`.`EMP_NAME`,' ',`emp_mst`.`EMPLST_NM`) from `emp_mst` where (`emp_mst`.`EMP_ID` = `EMPLOYEE_ID`)) AS `EMP_NAME`,`dependent_dtl`.`OA_DEP_CNTCTS_ID` AS `OA_DEP_CNTCTS_ID`,(select `oa_contacts`.`CNTCT_ID` from `oa_contacts` where (`oa_contacts`.`OA_CNTCTS_ID` = `dependent_dtl`.`OA_DEP_CNTCTS_ID`)) AS `OA_CNTCTS_ID`,(select concat(ifnull(`contact_mst`.`CNTCT_FRST_NM`,''),' ',ifnull(`contact_mst`.`CNTCT_LST_NM`,'')) from `contact_mst` where (`contact_mst`.`CNTCT_ID` = `OA_CNTCTS_ID`)) AS `CNTCT_FULL_NM`,`dependent_dtl`.`RELATION_TYPE_ID` AS `RELATION_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `dependent_dtl`.`RELATION_TYPE_ID`)) AS `REALTION_TYPE_NAME`,cast(`dependent_dtl`.`DATE_OF_BIRTH` as date) AS `DATE_OF_BIRTH`,`dependent_dtl`.`AGE` AS `AGE`,`dependent_dtl`.`EMP_ID` AS `EMP_ID`,`dependent_dtl`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`dependent_dtl`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`dependent_dtl`.`CREATED_ON` AS `CREATED_ON`,`dependent_dtl`.`UPDATED_ON` AS `UPDATED_ON`,`dependent_dtl`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`dependent_dtl`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`dependent_dtl`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`dependent_dtl`.`IS_DELETED` AS `IS_DELETED` from `dependent_dtl` */;

--
-- Final view structure for view `parent_education_vw`
--

/*!50001 DROP VIEW IF EXISTS `parent_education_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `parent_education_vw` AS select `emp_education`.`ID` AS `id`,`emp_education`.`EMP_ID` AS `employee_id`,(select concat(`emp_mst`.`EMP_NAME`,' ',`emp_mst`.`EMPLST_NM`) from `emp_mst` where (`emp_mst`.`EMP_ID` = `employee_id`)) AS `EMP_NM`,`emp_education`.`EDU_QUAL_ID` AS `edu_qual_id`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `emp_education`.`EDU_QUAL_ID`)) AS `EMP_GRADE`,`emp_education`.`INSTITUTE` AS `institute`,`emp_education`.`EDUCATION_QUALIFICATION` AS `EDUCATION_QUALIFICATION`,`emp_education`.`EDUCATION_COURSE_TYPE` AS `EDUCATION_COURSE_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `emp_education`.`EDUCATION_COURSE_TYPE`)) AS `EDUCATION_COURSE_TYPE_NM`,`emp_education`.`MAJOR` AS `major`,`emp_education`.`YEAR` AS `year`,`emp_education`.`SCORE` AS `score`,`emp_education`.`START_DATE` AS `start_date`,`emp_education`.`END_DATE` AS `end_date`,`emp_education`.`EMP_ID` AS `EMP_ID`,`emp_education`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`emp_education`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`emp_education`.`CREATED_ON` AS `CREATED_ON`,`emp_education`.`UPDATED_ON` AS `UPDATED_ON`,`emp_education`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`emp_education`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`emp_education`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`emp_education`.`IS_DELETED` AS `IS_DELETED` from `emp_education` */;

--
-- Final view structure for view `parent_emergency_contact_dtl_vw`
--

/*!50001 DROP VIEW IF EXISTS `parent_emergency_contact_dtl_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `parent_emergency_contact_dtl_vw` AS select `emergency_contact_dtl`.`EMERGENCY_CONTACT_DTL_ID` AS `EMERGENCY_CONTACT_DTL_ID`,`emergency_contact_dtl`.`EMP_ID` AS `EMPLOYEE_ID`,(select concat(`emp_mst`.`EMP_NAME`,' ',`emp_mst`.`EMPLST_NM`) from `emp_mst` where (`emp_mst`.`EMP_ID` = `EMPLOYEE_ID`)) AS `EMP_NAME`,`emergency_contact_dtl`.`EMERG_CONTACT_ID` AS `EMERG_CONTACT_ID`,(select `oa_contacts_vw`.`CNTCT_FULL_NM` from `oa_contacts_vw` where (`oa_contacts_vw`.`OA_CNTCTS_ID` = `emergency_contact_dtl`.`EMERG_CONTACT_ID`)) AS `EMRG_CNTCT_NM`,(select `oa_contacts`.`OA_CNTCTS_ID` from `oa_contacts` where (`oa_contacts`.`OA_CNTCTS_ID` = `emergency_contact_dtl`.`EMERG_CONTACT_ID`)) AS `OA_CNTCTS_ID`,(select `contact_mst`.`CNTCT_FRST_NM` from `contact_mst` where (`contact_mst`.`CNTCT_ID` = `OA_CNTCTS_ID`)) AS `CNTCT_EMERG_NO`,`emergency_contact_dtl`.`EMERG_CONTACT_RELATION_TYPE_ID` AS `EMERG_CONTACT_RELATION_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `emergency_contact_dtl`.`EMERG_CONTACT_RELATION_TYPE_ID`)) AS `EMERG_CONTACT_RELATION_TYPE_NM`,(select concat((select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `emergency_contact_dtl`.`TEL_COUNTRY_CODE`)),'              ',`emergency_contact_dtl`.`EMERG_CONTACT_TEL_ID`)) AS `EMERG_CONTACT_TEL_ID`,(select concat((select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `emergency_contact_dtl`.`MOBILE_COUNTRY_CODE`)),' ',`emergency_contact_dtl`.`EMERG_CONTACT_MOBILE_ID`)) AS `EMERG_CONTACT_MOBILE_ID`,(select concat((select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `emergency_contact_dtl`.`OFFICE_COUNTRY_CODE`)),' ',`emergency_contact_dtl`.`EMERG_CONTACT_OFFNO_ID`)) AS `EMERG_CONTACT_OFFNO_ID`,(select `phone_nbr_mst`.`PHONE_NBR` from `phone_nbr_mst` where (`phone_nbr_mst`.`PHONE_NBR_ID` = (select `contact_phones`.`PHONE_NBR_ID` from `contact_phones` where (`contact_phones`.`CNTCT_PHONE_ID` = (select `oa_contact_phones`.`CNTCT_PHONE_ID` from `oa_contact_phones` where (`oa_contact_phones`.`OA_CNTCT_PHONE_ID` = `emergency_contact_dtl`.`EMERG_CONTACT_MOBILE_ID`)))))) AS `PHONE_NBR`,(select `phone_nbr_mst`.`PHONE_NBR` from `phone_nbr_mst` where (`phone_nbr_mst`.`PHONE_NBR_ID` = (select `contact_phones`.`PHONE_NBR_ID` from `contact_phones` where (`contact_phones`.`CNTCT_PHONE_ID` = (select `oa_contact_phones`.`CNTCT_PHONE_ID` from `oa_contact_phones` where (`oa_contact_phones`.`OA_CNTCT_PHONE_ID` = `emergency_contact_dtl`.`EMERG_CONTACT_TEL_ID`)))))) AS `TEL_NBR`,(select `phone_nbr_mst`.`PHONE_NBR` from `phone_nbr_mst` where (`phone_nbr_mst`.`PHONE_NBR_ID` = (select `contact_phones`.`PHONE_NBR_ID` from `contact_phones` where (`contact_phones`.`CNTCT_PHONE_ID` = (select `oa_contact_phones`.`CNTCT_PHONE_ID` from `oa_contact_phones` where (`oa_contact_phones`.`OA_CNTCT_PHONE_ID` = `emergency_contact_dtl`.`EMERG_CONTACT_OFFNO_ID`)))))) AS `OFFICE_NBR`,(select concat((select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `emergency_contact_dtl`.`MOBILE_COUNTRY_CODE`)),' ',`PHONE_NBR`)) AS `FULL_PHONE_NBR`,(select concat((select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `emergency_contact_dtl`.`OFFICE_COUNTRY_CODE`)),' ',`OFFICE_NBR`)) AS `FULL_OFFICE_NBR`,(select concat((select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `emergency_contact_dtl`.`TEL_COUNTRY_CODE`)),' ',`TEL_NBR`)) AS `FULL_TEL_NBR`,`emergency_contact_dtl`.`EMERG_CONTACT_EMAIL_ID` AS `EMERG_CONTACT_EMAIL_ID`,`emergency_contact_dtl`.`EMP_ID` AS `EMP_ID`,(select `oa_contact_emails`.`CNTCT_EML_ID` from `oa_contact_emails` where (`oa_contact_emails`.`OA_CNTCT_EML_ID` = `emergency_contact_dtl`.`EMERG_CONTACT_EMAIL_ID`)) AS `CNTCT_EMAILS`,(select `contact_emails`.`EMAIL_ADD_ID` from `contact_emails` where (`contact_emails`.`CNTCT_EML_ID` = `CNTCT_EMAILS`)) AS `CNTCT_EML`,(select `email_address_mst`.`EMAIL_ADD` from `email_address_mst` where (`email_address_mst`.`EMAIL_ADD_ID` = `CNTCT_EML`)) AS `EMAIL_ID`,`emergency_contact_dtl`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`emergency_contact_dtl`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`emergency_contact_dtl`.`CREATED_ON` AS `CREATED_ON`,`emergency_contact_dtl`.`UPDATED_ON` AS `UPDATED_ON`,`emergency_contact_dtl`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`emergency_contact_dtl`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`emergency_contact_dtl`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`emergency_contact_dtl`.`IS_DELETED` AS `IS_DELETED` from `emergency_contact_dtl` */;

--
-- Final view structure for view `parent_hub_vw`
--

/*!50001 DROP VIEW IF EXISTS `parent_hub_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `parent_hub_vw` AS select `em`.`EMP_ID` AS `EMP_ID`,`em`.`EMP_NBR` AS `EMP_NBR`,`em`.`EMP_NAME` AS `EMP_NAME`,`em`.`EMP_MIDDLE_NM` AS `EMP_MIDDLE_NM`,`em`.`EMPLST_NM` AS `EMPLST_NM`,(select concat(ifnull(`em`.`EMP_NAME`,''),' ',ifnull(`em`.`EMP_MIDDLE_NM`,''),' ',ifnull(`em`.`EMPLST_NM`,''))) AS `EMP_FULL_NAME`,`em`.`EMP_INITIALS` AS `EMP_INITIALS`,if((`em`.`IS_MANAGER` = 1),'Yes','No') AS `IS_MANAGER`,`em`.`MANAGER_ID` AS `MANAGER_ID`,(select `emp_mst`.`EMP_NAME` from `emp_mst` where (`emp_mst`.`EMP_ID` = `em`.`MANAGER_ID`)) AS `MANAGER`,`em`.`HR_EXECUTIVE_ID` AS `HR_EXECUTIVE_ID`,`em`.`DOB` AS `DOB`,`em`.`GENDER_ID` AS `GENDER_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`GENDER_ID`)) AS `GENDER`,`em`.`MARITAL_STATUS_ID` AS `MARITAL_STATUS_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`MARITAL_STATUS_ID`)) AS `MARITAL_STATUS`,`em`.`CAST_ID` AS `CAST_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`CAST_ID`)) AS `CAST`,`em`.`RAISE_ID` AS `RAISE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`RAISE_ID`)) AS `RAISE`,`em`.`ETHINICITY_ID` AS `ETHINICITY_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`ETHINICITY_ID`)) AS `ETHINICITY`,`em`.`BLOOD_GRP` AS `BLOOD_GRP_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`BLOOD_GRP`)) AS `BLOOD_GRP_NM`,if((`em`.`IS_SMOKER` = 1),'Yes','No') AS `IS_SMOKER`,`em`.`OA_CNTCT_EML_ID` AS `OA_CNTCT_EML_ID`,(select `email_address_mst`.`EMAIL_ADD` from `email_address_mst` where (`email_address_mst`.`EMAIL_ADD_ID` = (select `contact_emails`.`EMAIL_ADD_ID` from `contact_emails` where (`contact_emails`.`CNTCT_EML_ID` = (select `oa_contact_emails`.`CNTCT_EML_ID` from `oa_contact_emails` where (`oa_contact_emails`.`OA_CNTCT_EML_ID` = `em`.`OA_CNTCT_EML_ID`)))))) AS `EMAIL_ADD`,`em`.`OA_CNTCT_PHONE_ID` AS `OA_CNTCT_PHONE_ID`,(select `phone_nbr_mst`.`PHONE_NBR` from `phone_nbr_mst` where (`phone_nbr_mst`.`PHONE_NBR_ID` = (select `contact_phones`.`PHONE_NBR_ID` from `contact_phones` where (`contact_phones`.`CNTCT_PHONE_ID` = (select `oa_contact_phones`.`CNTCT_PHONE_ID` from `oa_contact_phones` where (`oa_contact_phones`.`OA_CNTCT_PHONE_ID` = `em`.`OA_CNTCT_PHONE_ID`)))))) AS `PHONE_NBR`,(select concat((select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`COUNTRY_CODE`)),' ',`PHONE_NBR`)) AS `FULL_PHONE_NBR`,`em`.`EMP_SSN_NBR` AS `EMP_SSN_NBR`,`em`.`EMP_SIN_NBR` AS `EMP_SIN_NBR`,`em`.`EMP_PAN_NBR` AS `EMP_PAN_NBR`,`em`.`EMP_DRI_LICE_NBR` AS `EMP_DRI_LICE_NBR`,`em`.`EMP_DRI_LICE_EXP_DATE` AS `EMP_DRI_LICE_EXP_DATE`,if((`em`.`EMP_MILITARY_SERVICE` = 1),'Yes','No') AS `EMP_MILITARY_SERVICE`,`em`.`EMP_STATUS_ID` AS `EMP_STATUS_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `em`.`EMP_STATUS_ID`)) AS `EMP_STATUS`,`em`.`SKYPE_ID` AS `SKYPE_ID`,`em`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`em`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`em`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`em`.`IS_DELETED` AS `IS_DELETED` from (`emp_mst` `em` join `user_mst` `um` on((`em`.`REF_EMP_ID` = `um`.`USER_ID`))) where ((`em`.`IS_DELETED` = 0) and (`um`.`USER_TYP_ID` = (select `independent_mst`.`MSTR_ID` from `independent_mst` where (`independent_mst`.`MSTR_CD` = 'UCTPA')))) */;

--
-- Final view structure for view `parent_immigration_dtl_vw`
--

/*!50001 DROP VIEW IF EXISTS `parent_immigration_dtl_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `parent_immigration_dtl_vw` AS select `immigration_dtl`.`IMMIGRATION_ID` AS `IMMIGRATION_ID`,`immigration_dtl`.`EMP_ID` AS `EMPID`,(select concat(`emp_mst`.`EMP_NAME`,' ',`emp_mst`.`EMPLST_NM`) from `emp_mst` where (`emp_mst`.`EMP_ID` = `EMPID`)) AS `EMP_NAME`,`immigration_dtl`.`IMMIGRATION_TYP_ID` AS `IMMIGRATION_TYP_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `immigration_dtl`.`IMMIGRATION_TYP_ID`)) AS `IMMIGRATION_TYPE`,`immigration_dtl`.`IMMIGRATION_NO` AS `IMMIGRATION_NO`,`immigration_dtl`.`DATE_OF_ISSUE` AS `DATE_OF_ISSUE`,`immigration_dtl`.`DATE_OF_EXPIRY` AS `DATE_OF_EXPIRY`,`immigration_dtl`.`PROCESSING_COUNTRY_ID` AS `PROCESSING_COUNTRY_ID`,`immigration_dtl`.`EMP_ID` AS `EMP_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `immigration_dtl`.`PROCESSING_COUNTRY_ID`)) AS `PROCESSINGCOUNTRY_NM`,`immigration_dtl`.`IS_DELETED` AS `IS_DELETED`,`immigration_dtl`.`ISSUED_FOR` AS `ISSUED_FOR`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `immigration_dtl`.`ISSUED_FOR`)) AS `ISSUED_FOR_COUNTRY`,`immigration_dtl`.`DOCUMENT_TITLE` AS `DOCUMENT_TITLE`,`immigration_dtl`.`ISSUING_AUTHORITY` AS `ISSUING_AUTHORITY`,`immigration_dtl`.`ATTACHMENT_NAME` AS `ATTACHMENT_NAME`,`immigration_dtl`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`immigration_dtl`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where ((`oa_brands`.`OA_BRAND_ID` = `OABRANDID`) and (`oa_brands`.`OA_ID` = `OAID`))) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where ((`oa_brands`.`OA_BRAND_ID` = `OABRANDID`) and (`oa_brands`.`OA_ID` = `OAID`))) AS `OA_BRAND_NM`,`immigration_dtl`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`immigration_dtl`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`immigration_dtl`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`immigration_dtl`.`CREATEDON` AS `CREATED_ON`,`immigration_dtl`.`UPDATEDON` AS `UPDATED_ON` from `immigration_dtl` */;

--
-- Final view structure for view `parent_job_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `parent_job_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `parent_job_mst_vw` AS select `jm`.`JOB_ID` AS `JOB_ID`,`jm`.`EMP_ID` AS `EMPLOYEE_ID`,(select concat(`emp_mst`.`EMP_NAME`,' ',`emp_mst`.`EMPLST_NM`) from `emp_mst` where (`emp_mst`.`EMP_ID` = `jm`.`EMP_ID`)) AS `EMP_NM`,`jm`.`EMP_STATUS_ID` AS `EMPSTATUSID`,`jm`.`EMP_GROSS_SALARY` AS `EMP_GROSS_SALARY`,`jm`.`EMP_STATUS_ID` AS `EMP_STATUS_ID`,`jm`.`EMP_TYPE_ID` AS `EMP_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `EMPSTATUSID`)) AS `STATUS_NAME`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `jm`.`EMP_TYPE_ID`)) AS `TYPE_NAME`,`jm`.`EMP_CAT_ID` AS `EMP_CAT_ID`,`jm`.`DEPARTMENT_ID` AS `DEPARTMENT_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `jm`.`DEPARTMENT_ID`)) AS `DEPARTMENT_NAME`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `jm`.`DESIGNATION_ID`)) AS `DESIGNATION_NAME`,`jm`.`COST_CENTER` AS `COST_CENTER`,`jm`.`HOLIDAY_GRP_ID` AS `HOLIDAY_GRP_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `jm`.`HOLIDAY_GRP_ID`)) AS `HOLIDAY_GRP`,`jm`.`DESIGNATION_ID` AS `DESIGNATION_ID`,`jm`.`EMP_ID` AS `EMP_ID`,`jm`.`JOB_TITLE_ID` AS `JOB_TITLE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `jm`.`JOB_TITLE_ID`)) AS `JOB_TITLE`,`jm`.`JOB_CAT_ID` AS `JOB_CAT_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `jm`.`JOB_CAT_ID`)) AS `JOB_CATEGORY`,`jm`.`WORK_STATION` AS `WORK_STATION`,`jm`.`EMP_BAND_ID` AS `EMP_BAND_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `jm`.`EMP_BAND_ID`)) AS `EMP_BAND`,`jm`.`EMP_GRADE_ID` AS `EMP_GRADE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `jm`.`EMP_GRADE_ID`)) AS `EMP_GRADE`,`jm`.`POSITION_ID` AS `position_id`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `jm`.`POSITION_ID`)) AS `POSTION_NM`,`jm`.`CURRENCY_ID` AS `currency_id`,(select `currency_mst`.`CURR_NAME` from `currency_mst` where (`currency_mst`.`CURR_ID` = `jm`.`CURRENCY_ID`)) AS `CURRENCY_NM`,`jm`.`DATE_OF_JOINING` AS `DATE_OF_JOINING`,`jm`.`CREATED_BY` AS `Created_By_User_id`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `Created_By_User_id`)) AS `CREATED_BY_USER_NAME`,`jm`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`jm`.`CREATED_ON` AS `CREATED_ON`,`jm`.`UPDATED_ON` AS `UPDATED_ON`,`jm`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`jm`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`jm`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`jm`.`IS_DELETED` AS `IS_DELETED`,`jm`.`CONFIRMATION_DATE` AS `CONFIRMATION_DATE`,`jm`.`LAST_APPRAISAL_DATE` AS `LAST_APPRAISAL_DATE`,`jm`.`APPRAISAL_TYPE` AS `APPRAISAL_TYPE`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `jm`.`APPRAISAL_TYPE`)) AS `APPRAISAL_TYPE_NM`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `jm`.`WORK_LOCATION`)) AS `WORK_LOCATION`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD` from `job_mst` `jm` */;

--
-- Final view structure for view `parent_language_vw`
--

/*!50001 DROP VIEW IF EXISTS `parent_language_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `parent_language_vw` AS select `emp_language`.`EMP_LANGUAGE_ID` AS `EMP_LANGUAGE_ID`,`emp_language`.`EMP_ID` AS `EMPLOYEE_ID`,(select concat(`emp_mst`.`EMP_NAME`,' ',`emp_mst`.`EMPLST_NM`) from `emp_mst` where (`emp_mst`.`EMP_ID` = `EMPLOYEE_ID`)) AS `EMP_NM`,`emp_language`.`LANGUAGE_ID` AS `LANGUAGE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `emp_language`.`LANGUAGE_ID`)) AS `LANGUAGE`,`emp_language`.`LANGUAGE_FLUENCY_ID` AS `LANGUAGE_FLUENCY_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `emp_language`.`LANGUAGE_FLUENCY_ID`)) AS `LANGUAGE_FLUENCY`,`emp_language`.`LANGUAGE_COMPETENCY_ID` AS `LANGUAGE_COMPETENCY_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `emp_language`.`LANGUAGE_COMPETENCY_ID`)) AS `LANGUAGE_COMPETENCY`,`emp_language`.`COMMENTS` AS `COMMENTS`,`emp_language`.`EMP_ID` AS `EMP_ID`,`emp_language`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`emp_language`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`emp_language`.`CREATED_ON` AS `CREATED_ON`,`emp_language`.`UPDATED_ON` AS `UPDATED_ON`,`emp_language`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`emp_language`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`emp_language`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`emp_language`.`IS_DELETED` AS `IS_DELETED` from `emp_language` */;

--
-- Final view structure for view `parent_licence_vw`
--

/*!50001 DROP VIEW IF EXISTS `parent_licence_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `parent_licence_vw` AS select `emp_licence`.`LICENSE_ID` AS `LICENSE_ID`,`emp_licence`.`EMP_ID` AS `EMPLOYEE_ID`,`emp_licence`.`LIENCE_TYPE_ID` AS `LIENCE_TYPE_ID`,(select concat(`emp_mst`.`EMP_NAME`,' ',`emp_mst`.`EMPLST_NM`) from `emp_mst` where (`emp_mst`.`EMP_ID` = `EMPLOYEE_ID`)) AS `EMP_NAME`,`emp_licence`.`LICENSE_NM_ID` AS `LICENSE_NM_ID`,`emp_licence`.`LIENCE_TYPE_ID` AS `LICENSE_TYP_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `emp_licence`.`LIENCE_TYPE_ID`)) AS `LICENSE_TYP_NM`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `emp_licence`.`LICENSE_NM_ID`)) AS `LICENSE__NAME`,`emp_licence`.`LICENSE_NO` AS `LICENSE_NO`,`emp_licence`.`LICENSE_ISSUED_DATE` AS `LICENSE_ISSUED_DATE`,`emp_licence`.`LICENSE_EXPIRY_DATE` AS `LICENSE_EXPIRY_DATE`,`emp_licence`.`EMP_ID` AS `EMP_ID`,`emp_licence`.`CREATED_BY` AS `Created_By_User_id`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `Created_By_User_id`)) AS `CREATED_BY_USER_NAME`,`emp_licence`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`emp_licence`.`CREATED_ON` AS `CREATED_ON`,`emp_licence`.`UPDATED_ON` AS `UPDATED_ON`,`emp_licence`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`emp_licence`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`emp_licence`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`emp_licence`.`IS_DELETED` AS `IS_DELETED` from `emp_licence` */;

--
-- Final view structure for view `parent_member_attachment_vw`
--

/*!50001 DROP VIEW IF EXISTS `parent_member_attachment_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `parent_member_attachment_vw` AS select `member_attachment`.`ID` AS `ID`,`member_attachment`.`FILENAME` AS `FILENAME`,`member_attachment`.`IMAGENAME` AS `IMAGENAME`,`member_attachment`.`TYPE` AS `TYPE`,`member_attachment`.`LINKED_MASTER_DOC_TYPE_ID` AS `LINKED_MASTER_DOC_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `member_attachment`.`LINKED_MASTER_DOC_TYPE_ID`)) AS `LINKED_MASTER_DOC_TYPE`,`member_attachment`.`LINKED_SYSTEM_ENTITY_TYPE_ID` AS `LINKED_SYSTEM_ENTITY_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `member_attachment`.`LINKED_SYSTEM_ENTITY_TYPE_ID`)) AS `LINKED_SYSTEM_ENTITY_TYPE`,`member_attachment`.`IS_PUBLIC` AS `IS_PUBLIC`,`member_attachment`.`USER_GROUP_ID` AS `USER_GROUP_ID`,`member_attachment`.`USER_GROUP_ID` AS `USERGROUPID`,(select `user_group`.`USER_GRP_NM` from `user_group` where (`user_group`.`USER_GRP_ID` = `USERGROUPID`)) AS `USER_GROUP`,`member_attachment`.`DOC_CATEGORY_ID` AS `DOC_CATEGORY_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `member_attachment`.`DOC_CATEGORY_ID`)) AS `DOC_CATEGORY`,`member_attachment`.`DOC_SUB_CATEGORY_ID` AS `DOC_SUB_CATEGORY_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `member_attachment`.`DOC_SUB_CATEGORY_ID`)) AS `DOC_SUB_CATEGORY`,`member_attachment`.`DOC_TYPE_ID` AS `DOC_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `member_attachment`.`DOC_TYPE_ID`)) AS `DOC_TYPE`,`member_attachment`.`DOC_STATUS_ID` AS `DOC_STATUS_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `member_attachment`.`DOC_STATUS_ID`)) AS `DOC_STATUS`,`member_attachment`.`IS_DELETED` AS `IS_DELETED`,`member_attachment`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`member_attachment`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`member_attachment`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`member_attachment`.`CREATED_BY` AS `CREATED_BY`,`member_attachment`.`CREATED_ON` AS `CREATED_ON`,`member_attachment`.`UPDATED_BY` AS `UPDATED_BY`,`member_attachment`.`UPDATED_ON` AS `UPDATED_ON` from `member_attachment` */;

--
-- Final view structure for view `parent_membership_vw`
--

/*!50001 DROP VIEW IF EXISTS `parent_membership_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `parent_membership_vw` AS select `membership`.`MEMBERSHIP_ID` AS `MEMBERSHIP_ID`,`membership`.`EMP_ID` AS `EMP_ID`,(select `emp_mst_vw`.`EMP_FULL_NAME` from `emp_mst_vw` where (`emp_mst_vw`.`EMP_ID` = `membership`.`EMP_ID`)) AS `EMP_FULL_NAME`,`membership`.`MEMBERSHIP` AS `MEMBERSHIP`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `membership`.`MEMBERSHIP`)) AS `MEMBERSHIP_NM`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `membership`.`MEMBERSHIP_FR`)) AS `MEMBERSHIP_FR`,`membership`.`SUBSCRIPTION_PAID_BY` AS `SUBSCRIPTION_PAID_BY`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `membership`.`SUBSCRIPTION_PAID_BY`)) AS `SUBSCRIPTION_PAID_BY_NM`,`membership`.`SUBSCRIPTION_AMOUNT` AS `SUBSCRIPTION_AMOUNT`,`membership`.`CURRENCY_ID` AS `CURRENCY_ID`,(select `currency_mst`.`CURR_NAME` from `currency_mst` where (`currency_mst`.`CURR_ID` = `membership`.`CURRENCY_ID`)) AS `CURRENCY`,`membership`.`SUBSCRIPTION_COMMENCE_DATE` AS `SUBSCRIPTION_COMMENCE_DATE`,`membership`.`SUBSCRIPTION_REVEWAL_DATE` AS `SUBSCRIPTION_REVEWAL_DATE`,`membership`.`PROFILE_SUMMARY` AS `PROFILE_SUMMARY`,`membership`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`membership`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`membership`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`membership`.`IS_DELETED` AS `IS_DELETED`,`membership`.`CREATED_ON` AS `CREATED_ON`,`membership`.`UPDATED_ON` AS `UPDATED_ON`,`membership`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`membership`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME` from `membership` */;

--
-- Final view structure for view `parent_oa_contact_phones_vw`
--

/*!50001 DROP VIEW IF EXISTS `parent_oa_contact_phones_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `parent_oa_contact_phones_vw` AS select `oa_contact_phones`.`OA_CNTCT_PHONE_ID` AS `OA_CNTCT_PHONE_ID`,(select `emp_mst_vw`.`EMP_FULL_NAME` from `emp_mst_vw` where (`emp_mst_vw`.`EMP_ID` = `oa_contact_phones`.`EMP_ID`)) AS `EMP_FULL_NAME`,(select `contact_phones`.`PHONE_NBR_ID` from `contact_phones` where (`contact_phones`.`CNTCT_PHONE_ID` = `oa_contact_phones`.`CNTCT_PHONE_ID`)) AS `CNTCTID`,`oa_contact_phones`.`CNTCT_PHONE_ID` AS `CNTCT_PHONE_ID`,`oa_contact_phones`.`COUNTRY_CODE` AS `COUNTRY_CODE`,(select `phone_nbr_mst`.`PHONE_NBR` from `phone_nbr_mst` where (`phone_nbr_mst`.`PHONE_NBR_ID` = `CNTCTID`)) AS `CNTCT_OFFICE_NBR`,(select concat((select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `oa_contact_phones`.`COUNTRY_CODE`)),' ',`CNTCT_OFFICE_NBR`)) AS `OA_ACCT_CNTCT_PHONE_ID`,if((`oa_contact_phones`.`IS_PRIMARY` = 1),'Yes','No') AS `Is_Primary`,`oa_contact_phones`.`EMP_ID` AS `EMP_ID`,`oa_contact_phones`.`IS_DELETED` AS `IS_DELETED`,`oa_contact_phones`.`IS_EMP` AS `IS_EMP`,`oa_contact_phones`.`OA_CNTCT_ID` AS `OA_CNTCT_ID`,(select `oa_contacts`.`CNTCT_ID` from `oa_contacts` where (`oa_contacts`.`OA_CNTCTS_ID` = `oa_contact_phones`.`OA_CNTCT_ID`)) AS `OACNTCT_ID`,(select `contact_mst`.`CNTCT_FRST_NM` from `contact_mst` where (`contact_mst`.`CNTCT_ID` = `OACNTCT_ID`)) AS `CNTCT_NM`,`oa_contact_phones`.`OA_ID` AS `ORG_ACC_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `ORG_ACC_ID`)) AS `OA_NM`,`oa_contact_phones`.`OA_BRAND_ID` AS `BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `BRAND_ID`)) AS `OA_BRAND_NM`,`oa_contact_phones`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`oa_contact_phones`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`oa_contact_phones`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`oa_contact_phones`.`CREATED_ON` AS `Created_On`,`oa_contact_phones`.`UPDATED_ON` AS `Updated_On` from `oa_contact_phones` where (`oa_contact_phones`.`IS_EMP` = 1) */;

--
-- Final view structure for view `parent_picture_vw`
--

/*!50001 DROP VIEW IF EXISTS `parent_picture_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `parent_picture_vw` AS select `emp_picture`.`EMP_PICYURE_ID` AS `EMP_PICYURE_ID`,`emp_picture`.`EMP_ID` AS `EMPLOYEE_ID`,(select concat(`emp_mst`.`EMP_NAME`,' ',`emp_mst`.`EMPLST_NM`) from `emp_mst` where (`emp_mst`.`EMP_ID` = `EMPLOYEE_ID`)) AS `EMP_NAME`,`emp_picture`.`EPIC_PICTURE` AS `EPIC_PICTURE`,`emp_picture`.`EPIC_FILENAME` AS `EPIC_FILENAME`,`emp_picture`.`EPIC_TYPE` AS `EPIC_TYPE`,`emp_picture`.`EPIC_FILE_SIZE` AS `EPIC_FILE_SIZE`,`emp_picture`.`EPIC_FILE_WIDTH` AS `EPIC_FILE_WIDTH`,`emp_picture`.`EPIC_FILE_HEIGHT` AS `EPIC_FILE_HEIGHT`,`emp_picture`.`EMP_ID` AS `EMP_ID`,`emp_picture`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`emp_picture`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`emp_picture`.`CREATED_ON` AS `CREATED_ON`,`emp_picture`.`UPDATED_ON` AS `UPDATED_ON`,`emp_picture`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`emp_picture`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`emp_picture`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`emp_picture`.`IS_DELETED` AS `IS_DELETED` from `emp_picture` */;

--
-- Final view structure for view `parent_reporting_locations_vw`
--

/*!50001 DROP VIEW IF EXISTS `parent_reporting_locations_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `parent_reporting_locations_vw` AS select `emp_reporting_locations`.`EMP_REPORTING_LOCATIONS_ID` AS `EMP_REPORTING_LOCATIONS_ID`,`emp_reporting_locations`.`EMP_ID` AS `EMPLOYEE_ID`,(select concat(`emp_mst`.`EMP_NAME`,' ',ifnull(`emp_mst`.`EMPLST_NM`,'')) from `emp_mst` where (`emp_mst`.`EMP_ID` = `EMPLOYEE_ID`)) AS `EMP_NAME`,`emp_reporting_locations`.`LOCATION_ID` AS `LOCATION_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `emp_reporting_locations`.`LOCATION_ID`)) AS `LOCATION`,`emp_reporting_locations`.`EMP_ID` AS `EMP_ID`,if((`emp_reporting_locations`.`IS_PRIMARY` = 1),'Yes','No') AS `IS_PRIMARY`,`emp_reporting_locations`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`emp_reporting_locations`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`emp_reporting_locations`.`CREATED_ON` AS `CREATED_ON`,`emp_reporting_locations`.`UPDATED_ON` AS `UPDATED_ON`,`emp_reporting_locations`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`emp_reporting_locations`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`emp_reporting_locations`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`emp_reporting_locations`.`IS_DELETED` AS `IS_DELETED` from `emp_reporting_locations` */;

--
-- Final view structure for view `parent_reporting_vw`
--

/*!50001 DROP VIEW IF EXISTS `parent_reporting_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `parent_reporting_vw` AS select `emp_reporting`.`EMP_REPORTING_ID` AS `EMP_REPORTING_ID`,`emp_reporting`.`EMP_ID` AS `EMPLOYEE_ID`,(select concat(`emp_mst`.`EMP_NAME`,' ',`emp_mst`.`EMPLST_NM`) from `emp_mst` where (`emp_mst`.`EMP_ID` = `EMPLOYEE_ID`)) AS `EMP_NAME`,`emp_reporting`.`MANAGER_ID` AS `MANAGER_ID`,(select `emp_mst`.`EMP_NAME` from `emp_mst` where (`emp_mst`.`EMP_ID` = `emp_reporting`.`MANAGER_ID`)) AS `MANAGER_NAME`,`emp_reporting`.`MANAGER_TYPE_ID` AS `MANAGER_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `emp_reporting`.`MANAGER_TYPE_ID`)) AS `MANAGER_TYPE`,`emp_reporting`.`REPORTING_MODE_ID` AS `REPORTING_MODE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `emp_reporting`.`REPORTING_MODE_ID`)) AS `REPORTING_MODE`,`emp_reporting`.`EMP_ID` AS `EMP_ID`,`emp_reporting`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`emp_reporting`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`emp_reporting`.`CREATED_ON` AS `CREATED_ON`,`emp_reporting`.`UPDATED_ON` AS `UPDATED_ON`,`emp_reporting`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`emp_reporting`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`emp_reporting`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`emp_reporting`.`IS_DELETED` AS `IS_DELETED` from `emp_reporting` */;

--
-- Final view structure for view `parent_termination_dtl_vw`
--

/*!50001 DROP VIEW IF EXISTS `parent_termination_dtl_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `parent_termination_dtl_vw` AS select `emp_termination_dtl`.`TERMINATION_ID` AS `TERMINATION_ID`,`emp_termination_dtl`.`EMP_ID` AS `EMP_ID`,`emp_termination_dtl`.`EMP_ID` AS `EMPID`,(select `emp_mst`.`EMP_NAME` from `emp_mst` where (`emp_mst`.`EMP_ID` = `EMPID`)) AS `EMP_NM`,`emp_termination_dtl`.`EMP_TERMINATION_ID` AS `EMP_TERMINATION_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `emp_termination_dtl`.`EMP_TERMINATION_ID`)) AS `EMP_TERMINATION`,`emp_termination_dtl`.`TERMINATION_DATE` AS `TERMINATION_DATE`,`emp_termination_dtl`.`RESIGNED_ON` AS `RESIGNED_ON`,`emp_termination_dtl`.`RESIGNATION_ACCEPTED_ON` AS `RESIGNATION_ACCEPTED_ON`,`emp_termination_dtl`.`RETENTION_DATE` AS `RETENTION_DATE`,`emp_termination_dtl`.`IS_DELETED` AS `IS_DELETED`,`emp_termination_dtl`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`emp_termination_dtl`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`emp_termination_dtl`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`emp_termination_dtl`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`emp_termination_dtl`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NAME`,`emp_termination_dtl`.`CREATED_ON` AS `CREATED_ON`,`emp_termination_dtl`.`UPDATED_ON` AS `UPDATED_ON` from `emp_termination_dtl` */;

--
-- Final view structure for view `parent_work_experience_vw`
--

/*!50001 DROP VIEW IF EXISTS `parent_work_experience_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `parent_work_experience_vw` AS select `emp_work_experience`.`EMP_WORK_EXPERIENCE_ID` AS `EMP_WORK_EXPERIENCE_ID`,`emp_work_experience`.`EMP_ID` AS `EMPLOYEE_ID`,(select concat(`emp_mst`.`EMP_NAME`,' ',`emp_mst`.`EMPLST_NM`) from `emp_mst` where (`emp_mst`.`EMP_ID` = `EMPLOYEE_ID`)) AS `EMP_NAME`,`emp_work_experience`.`EEXP_SEQNO` AS `EEXP_SEQNO`,`emp_work_experience`.`EEXP_EMPLOYER` AS `EEXP_EMPLOYER`,`emp_work_experience`.`JOB_TITLE_ID` AS `JOB_TITLE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `emp_work_experience`.`JOB_TITLE_ID`)) AS `JOB_TITLE`,`emp_work_experience`.`JOBTITLE` AS `JOBTITLE`,cast(`emp_work_experience`.`EEXP_FROM_DATE` as date) AS `EEXP_FROM_DATE`,cast(`emp_work_experience`.`EEXP_TO_DATE` as date) AS `EEXP_TO_DATE`,`emp_work_experience`.`EEXP_COMMENTS` AS `EEXP_COMMENTS`,if((`emp_work_experience`.`EEXP_INTERNAL` = 1),'Yes','No') AS `EEXP_INTERNAL`,`emp_work_experience`.`EMP_ID` AS `EMP_ID`,`emp_work_experience`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`emp_work_experience`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`emp_work_experience`.`CREATED_ON` AS `CREATED_ON`,`emp_work_experience`.`UPDATED_ON` AS `UPDATED_ON`,`emp_work_experience`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`emp_work_experience`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`emp_work_experience`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`emp_work_experience`.`IS_DELETED` AS `IS_DELETED` from `emp_work_experience` */;

--
-- Final view structure for view `parent_work_shift_vw`
--

/*!50001 DROP VIEW IF EXISTS `parent_work_shift_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `parent_work_shift_vw` AS select `emp_work_shift`.`EMP_WORK_SHIFT_ID` AS `EMP_WORK_SHIFT_ID`,`emp_work_shift`.`WORK_SHIFT_ID` AS `WORK_SHIFT_ID`,(select `shift_mst`.`NAME` from `shift_mst` where (`shift_mst`.`SHIFT_ID` = `emp_work_shift`.`WORK_SHIFT_ID`)) AS `WORK_SHIFT`,`emp_work_shift`.`EMP_NUMBER` AS `EMP_NUMBER`,(select `emp_mst`.`EMP_NAME` from `emp_mst` where (`emp_mst`.`EMP_ID` = `emp_work_shift`.`EMP_NUMBER`)) AS `EMP_NAME`,`emp_work_shift`.`PREV_WORK_SHIFT_ID` AS `PREV_WORK_SHIFT_ID`,`emp_work_shift`.`NEXT_WORK_SHIFT_ID` AS `NEXT_WORK_SHIFT_ID`,`emp_work_shift`.`EFFECTIVE_ON` AS `EFFECTIVE_ON`,`emp_work_shift`.`EFFECTIVE_TO` AS `EFFECTIVE_TO`,`emp_work_shift`.`CURR_PUNCH_IN_TIME` AS `CURR_PUNCH_IN_TIME`,`emp_work_shift`.`SHIFT_TYPE_ID` AS `SHIFT_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `emp_work_shift`.`SHIFT_TYPE_ID`)) AS `SHIFT_TYPE`,`emp_work_shift`.`NO_OF_DAYS` AS `NO_OF_DAYS`,`emp_work_shift`.`START_DATE` AS `START_DATE`,`emp_work_shift`.`END_DATE` AS `END_DATE`,`emp_work_shift`.`SHIFT_CALENDAR_ID` AS `SHIFT_CALENDAR_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `emp_work_shift`.`SHIFT_CALENDAR_ID`)) AS `SHIFT_CALENDAR`,`emp_work_shift`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`emp_work_shift`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`emp_work_shift`.`CREATED_ON` AS `CREATED_ON`,`emp_work_shift`.`UPDATED_ON` AS `UPDATED_ON`,`emp_work_shift`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`emp_work_shift`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`emp_work_shift`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`emp_work_shift`.`IS_DELETED` AS `IS_DELETED` from `emp_work_shift` */;

--
-- Final view structure for view `partners_vw`
--

/*!50001 DROP VIEW IF EXISTS `partners_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `partners_vw` AS select `oa`.`OA_ID` AS `OA_ID`,`oa`.`OA_CD` AS `OA_CD`,`oa`.`OA_NM` AS `OA_NM`,`um`.`USER_TYP_ID` AS `USER_TYP_ID`,`oa`.`OA_EMAIL` AS `OA_EMAIL`,`oa`.`OA_WEB_DOMAIN` AS `OA_WEB_DOMAIN`,`oa`.`OA_CONTACT_NO` AS `OA_CONTACT_NO`,`oa`.`OA_ADDRESS` AS `OA_ADDRESS`,`oa`.`PARTNER_ID` AS `PARTNER_ID`,`oa`.`OA_STATUS_ID` AS `OA_STATUS_ID`,`oa`.`IS_DELETED` AS `IS_DELETED`,`oa`.`CREATED_ON` AS `CREATED_ON`,`oa`.`UPDATED_ON` AS `UPDATED_ON`,`oa`.`CREATED_BY` AS `CREATED_BY`,`oa`.`UPDATED_BY` AS `UPDATED_BY` from (`user_mst` `um` join `org_accounts` `oa` on((`oa`.`OA_ID` = `um`.`OA_ID`))) where (`um`.`USER_TYP_ID` is not null) */;

--
-- Final view structure for view `party_master_vw`
--

/*!50001 DROP VIEW IF EXISTS `party_master_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `party_master_vw` AS select `party_master`.`PERTY_ID` AS `PERTY_ID`,`party_master`.`PARTY_CODE` AS `PARTY_CODE`,`party_master`.`PARTY_NAME` AS `PARTY_NAME`,`party_master`.`CONTACT_PERSON` AS `CONTACT_PERSON`,`party_master`.`PARTY_PREFIX` AS `PARTY_PREFIX`,`party_master`.`EMAIL` AS `EMAIL`,`party_master`.`SECONDARY_EMAIL` AS `SECONDARY_EMAIL`,`party_master`.`PARTY_DEPARTMENT` AS `PARTY_DEPARTMENT`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`party_master`.`PARTY_DEPARTMENT` = `independent_mst`.`MSTR_ID`)) AS `DEPARTMENT`,`party_master`.`ADDRESS_1` AS `ADDRESS_1`,`party_master`.`ADDRESS_2` AS `ADDRESS_2`,`party_master`.`POSTCODE` AS `POSTCODE`,`party_master`.`CITY` AS `CITY`,`party_master`.`COUNTRY` AS `COUNTRY`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`party_master`.`COUNTRY` = `independent_mst`.`MSTR_ID`)) AS `COUNTRY_NM`,`party_master`.`TELEPHONE` AS `TELEPHONE`,`party_master`.`PARTY_TYPE` AS `PARTY_TYPE`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`party_master`.`PARTY_TYPE` = `independent_mst`.`MSTR_ID`)) AS `PARTY_TYPE_NM`,`party_master`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `OAID`)) AS `OA_NM`,`party_master`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `OABRANDID`)) AS `OA_BRAND_NM`,`party_master`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`party_master`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `CREATED_BY_USER_ID`)) AS `CREATED_BY_USER_NAME`,`party_master`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `UPDATED_BY_USER_ID`)) AS `UPDATED_BY_USER_NAME`,`party_master`.`CREATED_ON` AS `CREATED_ON`,`party_master`.`UPDATED_ON` AS `UPDATED_ON`,`party_master`.`IS_DELETED` AS `IS_DELETED` from `party_master` */;
