
--
-- Final view structure for view `past_illness_new_vw`
--

/*!50001 DROP VIEW IF EXISTS `past_illness_new_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `past_illness_new_vw` AS select `past_illness_new`.`PAST_ILL_ID` AS `PAST_ILL_ID`,`past_illness_new`.`PATIENT_ID` AS `PATIENT_ID`,(select coalesce(`personal_information`.`FIRST_NAME`,`personal_information`.`LAST_NAME`) from `personal_information` where (`personal_information`.`PATIENT_ID` = `past_illness_new`.`PATIENT_ID`)) AS `PATIENT_NAME`,`past_illness_new`.`HEADACHE` AS `HEADACHE`,`past_illness_new`.`HEADACHE_COMMENT` AS `HEADACHE_COMMENT`,`past_illness_new`.`DEPRESSION` AS `DEPRESSION`,`past_illness_new`.`DEPRESSION_COMMENT` AS `DEPRESSION_COMMENT`,`past_illness_new`.`UTI_HISTORY` AS `UTI_HISTORY`,`past_illness_new`.`UTI_HISTORY_COMMENT` AS `UTI_HISTORY_COMMENT`,`past_illness_new`.`THYROID_DISORDERD` AS `THYROID_DISORDERD`,`past_illness_new`.`THYROID_DISORDERD_COMMENT` AS `THYROID_DISORDERD_COMMENT`,`past_illness_new`.`AUTO_IMMUNE_DISORDERS` AS `AUTO_IMMUNE_DISORDERS`,`past_illness_new`.`AUTO_IMMUNE_DISORDERS_COMMENT` AS `AUTO_IMMUNE_DISORDERS_COMMENT`,`past_illness_new`.`KIDNEY_DISEASE` AS `KIDNEY_DISEASE`,`past_illness_new`.`KIDNEY_DISEASE_COMMENT` AS `KIDNEY_DISEASE_COMMENT`,`past_illness_new`.`GI_DISORDERS` AS `GI_DISORDERS`,`past_illness_new`.`GI_DISORDERS_COMMENT` AS `GI_DISORDERS_COMMENT`,`past_illness_new`.`ANOREXIA` AS `ANOREXIA`,`past_illness_new`.`ANOREXIA_COMMENT` AS `ANOREXIA_COMMENT`,`past_illness_new`.`SEASONAL_ALLERGIES` AS `SEASONAL_ALLERGIES`,`past_illness_new`.`SEASONAL_ALLERGIES_COMMENT` AS `SEASONAL_ALLERGIES_COMMENT`,`past_illness_new`.`HYPO_THYROID` AS `HYPO_THYROID`,`past_illness_new`.`HYPO_THYROID_COMMENT` AS `HYPO_THYROID_COMMENT`,`past_illness_new`.`HTN` AS `HTN`,`past_illness_new`.`HTN_COMMENT` AS `HTN_COMMENT`,`past_illness_new`.`ENDOMETRIOSIS` AS `ENDOMETRIOSIS`,`past_illness_new`.`ENDOMETRIOSIS_COMMENT` AS `ENDOMETRIOSIS_COMMENT`,`past_illness_new`.`H0_BLOOD_TRANSFUSION` AS `H0_BLOOD_TRANSFUSION`,`past_illness_new`.`H0_BLOOD_TRANSFUSION_COMMENT` AS `H0_BLOOD_TRANSFUSION_COMMENT`,`past_illness_new`.`PSORIASIS` AS `PSORIASIS`,`past_illness_new`.`PSORIASIS_COMMENT` AS `PSORIASIS_COMMENT`,`past_illness_new`.`ARTHRITIS` AS `ARTHRITIS`,`past_illness_new`.`ARTHRITIS_COMMENT` AS `ARTHRITIS_COMMENT`,`past_illness_new`.`SLEEP_APNEA` AS `SLEEP_APNEA`,`past_illness_new`.`SLEEP_APNEA_COMMENT` AS `SLEEP_APNEA_COMMENT`,`past_illness_new`.`MVP` AS `MVP`,`past_illness_new`.`MVP_COMMENT` AS `MVP_COMMENT`,`past_illness_new`.`GARDISIL_SERIES` AS `GARDISIL_SERIES`,`past_illness_new`.`GARDISIL_SERIES_COMMENT` AS `GARDISIL_SERIES_COMMENT`,`past_illness_new`.`HEART_MUMMUR` AS `HEART_MUMMUR`,`past_illness_new`.`HEART_MUMMUR_COMMENT` AS `HEART_MUMMUR_COMMENT`,`past_illness_new`.`CHRONIC_FATIGUE_SYNDROME` AS `CHRONIC_FATIGUE_SYNDROME`,`past_illness_new`.`CHRONIC_FATIGUE_SYNDROME_COMMENT` AS `CHRONIC_FATIGUE_SYNDROME_COMMENT`,`past_illness_new`.`FIBRIOD_UTERUS` AS `FIBRIOD_UTERUS`,`past_illness_new`.`FIBRIOD_UTERUS_COMMENT` AS `FIBRIOD_UTERUS_COMMENT`,`past_illness_new`.`CARDIOMYOPATHY` AS `CARDIOMYOPATHY`,`past_illness_new`.`CARDIOMYOPATHY_COMMENT` AS `CARDIOMYOPATHY_COMMENT`,`past_illness_new`.`ASTHMA` AS `ASTHMA`,`past_illness_new`.`ASTHMA_COMMENT` AS `ASTHMA_COMMENT`,`past_illness_new`.`DIABETIC` AS `DIABETIC`,`past_illness_new`.`DIABETIC_COMMENT` AS `DIABETIC_COMMENT`,`past_illness_new`.`MIGRAINES` AS `MIGRAINES`,`past_illness_new`.`MIGRAINES_COMMENT` AS `MIGRAINES_COMMENT`,`past_illness_new`.`THROAT_INFECTION` AS `THROAT_INFECTION`,`past_illness_new`.`THROAT_INFECTION_COMMENT` AS `THROAT_INFECTION_COMMENT`,`past_illness_new`.`FIBROCYSTIC_BREAST_DISEASE` AS `FIBROCYSTIC_BREAST_DISEASE`,`past_illness_new`.`FIBROCYSTIC_BREAST_DISEASE_COMMENT` AS `FIBROCYSTIC_BREAST_DISEASE_COMMENT`,`past_illness_new`.`URINARY_TRACT_INFECTION` AS `URINARY_TRACT_INFECTION`,`past_illness_new`.`URINARY_TRACT_INFECTION_COMMENT` AS `URINARY_TRACT_INFECTION_COMMENT`,`past_illness_new`.`COMMENTS` AS `COMMENTS`,`past_illness_new`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`past_illness_new`.`OA_ID` AS `OA_ID`,`past_illness_new`.`USER_ID` AS `USER_ID`,`past_illness_new`.`IS_DELETED` AS `IS_DELETED`,`past_illness_new`.`CREATED_ON` AS `CREATED_ON`,`past_illness_new`.`UPDATED_ON` AS `UPDATED_ON`,`past_illness_new`.`CREATED_BY` AS `CREATED_BY`,`past_illness_new`.`UPDATED_BY` AS `UPDATED_BY` from `past_illness_new` */;

--
-- Final view structure for view `pay_attendance_type_config_vw`
--

/*!50001 DROP VIEW IF EXISTS `pay_attendance_type_config_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `pay_attendance_type_config_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` = 311) */;

--
-- Final view structure for view `pay_benefit_calculation_method_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `pay_benefit_calculation_method_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `pay_benefit_calculation_method_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` = 307) */;

--
-- Final view structure for view `pay_calculation_day_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `pay_calculation_day_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `pay_calculation_day_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` = 279) */;

--
-- Final view structure for view `pay_compensation_type_category_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `pay_compensation_type_category_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `pay_compensation_type_category_mst_vw` AS select `oa_brand_settings_vw`.`OAB_SETTING_ID` AS `OAB_SETTING_ID`,`oa_brand_settings_vw`.`OABS_ATTRBUTE_ID` AS `OABS_ATTRBUTE_ID`,`oa_brand_settings_vw`.`COMPANY_ATTRIBUTE` AS `COMPANY_ATTRIBUTE`,`oa_brand_settings_vw`.`OABS_ATTRBUTE_CD` AS `OABS_ATTRBUTE_CD`,`oa_brand_settings_vw`.`OABS_ATTRBUTE_NM` AS `OABS_ATTRBUTE_NM`,`oa_brand_settings_vw`.`OABS_SETTING_VALUE_ID` AS `OABS_SETTING_VALUE_ID`,`oa_brand_settings_vw`.`OABS_SETTING_VALUE_CD` AS `OABS_SETTING_VALUE_CD`,`oa_brand_settings_vw`.`OABS_SETTING_VALUE_NM` AS `OABS_SETTING_VALUE_NM`,`oa_brand_settings_vw`.`OABS_SETTING_VALUE` AS `OABS_SETTING_VALUE`,`oa_brand_settings_vw`.`BRAND_ID` AS `BRAND_ID`,`oa_brand_settings_vw`.`OA_BRAND_CD` AS `OA_BRAND_CD`,`oa_brand_settings_vw`.`OA_BRAND_NM` AS `OA_BRAND_NM`,`oa_brand_settings_vw`.`DESCRIPTION` AS `DESCRIPTION`,`oa_brand_settings_vw`.`VALIDATION` AS `VALIDATION`,`oa_brand_settings_vw`.`IS_ACTIVE` AS `IS_ACTIVE`,`oa_brand_settings_vw`.`CREATED_BY_USER_ID` AS `CREATED_BY_USER_ID`,`oa_brand_settings_vw`.`CREATED_BY_USER_NAME` AS `CREATED_BY_USER_NAME`,`oa_brand_settings_vw`.`UPDATED_BY_USER_ID` AS `UPDATED_BY_USER_ID`,`oa_brand_settings_vw`.`UPDATED_BY_USER_NAME` AS `UPDATED_BY_USER_NAME`,`oa_brand_settings_vw`.`CREATED_ON` AS `CREATED_ON`,`oa_brand_settings_vw`.`UPDATED_ON` AS `UPDATED_ON`,`oa_brand_settings_vw`.`IS_DELETED` AS `IS_DELETED` from `oa_brand_settings_vw` where ((`oa_brand_settings_vw`.`OABS_ATTRBUTE_ID` = 2140) or (`oa_brand_settings_vw`.`OABS_ATTRBUTE_ID` = 2141) or (`oa_brand_settings_vw`.`OABS_ATTRBUTE_ID` = 2142)) */;

--
-- Final view structure for view `pay_component_benefit_rules_vw`
--

/*!50001 DROP VIEW IF EXISTS `pay_component_benefit_rules_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `pay_component_benefit_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`.`COMPONENT_ID` AS `COMPONENT_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `br`.`COMPONENT_ID`)) AS `COMPONENT`,`br`.`TAX_ALLOWANCE_TYPE_ID` AS `TAX_ALLOWANCE_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `br`.`TAX_ALLOWANCE_TYPE_ID`)) AS `TAX_ALLOWANCE_TYPE_NM`,`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`.`DEPENDENT_ON_COMP` AS `DEPENDENT_ON_COMP`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `br`.`DEPENDENT_ON_COMP`)) AS `DEPENDENT_ON_COMP_NM`,`br`.`LOWER_LIMIT` AS `LOWER_LIMIT`,`br`.`UPPER_LIMIT` AS `UPPER_LIMIT`,`br`.`VALUES` AS `VALUES`,`br`.`SIGN_FACTOR` AS `SIGN_FACTOR`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `br`.`SIGN_FACTOR`)) AS `SIGN_FACTOR_NM`,`br`.`GENDER` AS `GENDER`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `br`.`GENDER`)) AS `GENDER_NM`,`br`.`COUNTRY` AS `COUNTRY`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `br`.`COUNTRY`)) AS `COUNTRY_NM`,`br`.`FINANCIAL_YEAR_ID` AS `FINANCIAL_YEAR_ID`,(select `period_mst`.`FISCAL_PERIOD_DESC` from `period_mst` where (`period_mst`.`PERIOD_ID` = `br`.`FINANCIAL_YEAR_ID`)) AS `FINANCIAL_YEAR_NM`,if((`br`.`OPEN_LIMIT` = 1),'Yes','No') AS `OPEN_LIMIT`,`br`.`COMMENT` AS `COMMENT`,monthname(concat('2011-',`br`.`MONTH`,'-01')) 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` = 'BRTYSBR') */;

--
-- Final view structure for view `pay_element_calculation_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `pay_element_calculation_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `pay_element_calculation_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` = 273) */;

--
-- Final view structure for view `pay_element_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `pay_element_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `pay_element_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` = 276) */;

--
-- Final view structure for view `pay_element_payment_frequency_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `pay_element_payment_frequency_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `pay_element_payment_frequency_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` = 277) */;

--
-- Final view structure for view `pay_element_tax_eligibility_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `pay_element_tax_eligibility_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `pay_element_tax_eligibility_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` = 278) */;

--
-- Final view structure for view `pay_element_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `pay_element_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `pay_element_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` = 309) */;

--
-- Final view structure for view `pay_frequency_vw`
--

/*!50001 DROP VIEW IF EXISTS `pay_frequency_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `pay_frequency_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` = 163) */;

--
-- Final view structure for view `pay_group_head_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `pay_group_head_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `pay_group_head_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` = 303) */;

--
-- Final view structure for view `pay_method_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `pay_method_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `pay_method_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` = 304) */;

--
-- Final view structure for view `pay_rate_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `pay_rate_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `pay_rate_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` = 308) */;

--
-- Final view structure for view `pay_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `pay_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `pay_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` = 305) */;

--
-- Final view structure for view `payment_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `payment_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `payment_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` = 146) */;

--
-- Final view structure for view `payment_vw`
--

/*!50001 DROP VIEW IF EXISTS `payment_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `payment_vw` AS select `payment`.`payment_id` AS `payment_id`,`payment`.`created_on` AS `created_on`,`payment`.`created_by` AS `created_by`,`payment`.`UPDATED_ON` AS `UPDATED_ON`,`payment`.`UPDATED_BY` AS `UPDATED_BY`,`payment`.`remittance_id` AS `remittance_id`,(select `remittance_mst`.`for_description` from `remittance_mst` where (`remittance_mst`.`remittance_id` = `payment`.`remittance_id`)) AS `description`,`payment`.`remittance_no` AS `remittance_no`,`payment`.`remittance_date` AS `remittance_date`,`payment`.`OA_ID` AS `OA_ID`,`payment`.`invoice_no` AS `invoice_no`,`payment`.`invoice_id` AS `invoice_id`,`payment`.`payment_refrence` AS `payment_refrence`,`payment`.`Project_name` AS `Project_name`,`payment`.`payment_amount` AS `payment_amount`,`payment`.`item_amt` AS `item_amt`,`payment`.`toggle` AS `toggle`,`payment`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`payment`.`USER_ID` AS `USER_ID`,`payment`.`IS_DELETED` AS `IS_DELETED` from `payment` */;

--
-- Final view structure for view `payout_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `payout_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `payout_mst_vw` AS select `payout_mst`.`payout_id` AS `payout_id`,`payout_mst`.`payout_no` AS `payout_no`,(select concat(`payout_mst`.`payout_prefix`,' ',`payout_mst`.`payout_no`)) AS `payoutt_nooo`,`payout_mst`.`Ref_payout_No` AS `Ref_payout_No`,`payout_mst`.`company_id` AS `company_id`,(select `company_details`.`company_name` from `company_details` where (`company_details`.`cmpy_id` = `payout_mst`.`company_id`)) AS `compny_name`,`payout_mst`.`payout_unit` AS `payout_unit`,`payout_mst`.`payout_date` AS `payout_date`,`payout_mst`.`start_date` AS `start_date`,`payout_mst`.`end_date` AS `end_date`,`payout_mst`.`for_description` AS `for_description`,`payout_mst`.`vat_percent` AS `vat_percent`,`payout_mst`.`vat_amount` AS `vat_amount`,`payout_mst`.`total_amt` AS `total_amt`,`payout_mst`.`payout_amount` AS `payout_amount`,`payout_mst`.`created_on` AS `created_on`,`payout_mst`.`created_by` AS `created_by`,`payout_mst`.`UPDATED_ON` AS `UPDATED_ON`,`payout_mst`.`UPDATED_BY` AS `UPDATED_BY`,`payout_mst`.`project_id` AS `project_id`,(select `assignment_details`.`assignment_name` from `assignment_details` where (`assignment_details`.`id` = `payout_mst`.`project_id`)) AS `Assimnt_name`,`payout_mst`.`OA_ID` AS `OA_ID`,`payout_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`payout_mst`.`OA_CD` AS `OA_CD`,`payout_mst`.`generated` AS `generated`,`payout_mst`.`payout_prefix` AS `payout_prefix`,`payout_mst`.`FY_ID` AS `FY_ID`,`payout_mst`.`Company_name` AS `Company_name`,`payout_mst`.`PRoject_name` AS `PRoject_name`,`payout_mst`.`org_id` AS `org_id`,(select `ob`.`OA_BRAND_LOGO` from `oa_brands` `ob` where ((`ob`.`OA_ID` = `payout_mst`.`OA_ID`) and (`ob`.`OA_BRAND_ID` = `payout_mst`.`OA_BRAND_ID`))) AS `OA_BRAND_LOGO`,`payout_mst`.`org_cd` AS `org_cd`,(select `oais`.`ORG_TEMPLATE` from `org_acc_invoice_settings` `oais` where ((`oais`.`OA_ID` = `payout_mst`.`OA_ID`) and (`oais`.`OA_BRAND_ID` = `payout_mst`.`OA_BRAND_ID`) and (`oais`.`TEMPLATE_SETTING_ID` = 5567))) AS `org_template`,`payout_mst`.`payment_template` AS `payment_template`,(select `oais`.`MAIL_PDF` from `org_acc_invoice_settings` `oais` where ((`oais`.`OA_ID` = `payout_mst`.`OA_ID`) and (`oais`.`OA_BRAND_ID` = `payout_mst`.`OA_BRAND_ID`) and (`oais`.`TEMPLATE_SETTING_ID` = 5567))) AS `mail_pdf`,`payout_mst`.`IS_DELETED` AS `IS_DELETED`,`payout_mst`.`USER_ID` AS `USER_ID`,if((`payout_mst`.`generated` = 0),'No','Yes') AS `isgenerated`,`payout_mst`.`GENERATED_PATH` AS `GENERATED_PATH` from `payout_mst` */;

--
-- Final view structure for view `payroll_attendance_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `payroll_attendance_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `payroll_attendance_summary_vw` AS select `payroll_attendance_summary`.`PAS_ID` AS `PAS_ID`,`payroll_attendance_summary`.`EMP_ID` AS `EMP_ID`,(select `emp_mst_vw`.`EMP_FULL_NAME` from `emp_mst_vw` where (`payroll_attendance_summary`.`EMP_ID` = `emp_mst_vw`.`EMP_ID`)) AS `EMP_NM`,`payroll_attendance_summary`.`PAY_FREQUENCY` AS `PAY_FREQUENCY`,`payroll_attendance_summary`.`CALENDAR_MONTH` AS `CALENDAR_MONTH`,(select `calendar`.`MONTH_NAME` from `calendar` where (`payroll_attendance_summary`.`CALENDAR_MONTH` = `calendar`.`MONTH`) limit 1) AS `MONTH_NAME`,`payroll_attendance_summary`.`CALENDAR_WEEK` AS `CALENDAR_WEEK`,`payroll_attendance_summary`.`HALF_DAYS` AS `HALF_DAYS`,`payroll_attendance_summary`.`FULL_DAYS` AS `FULL_DAYS`,`payroll_attendance_summary`.`PAID_HOLIDAYS` AS `PAID_HOLIDAYS`,`payroll_attendance_summary`.`ABSENT_DAYS` AS `ABSENT_DAYS`,`payroll_attendance_summary`.`LEAVE_ADJUSTED` AS `LEAVE_ADJUSTED`,`payroll_attendance_summary`.`WD_OT_HRS` AS `WD_OT_HRS`,`payroll_attendance_summary`.`HD_OT_HRS` AS `HD_OT_HRS`,`payroll_attendance_summary`.`PAID_DAYS` AS `PAID_DAYS`,`payroll_attendance_summary`.`STATUS` AS `STATUS`,`payroll_attendance_summary`.`WEEKLY_OFF` AS `WEEKLY_OFF`,`payroll_attendance_summary`.`OTHER_HOLIDAY` AS `OTHER_HOLIDAY`,`payroll_attendance_summary`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `payroll_attendance_summary`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `payroll_attendance_summary`.`OA_ID`)) AS `OA_NM`,`payroll_attendance_summary`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `payroll_attendance_summary`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `payroll_attendance_summary`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`payroll_attendance_summary`.`USER_ID` AS `USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `payroll_attendance_summary`.`USER_ID`)) AS `USER_NM`,`payroll_attendance_summary`.`CREATED_ON` AS `CREATED_ON`,`payroll_attendance_summary`.`CREATED_BY` AS `CREATED_BY`,`payroll_attendance_summary`.`IS_DELETED` AS `IS_DELETED`,`payroll_attendance_summary`.`UPDATED_ON` AS `UPDATED_ON`,`payroll_attendance_summary`.`UPDATED_BY` AS `UPDATED_BY` from `payroll_attendance_summary` */;

--
-- Final view structure for view `payslip_settings_vw`
--

/*!50001 DROP VIEW IF EXISTS `payslip_settings_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `payslip_settings_vw` AS select `payslip_settings`.`PAYSLIP_SETTING_ID` AS `PAYSLIP_SETTING_ID`,`payslip_settings`.`FOLDER_LOC` AS `FOLDER_LOC`,`payslip_settings`.`PAYSLIP_TEMPLATE` AS `PAYSLIP_TEMPLATE`,`payslip_settings`.`REG_ADDRESS` AS `REG_ADDRESS`,`payslip_settings`.`REG_ADDRESS_2` AS `REG_ADDRESS_2`,`payslip_settings`.`REG_ADDRESS_3` AS `REG_ADDRESS_3`,`payslip_settings`.`POSTAL_CODE` AS `POSTAL_CODE`,`payslip_settings`.`COUNTRY` AS `COUNTRY`,`payslip_settings`.`REGISTRATION_NO` AS `REGISTRATION_NO`,`payslip_settings`.`VAT_NO` AS `VAT_NO`,`payslip_settings`.`STATUS_ID` AS `STATUS_ID`,`payslip_settings`.`ACCOUNT_NAME` AS `ACCOUNT_NAME`,`payslip_settings`.`ACCOUNT_NO` AS `ACCOUNT_NO`,`payslip_settings`.`SORT_CODE` AS `SORT_CODE`,`payslip_settings`.`INSTRUCTION_LINE_1` AS `INSTRUCTION_LINE_1`,`payslip_settings`.`INSTRUCTION_LINE_2` AS `INSTRUCTION_LINE_2`,`payslip_settings`.`INSTRUCTION_LINE_3` AS `INSTRUCTION_LINE_3`,`payslip_settings`.`INSTRUCTION_LINE_4` AS `INSTRUCTION_LINE_4`,`payslip_settings`.`CITY` AS `CITY`,`payslip_settings`.`MAIL_PDF` AS `MAIL_PDF`,`payslip_settings`.`TEMPLATE_SETTING_ID` AS `TEMPLATE_SETTING_ID`,`payslip_settings`.`PREFIX` AS `PREFIX`,`payslip_settings`.`CURRENCY_ID` AS `CURRENCY_ID`,`payslip_settings`.`OA_ID` AS `OA_ID`,`payslip_settings`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`payslip_settings`.`USER_ID` AS `USER_ID`,`payslip_settings`.`IS_DELETED` AS `IS_DELETED`,`payslip_settings`.`CREATED_ON` AS `CREATED_ON`,`payslip_settings`.`CREATED_BY` AS `CREATED_BY`,`payslip_settings`.`UPDATED_ON` AS `UPDATED_ON`,`payslip_settings`.`UPDATED_BY` AS `UPDATED_BY`,`payslip_settings`.`OA_BRAND_NM` AS `OA_BRAND_NM`,`payslip_settings`.`OA_BRAND_CD` AS `OA_BRAND_CD`,`payslip_settings`.`APPLICABLE_TAX` AS `APPLICABLE_TAX`,`payslip_settings`.`CST` AS `CST`,`payslip_settings`.`PAN` AS `PAN`,`it`.`TEMPLATE_CD` AS `TEMPLATE_CD` from (`payslip_settings` join `inv_template_mst` `it` on((`payslip_settings`.`PAYSLIP_TEMPLATE` = `it`.`TEMPLATE_ID`))) */;

--
-- Final view structure for view `pending_transaction_vw`
--

/*!50001 DROP VIEW IF EXISTS `pending_transaction_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `pending_transaction_vw` AS select `pending_transaction`.`PT_ID` AS `PT_ID`,`pending_transaction`.`BANK_STATUS` AS `BANK_STATUS`,`pending_transaction`.`AMOUNT` AS `AMOUNT`,`pending_transaction`.`TRANSACTION_ID` AS `TRANSACTION_ID`,`pending_transaction`.`BANK_REF_NO` AS `BANK_REF_NO`,`pending_transaction`.`NAME` AS `NAME`,`pending_transaction`.`EMAIL` AS `EMAIL`,`pending_transaction`.`MOBILE` AS `MOBILE`,`pending_transaction`.`DATE` AS `DATE`,`pending_transaction`.`OA_ID` AS `OA_ID`,`pending_transaction`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`pending_transaction`.`USER_ID` AS `USER_ID`,`pending_transaction`.`IS_DELETED` AS `IS_DELETED`,`pending_transaction`.`CREATED_ON` AS `CREATED_ON`,`pending_transaction`.`CREATED_BY` AS `CREATED_BY`,`pending_transaction`.`UPDATED_ON` AS `UPDATED_ON`,`pending_transaction`.`UPDATED_BY` AS `UPDATED_BY` from `pending_transaction` */;

--
-- Final view structure for view `pension_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `pension_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `pension_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` = 310) */;

--
-- Final view structure for view `performance_action_log_vw`
--

/*!50001 DROP VIEW IF EXISTS `performance_action_log_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `performance_action_log_vw` AS select `performance_action_log`.`PR_ACTION_LOG_ID` AS `PR_ACTION_LOG_ID`,`performance_action_log`.`PR_ID` AS `PR_ID`,`performance_action_log`.`COMMENT` AS `COMMENT`,`performance_action_log`.`PR_ACTION_ID` AS `PR_ACTION_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`performance_action_log`.`PR_ACTION_ID` = `independent_mst`.`MSTR_ID`)) AS `PR_ACTION_NM`,`performance_action_log`.`ACTION` AS `ACTION`,`performance_action_log`.`DATE_TIME` AS `DATE_TIME`,`performance_action_log`.`PERFROMED_BY` AS `PERFROMED_BY`,(select `user_mst`.`USER_NAME` from `user_mst` where (`performance_action_log`.`PERFROMED_BY` = `user_mst`.`USER_ID`)) AS `PEFORMED_BY_NM`,`performance_action_log`.`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`,`performance_action_log`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`performance_action_log`.`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`,`performance_action_log`.`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`,`performance_action_log`.`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`,`performance_action_log`.`CREATEDON` AS `CREATED_ON`,`performance_action_log`.`UPDATEDON` AS `UPDATED_ON`,`performance_action_log`.`IS_DELETED` AS `IS_DELETED` from `performance_action_log` */;

--
-- Final view structure for view `performance_indicator_vw`
--

/*!50001 DROP VIEW IF EXISTS `performance_indicator_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `performance_indicator_vw` AS select `performance_indicator`.`PI_ID` AS `PI_ID`,`performance_indicator`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NAME`,`performance_indicator`.`PERIOD_ID` AS `PERIODID`,`performance_indicator`.`PERIOD_ID` AS `PERIOD_ID`,(select `period_mst`.`FISCAL_PERIOD_DESC` from `period_mst` where (`period_mst`.`PERIOD_ID` = `PERIODID`)) AS `PERIOD`,`performance_indicator`.`JOB_TITLE_ID` AS `JOB_TITLE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `performance_indicator`.`JOB_TITLE_ID`)) AS `JOB_TITLE`,`performance_indicator`.`GOAL_TYPE_ID` AS `GOAL_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `performance_indicator`.`GOAL_TYPE_ID`)) AS `GOAL_TYPE`,`performance_indicator`.`GOAL_TITLE` AS `GOAL_TITLE`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `performance_indicator`.`GOAL_TITLE`)) AS `GOAL`,`performance_indicator`.`DESCRIPTION` AS `DESCRIPTION`,`performance_indicator`.`RATE_MIN` AS `RATE_MIN`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `performance_indicator`.`RATE_MIN`)) AS `MINIMUM_RATING`,`performance_indicator`.`RATE_MAX` AS `RATE_MAX`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `performance_indicator`.`RATE_MAX`)) AS `MAXIMUM_RATING`,`performance_indicator`.`RATE_DEFAULT` AS `RATE_DEFAULT`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `performance_indicator`.`RATE_DEFAULT`)) AS `DEFAULT_RATING`,`performance_indicator`.`IS_ACTIVE` AS `IS_ACTIVE`,`performance_indicator`.`IS_DELETED` AS `IS_DELETED`,`performance_indicator`.`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`,`performance_indicator`.`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`,`performance_indicator`.`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`,`performance_indicator`.`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`,`performance_indicator`.`CREATED_ON` AS `CREATED_ON`,`performance_indicator`.`UPDATED_ON` AS `UPDATED_ON` from `performance_indicator` */;

--
-- Final view structure for view `performance_item_vw`
--

/*!50001 DROP VIEW IF EXISTS `performance_item_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `performance_item_vw` AS select `performance_item`.`PR_ITEM_ID` AS `PR_ITEM_ID`,`performance_item`.`PR_ID` AS `PR_ID`,`performance_item`.`DURATION` AS `DURATION`,`performance_item`.`COMMENT` AS `COMMENT`,`performance_item`.`PR_PRJ_ID` AS `PR_PRJ_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`performance_item`.`PR_PRJ_ID` = `independent_mst`.`MSTR_ID`)) AS `PRJ_NM`,`performance_item`.`GOAL_ID` AS `GOAL_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `performance_item`.`GOAL_ID`)) AS `GOAL`,`performance_item`.`RATING_ID` AS `RATING_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`performance_item`.`RATING_ID` = `independent_mst`.`MSTR_ID`)) AS `RATING`,`performance_item`.`MANAGER_RATING_ID` AS `MANAGER_RATING_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`performance_item`.`MANAGER_RATING_ID` = `independent_mst`.`MSTR_ID`)) AS `MANAGER_RATING`,`performance_item`.`MANAGER_COMMENT` AS `MANAGER_COMMENT`,`performance_item`.`PR_ACTIVITY_ID` AS `PR_ACTIVITY_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`performance_item`.`PR_ACTIVITY_ID` = `independent_mst`.`MSTR_ID`)) AS `PR_ACTIVITY_NM`,`performance_item`.`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`,`performance_item`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`performance_item`.`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`,`performance_item`.`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`,`performance_item`.`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`,`performance_item`.`CREATEDON` AS `CREATED_ON`,`performance_item`.`UPDATEDON` AS `UPDATED_ON`,`performance_item`.`IS_DELETED` AS `IS_DELETED` from `performance_item` */;

--
-- Final view structure for view `performance_period_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `performance_period_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `performance_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` = 'OPPS') */;

--
-- Final view structure for view `performance_rating_vw`
--

/*!50001 DROP VIEW IF EXISTS `performance_rating_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `performance_rating_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`.`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` = 209) */;

--
-- Final view structure for view `performance_ratings_vw`
--

/*!50001 DROP VIEW IF EXISTS `performance_ratings_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `performance_ratings_vw` AS select `im`.`MSTR_ID` AS `MSTR_ID`,`im`.`MSTR_NM` AS `MSTR_NM`,`im`.`MSTR_DESC` AS `MSTR_DESC` from (`independent_mst` `im` join `common_type` `ct`) where ((`ct`.`TYP_ID` = `im`.`TYP_ID`) and (`ct`.`TYP_CD` = 'SEPR')) order by `im`.`SEQUENCE` */;

--
-- Final view structure for view `performance_remark_vw`
--

/*!50001 DROP VIEW IF EXISTS `performance_remark_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `performance_remark_vw` AS select `performance_remark`.`PR_REMARK_ID` AS `PR_REMARK_ID`,`performance_remark`.`PR_REVIEW_ID` AS `PR_REVIEW_ID`,`performance_remark`.`EMP_ID` AS `EMP_ID`,`performance_remark`.`MANAGER_ID` AS `MANAGER_ID`,`performance_remark`.`REMARK` AS `REMARK`,`performance_remark`.`JUSTIFICATION` AS `JUSTIFICATION`,`performance_remark`.`OA_ID` AS `OA_ID`,`performance_remark`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`performance_remark`.`USER_ID` AS `USER_ID`,`performance_remark`.`CREATED_BY` AS `CREATED_BY`,`performance_remark`.`CREATED_ON` AS `CREATED_ON`,`performance_remark`.`UPDATED_BY` AS `UPDATED_BY`,`performance_remark`.`UPDATED_ON` AS `UPDATED_ON`,`performance_remark`.`IS_DELETED` AS `IS_DELETED` from `performance_remark` */;

--
-- Final view structure for view `performance_review_comments_vw`
--

/*!50001 DROP VIEW IF EXISTS `performance_review_comments_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `performance_review_comments_vw` AS select `performance_review_comments`.`PRC_ID` AS `PRC_ID`,`performance_review_comments`.`PR_ID` AS `PRID`,`performance_review_comments`.`PR_ID` AS `PR_ID`,`performance_review_comments`.`PI_EMP_ID` AS `PI_EMP_ID`,`performance_review_comments`.`EMP_ID` AS `EMP_ID`,(select `performance_review`.`PR_ID` from `performance_review` where (`performance_review`.`PR_ID` = `PRID`)) AS `PERFORMANCE_REVIEW_ID`,`performance_review_comments`.`PI_EMP_ID` AS `PIEMPID`,(select `pi_employee`.`REF_EMP_ID` from `pi_employee` where (`pi_employee`.`PI_EMP_ID` = `PIEMPID`)) AS `PI_EMP`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `PI_EMP`)) AS `PI_EMP_NM`,(select `emp_mst`.`EMP_NAME` from `emp_mst` where (`emp_mst`.`REF_EMP_ID` = `PI_EMP`)) AS `EMPLOYEE_NAME`,`performance_review_comments`.`EMP_ID` AS `EMPID`,(select `pi_employee`.`REF_EMP_ID` from `pi_employee` where (`pi_employee`.`PI_EMP_ID` = `PIEMPID`)) AS `REF_MP_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `REF_MP_ID`)) AS `REF_EMP_NM`,`performance_review_comments`.`COMMENT` AS `COMMENT`,`performance_review_comments`.`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`,`performance_review_comments`.`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`,`performance_review_comments`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`performance_review_comments`.`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`,`performance_review_comments`.`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`,`performance_review_comments`.`CREATED_ON` AS `CREATED_ON`,`performance_review_comments`.`UPDATED_ON` AS `UPDATED_ON`,`performance_review_comments`.`IS_DELETED` AS `IS_DELETED` from `performance_review_comments` */;

--
-- Final view structure for view `performance_review_vw`
--

/*!50001 DROP VIEW IF EXISTS `performance_review_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `performance_review_vw` AS select `performance_review`.`PR_ID` AS `PR_ID`,`performance_review`.`PI_EMP_ID` AS `PIEMPID`,`performance_review`.`PI_EMP_ID` AS `PI_EMP_ID`,`performance_review`.`PERIOD_ID` AS `PERIOD_ID`,`pi_employee`.`EMP_NM` AS `PI_EMP`,`pi_employee`.`REF_EMP_ID` AS `REF_EMP_ID`,`performance_review`.`REVIEWER_ID` AS `reviewer_id`,(select `pi_employee`.`REF_EMP_ID` from `pi_employee` where (`pi_employee`.`PI_EMP_ID` = `performance_review`.`REVIEWER_ID`)) AS `REVIEWER_EMP_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `REVIEWER_EMP_ID`)) AS `REVIEWER_EMP_NM`,(select `emp_mst`.`EMP_NAME` from `emp_mst` where (`emp_mst`.`REF_EMP_ID` = `REVIEWER_EMP_ID`)) AS `REVIEWER_EMP_NAME`,`performance_review`.`JOB_TITLE_ID` AS `JOB_TITLE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `performance_review`.`JOB_TITLE_ID`)) AS `JOB_TITLE`,`performance_review`.`SUB_DIVISION_ID` AS `SUB_DIVISION_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `performance_review`.`SUB_DIVISION_ID`)) AS `SUB_DIVISION`,`performance_review`.`PERIOD_FROM` AS `PERIOD_FROM`,`performance_review`.`PERIOD_TO` AS `PERIOD_TO`,`performance_review`.`DUE_DATE` AS `DUE_DATE`,(select `performance_review`.`PR_STATUS_ID` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `performance_review`.`PR_STATUS_ID`)) AS `PR_STATUS_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `performance_review`.`PR_STATUS_ID`)) AS `PR_STATUS`,concat('Performance Review For ',`pi_employee`.`EMP_NM`,' - ',`period_mst`.`FISCAL_PERIOD_DESC`) AS `PR_TITLE`,`performance_review`.`KPIS` AS `KPIS`,`performance_review`.`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`,`performance_review`.`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`,`performance_review`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`performance_review`.`APPROVER_ID` AS `APPROVER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `performance_review`.`APPROVER_ID`)) AS `APPROVER_NM`,(select `emp_mst`.`EMP_NAME` from `emp_mst` where (`emp_mst`.`REF_EMP_ID` = `performance_review`.`APPROVER_ID`)) AS `APPROVER_NAME`,`performance_review`.`APPROVER_COMMENTS` AS `APPROVER_COMMENTS`,`performance_review`.`MANAGER_COMMENTS` AS `MANAGER_COMMENTS`,`performance_review`.`AGGREGATE_EMP_RATING` AS `AGGREGATE_EMP_RATING`,`performance_review`.`AGGREGATE_MANAGER_RATING` AS `AGGREGATE_MANAGER_RATING`,`performance_review`.`AGGREGATE_OVERALL_RATINGS` AS `AGGREGATE_OVERALL_RATINGS`,`performance_review`.`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`,`performance_review`.`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`,`performance_review`.`CREATED_ON` AS `CREATED_ON`,`performance_review`.`UPDATED_ON` AS `UPDATED_ON`,`performance_review`.`IS_DELETED` AS `IS_DELETED` from ((`performance_review` join `pi_employee` on((`pi_employee`.`PI_EMP_ID` = `performance_review`.`PI_EMP_ID`))) join `period_mst`) where (`period_mst`.`PERIOD_ID` = `performance_review`.`PERIOD_ID`) */;

--
-- Final view structure for view `performance_status__mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `performance_status__mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `performance_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` = 191) */;

--
-- Final view structure for view `period_manager_module_menu_items_vw`
--

/*!50001 DROP VIEW IF EXISTS `period_manager_module_menu_items_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `period_manager_module_menu_items_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`.`MSTR_NM` like '%Period%Manager%') */;

--
-- Final view structure for view `period_mst_brand_wise_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `period_mst_brand_wise_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `period_mst_brand_wise_summary_vw` AS select `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`.`OABRANDID` AS `OABRANDID`,`period_mst_vw`.`OA_BRAND_CD` AS `OA_BRAND_CD`,`period_mst_vw`.`OA_BRAND_NM` AS `OA_BRAND_NM`,count(1) AS `COUNT(1)` from `period_mst_vw` group by `period_mst_vw`.`OAID`,`period_mst_vw`.`OA_CD`,`period_mst_vw`.`OA_NM`,`period_mst_vw`.`OABRANDID`,`period_mst_vw`.`OA_BRAND_CD`,`period_mst_vw`.`OA_BRAND_NM` */;

--
-- Final view structure for view `period_mst_type_wise_record_count_vw`
--

/*!50001 DROP VIEW IF EXISTS `period_mst_type_wise_record_count_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `period_mst_type_wise_record_count_vw` AS select `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`,count(1) AS `TOTAL_COUNT`,count(distinct `period_mst_vw`.`OABRANDID`) AS `BRAND_COUNT`,round((count(1) / count(distinct `period_mst_vw`.`OABRANDID`)),0) AS `APROX_RECORD_PER_TYPE` from `period_mst_vw` group by `period_mst_vw`.`PERIOD_TYPE_ID`,`period_mst_vw`.`PERIOD_TYP_CD`,`period_mst_vw`.`PERIOD_TYP` */;

--
-- Final view structure for view `period_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `period_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `period_mst_vw` AS select `P`.`PERIOD_ID` AS `PERIOD_ID`,`P`.`PERIOD_TYPE_ID` AS `PERIOD_TYPE_ID`,(select `independent_mst`.`MSTR_CD` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `P`.`PERIOD_TYPE_ID`)) AS `PERIOD_TYP_CD`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `P`.`PERIOD_TYPE_ID`)) AS `PERIOD_TYP`,`P`.`PERIOD_START_DATE` AS `PERIOD_START_DATE`,`P`.`PERIOD_END_DATE` AS `PERIOD_END_DATE`,`P`.`FISCAL_PERIOD_DESC` AS `FISCAL_PERIOD_DESC`,`P`.`PERIOD_STATUS_ID` AS `PERIOD_STATUS_ID`,(select `independent_mst`.`MSTR_CD` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `P`.`PERIOD_STATUS_ID`)) AS `PERIOD_STATUS_CD`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `P`.`PERIOD_STATUS_ID`)) AS `PERIOD_STATUS`,if((`P`.`IS_VERIFIED` = 1),'Yes','No') AS `IS_VERIFIED`,`P`.`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`,`P`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`P`.`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`,`P`.`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`,`P`.`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`,`P`.`CREATED_ON` AS `CREATED_ON`,`P`.`UPDATED_ON` AS `UPDATED_ON`,`P`.`IS_DELETED` AS `IS_DELETED` from `period_mst` `P` */;

--
-- Final view structure for view `permission_class_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `permission_class_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `permission_class_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`,if((`independent_mst`.`IS_EDITABLE` = 1),'Yes','No') AS `IS_EDITABLE`,if((`independent_mst`.`IS_PREDEFINED` = 1),'Yes','No') AS `IS_PREDEFINED`,`permission_dtl`.`PERMISSIONS_DTL_ID` AS `PERMISSIONS_DTL_ID`,`permission_dtl`.`PERMISSIONS_CLASS_ID` AS `PERMISSIONS_CLASS_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `permission_dtl`.`PERMISSIONS_CLASS_ID`)) AS `PERMISSIONS_CLASS`,`permission_dtl`.`PERMISSIONS_REF_TYPE_ID` AS `PERMISSIONS_REF_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `permission_dtl`.`PERMISSIONS_REF_TYPE_ID`)) AS `PERMISSIONS_REF_TYPE`,`permission_dtl`.`PERMISSIONS_REF_ID` AS `PERMISSIONS_REF_ID`,`permission_dtl`.`PERMISSIONS_ID` AS `PERMISSIONS_ID`,`permission_dtl`.`PERMISSION_ENABLED` AS `PERMISSION_ENABLED`,`permission_dtl`.`PERMISSION_READ_ONLY` AS `PERMISSION_READ_ONLY`,`permission_dtl`.`PERMISSION_MODIFY` AS `PERMISSION_MODIFY`,`permission_dtl`.`PERMISSION_DELETE` AS `PERMISSION_DELETE`,`permission_dtl`.`PERMISSION_PRINT` AS `PERMISSION_PRINT`,`permission_dtl`.`PERMISSION_EXECUTE` AS `PERMISSION_EXECUTE`,`permission_dtl`.`PERMISSION_INSERT` AS `PERMISSION_INSERT`,`permission_dtl`.`IS_DELETED` AS `IS_DELETED`,`permission_dtl`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `permission_dtl`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `permission_dtl`.`OA_ID`)) AS `OA_NM`,`permission_dtl`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `permission_dtl`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `permission_dtl`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`permission_dtl`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `permission_dtl`.`USER_ID`)) AS `USER_NM`,`permission_dtl`.`CREATED_BY` AS `CREATED_BY`,`permission_dtl`.`UPDATED_BY` AS `UPDATED_BY`,`permission_dtl`.`CREATED_ON` AS `CREATED_ON`,`permission_dtl`.`UPDATED_ON` AS `UPDATED_ON` from (`independent_mst` join `permission_dtl` on((`independent_mst`.`MSTR_ID` = `permission_dtl`.`PERMISSIONS_CLASS_ID`))) where ((`independent_mst`.`TYP_ID` = 49) and (`permission_dtl`.`PERMISSIONS_REF_TYPE_ID` = 65)) group by `permission_dtl`.`PERMISSIONS_CLASS_ID`,`permission_dtl`.`OA_BRAND_ID` */;

--
-- Final view structure for view `permission_class_roles_vw`
--

/*!50001 DROP VIEW IF EXISTS `permission_class_roles_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `permission_class_roles_vw` AS select `permission_dtl`.`PERMISSIONS_DTL_ID` AS `PERMISSIONS_DTL_ID`,`permission_dtl`.`PERMISSIONS_CLASS_ID` AS `PERMISSIONS_CLASS_ID`,(select `independent_mst`.`MSTR_CD` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `permission_dtl`.`PERMISSIONS_CLASS_ID`)) AS `PERMISSIONS_CLASS_CD`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `permission_dtl`.`PERMISSIONS_CLASS_ID`)) AS `PERMISSIONS_CLASS_NAME`,`permission_dtl`.`PERMISSIONS_REF_TYPE_ID` AS `PERMISSIONS_REF_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `permission_dtl`.`PERMISSIONS_REF_TYPE_ID`)) AS `TYP_NM`,`permission_dtl`.`PERMISSIONS_REF_ID` AS `PERMISSIONS_REF_ROLE_ID`,(select `role_mst`.`ROLE_NM` from `role_mst` where (`role_mst`.`ROLE_ID` = `PERMISSIONS_REF_ROLE_ID`)) AS `ROLE_NM`,`permission_dtl`.`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`,`permission_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`,`permission_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`,`permission_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`,`permission_dtl`.`CREATED_ON` AS `CREATED_ON`,`permission_dtl`.`UPDATED_ON` AS `UPDATED_ON`,`permission_dtl`.`IS_DELETED` AS `IS_DELETED` from `permission_dtl` where `permission_dtl`.`PERMISSIONS_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 `permission_class_usergroups_vw`
--

/*!50001 DROP VIEW IF EXISTS `permission_class_usergroups_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `permission_class_usergroups_vw` AS select `permission_dtl`.`PERMISSIONS_DTL_ID` AS `PERMISSIONS_DTL_ID`,`permission_dtl`.`PERMISSIONS_CLASS_ID` AS `PERMISSIONS_CLASS_ID`,(select `independent_mst`.`MSTR_CD` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `permission_dtl`.`PERMISSIONS_CLASS_ID`)) AS `PERMISSIONS_CLASS_CD`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `permission_dtl`.`PERMISSIONS_CLASS_ID`)) AS `PERMISSIONS_CLASS_NAME`,`permission_dtl`.`PERMISSIONS_REF_TYPE_ID` AS `PERMISSIONS_REF_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `permission_dtl`.`PERMISSIONS_REF_TYPE_ID`)) AS `TYP_NM`,`permission_dtl`.`PERMISSIONS_REF_ID` AS `PERMISSIONS_REF_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `permission_dtl`.`PERMISSIONS_REF_ID`)) AS `USER_GRP_NM`,`permission_dtl`.`PERMISSIONS_ID` AS `PERMISSIONS_ID`,(select `user_group`.`USER_GRP_NM` from `user_group` where (`user_group`.`USER_GRP_ID` = `permission_dtl`.`PERMISSIONS_ID`)) AS `USER_GRP`,`permission_dtl`.`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`,`permission_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`,`permission_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`,`permission_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`,`permission_dtl`.`CREATED_ON` AS `CREATED_ON`,`permission_dtl`.`UPDATED_ON` AS `UPDATED_ON`,`permission_dtl`.`IS_DELETED` AS `IS_DELETED` from `permission_dtl` where `permission_dtl`.`PERMISSIONS_REF_TYPE_ID` in (select `independent_mst`.`MSTR_ID` from `independent_mst` where ((`independent_mst`.`MSTR_CD` = 'PRTUP') and (`independent_mst`.`IS_PREDEFINED` = 1))) */;

--
-- Final view structure for view `permission_class_users_vw`
--

/*!50001 DROP VIEW IF EXISTS `permission_class_users_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `permission_class_users_vw` AS select `permission_dtl`.`PERMISSIONS_DTL_ID` AS `PERMISSIONS_DTL_ID`,`permission_dtl`.`PERMISSIONS_CLASS_ID` AS `PERMISSIONS_CLASS_ID`,(select `independent_mst`.`MSTR_CD` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `permission_dtl`.`PERMISSIONS_CLASS_ID`)) AS `PERMISSIONS_CLASS_CD`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `permission_dtl`.`PERMISSIONS_CLASS_ID`)) AS `PERMISSIONS_CLASS_NAME`,`permission_dtl`.`PERMISSIONS_REF_TYPE_ID` AS `PERMISSIONS_REF_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `permission_dtl`.`PERMISSIONS_REF_TYPE_ID`)) AS `PERMISSIONS_REF_TYPE_NM`,`permission_dtl`.`PERMISSIONS_REF_ID` AS `PERMISSIONS_REF_USER_ID`,(select `user_group`.`USER_GRP_NM` from `user_group` where (`user_group`.`USER_GRP_ID` = `PERMISSIONS_REF_USER_ID`)) AS `USER_NAME`,`permission_dtl`.`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`,`permission_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`,`permission_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`,`permission_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`,`permission_dtl`.`CREATED_ON` AS `CREATED_ON`,`permission_dtl`.`UPDATED_ON` AS `UPDATED_ON`,`permission_dtl`.`IS_DELETED` AS `IS_DELETED` from `permission_dtl` where `permission_dtl`.`PERMISSIONS_REF_TYPE_ID` in (select `independent_mst`.`MSTR_ID` from `independent_mst` where ((`independent_mst`.`MSTR_CD` = 'PRTGP') and (`independent_mst`.`IS_PREDEFINED` = 1))) */;

--
-- Final view structure for view `permission_dtl_vw`
--

/*!50001 DROP VIEW IF EXISTS `permission_dtl_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `permission_dtl_vw` AS select `pd`.`PERMISSIONS_DTL_ID` AS `PERMISSIONS_DTL_ID`,`pd`.`PERMISSIONS_CLASS_ID` AS `PERMISSIONS_CLASS_ID`,(select `im`.`MSTR_CD` from `independent_mst` `im` where (`im`.`MSTR_ID` = `pd`.`PERMISSIONS_CLASS_ID`)) AS `PERMISSIONS_CLASS_CD`,(select `im`.`MSTR_NM` from `independent_mst` `im` where (`im`.`MSTR_ID` = `pd`.`PERMISSIONS_CLASS_ID`)) AS `PERMISSIONS_CLASS_NAME`,`pd`.`PERMISSIONS_REF_TYPE_ID` AS `PERMISSIONS_REF_TYPE_ID`,(select `im`.`MSTR_NM` from `independent_mst` `im` where (`im`.`MSTR_ID` = `pd`.`PERMISSIONS_REF_TYPE_ID`)) AS `TYP_NM`,`pd`.`PERMISSIONS_REF_ID` AS `PERMISSIONS_REF_ID`,(select `ug`.`USER_GRP_NM` from `user_group` `ug` where (`ug`.`USER_GRP_ID` = `pd`.`PERMISSIONS_REF_ID`)) AS `USER_GRP_NM`,`pd`.`OA_ID` AS `ORG_ACC_ID`,(select `oa`.`OA_CD` from `org_accounts` `oa` where (`oa`.`OA_ID` = `pd`.`OA_ID`)) AS `OA_CD`,(select `oa`.`OA_NM` from `org_accounts` `oa` where (`oa`.`OA_ID` = `pd`.`OA_ID`)) AS `OA_NM`,`pd`.`OA_BRAND_ID` AS `BRAND_ID`,(select `ob`.`OA_BRAND_CD` from `oa_brands` `ob` where (`ob`.`OA_BRAND_ID` = `pd`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `ob`.`OA_BRAND_NM` from `oa_brands` `ob` where (`ob`.`OA_BRAND_ID` = `pd`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`pd`.`USER_ID` AS `USERID`,(select `um`.`USER_NAME` from `user_mst` `um` where (`um`.`USER_ID` = `pd`.`USER_ID`)) AS `USER_NM`,`pd`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `um`.`USER_NAME` from `user_mst` `um` where (`um`.`USER_ID` = `pd`.`CREATED_BY`)) AS `CREATED_BY_USER_NAME`,`pd`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `um`.`USER_NAME` from `user_mst` `um` where (`um`.`USER_ID` = `pd`.`UPDATED_BY`)) AS `UPDATED_BY_USER_NAME`,`pd`.`CREATED_ON` AS `CREATED_ON`,`pd`.`UPDATED_ON` AS `UPDATED_ON`,`pd`.`IS_DELETED` AS `IS_DELETED` from `permission_dtl` `pd` */;

--
-- Final view structure for view `permission_ref_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `permission_ref_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `permission_ref_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` = 48) */;

--
-- Final view structure for view `permissions_vw`
--

/*!50001 DROP VIEW IF EXISTS `permissions_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `permissions_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`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`default_access_confug`.`PERMISSIONS_DTL_ID` AS `PERMISSIONS_DTL_ID`,`default_access_confug`.`PERMISSIONS_CLASS_ID` AS `PERMISSIONS_CLASS_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `default_access_confug`.`PERMISSIONS_CLASS_ID`)) AS `PERMISSIONS_CLASS`,`default_access_confug`.`PERMISSIONS_REF_TYPE_ID` AS `PERMISSIONS_REF_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `default_access_confug`.`PERMISSIONS_REF_TYPE_ID`)) AS `PERMISSIONS_REF_TYPE`,`default_access_confug`.`PERMISSIONS_REF_ID` AS `PERMISSIONS_REF_ID`,`default_access_confug`.`PERMISSIONS_ID` AS `PERMISSIONS_ID`,`default_access_confug`.`PERMISSION_ENABLED` AS `PERMISSION_ENABLED`,`default_access_confug`.`PERMISSION_READ_ONLY` AS `PERMISSION_READ_ONLY`,`default_access_confug`.`PERMISSION_MODIFY` AS `PERMISSION_MODIFY`,`default_access_confug`.`PERMISSION_DELETE` AS `PERMISSION_DELETE`,`default_access_confug`.`PERMISSION_PRINT` AS `PERMISSION_PRINT`,`default_access_confug`.`PERMISSION_EXECUTE` AS `PERMISSION_EXECUTE`,`default_access_confug`.`PERMISSION_INSERT` AS `PERMISSION_INSERT`,`default_access_confug`.`IS_DELETED` AS `IS_DELETED`,`default_access_confug`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `default_access_confug`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `default_access_confug`.`OA_ID`)) AS `OA_NM`,`default_access_confug`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `default_access_confug`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `default_access_confug`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`default_access_confug`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `default_access_confug`.`USER_ID`)) AS `USER_NM`,`default_access_confug`.`CREATED_BY` AS `CREATED_BY`,`default_access_confug`.`UPDATED_BY` AS `UPDATED_BY`,`default_access_confug`.`CREATED_ON` AS `CREATED_ON`,`default_access_confug`.`UPDATED_ON` AS `UPDATED_ON` from (`independent_mst` join `default_access_confug` on((`independent_mst`.`MSTR_ID` = `default_access_confug`.`PERMISSIONS_CLASS_ID`))) where ((`independent_mst`.`TYP_ID` = 49) and (`default_access_confug`.`PERMISSIONS_REF_TYPE_ID` = 65)) group by `default_access_confug`.`PERMISSIONS_CLASS_ID`,`default_access_confug`.`OA_BRAND_ID` */;

--
-- Final view structure for view `personal_habbit_vw`
--

/*!50001 DROP VIEW IF EXISTS `personal_habbit_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `personal_habbit_vw` AS select `personal_habbit`.`HABBIT_ID` AS `HABBIT_ID`,`personal_habbit`.`PATIENT_ID` AS `PATIENT_ID`,(select `personal_information`.`FIRST_NAME` from `personal_information` where (`personal_information`.`PATIENT_ID` = `personal_habbit`.`PATIENT_ID`)) AS `PATIENT_NM`,if((`personal_habbit`.`SMOKE` = 1),'Yes','No') AS `SMOKE`,`personal_habbit`.`SMOKE_STATUS` AS `SMOKE_STATUS`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `personal_habbit`.`SMOKE_STATUS`)) AS `SMOKE_STATUS_NM`,if((`personal_habbit`.`TOBACCO` = 1),'Yes','No') AS `TOBACCO`,`personal_habbit`.`TOBACCO_TEXT` AS `TOBACCO_TEXT`,if((`personal_habbit`.`RECREATIONAL_DRUGS` = 1),'Yes','No') AS `RECREATIONAL_DRUGS`,`personal_habbit`.`RECREATIONAL_DRUGS_TEXT` AS `RECREATIONAL_DRUGS_TEXT`,if((`personal_habbit`.`COFFEE` = 1),'Yes','No') AS `COFFEE`,`personal_habbit`.`COFFEE_TEXT` AS `COFFEE_TEXT`,if((`personal_habbit`.`TEA` = 1),'Yes','No') AS `TEA`,`personal_habbit`.`TEA_TEXT` AS `TEA_TEXT`,if((`personal_habbit`.`PHYSICAL_EXERCISE` = 1),'Yes','No') AS `PHYSICAL_EXERCISE`,`personal_habbit`.`EXERCISE_STATUS` AS `EXERCISE_STATUS`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `personal_habbit`.`EXERCISE_STATUS`)) AS `EXERCISE_STATUS_NM`,`personal_habbit`.`COMMENTS` AS `COMMENTS`,`personal_habbit`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`personal_habbit`.`OA_ID` AS `OA_ID`,`personal_habbit`.`USER_ID` AS `USER_ID`,`personal_habbit`.`IS_DELETED` AS `IS_DELETED`,`personal_habbit`.`CREATED_ON` AS `CREATED_ON`,`personal_habbit`.`UPDATED_ON` AS `UPDATED_ON`,`personal_habbit`.`CREATED_BY` AS `CREATED_BY`,`personal_habbit`.`UPDATED_BY` AS `UPDATED_BY` from `personal_habbit` */;

--
-- Final view structure for view `personal_information_vw`
--

/*!50001 DROP VIEW IF EXISTS `personal_information_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `personal_information_vw` AS select `personal_information`.`PATIENT_ID` AS `PATIENT_ID`,`personal_information`.`FIRST_NAME` AS `FIRST_NAME`,`personal_information`.`LAST_NAME` AS `LAST_NAME`,`personal_information`.`DOB` AS `DOB`,`personal_information`.`SEX` AS `SEX`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `personal_information`.`SEX`)) AS `SEX_NM`,`personal_information`.`BLOOD_GROUP` AS `BLOOD_GROUP`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `personal_information`.`BLOOD_GROUP`)) AS `BLOOD_GROUP_NM`,`personal_information`.`GP` AS `GP`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `personal_information`.`GP`)) AS `GP_NM`,`personal_information`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`personal_information`.`OA_ID` AS `OA_ID`,`personal_information`.`USER_ID` AS `USER_ID`,`personal_information`.`IS_DELETED` AS `IS_DELETED`,`personal_information`.`CREATED_ON` AS `CREATED_ON`,`personal_information`.`UPDATED_ON` AS `UPDATED_ON`,`personal_information`.`CREATED_BY` AS `CREATED_BY`,`personal_information`.`UPDATED_BY` AS `UPDATED_BY` from `personal_information` */;

--
-- Final view structure for view `phone_nbr_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `phone_nbr_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `phone_nbr_mst_vw` AS select `phone_nbr_mst`.`PHONE_NBR_ID` AS `PHONE_NBR_ID`,`phone_nbr_mst`.`PHONE_NBR` AS `PHONE_NBR`,`phone_nbr_mst`.`PHONE_NBR_TYPE_ID` AS `PHONE_NBR_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `phone_nbr_mst`.`PHONE_NBR_TYPE_ID`)) AS `PHONE_NBR_TYPE_NM`,`phone_nbr_mst`.`PHONE_COUNTRY_CD` AS `PHONE_COUNTRY_CD`,`phone_nbr_mst`.`PHONE_AREA_CD` AS `PHONE_AREA_CD`,`phone_nbr_mst`.`PHONE_EXCHANGE_NBR` AS `PHONE_EXCHANGE_NBR`,`phone_nbr_mst`.`PHONE_LINE_NBR` AS `PHONE_LINE_NBR`,`phone_nbr_mst`.`PHONE_EXTN` AS `PHONE_EXTN`,`phone_nbr_mst`.`IS_FAXNBR` AS `Is_FaxNbr`,`phone_nbr_mst`.`IS_DELETED` AS `IS_DELETED`,`phone_nbr_mst`.`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`,`phone_nbr_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`,`phone_nbr_mst`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`phone_nbr_mst`.`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`,`phone_nbr_mst`.`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`,`phone_nbr_mst`.`CREATED_ON` AS `Created_On`,`phone_nbr_mst`.`UPDATED_ON` AS `Updated_On` from `phone_nbr_mst` */;

--
-- Final view structure for view `phone_number_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `phone_number_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `phone_number_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` = 140) */;

--
-- Final view structure for view `phone_support_vw`
--

/*!50001 DROP VIEW IF EXISTS `phone_support_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `phone_support_vw` AS select `phone_support`.`PID` AS `PID`,`phone_support`.`PH_NUMBER` AS `PH_NUMBER`,`phone_support`.`PH_INSTRUCTION` AS `PH_INSTRUCTION`,`phone_support`.`IS_DELETED` AS `IS_DELETED`,`phone_support`.`USER_ID` AS `USER_ID`,`phone_support`.`OA_ID` AS `OA_ID`,`phone_support`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`phone_support`.`CREATED_ON` AS `CREATED_ON`,`phone_support`.`CREATED_BY` AS `CREATED_BY`,`phone_support`.`UPDATED_ON` AS `UPDATED_ON`,`phone_support`.`UPDATED_BY` AS `UPDATED_BY` from `phone_support` */;

--
-- Final view structure for view `pi_employee_vw`
--

/*!50001 DROP VIEW IF EXISTS `pi_employee_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `pi_employee_vw` AS select `pie`.`PI_EMP_ID` AS `PI_EMP_ID`,`pie`.`MANAGER_ID` AS `MANAGER_ID`,`pie`.`IS_MANAGER` AS `IS_MANAGER`,(select `piem`.`EMP_NM` from `pi_employee` `piem` where (`piem`.`PI_EMP_ID` = `pie`.`MANAGER_ID`)) AS `MANAGER_NM`,`pie`.`REF_EMP_ID` AS `REF_EMP_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `pie`.`REF_EMP_ID`)) AS `REF_EMP_NM`,`pie`.`REF_EMP_CD` AS `REF_EMP_CD`,`pie`.`EMP_NM` AS `EMP_NM`,`pie`.`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` = `pie`.`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`,`pie`.`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`,`pie`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`pie`.`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`,`pie`.`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`,`pie`.`CREATEDON` AS `CREATEDON`,`pie`.`UPDATEDON` AS `UPDATEDON`,`pie`.`IS_DELETED` AS `IS_DELETED` from `pi_employee` `pie` */;

--
-- Final view structure for view `position_level_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `position_level_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `position_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` = 162) */;

--
-- Final view structure for view `position_level_vw`
--

/*!50001 DROP VIEW IF EXISTS `position_level_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `position_level_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` = 162) */;

--
-- Final view structure for view `postcode_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `postcode_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `postcode_mst_vw` AS select `postcode_mst`.`POSTCODE_ID` AS `POSTCODE_ID`,`postcode_mst`.`POSTCODE_PREFIX` AS `POSTCODE_PREFIX`,`postcode_mst`.`POSTCODE_SUFFIX` AS `POSTCODE_SUFFIX`,`postcode_mst`.`POSTCODE` AS `POSTCODE`,`postcode_mst`.`COUNTRY_ID` AS `COUNTRY_ID`,(select `location_mst`.`LOC_NAME` from `location_mst` where (`postcode_mst`.`COUNTRY_ID` = `location_mst`.`LOC_ID`)) AS `COUNTRY_NM`,`postcode_mst`.`COUNTY_STATE_ID` AS `COUNTY_STATE_ID`,(select `location_mst`.`LOC_NAME` from `location_mst` where (`postcode_mst`.`COUNTY_STATE_ID` = `location_mst`.`LOC_ID`)) AS `COUNTY_STATE_NM`,`postcode_mst`.`TIME_ZONE_ID` AS `TIMEZONEID`,`postcode_mst`.`TIME_ZONE_ID` AS `TIME_ZONE_ID`,(select `timezone_mst`.`TIMEZONE` from `timezone_mst` where (`timezone_mst`.`TIME_ZONE_ID` = `TIMEZONEID`)) AS `TIMEZONE_NM`,`postcode_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`,`postcode_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`,`postcode_mst`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`postcode_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`,`postcode_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`,`postcode_mst`.`CREATEDON` AS `CREATED_ON`,`postcode_mst`.`UPDATEDON` AS `UPDATED_ON`,`postcode_mst`.`IS_DELETED` AS `IS_DELETED` from `postcode_mst` */;

--
-- Final view structure for view `pr_status_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `pr_status_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `pr_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` = 192) */;

--
-- Final view structure for view `practice_vw`
--

/*!50001 DROP VIEW IF EXISTS `practice_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `practice_vw` AS select `practice`.`PR_ID` AS `PR_ID`,`practice`.`FIRST_NAME` AS `FIRST_NAME`,`practice`.`LAST_NAME` AS `LAST_NAME`,`practice`.`ADDRESS` AS `ADDRESS`,`practice`.`EMAIL` AS `EMAIL`,`practice`.`CONTACT` AS `CONTACT`,`practice`.`OA_ID` AS `OA_ID`,`practice`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`practice`.`USER_ID` AS `USER_ID`,`practice`.`IS_DELETED` AS `IS_DELETED`,`practice`.`CREATED_ON` AS `CREATED_ON`,`practice`.`CREATED_BY` AS `CREATED_BY`,`practice`.`UPDATED_ON` AS `UPDATED_ON`,`practice`.`UPDATED_BY` AS `UPDATED_BY` from `practice` */;

--
-- Final view structure for view `prcss_obj_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `prcss_obj_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `prcss_obj_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` = 27) */;

--
-- Final view structure for view `pricelist_vw`
--

/*!50001 DROP VIEW IF EXISTS `pricelist_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `pricelist_vw` AS select `pricelist`.`ID` AS `ID`,`pricelist`.`START_RANGE` AS `START_RANGE`,`pricelist`.`END_RANGE` AS `END_RANGE`,`pricelist`.`TITLE` AS `TITLE`,`pricelist`.`PRICE` AS `PRICE`,`pricelist`.`FREQUENCY` AS `FREQUENCY`,`pricelist`.`OA_ID` AS `OA_ID`,`pricelist`.`OA_BRAND_ID` AS `OABRANDID`,`pricelist`.`USER_ID` AS `USERID`,`pricelist`.`IS_DELETED` AS `IS_DELETED` from `pricelist` */;

--
-- Final view structure for view `products_vw`
--

/*!50001 DROP VIEW IF EXISTS `products_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `products_vw` AS select `products`.`PRODUCT_ID` AS `PRODUCT_ID`,`products`.`PRODUCT_NAME` AS `PRODUCT_NAME`,`products`.`PRODUCT_IMAGE` AS `PRODUCT_IMAGE`,`products`.`PICTURE_FILE_NAME` AS `PICTURE_FILE_NAME`,`products`.`PICTURE_FILE_TYPE` AS `PICTURE_FILE_TYPE`,`products`.`PICTURE_FILE_SIZE` AS `PICTURE_FILE_SIZE`,`products`.`PIUCTURE_FILE_WIDTH` AS `PIUCTURE_FILE_WIDTH`,`products`.`PICTURE_FILE_HEIGHT` AS `PICTURE_FILE_HEIGHT`,`products`.`EPIC_PICTURE` AS `EPIC_PICTURE`,`products`.`EPIC_FILENAME` AS `EPIC_FILENAME`,`products`.`EPIC_TYPE` AS `EPIC_TYPE`,`products`.`EPIC_FILE_SIZE` AS `EPIC_FILE_SIZE`,`products`.`EPIC_FILE_WIDTH` AS `EPIC_FILE_WIDTH`,`products`.`EPIC_FILE_HEIGHT` AS `EPIC_FILE_HEIGHT`,`products`.`OA_ID` AS `OA_ID`,`products`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`products`.`USER_ID` AS `USER_ID`,`products`.`IS_DELETED` AS `IS_DELETED`,`products`.`CREATED_BY` AS `CREATED_BY`,`products`.`CREATED_ON` AS `CREATED_ON`,`products`.`UPDATED_BY` AS `UPDATED_BY`,`products`.`UPDATED_ON` AS `UPDATED_ON` from `products` */;

--
-- Final view structure for view `professional_plan_feature_list_vw`
--

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

--
-- Final view structure for view `professional_tax_vw`
--

/*!50001 DROP VIEW IF EXISTS `professional_tax_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `professional_tax_vw` AS select `professional_tax`.`PT_ID` AS `PT_ID`,`professional_tax`.`EMP_ID` AS `EMP_ID`,(select `emp_mst`.`EMP_NBR` from `emp_mst` where (`emp_mst`.`EMP_ID` = `professional_tax`.`EMP_ID`) limit 1) AS `EMP_CD`,(select concat(`emp_mst`.`EMP_NAME`,' ',`emp_mst`.`EMPLST_NM`) from `emp_mst` where (`emp_mst`.`EMP_ID` = `professional_tax`.`EMP_ID`) limit 1) AS `EMP_NM`,`professional_tax`.`YEAR` AS `YEAR`,`professional_tax`.`M_1` AS `M_1`,`professional_tax`.`M_2` AS `M_2`,`professional_tax`.`M_3` AS `M_3`,`professional_tax`.`M_4` AS `M_4`,`professional_tax`.`M_5` AS `M_5`,`professional_tax`.`M_6` AS `M_6`,`professional_tax`.`M_7` AS `M_7`,`professional_tax`.`M_8` AS `M_8`,`professional_tax`.`M_9` AS `M_9`,`professional_tax`.`M_10` AS `M_10`,`professional_tax`.`M_11` AS `M_11`,`professional_tax`.`M_12` AS `M_12`,`professional_tax`.`ANNUAL_PAYMENT` AS `ANNUAL_PAYMENT`,`professional_tax`.`IS_DELETED` AS `IS_DELETED`,`professional_tax`.`OA_ID` AS `OA_ID`,`professional_tax`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`professional_tax`.`USER_ID` AS `USER_ID`,`professional_tax`.`CREATED_BY` AS `CREATED_BY`,`professional_tax`.`CREATED_ON` AS `CREATED_ON`,`professional_tax`.`UPDATED_BY` AS `UPDATED_BY`,`professional_tax`.`UPDATED_ON` AS `UPDATED_ON` from `professional_tax` */;

--
-- Final view structure for view `profile_employment_vw`
--

/*!50001 DROP VIEW IF EXISTS `profile_employment_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `profile_employment_vw` AS select `profile_employment`.`EMPLOYEE_ID` AS `EMPLOYEE_ID`,`profile_employment`.`PROFILE_ID` AS `PRO_ID`,(select concat(`profile_finance_mst`.`PRO_FIRSTNAME`,'  ',`profile_finance_mst`.`PRO_SURNAME`) from `profile_finance_mst` where (`profile_finance_mst`.`PROFILE_ID` = `PRO_ID`)) AS `PROFILE_NAME`,if((`profile_employment`.`EMP_SELF_EPLOYEE` = 1),'Yes','No') AS `EMP_SELF_EPLOYEE`,if((`profile_employment`.`EMP_SELF_ACCOUNT` = 1),'Yes','No') AS `EMP_SELF_ACCOUNT`,`profile_employment`.`EMP_OCCUPATION` AS `EMP_OCCUPATION`,`profile_employment`.`EMP_NAME_EMPLOYER` AS `EMP_NAME_EMPLOYER`,`profile_employment`.`EMP_SALARY` AS `EMP_SALARY`,`profile_employment`.`EMP_START_DATE` AS `EMP_START_DATE`,`profile_employment`.`IS_DELETED` AS `IS_DELETED`,`profile_employment`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`profile_employment`.`CREATED_BY` AS `CREATED_BY`,`profile_employment`.`UPDATED_BY` AS `UPDATED_BY`,`profile_employment`.`CREATED_ON` AS `CREATED_ON`,`profile_employment`.`UPDATED_ON` AS `UPDATED_ON`,`profile_employment`.`OA_ID` AS `OA_ID`,`profile_employment`.`USER_ID` AS `USER_ID` from `profile_employment` */;

--
-- Final view structure for view `profile_finance_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `profile_finance_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `profile_finance_mst_vw` AS select `profile_finance_mst`.`PROFILE_ID` AS `PROFILE_ID`,(select concat(ifnull(`profile_finance_mst`.`PRO_FIRSTNAME`,''),'',ifnull(`profile_finance_mst`.`PRO_SURNAME`,''))) AS `PRO_FULL_NAME`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`profile_finance_mst`.`PRO_TITLE` = `independent_mst`.`MSTR_ID`)) AS `PRO_TITLE`,`profile_finance_mst`.`PRO_SURNAME` AS `PRO_SURNAME`,`profile_finance_mst`.`PRO_FIRSTNAME` AS `PRO_FIRSTNAME`,`profile_finance_mst`.`PRO_COMPANY_NAME` AS `PRO_COMPANY_NAME`,`profile_finance_mst`.`PRO_ADDRESS` AS `PRO_ADDRESS`,`profile_finance_mst`.`PRO_POSTCODE` AS `PRO_POSTCODE`,`profile_finance_mst`.`PRO_MOVED_ADD` AS `PRO_MOVED_ADD`,if((`profile_finance_mst`.`PRO_YOUR_DETAILS` = 1),'Yes','No') AS `PRO_YOUR_DETAILS`,`profile_finance_mst`.`PRO_PHN_NUMBER` AS `PRO_PHN_NUMBER`,`profile_finance_mst`.`PRO_EMAIL_ADDRESS` AS `PRO_EMAIL_ADDRESS`,`profile_finance_mst`.`PRO_DATE_OF_BIRTH` AS `PRO_DATE_OF_BIRTH`,`profile_finance_mst`.`PRO_NUMBER_DEPENDANT` AS `PRO_NUMBER_DEPENDANT`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`profile_finance_mst`.`PRO_SINGLE` = `independent_mst`.`MSTR_ID`)) AS `PRO_SINGLE`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`profile_finance_mst`.`PRO_SPECIFY` = `independent_mst`.`MSTR_ID`)) AS `PRO_SPECIFY`,`profile_finance_mst`.`PRO_OTHERS_INFO` AS `PRO_OTHERS_INFO`,`profile_finance_mst`.`IS_DELETED` AS `IS_DELETED`,`profile_finance_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`profile_finance_mst`.`CREATED_BY` AS `CREATED_BY`,`profile_finance_mst`.`UPDATED_BY` AS `UPDATED_BY`,`profile_finance_mst`.`CREATED_ON` AS `CREATED_ON`,`profile_finance_mst`.`UPDATED_ON` AS `UPDATED_ON`,`profile_finance_mst`.`OA_ID` AS `OA_ID`,`profile_finance_mst`.`USER_ID` AS `USER_ID` from `profile_finance_mst` */;

--
-- Final view structure for view `profile_monthly_income_details_vw`
--

/*!50001 DROP VIEW IF EXISTS `profile_monthly_income_details_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `profile_monthly_income_details_vw` AS select `profile_monthly_income_details`.`MONTHLY_ID` AS `MONTHLY_ID`,`profile_monthly_income_details`.`PROFILE_ID` AS `PRO_ID`,(select concat(`profile_finance_mst`.`PRO_FIRSTNAME`,'  ',`profile_finance_mst`.`PRO_SURNAME`) from `profile_finance_mst` where (`profile_finance_mst`.`PROFILE_ID` = `PRO_ID`)) AS `PROFILE_NAME`,`profile_monthly_income_details`.`MON_NET_SALARY` AS `MON_NET_SALARY`,`profile_monthly_income_details`.`MON_SPOUSE_SALARY` AS `MON_SPOUSE_SALARY`,`profile_monthly_income_details`.`MON_STATE_BENIFITS` AS `MON_STATE_BENIFITS`,`profile_monthly_income_details`.`MON_INVESTMENT_INC` AS `MON_INVESTMENT_INC`,`profile_monthly_income_details`.`MON_REGULAR_INC` AS `MON_REGULAR_INC`,`profile_monthly_income_details`.`MON_TOTALLY_MONTLY_INC` AS `MON_TOTALLY_MONTLY_INC`,`profile_monthly_income_details`.`MON_RENT` AS `MON_RENT`,`profile_monthly_income_details`.`MON_LIFE_ASSURANCE` AS `MON_LIFE_ASSURANCE`,`profile_monthly_income_details`.`MON_GENERAL` AS `MON_GENERAL`,`profile_monthly_income_details`.`MON_COUNCIL_TAX` AS `MON_COUNCIL_TAX`,`profile_monthly_income_details`.`MON_OTHER_EXP` AS `MON_OTHER_EXP`,`profile_monthly_income_details`.`MON_TOTALLY_MONTH_EXP` AS `MON_TOTALLY_MONTH_EXP`,`profile_monthly_income_details`.`IS_DELETED` AS `IS_DELETED`,`profile_monthly_income_details`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`profile_monthly_income_details`.`CREATED_BY` AS `CREATED_BY`,`profile_monthly_income_details`.`UPDATED_BY` AS `UPDATED_BY`,`profile_monthly_income_details`.`CREATED_ON` AS `CREATED_ON`,`profile_monthly_income_details`.`UPDATED_ON` AS `UPDATED_ON`,`profile_monthly_income_details`.`OA_ID` AS `OA_ID`,`profile_monthly_income_details`.`USER_ID` AS `USER_ID` from `profile_monthly_income_details` */;

--
-- Final view structure for view `profile_other_assets_vw`
--

/*!50001 DROP VIEW IF EXISTS `profile_other_assets_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `profile_other_assets_vw` AS select `profile_other_assets`.`OTHER_ASSETS_ID` AS `OTHER_ASSETS_ID`,`profile_other_assets`.`PROFILE_ID` AS `PRO_ID`,(select concat(`profile_finance_mst`.`PRO_FIRSTNAME`,'  ',`profile_finance_mst`.`PRO_SURNAME`) from `profile_finance_mst` where (`profile_finance_mst`.`PROFILE_ID` = `PRO_ID`)) AS `PROFILE_NAME`,`profile_other_assets`.`OTH_CASH_DEPOSIT` AS `OTH_CASH_DEPOSIT`,`profile_other_assets`.`OTH_QUO_SHARES` AS `OTH_QUO_SHARES`,`profile_other_assets`.`OTH_LIFE_POLICY` AS `OTH_LIFE_POLICY`,`profile_other_assets`.`OTH_OTHER` AS `OTH_OTHER`,`profile_other_assets`.`OTH_BANK_NAME` AS `OTH_BANK_NAME`,`profile_other_assets`.`OTH_DEATH_COVER` AS `OTH_DEATH_COVER`,`profile_other_assets`.`OTH_SPECIFY` AS `OTH_SPECIFY`,`profile_other_assets`.`IS_DELETED` AS `IS_DELETED`,`profile_other_assets`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`profile_other_assets`.`CREATED_BY` AS `CREATED_BY`,`profile_other_assets`.`UPDATED_BY` AS `UPDATED_BY`,`profile_other_assets`.`CREATED_ON` AS `CREATED_ON`,`profile_other_assets`.`UPDATED_ON` AS `UPDATED_ON`,`profile_other_assets`.`OA_ID` AS `OA_ID`,`profile_other_assets`.`USER_ID` AS `USER_ID` from `profile_other_assets` */;

--
-- Final view structure for view `profile_other_liabilities_vw`
--

/*!50001 DROP VIEW IF EXISTS `profile_other_liabilities_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `profile_other_liabilities_vw` AS select `profile_other_liabilities`.`LIABILITIES_ID` AS `LIABILITIES_ID`,`profile_other_liabilities`.`PROFILE_ID` AS `PRO_ID`,(select concat(`profile_finance_mst`.`PRO_FIRSTNAME`,'  ',`profile_finance_mst`.`PRO_SURNAME`) from `profile_finance_mst` where (`profile_finance_mst`.`PROFILE_ID` = `PRO_ID`)) AS `PROFILE_NAME`,`profile_other_liabilities`.`LIA_LENDER_NAME` AS `LIA_LENDER_NAME`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`profile_other_liabilities`.`LIA_TYPE_OF_LOAN` = `independent_mst`.`MSTR_ID`)) AS `LIA_TYPE_OF_LOAN`,`profile_other_liabilities`.`LIA_AMT_OUTSTANDING` AS `LIA_AMT_OUTSTANDING`,`profile_other_liabilities`.`LIA_AMT_MONTHLY` AS `LIA_AMT_MONTHLY`,`profile_other_liabilities`.`LIA_CREDIT_LIMIT` AS `LIA_CREDIT_LIMIT`,`profile_other_liabilities`.`LIA_FINAL_REPAY` AS `LIA_FINAL_REPAY`,`profile_other_liabilities`.`IS_DELETED` AS `IS_DELETED`,`profile_other_liabilities`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`profile_other_liabilities`.`CREATED_BY` AS `CREATED_BY`,`profile_other_liabilities`.`UPDATED_BY` AS `UPDATED_BY`,`profile_other_liabilities`.`CREATED_ON` AS `CREATED_ON`,`profile_other_liabilities`.`UPDATED_ON` AS `UPDATED_ON`,`profile_other_liabilities`.`OA_ID` AS `OA_ID`,`profile_other_liabilities`.`USER_ID` AS `USER_ID` from `profile_other_liabilities` */;

--
-- Final view structure for view `profile_partner_details_vw`
--

/*!50001 DROP VIEW IF EXISTS `profile_partner_details_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `profile_partner_details_vw` AS select `profile_partner_details`.`PARTNER_ID` AS `PARTNER_ID`,`profile_partner_details`.`PROFILE_ID` AS `PRO_ID`,(select concat(`profile_finance_mst`.`PRO_FIRSTNAME`,'  ',`profile_finance_mst`.`PRO_SURNAME`) from `profile_finance_mst` where (`profile_finance_mst`.`PROFILE_ID` = `PRO_ID`)) AS `PROFILE_NAME`,`profile_partner_details`.`PAR_SURNAME` AS `PAR_SURNAME`,`profile_partner_details`.`PAR_FORENAMES` AS `PAR_FORENAMES`,`profile_partner_details`.`PAR_PARTNER_DOB` AS `PAR_PARTNER_DOB`,`profile_partner_details`.`PAR_OCCUPATION` AS `PAR_OCCUPATION`,if((`profile_partner_details`.`PAR_SELF_EMP` = 1),'Yes','No') AS `PAR_SELF_EMP`,`profile_partner_details`.`PAR_NAME_EMPLOYER` AS `PAR_NAME_EMPLOYER`,`profile_partner_details`.`PAR_ANNAUL_SALARY` AS `PAR_ANNAUL_SALARY`,`profile_partner_details`.`PAR_START_DATE` AS `PAR_START_DATE`,`profile_partner_details`.`IS_DELETED` AS `IS_DELETED`,`profile_partner_details`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`profile_partner_details`.`CREATED_BY` AS `CREATED_BY`,`profile_partner_details`.`UPDATED_BY` AS `UPDATED_BY`,`profile_partner_details`.`CREATED_ON` AS `CREATED_ON`,`profile_partner_details`.`UPDATED_ON` AS `UPDATED_ON`,`profile_partner_details`.`OA_ID` AS `OA_ID`,`profile_partner_details`.`USER_ID` AS `USER_ID` from `profile_partner_details` */;

--
-- Final view structure for view `profile_personal_assets_vw`
--

/*!50001 DROP VIEW IF EXISTS `profile_personal_assets_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `profile_personal_assets_vw` AS select `profile_personal_assets`.`ASSETS_ID` AS `ASSETS_ID`,`profile_personal_assets`.`PROFILE_ID` AS `PRO_ID`,(select concat(`profile_finance_mst`.`PRO_FIRSTNAME`,'  ',`profile_finance_mst`.`PRO_SURNAME`) from `profile_finance_mst` where (`profile_finance_mst`.`PROFILE_ID` = `PRO_ID`)) AS `PROFILE_NAME`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`profile_personal_assets`.`PERSONAL_ASSETS_TYPE` = `independent_mst`.`MSTR_ID`)) AS `PERSONAL_ASSETS_TYPE`,`profile_personal_assets`.`PRESENT_VALUE` AS `PRESENT_VALUE`,`profile_personal_assets`.`MORTGAGE_OUTSTANDING` AS `MORTGAGE_OUTSTANDING`,if((`profile_personal_assets`.`OWNED_SOLELY_JOINTLY` = 1),'Solely','Jointly') AS `OWNED_SOLELY_JOINTLY`,if((`profile_personal_assets`.`IS_PROPERTY` = 1),'Yes','No') AS `IS_PROPERTY`,`profile_personal_assets`.`LENDERS` AS `LENDERS`,`profile_personal_assets`.`TERM_REMAINING` AS `TERM_REMAINING`,`profile_personal_assets`.`REPAYMENT_METHOD` AS `REPAYMENT_METHOD`,`profile_personal_assets`.`IS_DELETED` AS `IS_DELETED`,`profile_personal_assets`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`profile_personal_assets`.`CREATED_BY` AS `CREATED_BY`,`profile_personal_assets`.`UPDATED_BY` AS `UPDATED_BY`,`profile_personal_assets`.`CREATED_ON` AS `CREATED_ON`,`profile_personal_assets`.`UPDATED_ON` AS `UPDATED_ON`,`profile_personal_assets`.`OA_ID` AS `OA_ID`,`profile_personal_assets`.`USER_ID` AS `USER_ID` from `profile_personal_assets` */;

--
-- Final view structure for view `profile_personal_guarantees_vw`
--

/*!50001 DROP VIEW IF EXISTS `profile_personal_guarantees_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `profile_personal_guarantees_vw` AS select `profile_personal_guarantees`.`GUARANTEES_ID` AS `GUARANTEES_ID`,`profile_personal_guarantees`.`PROFILE_ID` AS `PRO_ID`,(select concat(`profile_finance_mst`.`PRO_FIRSTNAME`,'  ',`profile_finance_mst`.`PRO_SURNAME`) from `profile_finance_mst` where (`profile_finance_mst`.`PROFILE_ID` = `PRO_ID`)) AS `PROFILE_NAME`,`profile_personal_guarantees`.`GUA_GRANTED_FOR` AS `GUA_GRANTED_FOR`,`profile_personal_guarantees`.`GUA_PURPOSE` AS `GUA_PURPOSE`,`profile_personal_guarantees`.`GUA_AMT` AS `GUA_AMT`,`profile_personal_guarantees`.`IS_DELETED` AS `IS_DELETED`,`profile_personal_guarantees`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`profile_personal_guarantees`.`CREATED_BY` AS `CREATED_BY`,`profile_personal_guarantees`.`UPDATED_BY` AS `UPDATED_BY`,`profile_personal_guarantees`.`CREATED_ON` AS `CREATED_ON`,`profile_personal_guarantees`.`UPDATED_ON` AS `UPDATED_ON`,`profile_personal_guarantees`.`OA_ID` AS `OA_ID`,`profile_personal_guarantees`.`USER_ID` AS `USER_ID` from `profile_personal_guarantees` */;

--
-- Final view structure for view `program_name_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `program_name_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `program_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`.`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`.`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`.`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` = 658) */;

--
-- Final view structure for view `project_details_vw`
--

/*!50001 DROP VIEW IF EXISTS `project_details_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `project_details_vw` AS select `project_details`.`id` AS `id`,`project_details`.`company_id` AS `company_id`,(select `company_details`.`company_name` from `company_details` where (`company_details`.`cmpy_id` = `project_details`.`company_id`)) AS `Vendor_name`,`project_details`.`project_name` AS `project_name`,`project_details`.`project_code` AS `project_code`,if((`project_details`.`prefix` = 0),'No','Yes') AS `prefix`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `project_details`.`project_type`)) AS `project_type`,`project_details`.`created_on` AS `created_on`,`project_details`.`created_by` AS `created_by`,`project_details`.`UPDATED_ON` AS `UPDATED_ON`,`project_details`.`UPDATED_BY` AS `UPDATED_BY`,`project_details`.`unit` AS `unit`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `project_details`.`unit`)) AS `name_unit`,`project_details`.`rate_per_unit` AS `rate_per_unit`,`project_details`.`vat_tax` AS `vat_tax`,`project_details`.`service_tax` AS `service_tax`,`project_details`.`cst_tax` AS `cst_tax`,`project_details`.`octroi_tax` AS `octroi_tax`,`project_details`.`acc_group` AS `acc_group`,`project_details`.`subacc_group` AS `subacc_group`,`project_details`.`opening_bal` AS `opening_bal`,`project_details`.`OA_ID` AS `OA_ID`,`project_details`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`project_details`.`OA_CD` AS `OA_CD`,`project_details`.`USER_ID` AS `USER_ID`,`project_details`.`IS_DELETED` AS `IS_DELETED` from `project_details` */;

--
-- Final view structure for view `project_status_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `project_status_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `project_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` = 253) */;

--
-- Final view structure for view `property_applicant_details_vw`
--

/*!50001 DROP VIEW IF EXISTS `property_applicant_details_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `property_applicant_details_vw` AS select `property_applicant_details`.`PROP_ID` AS `PROP_ID`,`property_applicant_details`.`PROP_NAME` AS `PROP_NAME`,`property_applicant_details`.`PROP_ADDRESS` AS `PROP_ADDRESS`,`property_applicant_details`.`PROP_POSTCODE` AS `PROP_POSTCODE`,`property_applicant_details`.`PROP_TELEPHONE_NO` AS `PROP_TELEPHONE_NO`,`property_applicant_details`.`PROP_FAX_NO` AS `PROP_FAX_NO`,`property_applicant_details`.`PROP_EMAIL_ADDRESS` AS `PROP_EMAIL_ADDRESS`,`property_applicant_details`.`PROP_WEB_URL` AS `PROP_WEB_URL`,`property_applicant_details`.`PROP_PROJECT_LOCATION` AS `PROP_PROJECT_LOCATION`,`property_applicant_details`.`OA_ID` AS `OA_ID`,`property_applicant_details`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`property_applicant_details`.`USER_ID` AS `USER_ID`,`property_applicant_details`.`IS_DELETED` AS `IS_DELETED`,`property_applicant_details`.`CREATED_ON` AS `CREATED_ON`,`property_applicant_details`.`CREATED_BY` AS `CREATED_BY`,`property_applicant_details`.`UPDATED_ON` AS `UPDATED_ON`,`property_applicant_details`.`UPDATED_BY` AS `UPDATED_BY` from `property_applicant_details` */;

--
-- Final view structure for view `property_company_details_vw`
--

/*!50001 DROP VIEW IF EXISTS `property_company_details_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `property_company_details_vw` AS select `property_company_details`.`COMPANY_ID` AS `COMPANY_ID`,`property_company_details`.`COMPANY_NAME` AS `COMPANY_NAME`,`property_company_details`.`NATURE_OF_BUSINESS` AS `NATURE_OF_BUSINESS`,`property_company_details`.`BUSINESS_ADDRESS` AS `BUSINESS_ADDRESS`,`property_company_details`.`POSTCODE` AS `POSTCODE`,`property_company_details`.`TELEPHONE_NO` AS `TELEPHONE_NO`,`property_company_details`.`FAX_NO` AS `FAX_NO`,`property_company_details`.`EMAIL_ADDRESS` AS `EMAIL_ADDRESS`,`property_company_details`.`WEB_URL_ADDRESS` AS `WEB_URL_ADDRESS`,`property_company_details`.`PREVIOUS_BUSINESS_ADDRESS` AS `PREVIOUS_BUSINESS_ADDRESS`,`property_company_details`.`TYPE_OF_BUSINESS` AS `TYPE_OF_BUSINESS`,`property_company_details`.`REGISTRATION_NUMBER` AS `REGISTRATION_NUMBER`,`property_company_details`.`COUNTRY_OF_REGISTRATION` AS `COUNTRY_OF_REGISTRATION`,`property_company_details`.`DATE_OF_INCORPORATION` AS `DATE_OF_INCORPORATION`,`property_company_details`.`REGISTERED_ADDRESS` AS `REGISTERED_ADDRESS`,`property_company_details`.`TURNOVER` AS `TURNOVER`,`property_company_details`.`GROSS_PROFIT` AS `GROSS_PROFIT`,`property_company_details`.`NET_PROFIT` AS `NET_PROFIT`,`property_company_details`.`OA_ID` AS `OA_ID`,`property_company_details`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`property_company_details`.`USER_ID` AS `USER_ID`,`property_company_details`.`IS_DELETED` AS `IS_DELETED`,`property_company_details`.`CREATED_ON` AS `CREATED_ON`,`property_company_details`.`CREATED_BY` AS `CREATED_BY`,`property_company_details`.`UPDATED_ON` AS `UPDATED_ON`,`property_company_details`.`UPDATED_BY` AS `UPDATED_BY` from `property_company_details` */;

--
-- Final view structure for view `property_company_directors_vw`
--

/*!50001 DROP VIEW IF EXISTS `property_company_directors_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `property_company_directors_vw` AS select `property_company_directors`.`PROP_ID` AS `PROP_ID`,`property_company_directors`.`PROP_NAME` AS `PROP_NAME`,`property_company_directors`.`PROP_ROLE` AS `PROP_ROLE`,`property_company_directors`.`PROP_PROFESSION` AS `PROP_PROFESSION`,`property_company_directors`.`OA_ID` AS `OA_ID`,`property_company_directors`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`property_company_directors`.`USER_ID` AS `USER_ID`,`property_company_directors`.`IS_DELETED` AS `IS_DELETED`,`property_company_directors`.`CREATED_ON` AS `CREATED_ON`,`property_company_directors`.`CREATED_BY` AS `CREATED_BY`,`property_company_directors`.`UPDATED_ON` AS `UPDATED_ON`,`property_company_directors`.`UPDATED_BY` AS `UPDATED_BY` from `property_company_directors` */;

--
-- Final view structure for view `property_construction_team_vw`
--

/*!50001 DROP VIEW IF EXISTS `property_construction_team_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `property_construction_team_vw` AS select `property_construction_team`.`TEAM_ID` AS `TEAM_ID`,if((`property_construction_team`.`TEAM_FIXED_PRICE` = 0),'Yes','No') AS `TEAM_FIXED_PRICE`,if((`property_construction_team`.`TEAM_OWN_STAFF` = 0),'Yes','No') AS `TEAM_OWN_STAFF`,if((`property_construction_team`.`TEAM_CONTRACTOR_IDENTIFIED` = 0),'Yes','No') AS `TEAM_CONTRACTOR_IDENTIFIED`,`property_construction_team`.`TEAM_CONTRACTOR_NAME` AS `TEAM_CONTRACTOR_NAME`,`property_construction_team`.`TEAM_BUSINESS_ADDRESS` AS `TEAM_BUSINESS_ADDRESS`,`property_construction_team`.`TEAM_POSTCODE` AS `TEAM_POSTCODE`,`property_construction_team`.`OA_ID` AS `OA_ID`,`property_construction_team`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`property_construction_team`.`USER_ID` AS `USER_ID`,`property_construction_team`.`IS_DELETED` AS `IS_DELETED`,`property_construction_team`.`CREATED_ON` AS `CREATED_ON`,`property_construction_team`.`CREATED_BY` AS `CREATED_BY`,`property_construction_team`.`UPDATED_ON` AS `UPDATED_ON`,`property_construction_team`.`UPDATED_BY` AS `UPDATED_BY` from `property_construction_team` */;

--
-- Final view structure for view `property_credit_history_vw`
--

/*!50001 DROP VIEW IF EXISTS `property_credit_history_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `property_credit_history_vw` AS select `property_credit_history`.`CREDIT_ID` AS `CREDIT_ID`,if((`property_credit_history`.`CREDIT_BUSINESS_EVER` = 0),'Yes','No') AS `CREDIT_BUSINESS_EVER`,if((`property_credit_history`.`CREDIT_CREDITORS` = 0),'Yes','No') AS `CREDIT_CREDITORS`,if((`property_credit_history`.`CREDIT_REPOSSESSED` = 0),'Yes','No') AS `CREDIT_REPOSSESSED`,if((`property_credit_history`.`CREDIT_REGISTERED` = 0),'Yes','No') AS `CREDIT_REGISTERED`,if((`property_credit_history`.`CREDIT_REPAYMENTS` = 0),'Yes','No') AS `CREDIT_REPAYMENTS`,if((`property_credit_history`.`CREDIT_AGREEMENTS` = 0),'Yes','No') AS `CREDIT_AGREEMENTS`,`property_credit_history`.`OA_ID` AS `OA_ID`,`property_credit_history`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`property_credit_history`.`USER_ID` AS `USER_ID`,`property_credit_history`.`IS_DELETED` AS `IS_DELETED`,`property_credit_history`.`CREATED_ON` AS `CREATED_ON`,`property_credit_history`.`CREATED_BY` AS `CREATED_BY`,`property_credit_history`.`UPDATED_ON` AS `UPDATED_ON`,`property_credit_history`.`UPDATED_BY` AS `UPDATED_BY` from `property_credit_history` */;

--
-- Final view structure for view `property_current_project_details_vw`
--

/*!50001 DROP VIEW IF EXISTS `property_current_project_details_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `property_current_project_details_vw` AS select `property_current_project_details`.`CURRENT_ID` AS `CURRENT_ID`,`property_current_project_details`.`DESCRIPTION` AS `DESCRIPTION`,`property_current_project_details`.`PRESENT_VALUE` AS `PRESENT_VALUE`,`property_current_project_details`.`BUILD_COSTS` AS `BUILD_COSTS`,`property_current_project_details`.`PRESENT_LENDINGS` AS `PRESENT_LENDINGS`,`property_current_project_details`.`PROJECTED_GDV` AS `PROJECTED_GDV`,`property_current_project_details`.`OA_ID` AS `OA_ID`,`property_current_project_details`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`property_current_project_details`.`USER_ID` AS `USER_ID`,`property_current_project_details`.`IS_DELETED` AS `IS_DELETED`,`property_current_project_details`.`CREATED_ON` AS `CREATED_ON`,`property_current_project_details`.`CREATED_BY` AS `CREATED_BY`,`property_current_project_details`.`UPDATED_ON` AS `UPDATED_ON`,`property_current_project_details`.`UPDATED_BY` AS `UPDATED_BY` from `property_current_project_details` */;

--
-- Final view structure for view `property_planning_permission_vw`
--

/*!50001 DROP VIEW IF EXISTS `property_planning_permission_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `property_planning_permission_vw` AS select `property_planning_permission`.`PLAN_ID` AS `PLAN_ID`,`property_planning_permission`.`IS_PLANNING_PERMISSION` AS `IS_PLANNING_PERMISSION`,`property_planning_permission`.`PLANNING_AUTHORITY` AS `PLANNING_AUTHORITY`,`property_planning_permission`.`DATE_APPLIED_FOR` AS `DATE_APPLIED_FOR`,`property_planning_permission`.`DATE_APPROVED` AS `Date_Approved`,`property_planning_permission`.`OA_ID` AS `OA_ID`,`property_planning_permission`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`property_planning_permission`.`USER_ID` AS `USER_ID`,`property_planning_permission`.`IS_DELETED` AS `IS_DELETED`,`property_planning_permission`.`CREATED_ON` AS `CREATED_ON`,`property_planning_permission`.`CREATED_BY` AS `CREATED_BY`,`property_planning_permission`.`UPDATED_ON` AS `UPDATED_ON`,`property_planning_permission`.`UPDATED_BY` AS `UPDATED_BY` from `property_planning_permission` */;

--
-- Final view structure for view `property_previous_experience_vw`
--

/*!50001 DROP VIEW IF EXISTS `property_previous_experience_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `property_previous_experience_vw` AS select `property_previous_experience`.`EXPERIENCE_ID` AS `EXPERIENCE_ID`,`property_previous_experience`.`PREVIOUS_EXPERIENCE` AS `PREVIOUS_EXPERIENCE`,`property_previous_experience`.`OA_ID` AS `OA_ID`,`property_previous_experience`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`property_previous_experience`.`USER_ID` AS `USER_ID`,`property_previous_experience`.`IS_DELETED` AS `IS_DELETED`,`property_previous_experience`.`CREATED_ON` AS `CREATED_ON`,`property_previous_experience`.`CREATED_BY` AS `CREATED_BY`,`property_previous_experience`.`UPDATED_ON` AS `UPDATED_ON`,`property_previous_experience`.`UPDATED_BY` AS `UPDATED_BY` from `property_previous_experience` */;

--
-- Final view structure for view `property_project_cost_vw`
--

/*!50001 DROP VIEW IF EXISTS `property_project_cost_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `property_project_cost_vw` AS select `property_project_cost`.`COST_ID` AS `COST_ID`,`property_project_cost`.`LAND` AS `LAND`,`property_project_cost`.`PROJECT_BUILD` AS `PROJECT_BUILD`,`property_project_cost`.`PROFESSIONAL_FEES` AS `PROFESSIONAL_FEES`,`property_project_cost`.`MONEY_EXPENDED` AS `MONEY_EXPENDED`,`property_project_cost`.`TOTAL_PROJECT_COST` AS `TOTAL_PROJECT_COST`,`property_project_cost`.`GROSS_VALUE` AS `GROSS_VALUE`,`property_project_cost`.`OWN_FUNDS` AS `OWN_FUNDS`,`property_project_cost`.`OA_ID` AS `OA_ID`,`property_project_cost`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`property_project_cost`.`USER_ID` AS `USER_ID`,`property_project_cost`.`IS_DELETED` AS `IS_DELETED`,`property_project_cost`.`CREATED_ON` AS `CREATED_ON`,`property_project_cost`.`CREATED_BY` AS `CREATED_BY`,`property_project_cost`.`UPDATED_ON` AS `UPDATED_ON`,`property_project_cost`.`UPDATED_BY` AS `UPDATED_BY` from `property_project_cost` */;

--
-- Final view structure for view `property_project_description_vw`
--

/*!50001 DROP VIEW IF EXISTS `property_project_description_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `property_project_description_vw` AS select `property_project_description`.`PROJECT_ID` AS `PROJECT_ID`,`property_project_description`.`PROJECT_DESCRIPTION` AS `PROJECT_DESCRIPTION`,`property_project_description`.`OA_ID` AS `OA_ID`,`property_project_description`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`property_project_description`.`USER_ID` AS `USER_ID`,`property_project_description`.`IS_DELETED` AS `IS_DELETED`,`property_project_description`.`CREATED_ON` AS `CREATED_ON`,`property_project_description`.`CREATED_BY` AS `CREATED_BY`,`property_project_description`.`UPDATED_ON` AS `UPDATED_ON`,`property_project_description`.`UPDATED_BY` AS `UPDATED_BY` from `property_project_description` */;

--
-- Final view structure for view `property_project_site_vw`
--

/*!50001 DROP VIEW IF EXISTS `property_project_site_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `property_project_site_vw` AS select `property_project_site`.`PROJECT_ID` AS `PROJECT_ID`,if((`property_project_site`.`PURCHASED` = 0),'Yes','No') AS `PURCHASED`,if((`property_project_site`.`IS_CONTRACT_EXCHANGED` = 0),'Yes','No') AS `IS_CONTRACT_EXCHANGED`,if((`property_project_site`.`DEPOSITE_PAID` = 0),'Yes','No') AS `DEPOSITE_PAID`,`property_project_site`.`SITE` AS `SITE`,`property_project_site`.`SIZE_EXISTING_SITE` AS `SIZE_EXISTING_SITE`,`property_project_site`.`SIZE_PROPOSED_SITE` AS `SIZE_PROPOSED_SITE`,`property_project_site`.`PROPOSED_START_DATE` AS `PROPOSED_START_DATE`,`property_project_site`.`COMPLETION_DATE` AS `COMPLETION_DATE`,`property_project_site`.`OA_ID` AS `OA_ID`,`property_project_site`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`property_project_site`.`USER_ID` AS `USER_ID`,`property_project_site`.`IS_DELETED` AS `IS_DELETED`,`property_project_site`.`CREATED_ON` AS `CREATED_ON`,`property_project_site`.`CREATED_BY` AS `CREATED_BY`,`property_project_site`.`UPDATED_ON` AS `UPDATED_ON`,`property_project_site`.`UPDATED_BY` AS `UPDATED_BY` from `property_project_site` */;

--
-- Final view structure for view `proposal_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `proposal_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `proposal_mst_vw` AS select `proposal_mst`.`PROPOSAL_ID` AS `PROPOSAL_ID`,`proposal_mst`.`CONVERT_TO_INVOICE` AS `CONVERT_TO_INVOICE`,`proposal_mst`.`PROPOSAL_NO` AS `PROPOSAL_NO`,`proposal_mst`.`COMPANY_ID` AS `COMPANY_ID`,`proposal_mst`.`COMPANY_NM` AS `COMPANY_NM`,`proposal_mst`.`PROPOSAL_UNIT` AS `PROPOSAL_UNIT`,`proposal_mst`.`PROPOSAL_DATE` AS `PROPOSAL_DATE`,`proposal_mst`.`STATUS` AS `STATUS`,`proposal_mst`.`START_DATE` AS `START_DATE`,`proposal_mst`.`END_DATE` AS `END_DATE`,`proposal_mst`.`FOR_DESCRIPTION` AS `FOR_DESCRIPTION`,`proposal_mst`.`VAT_PERCENT` AS `VAT_PERCENT`,`proposal_mst`.`VAT_AMOUNT` AS `VAT_AMOUNT`,`proposal_mst`.`TOTAL_AMOUNT` AS `TOTAL_AMOUNT`,`proposal_mst`.`PAID_PROPOSAL` AS `PAID_PROPOSAL`,`proposal_mst`.`PROPOSAL_AMOUNT` AS `PROPOSAL_AMOUNT`,`proposal_mst`.`PROPOSAL_STATUS` AS `PROPOSAL_STATUS`,`proposal_mst`.`ORG_ID` AS `ORG_ID`,`proposal_mst`.`DUE_DATE` AS `DUE_DATE`,`proposal_mst`.`DUE_DAYS` AS `DUE_DAYS`,`proposal_mst`.`PROJECT_ID` AS `PROJECT_ID`,`proposal_mst`.`PROJECT_NM` AS `PROJECT_NM`,`proposal_mst`.`GENERATED` AS `GENERATED`,`proposal_mst`.`PROPOSAL_PREFIX` AS `PROPOSAL_PREFIX`,`proposal_mst`.`FY_ID` AS `FY_ID`,`proposal_mst`.`OA_ID` AS `OA_ID`,`proposal_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`proposal_mst`.`USER_ID` AS `USER_ID`,`proposal_mst`.`IS_DELETED` AS `IS_DELETED`,`proposal_mst`.`CREATED_BY` AS `CREATED_BY`,`proposal_mst`.`UPDATED_BY` AS `UPDATED_BY`,`proposal_mst`.`CREATED_ON` AS `CREATED_ON`,`proposal_mst`.`UPDATED_ON` AS `UPDATED_ON` from `proposal_mst` */;

--
-- Final view structure for view `prsnttn_layer_obj_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `prsnttn_layer_obj_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `prsnttn_layer_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` = 20) */;

--
-- Final view structure for view `pub_about_loan_vw`
--

/*!50001 DROP VIEW IF EXISTS `pub_about_loan_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `pub_about_loan_vw` AS select `pub_about_loan`.`ABOUTLOAN_ID` AS `ABOUTLOAN_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`pub_about_loan`.`BUSINESS_TYPE` = `independent_mst`.`MSTR_ID`)) AS `BUSINESS_TYPE`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`pub_about_loan`.`LOAN_REQUIRED` = `independent_mst`.`MSTR_ID`)) AS `LOAN_REQUIRED`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`pub_about_loan`.`CONTACT_TIME` = `independent_mst`.`MSTR_ID`)) AS `CONTACT_TIME`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`pub_about_loan`.`REFERENCE` = `independent_mst`.`MSTR_ID`)) AS `REFERENCE`,`pub_about_loan`.`INFORMATION` AS `INFORMATION`,`pub_about_loan`.`OA_ID` AS `OA_ID`,`pub_about_loan`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`pub_about_loan`.`USER_ID` AS `USER_ID`,`pub_about_loan`.`IS_DELETED` AS `IS_DELETED`,`pub_about_loan`.`CREATED_ON` AS `CREATED_ON`,`pub_about_loan`.`CREATED_BY` AS `CREATED_BY`,`pub_about_loan`.`UPDATED_ON` AS `UPDATED_ON`,`pub_about_loan`.`UPDATED_BY` AS `UPDATED_BY` from `pub_about_loan` */;

--
-- Final view structure for view `pub_about_you_vw`
--

/*!50001 DROP VIEW IF EXISTS `pub_about_you_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `pub_about_you_vw` AS select `pub_about_you`.`A_ID` AS `A_ID`,`pub_about_you`.`FIRST_NAME` AS `FIRST_NAME`,`pub_about_you`.`LAST_NAME` AS `LAST_NAME`,`pub_about_you`.`EMAIL` AS `EMAIL`,`pub_about_you`.`MOBILE` AS `MOBILE`,`pub_about_you`.`OA_ID` AS `OA_ID`,`pub_about_you`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`pub_about_you`.`USER_ID` AS `USER_ID`,`pub_about_you`.`ISDELETED` AS `ISDELETED`,`pub_about_you`.`CREATED_ON` AS `CREATED_ON`,`pub_about_you`.`CREATED_BY` AS `CREATED_BY`,`pub_about_you`.`UPDATED_ON` AS `UPDATED_ON`,`pub_about_you`.`UPDATED_BY` AS `UPDATED_BY` from `pub_about_you` */;

--
-- Final view structure for view `publish_result_vw`
--

/*!50001 DROP VIEW IF EXISTS `publish_result_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `publish_result_vw` AS select `publish_result`.`PUBLISH_RESULT_ID` AS `PUBLISH_RESULT_ID`,`publish_result`.`EXAM_TYPE_ID` AS `EXAM_TYPE_ID`,(select `exam_type`.`EXAM_TYPE` from `exam_type` where (`exam_type`.`EXAM_TYPE_ID` = `publish_result`.`EXAM_TYPE_ID`)) AS `EXAM_NM`,`publish_result`.`CLASS_ID` AS `CLASS_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `publish_result`.`CLASS_ID`)) AS `CLASS_NM`,if((`publish_result`.`MARKS` = 0),'With Out Marks','With Marks') AS `MARKS`,`publish_result`.`SUBJECT` AS `SUBJECT`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `publish_result`.`SUBJECT`)) AS `SUBJECT_NM`,`publish_result`.`MESSAGE` AS `MESSAGE`,`publish_result`.`OA_ID` AS `OA_ID`,`publish_result`.`USER_ID` AS `USER_ID`,`publish_result`.`CREATED_BY` AS `CREATED_BY`,`publish_result`.`UPDATED_BY` AS `UPDATED_BY`,`publish_result`.`CREATED_ON` AS `CREATED_ON`,`publish_result`.`UPDATED_ON` AS `UPDATED_ON`,`publish_result`.`IS_DELETED` AS `IS_DELETED`,`publish_result`.`OA_BRAND_ID` AS `OA_BRAND_ID` from `publish_result` */;

--
-- Final view structure for view `punch_monitor_vw`
--

/*!50001 DROP VIEW IF EXISTS `punch_monitor_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `punch_monitor_vw` AS select `punch_monitor`.`ID` AS `ID`,`punch_monitor`.`ATTND_EMP_ID` AS `ATTND_EMP_ID`,`punch_monitor`.`EMP_CD` AS `EMP_CD`,`punch_monitor`.`EMP_STATUS_ID` AS `EMP_STATUS_ID`,(select `AE`.`EMP_NM` from `attendance_employee` `AE` where (`AE`.`ATTND_EMP_ID` = `punch_monitor`.`ATTND_EMP_ID`) limit 1) AS `EMPLOYEE_NM`,`punch_monitor`.`DATE` AS `DATE`,`punch_monitor`.`PUNCH_IN_USER_TIME` AS `PUNCH_IN_USER_TIME`,`punch_monitor`.`PUNCH_OUT_USER_TIME` AS `PUNCH_OUT_USER_TIME`,`punch_monitor`.`WORKED_HOURS` AS `WORKED_HOURS`,`punch_monitor`.`ATTENDANCE` AS `ATTENDANCE`,`punch_monitor`.`IS_DELETED` AS `IS_DELETED`,`punch_monitor`.`OA_ID` AS `OA_ID`,`punch_monitor`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`punch_monitor`.`USER_ID` AS `USER_ID`,`punch_monitor`.`CREATED_BY` AS `CREATED_BY`,`punch_monitor`.`UPDATED_BY` AS `UPDATED_BY`,`punch_monitor`.`CREATED_ON` AS `CREATED_ON`,`punch_monitor`.`UPDATED_ON` AS `UPDATED_ON` from `punch_monitor` */;

--
-- Final view structure for view `quote_vw`
--

/*!50001 DROP VIEW IF EXISTS `quote_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `quote_vw` AS select `quote`.`Q_ID` AS `Q_ID`,`quote`.`B_ID` AS `B_ID`,(select `b`.`B_NAME` from `building_info` `b` where (`b`.`B_ID` = `quote`.`B_ID`) limit 1) AS `B_NAME`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`quote`.`HEIGHT` = `independent_mst`.`MSTR_ID`)) AS `HEIGHT`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`quote`.`WIDTH` = `independent_mst`.`MSTR_ID`)) AS `WIDTH`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`quote`.`CLADDING` = `independent_mst`.`MSTR_ID`)) AS `CLADDING`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`quote`.`EXTRA_BUILDING` = `independent_mst`.`MSTR_ID`)) AS `EXTRA_BUILDING`,`quote`.`OA_ID` AS `OA_ID`,`quote`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`quote`.`USER_ID` AS `USER_ID`,`quote`.`IS_DELETED` AS `IS_DELETED`,`quote`.`CREATED_ON` AS `CREATED_ON`,`quote`.`CREATED_BY` AS `CREATED_BY`,`quote`.`UPDATED_ON` AS `UPDATED_ON`,`quote`.`UPDATED_BY` AS `UPDATED_BY` from `quote` */;

--
-- Final view structure for view `quotes_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `quotes_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `quotes_mst_vw` AS select `QM`.`QUOTES_ID` AS `QUOTES_ID`,`QM`.`QUOTES_NO` AS `QUOTES_NO`,(select concat(`QM`.`QUOTES_PREFIX`,' ',`QM`.`QUOTES_NO`)) AS `QUOTES_PRENO`,`QM`.`COMPANY_ID` AS `COMPANY_ID`,(select `company_details`.`company_name` from `company_details` where (`company_details`.`cmpy_id` = `QM`.`COMPANY_ID`)) AS `Company_name`,`QM`.`quo_status` AS `quo_status`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `QM`.`quo_status`)) AS `Quotes_Status`,`QM`.`QUOTES_DATE` AS `QUOTES_DATE`,`QM`.`START_DATE` AS `START_DATE`,`QM`.`END_DATE` AS `END_DATE`,`QM`.`FOR_DESCRIPTION` AS `FOR_DESCRIPTION`,`QM`.`VAT_PERCENT` AS `VAT_PERCENT`,`QM`.`VAT_AMOUNT` AS `VAT_AMOUNT`,`QM`.`TOTAL_AMT` AS `TOTAL_AMT`,`QM`.`QUOTES_AMOUNT` AS `QUOTES_AMOUNT`,`QM`.`created_on` AS `created_on`,`QM`.`created_by` AS `created_by`,`QM`.`UPDATED_ON` AS `UPDATED_ON`,`QM`.`UPDATED_BY` AS `UPDATED_BY`,`QM`.`FY_ID` AS `FY_ID`,`QM`.`PROJECT_ID` AS `PROJECT_ID`,`QM`.`DUE_DAYS` AS `DUE_DAYS`,`QM`.`DUE_DATE` AS `DUE_DATE`,(select `project_details`.`project_name` from `project_details` where (`project_details`.`id` = `QM`.`PROJECT_ID`)) AS `PROJECT_NAME`,`QM`.`payment_paid` AS `payment_paid`,`QM`.`balance` AS `balance`,`QM`.`OA_ID` AS `org_id`,(select `ob`.`OA_BRAND_LOGO` from `oa_brands` `ob` where ((`ob`.`OA_ID` = `QM`.`OA_ID`) and (`ob`.`OA_BRAND_ID` = `QM`.`OA_BRAND_ID`))) AS `OA_BRAND_LOGO`,`QM`.`QUOTES_UNIT` AS `QUOTES_UNIT`,`QM`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`QM`.`OA_CD` AS `org_cd`,(select `oais`.`ORG_TEMPLATE` from `org_acc_invoice_settings` `oais` where ((`oais`.`OA_ID` = `QM`.`OA_ID`) and (`oais`.`OA_BRAND_ID` = `QM`.`OA_BRAND_ID`) and (`oais`.`TEMPLATE_SETTING_ID` = 5565))) AS `org_template`,(select `oais`.`MAIL_PDF` from `org_acc_invoice_settings` `oais` where ((`oais`.`OA_ID` = `QM`.`OA_ID`) and (`oais`.`OA_BRAND_ID` = `QM`.`OA_BRAND_ID`) and (`oais`.`TEMPLATE_SETTING_ID` = 5565))) AS `mail_pdf`,`QM`.`GENERATED` AS `GENERATED`,if((`QM`.`GENERATED` = 0),'No','Yes') AS `isgenerated`,`QM`.`MARK_SEND` AS `MARK_SEND`,if((`QM`.`MARK_SEND` = 0),'No','Yes') AS `MARK_SENT`,`QM`.`QUOTES_PREFIX` AS `QUOTES_PREFIX`,`QM`.`GENERATED_PATH` AS `GENERATED_PATH`,`QM`.`IS_DELETED` AS `IS_DELETED`,`QM`.`USER_ID` AS `USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `QM`.`USER_ID`)) AS `USER_NAME` from `quotes_mst` `QM` */;

--
-- Final view structure for view `race_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `race_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `race_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` = 136) */;

--
-- Final view structure for view `realtionship_type_vw`
--

/*!50001 DROP VIEW IF EXISTS `realtionship_type_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `realtionship_type_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` = 160) */;

--
-- Final view structure for view `recruitment_attachement_vw`
--

/*!50001 DROP VIEW IF EXISTS `recruitment_attachement_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `recruitment_attachement_vw` AS select `recruitment_attachement`.`ATTACHMENT_ID` AS `ATTACHMENT_ID`,`recruitment_attachement`.`ATTACHMENT_REF_TYPE_ID` AS `ATTACHMENT_REF_TYPE_ID`,(select `independent_mst`.`MSTR_ID` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `recruitment_attachement`.`ATTACHMENT_REF_TYPE_ID`)) AS `ATTACHMENT_REF_TYPE`,`recruitment_attachement`.`ATTACHEMENT_REF_ID` AS `ATTACHEMENT_REF_ID`,`recruitment_attachement`.`FILE_NAME` AS `FILE_NAME`,`recruitment_attachement`.`FILE_TYPE` AS `FILE_TYPE`,`recruitment_attachement`.`FILE_SIZE` AS `FILE_SIZE`,`recruitment_attachement`.`FILE_CONTENT` AS `FILE_CONTENT`,`recruitment_attachement`.`FILE_ATTACHMENT_TYPE_ID` AS `FILE_ATTACHMENT_TYPE_ID`,(select `independent_mst`.`MSTR_ID` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `recruitment_attachement`.`FILE_ATTACHMENT_TYPE_ID`)) AS `FILE_ATTACHMENT_TYPE`,`recruitment_attachement`.`COMMENT` AS `COMMENT`,`recruitment_attachement`.`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`,`recruitment_attachement`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`recruitment_attachement`.`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`,`recruitment_attachement`.`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`,`recruitment_attachement`.`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`,`recruitment_attachement`.`CREATED_ON` AS `CREATED_ON`,`recruitment_attachement`.`UPDATED_ON` AS `UPDATED_ON`,`recruitment_attachement`.`IS_DELETED` AS `IS_DELETED` from `recruitment_attachement` */;

--
-- Final view structure for view `refund_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `refund_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `refund_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` = 147) */;

--
-- Final view structure for view `relationship_dtl_vw`
--

/*!50001 DROP VIEW IF EXISTS `relationship_dtl_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `relationship_dtl_vw` AS select `relationship_dtl`.`REL_DET_ID` AS `REL_DET_ID`,`relationship_dtl`.`HIER_LEVEL_CONFIG_ID` AS `HIER_LEVEL_CONFIG_ID`,`relationship_dtl`.`LEVEL_SEQ` AS `LEVEL_SEQ`,`relationship_dtl`.`CHILD_ID` AS `CHILD_MSTR_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `CHILD_MSTR_ID`)) AS `CHILD_MSTR_NM`,`relationship_dtl`.`PARENT_ID` AS `PARENT_HIER_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `PARENT_HIER_ID`)) AS `PARENT_MSTR_NM`,`relationship_dtl`.`CHILD_ID` AS `CHILD_ID`,`relationship_dtl`.`PARENT_ID` AS `PARENT_ID`,`relationship_dtl`.`HIER_TYPE_ID` AS `HIER_TYPE_ID`,(select `common_type`.`TYP_NM` from `common_type` where (`common_type`.`TYP_ID` = `relationship_dtl`.`HIER_TYPE_ID`)) AS `HIER_TYPE_NM`,`relationship_dtl`.`HIER_CHILD_ENTITY_TYPE_ID` AS `HIER_CHILD_ENTITY_TYPE_ID`,(select `common_type`.`TYP_NM` from `common_type` where (`common_type`.`TYP_ID` = `relationship_dtl`.`HIER_CHILD_ENTITY_TYPE_ID`)) AS `HIER_CHILD_ENTITY_TYPE_NM`,`relationship_dtl`.`HIER_PARENT_ENTITY_TYPE_ID` AS `HIER_PARENT_ENTITY_TYPE_ID`,(select `common_type`.`TYP_NM` from `common_type` where (`common_type`.`TYP_ID` = `relationship_dtl`.`HIER_PARENT_ENTITY_TYPE_ID`)) AS `HIER_PARENT_ENTITY_TYPE_NM`,`relationship_dtl`.`ENABLED` AS `ENABLED`,`relationship_dtl`.`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`,`relationship_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`,`relationship_dtl`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`relationship_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`,`relationship_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`,`relationship_dtl`.`CREATED_ON` AS `CREATED_ON`,`relationship_dtl`.`UPDATED_ON` AS `UPDATED_ON`,`relationship_dtl`.`IS_DELETED` AS `IS_DELETED` from `relationship_dtl` */;

--
-- Final view structure for view `relationship_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `relationship_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `relationship_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` = 160) */;

--
-- Final view structure for view `release_status_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `release_status_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `release_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` = 255) */;

--
-- Final view structure for view `religion_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `religion_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `religion_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` = 143) */;

--
-- Final view structure for view `remark_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `remark_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `remark_mst_vw` AS select `remark_mst`.`REMARK_ID` AS `REMARK_ID`,`remark_mst`.`EMP_ID` AS `EMP_ID`,(select `emp_mst_vw`.`EMP_FULL_NAME` from `emp_mst_vw` where (`emp_mst_vw`.`EMP_ID` = `remark_mst`.`EMP_ID`)) AS `EMPLOYEE_NAME`,`remark_mst`.`REMARK` AS `REMARK`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `remark_mst`.`REMARK`)) AS `REMARK_Name`,`remark_mst`.`REMARK_DATE` AS `REMARK_DATE`,`remark_mst`.`IS_DELETED` AS `IS_DELETED`,`remark_mst`.`OA_ID` AS `OA_ID`,`remark_mst`.`USER_ID` AS `USER_ID`,`remark_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`remark_mst`.`CREATED_BY` AS `CREATED_BY`,`remark_mst`.`UPDATED_BY` AS `UPDATED_BY`,`remark_mst`.`CREATEDON` AS `CREATEDON`,`remark_mst`.`UPDATEDON` AS `UPDATEDON` from `remark_mst` where 1 */;

--
-- Final view structure for view `remittance_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `remittance_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `remittance_mst_vw` AS select `r`.`remittance_id` AS `remittance_id`,`r`.`remittance_no` AS `remittance_no`,(select concat(`r`.`remittance_prefix`,' ',`r`.`remittance_no`)) AS `remittance_nooo`,`r`.`company_id` AS `company_id`,(select `company_details`.`company_name` from `company_details` where (`company_details`.`cmpy_id` = `r`.`company_id`)) AS `Company_name`,`r`.`remittance_date` AS `remittance_date`,`r`.`start_date` AS `start_date`,`r`.`end_date` AS `end_date`,`r`.`for_description` AS `for_description`,`r`.`vat_percent` AS `vat_percent`,`r`.`vat_amount` AS `vat_amount`,`r`.`total_amt` AS `total_amt`,`r`.`remittance_amount` AS `remittance_amount`,`r`.`remittance_amt` AS `remittance_amt`,`r`.`ATTACHMENT` AS `ATTACHMENT`,`r`.`payment_paid` AS `payment_paid`,`r`.`balance` AS `balance`,`r`.`FY_ID` AS `FY_ID`,`r`.`created_on` AS `created_on`,`r`.`created_by` AS `created_by`,`r`.`UPDATED_ON` AS `UPDATED_ON`,`r`.`UPDATED_BY` AS `UPDATED_BY`,`r`.`project_id` AS `project_id`,(select `project_details`.`project_name` from `project_details` where (`project_details`.`id` = `r`.`project_id`)) AS `PRoject_name`,`r`.`OA_ID` AS `org_id`,(select `ob`.`OA_BRAND_LOGO` from `oa_brands` `ob` where ((`ob`.`OA_ID` = `r`.`OA_ID`) and (`ob`.`OA_BRAND_ID` = `r`.`OA_BRAND_ID`))) AS `OA_BRAND_LOGO`,`r`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`r`.`OA_CD` AS `org_cd`,(select `oais`.`ORG_TEMPLATE` from `org_acc_invoice_settings` `oais` where ((`oais`.`OA_ID` = `r`.`OA_ID`) and (`oais`.`OA_BRAND_ID` = `r`.`OA_BRAND_ID`) and (`oais`.`TEMPLATE_SETTING_ID` = 5561))) AS `org_template`,(select `oais`.`PAYMENT_TEMPLATE` from `org_acc_invoice_settings` `oais` where ((`oais`.`OA_ID` = `r`.`OA_ID`) and (`oais`.`OA_BRAND_ID` = `r`.`OA_BRAND_ID`) and (`oais`.`TEMPLATE_SETTING_ID` = 5561))) AS `payment_template`,(select `oais`.`MAIL_PDF` from `org_acc_invoice_settings` `oais` where ((`oais`.`OA_ID` = `r`.`OA_ID`) and (`oais`.`OA_BRAND_ID` = `r`.`OA_BRAND_ID`) and (`oais`.`TEMPLATE_SETTING_ID` = 5561))) AS `mail_pdf`,`r`.`generated` AS `generated`,if((`r`.`generated` = 0),'No','Yes') AS `generated_status`,`r`.`remittance_prefix` AS `remittance_prefix`,`r`.`GENERATED_PATH` AS `GENERATED_PATH`,`r`.`IS_DELETED` AS `IS_DELETED`,`r`.`USER_ID` AS `USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `r`.`USER_ID`)) AS `USER_NAME` from `remittance_mst` `r` */;

--
-- Final view structure for view `requirement_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `requirement_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `requirement_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` = 222) */;

--
-- Final view structure for view `respiratory_vw`
--

/*!50001 DROP VIEW IF EXISTS `respiratory_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `respiratory_vw` AS select `r`.`ID` AS `ID`,`r`.`PATIENT_ID` AS `PATIENT_ID`,(select `personal_information`.`FIRST_NAME` from `personal_information` where (`personal_information`.`PATIENT_ID` = `r`.`PATIENT_ID`)) AS `PATIENT_NM`,`r`.`RESPIRATORY_PATTERN` AS `RESPIRATORY_PATTERN`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `r`.`RESPIRATORY_PATTERN`)) AS `RESPIRATORY_PATTERN_NM`,`r`.`BREATH_SOUNDS` AS `BREATH_SOUNDS`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `r`.`BREATH_SOUNDS`)) AS `BREATH_SOUNDS_NM`,`r`.`RESPIRATION_HISTRY` AS `RESPIRATION_HISTRY`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `r`.`RESPIRATION_HISTRY`)) AS `RESPIRATION_HISTRY_NM`,`r`.`RESPIRATORY_SCORE` AS `RESPIRATORY_SCORE`,`r`.`OA_ID` AS `OA_ID`,`r`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`r`.`CREATED_BY` AS `CREATED_BY`,`r`.`UPDATED_BY` AS `UPDATED_BY`,`r`.`CREATED_ON` AS `CREATED_ON`,`r`.`UPDATED_ON` AS `UPDATED_ON`,`r`.`USER_ID` AS `USER_ID`,`r`.`IS_DELETED` AS `IS_DELETED` from `respiratory` `r` */;

--
-- Final view structure for view `result_setup_co_scholastic_vw`
--

/*!50001 DROP VIEW IF EXISTS `result_setup_co_scholastic_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `result_setup_co_scholastic_vw` AS select `result_setup_co_scolastic`.`RESULT_SETUP_CO_SCOLASTIC_ID` AS `RESULT_SETUP_CO_SCOLASTIC_ID`,`result_setup_co_scolastic`.`CO_AREA_ID` AS `CO_AREA_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `result_setup_co_scolastic`.`CO_AREA_ID`)) AS `CO_AREA_NM`,`result_setup_co_scolastic`.`CO_TERM_ID` AS `CO_TERM_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `result_setup_co_scolastic`.`CO_TERM_ID`)) AS `CO_TERM_NM`,`result_setup_co_scolastic`.`CLASS_ID` AS `CLASS_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `result_setup_co_scolastic`.`CLASS_ID`)) AS `CLASS_NM`,`result_setup_co_scolastic`.`USER_ID` AS `USER_ID`,`result_setup_co_scolastic`.`OA_ID` AS `OA_ID`,`result_setup_co_scolastic`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`result_setup_co_scolastic`.`UPDATED_BY` AS `UPDATED_BY`,`result_setup_co_scolastic`.`CREATED_BY` AS `CREATED_BY`,`result_setup_co_scolastic`.`CREATED_ON` AS `CREATED_ON`,`result_setup_co_scolastic`.`UPDATED_ON` AS `UPDATED_ON`,`result_setup_co_scolastic`.`IS_DELETED` AS `IS_DELETED` from `result_setup_co_scolastic` */;

--
-- Final view structure for view `result_setup_marksheet_vw`
--

/*!50001 DROP VIEW IF EXISTS `result_setup_marksheet_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `result_setup_marksheet_vw` AS select `result_setup_marksheet`.`ID` AS `ID`,`result_setup_marksheet`.`LOGO` AS `LOGO`,`result_setup_marksheet`.`ADDRESS` AS `ADDRESS`,`result_setup_marksheet`.`SCHOOL_NO` AS `SCHOOL_NO`,`result_setup_marksheet`.`REGISTRATION_NO` AS `REGISTRATION_NO`,`result_setup_marksheet`.`SCHOLASTIC_AREA_HEADING` AS `SCHOLASTIC_AREA_HEADING`,`result_setup_marksheet`.`SHOW_GRADE_TERM_WISE` AS `SHOW_GRADE_TERM_WISE`,`result_setup_marksheet`.`MULTIPLE_PAGE` AS `MULTIPLE_PAGE`,`result_setup_marksheet`.`SHOW_SUBJECT` AS `SHOW_SUBJECT`,`result_setup_marksheet`.`CO_SCHOLASTIC_AREA` AS `CO_SCHOLASTIC_AREA`,`result_setup_marksheet`.`ATTENDANCE` AS `ATTENDANCE`,`result_setup_marksheet`.`HEALTH` AS `HEALTH`,`result_setup_marksheet`.`PRINCIPAL_SIGNATURE` AS `PRINCIPAL_SIGNATURE`,`result_setup_marksheet`.`REMARK` AS `REMARK`,`result_setup_marksheet`.`TEACHER_SIGNATURE` AS `TEACHER_SIGNATURE`,`result_setup_marksheet`.`ADD_LOGO` AS `ADD_LOGO`,`result_setup_marksheet`.`ADD_ADDRESS` AS `ADD_ADDRESS`,`result_setup_marksheet`.`ADD_SCHOOL_NUMBER` AS `ADD_SCHOOL_NUMBER`,`result_setup_marksheet`.`ADD_REGISTRATION_NUMBER` AS `ADD_REGISTRATION_NUMBER`,`result_setup_marksheet`.`STUDENT_TYPE` AS `STUDENT_TYPE`,`result_setup_marksheet`.`COUNTRY` AS `COUNTRY`,`result_setup_marksheet`.`STUDENT_ADDRESS` AS `STUDENT_ADDRESS`,`result_setup_marksheet`.`ADD_SIGNATURE` AS `ADD_SIGNATURE`,`result_setup_marksheet`.`ADD_MAX_MARKS` AS `ADD_MAX_MARKS`,`result_setup_marksheet`.`REPORT_CARD` AS `REPORT_CARD`,`result_setup_marksheet`.`SCHOLASTIC_AREA` AS `SCHOLASTIC_AREA`,`result_setup_marksheet`.`SHOW_TERM_TOTAL` AS `SHOW_TERM_TOTAL`,`result_setup_marksheet`.`SHOW_OVERALL_TERM_TOTAL` AS `SHOW_OVERALL_TERM_TOTAL`,`result_setup_marksheet`.`SHOW_OVERALL_TERM_GRADE` AS `SHOW_OVERALL_TERM_GRADE`,`result_setup_marksheet`.`CALCULATE_WEIGHTAGE` AS `CALCULATE_WEIGHTAGE`,`result_setup_marksheet`.`SHOW_MARKS` AS `SHOW_MARKS`,`result_setup_marksheet`.`SHOW_MAX_MARKS` AS `SHOW_MAX_MARKS`,`result_setup_marksheet`.`PARENT_SIGNATURE` AS `PARENT_SIGNATURE`,`result_setup_marksheet`.`SHOW_GRADING_SCALE` AS `SHOW_GRADING_SCALE`,`result_setup_marksheet`.`ADD_SCHOOL_IMAGE` AS `ADD_SCHOOL_IMAGE`,`result_setup_marksheet`.`SCHOOL_IMAGE` AS `SCHOOL_IMAGE`,`result_setup_marksheet`.`SELECT_MAX_MARKS` AS `SELECT_MAX_MARKS`,`result_setup_marksheet`.`FOOTER_TEXT` AS `FOOTER_TEXT`,`result_setup_marksheet`.`OA_ID` AS `OA_ID`,`result_setup_marksheet`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`result_setup_marksheet`.`USER_ID` AS `USER_ID`,`result_setup_marksheet`.`CREATED_BY` AS `CREATED_BY`,`result_setup_marksheet`.`CREATED_ON` AS `CREATED_ON`,`result_setup_marksheet`.`UPDATED_BY` AS `UPDATED_BY`,`result_setup_marksheet`.`UPDATED_ON` AS `UPDATED_ON`,`result_setup_marksheet`.`IS_DELETED` AS `IS_DELETED` from `result_setup_marksheet` */;

--
-- Final view structure for view `result_setup_scholastic_vw`
--

/*!50001 DROP VIEW IF EXISTS `result_setup_scholastic_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `result_setup_scholastic_vw` AS select `result_setup_scholastic`.`SCHOLASTIC_ID` AS `SCHOLASTIC_ID`,`result_setup_scholastic`.`EXAM_TYPE` AS `EXAM_TYPE`,(select `exam_type`.`EXAM_TYPE` from `exam_type` where (`exam_type`.`EXAM_TYPE_ID` = `result_setup_scholastic`.`EXAM_TYPE`)) AS `EXAM_NM`,`result_setup_scholastic`.`CLASS` AS `CLASS`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `result_setup_scholastic`.`CLASS`)) AS `CLASS_NM`,`result_setup_scholastic`.`SUBJECT` AS `SUBJECT`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `result_setup_scholastic`.`SUBJECT`)) AS `SUBJECT_NM`,`result_setup_scholastic`.`EXAM_DATE` AS `EXAM_DATE`,`result_setup_scholastic`.`MAX_MARKS` AS `MAX_MARKS`,`result_setup_scholastic`.`REMARKS` AS `REMARKS`,`result_setup_scholastic`.`ADMISSION_NO` AS `ADMISSION_NO`,`result_setup_scholastic`.`OA_ID` AS `OA_ID`,`result_setup_scholastic`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`result_setup_scholastic`.`USER_ID` AS `USER_ID`,`result_setup_scholastic`.`ISDELETED` AS `ISDELETED`,`result_setup_scholastic`.`CREATED_ON` AS `CREATED_ON`,`result_setup_scholastic`.`CREATED_BY` AS `CREATED_BY`,`result_setup_scholastic`.`UPDATED_ON` AS `UPDATED_ON`,`result_setup_scholastic`.`UPDATED_BY` AS `UPDATED_BY` from `result_setup_scholastic` */;

--
-- Final view structure for view `result_setup_vw`
--

/*!50001 DROP VIEW IF EXISTS `result_setup_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `result_setup_vw` AS select `result_setup`.`RESULT_ID` AS `RESULT_ID`,`result_setup`.`EXAM_TYPE` AS `EXAM_TYPE`,`result_setup`.`EXAM_DATE` AS `EXAM_DATE`,`result_setup`.`START_TIME` AS `START_TIME`,`result_setup`.`END_TIME` AS `END_TIME`,`result_setup`.`REMARK` AS `REMARK`,if((`result_setup`.`EXAM_STATUS` = 0),'FAIL','PASS') AS `EXAM_STATUS`,`result_setup`.`OA_ID` AS `OA_ID`,`result_setup`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`result_setup`.`USER_ID` AS `USER_ID`,`result_setup`.`ISDELETED` AS `ISDELETED`,`result_setup`.`CREATED_ON` AS `CREATED_ON`,`result_setup`.`CREATED_BY` AS `CREATED_BY`,`result_setup`.`UPDATED_ON` AS `UPDATED_ON`,`result_setup`.`UPDATED_BY` AS `UPDATED_BY` from `result_setup` */;

--
-- Final view structure for view `retail_accountant_details_vw`
--

/*!50001 DROP VIEW IF EXISTS `retail_accountant_details_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `retail_accountant_details_vw` AS select `retail_accountant_details`.`ACCOUNTANT_ID` AS `ACCOUNTANT_ID`,`retail_accountant_details`.`NAME` AS `NAME`,`retail_accountant_details`.`ADDRESS` AS `ADDRESS`,`retail_accountant_details`.`POSTCODE` AS `POSTCODE`,`retail_accountant_details`.`OA_ID` AS `OA_ID`,`retail_accountant_details`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`retail_accountant_details`.`USER_ID` AS `USER_ID`,`retail_accountant_details`.`IS_DELETED` AS `IS_DELETED`,`retail_accountant_details`.`CREATED_ON` AS `CREATED_ON`,`retail_accountant_details`.`CREATED_BY` AS `CREATED_BY`,`retail_accountant_details`.`UPDATED_ON` AS `UPDATED_ON`,`retail_accountant_details`.`UPDATED_BY` AS `UPDATED_BY` from `retail_accountant_details` */;

--
-- Final view structure for view `retail_additional_comments_vw`
--

/*!50001 DROP VIEW IF EXISTS `retail_additional_comments_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `retail_additional_comments_vw` AS select `retail_additional_comments`.`COMMENT_ID` AS `COMMENT_ID`,`retail_additional_comments`.`COMMENT` AS `COMMENT`,`retail_additional_comments`.`OA_ID` AS `OA_ID`,`retail_additional_comments`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`retail_additional_comments`.`USER_ID` AS `USER_ID`,`retail_additional_comments`.`IS_DELETED` AS `IS_DELETED`,`retail_additional_comments`.`CREATED_ON` AS `CREATED_ON`,`retail_additional_comments`.`CREATED_BY` AS `CREATED_BY`,`retail_additional_comments`.`UPDATED_ON` AS `UPDATED_ON`,`retail_additional_comments`.`UPDATED_BY` AS `UPDATED_BY` from `retail_additional_comments` */;

--
-- Final view structure for view `retail_bank_details_vw`
--

/*!50001 DROP VIEW IF EXISTS `retail_bank_details_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `retail_bank_details_vw` AS select `retail_bank_details`.`BANK_ID` AS `BANK_ID`,`retail_bank_details`.`BANK_NAME` AS `BANK_NAME`,`retail_bank_details`.`BANK_ADDRESS` AS `BANK_ADDRESS`,`retail_bank_details`.`ACCOUNT_NAME` AS `ACCOUNT_NAME`,`retail_bank_details`.`SORT_CODE` AS `SORT_CODE`,`retail_bank_details`.`ACCOUNT_NO` AS `ACCOUNT_NO`,`retail_bank_details`.`OA_ID` AS `OA_ID`,`retail_bank_details`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`retail_bank_details`.`USER_ID` AS `USER_ID`,`retail_bank_details`.`IS_DELETED` AS `IS_DELETED`,`retail_bank_details`.`CREATED_ON` AS `CREATED_ON`,`retail_bank_details`.`CREATED_BY` AS `CREATED_BY`,`retail_bank_details`.`UPDATED_ON` AS `UPDATED_ON`,`retail_bank_details`.`UPDATED_BY` AS `UPDATED_BY` from `retail_bank_details` */;

--
-- Final view structure for view `retail_branch_details_vw`
--

/*!50001 DROP VIEW IF EXISTS `retail_branch_details_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `retail_branch_details_vw` AS select `retail_branch_details`.`BRANCH_ID` AS `BRANCH_ID`,`retail_branch_details`.`ADDRESS` AS `ADDRESS`,`retail_branch_details`.`POSTCODE` AS `POSTCODE`,`retail_branch_details`.`MANAGER_NAME` AS `MANAGER_NAME`,`retail_branch_details`.`CONTACT_NO` AS `CONTACT_NO`,`retail_branch_details`.`FAX_NO` AS `FAX_NO`,`retail_branch_details`.`OA_ID` AS `OA_ID`,`retail_branch_details`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`retail_branch_details`.`USER_ID` AS `USER_ID`,`retail_branch_details`.`IS_DELETED` AS `IS_DELETED`,`retail_branch_details`.`CREATED_ON` AS `CREATED_ON`,`retail_branch_details`.`CREATED_BY` AS `CREATED_BY`,`retail_branch_details`.`UPDATED_ON` AS `UPDATED_ON`,`retail_branch_details`.`UPDATED_BY` AS `UPDATED_BY` from `retail_branch_details` */;

--
-- Final view structure for view `retail_business_description_vw`
--

/*!50001 DROP VIEW IF EXISTS `retail_business_description_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `retail_business_description_vw` AS select `retail_business_description`.`BUSINESS_ID` AS `BUSINESS_ID`,`retail_business_description`.`DESCRIPTION` AS `DESCRIPTION`,`retail_business_description`.`OA_ID` AS `OA_ID`,`retail_business_description`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`retail_business_description`.`USER_ID` AS `USER_ID`,`retail_business_description`.`IS_DELETED` AS `IS_DELETED`,`retail_business_description`.`CREATED_ON` AS `CREATED_ON`,`retail_business_description`.`CREATED_BY` AS `CREATED_BY`,`retail_business_description`.`UPDATED_ON` AS `UPDATED_ON`,`retail_business_description`.`UPDATED_BY` AS `UPDATED_BY` from `retail_business_description` */;

--
-- Final view structure for view `retail_credit_licence_details_vw`
--

/*!50001 DROP VIEW IF EXISTS `retail_credit_licence_details_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `retail_credit_licence_details_vw` AS select `retail_credit_licence_details`.`LICENCE_ID` AS `LICENCE_ID`,`retail_credit_licence_details`.`LICENCE` AS `LICENCE`,`retail_credit_licence_details`.`LICENCE_NO` AS `LICENCE_NO`,`retail_credit_licence_details`.`OA_ID` AS `OA_ID`,`retail_credit_licence_details`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`retail_credit_licence_details`.`USER_ID` AS `USER_ID`,`retail_credit_licence_details`.`IS_DELETED` AS `IS_DELETED`,`retail_credit_licence_details`.`CREATED_ON` AS `CREATED_ON`,`retail_credit_licence_details`.`CREATED_BY` AS `CREATED_BY`,`retail_credit_licence_details`.`UPDATED_ON` AS `UPDATED_ON`,`retail_credit_licence_details`.`UPDATED_BY` AS `UPDATED_BY` from `retail_credit_licence_details` */;

--
-- Final view structure for view `retail_details_vw`
--

/*!50001 DROP VIEW IF EXISTS `retail_details_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `retail_details_vw` AS select `retail_details`.`RETAILS_ID` AS `RETAILS_ID`,`retail_details`.`COMPANY_NAME` AS `COMPANY_NAME`,`retail_details`.`TRADING_NAME` AS `TRADING_NAME`,`retail_details`.`CONTACT_NAME` AS `CONTACT_NAME`,`retail_details`.`TYPES_OF_NAME` AS `TYPES_OF_NAME`,`retail_details`.`DATE_ESTABLISHED` AS `DATE_ESTABLISHED`,`retail_details`.`ANNUAL_TURNOVER` AS `ANNUAL_TURNOVER`,`retail_details`.`REGISTERED_NUMBER` AS `REGISTERED_NUMBER`,`retail_details`.`NUMBER_OF_BRANCHES` AS `NUMBER_OF_BRANCHES`,`retail_details`.`OA_ID` AS `OA_ID`,`retail_details`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`retail_details`.`USER_ID` AS `USER_ID`,`retail_details`.`IS_DELETED` AS `IS_DELETED`,`retail_details`.`CREATED_ON` AS `CREATED_ON`,`retail_details`.`CREATED_BY` AS `CREATED_BY`,`retail_details`.`UPDATED_ON` AS `UPDATED_ON`,`retail_details`.`UPDATED_BY` AS `UPDATED_BY` from `retail_details` */;

--
-- Final view structure for view `retail_headoffice_address_vw`
--

/*!50001 DROP VIEW IF EXISTS `retail_headoffice_address_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `retail_headoffice_address_vw` AS select `retail_headoffice_address`.`HOADDRESS_ID` AS `HOADDRESS_ID`,`retail_headoffice_address`.`ADDRESS` AS `ADDRESS`,`retail_headoffice_address`.`POSTCODE` AS `POSTCODE`,`retail_headoffice_address`.`TEL_NO` AS `TEL_NO`,`retail_headoffice_address`.`FAX_NO` AS `FAX_NO`,`retail_headoffice_address`.`EMAIL` AS `EMAIL`,`retail_headoffice_address`.`WEB_URL` AS `WEB_URL`,`retail_headoffice_address`.`OA_ID` AS `OA_ID`,`retail_headoffice_address`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`retail_headoffice_address`.`USER_ID` AS `USER_ID`,`retail_headoffice_address`.`IS_DELETED` AS `IS_DELETED`,`retail_headoffice_address`.`CREATED_ON` AS `CREATED_ON`,`retail_headoffice_address`.`CREATED_BY` AS `CREATED_BY`,`retail_headoffice_address`.`UPDATED_ON` AS `UPDATED_ON`,`retail_headoffice_address`.`UPDATED_BY` AS `UPDATED_BY` from `retail_headoffice_address` */;

--
-- Final view structure for view `retail_internal_use_vw`
--

/*!50001 DROP VIEW IF EXISTS `retail_internal_use_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `retail_internal_use_vw` AS select `retail_internal_use`.`SECTION_ID` AS `SECTION_ID`,`retail_internal_use`.`PROF_ASSOCIATIVE` AS `PROF_ASSOCIATIVE`,`retail_internal_use`.`EMAIL` AS `EMAIL`,`retail_internal_use`.`DATE` AS `DATE`,`retail_internal_use`.`OA_ID` AS `OA_ID`,`retail_internal_use`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`retail_internal_use`.`USER_ID` AS `USER_ID`,`retail_internal_use`.`IS_DELETED` AS `IS_DELETED`,`retail_internal_use`.`CREATED_ON` AS `CREATED_ON`,`retail_internal_use`.`CREATED_BY` AS `CREATED_BY`,`retail_internal_use`.`UPDATED_ON` AS `UPDATED_ON`,`retail_internal_use`.`UPDATED_BY` AS `UPDATED_BY` from `retail_internal_use` */;

--
-- Final view structure for view `retail_member_details_vw`
--

/*!50001 DROP VIEW IF EXISTS `retail_member_details_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `retail_member_details_vw` AS select `retail_member_details`.`MEMBER_ID` AS `MEMBER_ID`,`retail_member_details`.`NAME` AS `NAME`,`retail_member_details`.`ROLE` AS `ROLE`,`retail_member_details`.`PROFESSION` AS `PROFESSION`,`retail_member_details`.`OA_ID` AS `OA_ID`,`retail_member_details`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`retail_member_details`.`USER_ID` AS `USER_ID`,`retail_member_details`.`IS_DELETED` AS `IS_DELETED`,`retail_member_details`.`CREATED_ON` AS `CREATED_ON`,`retail_member_details`.`CREATED_BY` AS `CREATED_BY`,`retail_member_details`.`UPDATED_ON` AS `UPDATED_ON`,`retail_member_details`.`UPDATED_BY` AS `UPDATED_BY` from `retail_member_details` */;

--
-- Final view structure for view `retail_retailer_details_vw`
--

/*!50001 DROP VIEW IF EXISTS `retail_retailer_details_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `retail_retailer_details_vw` AS select `retail_retailer_details`.`RETAILER_ID` AS `RETAILER_ID`,`retail_retailer_details`.`COMPANY_NAME` AS `COMPANY_NAME`,`retail_retailer_details`.`TRADING_NAME` AS `TRADING_NAME`,`retail_retailer_details`.`CONTACT_NAME` AS `CONTACT_NAME`,`retail_retailer_details`.`COMPANY_TYPE` AS `COMPANY_TYPE`,`retail_retailer_details`.`ESTABLISH_DATE` AS `ESTABLISH_DATE`,`retail_retailer_details`.`ANNUAL_TURNOVER` AS `ANNUAL_TURNOVER`,`retail_retailer_details`.`REGISTERED_NO` AS `REGISTERED_NO`,`retail_retailer_details`.`BRANCH_NO` AS `BRANCH_NO`,`retail_retailer_details`.`OA_ID` AS `OA_ID`,`retail_retailer_details`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`retail_retailer_details`.`USER_ID` AS `USER_ID`,`retail_retailer_details`.`IS_DELETED` AS `IS_DELETED`,`retail_retailer_details`.`CREATED_ON` AS `CREATED_ON`,`retail_retailer_details`.`CREATED_BY` AS `CREATED_BY`,`retail_retailer_details`.`UPDATED_ON` AS `UPDATED_ON`,`retail_retailer_details`.`UPDATED_BY` AS `UPDATED_BY` from `retail_retailer_details` */;

--
-- Final view structure for view `retail_sales_method_details_vw`
--

/*!50001 DROP VIEW IF EXISTS `retail_sales_method_details_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `retail_sales_method_details_vw` AS select `retail_sales_method_details`.`METHOD_ID` AS `METHOD_ID`,`retail_sales_method_details`.`FIRST_QUESTION` AS `FIRST_QUESTION`,`retail_sales_method_details`.`SECOND_QUESTION` AS `SECOND_QUESTION`,`retail_sales_method_details`.`THIRD_QUESTION` AS `THIRD_QUESTION`,`retail_sales_method_details`.`FORTH_QUESTION` AS `FORTH_QUESTION`,`retail_sales_method_details`.`OA_ID` AS `OA_ID`,`retail_sales_method_details`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`retail_sales_method_details`.`USER_ID` AS `USER_ID`,`retail_sales_method_details`.`IS_DELETED` AS `IS_DELETED`,`retail_sales_method_details`.`CREATED_ON` AS `CREATED_ON`,`retail_sales_method_details`.`CREATED_BY` AS `CREATED_BY`,`retail_sales_method_details`.`UPDATED_ON` AS `UPDATED_ON`,`retail_sales_method_details`.`UPDATED_BY` AS `UPDATED_BY` from `retail_sales_method_details` */;

--
-- Final view structure for view `retail_vat_details_vw`
--

/*!50001 DROP VIEW IF EXISTS `retail_vat_details_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `retail_vat_details_vw` AS select `retail_vat_details`.`VAT_ID` AS `VAT_ID`,`retail_vat_details`.`VAT_REG_NO` AS `VAT_REG_NO`,`retail_vat_details`.`WARRANTY_DETAILS` AS `WARRANTY_DETAILS`,`retail_vat_details`.`OA_ID` AS `OA_ID`,`retail_vat_details`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`retail_vat_details`.`USER_ID` AS `USER_ID`,`retail_vat_details`.`IS_DELETED` AS `IS_DELETED`,`retail_vat_details`.`CREATED_ON` AS `CREATED_ON`,`retail_vat_details`.`CREATED_BY` AS `CREATED_BY`,`retail_vat_details`.`UPDATED_ON` AS `UPDATED_ON`,`retail_vat_details`.`UPDATED_BY` AS `UPDATED_BY` from `retail_vat_details` */;

--
-- Final view structure for view `reviewers_detail_vw`
--

/*!50001 DROP VIEW IF EXISTS `reviewers_detail_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `reviewers_detail_vw` AS select `reviewers_detail`.`REVIEW_DTL_ID` AS `REVIEW_DTL_ID`,`reviewers_detail`.`EMP_ID` AS `EMPID`,(select `kns_employee`.`EMP_NM` from `kns_employee` where (`kns_employee`.`EMP_ID` = `EMPID`)) AS `EMP_NM`,`reviewers_detail`.`REVIEW_STATUS_ID` AS `REVIEW_STATUS_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `reviewers_detail`.`REVIEW_STATUS_ID`)) AS `REVIEW_STATUS_NM`,`reviewers_detail`.`PROJECT_ID` AS `PROJECT_ID`,(select `kns_project_details`.`PRJ_NM` from `kns_project_details` where (`reviewers_detail`.`PROJECT_ID` = `kns_project_details`.`SKILL_PRJ_ID`)) AS `PROJECT_NM`,`reviewers_detail`.`REVIEW_DATE` AS `REVIEW_DATE`,`reviewers_detail`.`PROJECT_START_DATE` AS `PROJECT_START_DATE`,`reviewers_detail`.`SUPERVISOR_ID` AS `SUPERVISOR_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `reviewers_detail`.`SUPERVISOR_ID`)) AS `SUPERVISOR_NM`,`reviewers_detail`.`REMARK` AS `REMARK`,`reviewers_detail`.`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`,`reviewers_detail`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`reviewers_detail`.`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`,`reviewers_detail`.`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`,`reviewers_detail`.`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`,`reviewers_detail`.`CREATED_ON` AS `CREATED_ON`,`reviewers_detail`.`UPDATED_ON` AS `UPDATED_ON` from `reviewers_detail` */;

--
-- Final view structure for view `risk_action_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `risk_action_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `risk_action_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` = 234) */;

--
-- Final view structure for view `risk_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `risk_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `risk_mst_vw` AS select `risk_mst`.`RISK_ID` AS `RISK_ID`,`risk_mst`.`PROJECT_ID` AS `PROJECT_ID`,`risk_mst`.`RAISED_ON_DATE` AS `RAISED_ON_DATE`,`risk_mst`.`ORIGINATOR_USER_ID` AS `ORIGINATOR_USER_ID`,`risk_mst`.`RISK_DESC` AS `RISK_DESC`,`risk_mst`.`IMPACT_DESC` AS `IMPACT_DESC`,`risk_mst`.`PROBABILITY_PERCENTAGE` AS `PROBABILITY_PERCENTAGE`,`risk_mst`.`IMPACT_WTG` AS `IMPACT_WTG`,`risk_mst`.`CRITICALITY_VALUE` AS `CRITICALITY_VALUE`,`risk_mst`.`RISK_STATUS_ID` AS `RISK_STATUS_ID`,`risk_mst`.`TREND_STATUS_ID` AS `TREND_STATUS_ID`,`risk_mst`.`ACTION_COMMENTS` AS `ACTION_COMMENTS`,`risk_mst`.`ACTION_TYPE_ID` AS `ACTION_TYPE_ID`,`risk_mst`.`OWNER_USER_ID` AS `OWNER_USER_ID`,`risk_mst`.`LAST_REVIEW_DATE` AS `LAST_REVIEW_DATE`,`risk_mst`.`OA_ID` AS `OA_ID`,`risk_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`risk_mst`.`IS_DELETED` AS `IS_DELETED`,`risk_mst`.`CREATED_BY` AS `CREATED_BY`,`risk_mst`.`UPDATED_BY` AS `UPDATED_BY`,`risk_mst`.`CREATED_ON` AS `CREATED_ON`,`risk_mst`.`UPDATED_ON` AS `UPDATED_ON` from `risk_mst` */;

--
-- Final view structure for view `risk_owner_user_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `risk_owner_user_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `risk_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` = 235) */;

--
-- Final view structure for view `risk_status_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `risk_status_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `risk_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` = 232) */;

--
-- Final view structure for view `risk_trend_status_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `risk_trend_status_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `risk_trend_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` = 233) */;

--
-- Final view structure for view `role_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `role_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `role_mst_vw` AS select `role_mst`.`ROLE_ID` AS `ROLE_ID`,`role_mst`.`ROLE_NM` AS `ROLE_NM`,`role_mst`.`ROLE_DSCRPTN` AS `ROLE_DSCRPTN`,`role_mst`.`DMN_ID` AS `DOMAIN_ID`,`role_mst`.`DMN_ID` AS `DMN_ID`,`role_mst`.`AUTHORITY_LEVEL` AS `AUTHORITY_LEVEL`,(select `user_domain_vw`.`DMN_NM` from `user_domain_vw` where (`user_domain_vw`.`DMN_ID` = `DOMAIN_ID`)) AS `DMN_NM`,(select `user_domain_vw`.`ORG_ACC_ID` from `user_domain_vw` where (`user_domain_vw`.`DMN_ID` = `DOMAIN_ID`)) AS `ORG_ACC_ID`,(select `user_domain_vw`.`OA_CD` from `user_domain_vw` where (`user_domain_vw`.`DMN_ID` = `DOMAIN_ID`)) AS `OA_CD`,(select `user_domain_vw`.`OA_NM` from `user_domain_vw` where (`user_domain_vw`.`DMN_ID` = `DOMAIN_ID`)) AS `OA_NM`,(select `user_domain_vw`.`BRAND_ID` from `user_domain_vw` where (`user_domain_vw`.`DMN_ID` = `DOMAIN_ID`)) AS `BRAND_ID`,(select `user_domain_vw`.`OA_BRAND_CD` from `user_domain_vw` where (`user_domain_vw`.`DMN_ID` = `DOMAIN_ID`)) AS `OA_BRAND_CD`,(select `user_domain_vw`.`OA_BRAND_NM` from `user_domain_vw` where (`user_domain_vw`.`DMN_ID` = `DOMAIN_ID`)) AS `OA_BRAND_NM`,`role_mst`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`role_mst`.`IS_DELETED` AS `IS_DELETED`,if((`role_mst`.`IS_ADMIN_ROLE` = 1),'Yes','No') AS `IS_ADMIN_ROLE`,if((`role_mst`.`IS_ASSIGNABLE` = 1),'Yes','No') AS `IS_ASSIGNABLE`,if((`role_mst`.`IS_PREDEFINED` = 1),'Yes','No') AS `IS_PREDEFINED`,`role_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`,`role_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`,`role_mst`.`CREATED_ON` AS `CREATED_ON`,`role_mst`.`UPDATED_ON` AS `UPDATED_ON` from `role_mst` */;

--
-- Final view structure for view `room_id_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `room_id_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `room_id_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`.`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`.`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` = 653) */;

--
-- Final view structure for view `roomallocation_vw`
--

/*!50001 DROP VIEW IF EXISTS `roomallocation_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `roomallocation_vw` AS select `roomallocation`.`id` AS `id`,`roomallocation`.`building` AS `building_id`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `roomallocation`.`building`)) AS `building`,`roomallocation`.`block` AS `block_id`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `roomallocation`.`block`)) AS `block`,`roomallocation`.`room` AS `room_id`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `roomallocation`.`room`)) AS `room`,`roomallocation`.`OA_ID` AS `OA_ID`,`roomallocation`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`roomallocation`.`USER_ID` AS `USER_ID`,`roomallocation`.`CREATED_BY` AS `CREATED_BY`,`roomallocation`.`CREATED_ON` AS `CREATED_ON`,`roomallocation`.`UPDATED_BY` AS `UPDATED_BY`,`roomallocation`.`UPDATED_ON` AS `UPDATED_ON`,`roomallocation`.`IS_DELETED` AS `IS_DELETED` from `roomallocation` */;

--
-- Final view structure for view `rota_pattern_group_vw`
--

/*!50001 DROP VIEW IF EXISTS `rota_pattern_group_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `rota_pattern_group_vw` AS select `rota_pattern`.`ROTA_PATTERN_ID` AS `ROTA_PATTERN_ID`,`rota_pattern`.`ROTA_PATTERN_NAME_ID` AS `ROTA_PATTERN_NAME_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `rota_pattern`.`ROTA_PATTERN_NAME_ID`)) AS `ROTA_PATTERN_NAME`,group_concat(`rota_pattern`.`DESIGNATION_ID` separator ',') AS `DESIGNATION_ID`,group_concat((select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `rota_pattern`.`DESIGNATION_ID`)) separator ',') AS `DESIGNATION`,sum(`rota_pattern`.`COUNT_REQUIRED`) AS `COUNT_REQUIRED`,`rota_pattern`.`IS_DELETED` AS `IS_DELETED`,`rota_pattern`.`OA_ID` AS `OAID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `rota_pattern`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `rota_pattern`.`OA_ID`)) AS `OA_NM`,`rota_pattern`.`OA_BRAND_ID` AS `OABRANDID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `rota_pattern`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `rota_pattern`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`rota_pattern`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `rota_pattern`.`USER_ID`)) AS `USER_NM`,`rota_pattern`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `rota_pattern`.`CREATED_BY`)) AS `CREATED_BY_USER_NAME`,`rota_pattern`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `rota_pattern`.`UPDATED_BY`)) AS `UPDATED_BY_USER_NAME`,`rota_pattern`.`CREATED_ON` AS `CREATED_ON`,`rota_pattern`.`UPDATED_ON` AS `UPDATED_ON` from `rota_pattern` group by `rota_pattern`.`ROTA_PATTERN_NAME_ID` */;

--
-- Final view structure for view `rota_pattern_name_vw`
--

/*!50001 DROP VIEW IF EXISTS `rota_pattern_name_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `rota_pattern_name_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`.`IS_EDITABLE` AS `IS_EDITABLE`,`independent_mst`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`independent_mst`.`IM_GROUP_CTR` AS `IM_GROUP_CTR`,`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` = 340) */;

--
-- Final view structure for view `rota_pattern_vw`
--

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

--
-- Final view structure for view `rpt_brand_wise_system_entity_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `rpt_brand_wise_system_entity_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `rpt_brand_wise_system_entity_summary_vw` AS select `system_entities_vw`.`TABLE_TYPE` AS `TABLE_TYPE`,`system_entities_vw`.`ORG_ACC_ID` AS `ORG_ACC_ID`,`system_entities_vw`.`OA_CD` AS `OA_CD`,`system_entities_vw`.`OA_NM` AS `OA_NM`,`system_entities_vw`.`BRAND_ID` AS `BRAND_ID`,`system_entities_vw`.`OA_BRAND_CD` AS `OA_BRAND_CD`,`system_entities_vw`.`OA_BRAND_NM` AS `OA_BRAND_NM`,count(1) AS `ROW_COUNT` from `system_entities_vw` group by `system_entities_vw`.`TABLE_TYPE`,`system_entities_vw`.`ORG_ACC_ID`,`system_entities_vw`.`OA_CD`,`system_entities_vw`.`OA_NM`,`system_entities_vw`.`BRAND_ID`,`system_entities_vw`.`OA_BRAND_CD`,`system_entities_vw`.`OA_BRAND_NM` */;

--
-- Final view structure for view `rpt_data_type_wise_system_entity_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `rpt_data_type_wise_system_entity_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `rpt_data_type_wise_system_entity_summary_vw` AS select `independent_mst_vw`.`DATA_TYPE` AS `DATA_TYPE`,count(1) AS `ROW_COUNT` from `independent_mst_vw` group by `independent_mst_vw`.`DATA_TYPE` */;

--
-- Final view structure for view `rpt_entity_obj_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `rpt_entity_obj_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `rpt_entity_obj_summary_vw` AS select `entity_obj_vw`.`OBJ_TYP` AS `OBJ_TYP`,count(1) AS `recordcount` from `entity_obj_vw` where 1 group by `entity_obj_vw`.`OBJ_TYP` */;

--
-- Final view structure for view `rpt_im_data_type_wise_system_entity_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `rpt_im_data_type_wise_system_entity_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `rpt_im_data_type_wise_system_entity_summary_vw` AS select `independent_mst_vw`.`DATA_TYPE` AS `DATA_TYPE`,count(1) AS `ROW_COUNT` from `independent_mst_vw` group by `independent_mst_vw`.`DATA_TYPE` */;

--
-- Final view structure for view `rpt_im_masters_record_count_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `rpt_im_masters_record_count_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `rpt_im_masters_record_count_summary_vw` AS select count(1) AS `ROW_COUNT` from `independent_mst_vw` */;

--
-- Final view structure for view `rpt_im_system_master_data_for_non_blank_brand_vw`
--

/*!50001 DROP VIEW IF EXISTS `rpt_im_system_master_data_for_non_blank_brand_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `rpt_im_system_master_data_for_non_blank_brand_vw` AS select `independent_mst_vw`.`DATA_TYPE` AS `DATA_TYPE`,`independent_mst_vw`.`ORG_ACC_ID` AS `ORG_ACC_ID`,`independent_mst_vw`.`BRAND_ID` AS `BRAND_ID`,count(1) AS `ROW_COUNT` from `independent_mst_vw` group by `independent_mst_vw`.`DATA_TYPE`,`independent_mst_vw`.`ORG_ACC_ID`,`independent_mst_vw`.`BRAND_ID` */;

--
-- Final view structure for view `rpt_masters_record_count_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `rpt_masters_record_count_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `rpt_masters_record_count_summary_vw` AS select count(1) AS `ROW_COUNT` from `independent_mst_vw` */;

--
-- Final view structure for view `rpt_summary_im_data_type_wise_system_entity_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `rpt_summary_im_data_type_wise_system_entity_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `rpt_summary_im_data_type_wise_system_entity_summary_vw` AS select `independent_mst_vw`.`DATA_TYPE` AS `DATA_TYPE`,count(1) AS `ROW_COUNT` from `independent_mst_vw` group by `independent_mst_vw`.`DATA_TYPE` */;

--
-- Final view structure for view `rpt_summary_im_masters_record_count_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `rpt_summary_im_masters_record_count_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `rpt_summary_im_masters_record_count_summary_vw` AS select count(1) AS `ROW_COUNT` from `independent_mst_vw` */;

--
-- Final view structure for view `rpt_summary_im_system_master_data_for_non_blank_brand_vw`
--

/*!50001 DROP VIEW IF EXISTS `rpt_summary_im_system_master_data_for_non_blank_brand_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `rpt_summary_im_system_master_data_for_non_blank_brand_vw` AS select `independent_mst_vw`.`DATA_TYPE` AS `DATA_TYPE`,`independent_mst_vw`.`ORG_ACC_ID` AS `ORG_ACC_ID`,`independent_mst_vw`.`BRAND_ID` AS `BRAND_ID`,count(1) AS `ROW_COUNT` from `independent_mst_vw` group by `independent_mst_vw`.`DATA_TYPE`,`independent_mst_vw`.`ORG_ACC_ID`,`independent_mst_vw`.`BRAND_ID` */;

--
-- Final view structure for view `rpt_system_entity_is_editable_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `rpt_system_entity_is_editable_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `rpt_system_entity_is_editable_summary_vw` AS select `system_entities_vw`.`TABLE_TYPE` AS `TABLE_TYPE`,`system_entities_vw`.`IS_EDITABLE` AS `IS_EDITABLE`,count(1) AS `ROW_COUNT` from `system_entities_vw` group by `system_entities_vw`.`TABLE_TYPE`,`system_entities_vw`.`IS_EDITABLE` */;

--
-- Final view structure for view `rpt_system_entity_is_predefine_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `rpt_system_entity_is_predefine_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `rpt_system_entity_is_predefine_summary_vw` AS select `system_entities_vw`.`TABLE_TYPE` AS `TABLE_TYPE`,`system_entities_vw`.`IS_PREDEFINED` AS `IS_PREDEFINED`,count(1) AS `ROW_COUNT` from `system_entities_vw` group by `system_entities_vw`.`TABLE_TYPE`,`system_entities_vw`.`IS_PREDEFINED` */;

--
-- Final view structure for view `rpt_system_entity_record_count_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `rpt_system_entity_record_count_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `rpt_system_entity_record_count_summary_vw` AS select count(1) AS `ROW_COUNT` from `system_entities_vw` */;

--
-- Final view structure for view `rpt_system_entity_replicate_data_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `rpt_system_entity_replicate_data_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `rpt_system_entity_replicate_data_summary_vw` AS select `system_entities_vw`.`TABLE_TYPE` AS `TABLE_TYPE`,`system_entities_vw`.`REPLICATE_DATA_FOR_ALL_BRANDS` AS `REPLICATE_DATA_FOR_ALL_BRANDS`,count(1) AS `ROW_COUNT` from `system_entities_vw` group by `system_entities_vw`.`TABLE_TYPE`,`system_entities_vw`.`REPLICATE_DATA_FOR_ALL_BRANDS` */;

--
-- Final view structure for view `rpt_system_entity_user_can_create_data_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `rpt_system_entity_user_can_create_data_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `rpt_system_entity_user_can_create_data_summary_vw` AS select `system_entities_vw`.`TABLE_TYPE` AS `TABLE_TYPE`,`system_entities_vw`.`USER_CAN_CREATE_DATA` AS `USER_CAN_CREATE_DATA`,count(1) AS `ROW_COUNT` from `system_entities_vw` group by `system_entities_vw`.`TABLE_TYPE`,`system_entities_vw`.`USER_CAN_CREATE_DATA` */;

--
-- Final view structure for view `rpt_system_entity_visible_to_user_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `rpt_system_entity_visible_to_user_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `rpt_system_entity_visible_to_user_summary_vw` AS select `system_entities_vw`.`TABLE_TYPE` AS `TABLE_TYPE`,`system_entities_vw`.`VISIBLE_TO_USER_FLAG` AS `VISIBLE_TO_USER_FLAG`,count(1) AS `ROW_COUNT` from `system_entities_vw` group by `system_entities_vw`.`TABLE_TYPE`,`system_entities_vw`.`VISIBLE_TO_USER_FLAG` */;

--
-- Final view structure for view `rpt_system_master_data_for_non_blank_brand_vw`
--

/*!50001 DROP VIEW IF EXISTS `rpt_system_master_data_for_non_blank_brand_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `rpt_system_master_data_for_non_blank_brand_vw` AS select `independent_mst_vw`.`DATA_TYPE` AS `DATA_TYPE`,`independent_mst_vw`.`ORG_ACC_ID` AS `ORG_ACC_ID`,`independent_mst_vw`.`BRAND_ID` AS `BRAND_ID`,count(1) AS `ROW_COUNT` from `independent_mst_vw` group by `independent_mst_vw`.`DATA_TYPE`,`independent_mst_vw`.`ORG_ACC_ID`,`independent_mst_vw`.`BRAND_ID` */;

--
-- Final view structure for view `rpt_table_type_wise_master_data_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `rpt_table_type_wise_master_data_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `rpt_table_type_wise_master_data_summary_vw` AS select `independent_mst_vw`.`DATA_TYPE` AS `DATA_TYPE`,count(1) AS `count(1)` from `independent_mst_vw` group by `independent_mst_vw`.`DATA_TYPE` */;

--
-- Final view structure for view `rpt_table_type_wise_system_entity_summary_vw`
--

/*!50001 DROP VIEW IF EXISTS `rpt_table_type_wise_system_entity_summary_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `rpt_table_type_wise_system_entity_summary_vw` AS select `system_entities_vw`.`TABLE_TYPE` AS `TABLE_TYPE`,count(1) AS `ROW_COUNT` from `system_entities_vw` group by `system_entities_vw`.`TABLE_TYPE` */;

--
-- Final view structure for view `salary_breakup_vw`
--

/*!50001 DROP VIEW IF EXISTS `salary_breakup_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `salary_breakup_vw` AS select `salary_breakup`.`SLB_ID` AS `SLB_ID`,`salary_breakup`.`EMP_ID` AS `EMP_ID`,(select `emp_mst`.`EMP_NBR` from `emp_mst` where (`emp_mst`.`EMP_ID` = `salary_breakup`.`EMP_ID`) limit 1) AS `EMP_CD`,(select concat(`emp_mst`.`EMP_NAME`,' ',`emp_mst`.`EMPLST_NM`) from `emp_mst` where (`emp_mst`.`EMP_ID` = `salary_breakup`.`EMP_ID`) limit 1) AS `EMP_NM`,`salary_breakup`.`YEAR` AS `YEAR`,`salary_breakup`.`DAILY_SALARY` AS `DAILY_SALARY`,`salary_breakup`.`WEEKLY_SALARY` AS `WEEKLY_SALARY`,`salary_breakup`.`MONTHLY_SALARY` AS `MONTHLY_SALARY`,`salary_breakup`.`ANNUAL_SALARY` AS `ANNUAL_SALARY`,`salary_breakup`.`CTC` AS `CTC`,`salary_breakup`.`CUM_GROSS_EARNINGS` AS `CUM_GROSS_EARNINGS`,`salary_breakup`.`CUM_GROSS_DEDUCTIONS` AS `CUM_GROSS_DEDUCTIONS`,`salary_breakup`.`CUM_GROSS_CONTRIBUTIONS` AS `CUM_GROSS_CONTRIBUTIONS`,`salary_breakup`.`BASIC` AS `BASIC`,`salary_breakup`.`HRA` AS `HRA`,`salary_breakup`.`CONVEYANCE_ALLOWANCE` AS `CONVEYANCE_ALLOWANCE`,`salary_breakup`.`MEDICAL_ALLOWANCE` AS `MEDICAL_ALLOWANCE`,`salary_breakup`.`TELEPHONE_ALLOWANCE` AS `TELEPHONE_ALLOWANCE`,`salary_breakup`.`SPECIAL_ALLOWANCE` AS `SPECIAL_ALLOWANCE`,`salary_breakup`.`GRATUITY` AS `GRATUITY`,`salary_breakup`.`MEDICAL_INSURANCE` AS `MEDICAL_INSURANCE`,`salary_breakup`.`STATUTORY_BONUS` AS `STATUTORY_BONUS`,`salary_breakup`.`CITY_COMPENSATORY_ALLOWANCE` AS `CITY_COMPENSATORY_ALLOWANCE`,`salary_breakup`.`EDUCATION` AS `EDUCATION`,`salary_breakup`.`LTA` AS `LTA`,`salary_breakup`.`DEARNESS_ALLOWANCE` AS `DEARNESS_ALLOWANCE`,`salary_breakup`.`CAR_LEASE` AS `CAR_LEASE`,`salary_breakup`.`MEAL_VOUCHERS` AS `MEAL_VOUCHERS`,`salary_breakup`.`ADHOC_ALLOWANCE` AS `ADHOC_ALLOWANCE`,`salary_breakup`.`PROFESSIONAL_TAX` AS `PROFESSIONAL_TAX`,`salary_breakup`.`PROVIDENT_FUND` AS `PROVIDENT_FUND`,`salary_breakup`.`EMPLOYER_PROVIDENT_FUND` AS `EMPLOYER_PROVIDENT_FUND`,`salary_breakup`.`ESIC` AS `ESIC`,`salary_breakup`.`EMPLOYER_ESIC_CONTRIBUTIONS` AS `EMPLOYER_ESIC_CONTRIBUTIONS`,`salary_breakup`.`INCOME_TAX` AS `INCOME_TAX`,`salary_breakup`.`EMPLOYER_PENSION_FUND_CONTRIBUTIONS` AS `EMPLOYER_PENSION_FUND_CONTRIBUTIONS`,`salary_breakup`.`EMPLOYER_LEAVE_CONTRIBUTIONS` AS `EMPLOYER_LEAVE_CONTRIBUTIONS`,`salary_breakup`.`LOP_DEDUCTIONS` AS `LOP_DEDUCTIONS`,`salary_breakup`.`IS_DELETED` AS `IS_DELETED`,`salary_breakup`.`OA_ID` AS `OA_ID`,`salary_breakup`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`salary_breakup`.`USER_ID` AS `USER_ID`,`salary_breakup`.`CREATED_BY` AS `CREATED_BY`,`salary_breakup`.`CREATED_ON` AS `CREATED_ON`,`salary_breakup`.`UPDATED_BY` AS `UPDATED_BY`,`salary_breakup`.`UPDATED_ON` AS `UPDATED_ON` from `salary_breakup` */;

--
-- Final view structure for view `salary_component_settings_vw`
--

/*!50001 DROP VIEW IF EXISTS `salary_component_settings_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `salary_component_settings_vw` AS select `salary_component_settings`.`SC_ID` AS `SC_ID`,`salary_component_settings`.`COMPONENT_ID` AS `COMPONENT_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`salary_component_settings`.`COMPONENT_ID` = `independent_mst`.`MSTR_ID`)) AS `SALARY_COMPONENT`,`salary_component_settings`.`COMPONENT_SEQUENCE` AS `COMPONENT_SEQUENCE`,`salary_component_settings`.`COMPONENT_TYPE` AS `COMPONENT_TYPE`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`salary_component_settings`.`COMPONENT_TYPE` = `independent_mst`.`MSTR_ID`)) AS `COMPONENT_TYPE_NM`,`salary_component_settings`.`PAY_GROUP_HEAD` AS `PAY_GROUP_HEAD`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`salary_component_settings`.`PAY_GROUP_HEAD` = `independent_mst`.`MSTR_ID`)) AS `PAY_GROUP_HEAD_NM`,`salary_component_settings`.`PAYROLL_COMP_CALC_TYPE` AS `PAYROLL_COMP_CALC_TYPE`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`salary_component_settings`.`PAYROLL_COMP_CALC_TYPE` = `independent_mst`.`MSTR_ID`)) AS `PAYROLL_COMP_CALC_TYPE_NM`,`salary_component_settings`.`COMPONENT_CALC_TYPE` AS `COMPONENT_CALC_TYPE`,`salary_component_settings`.`COMPONENT_CALC_TYPE_CONFIG` AS `COMPONENT_CALC_TYPE_CONFIG`,`salary_component_settings`.`IS_ANNUAL` AS `IS_ANNUAL`,`salary_component_settings`.`SIGN` AS `SIGN`,`salary_component_settings`.`TAXABLE_STATUS` AS `TAXABLE_STATUS`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`salary_component_settings`.`TAXABLE_STATUS` = `independent_mst`.`MSTR_ID`)) AS `TAXABLE_STATUS_NM`,`salary_component_settings`.`OT_APPLICABLE` AS `OT_APPLICABLE`,`salary_component_settings`.`OT_INCLUDED` AS `OT_INCLUDED`,`salary_component_settings`.`EFFECTIVE_FROM` AS `EFFECTIVE_FROM`,`salary_component_settings`.`LATEST_CALCULATED` AS `LATEST_CALCULATED`,if((`salary_component_settings`.`IS_ENABLED` = 0),'NO','YES') AS `IS_ENABLED`,if((`salary_component_settings`.`VISIBLE_IN_SALARY` = 0),'NO','YES') AS `VISIBLE_IN_SALARY`,if((`salary_component_settings`.`VISIBLE_IN_ANNEXURE` = 0),'NO','YES') AS `VISIBLE_IN_ANNEXURE`,`salary_component_settings`.`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`,`salary_component_settings`.`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`,`salary_component_settings`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`salary_component_settings`.`IS_DELETED` AS `IS_DELETED`,`salary_component_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`,`salary_component_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`,`salary_component_settings`.`CREATED_ON` AS `CREATED_ON`,`salary_component_settings`.`UPDATED_ON` AS `UPDATED_ON` from `salary_component_settings` */;

--
-- Final view structure for view `salary_details_vw`
--

/*!50001 DROP VIEW IF EXISTS `salary_details_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `salary_details_vw` AS select `salary_details`.`EMP ID` AS `EMP ID`,`salary_details`.`STAFF_NAME` AS `STAFF_NAME`,`salary_details`.`GRADE` AS `GRADE`,`salary_details`.`POSITION` AS `POSITION`,`salary_details`.`CURRANCY` AS `CURRANCY`,`salary_details`.`SALARY_COMPENENT` AS `SALARY_COMPENENT`,`salary_details`.`COMPENT_AMMOUNT` AS `COMPENT_AMMOUNT`,`salary_details`.`PAY_FREQUENCY` AS `PAY_FREQUENCY`,`salary_details`.`COMPENENT_DESCRIPTION` AS `COMPENENT_DESCRIPTION`,`salary_details`.`OA_ID` AS `OA_ID`,`salary_details`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`salary_details`.`USER_ID` AS `USER_ID`,`salary_details`.`IS_DELETED` AS `IS_DELETED`,`salary_details`.`CREATED_BY` AS `CREATED_BY`,`salary_details`.`CREATED_ON` AS `CREATED_ON`,`salary_details`.`UPDATED_ON` AS `UPDATED_ON`,`salary_details`.`UPDATED_BY` AS `UPDATED_BY` from `salary_details` */;

--
-- Final view structure for view `salarycomponentmember_vw`
--

/*!50001 DROP VIEW IF EXISTS `salarycomponentmember_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `salarycomponentmember_vw` AS select `salarycomponentmember`.`SALARY_COMP_MEMBER_ID` AS `SALARY_COMP_MEMBER_ID`,`salarycomponentmember`.`TYPE_ID` AS `TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`salarycomponentmember`.`TYPE_ID` = `independent_mst`.`MSTR_ID`)) AS `TYPE`,`salarycomponentmember`.`COMPONENT_ID` AS `COMPONENT_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`salarycomponentmember`.`COMPONENT_ID` = `independent_mst`.`MSTR_ID`)) AS `COMPONENT`,`salarycomponentmember`.`COMPONENT_MEMBER_CAL_SEQ` AS `COMPONENT_MEMBER_CAL_SEQ`,`salarycomponentmember`.`COMPONENT_TYPE_ID` AS `COMPONENT_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`salarycomponentmember`.`COMPONENT_TYPE_ID` = `independent_mst`.`MSTR_ID`)) AS `COMPONENT_TYPE`,`salarycomponentmember`.`IS_ENABLED` AS `IS_ENABLED`,`salarycomponentmember`.`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`,`salarycomponentmember`.`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`,`salarycomponentmember`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`salarycomponentmember`.`IS_DELETED` AS `IS_DELETED`,`salarycomponentmember`.`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`,`salarycomponentmember`.`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`,`salarycomponentmember`.`CREATED_ON` AS `CREATED_ON`,`salarycomponentmember`.`UPDATE_ON` AS `UPDATE_ON` from `salarycomponentmember` */;

--
-- Final view structure for view `salutation_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `salutation_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `salutation_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` = 265) */;

--
-- Final view structure for view `schedule_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `schedule_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `schedule_mst_vw` AS select `schedule_mst`.`SCHEDULE_ID` AS `SCHEDULE_ID`,`schedule_mst`.`SCHEDULE` AS `SCHEDULE`,`schedule_mst`.`DESCRIPTION` AS `DESCRIPTION`,`schedule_mst`.`OA_ID` AS `OA_ID`,`schedule_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`schedule_mst`.`CREATEDBY` AS `CREATEDBY`,`schedule_mst`.`UPDATEDBY` AS `UPDATEDBY`,`schedule_mst`.`CREATEDON` AS `CREATEDON`,`schedule_mst`.`UPDATEDON` AS `UPDATEDON` from `schedule_mst` */;

--
-- Final view structure for view `schedule_status_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `schedule_status_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `schedule_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` = 252) */;

--
-- Final view structure for view `schedule_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `schedule_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `schedule_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` = 475) */;

--
-- Final view structure for view `scholastic_grade_details_vw`
--

/*!50001 DROP VIEW IF EXISTS `scholastic_grade_details_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `scholastic_grade_details_vw` AS select `scholastic_grade_details`.`ID` AS `ID`,`scholastic_grade_details`.`MAXIMUM_MARKS` AS `MAXIMUM_MARKS`,`scholastic_grade_details`.`GRADE_ID` AS `GRADE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `scholastic_grade_details`.`GRADE_ID`)) AS `GRADE_NM`,`scholastic_grade_details`.`RANGE_START` AS `RANGE_START`,`scholastic_grade_details`.`RANGE_END` AS `RANGE_END`,`scholastic_grade_details`.`RESULT_ID` AS `RESULT_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `scholastic_grade_details`.`RESULT_ID`)) AS `RESULT_NM`,`scholastic_grade_details`.`IS_DELETED` AS `IS_DELETED`,`scholastic_grade_details`.`OA_ID` AS `OA_ID`,`scholastic_grade_details`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`scholastic_grade_details`.`USER_ID` AS `USER_ID`,`scholastic_grade_details`.`CREATED_ON` AS `CREATED_ON`,`scholastic_grade_details`.`CREATED_BY` AS `CREATED_BY`,`scholastic_grade_details`.`UPDATED_ON` AS `UPDATED_ON`,`scholastic_grade_details`.`UPDATED_BY` AS `UPDATED_BY` from `scholastic_grade_details` */;

--
-- Final view structure for view `scholastic_grade_marks_setup_vw`
--

/*!50001 DROP VIEW IF EXISTS `scholastic_grade_marks_setup_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `scholastic_grade_marks_setup_vw` AS select `scholastic_grade_marks_setup`.`GRADE_ID` AS `GRADE_ID`,`scholastic_grade_marks_setup`.`RANGE_START` AS `RANGE_START`,`scholastic_grade_marks_setup`.`RANGE_END` AS `RANGE_END`,`scholastic_grade_marks_setup`.`RESULT` AS `RESULT`,`scholastic_grade_marks_setup`.`OA_ID` AS `OA_ID`,`scholastic_grade_marks_setup`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`scholastic_grade_marks_setup`.`USER_ID` AS `USER_ID`,`scholastic_grade_marks_setup`.`ISDELETED` AS `ISDELETED`,`scholastic_grade_marks_setup`.`CREATED_ON` AS `CREATED_ON`,`scholastic_grade_marks_setup`.`CREATED_BY` AS `CREATED_BY`,`scholastic_grade_marks_setup`.`UPDATED_ON` AS `UPDATED_ON`,`scholastic_grade_marks_setup`.`UPDATED_BY` AS `UPDATED_BY` from `scholastic_grade_marks_setup` */;

--
-- Final view structure for view `scholastic_grade_result_vw`
--

/*!50001 DROP VIEW IF EXISTS `scholastic_grade_result_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `scholastic_grade_result_vw` AS select `scholastic_grade_result`.`SCHOLASTIC_GRADE_RESULT_ID` AS `SCHOLASTIC_GRADE_RESULT_ID`,`scholastic_grade_result`.`CLASS` AS `CLASS`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `scholastic_grade_result`.`CLASS`)) AS `CLASS_NM`,`scholastic_grade_result`.`EXAM_TYPE` AS `EXAM_TYPE`,(select `exam_type`.`EXAM_TYPE` from `exam_type` where (`exam_type`.`EXAM_TYPE_ID` = `scholastic_grade_result`.`EXAM_TYPE`)) AS `EXAM_NM`,`scholastic_grade_result`.`SUBJECT` AS `SUBJECT`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `scholastic_grade_result`.`SUBJECT`)) AS `SUBJECT_NM`,`scholastic_grade_result`.`STUDENT` AS `STUDENT`,(select concat(`student_detail_vw`.`FIRSTNAME`,' ',`student_detail_vw`.`LASTNAME`) from `student_detail_vw` where (`student_detail_vw`.`ID` = `scholastic_grade_result`.`STUDENT`)) AS `STUDENT_NM`,`scholastic_grade_result`.`IS_DELETED` AS `IS_DELETED`,`scholastic_grade_result`.`OA_ID` AS `OA_ID`,`scholastic_grade_result`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`scholastic_grade_result`.`USER_ID` AS `USER_ID`,`scholastic_grade_result`.`CREATED_BY` AS `CREATED_BY`,`scholastic_grade_result`.`CREATED_ON` AS `CREATED_ON`,`scholastic_grade_result`.`UPDATED_BY` AS `UPDATED_BY`,`scholastic_grade_result`.`UPDATED_ON` AS `UPDATED_ON` from `scholastic_grade_result` */;

--
-- Final view structure for view `scholastic_grade_vw`
--

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

--
-- Final view structure for view `school_term_vw`
--

/*!50001 DROP VIEW IF EXISTS `school_term_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `school_term_vw` AS select `school_term`.`TERM_ID` AS `TERM_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `school_term`.`TERM_TYPE`)) AS `TERM_TYPE`,`school_term`.`TERM_TYPE` AS `TERM_TYPE_ID`,`school_term`.`ACADEMIC_PERIOD_ID` AS `ACADEMIC_PERIOD_ID`,(select `period_mst`.`FISCAL_PERIOD_DESC` from `period_mst` where (`period_mst`.`PERIOD_ID` = `school_term`.`ACADEMIC_PERIOD_ID`)) AS `ACADEMIC_PERIOD`,`school_term`.`TERM_START_DATE` AS `TERM_START_DATE`,`school_term`.`TERM_END_DATE` AS `TERM_END_DATE`,`school_term`.`TERM_DESCRIPTION` AS `TERM_DESCRIPTION`,`school_term`.`IS_DELETED` AS `IS_DELETED`,`school_term`.`USER_ID` AS `USER_ID`,`school_term`.`OA_ID` AS `OA_ID`,`school_term`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`school_term`.`CREATED_BY` AS `CREATED_BY`,`school_term`.`UPDATED_BY` AS `UPDATED_BY`,`school_term`.`CREATED_ON` AS `CREATED_ON`,`school_term`.`UPDATED_ON` AS `UPDATED_ON` from `school_term` */;

--
-- Final view structure for view `secure_consolidation_vw`
--

/*!50001 DROP VIEW IF EXISTS `secure_consolidation_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `secure_consolidation_vw` AS select `secure_consolidation`.`CONSOLIDATION_ID` AS `CONSOLIDATION_ID`,`secure_consolidation`.`LOAN` AS `LOAN`,`secure_consolidation`.`OUTSTANDING_BALANCE` AS `OUTSTANDING_BALANCE`,`secure_consolidation`.`MONTHLY_PAYMENT` AS `MONTHLY_PAYMENT`,`secure_consolidation`.`CURRENT_ARREARS` AS `CURRENT_ARREARS`,`secure_consolidation`.`OA_ID` AS `OA_ID`,`secure_consolidation`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`secure_consolidation`.`USER_ID` AS `USER_ID`,`secure_consolidation`.`IS_DELETED` AS `IS_DELETED`,`secure_consolidation`.`CREATED_ON` AS `CREATED_ON`,`secure_consolidation`.`CREATED_BY` AS `CREATED_BY`,`secure_consolidation`.`UPDATED_ON` AS `UPDATED_ON`,`secure_consolidation`.`UPDATED_BY` AS `UPDATED_BY` from `secure_consolidation` */;

--
-- Final view structure for view `session_speaker_vw`
--

/*!50001 DROP VIEW IF EXISTS `session_speaker_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `session_speaker_vw` AS select `ss`.`SS_ID` AS `SS_ID`,`ss`.`SPEAKER_ID` AS `SPEAKER_ID`,`ss`.`CONF_ID` AS `CONF_ID`,`s`.`SPEAKER_NAME` AS `SPEAKER_NAME`,`ss`.`SESSION_ID` AS `SESSION_ID`,`ses`.`HEADING` AS `HEADING`,`ss`.`IS_DELETED` AS `IS_DELETED`,`s`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `s`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `s`.`OA_ID`)) AS `OA_NM`,`s`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `s`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `s`.`OA_BRAND_ID`)) AS `OA_BRAND_NM` from ((`session_speaker` `ss` join `speakers` `s` on((`ss`.`SPEAKER_ID` = `s`.`SPEAKER_ID`))) join `sessions` `ses` on((`ss`.`SESSION_ID` = `ses`.`SESSION_ID`))) order by `ss`.`SS_ID` */;

--
-- Final view structure for view `set_up_exam_terms_vw`
--

/*!50001 DROP VIEW IF EXISTS `set_up_exam_terms_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `set_up_exam_terms_vw` AS select `set_up_exam_terms`.`SET_UP_EXAM_TERMS_ID` AS `SET_UP_EXAM_TERMS_ID`,`set_up_exam_terms`.`EXAM_TERM` AS `EXAM_TERM`,`set_up_exam_terms`.`TOTAL_PERCENTAGE` AS `TOTAL_PERCENTAGE`,`set_up_exam_terms`.`IS_DELETED` AS `IS_DELETED`,`set_up_exam_terms`.`OA_ID` AS `OA_ID`,`set_up_exam_terms`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`set_up_exam_terms`.`USER_ID` AS `USER_ID`,`set_up_exam_terms`.`CREATED_BY` AS `CREATED_BY`,`set_up_exam_terms`.`CREATED_ON` AS `CREATED_ON`,`set_up_exam_terms`.`UPDATED_BY` AS `UPDATED_BY`,`set_up_exam_terms`.`UPDATED_ON` AS `UPDATED_ON` from `set_up_exam_terms` */;

--
-- Final view structure for view `setting_group_attribute_Value_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `setting_group_attribute_Value_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `setting_group_attribute_Value_mst_vw` AS select `setting_group_attribute_Value_mst`.`SETTING_ATTRIBUTE_OPTIONS_ID` AS `SETTING_ATTRIBUTE_OPTIONS_ID`,`setting_group_attribute_Value_mst`.`SETTING_ATTRIBUTE_ID` AS `SETTING_ATTRIBUTE_ID`,`setting_group_attribute_Value_mst`.`SETTING_ATTRIBUTE_CD` AS `SETTING_ATTRIBUTE_CD`,(select `setting_group_attribute_mst`.`SETTING_ATTRIBUTE_DESC` from `setting_group_attribute_mst` where (`setting_group_attribute_mst`.`SETTING_ATTRIBUTE_ID` = `setting_group_attribute_Value_mst`.`SETTING_ATTRIBUTE_ID`)) AS `SETTING_ATTRIBUTE`,`setting_group_attribute_Value_mst`.`ANSWER_GROUP_ID` AS `ANSWER_GROUP_ID`,`setting_group_attribute_Value_mst`.`INPUT_OPTION_TYPE_ID` AS `INPUT_OPTION_TYPE_ID`,`setting_group_attribute_Value_mst`.`INPUT_OPTION_TYPE_CD` AS `INPUT_OPTION_TYPE_CD`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `setting_group_attribute_Value_mst`.`INPUT_OPTION_TYPE_ID`)) AS `INPUT_OPTION_TYPE`,`setting_group_attribute_Value_mst`.`GLOBAL_SETTING_DATA_TYPE_ID` AS `GLOBAL_SETTING_DATA_TYPE_ID`,`setting_group_attribute_Value_mst`.`GLOBAL_SETTING_DATA_TYPE_ID` AS `GLOBAL_SETTING_DATA_TYPE_CD`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `setting_group_attribute_Value_mst`.`GLOBAL_SETTING_DATA_TYPE_ID`)) AS `GLOBAL_SETTING_DATA_TYPE`,`setting_group_attribute_Value_mst`.`SYSTEM_SETTING_ATTRIBUTE_VALUE_ID` AS `SYSTEM_SETTING_ATTRIBUTE_VALUE_ID`,`setting_group_attribute_Value_mst`.`SYSTEM_SETTING_ATTRIBUTE_VALUE_CD` AS `SYSTEM_SETTING_ATTRIBUTE_VALUE_CD`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `setting_group_attribute_Value_mst`.`SYSTEM_SETTING_ATTRIBUTE_VALUE_ID`)) AS `SYSTEM_SETTING_ATTRIBUTE_VALUE`,`setting_group_attribute_Value_mst`.`INPUT_OPTION_DESC` AS `INPUT_OPTION_DESC`,`setting_group_attribute_Value_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` = `setting_group_attribute_Value_mst`.`SETTING_GROUP_ID`)) AS `SETTING_GROUP`,`setting_group_attribute_Value_mst`.`IS_DELETED` AS `IS_DELETED`,`setting_group_attribute_Value_mst`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `setting_group_attribute_Value_mst`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `setting_group_attribute_Value_mst`.`OA_ID`)) AS `OA_NM`,`setting_group_attribute_Value_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `setting_group_attribute_Value_mst`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `setting_group_attribute_Value_mst`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`setting_group_attribute_Value_mst`.`CREATED_BY` AS `CREATED_BY`,`setting_group_attribute_Value_mst`.`CREATED_ON` AS `CREATED_ON`,`setting_group_attribute_Value_mst`.`UPDATED_BY` AS `UPDATED_BY`,`setting_group_attribute_Value_mst`.`UPDATED_ON` AS `UPDATED_ON` from `setting_group_attribute_Value_mst` */;

--
-- Final view structure for view `setting_group_attribute_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `setting_group_attribute_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `setting_group_attribute_mst_vw` AS select `setting_group_attribute_mst`.`SETTING_ATTRIBUTE_ID` AS `SETTING_ATTRIBUTE_ID`,`setting_group_attribute_mst`.`SETTING_GROUP_SECTION_HEADER_ID` AS `SETTING_GROUP_SECTION_HEADER_ID`,(select `setting_group_section_header_mst`.`SETTING_GROUP_SECTION_TITLE` from `setting_group_section_header_mst` where (`setting_group_attribute_mst`.`SETTING_GROUP_SECTION_HEADER_ID` = `setting_group_section_header_mst`.`SETTING_GROUP_SECTION_HEADER_ID`)) AS `SETTING_GROUP_SECTION_HEADER`,`setting_group_attribute_mst`.`SYSTEM_SETTING_ATTRIBUTE_ID` AS `SYSTEM_SETTING_ATTRIBUTE_ID`,`setting_group_attribute_mst`.`SYSTEM_SETTING_ATTRIBUTE_CD` AS `SYSTEM_SETTING_ATTRIBUTE_CD`,`setting_group_attribute_mst`.`SETTING_ATTRIBUTE_DESC` AS `SETTING_ATTRIBUTE_DESC`,`setting_group_attribute_mst`.`SETTING_INPUT_VALUE_TYPE_ID` AS `SETTING_INPUT_VALUE_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `setting_group_attribute_mst`.`SETTING_INPUT_VALUE_TYPE_ID`)) AS `SETTING_INPUT_VALUE_TYPE`,`setting_group_attribute_mst`.`ANSWER_GROUP_ID` AS `ANSWER_GROUP_ID`,`setting_group_attribute_mst`.`INPUT_OPTION_TYPE_ID` AS `INPUT_OPTION_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `setting_group_attribute_mst`.`INPUT_OPTION_TYPE_ID`)) AS `INPUT_OPTION_TYPE`,`setting_group_attribute_mst`.`GLOBAL_SETTING_DATA_TYPE_ID` AS `GLOBAL_SETTING_DATA_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `setting_group_attribute_mst`.`GLOBAL_SETTING_DATA_TYPE_ID`)) AS `GLOBAL_SETTING_DATA_TYPE`,`setting_group_attribute_mst`.`NO_OF_OPTIONS` AS `NO_OF_OPTIONS`,`setting_group_attribute_mst`.`DEPENDENT_ON_ATTRIBUTE_ID` AS `DEPENDENT_ON_ATTRIBUTE_ID`,`setting_group_attribute_mst`.`SYSTEM_TYPE_ID` AS `SYSTEM_TYPE_ID`,(select `common_type`.`TYP_NM` from `common_type` where (`common_type`.`TYP_ID` = `setting_group_attribute_mst`.`SYSTEM_TYPE_ID`)) AS `SYSTEM_TYPE`,`setting_group_attribute_mst`.`IS_DELETED` AS `IS_DELETED`,`setting_group_attribute_mst`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `setting_group_attribute_mst`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `setting_group_attribute_mst`.`OA_ID`)) AS `OA_NM`,`setting_group_attribute_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `setting_group_attribute_mst`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `setting_group_attribute_mst`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`setting_group_attribute_mst`.`CREATED_BY` AS `CREATED_BY`,`setting_group_attribute_mst`.`CREATED_ON` AS `CREATED_ON`,`setting_group_attribute_mst`.`UPDATED_BY` AS `UPDATED_BY`,`setting_group_attribute_mst`.`UPDATED_ON` AS `UPDATED_ON` from `setting_group_attribute_mst` */;

--
-- Final view structure for view `setting_group_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `setting_group_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `setting_group_mst_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` */;

--
-- Final view structure for view `setting_group_section_header_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `setting_group_section_header_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `setting_group_section_header_mst_vw` AS select `setting_group_section_header_mst`.`SETTING_GROUP_SECTION_HEADER_ID` AS `SETTING_GROUP_SECTION_HEADER_ID`,`setting_group_section_header_mst`.`SETTING_GROUP_SECTION_TITLE` AS `SETTING_GROUP_SECTION_TITLE`,`setting_group_section_header_mst`.`SETTING_SUBJECT_LINE_TEXT` AS `SETTING_SUBJECT_LINE_TEXT`,`setting_group_section_header_mst`.`SETTING_CONTENT_HEADER_TEXT` AS `SETTING_CONTENT_HEADER_TEXT`,`setting_group_section_header_mst`.`SETTING_CONTENT_BODY_TEXT` AS `SETTING_CONTENT_BODY_TEXT`,`setting_group_section_header_mst`.`SETTING_CONTENT_SUMMARY_TEXT` AS `SETTING_CONTENT_SUMMARY_TEXT`,`setting_group_section_header_mst`.`SETTING_GROUP_ID` AS `SETTING_GROUP_ID`,`setting_group_section_header_mst`.`SETTING_GROUP_CD` AS `SETTING_GROUP_CD`,(select `setting_group_mst`.`SETTING_GROUP_NAME` from `setting_group_mst` where (`setting_group_mst`.`SETTING_GROUP_ID` = `setting_group_section_header_mst`.`SETTING_GROUP_ID`)) AS `SETTING_GROUP`,`setting_group_section_header_mst`.`IS_DELETED` AS `IS_DELETED`,`setting_group_section_header_mst`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `setting_group_section_header_mst`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `setting_group_section_header_mst`.`OA_ID`)) AS `OA_NM`,`setting_group_section_header_mst`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `setting_group_section_header_mst`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `setting_group_section_header_mst`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`setting_group_section_header_mst`.`CREATED_BY` AS `CREATED_BY`,`setting_group_section_header_mst`.`CREATED_ON` AS `CREATED_ON`,`setting_group_section_header_mst`.`UPDATED_BY` AS `UPDATED_BY`,`setting_group_section_header_mst`.`UPDATED_ON` AS `UPDATED_ON` from `setting_group_section_header_mst` */;

--
-- Final view structure for view `setting_group_status_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `setting_group_status_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `setting_group_status_mst_vw` AS select `IM`.`MSTR_ID` AS `MSTR_ID`,`IM`.`MSTR_CD` AS `MSTR_CD`,`IM`.`MSTR_NM` AS `MSTR_NM`,`IM`.`TYP_ID` AS `TYP_ID`,`IM`.`RECORD_TYP` AS `RECORD_TYP`,`IM`.`PARENT_MSTR_ID` AS `PARENT_MSTR_ID`,`IM`.`IS_EDITABLE` AS `IS_EDITABLE`,`IM`.`IS_PREDEFINED` AS `IS_PREDEFINED`,`IM`.`IS_DELETED` AS `IS_DELETED`,`IM`.`OA_ID` AS `OA_ID`,(select `OA`.`OA_CD` from `org_accounts` `OA` where (`OA`.`OA_ID` = `IM`.`OA_ID`)) AS `OA_CD`,(select `OA`.`OA_NM` from `org_accounts` `OA` where (`OA`.`OA_ID` = `IM`.`OA_ID`)) AS `OA_NM`,`IM`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `OAB`.`OA_BRAND_CD` from `oa_brands` `OAB` where (`OAB`.`OA_BRAND_ID` = `IM`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `OAB`.`OA_BRAND_NM` from `oa_brands` `OAB` where (`OAB`.`OA_BRAND_ID` = `IM`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`IM`.`USER_ID` AS `USERID`,(select `um`.`USER_NAME` from `user_mst` `um` where (`um`.`USER_ID` = `IM`.`USER_ID`)) AS `USER_NM`,`IM`.`CREATED_BY` AS `CREATED_BY_USER_ID`,(select `um`.`USER_NAME` from `user_mst` `um` where (`um`.`USER_ID` = `IM`.`CREATED_BY`)) AS `CREATED_BY_USER_NAME`,`IM`.`UPDATED_BY` AS `UPDATED_BY_USER_ID`,(select `um`.`USER_NAME` from `user_mst` `um` where (`um`.`USER_ID` = `IM`.`UPDATED_BY`)) AS `UPDATED_BY_USER_NAME`,`IM`.`CREATED_ON` AS `CREATED_ON`,`IM`.`UPDATED_ON` AS `UPDATED_ON` from `independent_mst` `IM` where (`IM`.`TYP_ID` = 505) */;

--
-- Final view structure for view `setting_input_option_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `setting_input_option_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `setting_input_option_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` = 503) */;

--
-- Final view structure for view `setting_input_value_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `setting_input_value_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `setting_input_value_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` = 502) */;

--
-- Final view structure for view `setting_status_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `setting_status_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `setting_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` = 504) */;

--
-- Final view structure for view `setting_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `setting_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `setting_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` = 501) */;

--
-- Final view structure for view `shift_break_vw`
--

/*!50001 DROP VIEW IF EXISTS `shift_break_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `shift_break_vw` AS select `shift_break`.`SHIFT_BREAK_ID` AS `SHIFT_BREAK_ID`,`shift_break`.`SHIFT_ID` AS `SHIFT_ID`,`shift_break`.`SHIFT_ID` AS `SHIFTID`,(select `shift_mst`.`NAME` from `shift_mst` where (`shift_mst`.`SHIFT_ID` = `SHIFTID`)) AS `SHIFT`,`shift_break`.`BREAK_START_TIME` AS `BREAK_START_TIME`,`shift_break`.`BREAK_END_TIME` AS `BREAK_END_TIME`,`shift_break`.`BREAK_DURATION` AS `BREAK_DURATION`,`shift_break`.`BREAK_DURATION_UNIT_ID` AS `BREAK_DURATION_UNIT_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `shift_break`.`BREAK_DURATION_UNIT_ID`)) AS `BREAK_DURATION_UNIT`,`shift_break`.`SHIFT_BREAK_STATUS_ID` AS `SHIFT_BREAK_STATUS_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `shift_break`.`SHIFT_BREAK_STATUS_ID`)) AS `SHIFT_BREAK_STATUS`,`shift_break`.`IS_DELETED` AS `IS_DELETED`,`shift_break`.`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`,`shift_break`.`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`,`shift_break`.`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`,`shift_break`.`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`,`shift_break`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NAME`,`shift_break`.`CREATED_ON` AS `CREATED_ON`,`shift_break`.`UPDATED_ON` AS `UPDATED_ON` from `shift_break` */;

--
-- Final view structure for view `shift_calendar_schedule_vw`
--

/*!50001 DROP VIEW IF EXISTS `shift_calendar_schedule_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `shift_calendar_schedule_vw` AS select `emp_shift_calendar`.`EMP_SHIFT_CALENDAR_ID` AS `EMP_SHIFT_CALENDAR_ID`,`emp_shift_calendar`.`CALENDAR_ID` AS `CALENDAR_ID`,`emp_shift_calendar`.`SHIFT_ID` AS `SHIFT_ID`,`emp_shift_calendar`.`SHIFT_CALENDAR_ID` AS `SHIFT_CALENDAR_ID`,`emp_shift_calendar`.`REMARKS` AS `REMARKS`,`emp_shift_calendar`.`OA_ID` AS `OA_ID`,`emp_shift_calendar`.`BRAND_ID` AS `BRAND_ID`,`emp_shift_calendar`.`USER_ID` AS `USER_ID`,`emp_shift_calendar`.`IS_DELETED` AS `IS_DELETED`,`emp_shift_calendar`.`CREATED_ON` AS `CREATED_ON`,`emp_shift_calendar`.`UPDATE_ON` AS `UPDATE_ON`,`emp_shift_calendar`.`CREATED_BY` AS `CREATED_BY`,`emp_shift_calendar`.`UPDATE_BY` AS `UPDATE_BY` from `emp_shift_calendar` where (`emp_shift_calendar`.`SHIFT_CALENDAR_ID` is not null) */;

--
-- Final view structure for view `shift_emp_mapping_vw`
--

/*!50001 DROP VIEW IF EXISTS `shift_emp_mapping_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `shift_emp_mapping_vw` AS select `shift_emp_mapping`.`SEM_ID` AS `SEM_ID`,`shift_emp_mapping`.`SHIFT_ID` AS `SHIFT_ID`,(select `shift_mst`.`NAME` from `shift_mst` where (`shift_mst`.`SHIFT_ID` = `shift_emp_mapping`.`SHIFT_ID`)) AS `SHIFT`,`shift_emp_mapping`.`EMP_ID` AS `EMP_ID`,(select `emp_mst`.`EMP_NAME` from `emp_mst` where (`emp_mst`.`EMP_ID` = `shift_emp_mapping`.`EMP_ID`)) AS `EMP_NM`,`shift_emp_mapping`.`IS_DELETED` AS `IS_DELETED`,`shift_emp_mapping`.`OA_ID` AS `OA_ID`,`shift_emp_mapping`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`shift_emp_mapping`.`USER_ID` AS `USER_ID`,`shift_emp_mapping`.`CREATED_BY` AS `CREATED_BY`,`shift_emp_mapping`.`UPDATED_BY` AS `UPDATED_BY`,`shift_emp_mapping`.`CREATED_ON` AS `CREATED_ON`,`shift_emp_mapping`.`UPDATED_ON` AS `UPDATED_ON` from `shift_emp_mapping` */;

--
-- Final view structure for view `shift_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `shift_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `shift_mst_vw` AS select `shift_mst`.`SHIFT_ID` AS `SHIFT_ID`,`shift_mst`.`NAME` AS `NAME`,`shift_mst`.`GRACE_MINS` AS `GRACE_MINS`,`shift_mst`.`SHIFT_TYPE_ID` AS `SHIFT_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `shift_mst`.`SHIFT_TYPE_ID`)) AS `SHIFT_TYPE`,`shift_mst`.`SHIFT_STATUS_ID` AS `SHIFT_STATUS_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `shift_mst`.`SHIFT_STATUS_ID`)) AS `SHIFT_STATUS`,if((`shift_mst`.`IS_BREAK_ALLOWED` = 1),'Yes','No') AS `IS_BREAK_ALLOWED`,`shift_mst`.`HOURS_PER_DAY` AS `HOURS_PER_DAY`,(select group_concat(`shift_emp_mapping_vw`.`EMP_ID` separator ',') from `shift_emp_mapping_vw` where (`shift_emp_mapping_vw`.`SHIFT_ID` = `shift_mst`.`SHIFT_ID`)) AS `EMP_ID`,(select group_concat(`shift_emp_mapping_vw`.`EMP_NM` separator ',') from `shift_emp_mapping_vw` where (`shift_emp_mapping_vw`.`SHIFT_ID` = `shift_mst`.`SHIFT_ID`)) AS `EMP_NM`,`shift_mst`.`NO_OF_DAYS` AS `NO_OF_DAYS`,`shift_mst`.`START_DATE` AS `START_DATE`,`shift_mst`.`END_DATE` AS `END_DATE`,`shift_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`,`shift_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`,`shift_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`,`shift_mst`.`CREATED_ON` AS `CREATED_ON`,`shift_mst`.`UPDATED_ON` AS `UPDATED_ON`,`shift_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`,`shift_mst`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NM`,`shift_mst`.`IS_DELETED` AS `IS_DELETED` from `shift_mst` where (`shift_mst`.`IS_DELETED` = 0) */;

--
-- Final view structure for view `shift_roster_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `shift_roster_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `shift_roster_mst_vw` AS select `shift_roster_mst`.`SRM_ID` AS `SRM_ID`,`shift_roster_mst`.`SRSM_ID` AS `SRSM_ID`,(select `shift_roster_scheme_mst`.`SHIFT_ROSTER_SHEME_NAME` from `shift_roster_scheme_mst` where (`shift_roster_scheme_mst`.`SHIFT_ROSTER_SCHEME_ID` = `shift_roster_mst`.`SRSM_ID`)) AS `SHIFT_ROSTER_SCHEME`,`shift_roster_mst`.`LOCATION_ID` AS `LOCATION_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `shift_roster_mst`.`LOCATION_ID`)) AS `LOCATION`,`shift_roster_mst`.`DEPT_ID` AS `DEPT_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `shift_roster_mst`.`DEPT_ID`)) AS `DEPARTMENT`,`shift_roster_mst`.`IS_DELETED` AS `IS_DELETED`,`shift_roster_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`,`shift_roster_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`,`shift_roster_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`,`shift_roster_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`,`shift_roster_mst`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NAME`,`shift_roster_mst`.`CREATED_ON` AS `CREATED_ON`,`shift_roster_mst`.`UPDATED_ON` AS `UPDATED_ON` from `shift_roster_mst` */;

--
-- Final view structure for view `shift_roster_scheme_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `shift_roster_scheme_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `shift_roster_scheme_mst_vw` AS select `shift_roster_scheme_mst`.`SHIFT_ROSTER_SCHEME_ID` AS `SHIFT_ROSTER_SCHEME_ID`,`shift_roster_scheme_mst`.`SHIFT_ROSTER_SHEME_CD` AS `SHIFT_ROSTER_SHEME_CD`,`shift_roster_scheme_mst`.`SHIFT_ROSTER_SHEME_NAME` AS `SHIFT_ROSTER_SHEME_NAME`,`shift_roster_scheme_mst`.`SHIFT_ROSTER_SHEME_STATUS_ID` AS `SHIFT_ROSTER_SHEME_STATUS_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `shift_roster_scheme_mst`.`SHIFT_ROSTER_SHEME_STATUS_ID`)) AS `SHIFT_ROSTER_SHEME_STATUS`,`shift_roster_scheme_mst`.`ROTA_PATTERN_ID` AS `ROTA_PATTERN_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `shift_roster_scheme_mst`.`ROTA_PATTERN_ID`)) AS `ROTA_PATTERN`,`shift_roster_scheme_mst`.`SHIFT_CALENDAR_ID` AS `SHIFT_CALENDAR_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `shift_roster_scheme_mst`.`SHIFT_CALENDAR_ID`)) AS `SHIFT_CALENDAR`,`shift_roster_scheme_mst`.`IS_DELETED` AS `IS_DELETED`,`shift_roster_scheme_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`,`shift_roster_scheme_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`,`shift_roster_scheme_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`,`shift_roster_scheme_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`,`shift_roster_scheme_mst`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NAME`,`shift_roster_scheme_mst`.`CREATED_ON` AS `CREATED_ON`,`shift_roster_scheme_mst`.`UPDATED_ON` AS `UPDATED_ON` from `shift_roster_scheme_mst` */;

--
-- Final view structure for view `shift_time_schedule_vw`
--

/*!50001 DROP VIEW IF EXISTS `shift_time_schedule_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `shift_time_schedule_vw` AS select `shift_time_schedule`.`SHIFT_TIME_SCHEDULE_ID` AS `SHIFT_TIME_SCHEDULE_ID`,`shift_time_schedule`.`SHIFT_TIME_SCHEDULE_NAME` AS `SHIFT_TIME_SCHEDULE_NAME`,`shift_time_schedule`.`H1` AS `H1`,`shift_time_schedule`.`H2` AS `H2`,`shift_time_schedule`.`H3` AS `H3`,`shift_time_schedule`.`H4` AS `H4`,`shift_time_schedule`.`H5` AS `H5`,`shift_time_schedule`.`H6` AS `H6`,`shift_time_schedule`.`H7` AS `H7`,`shift_time_schedule`.`H8` AS `H8`,`shift_time_schedule`.`H9` AS `H9`,`shift_time_schedule`.`H10` AS `H10`,`shift_time_schedule`.`H11` AS `H11`,`shift_time_schedule`.`H12` AS `H12`,`shift_time_schedule`.`H13` AS `H13`,`shift_time_schedule`.`H14` AS `H14`,`shift_time_schedule`.`H15` AS `H15`,`shift_time_schedule`.`H16` AS `H16`,`shift_time_schedule`.`H17` AS `H17`,`shift_time_schedule`.`H18` AS `H18`,`shift_time_schedule`.`H19` AS `H19`,`shift_time_schedule`.`H20` AS `H20`,`shift_time_schedule`.`H21` AS `H21`,`shift_time_schedule`.`H22` AS `H22`,`shift_time_schedule`.`H23` AS `H23`,`shift_time_schedule`.`H24` AS `H24`,`shift_time_schedule`.`IS_DELETED` AS `IS_DELETED`,`shift_time_schedule`.`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`,`shift_time_schedule`.`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`,`shift_time_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`,`shift_time_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`,`shift_time_schedule`.`USER_ID` AS `USERID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `USERID`)) AS `USER_NAME`,`shift_time_schedule`.`CREATED_ON` AS `CREATED_ON`,`shift_time_schedule`.`UPDATED_ON` AS `UPDATED_ON` from `shift_time_schedule` */;

--
-- Final view structure for view `show_transaction_vw`
--

/*!50001 DROP VIEW IF EXISTS `show_transaction_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `show_transaction_vw` AS select `acc_transaction`.`TXNID` AS `TXNID`,`acc_transaction`.`ACCOUNT_HEAD_ID` AS `ACCOUNT_HEAD_ID`,`acc_transaction`.`ACCNUM` AS `ACCNUM`,(select `acc_mst`.`ACCNAME` from `acc_mst` where (`acc_mst`.`ACC_ID` = `acc_transaction`.`ACCOUNT_HEAD_ID`)) AS `ACCOUNT_HEAD_NAME`,`acc_transaction`.`TXNDATE` AS `TXNDATE`,(select concat(`acc_transaction`.`CROSSREFTYPE`,' ',`acc_transaction`.`CROSSREF`,' ',`acc_transaction`.`DESCRIPTION`)) AS `DESCRIPTION`,if((`acc_transaction`.`TXNTYPE` = 0),`acc_transaction`.`TXNVALUE`,0) AS `DEBITVALUE`,if((`acc_transaction`.`TXNTYPE` = 1),`acc_transaction`.`TXNVALUE`,0) AS `CREDITVALUE`,`acc_transaction`.`FINANCIAL_YEAR_ID` AS `FINANCIAL_YEAR_ID`,(select `period_mst_vw`.`FISCAL_PERIOD_DESC` from `period_mst_vw` where (`period_mst_vw`.`PERIOD_ID` = `acc_transaction`.`FINANCIAL_YEAR_ID`)) AS `FINANCIAL_YEAR_NAME`,`acc_transaction`.`OA_ID` AS `OA_ID`,`acc_transaction`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`acc_transaction`.`USER_ID` AS `USER_ID`,`acc_transaction`.`CREATED_BY` AS `CREATED_BY`,`acc_transaction`.`UPDATED_BY` AS `UPDATED_BY`,`acc_transaction`.`CREATED_ON` AS `CREATED_ON`,`acc_transaction`.`UPDATED_ON` AS `UPDATED_ON` from `acc_transaction` */;

--
-- Final view structure for view `skill_level_vw`
--

/*!50001 DROP VIEW IF EXISTS `skill_level_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `skill_level_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` = 174) */;

--
-- Final view structure for view `skill_proficiency_vw`
--

/*!50001 DROP VIEW IF EXISTS `skill_proficiency_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `skill_proficiency_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` = 172) */;

--
-- Final view structure for view `skill_status_vw`
--

/*!50001 DROP VIEW IF EXISTS `skill_status_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `skill_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` = 175) */;

--
-- Final view structure for view `skill_type_vw`
--

/*!50001 DROP VIEW IF EXISTS `skill_type_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `skill_type_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` = 173) */;

--
-- Final view structure for view `sleep_apnea_vw`
--

/*!50001 DROP VIEW IF EXISTS `sleep_apnea_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `sleep_apnea_vw` AS select `sa`.`ID` AS `ID`,`sa`.`PATIENT_ID` AS `PATIENT_ID`,(select `personal_information`.`FIRST_NAME` from `personal_information` where (`personal_information`.`PATIENT_ID` = `sa`.`PATIENT_ID`)) AS `PATIENT_NM`,`sa`.`SIT_READ` AS `SIT_READ`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `sa`.`SIT_READ`)) AS `SIT_READ_NM`,`sa`.`WATCH_TV` AS `WATCH_TV`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `sa`.`WATCH_TV`)) AS `WATCH_TV_NM`,`sa`.`INACTIVE_PLACE` AS `INACTIVE_PLACE`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `sa`.`INACTIVE_PLACE`)) AS `INACTIVE_PLACE_NM`,`sa`.`PASSENGER` AS `PASSENGER`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `sa`.`PASSENGER`)) AS `PASSENGER_NM`,`sa`.`PERMIT` AS `PERMIT`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `sa`.`PERMIT`)) AS `PERMIT_NM`,`sa`.`SOMEONE` AS `SOMEONE`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `sa`.`SOMEONE`)) AS `SOMEONE_NM`,`sa`.`SIT_QUIETLY` AS `SIT_QUIETLY`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `sa`.`SIT_QUIETLY`)) AS `SIT_QUIETLY_NM`,`sa`.`TRAFFIC` AS `TRAFFIC`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `sa`.`TRAFFIC`)) AS `TRAFFIC_NM`,`sa`.`ESS_SCORES` AS `ESS_SCORES`,`sa`.`OA_ID` AS `OA_ID`,`sa`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`sa`.`USER_ID` AS `USER_ID`,`sa`.`CREATED_BY` AS `CREATED_BY`,`sa`.`CREATED_ON` AS `CREATED_ON`,`sa`.`UPDATED_BY` AS `UPDATED_BY`,`sa`.`UPDATED_ON` AS `UPDATED_ON`,`sa`.`IS_DELETED` AS `IS_DELETED` from `sleep_apnea` `sa` */;

--
-- Final view structure for view `soc_lifestyle_vw`
--

/*!50001 DROP VIEW IF EXISTS `soc_lifestyle_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `soc_lifestyle_vw` AS select `soc_lifestyle`.`ID` AS `ID`,`soc_lifestyle`.`PATIENT_ID` AS `PATIENT_ID`,(select `personal_information`.`FIRST_NAME` from `personal_information` where (`personal_information`.`PATIENT_ID` = `soc_lifestyle`.`PATIENT_ID`)) AS `PATIENT_NM`,if((`soc_lifestyle`.`MARRIED` = 1),'Yes','No') AS `MARRIED`,`soc_lifestyle`.`MARRIED_TEXT` AS `MARRIED_TEXT`,`soc_lifestyle`.`STATUS` AS `STATUS`,if((`soc_lifestyle`.`LIVING_WILL` = 1),'Yes','No') AS `LIVING_WILL`,`soc_lifestyle`.`LIVING_WILL_TEXT` AS `LIVING_WILL_TEXT`,if((`soc_lifestyle`.`POWER_OF_ATTORNEY` = 1),'Yes','No') AS `POWER_OF_ATTORNEY`,`soc_lifestyle`.`POWER_OF_ATTORNEY_TEXT` AS `POWER_OF_ATTORNEY_TEXT`,if((`soc_lifestyle`.`FOREIGN_TRAVEL` = 1),'Yes','No') AS `FOREIGN_TRAVEL`,`soc_lifestyle`.`FOREIGN_WHEN` AS `FOREIGN_WHEN`,`soc_lifestyle`.`FOREIGN_WHERE` AS `FOREIGN_WHERE`,`soc_lifestyle`.`HIGHEST_EDU` AS `HIGHEST_EDU`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `soc_lifestyle`.`HIGHEST_EDU`)) AS `HIGHEST_EDU_NM`,`soc_lifestyle`.`EMPLOYMENT_STATUS` AS `EMPLOYMENT_STATUS`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `soc_lifestyle`.`EMPLOYMENT_STATUS`)) AS `EMPLOYMENT_STATUS_NM`,`soc_lifestyle`.`OA_ID` AS `OA_ID`,`soc_lifestyle`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`soc_lifestyle`.`USER_ID` AS `USER_ID`,`soc_lifestyle`.`CREATED_BY` AS `CREATED_BY`,`soc_lifestyle`.`CREATED_ON` AS `CREATED_ON`,`soc_lifestyle`.`UPDATED_BY` AS `UPDATED_BY`,`soc_lifestyle`.`UPDATED_ON` AS `UPDATED_ON`,`soc_lifestyle`.`IS_DELETED` AS `IS_DELETED` from `soc_lifestyle` */;

--
-- Final view structure for view `social_details_vw`
--

/*!50001 DROP VIEW IF EXISTS `social_details_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `social_details_vw` AS select `social_details`.`ACC_ID` AS `ACC_ID`,`social_details`.`PATIENT_ID` AS `PATIENT_ID`,(select `personal_information`.`FIRST_NAME` from `personal_information` where (`personal_information`.`PATIENT_ID` = `social_details`.`PATIENT_ID`)) AS `PATIENT_NM`,(select `im`.`MSTR_NM` from `independent_mst` `im` where (`im`.`MSTR_ID` = `social_details`.`MATERIAL_STATUS`)) AS `MATERIAL_STATUS`,(select `im`.`MSTR_NM` from `independent_mst` `im` where (`im`.`MSTR_ID` = `social_details`.`PREFERRED`)) AS `PREFERRED`,(select `im`.`MSTR_NM` from `independent_mst` `im` where (`im`.`MSTR_ID` = `social_details`.`ETHNICITY`)) AS `ETHNICITY`,(select `im`.`MSTR_NM` from `independent_mst` `im` where (`im`.`MSTR_ID` = `social_details`.`RACE`)) AS `RACE`,(select `im`.`MSTR_NM` from `independent_mst` `im` where (`im`.`MSTR_ID` = `social_details`.`NATIONALITY`)) AS `NATIONALITY`,(select `im`.`MSTR_NM` from `independent_mst` `im` where (`im`.`MSTR_ID` = `social_details`.`RELIGION`)) AS `RELIGION`,`social_details`.`OCCUPATION` AS `OCCUPATION`,`social_details`.`OA_ID` AS `OA_ID`,`social_details`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`social_details`.`CREATED_BY` AS `CREATED_BY`,`social_details`.`UPDATEDBY` AS `UPDATEDBY`,`social_details`.`CREATEDON` AS `CREATEDON`,`social_details`.`UPDATEDON` AS `UPDATEDON`,`social_details`.`IS_DELETED` AS `IS_DELETED`,`social_details`.`CREATEDBY` AS `CREATEDBY`,`social_details`.`CREATED_ON` AS `CREATED_ON`,`social_details`.`USER_ID` AS `USER_ID` from `social_details` */;

--
-- Final view structure for view `source_dcoument_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `source_dcoument_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `source_dcoument_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`.`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`.`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` = 490) */;

--
-- Final view structure for view `source_document_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `source_document_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `source_document_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` = 480) */;

--
-- Final view structure for view `speakers_vw`
--

/*!50001 DROP VIEW IF EXISTS `speakers_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `speakers_vw` AS select `speakers`.`SPEAKER_ID` AS `SPEAKER_ID`,`speakers`.`SPEAKER_NAME` AS `SPEAKER_NAME`,`speakers`.`COMPANY_NAME` AS `COMPANY_NAME`,`speakers`.`DESIGNATION` AS `DESIGNATION`,`speakers`.`DESCRIPTION` AS `DESCRIPTION`,`speakers`.`EPIC_PICTURE` AS `EPIC_PICTURE`,`speakers`.`EPIC_FILENAME` AS `EPIC_FILENAME`,`speakers`.`EPIC_TYPE` AS `EPIC_TYPE`,`speakers`.`EPIC_FILE_SIZE` AS `EPIC_FILE_SIZE`,`speakers`.`EPIC_FILE_WIDTH` AS `EPIC_FILE_WIDTH`,`speakers`.`EPIC_FILE_HEIGHT` AS `EPIC_FILE_HEIGHT`,`speakers`.`LOCATION` AS `LOCATION`,`speakers`.`OA_ID` AS `OA_ID`,`speakers`.`OA_BRAND_ID` AS `OA_BRAND_ID`,`speakers`.`USER_ID` AS `USER_ID`,`speakers`.`IS_DELETED` AS `IS_DELETED`,`speakers`.`CREATED_BY` AS `CREATED_BY`,`speakers`.`CREATED_ON` AS `CREATED_ON`,`speakers`.`UPDATED_BY` AS `UPDATED_BY`,`speakers`.`UPDATED_ON` AS `UPDATED_ON` from `speakers` */;

--
-- Final view structure for view `specail_journal_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `specail_journal_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `specail_journal_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`.`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`.`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` = 485) */;

--
-- Final view structure for view `special_journal_type_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `special_journal_type_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `special_journal_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` = 478) */;

--
-- Final view structure for view `staff_bank_dtl_vw`
--

/*!50001 DROP VIEW IF EXISTS `staff_bank_dtl_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `staff_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 `staff_contact_address_vw`
--

/*!50001 DROP VIEW IF EXISTS `staff_contact_address_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `staff_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 `staff_contact_emails_vw`
--

/*!50001 DROP VIEW IF EXISTS `staff_contact_emails_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `staff_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 `staff_contact_nationality_vw`
--

/*!50001 DROP VIEW IF EXISTS `staff_contact_nationality_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `staff_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 `staff_dependent_dtl_vw`
--

/*!50001 DROP VIEW IF EXISTS `staff_dependent_dtl_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `staff_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 `staff_education_vw`
--

/*!50001 DROP VIEW IF EXISTS `staff_education_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `staff_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 `staff_emergency_contact_dtl_vw`
--

/*!50001 DROP VIEW IF EXISTS `staff_emergency_contact_dtl_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `staff_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 `staff_hub_vw`
--

/*!50001 DROP VIEW IF EXISTS `staff_hub_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `staff_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'))) and (`um`.`USER_TYP_ID` <> (select `independent_mst`.`MSTR_ID` from `independent_mst` where (`independent_mst`.`MSTR_CD` = 'UCTE')))) */;

--
-- Final view structure for view `staff_immigration_dtl_vw`
--

/*!50001 DROP VIEW IF EXISTS `staff_immigration_dtl_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `staff_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 `staff_job_mst_vw`
--

/*!50001 DROP VIEW IF EXISTS `staff_job_mst_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `staff_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 `staff_language_vw`
--

/*!50001 DROP VIEW IF EXISTS `staff_language_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `staff_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 `staff_licence_vw`
--

/*!50001 DROP VIEW IF EXISTS `staff_licence_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `staff_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 `staff_member_attachment_vw`
--

/*!50001 DROP VIEW IF EXISTS `staff_member_attachment_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `staff_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 `staff_membership_vw`
--

/*!50001 DROP VIEW IF EXISTS `staff_membership_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `staff_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 `staff_oa_contact_phones_vw`
--

/*!50001 DROP VIEW IF EXISTS `staff_oa_contact_phones_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `staff_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 `staff_picture_vw`
--

/*!50001 DROP VIEW IF EXISTS `staff_picture_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `staff_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 `staff_reporting_locations_vw`
--

/*!50001 DROP VIEW IF EXISTS `staff_reporting_locations_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `staff_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 `staff_reporting_vw`
--

/*!50001 DROP VIEW IF EXISTS `staff_reporting_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `staff_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 `staff_shift_timing_vw`
--

/*!50001 DROP VIEW IF EXISTS `staff_shift_timing_vw`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`invoice_gap_v2`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `staff_shift_timing_vw` AS select `staff_shift_timing`.`STAFF_ID` AS `STAFF_ID`,`staff_shift_timing`.`SHIFT_ID` AS `SHIFT_ID`,(select `shift_mst`.`NAME` from `shift_mst` where (`shift_mst`.`SHIFT_ID` = `staff_shift_timing`.`SHIFT_ID`)) AS `SHIFT_NAME`,`staff_shift_timing`.`EMP_ID` AS `EMP_ID`,(select `emp_mst`.`EMP_NAME` from `emp_mst` where (`emp_mst`.`EMP_ID` = `staff_shift_timing`.`EMP_ID`)) AS `EMP_NM`,`staff_shift_timing`.`SHIFT_TYPE_ID` AS `SHIFT_TYPE_ID`,(select `independent_mst`.`MSTR_NM` from `independent_mst` where (`independent_mst`.`MSTR_ID` = `staff_shift_timing`.`SHIFT_TYPE_ID`)) AS `SHIFT_TYPE`,`staff_shift_timing`.`NO_OF_DAYS` AS `NO_OF_DAYS`,`staff_shift_timing`.`START_DATE` AS `START_DATE`,`staff_shift_timing`.`END_DATE` AS `END_DATE`,`staff_shift_timing`.`IS_DELETED` AS `IS_DELETED`,`staff_shift_timing`.`OA_ID` AS `OA_ID`,(select `org_accounts`.`OA_CD` from `org_accounts` where (`org_accounts`.`OA_ID` = `staff_shift_timing`.`OA_ID`)) AS `OA_CD`,(select `org_accounts`.`OA_NM` from `org_accounts` where (`org_accounts`.`OA_ID` = `staff_shift_timing`.`OA_ID`)) AS `OA_NM`,`staff_shift_timing`.`OA_BRAND_ID` AS `OA_BRAND_ID`,(select `oa_brands`.`OA_BRAND_CD` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `staff_shift_timing`.`OA_BRAND_ID`)) AS `OA_BRAND_CD`,(select `oa_brands`.`OA_BRAND_NM` from `oa_brands` where (`oa_brands`.`OA_BRAND_ID` = `staff_shift_timing`.`OA_BRAND_ID`)) AS `OA_BRAND_NM`,`staff_shift_timing`.`USER_ID` AS `USER_ID`,(select `user_mst`.`USER_NAME` from `user_mst` where (`user_mst`.`USER_ID` = `staff_shift_timing`.`USER_ID`)) AS `USER_NM`,`staff_shift_timing`.`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`,`staff_shift_timing`.`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`,`staff_shift_timing`.`CREATED_ON` AS `CREATED_ON`,`staff_shift_timing`.`UPDATED_ON` AS `UPDATED_ON` from `staff_shift_timing` */;
