From a5672fbe259b295516d18000c90ab23de62c1e65 Mon Sep 17 00:00:00 2001 From: Arnold Galovics Date: Wed, 23 Feb 2022 21:42:58 +0100 Subject: [PATCH] FINERACT-1498: Cleaning up Flyway files --- .../V100__Group_saving_summary_report.sql | 20 - ...mulitplesof_to_account_transfers_table.sql | 21 - .../V102__client_attendance_tables.sql | 49 - .../V103__cluster_support_for_batch_jobs.sql | 33 - .../V104__permissions_for_transfers.sql | 30 - ..._track_loan_transaction_against_office.sql | 34 - .../V106__more_permissions_for_transfers.sql | 49 - .../core_db/V107__datatable_code_mappings.sql | 30 - .../V108__client_has_transfer_office.sql | 28 - ..._transfer_withdrawal_fee_configuration.sql | 24 - ...0__interest-posting-fields-for-savings.sql | 31 - .../core_db/V110__group_center_close.sql | 27 - ...nse_account_for_existing_loan_products.sql | 23 - ...int_approach_for_datatables_by_default.sql | 20 - .../core_db/V112__mixreport_sql_support.sql | 132 --- ...ack_savings_transaction_against_office.sql | 34 - ...t_for_existing_savings_products - Copy.sql | 23 - .../V115__permissions_for_cache_api.sql | 38 - ...16__track_currency_for_journal_entries.sql | 48 - .../V117__loan_charge_from_savings.sql | 43 - .../V118_1__savings_charge_patch_update.sql | 22 - ...licate_fund_source_to_account_mappings.sql | 20 - ...rm_propose_and_accept_client_transfers.sql | 25 - ..._account_for_existing_savings_products.sql | 27 - ...batch_job_entry_for_pay_savings_charge.sql | 20 - ...ome_from_penalties_for savings_product.sql | 24 - ..._move_withdrawal_annual_fee_to_charges.sql | 272 ----- ...yments_seperately_in_loan_transactions.sql | 35 - .../core_db/V118__savings_charge.sql | 83 -- .../core_db/V119__add_template_table.sql | 53 - .../core_db/V11__add-payment-details.sql | 43 - .../V120__accounting_running_balance.sql | 24 - ...nting_running_balance_for_organization.sql | 23 - ...122__recurring_fee_support_for_savings.sql | 27 - .../V123__remove_payment_mode_for_savings.sql | 21 - .../V124__added_min_max_cap_for_charges.sql | 26 - ...mn_for_actual_fee_amount_or_percentage.sql | 21 - ...al_database_structure_for_sms_outbound.sql | 55 - .../core_db/V127__mobile_no_fields.sql | 27 - .../V128__added_loan_installment_charge.sql | 38 - .../V129__client_and_group_timeline.sql | 28 - ...2__add_external_id_to_couple_of_tables.sql | 45 - .../core_db/V130__calendar-history-table.sql | 38 - ..._holiday-status-column-and-permissions.sql | 35 - .../core_db/V132__borrower_cycle_changes.sql | 38 - ...ding_payment_detail_with_journal_entry.sql | 28 - ...1__submitted_date_updation_for_clients.sql | 24 - ...134_2__permissions_spelling_correction.sql | 20 - ..._added_column_value_on_c_configuration.sql | 31 - ..._added_permission_for_undo_written_off.sql | 20 - ...136_1__update_script_strechy_parameter.sql | 20 - ...137__added_is_active_column_in_m_staff.sql | 20 - ...r_m_product_loan_and_m_savings_product.sql | 37 - ...r_is_active_updated_to_true_in_m_staff.sql | 22 - ...group_and_client_pending_configuration.sql | 38 - ...yment_detail_id_in_ac_gl_journal_entry.sql | 22 - .../V140__added_loan_charge_status.sql | 21 - .../V141__add_early_repayment_strategy.sql | 22 - ..._read_savingsaccount_charge_permission.sql | 20 - ...create_journalentry_checker_permission.sql | 20 - .../V144__spelling_mistake_corrections.sql | 23 - ...orce_password_reset_in_c_configuration.sql | 36 - .../core_db/V146__tranche_loans.sql | 57 -- ...147__tranche_loans_column_name_changes.sql | 23 - .../core_db/V148__overdraft_changes.sql | 33 - ...__add_created_date_savings_transaction.sql | 23 - .../core_db/V14__rename_status_id_to_enum.sql | 27 - .../core_db/V150__basic_savings_report.sql | 49 - ..._add_default_savings_account_to_client.sql | 24 - .../V152__added_grace_for_over_due.sql | 24 - .../V153__Insert_missed_permissions.sql | 28 - .../core_db/V154__aging_details.sql | 20 - .../core_db/V155__stretchy_into_pentaho.sql | 735 ------------- .../V156__added_loan_saving_txns_pentaho.sql | 28 - .../V157__overdue_charge_improvements.sql | 37 - ...V158__dashboard_and_navigation_queries.sql | 36 - ...n_id_column_m_portfolio_command_source.sql | 21 - .../core_db/V15__center_permissions.sql | 26 - ..._nullValue_For_principal_on_lonProduct.sql | 20 - .../V160__standing_instruction_changes.sql | 144 --- .../core_db/V161__added_accrual_batch_job.sql | 25 - .../V162__overdue_charge_batch_job.sql | 20 - .../core_db/V163__added_npa_for_loans.sql | 26 - .../V164__fd_and_rd_deposit_tables.sql | 256 ----- ...mission_for_disburse_to_saving_account.sql | 20 - ..._amount_to_product_term_and_preclosure.sql | 26 - ...columns_for_writtenOff_loans_recovered.sql | 46 - ...xed_deposit_interest_to_linked_account.sql | 28 - ...ts_to_core_reports_use_report_to_false.sql | 20 - ...V16__drop_min_max_column_on_loan_table.sql | 26 - ..._deposit_accounts_maturity_details_job.sql | 20 - ...added_mandatory_savings_and_rd_changes.sql | 90 -- ...V172__accounting_changes_for_transfers.sql | 40 - .../sql/migrations/core_db/V173__ppi.sql | 122 --- .../core_db/V174__remove_interest_accrual.sql | 22 - .../V175__added_incentive_interest_rates.sql | 68 -- ...updates_to_financial_activity_accounts.sql | 34 - .../V177__cleanup_for_client_incentives.sql | 21 - ...tes_to_financial_activity_accounts_pt2.sql | 35 - ...on_names_for_maker_checker_permissions.sql | 22 - .../V17__update_stretchy_reporting_ddl.sql | 109 -- ...waitingdisbursal_and_groupnamesbystaff.sql | 21 - .../V181__standing_instruction_logging.sql | 30 - ...in_required_balance_to_savings_product.sql | 26 - ...d_min_balance_for_interest_calculation.sql | 24 - ...n_required_balance_for_savings_product.sql | 24 - ...accrual_till_date_for_periodic_accrual.sql | 21 - .../V186__added_periodic_accrual_job.sql | 22 - ...__added_permission_to_periodic_accrual.sql | 20 - ...d_savingscharge_inactivate_permissions.sql | 24 - ...__m_loan_interest_recalculation_tables.sql | 50 - ...8__update_stretchy_reporting_reportSql.sql | 25 - ...ategroup_disassociategroup_permissions.sql | 23 - ...e_gl_account_increase_size_of_name_col.sql | 21 - .../V192__interest_recalculate_job.sql | 26 - ...93__added_column_joiningDate_for_staff.sql | 21 - ...stComponent_for_interest_recalculation.sql | 21 - ..._moved_rest_frequency_to_product_level.sql | 28 - ...d_loan_running_balance_to_transactions.sql | 21 - ...d_loan_running_balance_of_transactions.sql | 32 - ...an_rescheduling_tables_and_permissions.sql | 92 -- ...ed_extra_columns_from_schedule_history.sql | 39 - .../V19__report_maintenance_permissions.sql | 33 - .../V1__mifosplatform-core-ddl-latest.sql | 965 ------------------ ...nt_for_start_interest_calculation_date.sql | 21 - .../sql/migrations/core_db/V201__webhooks.sql | 125 --- .../V202__savings_officer_history_table.sql | 38 - ...__added_subbmittedDate_loantransaction.sql | 22 - ...cript_for_charges_paid_by_for_accruals.sql | 20 - ...arge_and_interest_waiver_with_accruals.sql | 24 - .../V206__interest_posting_configuration.sql | 26 - .../V207__min_max_clients_per_group.sql | 22 - .../V208__min_max_clients_in_group_redux.sql | 28 - ...all_report_names_in_m_permission_table.sql | 60 -- ...eport_maint_perms_really_configuration.sql | 21 - ...__track_manually_adjusted_transactions.sql | 21 - ..._between_disbursal_and_first_repayment.sql | 21 - ..._add_NthDay_and_DayOfWeek_columns_loan.sql | 22 - ...d_DayOfWeek_columns_should_be_nullable.sql | 22 - ...er_table_add_create_SI_at_disbursement.sql | 20 - .../V215__guarantee_on_hold_fund_changes.sql | 37 - ...6__adding_loan_proposed_amount_to_loan.sql | 21 - ...nt_substatus_and_codevalue_description.sql | 30 - ...datetime_for_loan_savings_transactions.sql | 27 - ...antor_on_hold_fund_changes_for_account.sql | 65 -- ...21__activation-permissions-for-clients.sql | 27 - .../V220_1__prefix_type_account_number.sql | 23 - .../V220__account_number_preferences.sql | 41 - ...221__add_version_for_m_savings_account.sql | 21 - ..._on_hold_fund_changes_for_transactions.sql | 32 - .../V223__add_version_for_m_loan_account.sql | 21 - ...V224__client_lifecycle_adding_statuses.sql | 52 - ..._for_updating_recurring_deposit_amount.sql | 22 - ..._for_enforcing_calendars_for_jlg_loans.sql | 20 - .../core_db/V227__loan-refund-permissions.sql | 34 - .../core_db/V228__entity_to_entity_access.sql | 64 -- .../core_db/V229__teller_cash_management.sql | 126 --- ...-group-for-consistency-add-permissions.sql | 38 - ...le_status_and_correspoding_permissions.sql | 24 - ...ashier_transaction_added_currency_code.sql | 20 - .../V232__insert_center_closure_reason.sql | 20 - .../V233__Savings_Transaction_Receipt.sql | 27 - .../core_db/V234__opening_balaces_setup.sql | 53 - .../V235__add_ugd_template_id_m_hook.sql | 21 - ...ndividual_collection_sheet_permissions.sql | 21 - ...d_threshold_config_for_last_instalment.sql | 23 - ...V238__update_staff_display_name_length.sql | 23 - .../V239__Loan_Transaction_Receipt.sql | 21 - ...-configuration-for-client-group-status.sql | 23 - ...ging_config_for_interest_recalculation.sql | 24 - .../core_db/V241__fixed_emi_changes.sql | 22 - .../V242__entitytoentitymappingrelation.sql | 57 -- .../V243__alter_loan_disbursement_details.sql | 21 - .../V244__staff_assignment_history_table.sql | 41 - .../core_db/V245__open_rd_changes.sql | 20 - ...p_group_client_foreign_key_from_m_loan.sql | 21 - ...ng_principalThresholdForLastInstalment.sql | 22 - ...__added_password_never_expired_to_User.sql | 20 - .../core_db/V249__workingdays_permissions.sql | 52 - ...t-foreign-key-constraint-in-loan-table.sql | 26 - .../V250__password_validation_policy.sql | 57 -- .../core_db/V251__paymentType_table.sql | 65 -- .../V252__bug_fix_teller_cash_management.sql | 32 - ...__product_loan_configurable_attributes.sql | 40 - .../core_db/V254__General_Ledger_Report.sql | 42 - ...V255__pre_close_interest_period_config.sql | 21 - ...pdate script for General_Ledger_report.sql | 51 - .../core_db/V257__staff_image_association.sql | 35 - .../V258__interest_compounding_changes.sql | 29 - .../core_db/V259__alter_working_days.sql | 20 - ...ports_for_status_and_activation_change.sql | 101 -- ...V260__alter_password_validation_policy.sql | 23 - ...or Client_Loan_Account_Schedule_Report.sql | 22 - .../V262__accountNumber_for_groups.sql | 21 - .../core_db/V263__mifos_reports.sql | 42 - ...paymenttype_and_report_read_permission.sql | 21 - .../V265__modify_external_service_schema.sql | 66 -- .../migrations/core_db/V266__client_fees.sql | 103 -- .../V267__client_transaction_permissions.sql | 22 - .../core_db/V268__update_gmail_password.sql | 20 - ...V269__increased_calendar_title_length .sql | 24 - ...support-for-withdrawal-fees-on-savings.sql | 31 - .../V270__add_rounding_mode_configuration.sql | 23 - .../V271_1__withdrawal_charges_discount.sql | 40 - ...V271_2__withdrawal_charges_paymenttype.sql | 27 - .../V271__accounting_for_client_charges.sql | 28 - ...V272__loan_tranche_disbursement_charge.sql | 45 - .../core_db/V273__oauth_changes.sql | 61 -- .../V274__Loan_Reschedule_Code_Value.sql | 20 - ...nsaction_to_repayment_schedule_mapping.sql | 34 - .../V276__loan_recalulated_till_date.sql | 21 - .../V277__Loan_Product_Provisioning.sql | 123 --- ...278__LoanTransactionProcessingStrategy.sql | 38 - .../core_db/V279__floating_rates.sql | 80 -- ...27__add-loan-type-column-to-loan-table.sql | 66 -- .../V280__spm_framework_initial_tables.sql | 91 -- ...configuration_param_backdate-penalties.sql | 22 - .../core_db/V282__CustomerSelfService.sql | 34 - .../core_db/V283__Variable_Installments.sql | 45 - .../core_db/V284__update_codevalue.sql | 21 - .../V285__undo_last_tranche_script.sql | 21 - ...6__partial_period_interest_calcualtion.sql | 28 - .../core_db/V287__alter_spm_scorecard.sql | 38 - .../core_db/V288__overdraft_interest.sql | 27 - .../core_db/V289__client_non_person.sql | 40 - ...ccounting-abstractions-and-autoposting.sql | 65 -- ...0__shares_dividends_permissions_script.sql | 24 - .../V291__organisation_start_date_config.sql | 21 - .../V292__update_organisation_start_date.sql | 20 - ...nterest_rate_chart_support_for_amounts.sql | 32 - ...ype_application_forDisbursement_charge.sql | 20 - ...st_charged_date_same_as_disbursal_date.sql | 20 - ...__skip_repayment_on first-day_of_month.sql | 20 - .../V297__Adding_Meeting_Time_column.sql | 20 - .../core_db/V298__savings_interest_tax.sql | 125 --- .../core_db/V299__share_products.sql | 213 ---- ...add-support-for-annual-fees-on-savings.sql | 32 - .../V2__mifosx-base-reference-data-utf8.sql | 340 ------ ...ation_for_allow_changing_of_emi_amount.sql | 23 - ...recurring_moratorium_principal_periods.sql | 24 - .../V302__add_status_to_client_identifier.sql | 24 - .../V303__Savings_Account_Dormancy.sql | 37 - ...mer_self_service_third_party_transfers.sql | 43 - ...q_and_insertion_script_for_accrual_job.sql | 79 -- ..._domancy_tracking_job_to_savings_group.sql | 22 - .../core_db/V307__add_share_notes.sql | 21 - ...erest_recalculation_in_savings_account.sql | 21 - .../V309__add_loan_write_off_reason_code.sql | 24 - ...eferenceNumber-to-acc_gl_journal_entry.sql | 21 - ...oentityaccess_to_entitytoentitymapping.sql | 28 - .../core_db/V311__foreclosure_details.sql | 26 - .../V312__add_is_mandatory_to_code_value.sql | 20 - .../V313__multi_rescheduling_script.sql | 161 --- .../core_db/V314__updating_r_enum_table.sql | 112 -- ...th_disbursement_date_in_m_product_loan.sql | 20 - .../V316__address_module_tables_metadat.sql | 123 --- .../V317__report_mailing_job_module.sql | 80 -- .../migrations/core_db/V318__topuploan.sql | 39 - .../core_db/V319__client_undoreject.sql | 25 - .../core_db/V31__drop-autopostings.sql | 20 - .../V320__add_holiday_payment_reschedule.sql | 20 - ...21__boolean_field_As_Interest_PostedOn.sql | 21 - .../V322_1__scheduled_email_campaign.sql | 167 --- .../core_db/V322_2__email_business_rules.sql | 38 - .../migrations/core_db/V322__sms_campaign.sql | 275 ----- ...spm_replace_dead_fk_with_exisiting_one.sql | 38 - ...1__add_entity_subtype_registered_table.sql | 20 - .../core_db/V324__datatable_checks.sql | 43 - .../V325__add_is_staff_client_data.sql | 21 - ...ata_migration_for_client_tr_gl_entries.sql | 20 - .../V327_1__creditbureau_integration.sql | 76 -- .../V327__creditbureau_configuration.sql | 89 -- .../V328__family_members_sql_support.sql | 60 -- .../V329__sms_messages_without_campaign.sql | 20 - ...sociate-clients-from-group-permissions.sql | 23 - ..._savings_account_transaction_releaseId.sql | 45 - .../core_db/V331__holiday_schema_changes.sql | 23 - ...V332__self_service_registration_schema.sql | 38 - .../migrations/core_db/V333__adhocquery.sql | 49 - .../V334__notification_module_tables.sql | 46 - .../core_db/V335__self_service_user_role.sql | 20 - .../V336__sms_campaign_notification.sql | 47 - .../core_db/V337__equal_amortization.sql | 21 - .../V338__two_factor_authentication.sql | 63 -- .../core_db/V339__report-run-frequency.sql | 22 - ...que_check_on_stretchy_report_parameter.sql | 22 - .../core_db/V340__nullable-adhoc-email.sql | 20 - .../core_db/V341__m_import_document.sql | 39 - .../core_db/V342__topic_module_table.sql | 45 - .../V343__scheduled_email_campaign_status.sql | 20 - ...ing_recalculate_interest_for_loans_job.sql | 33 - .../V345__reports_for_self_service_user.sql | 28 - ...6__nullable_saving_product_description.sql | 20 - .../V347__correcting_report_category.sql | 31 - .../core_db/V348__m_trial_balance_table.sql | 36 - .../core_db/V349__client_transfer_details.sql | 41 - ...que_check_on_stretchy_report_parameter.sql | 21 - .../migrations/core_db/V350__email_from.sql | 41 - .../core_db/V351__pocket_mapping.sql | 40 - .../migrations/core_db/V352__interop_init.sql | 86 -- .../V353__migrate_passwords_to_ss_5.sql | 21 - ...4__self_service_user_unique_for_client.sql | 20 - .../sql/migrations/core_db/V355__rates.sql | 67 -- .../core_db/V356__GSIM_migration_script.sql | 63 -- .../core_db/V357__GLIM_migration_script.sql | 52 - .../V358__fixed_deposit_rollover_transfer.sql | 21 - .../V359__remove_fied_from_address.sql | 20 - ...dd_hierarchy_column_for_acc_gl_account.sql | 20 - .../V360__conf_loan_payday_on_holiday.sql | 22 - .../V361__conf_interest_appropriations.sql | 22 - .../V362__reschedule_interest_to_lrs.sql | 22 - .../V363__mnote_indexing_for_performance.sql | 21 - .../core_db/V364__elastic_hook_template.sql | 33 - ...V365__reportCategoryList-FINERACT-1306.sql | 22 - ...ding_or_trailing_spaces_in_reportnames.sql | 23 - .../V367__reports_for_email_campaigns.sql | 26 - .../core_db/V368__collateral_management.sql | 73 -- ...V369__repayment_with_post_dated_checks.sql | 40 - ...__add_tag_id_column_for_acc_gl_account.sql | 24 - .../V370__message_gateway_hook_template.sql | 27 - .../V371__loan_net_disbursal_amount.sql | 21 - .../V372__fixed_principal_percentage.sql | 21 - .../V373__node_aware_scheduler_jobs.sql | 26 - ...ng_expenseliablity_to_paymentorfeetype.sql | 25 - ...terest_next_day_for_period_end_posting.sql | 22 - .../V376__savings_last_transaction_date.sql | 24 - ...parallelizing_savings_interest_posting.sql | 22 - ...tion_for_variable_length_acoountNumber.sql | 20 - .../V379__user_cannot_change_password.sql | 20 - ...ter-group-collection-sheet-permissions.sql | 22 - ...onfiguration_for_random_account_number.sql | 20 - ...V381__update_currencies_new_currencies.sql | 28 - .../V38__add-group-summary-details-report.sql | 89 -- .../core_db/V390__clientdoc-code.sql | 20 - .../V391__add_transaction_ref_column.sql | 22 - ...__interest_recovery_conf_for_rescedule.sql | 29 - .../core_db/V39__payment-channels-updates.sql | 36 - ...osx-permissions-and-authorisation-utf8.sql | 354 ------- ...0__add_permissions_for_accounting_rule.sql | 20 - .../core_db/V41__group-summary-reports.sql | 108 -- ...t_value_for_id_for_acc_accounting_rule.sql | 21 - .../core_db/V43__accounting-for-savings.sql | 30 - ..._document-increase-size-of-column-type.sql | 21 - .../V45__create_acc_rule_tags_table.sql | 30 - .../core_db/V46__extend_datatables_api.sql | 28 - .../V47__staff-hierarchy-link-to-users.sql | 33 - .../core_db/V48__adding-S3-Support.sql | 97 -- ...track-loan-charge-payment-transactions.sql | 32 - .../core_db/V4__mifosx-core-reports-utf8.sql | 30 - ...50__add-grace-settings-to-loan-product.sql | 28 - ...ils-related-to-installment-performance.sql | 24 - ...an_support_cols_to_acc_accounting_rule.sql | 25 - ...vance-and-late-payments-on-installment.sql | 22 - ...V54__charge-to-income-account-mappings.sql | 22 - ...onal-transaction-processing-strategies.sql | 31 - .../V56__track-overpaid-amount-on-loans.sql | 21 - ...nd_credit_accounts_acc_accounting_rule.sql | 22 - .../V58__create-holiday-tables_changed.sql | 41 - ...add_group_roles_schema_and_permissions.sql | 41 - ...ate-savings-product-and-account-tables.sql | 30 - .../core_db/V60__quipo_dashboard_reports.sql | 337 ------ .../V61__txn_running_balance_example.sql | 143 --- .../V62__add_staff_id_to_m_client_changed.sql | 24 - ...sbursement_with_meeting_column_to_loan.sql | 23 - .../V64__add_permission_for_assign_staff.sql | 20 - .../core_db/V65__fix_rupee_symbol_issues.sql | 24 - .../V66__client_close_functionality.sql | 26 - .../core_db/V67__loans_in_advance_table.sql | 31 - .../V68__quipo_dashboard_reports_updated.sql | 343 ------- .../V69__loans_in_advance_initialise.sql | 38 - ...__add_min_max_principal_column_to_loan.sql | 26 - .../V70__quipo_program_detail_query_fix.sql | 57 -- ..._reschedule_repayment_to_configuration.sql | 20 - .../V72__add_m_loan_counter_changes.sql | 38 - ...led_to_and_processed_column_to_holiday.sql | 22 - ...__alter_m_loan_counter_table_add_group.sql | 23 - ...epayments-on-holidays_to_configuration.sql | 20 - .../V76__rename_permission_grouping.sql | 31 - .../V77__alter_m_product_loan_changes.sql | 21 - .../V78__breakdown_portfolio_grouping.sql | 24 - .../core_db/V79__schedule_jobs_tables.sql | 60 -- ...7__remove_read_makerchecker_permission.sql | 32 - .../V80__schedule_jobs_tables_updates.sql | 39 - .../core_db/V81__savings_related_changes.sql | 88 -- ...jobs_tables_updates_for_running_status.sql | 24 - .../core_db/V83__non-working-days-table.sql | 30 - ...4__undo_savings_transaction_permission.sql | 24 - .../V85__product_mix_related_changes.sql | 38 - .../core_db/V86__update-working-days.sql | 21 - .../V87__add_permission_for_scheduler.sql | 20 - ...ed_update_constrain_for_scheduler_jobs.sql | 21 - .../core_db/V89__added_scheduler_group.sql | 21 - ...-transaction-permissions-if-they-exist.sql | 20 - ...90__client_performance_history_reports.sql | 21 - ...ettings_for_holiday_and_non_workingday.sql | 21 - .../V91__apply_annual_fees_permission.sql | 24 - ...__group_center_assign_staff_permission.sql | 21 - .../V93__loan_transaction_external_id.sql | 22 - .../V94__added_savings_accont type.sql | 21 - .../core_db/V95__batch_job_postInterest.sql | 20 - .../V96__savings_accounts_transfers_table.sql | 75 -- ...mission_for_adjust_savings_transaction.sql | 20 - ..._added_currency_roundof_for_multipleof.sql | 31 - ..._constraint_column_to_loan_loanproduct.sql | 56 - .../V1__mifos-platform-shared-tenants.sql | 113 -- .../V2__externalize-connection-properties.sql | 33 - .../list_db/V3__deadlock-retry-properties.sql | 22 - ...ns_and_tenants_server_connection_table.sql | 80 -- .../V5__add_schema_connection_parameters.sql | 24 - .../V6__add_unique_tenant_identifier.sql | 20 - 410 files changed, 18291 deletions(-) delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V100__Group_saving_summary_report.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V101__add_mulitplesof_to_account_transfers_table.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V102__client_attendance_tables.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V103__cluster_support_for_batch_jobs.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V104__permissions_for_transfers.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V105__track_loan_transaction_against_office.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V106__more_permissions_for_transfers.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V107__datatable_code_mappings.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V108__client_has_transfer_office.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V109__account_transfer_withdrawal_fee_configuration.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V10__interest-posting-fields-for-savings.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V110__group_center_close.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V111_1__set default_transfers_in_suspense_account_for_existing_loan_products.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V111__disable_constraint_approach_for_datatables_by_default.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V112__mixreport_sql_support.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V113__track_savings_transaction_against_office.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V114__set_default_transfers_in_suspense_account_for_existing_savings_products - Copy.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V115__permissions_for_cache_api.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V116__track_currency_for_journal_entries.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V117__loan_charge_from_savings.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V118_1__savings_charge_patch_update.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V118_2__product_mapping_delete_duplicate_fund_source_to_account_mappings.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V118_3__permissions_form_propose_and_accept_client_transfers.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V118_4__reset_default_transfers_in_suspense_account_for_existing_savings_products.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V118_5__batch_job_entry_for_pay_savings_charge.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V118_6__defaults_for_income_from_penalties_for savings_product.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V118_7__move_withdrawal_annual_fee_to_charges.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V118_8__track_overpayments_seperately_in_loan_transactions.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V118__savings_charge.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V119__add_template_table.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V11__add-payment-details.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V120__accounting_running_balance.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V121__accounting_running_balance_for_organization.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V122__recurring_fee_support_for_savings.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V123__remove_payment_mode_for_savings.sql delete mode 100755 fineract-provider/src/main/resources/sql/migrations/core_db/V124__added_min_max_cap_for_charges.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V125__added_column_for_actual_fee_amount_or_percentage.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V126__initial_database_structure_for_sms_outbound.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V127__mobile_no_fields.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V128__added_loan_installment_charge.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V129__client_and_group_timeline.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V12__add_external_id_to_couple_of_tables.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V130__calendar-history-table.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V131__holiday-status-column-and-permissions.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V132__borrower_cycle_changes.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V133__adding_payment_detail_with_journal_entry.sql delete mode 100755 fineract-provider/src/main/resources/sql/migrations/core_db/V134_1__submitted_date_updation_for_clients.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V134_2__permissions_spelling_correction.sql delete mode 100755 fineract-provider/src/main/resources/sql/migrations/core_db/V134__added_column_value_on_c_configuration.sql delete mode 100755 fineract-provider/src/main/resources/sql/migrations/core_db/V135__added_permission_for_undo_written_off.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V136_1__update_script_strechy_parameter.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V137__added_is_active_column_in_m_staff.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V138__add_short_name_for_m_product_loan_and_m_savings_product.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V139__default_value_for_is_active_updated_to_true_in_m_staff.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V13__add_group_and_client_pending_configuration.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V140_1__added_payment_detail_id_in_ac_gl_journal_entry.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V140__added_loan_charge_status.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V141__add_early_repayment_strategy.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V142__read_savingsaccount_charge_permission.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V143__create_journalentry_checker_permission.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V144__spelling_mistake_corrections.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V145__add_force_password_reset_in_c_configuration.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V146__tranche_loans.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V147__tranche_loans_column_name_changes.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V148__overdraft_changes.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V149__add_created_date_savings_transaction.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V14__rename_status_id_to_enum.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V150__basic_savings_report.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V151__add_default_savings_account_to_client.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V152__added_grace_for_over_due.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V153__Insert_missed_permissions.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V154__aging_details.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V155__stretchy_into_pentaho.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V156__added_loan_saving_txns_pentaho.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V157__overdue_charge_improvements.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V158__dashboard_and_navigation_queries.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V159__add_transaction_id_column_m_portfolio_command_source.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V15__center_permissions.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V160_2__Allow_nullValue_For_principal_on_lonProduct.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V160__standing_instruction_changes.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V161__added_accrual_batch_job.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V162__overdue_charge_batch_job.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V163__added_npa_for_loans.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V164__fd_and_rd_deposit_tables.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V165__added_permission_for_disburse_to_saving_account.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V166__added_deposit_amount_to_product_term_and_preclosure.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V167__added_columns_for_writtenOff_loans_recovered.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V168__added_transfer_fixed_deposit_interest_to_linked_account.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V169__update_dashboard_reports_to_core_reports_use_report_to_false.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V16__drop_min_max_column_on_loan_table.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V170__update_deposit_accounts_maturity_details_job.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V171__added_mandatory_savings_and_rd_changes.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V172__accounting_changes_for_transfers.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V173__ppi.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V174__remove_interest_accrual.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V175__added_incentive_interest_rates.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V176__updates_to_financial_activity_accounts.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V177__cleanup_for_client_incentives.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V178__updates_to_financial_activity_accounts_pt2.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V179__updates_to_action_names_for_maker_checker_permissions.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V17__update_stretchy_reporting_ddl.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V180__update_report_schemas_for_disbursed_vs_awaitingdisbursal_and_groupnamesbystaff.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V181__standing_instruction_logging.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V182__added_min_required_balance_to_savings_product.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V183__added_min_balance_for_interest_calculation.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V184__update_min_required_balance_for_savings_product.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V185__add_accrual_till_date_for_periodic_accrual.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V186__added_periodic_accrual_job.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V187__added_permission_to_periodic_accrual.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V188__add_savingscharge_inactivate_permissions.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V189__m_loan_interest_recalculation_tables.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V18__update_stretchy_reporting_reportSql.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V190__add_associategroup_disassociategroup_permissions.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V191__update_gl_account_increase_size_of_name_col.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V192__interest_recalculate_job.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V193__added_column_joiningDate_for_staff.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V194__added_recalculatedInterestComponent_for_interest_recalculation.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V195__moved_rest_frequency_to_product_level.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V196__added_loan_running_balance_to_transactions.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V197__updated_loan_running_balance_of_transactions.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V198__loan_rescheduling_tables_and_permissions.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V199__removed_extra_columns_from_schedule_history.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V19__report_maintenance_permissions.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V1__mifosplatform-core-ddl-latest.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V200__alter_savings_account_for_start_interest_calculation_date.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V201__webhooks.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V202__savings_officer_history_table.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V203__added_subbmittedDate_loantransaction.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V204__insert_script_for_charges_paid_by_for_accruals.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V205__fix_for_charge_and_interest_waiver_with_accruals.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V206__interest_posting_configuration.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V207__min_max_clients_per_group.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V208__min_max_clients_in_group_redux.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V209__add_all_report_names_in_m_permission_table.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V20__report_maint_perms_really_configuration.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V210__track_manually_adjusted_transactions.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V211__minimum_days_between_disbursal_and_first_repayment.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V212__add_NthDay_and_DayOfWeek_columns_loan.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V213__NthDay_and_DayOfWeek_columns_should_be_nullable.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V214__alter_table_add_create_SI_at_disbursement.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V215__guarantee_on_hold_fund_changes.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V216__adding_loan_proposed_amount_to_loan.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V217__client_substatus_and_codevalue_description.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V218__add_user_and_datetime_for_loan_savings_transactions.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V219__guarantor_on_hold_fund_changes_for_account.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V21__activation-permissions-for-clients.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V220_1__prefix_type_account_number.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V220__account_number_preferences.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V221__add_version_for_m_savings_account.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V222__guarantor_on_hold_fund_changes_for_transactions.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V223__add_version_for_m_loan_account.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V224__client_lifecycle_adding_statuses.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V225__permissions_for_updating_recurring_deposit_amount.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V226__configuration_for_enforcing_calendars_for_jlg_loans.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V227__loan-refund-permissions.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V228__entity_to_entity_access.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V229__teller_cash_management.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V22__alter-group-for-consistency-add-permissions.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V230__role_status_and_correspoding_permissions.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V231__m_cashier_transaction_added_currency_code.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V232__insert_center_closure_reason.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V233__Savings_Transaction_Receipt.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V234__opening_balaces_setup.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V235__add_ugd_template_id_m_hook.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V236__individual_collection_sheet_permissions.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V237__add_threshold_config_for_last_instalment.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V238__update_staff_display_name_length.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V239__Loan_Transaction_Receipt.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V23__remove-enable-disable-configuration-for-client-group-status.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V240__arrears_aging_config_for_interest_recalculation.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V241__fixed_emi_changes.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V242__entitytoentitymappingrelation.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V243__alter_loan_disbursement_details.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V244__staff_assignment_history_table.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V245__open_rd_changes.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V246__drop_group_client_foreign_key_from_m_loan.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V247__consistency_wrt_spelling_principalThresholdForLastInstalment.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V248__added_password_never_expired_to_User.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V249__workingdays_permissions.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V24__add-group-client-foreign-key-constraint-in-loan-table.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V250__password_validation_policy.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V251__paymentType_table.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V252__bug_fix_teller_cash_management.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V253__product_loan_configurable_attributes.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V254__General_Ledger_Report.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V255__pre_close_interest_period_config.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V256__Update script for General_Ledger_report.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V257__staff_image_association.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V258__interest_compounding_changes.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V259__alter_working_days.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V25__update_client_reports_for_status_and_activation_change.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V260__alter_password_validation_policy.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V261__Update script for Client_Loan_Account_Schedule_Report.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V262__accountNumber_for_groups.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V263__mifos_reports.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V264__insert_paymenttype_and_report_read_permission.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V265__modify_external_service_schema.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V266__client_fees.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V267__client_transaction_permissions.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V268__update_gmail_password.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V269__increased_calendar_title_length .sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V26__add-support-for-withdrawal-fees-on-savings.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V270__add_rounding_mode_configuration.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V271_1__withdrawal_charges_discount.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V271_2__withdrawal_charges_paymenttype.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V271__accounting_for_client_charges.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V272__loan_tranche_disbursement_charge.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V273__oauth_changes.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V274__Loan_Reschedule_Code_Value.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V275__loan_transaction_to_repayment_schedule_mapping.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V276__loan_recalulated_till_date.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V277__Loan_Product_Provisioning.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V278__LoanTransactionProcessingStrategy.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V279__floating_rates.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V27__add-loan-type-column-to-loan-table.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V280__spm_framework_initial_tables.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V281__add_configuration_param_backdate-penalties.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V282__CustomerSelfService.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V283__Variable_Installments.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V284__update_codevalue.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V285__undo_last_tranche_script.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V286__partial_period_interest_calcualtion.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V287__alter_spm_scorecard.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V288__overdraft_interest.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V289__client_non_person.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V28__accounting-abstractions-and-autoposting.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V290__shares_dividends_permissions_script.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V291__organisation_start_date_config.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V292__update_organisation_start_date.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V293__interest_rate_chart_support_for_amounts.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V294__configuration_for_paymnettype_application_forDisbursement_charge.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V295__configuration_for_interest_charged_date_same_as_disbursal_date.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V296__skip_repayment_on first-day_of_month.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V297__Adding_Meeting_Time_column.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V298__savings_interest_tax.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V299__share_products.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V29__add-support-for-annual-fees-on-savings.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V2__mifosx-base-reference-data-utf8.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V300__configuration_for_allow_changing_of_emi_amount.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V301__recurring_moratorium_principal_periods.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V302__add_status_to_client_identifier.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V303__Savings_Account_Dormancy.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V304__customer_self_service_third_party_transfers.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V305__compounding_and_rest_frequency_nth_day_freq_and_insertion_script_for_accrual_job.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V306__add_domancy_tracking_job_to_savings_group.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V307__add_share_notes.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V308__add_interest_recalculation_in_savings_account.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V309__add_loan_write_off_reason_code.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V30__add-referenceNumber-to-acc_gl_journal_entry.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V310__copy_data_from_entitytoentityaccess_to_entitytoentitymapping.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V311__foreclosure_details.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V312__add_is_mandatory_to_code_value.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V313__multi_rescheduling_script.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V314__updating_r_enum_table.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V315__add_sync_expected_with_disbursement_date_in_m_product_loan.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V316__address_module_tables_metadat.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V317__report_mailing_job_module.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V318__topuploan.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V319__client_undoreject.sql delete mode 100755 fineract-provider/src/main/resources/sql/migrations/core_db/V31__drop-autopostings.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V320__add_holiday_payment_reschedule.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V321__boolean_field_As_Interest_PostedOn.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V322_1__scheduled_email_campaign.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V322_2__email_business_rules.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V322__sms_campaign.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V323__spm_replace_dead_fk_with_exisiting_one.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V324_1__add_entity_subtype_registered_table.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V324__datatable_checks.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V325__add_is_staff_client_data.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V326__data_migration_for_client_tr_gl_entries.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V327_1__creditbureau_integration.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V327__creditbureau_configuration.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V328__family_members_sql_support.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V329__sms_messages_without_campaign.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V32__associate-disassociate-clients-from-group-permissions.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V330__savings_account_transaction_releaseId.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V331__holiday_schema_changes.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V332__self_service_registration_schema.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V333__adhocquery.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V334__notification_module_tables.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V335__self_service_user_role.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V336__sms_campaign_notification.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V337__equal_amortization.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V338__two_factor_authentication.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V339__report-run-frequency.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V33__drop_unique_check_on_stretchy_report_parameter.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V340__nullable-adhoc-email.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V341__m_import_document.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V342__topic_module_table.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V343__scheduled_email_campaign_status.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V344__parallelizing_and_paging_recalculate_interest_for_loans_job.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V345__reports_for_self_service_user.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V346__nullable_saving_product_description.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V347__correcting_report_category.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V348__m_trial_balance_table.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V349__client_transfer_details.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V34__add_unique_check_on_stretchy_report_parameter.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V350__email_from.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V351__pocket_mapping.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V352__interop_init.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V353__migrate_passwords_to_ss_5.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V354__self_service_user_unique_for_client.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V355__rates.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V356__GSIM_migration_script.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V357__GLIM_migration_script.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V358__fixed_deposit_rollover_transfer.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V359__remove_fied_from_address.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V35__add_hierarchy_column_for_acc_gl_account.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V360__conf_loan_payday_on_holiday.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V361__conf_interest_appropriations.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V362__reschedule_interest_to_lrs.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V363__mnote_indexing_for_performance.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V364__elastic_hook_template.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V365__reportCategoryList-FINERACT-1306.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V366_remove_leading_or_trailing_spaces_in_reportnames.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V367__reports_for_email_campaigns.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V368__collateral_management.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V369__repayment_with_post_dated_checks.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V36__add_tag_id_column_for_acc_gl_account.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V370__message_gateway_hook_template.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V371__loan_net_disbursal_amount.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V372__fixed_principal_percentage.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V373__node_aware_scheduler_jobs.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V374__adding_expenseliablity_to_paymentorfeetype.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V375__transfer_fixed_deposit_interest_next_day_for_period_end_posting.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V376__savings_last_transaction_date.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V377__job_prams_for_parallelizing_savings_interest_posting.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V378__configuration_for_variable_length_acoountNumber.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V379__user_cannot_change_password.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V37__add-center-group-collection-sheet-permissions.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V380__configuration_for_random_account_number.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V381__update_currencies_new_currencies.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V38__add-group-summary-details-report.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V390__clientdoc-code.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V391__add_transaction_ref_column.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V392__interest_recovery_conf_for_rescedule.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V39__payment-channels-updates.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V3__mifosx-permissions-and-authorisation-utf8.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V40__add_permissions_for_accounting_rule.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V41__group-summary-reports.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V42__Add_default_value_for_id_for_acc_accounting_rule.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V43__accounting-for-savings.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V44__document-increase-size-of-column-type.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V45__create_acc_rule_tags_table.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V46__extend_datatables_api.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V47__staff-hierarchy-link-to-users.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V48__adding-S3-Support.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V49__track-loan-charge-payment-transactions.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V4__mifosx-core-reports-utf8.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V50__add-grace-settings-to-loan-product.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V51__track-additional-details-related-to-installment-performance.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V52__add_boolean_support_cols_to_acc_accounting_rule.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V53__track-advance-and-late-payments-on-installment.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V54__charge-to-income-account-mappings.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V55__add-additional-transaction-processing-strategies.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V56__track-overpaid-amount-on-loans.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V57__add_default_values_to_debit_and_credit_accounts_acc_accounting_rule.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V58__create-holiday-tables_changed.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V59__add_group_roles_schema_and_permissions.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V5__update-savings-product-and-account-tables.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V60__quipo_dashboard_reports.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V61__txn_running_balance_example.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V62__add_staff_id_to_m_client_changed.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V63__add_sync_disbursement_with_meeting_column_to_loan.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V64__add_permission_for_assign_staff.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V65__fix_rupee_symbol_issues.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V66__client_close_functionality.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V67__loans_in_advance_table.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V68__quipo_dashboard_reports_updated.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V69__loans_in_advance_initialise.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V6__add_min_max_principal_column_to_loan.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V70__quipo_program_detail_query_fix.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V71__insert_reschedule_repayment_to_configuration.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V72__add_m_loan_counter_changes.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V73__add_repayments_rescheduled_to_and_processed_column_to_holiday.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V74__alter_m_loan_counter_table_add_group.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V75__add_reschedule-repayments-on-holidays_to_configuration.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V76__rename_permission_grouping.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V77__alter_m_product_loan_changes.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V78__breakdown_portfolio_grouping.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V79__schedule_jobs_tables.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V7__remove_read_makerchecker_permission.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V80__schedule_jobs_tables_updates.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V81__savings_related_changes.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V82__schedule_jobs_tables_updates_for_running_status.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V83__non-working-days-table.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V84__undo_savings_transaction_permission.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V85__product_mix_related_changes.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V86__update-working-days.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V87__add_permission_for_scheduler.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V88__added_update_constrain_for_scheduler_jobs.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V89__added_scheduler_group.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V8__deposit-transaction-permissions-if-they-exist.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V90__client_performance_history_reports.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V91_1__configuration_settings_for_holiday_and_non_workingday.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V91__apply_annual_fees_permission.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V92__group_center_assign_staff_permission.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V93__loan_transaction_external_id.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V94__added_savings_accont type.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V95__batch_job_postInterest.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V96__savings_accounts_transfers_table.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V97__add_permission_for_adjust_savings_transaction.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V98__added_currency_roundof_for_multipleof.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V9__add_min_max_constraint_column_to_loan_loanproduct.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/list_db/V1__mifos-platform-shared-tenants.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/list_db/V2__externalize-connection-properties.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/list_db/V3__deadlock-retry-properties.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/list_db/V4__introduced_oltpId_reportId_columns_and_tenants_server_connection_table.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/list_db/V5__add_schema_connection_parameters.sql delete mode 100644 fineract-provider/src/main/resources/sql/migrations/list_db/V6__add_unique_tenant_identifier.sql diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V100__Group_saving_summary_report.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V100__Group_saving_summary_report.sql deleted file mode 100644 index cb4754e0c..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V100__Group_saving_summary_report.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('GroupSavingSummary', 'Table', NULL, NULL, 'select ifnull(cur.display_symbol, sa.currency_code) as currency,\ncount(sa.id) as totalSavingAccounts, ifnull(sum(sa.account_balance_derived),0) as totalSavings\nfrom m_group topgroup\njoin m_office o on o.id = topgroup.office_id and o.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\njoin m_group g on g.hierarchy like concat(topgroup.hierarchy, \'%\')\njoin m_savings_account sa on sa.group_id = g.id\nleft join m_currency cur on cur.code = sa.currency_code\nwhere topgroup.id = ${groupId}\nand sa.activatedon_date is not null\ngroup by sa.currency_code', 'Utility query for getting group or center saving summary details for a group_id', 1, 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V101__add_mulitplesof_to_account_transfers_table.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V101__add_mulitplesof_to_account_transfers_table.sql deleted file mode 100644 index ae3e8ba1c..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V101__add_mulitplesof_to_account_transfers_table.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_savings_account_transfer` -ADD COLUMN `currency_multiplesof` SMALLINT NULL DEFAULT NULL AFTER `currency_digits`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V102__client_attendance_tables.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V102__client_attendance_tables.sql deleted file mode 100644 index 8f015c9b0..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V102__client_attendance_tables.sql +++ /dev/null @@ -1,49 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_meeting` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `calendar_instance_id` BIGINT NOT NULL, - `meeting_date` DATE NOT NULL, - PRIMARY KEY (`id`), - UNIQUE INDEX `unique_calendar_instance_id_meeting_date` (`calendar_instance_id`, `meeting_date`), - CONSTRAINT `FK_m_calendar_instance_m_meeting` FOREIGN KEY (`calendar_instance_id`) REFERENCES `m_calendar_instance` (`id`) -) -COLLATE='latin1_swedish_ci' -ENGINE=InnoDB; - -CREATE TABLE `m_client_attendance` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `client_id` BIGINT NOT NULL DEFAULT '0', - `meeting_id` BIGINT NOT NULL, - `attendance_type_enum` SMALLINT NOT NULL, - PRIMARY KEY (`id`), - UNIQUE INDEX `unique_client_meeting_attendance` (`client_id`, `meeting_id`), - INDEX `FK_m_meeting_m_client_attendance` (`meeting_id`), - CONSTRAINT `FK_m_client_m_client_attendance` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`), - CONSTRAINT `FK_m_meeting_m_client_attendance` FOREIGN KEY (`meeting_id`) REFERENCES `m_meeting` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; - - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'CREATE_MEETING', 'MEETING', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATE_MEETING', 'MEETING', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'DELETE_MEETING', 'MEETING', 'DELETE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'SAVEORUPDATEATTENDANCE_MEETING', 'MEETING', 'SAVEORUPDATEATTENDANCE', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V103__cluster_support_for_batch_jobs.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V103__cluster_support_for_batch_jobs.sql deleted file mode 100644 index 3f8eb9c72..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V103__cluster_support_for_batch_jobs.sql +++ /dev/null @@ -1,33 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `job` - ADD COLUMN `is_misfired` tinyint NOT NULL DEFAULT '0' AFTER `scheduler_group`; - -CREATE TABLE `scheduler_detail` ( - `id` SMALLINT NOT NULL AUTO_INCREMENT, - `is_suspended` tinyint NOT NULL DEFAULT '0', - `execute_misfired_jobs` tinyint NOT NULL DEFAULT '1', - `reset_scheduler_on_bootup` tinyint NOT NULL DEFAULT '1', - PRIMARY KEY (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; - -INSERT INTO `scheduler_detail` (`is_suspended`, `execute_misfired_jobs`, `reset_scheduler_on_bootup`) VALUES (FALSE,TRUE,TRUE); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V104__permissions_for_transfers.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V104__permissions_for_transfers.sql deleted file mode 100644 index 27e1026a3..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V104__permissions_for_transfers.sql +++ /dev/null @@ -1,30 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('portfolio_group', 'TRANSFERCLIENTS_GROUP', 'GROUP', 'TRANSFERCLIENTS', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('portfolio_group', 'TRANSFERCLIENTS_GROUP_CHECKER', 'GROUP', 'TRANSFERCLIENTS', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('portfolio', 'TRANSFER_CLIENT', 'CLIENT', 'TRANSFER', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('portfolio', 'TRANSFER_CLIENT_CHECKER', 'CLIENT', 'TRANSFER', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V105__track_loan_transaction_against_office.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V105__track_loan_transaction_against_office.sql deleted file mode 100644 index 40bc111f3..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V105__track_loan_transaction_against_office.sql +++ /dev/null @@ -1,34 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_loan_transaction` - ADD COLUMN `office_id` BIGINT NULL DEFAULT NULL AFTER `loan_id`; - -/**update client loans**/ -UPDATE m_loan_transaction lt set lt.office_id = (SELECT c.office_id AS officeId FROM m_loan l JOIN m_client c on l.client_id=c.id where l.id=lt.loan_id) where lt.loan_id in (Select l.id from m_loan l where l.client_id is not null); - -/**update group loans**/ -UPDATE m_loan_transaction lt set lt.office_id = (SELECT g.office_id AS officeId FROM m_loan l JOIN m_group g on l.group_id=g.id where l.id=lt.loan_id) where lt.loan_id in (Select l.id from m_loan l where l.group_id is not null); - -/**Add foreign key constraints**/ -ALTER TABLE `m_loan_transaction` - CHANGE COLUMN `office_id` `office_id` BIGINT NOT NULL AFTER `loan_id`; - -ALTER TABLE `m_loan_transaction` - ADD CONSTRAINT `FK_m_loan_transaction_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V106__more_permissions_for_transfers.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V106__more_permissions_for_transfers.sql deleted file mode 100644 index 3b76fd9cc..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V106__more_permissions_for_transfers.sql +++ /dev/null @@ -1,49 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -DELETE FROM `m_permission` WHERE `code`="TRANSFER_CLIENT"; -DELETE FROM `m_permission` WHERE `code`="TRANSFER_CLIENT_CHECKER"; - -/**Permissions for proposing a transfer**/ -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('portfolio', 'PROPOSETRANSFER_CLIENT', 'CLIENT', 'PROPOSETRANSFER', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('portfolio', 'PROPOSETRANSFER_CLIENT_CHECKER', 'CLIENT', 'PROPOSETRANSFER', 0); - -/**Permissions for accepting a transfer**/ -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('portfolio', 'ACCEPTTRANSFER_CLIENT', 'CLIENT', 'ACCEPTTRANSFER', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('portfolio', 'ACCEPTTRANSFER_CLIENT_CHECKER', 'CLIENT', 'ACCEPTTRANSFER', 0); - -/**Permissions for rejecting a transfer**/ -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('portfolio', 'REJECTTRANSFER_CLIENT', 'CLIENT', 'REJECTTRANSFER', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('portfolio', 'REJECTTRANSFER_CLIENT_CHECKER', 'CLIENT', 'REJECTTRANSFER', 0); - -/**Permissions for withdrawing a transfer proposal**/ -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('portfolio', 'WITHDRAWTRANSFER_CLIENT', 'CLIENT', 'WITHDRAWTRANSFER', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('portfolio', 'WITHDRAWTRANSFER_CLIENT_CHECKER', 'CLIENT', 'WITHDRAWTRANSFER', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V107__datatable_code_mappings.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V107__datatable_code_mappings.sql deleted file mode 100644 index e4b4bec45..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V107__datatable_code_mappings.sql +++ /dev/null @@ -1,30 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `x_table_cloumn_code_mappings` ( - `column_alias_name` VARCHAR(50) NOT NULL, - `code_id` INT NOT NULL, - PRIMARY KEY (`column_alias_name`), - INDEX `FK_x_code_id` (`code_id`), - CONSTRAINT `FK_x_code_id` FOREIGN KEY (`code_id`) REFERENCES `m_code` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; - -INSERT INTO `c_configuration` (`name`, `enabled`) VALUES ('constraint_approach_for_datatables', 1); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V108__client_has_transfer_office.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V108__client_has_transfer_office.sql deleted file mode 100644 index 8105efa6b..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V108__client_has_transfer_office.sql +++ /dev/null @@ -1,28 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -/***Store destination office Id while client is pending transfers and effective joining date in a particular branch**/ -ALTER TABLE `m_client` - ADD COLUMN `office_joining_date` DATE NULL AFTER `activation_date`, - ADD COLUMN `transfer_to_office_id` BIGINT NULL AFTER `office_id`, - ADD CONSTRAINT `FK_m_client_m_office` FOREIGN KEY (`transfer_to_office_id`) REFERENCES `m_office` (`id`); - - -/**For current Clients, set the office joining date to activation date**/ -update m_client set office_joining_date=activation_date; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V109__account_transfer_withdrawal_fee_configuration.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V109__account_transfer_withdrawal_fee_configuration.sql deleted file mode 100644 index 4a74b49e4..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V109__account_transfer_withdrawal_fee_configuration.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_savings_product` - ADD COLUMN `withdrawal_fee_for_transfer` TINYINT NULL DEFAULT '1' AFTER `withdrawal_fee_type_enum`; - -ALTER TABLE `m_savings_account` - ADD COLUMN `withdrawal_fee_for_transfer` TINYINT NULL DEFAULT '1' AFTER `withdrawal_fee_type_enum`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V10__interest-posting-fields-for-savings.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V10__interest-posting-fields-for-savings.sql deleted file mode 100644 index 9ba08094b..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V10__interest-posting-fields-for-savings.sql +++ /dev/null @@ -1,31 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES -('transaction_savings', 'POSTINTEREST_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'POSTINTEREST', '1'), -('transaction_savings', 'POSTINTEREST_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'POSTINTEREST', '0'); - - -ALTER TABLE `m_savings_product` -ADD COLUMN `interest_posting_period_enum` SMALLINT NOT NULL DEFAULT 4 AFTER `interest_compounding_period_enum`; - - -ALTER TABLE `m_savings_account` -ADD COLUMN `interest_posting_period_enum` SMALLINT NOT NULL DEFAULT 4 AFTER `interest_compounding_period_enum`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V110__group_center_close.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V110__group_center_close.sql deleted file mode 100644 index 1986e5eea..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V110__group_center_close.sql +++ /dev/null @@ -1,27 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_code` (`code_name`, `is_system_defined`) VALUES ('GroupClosureReason', 1); - -ALTER TABLE `m_group` ADD COLUMN `closure_reason_cv_id` INT NULL DEFAULT NULL, -ADD COLUMN `closedon_date` DATE NULL DEFAULT NULL, -ADD CONSTRAINT `FK_m_group_m_code` FOREIGN KEY (`closure_reason_cv_id`) REFERENCES `m_code_value` (`id`); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`) VALUES ('portfolio', 'CLOSE_GROUP', 'GROUP', 'CLOSE'); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`) VALUES ('portfolio', 'CLOSE_CENTER', 'CENTER', 'CLOSE'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V111_1__set default_transfers_in_suspense_account_for_existing_loan_products.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V111_1__set default_transfers_in_suspense_account_for_existing_loan_products.sql deleted file mode 100644 index 26a2337a6..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V111_1__set default_transfers_in_suspense_account_for_existing_loan_products.sql +++ /dev/null @@ -1,23 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `acc_product_mapping` (`gl_account_id`,`product_id`,`product_type`,`payment_type`,`charge_id`,`financial_account_type`) -select mapping.gl_account_id,mapping.product_id,mapping.product_type,mapping.payment_type,mapping.charge_id, 10 -from acc_product_mapping mapping -where mapping.financial_account_type = 1 and mapping.product_type=1; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V111__disable_constraint_approach_for_datatables_by_default.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V111__disable_constraint_approach_for_datatables_by_default.sql deleted file mode 100644 index 2a3533b7e..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V111__disable_constraint_approach_for_datatables_by_default.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -update c_configuration set enabled=0 where name="constraint_approach_for_datatables"; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V112__mixreport_sql_support.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V112__mixreport_sql_support.sql deleted file mode 100644 index d1f39a6b9..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V112__mixreport_sql_support.sql +++ /dev/null @@ -1,132 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES -('xbrlmapping', 'UPDATE_XBRLMAPPING', 'XBRLMAPPING', 'UPDATE', 0); - -DROP TABLE IF EXISTS `mix_taxonomy`; - -CREATE TABLE `mix_taxonomy` ( - `id` INT unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(100) DEFAULT NULL, - `namespace_id` INT DEFAULT NULL, - `dimension` varchar(100) DEFAULT NULL, - `type` INT DEFAULT NULL, - `description` varchar(1000) DEFAULT NULL, - `need_mapping` tinyint DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -LOCK TABLES `mix_taxonomy` WRITE; - -INSERT INTO `mix_taxonomy` (`id`, `name`, `namespace_id`, `dimension`, `type`, `description`, `need_mapping`) -VALUES - (1,'AdministrativeExpense',1,NULL,3,NULL,1), - (2,'Assets',3,NULL,1,'All outstanding principals due for all outstanding client loans. This includes current, delinquent, and renegotiated loans, but not loans that have been written off. It does not include interest receivable.',1), - (3,'Assets',3,'MaturityDimension:LessThanOneYearMember',1,'Segmentation based on the life of an asset or liability.',1), - (4,'Assets',3,'MaturityDimension:MoreThanOneYearMember',1,'Segmentation based on the life of an asset or liability.',1), - (5,'CashAndCashEquivalents',1,NULL,1,NULL,1), - (6,'Deposits',3,NULL,1,'The total value of funds placed in an account with an MFI that are payable to a depositor. This item includes any current, checking, or savings accounts that are payable on demand. It also includes time deposits which have a fixed maturity date and compulsory deposits.',1), - (7,'Deposits',3,'DepositProductsDimension:CompulsoryMember',1,'The value of deposits that an MFI\'s clients are required to maintain as a condition of an existing or future loan.',NULL), - (8,'Deposits',3,'DepositProductsDimension:VoluntaryMember',1,'The value of deposits that an MFI\'s clients are not required to maintain as a condition of an existing or future loan.',NULL), - (9,'Deposits',3,'LocationDimension:RuralMember',1,'Located in rural areas. Segmentation based on location.',NULL), - (10,'Deposits',3,'LocationDimension:UrbanMember',1,'Located in urban areas. Segmentation based on location.',NULL), - (11,'Deposits',3,'MaturityDimension:LessThanOneYearMember',1,'Segmentation based on the life of an asset or liability.',NULL), - (12,'Deposits',3,'MaturityDimension:MoreThanOneYearMember',1,'Segmentation based on the life of an asset or liability.',NULL), - (13,'EmployeeBenefitsExpense',1,NULL,3,NULL,NULL), - (14,'Equity',1,NULL,1,NULL,NULL), - (15,'Expense',1,NULL,3,NULL,NULL), - (16,'FinancialExpense',3,NULL,3,'All costs All costs incurred in raising funds from third parties, fee expenses from non-financial services, net gains (losses) due to changes in fair value of financial liabilities, impairment losses net of reversals of financial assets other than loan portfolio and net gains (losses) from restatement of financial statements in terms of the measuring unit current at the end of the reporting period.',NULL), - (17,'FinancialRevenueOnLoans',3,NULL,2,'Interest and non-interest income generated by the provision of credit services to the clients. Fees and commissions for late payment are also included.',NULL), - (18,'ImpairmentLossAllowanceGrossLoanPortfolio',3,NULL,2,'An allowance for the risk of losses in the gross loan portfolio due to default .',NULL), - (19,'Liabilities',1,NULL,1,NULL,NULL), - (20,'Liabilities',3,'MaturityDimension:LessThanOneYearMember',1,'Segmentation based on the life of an asset or liability.',NULL), - (21,'Liabilities',3,'MaturityDimension:MoreThanOneYearMember',1,'Segmentation based on the life of an asset or liability.',NULL), - (22,'LoanPortfolioGross',3,NULL,2,'All outstanding principals due for all outstanding client loans. This includes current, delinquent, and renegotiated loans, but not loans that have been written off. It does not include interest receivable.',NULL), - (23,'LoanPortfolioGross',3,'CreditProductsDimension:MicroenterpriseMember',2,'Loans that finance the production or trade of goods and services for an individual\'s microenterprise, whether or not the microenterprise is legally registered. Segmentation based on loan product.',NULL), - (24,'LoanPortfolioGross',3,'DelinquencyDimension:OneMonthOrMoreMember',2,'Segmentation based on the principal balance of all loans outstanding that have one or more installments of principal past due or renegotiated. Segmentation based on the principal balance of all loans outstanding that have one or more installments of principal past due or renegotiated.',NULL), - (25,'LoanPortfolioGross',3,'DelinquencyDimension:ThreeMonthsOrMoreMember',2,'Segmentation based on the principal balance of all loans outstanding that have one or more installments of principal past due or renegotiated.? Segmentation based on the principal balance of all loans outstanding that have one or more installments of principal past due or renegotiated.',NULL), - (26,'LoanPortfolioGross',3,'LocationDimension:RuralMember',2,'Located in rural areas. Segmentation based on geographic location.',NULL), - (27,'LoanPortfolioGross',3,'LocationDimension:UrbanMember',2,'Located in urbal areas. Segmentation based on geographic location.',NULL), - (28,'LoanPortfolioGross',3,'MaturityDimension:LessThanOneYearMember',2,'Segmentation based on the life of an asset or liability.',NULL), - (29,'LoanPortfolioGross',3,'MaturityDimension:MoreThanOneYearMember',2,'Segmentation based on the life of an asset or liability.',NULL), - (30,'NetLoanLoss',3,'',3,'Referred to the value of delinquency loans written off net of any principal recovery.',NULL), - (31,'NetLoanLossProvisionExpense',3,NULL,3,'Represent the net value of loan portfolio impairment loss considering any reversal on impairment loss and any recovery on loans written off recognized as a income during the accounting period.',NULL), - (32,'NetOperatingIncome',3,NULL,2,'Total operating revenue less all expenses related to the MFI\'s core financial service operation including total financial expense, impairment loss and operating expense. Donations are excluded.',NULL), - (33,'NetOperatingIncomeNetOfTaxExpense',3,NULL,3,'Net operating income reported incorporating the effect of taxes. Taxes include all domestic and foreign taxes which are based on taxable profits, other taxes related to personnel, financial transactions or value-added taxes are not considered in calculation of this value.',NULL), - (34,'NumberOfActiveBorrowers',3,NULL,0,'The number of individuals who currently have an outstanding loan balance with the MFI or are primarily responsible for repaying any portion of the gross loan portfolio. Individuals who have multiple loans with an MFI should be counted as a single borrower.',NULL), - (35,'NumberOfActiveBorrowers',3,'GenderDimension:FemaleMember',0,'The number of individuals who currently have an outstanding loan balance with the MFI or are primarily responsible for repaying any portion of the gross loan portfolio. Individuals who have multiple loans with an MFI should be counted as a single borrower.',NULL), - (36,'NumberOfBoardMembers',3,'GenderDimension:FemaleMember',0,'The number of members that comprise the board of directors at the end of the reporting period who are female.',NULL), - (37,'NumberOfDepositAccounts',3,NULL,0,'The number of individuals who currently have funds on deposit with the MFI on a voluntary basis; i.e., they are not required to maintain the deposit account to access a loan. This number applies only to deposits held by an MFI, not to those deposits held in other institutions by the MFI\'s clients. The number should be based on the number of individuals rather than the number of groups. A single deposit account may represent multiple depositors.',NULL), - (38,'NumberOfDepositors',3,'',0,'The number of deposit accounts, both voluntary and compulsory, opened at the MFI whose balances the institution is liable to repay. The number should be based on the number of individual accounts rather than on the number of groups.',NULL), - (39,'NumberOfEmployees',3,NULL,0,'The number of individuals who are actively employed by an entity. This number includes contract employees or advisors who dedicate a substantial portion of their time to the entity, even if they are not on the entity\'s employees roster.',NULL), - (40,'NumberOfEmployees',3,'GenderDimension:FemaleMember',0,'The number of individuals who are actively employed by an entity. This number includes contract employees or advisors who dedicate a substantial portion of their time to the entity, even if they are not on the entity\'s employees roster.',NULL), - (41,'NumberOfLoanOfficers',3,NULL,0,'The number of employees whose main activity is to manage a portion of the gross loan portfolio. A loan officer is a staff member of record who is directly responsible for arranging and monitoring client loans.',NULL), - (42,'NumberOfLoanOfficers',3,'GenderDimension:FemaleMember',0,'The number of employees whose main activity is to manage a portion of the gross loan portfolio. A loan officer is a staff member of record who is directly responsible for arranging and monitoring client loans.',NULL), - (43,'NumberOfManagers',3,'GenderDimension:FemaleMember',0,'The number of members that comprise the management of the institution who are female.',NULL), - (44,'NumberOfOffices',3,NULL,0,'The number of staffed points of service and administrative sites used to deliver or support the delivery of financial services to microfinance clients.',NULL), - (45,'NumberOfOutstandingLoans',3,NULL,0,'The number of loans in the gross loan portfolio. For MFIs using a group lending methodology, the number of loans should refer to the number of individuals receiving loans as part of a group or as part of a group loan.',NULL), - (46,'OperatingExpense',3,NULL,3,'Includes expenses not related to financial and credit loss impairment, such as personnel expenses, depreciation, amortization and administrative expenses.',NULL), - (47,'OperatingIncome',3,NULL,2,'Includes all financial income and other operating revenue which is generated from non-financial services. Operating income also includes net gains (losses) from holding financial assets (changes on their values during the period and foreign exchange differences). Donations or any revenue not related with an MFI\'s core business of making loans and providing financial services are not considered under this category.',NULL), - (48,'WriteOffsOnGrossLoanPortfolio',3,NULL,2,'The value of loans that have been recognized as uncollectible for accounting purposes. A write-off is an accounting procedure that removes the outstanding balance of the loan from the gross loan portfolio and impairment loss allowance. Thus, the write-off does not affect the net loan portfolio, total assets, or any equity account. If the impairment loss allowance is insufficient to cover the amount written off, the excess amount will result in an additional impairment loss on loans recognised in profit or loss of the period.',NULL); - -UNLOCK TABLES; - - -DROP TABLE IF EXISTS `mix_taxonomy_mapping`; - -CREATE TABLE `mix_taxonomy_mapping` ( - `id` INT unsigned NOT NULL AUTO_INCREMENT, - `identifier` varchar(50) NOT NULL DEFAULT '', - `config` varchar(200) DEFAULT NULL, - `last_update_date` datetime DEFAULT NULL, - `currency` varchar(11) DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -LOCK TABLES `mix_taxonomy_mapping` WRITE; - -INSERT INTO `mix_taxonomy_mapping` (`id`, `identifier`, `config`, `last_update_date`, `currency`) VALUES -(1,'default',NULL,NULL,''); - -UNLOCK TABLES; - - -DROP TABLE IF EXISTS `mix_xbrl_namespace`; - -CREATE TABLE `mix_xbrl_namespace` ( - `id` INT unsigned NOT NULL AUTO_INCREMENT, - `prefix` varchar(20) NOT NULL DEFAULT '', - `url` varchar(100) DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `UNQUE` (`prefix`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -LOCK TABLES `mix_xbrl_namespace` WRITE; - -INSERT INTO `mix_xbrl_namespace` (`id`, `prefix`, `url`) -VALUES - (1,'ifrs','http://xbrl.iasb.org/taxonomy/2009-04-01/ifrs'), - (2,'iso4217','http://www.xbrl.org/2003/iso4217'), - (3,'mix','http://www.themix.org/INT/fr/ifrs/basi/YYYY-MM-DD/mx-cor'), - (4,'xbrldi','http://xbrl.org/2006/xbrldi'), - (5,'xbrli','http://www.xbrl.org/2003/instance'), - (6,'link','http://www.xbrl.org/2003/linkbase'), - (7,'dc-all','http://www.themix.org/INT/fr/ifrs/basi/2010-08-31/dc-all'); -UNLOCK TABLES; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V113__track_savings_transaction_against_office.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V113__track_savings_transaction_against_office.sql deleted file mode 100644 index def2796d6..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V113__track_savings_transaction_against_office.sql +++ /dev/null @@ -1,34 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_savings_account_transaction` - ADD COLUMN `office_id` BIGINT NULL DEFAULT NULL AFTER `savings_account_id`; - -/**update client savings**/ -UPDATE m_savings_account_transaction st set st.office_id = (SELECT c.office_id AS officeId FROM m_savings_account sa JOIN m_client c on sa.client_id=c.id where sa.id=st.savings_account_id) where st.savings_account_id in (Select sa.id from m_savings_account sa where sa.client_id is not null); - -/**update group savings**/ -UPDATE m_savings_account_transaction st set st.office_id = (SELECT g.office_id AS officeId FROM m_savings_account sa JOIN m_group g on sa.group_id=g.id where sa.id=st.savings_account_id) where st.savings_account_id in (Select sa.id from m_savings_account sa where sa.group_id is not null); - -/**Add foreign key constraints**/ -ALTER TABLE `m_savings_account_transaction` - CHANGE COLUMN `office_id` `office_id` BIGINT NOT NULL AFTER `savings_account_id`; - -ALTER TABLE `m_savings_account_transaction` - ADD CONSTRAINT `FK_m_savings_account_transaction_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V114__set_default_transfers_in_suspense_account_for_existing_savings_products - Copy.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V114__set_default_transfers_in_suspense_account_for_existing_savings_products - Copy.sql deleted file mode 100644 index 052ebc59c..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V114__set_default_transfers_in_suspense_account_for_existing_savings_products - Copy.sql +++ /dev/null @@ -1,23 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `acc_product_mapping` (`gl_account_id`,`product_id`,`product_type`,`payment_type`,`charge_id`,`financial_account_type`) -select mapping.gl_account_id,mapping.product_id,mapping.product_type,mapping.payment_type,mapping.charge_id, 10 -from acc_product_mapping mapping -where mapping.financial_account_type = 1 and mapping.product_type=2; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V115__permissions_for_cache_api.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V115__permissions_for_cache_api.sql deleted file mode 100644 index 5b3409fb8..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V115__permissions_for_cache_api.sql +++ /dev/null @@ -1,38 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -DROP TABLE IF EXISTS `c_cache`; -CREATE TABLE `c_cache` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `cache_type_enum` tinyint NOT NULL DEFAULT '1', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - - -INSERT INTO `c_cache` -(`id`,`cache_type_enum`) -VALUES -(1, 1); - - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('configuration', 'READ_CACHE', 'CACHE', 'READ', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('configuration', 'UPDATE_CACHE', 'CACHE', 'UPDATE', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V116__track_currency_for_journal_entries.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V116__track_currency_for_journal_entries.sql deleted file mode 100644 index 1214038d5..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V116__track_currency_for_journal_entries.sql +++ /dev/null @@ -1,48 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -/**Add currency code**/ -ALTER TABLE `acc_gl_journal_entry` - ADD COLUMN `currency_code` VARCHAR(3) NULL DEFAULT NULL AFTER `reversal_id`; - - -/**Update currency codes for loans**/ -UPDATE acc_gl_journal_entry journal_entry SET currency_code = ( -SELECT m_loan.currency_code -FROM m_loan, m_loan_transaction -WHERE m_loan.id = m_loan_transaction.loan_id AND m_loan_transaction.id=journal_entry.transaction_id) -WHERE journal_entry.entity_type_enum=1; - - -/**Update currency codes for savings**/ -UPDATE acc_gl_journal_entry journal_entry SET currency_code = ( -SELECT m_savings_account.currency_code -FROM m_savings_account, m_savings_account_transaction -WHERE m_savings_account.id = m_savings_account_transaction.savings_account_id AND m_savings_account_transaction.id=journal_entry.transaction_id) -WHERE journal_entry.entity_type_enum=2; - -/**Update currency codes for manual journal entries***/ -update acc_gl_journal_entry set currency_code = (select code from m_organisation_currency limit 1) -where acc_gl_journal_entry.currency_code is NULL; - -/**Make currency code not null**/ -ALTER TABLE `acc_gl_journal_entry` - ALTER `currency_code` DROP DEFAULT; -ALTER TABLE `acc_gl_journal_entry` - CHANGE COLUMN `currency_code` `currency_code` VARCHAR(3) NOT NULL AFTER `reversal_id`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V117__loan_charge_from_savings.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V117__loan_charge_from_savings.sql deleted file mode 100644 index 55015a7b0..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V117__loan_charge_from_savings.sql +++ /dev/null @@ -1,43 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_portfolio_account_associations` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `loan_account_id` BIGINT NULL DEFAULT NULL, - `savings_account_id` BIGINT NULL DEFAULT NULL, - `linked_loan_account_id` BIGINT NULL DEFAULT NULL, - `linked_savings_account_id` BIGINT NULL DEFAULT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `account_association_loan_fk` FOREIGN KEY (`loan_account_id`) REFERENCES `m_loan` (`id`), - CONSTRAINT `account_association_savings_fk` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`), - CONSTRAINT `linked_loan_fk` FOREIGN KEY (`linked_loan_account_id`) REFERENCES `m_loan` (`id`), - CONSTRAINT `linked_savings_fk` FOREIGN KEY (`linked_savings_account_id`) REFERENCES `m_savings_account` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; - -ALTER TABLE `m_charge` - ADD COLUMN `charge_payment_mode_enum` SMALLINT NOT NULL DEFAULT '0' AFTER `charge_calculation_enum`; - -ALTER TABLE `m_loan_charge` - ADD COLUMN `charge_payment_mode_enum` SMALLINT NOT NULL DEFAULT '0' AFTER `charge_calculation_enum`; - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('transaction_loan', 'PAY_LOANCHARGE', 'LOANCHARGE', 'PAY', 0); - -INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Transfer Fee For Loans From Savings', 'Transfer Fee For Loans From Savings', '0 1 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 0, 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V118_1__savings_charge_patch_update.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V118_1__savings_charge_patch_update.sql deleted file mode 100644 index f9fbfb4c2..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V118_1__savings_charge_patch_update.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_savings_account` - ADD COLUMN `total_fees_charge_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `total_withdrawal_fees_derived`, - ADD COLUMN `total_penalty_charge_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `total_fees_charge_derived`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V118_2__product_mapping_delete_duplicate_fund_source_to_account_mappings.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V118_2__product_mapping_delete_duplicate_fund_source_to_account_mappings.sql deleted file mode 100644 index e13986deb..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V118_2__product_mapping_delete_duplicate_fund_source_to_account_mappings.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -delete from acc_product_mapping where financial_account_type=10 and payment_type is not null; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V118_3__permissions_form_propose_and_accept_client_transfers.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V118_3__permissions_form_propose_and_accept_client_transfers.sql deleted file mode 100644 index cb48ef7db..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V118_3__permissions_form_propose_and_accept_client_transfers.sql +++ /dev/null @@ -1,25 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -/**Permissions for proposing and accepting a transfer**/ -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('portfolio', 'PROPOSEANDACCEPTTRANSFER_CLIENT', 'CLIENT', 'PROPOSEANDACCEPTTRANSFER', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('portfolio', 'PROPOSEANDACCEPTTRANSFER_CLIENT_CHECKER', 'CLIENT', 'PROPOSEANDACCEPTTRANSFER', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V118_4__reset_default_transfers_in_suspense_account_for_existing_savings_products.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V118_4__reset_default_transfers_in_suspense_account_for_existing_savings_products.sql deleted file mode 100644 index 8f8c36db4..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V118_4__reset_default_transfers_in_suspense_account_for_existing_savings_products.sql +++ /dev/null @@ -1,27 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -/***Delete previously set defaults**/ -delete from acc_product_mapping where financial_account_type=10 and product_type=2; - -/***Set the proper defaults**/ -INSERT INTO `acc_product_mapping` (`gl_account_id`,`product_id`,`product_type`,`payment_type`,`charge_id`,`financial_account_type`) -select mapping.gl_account_id,mapping.product_id,mapping.product_type,mapping.payment_type,mapping.charge_id, 10 -from acc_product_mapping mapping -where mapping.financial_account_type = 2 and mapping.product_type=2; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V118_5__batch_job_entry_for_pay_savings_charge.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V118_5__batch_job_entry_for_pay_savings_charge.sql deleted file mode 100644 index d42e480bf..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V118_5__batch_job_entry_for_pay_savings_charge.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Pay Due Savings Charges', 'Pay Due Savings Charges', '0 0 12 * * ?', '2013-09-23 00:00:00', 5, NULL, NULL, NULL, 'Pay Due Savings ChargesJobDetail1 _ DEFAULT', NULL, 1, 0, 1, 0, 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V118_6__defaults_for_income_from_penalties_for savings_product.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V118_6__defaults_for_income_from_penalties_for savings_product.sql deleted file mode 100644 index 2bd6e4436..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V118_6__defaults_for_income_from_penalties_for savings_product.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -/***Set defaults for income from Penalties for existing Saving Products**/ -INSERT INTO `acc_product_mapping` (`gl_account_id`,`product_id`,`product_type`,`payment_type`,`charge_id`,`financial_account_type`) -select mapping.gl_account_id,mapping.product_id,mapping.product_type,mapping.payment_type,mapping.charge_id, 5 -from acc_product_mapping mapping -where mapping.financial_account_type = 4 and mapping.product_type=2; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V118_7__move_withdrawal_annual_fee_to_charges.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V118_7__move_withdrawal_annual_fee_to_charges.sql deleted file mode 100644 index 20ee49e07..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V118_7__move_withdrawal_annual_fee_to_charges.sql +++ /dev/null @@ -1,272 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_savings_account_charge` - CHANGE COLUMN `due_for_collection_as_of_date` `charge_due_date` DATE NULL DEFAULT NULL AFTER `charge_time_enum`; - -ALTER TABLE `m_savings_account_charge` - ADD COLUMN `fee_on_month` SMALLINT NULL DEFAULT NULL AFTER `charge_due_date`, - ADD COLUMN `fee_on_day` SMALLINT NULL DEFAULT NULL AFTER `fee_on_month`, - ADD COLUMN `is_active` tinyint NOT NULL DEFAULT '1' AFTER `waived`; - - -delimiter // -CREATE PROCEDURE migrate_withdrwal_fees() -begin - declare no_more_rows boolean default false; - declare v_currency_code VARCHAR(3); - declare v_withdrawal_fee_type_enum SMALLINT; - declare v_withdrawal_fee_amount_charge_def DECIMAL(19,6); - declare v_account_id BIGINT; - declare v_withdrawal_fee_amount DECIMAL(19,6); - declare t_calculation_percentage DECIMAL(19,6); - declare t_calculation_on_amount DECIMAL(19,6); - declare t_withdrawal_fee_name VARCHAR(100); - - declare t_charge_id BIGINT; - declare t_savings_charge_id BIGINT; - - -- savings transaction variables - declare v_savings_transaction_id BIGINT; - declare v_transaction_amount DECIMAL(19,6); - - - declare cursor1 cursor for - select sa.currency_code, sa.withdrawal_fee_type_enum, sa.withdrawal_fee_amount - from m_savings_account sa where sa.withdrawal_fee_amount is not null and sa.withdrawal_fee_amount > 0 group by sa.currency_code, sa.withdrawal_fee_type_enum, sa.withdrawal_fee_amount; - - declare cursor2 cursor for - select sa.id, sa.withdrawal_fee_amount from m_savings_account sa where sa.currency_code=v_currency_code and sa.withdrawal_fee_type_enum=v_withdrawal_fee_type_enum and sa.withdrawal_fee_amount is not null and sa.withdrawal_fee_amount > 0; - - declare cursor3 cursor for - select sat.id, sat.amount from m_savings_account_transaction sat - where sat.savings_account_id=v_account_id and sat.transaction_type_enum=4; - - declare continue handler for not found - set no_more_rows := true; - - open cursor1; - LOOP1: loop - fetch cursor1 into v_currency_code, v_withdrawal_fee_type_enum, v_withdrawal_fee_amount_charge_def; - if no_more_rows then - close cursor1; - leave LOOP1; - end if; - -- set withdrawal fee name - if(v_withdrawal_fee_type_enum = 1) then - set t_withdrawal_fee_name = CONCAT('Withdrawal fee-Flat-',v_currency_code); - else - set t_withdrawal_fee_name = CONCAT('Withdrawal fee-Percentage-',v_currency_code); - end if; - - -- get charge id if already exists - set t_charge_id = (select id from m_charge where name = t_withdrawal_fee_name); - - if t_charge_id is null then - -- add withdrawal fee to charges - INSERT INTO `m_charge` (`name`, `currency_code`, `charge_applies_to_enum`, `charge_time_enum`, `charge_calculation_enum`, `charge_payment_mode_enum`, `amount`, `is_penalty`, `is_active`, `is_deleted`) VALUES (t_withdrawal_fee_name , v_currency_code, 2, 5, v_withdrawal_fee_type_enum, 0, v_withdrawal_fee_amount_charge_def, 0, 1, 0); - - -- get inserted charge id - set t_charge_id = last_insert_id(); - end if; - - open cursor2; - LOOP2: loop - fetch cursor2 into v_account_id, v_withdrawal_fee_amount; - if no_more_rows then - set no_more_rows := false; - close cursor2; - leave LOOP2; - end if; - - if (v_withdrawal_fee_type_enum=1) then - set t_calculation_percentage = NULL; - set t_calculation_on_amount = NULL; - else - set t_calculation_percentage = v_withdrawal_fee_amount; - set v_withdrawal_fee_amount = 0; - set t_calculation_on_amount = 0; - end if; - - if not exists (select id from m_savings_account_charge sac where - sac.savings_account_id=v_account_id and sac.charge_id=t_charge_id and sac.charge_time_enum=5) then - - -- attach withdrawal charge to savings - INSERT INTO `m_savings_account_charge` (`savings_account_id`, `charge_id`, `is_penalty`, `charge_time_enum`, `charge_due_date`, `fee_on_month`, `fee_on_day`, `charge_calculation_enum`, `calculation_percentage`, `calculation_on_amount`, `amount`, `amount_paid_derived`, `amount_waived_derived`, `amount_writtenoff_derived`, `amount_outstanding_derived`, `is_paid_derived`, `waived`, `is_active`) VALUES (v_account_id, t_charge_id, 0, 5, NULL, NULL, NULL, v_withdrawal_fee_type_enum, t_calculation_percentage, t_calculation_on_amount, v_withdrawal_fee_amount, NULL, NULL, NULL, 0.000000, 0, 0, 1); - - -- set savings account charge id - set t_savings_charge_id = last_insert_id(); - - else - - set t_savings_charge_id = (select id from m_savings_account_charge sac where sac.savings_account_id=v_account_id and sac.charge_id=t_charge_id and sac.charge_time_enum=5); - - end if; - - - open cursor3; - LOOP3: loop - fetch cursor3 into v_savings_transaction_id, v_transaction_amount; - - if no_more_rows then - set no_more_rows := false; - close cursor3; - leave LOOP3; - end if; - - if not exists (select id from m_savings_account_charge_paid_by sacp where - sacp.savings_account_transaction_id=v_savings_transaction_id and sacp.savings_account_charge_id=t_savings_charge_id) then - - -- insert a record into savings account charge paid by - INSERT INTO `m_savings_account_charge_paid_by` (`savings_account_transaction_id`, `savings_account_charge_id`, `amount`) VALUES(v_savings_transaction_id, t_savings_charge_id, v_transaction_amount); - - end if; - - end loop LOOP3; - end loop LOOP2; - end loop LOOP1; -end // - -CREATE PROCEDURE migrate_annual_fees() -begin - declare no_more_rows boolean default false; - declare v_currency_code VARCHAR(3); - declare v_annual_fee_amount_charge_def DECIMAL(19,6); - declare v_account_id BIGINT; - declare v_annual_fee_amount DECIMAL(19,6); - declare v_annual_fee_on_month SMALLINT; - declare v_annual_fee_on_day SMALLINT; - declare v_annual_fee_next_due_date DATE; - declare t_annual_fee_name VARCHAR(100); - declare t_charge_id BIGINT; - declare t_savings_charge_id BIGINT; - - -- savings transaction variables - declare v_savings_transaction_id BIGINT; - declare v_transaction_amount DECIMAL(19,6); - - - declare cursor1 cursor for - select sa.currency_code, sa.annual_fee_amount - from m_savings_account sa where sa.annual_fee_amount is not null and sa.annual_fee_on_month is not null and sa.annual_fee_on_day is not null group by sa.currency_code, sa.annual_fee_amount; - - declare cursor2 cursor for - select sa.id, sa.annual_fee_amount, sa.annual_fee_on_month, sa.annual_fee_on_day, sa.annual_fee_next_due_date from m_savings_account sa where sa.currency_code=v_currency_code and sa.annual_fee_amount is not null and sa.annual_fee_on_month is not null and sa.annual_fee_on_day is not null; - - declare cursor3 cursor for - select sat.id, sat.amount from m_savings_account_transaction sat - where sat.savings_account_id=v_account_id and sat.transaction_type_enum=5; - - declare continue handler for not found - set no_more_rows := true; - - open cursor1; - LOOP1: loop - fetch cursor1 into v_currency_code, v_annual_fee_amount_charge_def; - - if no_more_rows then - close cursor1; - leave LOOP1; - end if; - - -- set annual fee name - set t_annual_fee_name = CONCAT('Annual fee - ',v_currency_code); - - -- get charge id if already exists - set t_charge_id = (select id from m_charge where name = t_annual_fee_name); - - if t_charge_id is null then - - -- add annual fee to charges - INSERT INTO `m_charge` (`name`, `currency_code`, `charge_applies_to_enum`, `charge_time_enum`, `charge_calculation_enum`, `charge_payment_mode_enum`, `amount`, `is_penalty`, `is_active`, `is_deleted`) VALUES (t_annual_fee_name, v_currency_code, 2, 6, 1, 0, v_annual_fee_amount_charge_def, 0, 1, 0); - - -- get inserted charge id - set t_charge_id = last_insert_id(); - - end if; - - open cursor2; - LOOP2: loop - fetch cursor2 into v_account_id, v_annual_fee_amount, v_annual_fee_on_month, v_annual_fee_on_day, v_annual_fee_next_due_date; - - if no_more_rows then - set no_more_rows := false; - close cursor2; - leave LOOP2; - end if; - - if not exists (select id from m_savings_account_charge sac where - sac.savings_account_id=v_account_id and sac.charge_id=t_charge_id and sac.charge_time_enum=6) then - - -- attach annual charge to savings - INSERT INTO `m_savings_account_charge` (`savings_account_id`, `charge_id`, `is_penalty`, `charge_time_enum`, `charge_due_date`, `fee_on_month`, `fee_on_day`, `charge_calculation_enum`, `calculation_percentage`, `calculation_on_amount`, `amount`, `amount_paid_derived`, `amount_waived_derived`, `amount_writtenoff_derived`, `amount_outstanding_derived`, `is_paid_derived`, `waived`, `is_active`) VALUES (v_account_id, t_charge_id, 0, 6, v_annual_fee_next_due_date, v_annual_fee_on_month, v_annual_fee_on_day, 1, NULL, NULL, v_annual_fee_amount, NULL, NULL, NULL, v_annual_fee_amount, 0, 0, 1); - - -- set savings account charge id - set t_savings_charge_id = last_insert_id(); - - else - - set t_savings_charge_id = (select id from m_savings_account_charge sac where sac.savings_account_id=v_account_id and sac.charge_id=t_charge_id and sac.charge_time_enum=6); - - end if; - - open cursor3; - LOOP3: loop - fetch cursor3 into v_savings_transaction_id, v_transaction_amount; - - if no_more_rows then - set no_more_rows := false; - close cursor3; - leave LOOP3; - end if; - - if not exists (select id from m_savings_account_charge_paid_by sacp where - sacp.savings_account_transaction_id=v_savings_transaction_id and sacp.savings_account_charge_id=t_savings_charge_id) then - - -- insert a record into savings account charge paid by - INSERT INTO `m_savings_account_charge_paid_by` (`savings_account_transaction_id`, `savings_account_charge_id`, `amount`) VALUES(v_savings_transaction_id, t_savings_charge_id, v_transaction_amount); - - end if; - - end loop LOOP3; - end loop LOOP2; - end loop LOOP1; -end // - -delimiter ; - -call migrate_withdrwal_fees(); -call migrate_annual_fees(); - -drop procedure if exists migrate_annual_fees; -drop procedure if exists migrate_withdrwal_fees; - - -ALTER TABLE `m_savings_account` - DROP COLUMN `annual_fee_amount`, - DROP COLUMN `annual_fee_on_month`, - DROP COLUMN `annual_fee_on_day`, - DROP COLUMN `annual_fee_next_due_date`, - DROP COLUMN `withdrawal_fee_amount`, - DROP COLUMN `withdrawal_fee_type_enum`; - -ALTER TABLE `m_savings_product` - DROP COLUMN `annual_fee_amount`, - DROP COLUMN `annual_fee_on_month`, - DROP COLUMN `annual_fee_on_day`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V118_8__track_overpayments_seperately_in_loan_transactions.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V118_8__track_overpayments_seperately_in_loan_transactions.sql deleted file mode 100644 index c0a7f8240..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V118_8__track_overpayments_seperately_in_loan_transactions.sql +++ /dev/null @@ -1,35 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -/***Set defaults for income from Penalties for existing Saving Products**/ -ALTER TABLE `m_loan_transaction` - ADD COLUMN `overpayment_portion_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `penalty_charges_portion_derived`; - -/**Add dummy liability account if organization already has a loan product with accounting enabled**/ -INSERT INTO `acc_gl_account` (`name`, `hierarchy`, `gl_code`,`account_usage`, `classification_enum`,`description`) -select 'Loan Overpayments (Temp)', '.', '22000-Temp', 1, 2,'Temporary account to track Loan overpayments Liabilities' -FROM m_product_loan WHERE accounting_type != 1 -limit 1; - - -/**Map a liability account for every loan which has accounting enabled**/ -INSERT INTO `acc_product_mapping` (`gl_account_id`,`product_id`,`product_type`,`financial_account_type`) -select (select max(id) from acc_gl_account where classification_enum=2 and account_usage=1 LIMIT 1), mapping.product_id, mapping.product_type, 11 -from acc_product_mapping mapping -where mapping.financial_account_type = 2 and mapping.product_type=1; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V118__savings_charge.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V118__savings_charge.sql deleted file mode 100644 index 07152794c..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V118__savings_charge.sql +++ /dev/null @@ -1,83 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_savings_account_charge` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `savings_account_id` BIGINT NOT NULL, - `charge_id` BIGINT NOT NULL, - `is_penalty` tinyint NOT NULL DEFAULT '0', - `charge_time_enum` SMALLINT NOT NULL, - `due_for_collection_as_of_date` DATE NULL DEFAULT NULL, - `charge_calculation_enum` SMALLINT NOT NULL, - `calculation_percentage` DECIMAL(19,6) NULL DEFAULT NULL, - `calculation_on_amount` DECIMAL(19,6) NULL DEFAULT NULL, - `amount` DECIMAL(19,6) NOT NULL, - `amount_paid_derived` DECIMAL(19,6) NULL DEFAULT NULL, - `amount_waived_derived` DECIMAL(19,6) NULL DEFAULT NULL, - `amount_writtenoff_derived` DECIMAL(19,6) NULL DEFAULT NULL, - `amount_outstanding_derived` DECIMAL(19,6) NOT NULL DEFAULT '0.000000', - `is_paid_derived` tinyint NOT NULL DEFAULT '0', - `waived` tinyint NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - INDEX `charge_id` (`charge_id`), - INDEX `m_savings_account_charge_ibfk_2` (`savings_account_id`), - CONSTRAINT `m_savings_account_charge_ibfk_1` FOREIGN KEY (`charge_id`) REFERENCES `m_charge` (`id`), - CONSTRAINT `m_savings_account_charge_ibfk_2` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`) -) -ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - - -CREATE TABLE `m_savings_product_charge` ( - `savings_product_id` BIGINT NOT NULL, - `charge_id` BIGINT NOT NULL, - PRIMARY KEY (`savings_product_id`, `charge_id`), - INDEX `charge_id` (`charge_id`), - CONSTRAINT `m_savings_product_charge_ibfk_1` FOREIGN KEY (`charge_id`) REFERENCES `m_charge` (`id`), - CONSTRAINT `m_savings_product_charge_ibfk_2` FOREIGN KEY (`savings_product_id`) REFERENCES `m_savings_product` (`id`) -) -ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - - - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_SAVINGSACCOUNTCHARGE', 'SAVINGSACCOUNTCHARGE', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_SAVINGSACCOUNTCHARGE_CHECKER', 'SAVINGSACCOUNTCHARGE', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_SAVINGSACCOUNTCHARGE', 'SAVINGSACCOUNTCHARGE', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_SAVINGSACCOUNTCHARGE_CHECKER', 'SAVINGSACCOUNTCHARGE', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_SAVINGSACCOUNTCHARGE', 'SAVINGSACCOUNTCHARGE', 'DELETE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_SAVINGSACCOUNTCHARGE_CHECKER', 'SAVINGSACCOUNTCHARGE', 'DELETE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'WAIVE_SAVINGSACCOUNTCHARGE', 'SAVINGSACCOUNTCHARGE', 'WAIVE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'WAIVE_SAVINGSACCOUNTCHARGE_CHECKER', 'SAVINGSACCOUNTCHARGE', 'WAIVE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'PAY_SAVINGSACCOUNTCHARGE', 'SAVINGSACCOUNTCHARGE', 'PAY', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'PAY_SAVINGSACCOUNTCHARGE_CHECKER', 'SAVINGSACCOUNTCHARGE', 'PAY', 0); - - - -CREATE TABLE `m_savings_account_charge_paid_by` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `savings_account_transaction_id` BIGINT NOT NULL, - `savings_account_charge_id` BIGINT NOT NULL, - `amount` DECIMAL(19,6) NOT NULL, - PRIMARY KEY (`id`), - INDEX `FK__m_savings_account_transaction` (`savings_account_transaction_id`), - INDEX `FK__m_savings_account_charge` (`savings_account_charge_id`), - CONSTRAINT `FK__m_savings_account_charge` FOREIGN KEY (`savings_account_charge_id`) REFERENCES `m_savings_account_charge` (`id`), - CONSTRAINT `FK__m_savings_account_transaction` FOREIGN KEY (`savings_account_transaction_id`) REFERENCES `m_savings_account_transaction` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V119__add_template_table.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V119__add_template_table.sql deleted file mode 100644 index f22dc5ede..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V119__add_template_table.sql +++ /dev/null @@ -1,53 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -DROP TABLE IF EXISTS `m_template`; -CREATE TABLE `m_template` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `text` longtext COLLATE utf8mb4_unicode_ci NOT NULL, - `entity` INT DEFAULT NULL, - `type` INT DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `unq_name` (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -DROP TABLE IF EXISTS `m_templatemappers`; -CREATE TABLE `m_templatemappers` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `mapperkey` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `mapperorder` INT DEFAULT NULL, - `mappervalue` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -DROP TABLE IF EXISTS `m_template_m_templatemappers`; -CREATE TABLE `m_template_m_templatemappers` ( - `m_template_id` BIGINT NOT NULL, - `mappers_id` BIGINT NOT NULL, - UNIQUE KEY `mappers_id` (`mappers_id`), - KEY (`mappers_id`), - KEY (`m_template_id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organistion', 'DELETE_TEMPLATE', 'TEMPLATE', 'DELETE', 0), - ('organistion', 'CREATE_TEMPLATE', 'TEMPLATE', 'CREATE', 0), - ('organistion', 'UPDATE_TEMPLATE', 'TEMPLATE', 'UPDATE', 0), - ('organistion', 'READ_TEMPLATE', 'TEMPLATE', 'READ', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V11__add-payment-details.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V11__add-payment-details.sql deleted file mode 100644 index 46026d1db..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V11__add-payment-details.sql +++ /dev/null @@ -1,43 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -/* -New table for storing transaction details (for both loan and savings) -*/ - -CREATE TABLE `m_payment_detail` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `payment_type_enum` SMALLINT NOT NULL, - `account_number` VARCHAR(100) NULL DEFAULT NULL, - `check_number` VARCHAR(100) NULL DEFAULT NULL, - `receipt_number` VARCHAR(100) NULL DEFAULT NULL, - `bank_number` VARCHAR(100) NULL DEFAULT NULL, - `routing_code` VARCHAR(100) NULL DEFAULT NULL, - PRIMARY KEY (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; - -/* -Update loan transaction to add a link to transaction detail table -*/ - -ALTER TABLE `m_loan_transaction` - ADD COLUMN `payment_detail_id` BIGINT NULL AFTER `loan_id`, - ADD CONSTRAINT `FK_m_loan_transaction_m_payment_detail` FOREIGN KEY (`payment_detail_id`) REFERENCES `m_payment_detail` (`id`); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V120__accounting_running_balance.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V120__accounting_running_balance.sql deleted file mode 100644 index 3bee4d750..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V120__accounting_running_balance.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `acc_gl_journal_entry` - ADD COLUMN `is_running_balance_caculated` TINYINT NOT NULL DEFAULT '0' AFTER `lastmodified_date`, - ADD COLUMN `office_running_balance` DECIMAL(19,6) NOT NULL DEFAULT '0.000000' AFTER `is_running_balance_caculated`; - -INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Update Accounting Running Balances', 'Update Accounting Running Balances', '0 1 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 0, 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V121__accounting_running_balance_for_organization.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V121__accounting_running_balance_for_organization.sql deleted file mode 100644 index 51e95519a..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V121__accounting_running_balance_for_organization.sql +++ /dev/null @@ -1,23 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `acc_gl_journal_entry` - ADD COLUMN `organization_running_balance` DECIMAL(19,6) NOT NULL DEFAULT '0.000000' AFTER `office_running_balance`; - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'UPDATERUNNINGBALANCE_JOURNALENTRY', 'JOURNALENTRY', 'UPDATERUNNINGBALANCE', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V122__recurring_fee_support_for_savings.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V122__recurring_fee_support_for_savings.sql deleted file mode 100644 index 921104754..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V122__recurring_fee_support_for_savings.sql +++ /dev/null @@ -1,27 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_charge` - ADD COLUMN `fee_on_day` SMALLINT NULL AFTER `amount`, - ADD COLUMN `fee_interval` SMALLINT NULL AFTER `fee_on_day`, - ADD COLUMN `fee_on_month` SMALLINT NULL AFTER `fee_interval`; - - -ALTER TABLE `m_savings_account_charge` - ADD COLUMN `fee_interval` SMALLINT NULL DEFAULT NULL AFTER `fee_on_day`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V123__remove_payment_mode_for_savings.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V123__remove_payment_mode_for_savings.sql deleted file mode 100644 index 8e61ef525..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V123__remove_payment_mode_for_savings.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_charge` - CHANGE COLUMN `charge_payment_mode_enum` `charge_payment_mode_enum` SMALLINT NULL DEFAULT NULL AFTER `charge_calculation_enum`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V124__added_min_max_cap_for_charges.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V124__added_min_max_cap_for_charges.sql deleted file mode 100755 index 9daae3f16..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V124__added_min_max_cap_for_charges.sql +++ /dev/null @@ -1,26 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_charge` -ADD COLUMN `min_cap` DECIMAL(19,6) NULL AFTER `is_deleted`, -ADD COLUMN `max_cap` DECIMAL(19,6) NULL AFTER `min_cap`; - -ALTER TABLE `m_loan_charge` -ADD COLUMN `min_cap` DECIMAL(19,6) NULL AFTER `waived`, -ADD COLUMN `max_cap` DECIMAL(19,6) NULL AFTER `min_cap`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V125__added_column_for_actual_fee_amount_or_percentage.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V125__added_column_for_actual_fee_amount_or_percentage.sql deleted file mode 100644 index 3e06ca5b1..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V125__added_column_for_actual_fee_amount_or_percentage.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_loan_charge` - ADD COLUMN `charge_amount_or_percentage` DECIMAL(19,6) NULL DEFAULT NULL AFTER `calculation_on_amount`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V126__initial_database_structure_for_sms_outbound.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V126__initial_database_structure_for_sms_outbound.sql deleted file mode 100644 index b25dba1db..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V126__initial_database_structure_for_sms_outbound.sql +++ /dev/null @@ -1,55 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -DROP TABLE IF EXISTS `sms_messages_outbound`; -CREATE TABLE `sms_messages_outbound` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `group_id` BIGINT DEFAULT NULL, - `client_id` BIGINT DEFAULT NULL, - `staff_id` BIGINT DEFAULT NULL, - `status_enum` INT NOT NULL DEFAULT '100', - `mobile_no` varchar(50) NOT NULL, - `message` varchar(1000) NOT NULL, - PRIMARY KEY (`id`), - KEY `FKGROUP000000001` (`group_id`), - KEY `FKCLIENT00000001` (`client_id`), - CONSTRAINT `FKGROUP000000001` FOREIGN KEY (`group_id`) REFERENCES `m_group` (`id`), - CONSTRAINT `FKCLIENT00000001` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`), - CONSTRAINT `FKSTAFF000000001` FOREIGN KEY (`staff_id`) REFERENCES `m_staff` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - --- Permissions for CRUD on SMS outbound message tracking -DELETE FROM `m_permission` WHERE `entity_name`='SMS'; -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organisation', 'READ_SMS', 'SMS', 'READ', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organisation', 'CREATE_SMS', 'SMS', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organisation', 'CREATE_SMS_CHECKER', 'SMS', 'CREATE', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organisation', 'UPDATE_SMS', 'SMS', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organisation', 'UPDATE_SMS_CHECKER', 'SMS', 'UPDATE', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organisation', 'DELETE_SMS', 'SMS', 'DELETE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organisation', 'DELETE_SMS_CHECKER', 'SMS', 'DELETE', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V127__mobile_no_fields.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V127__mobile_no_fields.sql deleted file mode 100644 index 9c8a67d8d..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V127__mobile_no_fields.sql +++ /dev/null @@ -1,27 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_client` -ADD COLUMN `mobile_no` VARCHAR(50) NULL DEFAULT NULL AFTER `display_name`, -ADD UNIQUE INDEX `mobile_no_UNIQUE` (`mobile_no` ASC); - - -ALTER TABLE `m_staff` -ADD COLUMN `mobile_no` VARCHAR(50) NULL DEFAULT NULL AFTER `display_name`, -ADD UNIQUE INDEX `mobile_no_UNIQUE` (`mobile_no` ASC); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V128__added_loan_installment_charge.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V128__added_loan_installment_charge.sql deleted file mode 100644 index cb04ff1a4..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V128__added_loan_installment_charge.sql +++ /dev/null @@ -1,38 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_loan_installment_charge` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `loan_charge_id` BIGINT NOT NULL, - `loan_schedule_id` BIGINT NOT NULL, - `due_date` DATE NULL DEFAULT NULL, - `amount` DECIMAL(19,6) NOT NULL, - `amount_paid_derived` DECIMAL(19,6) NULL DEFAULT NULL, - `amount_waived_derived` DECIMAL(19,6) NULL DEFAULT NULL, - `amount_writtenoff_derived` DECIMAL(19,6) NULL DEFAULT NULL, - `amount_outstanding_derived` DECIMAL(19,6) NOT NULL DEFAULT '0.000000', - `is_paid_derived` tinyint NOT NULL DEFAULT '0', - `waived` tinyint NOT NULL DEFAULT '0', - `amount_through_charge_payment` DECIMAL(19,6) NULL DEFAULT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `FK_loan_charge_id_charge_schedule` FOREIGN KEY (`loan_charge_id`) REFERENCES `m_loan_charge` (`id`), - CONSTRAINT `FK_loan_schedule_id_charge_schedule` FOREIGN KEY (`loan_schedule_id`) REFERENCES `m_loan_repayment_schedule` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V129__client_and_group_timeline.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V129__client_and_group_timeline.sql deleted file mode 100644 index a3491519b..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V129__client_and_group_timeline.sql +++ /dev/null @@ -1,28 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_client` ADD `submittedon_date` DATE NULL DEFAULT NULL , -ADD `submittedon_userid` BIGINT NULL DEFAULT NULL , -ADD `activatedon_userid` BIGINT NULL DEFAULT NULL , -ADD `closedon_userid` BIGINT NULL DEFAULT NULL ; - -ALTER TABLE `m_group` ADD `activatedon_userid` BIGINT NULL , -ADD `submittedon_date` DATE NULL , -ADD `submittedon_userid` BIGINT NULL , -ADD `closedon_userid` BIGINT NULL ; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V12__add_external_id_to_couple_of_tables.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V12__add_external_id_to_couple_of_tables.sql deleted file mode 100644 index a64ee395c..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V12__add_external_id_to_couple_of_tables.sql +++ /dev/null @@ -1,45 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -ALTER TABLE m_group - ADD UNIQUE INDEX `external_id_UNIQUE` (`external_id` ASC) ; - -ALTER TABLE m_product_loan - ADD COLUMN `external_id` VARCHAR(100) NULL AFTER `loan_transaction_strategy_id` , - ADD UNIQUE INDEX `external_id_UNIQUE` (`external_id` ASC) ; - -ALTER TABLE m_staff - ADD COLUMN `external_id` VARCHAR(100) NULL AFTER `display_name` , - ADD UNIQUE INDEX `external_id_UNIQUE` (`external_id` ASC) ; - - -/* status_id values for client and group -0 - Invalid -100 - Pending -300 - Active -600 - Closed( or Exited) -*/ - -ALTER TABLE m_client - ADD COLUMN `status_id` INT NOT NULL DEFAULT 300 AFTER `is_deleted` ; - - -ALTER TABLE m_group - ADD COLUMN `status_id` INT NOT NULL DEFAULT 300 AFTER `is_deleted` ; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V130__calendar-history-table.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V130__calendar-history-table.sql deleted file mode 100644 index f8a80161a..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V130__calendar-history-table.sql +++ /dev/null @@ -1,38 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_calendar_history` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `calendar_id` BIGINT NOT NULL, - `title` VARCHAR(50) NOT NULL, - `description` VARCHAR(100) NULL DEFAULT NULL, - `location` VARCHAR(50) NULL DEFAULT NULL, - `start_date` DATE NOT NULL, - `end_date` DATE NULL DEFAULT NULL, - `duration` SMALLINT NULL DEFAULT NULL, - `calendar_type_enum` SMALLINT NOT NULL, - `repeating` tinyint NOT NULL DEFAULT '0', - `recurrence` VARCHAR(100) NULL DEFAULT NULL, - `remind_by_enum` SMALLINT NULL DEFAULT NULL, - `first_reminder` SMALLint NULL DEFAULT NULL, - `second_reminder` SMALLint NULL DEFAULT NULL, - PRIMARY KEY (`id`), - INDEX `FK_m_calendar_m_calendar_history` (`calendar_id`), - CONSTRAINT `FK_m_calendar_m_calendar_history` FOREIGN KEY (`calendar_id`) REFERENCES `m_calendar` (`id`) -); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V131__holiday-status-column-and-permissions.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V131__holiday-status-column-and-permissions.sql deleted file mode 100644 index bad868a35..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V131__holiday-status-column-and-permissions.sql +++ /dev/null @@ -1,35 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_holiday` - ADD COLUMN `status_enum` INT NOT NULL DEFAULT '100' AFTER `repayments_rescheduled_to`; - -ALTER TABLE `m_holiday` - DROP INDEX `holiday_name`, - ADD UNIQUE INDEX `holiday_name` (`name`, `from_date`); - -UPDATE `m_holiday` set `status_enum`=300; - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('organisation', 'CREATE_HOLIDAY_CHECKER', 'HOLIDAY', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('organisation', 'ACTIVATE_HOLIDAY', 'HOLIDAY', 'ACTIVATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('organisation', 'ACTIVATE_HOLIDAY_CHECKER', 'HOLIDAY', 'ACTIVATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('organisation', 'UPDATE_HOLIDAY', 'HOLIDAY', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('organisation', 'UPDATE_HOLIDAY_CHECKER', 'HOLIDAY', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('organisation', 'DELETE_HOLIDAY', 'HOLIDAY', 'DELETE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('organisation', 'DELETE_HOLIDAY_CHECKER', 'HOLIDAY', 'DELETE', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V132__borrower_cycle_changes.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V132__borrower_cycle_changes.sql deleted file mode 100644 index 9953d26cb..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V132__borrower_cycle_changes.sql +++ /dev/null @@ -1,38 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_product_loan_variations_borrower_cycle` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `loan_product_id` BIGINT NOT NULL DEFAULT '0', - `borrower_cycle_number` INT NOT NULL DEFAULT '0', - `value_condition` INT NOT NULL DEFAULT '0', - `param_type` INT NOT NULL DEFAULT '0', - `default_value` DECIMAL(19,6) NOT NULL DEFAULT '0.000000', - `max_value` DECIMAL(19,6) NULL DEFAULT NULL, - `min_value` DECIMAL(19,6) NULL DEFAULT NULL, - PRIMARY KEY (`id`), - INDEX `borrower_cycle_loan_product_FK` (`loan_product_id`), - CONSTRAINT `borrower_cycle_loan_product_FK` FOREIGN KEY (`loan_product_id`) REFERENCES `m_product_loan` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; - - -ALTER TABLE `m_product_loan` - ADD COLUMN `use_borrower_cycle` tinyint NOT NULL DEFAULT '0' AFTER `include_in_borrower_cycle`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V133__adding_payment_detail_with_journal_entry.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V133__adding_payment_detail_with_journal_entry.sql deleted file mode 100644 index 4942f23af..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V133__adding_payment_detail_with_journal_entry.sql +++ /dev/null @@ -1,28 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `acc_gl_journal_entry` - ADD COLUMN `loan_transaction_id` BIGINT NULL AFTER `transaction_id`, - ADD COLUMN `savings_transaction_id` BIGINT NULL AFTER `loan_transaction_id`, - ADD CONSTRAINT `FK_acc_gl_journal_entry_m_loan_transaction` FOREIGN KEY (`loan_transaction_id`) REFERENCES `m_loan_transaction` (`id`), - ADD CONSTRAINT `FK_acc_gl_journal_entry_m_savings_account_transaction` FOREIGN KEY (`savings_transaction_id`) REFERENCES `m_savings_account_transaction` (`id`); - -UPDATE acc_gl_journal_entry je SET je.savings_transaction_id=je.transaction_id,je.transaction_id=Concat('S',je.transaction_id) WHERE je.entity_type_enum=2; - -UPDATE acc_gl_journal_entry je SET je.loan_transaction_id=je.transaction_id,je.transaction_id=Concat('L',je.transaction_id) WHERE je.entity_type_enum=1; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V134_1__submitted_date_updation_for_clients.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V134_1__submitted_date_updation_for_clients.sql deleted file mode 100755 index 3fadd0032..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V134_1__submitted_date_updation_for_clients.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -UPDATE m_client mc SET mc.submittedon_date=mc.activation_date where mc.submittedon_date is NULL; -UPDATE m_client mc SET mc.submittedon_date=now() where mc.submittedon_date is NULL; - -UPDATE m_group mg SET mg.submittedon_date=mg.activation_date where mg.submittedon_date is NULL; -UPDATE m_group mg SET mg.submittedon_date=now() where mg.submittedon_date is NULL; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V134_2__permissions_spelling_correction.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V134_2__permissions_spelling_correction.sql deleted file mode 100644 index d3794f45a..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V134_2__permissions_spelling_correction.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -update m_permission set `grouping`="organisation" where `grouping` = "organistion"; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V134__added_column_value_on_c_configuration.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V134__added_column_value_on_c_configuration.sql deleted file mode 100755 index 004b93d21..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V134__added_column_value_on_c_configuration.sql +++ /dev/null @@ -1,31 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `c_configuration` -ADD COLUMN `value` INT NULL AFTER `name`; - -INSERT INTO `c_configuration` ( -`id` , -`name` , -`value` , -`enabled` -) -VALUES ( -NULL , 'penalty-wait-period', '2', '1' -); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V135__added_permission_for_undo_written_off.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V135__added_permission_for_undo_written_off.sql deleted file mode 100755 index fe39aba41..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V135__added_permission_for_undo_written_off.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('transaction_loan', 'UNDOWRITEOFF_LOAN', 'LOAN', 'UNDOWRITEOFF', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V136_1__update_script_strechy_parameter.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V136_1__update_script_strechy_parameter.sql deleted file mode 100644 index 2e0be8d0d..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V136_1__update_script_strechy_parameter.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -UPDATE stretchy_parameter SET `parameter_sql`='select p.id, p.`name`\r\nfrom m_product_loan p\r\nwhere (p.currency_code = \'$\{currencyId}\' or \'-1\'= \'$\{currencyId}\')\r\norder by 2' WHERE parameter_name='loanProductIdSelectAll'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V137__added_is_active_column_in_m_staff.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V137__added_is_active_column_in_m_staff.sql deleted file mode 100644 index 7dbfe8da2..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V137__added_is_active_column_in_m_staff.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_staff` ADD COLUMN `is_active` tinyint DEFAULT '0' AFTER `organisational_role_parent_staff_id`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V138__add_short_name_for_m_product_loan_and_m_savings_product.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V138__add_short_name_for_m_product_loan_and_m_savings_product.sql deleted file mode 100644 index 4b1d0e5a4..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V138__add_short_name_for_m_product_loan_and_m_savings_product.sql +++ /dev/null @@ -1,37 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_product_loan` - ADD COLUMN `short_name` VARCHAR(4) NULL DEFAULT NULL AFTER `id`; -update m_product_loan set short_name=concat(LEFT(name,2), RIGHT(id,2)) where short_name is null; -ALTER TABLE `m_product_loan` - ALTER `short_name` DROP DEFAULT; -ALTER TABLE `m_product_loan` - CHANGE COLUMN `short_name` `short_name` VARCHAR(4) NOT NULL AFTER `id`; -ALTER TABLE `m_product_loan` - ADD UNIQUE INDEX `unq_short_name` (`short_name`); - -ALTER TABLE `m_savings_product` - ADD COLUMN `short_name` VARCHAR(4) NULL DEFAULT NULL AFTER `name`; -update m_savings_product set short_name=concat(LEFT(name,2), RIGHT(id,2)) where short_name is null; -ALTER TABLE `m_savings_product` - ALTER `short_name` DROP DEFAULT; -ALTER TABLE `m_savings_product` - CHANGE COLUMN `short_name` `short_name` VARCHAR(4) NOT NULL AFTER `name`, - ADD UNIQUE INDEX `sp_unq_short_name` (`short_name`); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V139__default_value_for_is_active_updated_to_true_in_m_staff.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V139__default_value_for_is_active_updated_to_true_in_m_staff.sql deleted file mode 100644 index e215474ae..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V139__default_value_for_is_active_updated_to_true_in_m_staff.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_staff` - CHANGE COLUMN `is_active` `is_active` tinyint NOT NULL DEFAULT '1' AFTER `organisational_role_parent_staff_id`; -UPDATE `m_staff` SET `is_active`=1; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V13__add_group_and_client_pending_configuration.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V13__add_group_and_client_pending_configuration.sql deleted file mode 100644 index 828cecf77..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V13__add_group_and_client_pending_configuration.sql +++ /dev/null @@ -1,38 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - - -/* -default client and group status is active 300. If you want to be able to have pending as the initial client stat -*/ -INSERT INTO c_configuration (`name`, `enabled`) VALUES ('allow-pending-client-status', '0'); -INSERT INTO c_configuration (`name`, `enabled`) VALUES ('allow-pending-group-status', '0'); - - -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`) - VALUES ('status_id', '0', 'Invalid', 'Invalid'); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`) - VALUES ('status_id', '100', 'Pending', 'Pending'); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`) - VALUES ('status_id', '300', 'Active', 'Active'); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`) - VALUES ('status_id', '600', 'Closed', 'Closed'); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`) - VALUES ('loan_status_id', '0', 'Invalid', 'Invalid'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V140_1__added_payment_detail_id_in_ac_gl_journal_entry.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V140_1__added_payment_detail_id_in_ac_gl_journal_entry.sql deleted file mode 100644 index ce17e73be..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V140_1__added_payment_detail_id_in_ac_gl_journal_entry.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `acc_gl_journal_entry` - ADD COLUMN `payment_details_id` BIGINT NULL AFTER `organization_running_balance`, - ADD CONSTRAINT `FK_acc_gl_journal_entry_m_payment_detail` FOREIGN KEY (`payment_details_id`) REFERENCES `m_payment_detail` (`id`); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V140__added_loan_charge_status.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V140__added_loan_charge_status.sql deleted file mode 100644 index 7e0f0898e..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V140__added_loan_charge_status.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_loan_charge` - ADD COLUMN `is_active` tinyint NOT NULL DEFAULT '1' AFTER `max_cap`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V141__add_early_repayment_strategy.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V141__add_early_repayment_strategy.sql deleted file mode 100644 index 6541b3e24..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V141__add_early_repayment_strategy.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `ref_loan_transaction_processing_strategy` ( `code`, `name`) -VALUES - ( 'early-repayment-strategy', 'Early Repayment Strategy'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V142__read_savingsaccount_charge_permission.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V142__read_savingsaccount_charge_permission.sql deleted file mode 100644 index 53dc2ace0..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V142__read_savingsaccount_charge_permission.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -insert into `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'READ_SAVINGSACCOUNTCHARGE', 'SAVINGSACCOUNTCHARGE', 'READ', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V143__create_journalentry_checker_permission.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V143__create_journalentry_checker_permission.sql deleted file mode 100644 index 6301d7d9a..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V143__create_journalentry_checker_permission.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -insert into `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'CREATE_JOURNALENTRY_CHECKER', 'JOURNALENTRY', 'CREATE', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V144__spelling_mistake_corrections.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V144__spelling_mistake_corrections.sql deleted file mode 100644 index 09499b943..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V144__spelling_mistake_corrections.sql +++ /dev/null @@ -1,23 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -RENAME TABLE `x_table_cloumn_code_mappings` TO `x_table_column_code_mappings`; - -ALTER TABLE `acc_gl_journal_entry` - CHANGE COLUMN `is_running_balance_caculated` `is_running_balance_calculated` TINYINT NOT NULL DEFAULT '0' AFTER `lastmodified_date`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V145__add_force_password_reset_in_c_configuration.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V145__add_force_password_reset_in_c_configuration.sql deleted file mode 100644 index 02be5d887..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V145__add_force_password_reset_in_c_configuration.sql +++ /dev/null @@ -1,36 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `c_configuration` (`id`, `name`, `value`, `enabled`) VALUES (NULL, 'force-password-reset-days', '0', '0'); - -ALTER TABLE `m_appuser` ADD `last_time_password_updated` DATE NOT NULL DEFAULT '1970-01-01', -ADD INDEX ( `last_time_password_updated` ) ; - -UPDATE `m_appuser` SET `last_time_password_updated` = NOW() WHERE `m_appuser`.`last_time_password_updated` ='1970-01-01'; - -CREATE TABLE IF NOT EXISTS `m_appuser_previous_password` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `user_id` BIGINT NOT NULL, - `password` varchar(255) NOT NULL, - `removal_date` date NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; - -ALTER TABLE m_appuser_previous_password -ADD FOREIGN KEY (user_id) REFERENCES m_appuser(id); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V146__tranche_loans.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V146__tranche_loans.sql deleted file mode 100644 index 00c431472..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V146__tranche_loans.sql +++ /dev/null @@ -1,57 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_product_loan` - ADD COLUMN `multi_disburse_loan` tinyint NOT NULL DEFAULT '0' AFTER `close_date`, - ADD COLUMN `max_tranche_count` INT NULL DEFAULT NULL AFTER `multi_disburse_loan`, - ADD COLUMN `outstanding_loan_balance` DECIMAL(19,6) NULL DEFAULT NULL AFTER `max_tranche_count`; - -CREATE TABLE `m_loan_disbursement_detail` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `loan_id` BIGINT NOT NULL, - `expected_disburse_date` DATETIME NOT NULL, - `disbursedon_date` DATETIME NULL, - `principal` DECIMAL(19,6) NOT NULL, - `approved_principal` DECIMAL(19,6) NOT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `FK_loan_disbursement_detail_loan_id` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; - -ALTER TABLE `m_loan` - ADD COLUMN `fixed_emi_amount` DECIMAL(19,6) NULL AFTER `loan_product_counter`, - ADD COLUMN `approved_principal` DECIMAL(19,6) NOT NULL AFTER `principal_amount`, - ADD COLUMN `max_outstanding_loan_balance` DECIMAL(19,6) NULL DEFAULT NULL AFTER `fixed_emi_amount`; - -UPDATE m_loan ml SET ml.approved_principal = ml.principal_amount; - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATE_DISBURSEMENTDETAIL', 'DISBURSEMENTDETAIL', 'UPDATE', 0); - -CREATE TABLE `m_loan_term_variations` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `loan_id` BIGINT NOT NULL, - `term_type` SMALLINT NOT NULL, - `applicable_from` DATE NOT NULL, - `term_value` DECIMAL(19,6) NOT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `FK_loan_id_m_loan_id` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V147__tranche_loans_column_name_changes.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V147__tranche_loans_column_name_changes.sql deleted file mode 100644 index 0e038f8bd..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V147__tranche_loans_column_name_changes.sql +++ /dev/null @@ -1,23 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_product_loan` - CHANGE COLUMN `multi_disburse_loan` `allow_multiple_disbursals` tinyint NOT NULL DEFAULT '0' AFTER `close_date`, - CHANGE COLUMN `max_tranche_count` `max_disbursals` INT NULL DEFAULT NULL AFTER `allow_multiple_disbursals`, - CHANGE COLUMN `outstanding_loan_balance` `max_outstanding_loan_balance` DECIMAL(19,6) NULL DEFAULT NULL AFTER `max_disbursals`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V148__overdraft_changes.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V148__overdraft_changes.sql deleted file mode 100644 index b00f3a670..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V148__overdraft_changes.sql +++ /dev/null @@ -1,33 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_savings_product` - ADD COLUMN `allow_overdraft` tinyint NOT NULL DEFAULT '0' AFTER `withdrawal_fee_for_transfer`, - ADD COLUMN `overdraft_limit` DECIMAL(19,6) NULL DEFAULT NULL AFTER `allow_overdraft`; - -ALTER TABLE `m_savings_account` - ADD COLUMN `allow_overdraft` tinyint NOT NULL DEFAULT '0' AFTER `withdrawal_fee_for_transfer`, - ADD COLUMN `overdraft_limit` DECIMAL(19,6) NULL DEFAULT NULL AFTER `allow_overdraft`; - -ALTER TABLE `m_savings_account_transaction` - ADD COLUMN `overdraft_amount_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `amount`; - -ALTER TABLE `m_client` - ADD COLUMN `default_savings_product` BIGINT NULL DEFAULT NULL AFTER `closedon_userid`, - ADD CONSTRAINT `FK_m_client_m_savings_product` FOREIGN KEY (`default_savings_product`) REFERENCES `m_savings_product` (`id`); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V149__add_created_date_savings_transaction.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V149__add_created_date_savings_transaction.sql deleted file mode 100644 index cbd8b3fb1..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V149__add_created_date_savings_transaction.sql +++ /dev/null @@ -1,23 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_savings_account_transaction` - ADD COLUMN `created_date` DATETIME NOT NULL AFTER `cumulative_balance_derived`; - -update m_savings_account_transaction sat set sat.created_date=sat.transaction_date; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V14__rename_status_id_to_enum.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V14__rename_status_id_to_enum.sql deleted file mode 100644 index ccbcef2d0..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V14__rename_status_id_to_enum.sql +++ /dev/null @@ -1,27 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -ALTER TABLE m_group CHANGE COLUMN `status_id` `status_enum` INT NOT NULL DEFAULT '300' ; - -ALTER TABLE m_client CHANGE COLUMN `status_id` `status_enum` INT NOT NULL DEFAULT '300' ; - -update r_enum_value -set enum_name = 'status_enum' -where enum_name = 'status_id'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V150__basic_savings_report.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V150__basic_savings_report.sql deleted file mode 100644 index 9705cab25..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V150__basic_savings_report.sql +++ /dev/null @@ -1,49 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Savings Transactions', 'Pentaho', NULL, 'Savings', NULL, NULL, 0, 1); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Client Savings Summary', 'Pentaho', NULL, 'Savings', NULL, NULL, 0, 1); - -INSERT INTO `stretchy_parameter` (`parameter_name`, `parameter_variable`, `parameter_label`, `parameter_displayType`, `parameter_FormatType`, `parameter_default`, `special`, `selectOne`, `selectAll`, `parameter_sql`, `parent_id`) VALUES ( 'selectAccount', 'accountNo', 'Enter Account No', 'text', 'string', 'n/a', NULL, NULL, NULL, NULL, NULL); -INSERT INTO `stretchy_parameter` (`parameter_name`, `parameter_variable`, `parameter_label`, `parameter_displayType`, `parameter_FormatType`, `parameter_default`, `special`, `selectOne`, `selectAll`, `parameter_sql`, `parent_id`) VALUES ('savingsProductIdSelectAll', 'savingsProductId', 'Product', 'select', 'number', '0', NULL, NULL, 'Y', 'select p.id, p.`name`\r\nfrom m_savings_product p\r\norder by 2', NULL); - -INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Savings Transactions'), (select id from stretchy_parameter where parameter_name='startDateSelect'), 'fromDate'); -INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Savings Transactions'), (select id from stretchy_parameter where parameter_name='endDateSelect'), 'toDate'); -INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Savings Transactions'), (select id from stretchy_parameter where parameter_name='selectAccount'), 'accountNo'); -INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Savings Summary'), (select id from stretchy_parameter where parameter_name='startDateSelect'), 'fromDate'); -INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Savings Summary'), (select id from stretchy_parameter where parameter_name='endDateSelect'), 'toDate'); -INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Savings Summary'), (select id from stretchy_parameter where parameter_name='OfficeIdSelectOne'), 'selectOffice'); -INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Savings Summary'), (select id from stretchy_parameter where parameter_name='savingsProductIdSelectAll'), 'selectProduct'); - -ALTER TABLE `r_enum_value` - ADD COLUMN `enum_type` tinyint NOT NULL AFTER `enum_value`; - -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 1, 'deposit', 'deposit', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 2, 'withdrawal', 'withdrawal', 1); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 3, 'Interest Posting', 'Interest Posting', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 4, 'Withdrawal Fee', 'Withdrawal Fee', 1); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 5, 'Annual Fee', 'Annual Fee', 1); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 6, 'Waive Charge', 'Waive Charge', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 7, 'Pay Charge', 'Pay Charge', 1); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 12, 'Initiate Transfer', 'Initiate Transfer', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 13, 'Approve Transfer', 'Approve Transfer', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 14, 'Withdraw Transfer', 'Withdraw Transfer', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 15, 'Reject Transfer', 'Reject Transfer', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 16, 'Written-Off', 'Written-Off', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 17, 'Overdraft Interest', 'Overdraft Interest', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V151__add_default_savings_account_to_client.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V151__add_default_savings_account_to_client.sql deleted file mode 100644 index 7d1203e3b..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V151__add_default_savings_account_to_client.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_client` - ADD COLUMN `default_savings_account` BIGINT NULL DEFAULT NULL AFTER `default_savings_product`, - ADD CONSTRAINT `FK_m_client_m_savings_account` FOREIGN KEY (`default_savings_account`) REFERENCES `m_savings_account` (`id`); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATESAVINGSACCOUNT_CLIENT', 'CLIENT', 'UPDATESAVINGSACCOUNT', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V152__added_grace_for_over_due.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V152__added_grace_for_over_due.sql deleted file mode 100644 index ad33fce31..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V152__added_grace_for_over_due.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_product_loan` - ADD COLUMN `grace_on_arrears_ageing` SMALLINT NULL DEFAULT NULL AFTER `max_outstanding_loan_balance`; - -ALTER TABLE `m_loan` - ADD COLUMN `grace_on_arrears_ageing` SMALLINT NULL DEFAULT NULL AFTER `max_outstanding_loan_balance`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V153__Insert_missed_permissions.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V153__Insert_missed_permissions.sql deleted file mode 100644 index b52c94581..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V153__Insert_missed_permissions.sql +++ /dev/null @@ -1,28 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'READ_ACCOUNTINGRULE', 'ACCOUNTINGRULE', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'READ_JOURNALENTRY', 'JOURNALENTRY', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'READ_GLACCOUNT', 'GLACCOUNT', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'READ_GLCLOSURE', 'GLCLOSURE', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('organisation', 'READ_HOLIDAY', 'HOLIDAY', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('jobs', 'READ_SCHEDULER', 'SCHEDULER', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'READ_PRODUCTMIX', 'PRODUCTMIX', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'READ_MEETING', 'MEETING', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('jobs', 'EXECUTEJOB_SCHEDULER', 'SCHEDULER', 'EXECUTEJOB', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V154__aging_details.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V154__aging_details.sql deleted file mode 100644 index 22979ba57..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V154__aging_details.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -UPDATE `stretchy_report` SET `report_sql`='\r\nSELECT \r\nconcat(repeat("..", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as "Office/Branch",\r\nifnull(cur.display_symbol, ml.currency_code) as Currency, \r\nmc.account_no as "Client Account No.",\r\n mc.display_name AS "Client Name",\r\n ml.account_no AS "Account Number",\r\n ml.principal_amount AS "Loan Amount",\r\n ml.principal_disbursed_derived AS "Original Principal",\r\n ml.interest_charged_derived AS "Original Interest",\r\n ml.principal_repaid_derived AS "Principal Paid",\r\n ml.interest_repaid_derived AS "Interest Paid",\r\n laa.principal_overdue_derived AS "Principal Overdue",\r\n laa.interest_overdue_derived AS "Interest Overdue",\r\nDATEDIFF(CURDATE(), laa.overdue_since_date_derived) as "Days in Arrears",\r\n\r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<7, \'<1\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<8, \' 1\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<15, \'2\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<22, \' 3\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<29, \' 4\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<36, \' 5\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<43, \' 6\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<50, \' 7\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<57, \' 8\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<64, \' 9\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<71, \'10\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<78, \'11\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<85, \'12\', \'12+\')))))))))))) )AS "Weeks In Arrears Band",\r\n\r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<31, \'0 - 30\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<61, \'30 - 60\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<91, \'60 - 90\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<181, \'90 - 180\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<361, \'180 - 360\', \r\n \'> 360\'))))) AS "Days in Arrears Band"\r\n\r\n FROM m_office mo \r\n JOIN m_office ounder ON ounder.hierarchy like concat(mo.hierarchy, \'%\')\r\n AND ounder.hierarchy like CONCAT(\'${currentUserHierarchy}\', \'%\')\r\n INNER JOIN m_client mc ON mc.office_id=ounder.id\r\n INNER JOIN m_loan ml ON ml.client_id = mc.id\r\n INNER JOIN r_enum_value rev ON rev.enum_id=ml.loan_status_id AND rev.enum_name = \'loan_status_id\'\r\n INNER JOIN m_loan_arrears_aging laa ON laa.loan_id=ml.id\r\n left join m_currency cur on cur.code = ml.currency_code\r\n WHERE ml.loan_status_id=300\r\n AND mo.id=${officeId}\r\nORDER BY ounder.hierarchy, ifnull(cur.display_symbol, ml.currency_code), ml.account_no\r\n' WHERE `report_name`='Aging Detail'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V155__stretchy_into_pentaho.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V155__stretchy_into_pentaho.sql deleted file mode 100644 index 0b06ae86d..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V155__stretchy_into_pentaho.sql +++ /dev/null @@ -1,735 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report)VALUES ("Active Loans - Details(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Active Loans - Summary(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Active Loans by Disbursal Period(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Active Loans in last installment Summary(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report)VALUES ("Active Loans in last installment(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Active Loans Passed Final Maturity Summary(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Active Loans Passed Final Maturity(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Aging Detail(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Aging Summary (Arrears in Months)(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Aging Summary (Arrears in Weeks)(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Client Listing(Pentaho)", 'Pentaho', 'Client', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Client Loans Listing(Pentaho)", 'Pentaho', 'Client', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Expected Payments By Date - Basic(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Funds Disbursed Between Dates Summary by Office(Pentaho)", 'Pentaho', 'Fund', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Funds Disbursed Between Dates Summary(Pentaho)", 'Pentaho', 'Fund', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Loans Awaiting Disbursal Summary by Month(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Loans Awaiting Disbursal Summary(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Loans Awaiting Disbursal(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Loans Pending Approval(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Obligation Met Loans Details(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Obligation Met Loans Summary(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Portfolio at Risk by Branch(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Portfolio at Risk(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Rescheduled Loans(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("TxnRunningBalances(Pentaho)", 'Pentaho', 'Transaction', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report) VALUES ("Written-Off Loans(Pentaho)", 'Pentaho', 'Loan', '(NULL)', '(NULL)', 1, 1); - -INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Details(Pentaho)'),(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'),'branch'); - -INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Details(Pentaho)'),(select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'), - 'loanOfficer'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Details(Pentaho)'),(select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'), - 'currencyId'); -INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Details(Pentaho)'),(select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'),'fundId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Details(Pentaho)'),(select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'), - 'loanProductId'); -INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Details(Pentaho)'),(select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'),'loanPurposeId'); - -INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'), - 'Branch'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'), - 'loanOfficer'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'), - 'CurrencyId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'), - 'fundId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'), - 'loanProductId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'), - 'loanPurposeId'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans - Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='parTypeSelect'), - 'parType'); - -INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans by Disbursal Period(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'), - 'Branch'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans by Disbursal Period(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'), - 'loanOfficer'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans by Disbursal Period(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'), - 'CurrencyId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans by Disbursal Period(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'), - 'fundId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans by Disbursal Period(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'), - 'loanProductId'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans by Disbursal Period(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'), - 'loanPurposeId'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans by Disbursal Period(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'), - 'startDate'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans by Disbursal Period(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'), - 'endDate'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'), - 'Branch'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'), - 'Loan Officer'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'), - 'CurrencyId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'), - 'fundId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'), - 'loanProductId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'), - 'loanPurposeId'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='parTypeSelect'), - 'parType'); - - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'), - 'Branch'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'), - 'Loan Officer'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'), - 'CurrencyId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'), - 'fundId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'), - 'loanProductId'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans in last installment(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'), - 'loanPurposeId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'), - 'Branch'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'), - 'Loan Officer'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'), - 'CurrencyId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'), - 'fundId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'), - 'loanProductId'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'), - 'loanPurposeId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='parTypeSelect'), - 'parType'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'), - 'Branch'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'), - 'Loan Officer'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'), - 'CurrencyId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'), - 'fundId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'), - 'loanProductId'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Active Loans Passed Final Maturity(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'), - 'loanPurposeId'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Aging Detail(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'), - 'Branch'); -INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Aging Summary (Arrears in Months)(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'), - 'Branch'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Aging Summary (Arrears in Months)(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'), - 'CurrencyId'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Aging Summary (Arrears in Weeks)(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'), - 'Branch'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Aging Summary (Arrears in Weeks)(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'), - 'CurrencyId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Client Listing(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'), - 'selectOffice'); -INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Client Loans Listing(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'), - 'Branch'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Client Loans Listing(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'), - 'Loan Officer'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Client Loans Listing(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'), - 'CurrencyId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Client Loans Listing(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'), -'fundId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Client Loans Listing(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'), - 'loanProductId'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Client Loans Listing(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'), - 'loanPurposeId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Expected Payments By Date - Basic(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'), - 'Branch'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Expected Payments By Date - Basic(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'), - 'Loan Officer'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Expected Payments By Date - Basic(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'), - 'startDate'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Expected Payments By Date - Basic(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'), - 'endDate'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary by Office(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'), - 'Branch'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary by Office(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'), - 'CurrencyId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary by Office(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'), - 'fundId'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary by Office(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'), - 'startDate'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary by Office(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'), - 'endDate'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'), - 'CurrencyId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'), - 'fundId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'), - 'startDate'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Funds Disbursed Between Dates Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'), - 'endDate'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary by Month(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'), - 'Branch'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary by Month(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'), - 'Loan Officer'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary by Month(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'), - 'CurrencyId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary by Month(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'), - 'fundId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary by Month(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'), - 'loanProductId'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary by Month(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'), - 'loanPurposeId'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'), - 'Branch'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'), - 'Loan Officer'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'), - 'CurrencyId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'), - 'fundId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'), - 'loanProductId'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'), - 'loanPurposeId'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'), - 'Branch'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'), - 'Loan Officer'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'), - 'CurrencyId'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'), - 'fundId'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'), - 'loanProductId'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Awaiting Disbursal(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'), - 'loanPurposeId'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Pending Approval(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'), - 'Branch'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Pending Approval(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'), - 'Loan Officer'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Pending Approval(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'), - 'CurrencyId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Pending Approval(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'), - 'fundId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Pending Approval(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'), - 'loanProductId'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Loans Pending Approval(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'), - 'loanPurposeId'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'), - 'Branch'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'), -'Loan Officer'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'), - 'CurrencyId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'), - 'fundId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'), - 'loanProductId'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'), - 'loanPurposeId'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'), - 'startDate'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'), - 'endDate'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Details(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='obligDateTypeSelect'), - 'obligDateType'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'), - 'Branch'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'), - 'Loan Officer'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'), - 'CurrencyId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'), - 'fundId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'), - 'loanProductId'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'), - 'loanPurposeId'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'), - 'Startdate'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'), - 'Enddate'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Obligation Met Loans Summary(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='obligDateTypeSelect'), - 'obligDateType'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk by Branch(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'), - 'Branch'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk by Branch(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'), - 'Loan Officer'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk by Branch(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'), - 'CurrencyId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk by Branch(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'), - 'fundId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk by Branch(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'), - 'loanProductId'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk by Branch(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'), - 'loanPurposeId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk by Branch(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='parTypeSelect'), - 'parType'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'), - 'Branch'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'), - 'loanOfficer'); - - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'), - 'CurrencyId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='fundIdSelectAll'), - 'fundId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'), - 'loanProductId'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanPurposeIdSelectAll'), - 'loanPurposeId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Portfolio at Risk(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='parTypeSelect'), - 'parType'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Rescheduled Loans(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'), - 'Branch'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Rescheduled Loans(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'), - 'CurrencyId'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Rescheduled Loans(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'), - 'loanProductId'); -INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Rescheduled Loans(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'), - 'startDate'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Rescheduled Loans(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'), - 'endDate'); -INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='TxnRunningBalances(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'), - 'Branch'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='TxnRunningBalances(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanOfficerIdSelectAll'), - 'Loan Officer'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='TxnRunningBalances(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'), - 'startDate'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='TxnRunningBalances(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'), - 'endDate'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Written-Off Loans(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'), - 'Branch'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Written-Off Loans(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='currencyIdSelectAll'), - 'CurrencyId'); - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Written-Off Loans(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='loanProductIdSelectAll'), - 'loanProductId'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Written-Off Loans(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='startDateSelect'), - 'startDate'); - - INSERT INTO stretchy_report_parameter (report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id From stretchy_report sr where sr.report_name='Written-Off Loans(Pentaho)'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'), - 'endDate'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V156__added_loan_saving_txns_pentaho.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V156__added_loan_saving_txns_pentaho.sql deleted file mode 100644 index 5ed366efe..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V156__added_loan_saving_txns_pentaho.sql +++ /dev/null @@ -1,28 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Client Saving Transactions', 'Pentaho', NULL, 'Savings', NULL, NULL, 0, 0); -INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Saving Transactions'), (select id from stretchy_parameter where parameter_name='startDateSelect'), 'startDate'); -INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Saving Transactions'), (select id from stretchy_parameter where parameter_name='endDateSelect'), 'endDate'); -INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Saving Transactions'), (select id from stretchy_parameter where parameter_name='selectAccount'), 'accountNo'); - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Client Loan Account Schedule', 'Pentaho', NULL, 'Loans', NULL, NULL, 0, 0); -INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Loan Account Schedule'), (select id from stretchy_parameter where parameter_name='startDateSelect'), 'startDate'); -INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Loan Account Schedule'), (select id from stretchy_parameter where parameter_name='endDateSelect'), 'endDate'); -INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Loan Account Schedule'), (select id from stretchy_parameter where parameter_name='selectAccount'), 'accountNo'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V157__overdue_charge_improvements.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V157__overdue_charge_improvements.sql deleted file mode 100644 index 8f65d96e7..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V157__overdue_charge_improvements.sql +++ /dev/null @@ -1,37 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_charge` - ADD COLUMN `fee_frequency` SMALLINT NULL DEFAULT NULL AFTER `max_cap`; - -CREATE TABLE `m_loan_overdue_installment_charge` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `loan_charge_id` BIGINT NOT NULL, - `loan_schedule_id` BIGINT NOT NULL, - `frequency_number` INT NOT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `FK_m_loan_overdue_installment_charge_m_loan_charge` FOREIGN KEY (`loan_charge_id`) REFERENCES `m_loan_charge` (`id`), - CONSTRAINT `FK_m_loan_overdue_installment_charge_m_loan_repayment_schedule` FOREIGN KEY (`loan_schedule_id`) REFERENCES `m_loan_repayment_schedule` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; - -INSERT INTO `c_configuration` (`name`, `value`, `enabled`) VALUES ('grace-on-penalty-posting', 0, 1); - -INSERT INTO m_loan_overdue_installment_charge (`loan_charge_id`, `loan_schedule_id`, `frequency_number`) SELECT mlc.id ,ls.id ,1 from m_loan_charge as mlc inner join m_charge mc on mc.id = mlc.charge_id inner join m_loan_repayment_schedule ls on ls.loan_id = mlc.loan_id and ls.duedate = mlc.due_for_collection_as_of_date where mc.charge_time_enum = 9 and mlc.is_active = 1; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V158__dashboard_and_navigation_queries.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V158__dashboard_and_navigation_queries.sql deleted file mode 100644 index 31dbc683e..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V158__dashboard_and_navigation_queries.sql +++ /dev/null @@ -1,36 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('GroupNamesByStaff', 'Table', '', '', 'Select gr.id as id, gr.display_name as name from m_group gr where gr.level_id=1 and gr.staff_id = ${staffId}', '', 0, 1); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('ClientTrendsByDay', 'Table', '', 'Client', 'SELECT COUNT(cl.id) AS count, \n cl.activation_date AS days\nFROM m_office of \n LEFT JOIN m_client cl on of.id = cl.office_id\nWHERE of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" ) \n AND (cl.activation_date BETWEEN DATE_SUB(CURDATE(), INTERVAL 12 DAY) AND DATE(NOW()- INTERVAL 1 DAY))\nGROUP BY days', 'Retrieves the number of clients joined in last 12 days', 0, 1); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('ClientTrendsByWeek', 'Table', '', 'Client', 'SELECT COUNT(cl.id) AS count, \n WEEK(cl.activation_date) AS Weeks\nFROM m_office of \n LEFT JOIN m_client cl on of.id = cl.office_id\nWHERE of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" ) \n AND (cl.activation_date BETWEEN DATE_SUB(CURDATE(), INTERVAL 12 WEEK) AND DATE(NOW()))\nGROUP BY Weeks', '', 0, 1); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('ClientTrendsByMonth', 'Table', '', 'Client', 'SELECT COUNT(cl.id) AS count, \n MONTHNAME(cl.activation_date) AS Months\nFROM m_office of \n LEFT JOIN m_client cl on of.id = cl.office_id\nWHERE of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" ) \n AND (cl.activation_date BETWEEN DATE_SUB(CURDATE(), INTERVAL 12 MONTH) AND DATE(NOW()))\nGROUP BY Months', '', 0, 1); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('LoanTrendsByDay', 'Table', '', 'Loan', 'SELECT COUNT(ln.id) AS lcount, \n ln.disbursedon_date AS days\nFROM m_office of \n LEFT JOIN m_client cl on of.id = cl.office_id\n LEFT JOIN m_loan ln on cl.id = ln.client_id\nWHERE of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" ) \n AND (ln.disbursedon_date BETWEEN DATE_SUB(CURDATE(), INTERVAL 12 DAY) AND DATE(NOW()- INTERVAL 1 DAY))\nGROUP BY days', 'Retrieves Number of loans disbursed for last 12 days', 0, 1); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('LoanTrendsByWeek', 'Table', '', 'Loan', 'SELECT COUNT(ln.id) AS lcount, \n WEEK(ln.disbursedon_date) AS Weeks\nFROM m_office of \n LEFT JOIN m_client cl on of.id = cl.office_id\n LEFT JOIN m_loan ln on cl.id = ln.client_id\nWHERE of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" ) \n AND (ln.disbursedon_date BETWEEN DATE_SUB(CURDATE(), INTERVAL 12 WEEK) AND DATE(NOW()))\nGROUP BY Weeks', '', 0, 1); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('LoanTrendsByMonth', 'Table', '', 'Loan', 'SELECT COUNT(ln.id) AS lcount, \n MONTHNAME(ln.disbursedon_date) AS Months\nFROM m_office of \n LEFT JOIN m_client cl on of.id = cl.office_id\n LEFT JOIN m_loan ln on cl.id = ln.client_id\nWHERE of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" ) \n AND (ln.disbursedon_date BETWEEN DATE_SUB(CURDATE(), INTERVAL 12 MONTH) AND DATE(NOW()))\nGROUP BY Months', '', 0, 1); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Demand_Vs_Collection', 'Table', '', 'Loan', 'select amount.AmountDue-amount.AmountPaid as AmountDue, amount.AmountPaid as AmountPaid from\n(SELECT \n(IFNULL(SUM(ls.principal_amount),0) - IFNULL(SUM(ls.principal_writtenoff_derived),0)\n + IFNULL(SUM(ls.interest_amount),0) - IFNULL(SUM(ls.interest_writtenoff_derived),0) \n - IFNULL(SUM(ls.interest_waived_derived),0)\n + IFNULL(SUM(ls.fee_charges_amount),0) - IFNULL(SUM(ls.fee_charges_writtenoff_derived),0) \n - IFNULL(SUM(ls.fee_charges_waived_derived),0)\n + IFNULL(SUM(ls.penalty_charges_amount),0) - IFNULL(SUM(ls.penalty_charges_writtenoff_derived),0) \n - IFNULL(SUM(ls.penalty_charges_waived_derived),0)\n) AS AmountDue, \n\n(IFNULL(SUM(ls.principal_completed_derived),0) - IFNULL(SUM(ls.principal_writtenoff_derived),0) + IFNULL(SUM(ls.interest_completed_derived),0) - IFNULL(SUM(ls.interest_writtenoff_derived),0) \n - IFNULL(SUM(ls.interest_waived_derived),0)\n + IFNULL(SUM(ls.fee_charges_completed_derived),0) - IFNULL(SUM(ls.fee_charges_writtenoff_derived),0) \n - IFNULL(SUM(ls.fee_charges_waived_derived),0)\n + IFNULL(SUM(ls.penalty_charges_completed_derived),0) - IFNULL(SUM(ls.penalty_charges_writtenoff_derived),0) \n - IFNULL(SUM(ls.penalty_charges_waived_derived),0)\n) AS AmountPaid\nFROM m_office of\nLEFT JOIN m_client cl ON of.id = cl.office_id\nLEFT JOIN m_loan ln ON cl.id = ln.client_id\nLEFT JOIN m_loan_repayment_schedule ls ON ln.id = ls.loan_id\nWHERE ls.duedate = DATE(NOW()) AND \n (of.hierarchy LIKE CONCAT((\nSELECT ino.hierarchy\nFROM m_office ino\nWHERE ino.id = ${officeId}),"%"))) as amount', 'Demand Vs Collection', 0, 1); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Disbursal_Vs_Awaitingdisbursal', 'Table', '', 'Loan', 'select awaitinddisbursal.amount-disbursedAmount.amount as amountToBeDisburse, disbursedAmount.amount as disbursedAmount from \n(\nSELECT COUNT(ln.id) AS noOfLoans, \n IFNULL(SUM(ln.principal_amount),0) AS amount\nFROM \nm_office of\nLEFT JOIN m_client cl ON cl.office_id = of.id\nLEFT JOIN m_loan ln ON cl.id = ln.client_id\nWHERE \nln.expected_disbursedon_date = DATE(NOW()) AND \n(ln.loan_status_id=200 OR ln.loan_status_id=300) AND\n of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" )\n) awaitinddisbursal,\n(\nSELECT COUNT(ltrxn.id) as count, \n IFNULL(SUM(ltrxn.amount),0) as amount \nFROM \nm_office of\nLEFT JOIN m_client cl ON cl.office_id = of.id\nLEFT JOIN m_loan ln ON cl.id = ln.client_id\nLEFT JOIN m_loan_transaction ltrxn ON ln.id = ltrxn.loan_id\nWHERE \nltrxn.transaction_date = DATE(NOW()) AND \nltrxn.transaction_type_enum=1 AND\n of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" ) \n) disbursedAmount', 'Disbursal_Vs_Awaitingdisbursal', 0, 1); -INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select sr.id from stretchy_report sr where sr.report_name = 'ClientTrendsByDay'), (select sp.id from stretchy_parameter sp where sp.parameter_name = 'OfficeIdSelectOne'), ''); -INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select sr.id from stretchy_report sr where sr.report_name = 'ClientTrendsByWeek'), (select sp.id from stretchy_parameter sp where sp.parameter_name = 'OfficeIdSelectOne'), ''); -INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select sr.id from stretchy_report sr where sr.report_name = 'ClientTrendsByMonth'), (select sp.id from stretchy_parameter sp where sp.parameter_name = 'OfficeIdSelectOne'), ''); -INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select sr.id from stretchy_report sr where sr.report_name = 'LoanTrendsByDay'), (select sp.id from stretchy_parameter sp where sp.parameter_name = 'OfficeIdSelectOne'), ''); -INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select sr.id from stretchy_report sr where sr.report_name = 'LoanTrendsByWeek'), (select sp.id from stretchy_parameter sp where sp.parameter_name = 'OfficeIdSelectOne'), ''); -INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select sr.id from stretchy_report sr where sr.report_name = 'LoanTrendsByMonth'), (select sp.id from stretchy_parameter sp where sp.parameter_name = 'OfficeIdSelectOne'), ''); -INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select sr.id from stretchy_report sr where sr.report_name = 'Demand_Vs_Collection'), (select sp.id from stretchy_parameter sp where sp.parameter_name = 'OfficeIdSelectOne'), ''); -INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select sr.id from stretchy_report sr where sr.report_name = 'Disbursal_Vs_Awaitingdisbursal'), (select sp.id from stretchy_parameter sp where sp.parameter_name = 'OfficeIdSelectOne'), ''); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V159__add_transaction_id_column_m_portfolio_command_source.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V159__add_transaction_id_column_m_portfolio_command_source.sql deleted file mode 100644 index bc6e68e10..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V159__add_transaction_id_column_m_portfolio_command_source.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_portfolio_command_source` - ADD COLUMN `transaction_id` VARCHAR(100) NULL DEFAULT NULL AFTER `product_id`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V15__center_permissions.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V15__center_permissions.sql deleted file mode 100644 index 9327fa24c..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V15__center_permissions.sql +++ /dev/null @@ -1,26 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'READ_CENTER', 'CENTER', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'CREATE_CENTER', 'CENTER', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'CREATE_CENTER_CHECKER', 'CENTER', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATE_CENTER', 'CENTER', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATE_CENTER_CHECKER', 'CENTER', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'DELETE_CENTER', 'CENTER', 'DELETE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'DELETE_CENTER_CHECKER', 'CENTER', 'DELETE', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V160_2__Allow_nullValue_For_principal_on_lonProduct.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V160_2__Allow_nullValue_For_principal_on_lonProduct.sql deleted file mode 100644 index cff0cf9c9..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V160_2__Allow_nullValue_For_principal_on_lonProduct.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_product_loan` CHANGE `principal_amount` `principal_amount` DECIMAL( 19, 6 ) NULL ; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V160__standing_instruction_changes.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V160__standing_instruction_changes.sql deleted file mode 100644 index ff17380fb..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V160__standing_instruction_changes.sql +++ /dev/null @@ -1,144 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_account_transfer_details` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `from_office_id` BIGINT NOT NULL, - `to_office_id` BIGINT NOT NULL, - `from_client_id` BIGINT NULL DEFAULT NULL, - `to_client_id` BIGINT NULL DEFAULT NULL, - `from_savings_account_id` BIGINT NULL DEFAULT NULL, - `to_savings_account_id` BIGINT NULL DEFAULT NULL, - `from_loan_account_id` BIGINT NULL DEFAULT NULL, - `to_loan_account_id` BIGINT NULL DEFAULT NULL, - `transfer_type` SMALLINT NULL DEFAULT NULL, - `from_savings_transaction_id` BIGINT NULL DEFAULT NULL, - `from_loan_transaction_id` BIGINT NULL DEFAULT NULL, - `to_savings_transaction_id` BIGINT NULL DEFAULT NULL, - `to_loan_transaction_id` BIGINT NULL DEFAULT NULL, - `is_reversed` tinyint NOT NULL, - `transaction_date` DATE NOT NULL, - `currency_code` VARCHAR(3) NOT NULL, - `currency_digits` SMALLINT NOT NULL, - `currency_multiplesof` SMALLINT NULL DEFAULT NULL, - `amount` DECIMAL(19,6) NOT NULL, - `description` VARCHAR(200) NOT NULL, - PRIMARY KEY (`id`), - INDEX `FK_m_account_transfer_details_from_office` (`from_office_id`), - INDEX `FK_m_account_transfer_details_to_office` (`to_office_id`), - INDEX `FK_m_account_transfer_details_from_client` (`from_client_id`), - INDEX `FK_m_account_transfer_details_to_client` (`to_client_id`), - INDEX `FK_m_account_transfer_details_from_savings_account` (`from_savings_account_id`), - INDEX `FK_m_account_transfer_details_to_savings_account` (`to_savings_account_id`), - INDEX `FK_m_account_transfer_details_from_loan_account` (`from_loan_account_id`), - INDEX `FK_m_account_transfer_details_to_loan_account` (`to_loan_account_id`), - CONSTRAINT `FK_m_account_transfer_details_from_client` FOREIGN KEY (`from_client_id`) REFERENCES `m_client` (`id`), - CONSTRAINT `FK_m_account_transfer_details_from_loan_account` FOREIGN KEY (`from_loan_account_id`) REFERENCES `m_loan` (`id`), - CONSTRAINT `FK_m_account_transfer_details_from_office` FOREIGN KEY (`from_office_id`) REFERENCES `m_office` (`id`), - CONSTRAINT `FK_m_account_transfer_details_from_savings_account` FOREIGN KEY (`from_savings_account_id`) REFERENCES `m_savings_account` (`id`), - CONSTRAINT `FK_m_account_transfer_details_to_client` FOREIGN KEY (`to_client_id`) REFERENCES `m_client` (`id`), - CONSTRAINT `FK_m_account_transfer_details_to_loan_account` FOREIGN KEY (`to_loan_account_id`) REFERENCES `m_loan` (`id`), - CONSTRAINT `FK_m_account_transfer_details_to_office` FOREIGN KEY (`to_office_id`) REFERENCES `m_office` (`id`), - CONSTRAINT `FK_m_account_transfer_details_to_savings_account` FOREIGN KEY (`to_savings_account_id`) REFERENCES `m_savings_account` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; - -CREATE TABLE `m_account_transfer_standing_instructions` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `name` VARCHAR(250) NOT NULL, - `account_transfer_details_id` BIGINT NOT NULL, - `priority` TINYINT NOT NULL, - `status` TINYINT NOT NULL, - `instruction_type` TINYINT NOT NULL, - `amount` DECIMAL(19,6) NULL DEFAULT NULL, - `valid_from` DATE NOT NULL, - `valid_till` DATE NULL DEFAULT NULL, - `recurrence_type` tinyint NOT NULL, - `recurrence_frequency` SMALLINT NULL DEFAULT NULL, - `recurrence_interval` SMALLINT NULL DEFAULT NULL, - `recurrence_on_day` SMALLINT NULL DEFAULT NULL, - `recurrence_on_month` SMALLINT NULL DEFAULT NULL, - `last_run_date` DATE NULL DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE INDEX `name` (`name`), - INDEX `FK_m_standing_instructions_account_transfer_details` (`account_transfer_details_id`), - CONSTRAINT `FK_m_standing_instructions_account_transfer_details` FOREIGN KEY (`account_transfer_details_id`) REFERENCES `m_account_transfer_details` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; - - -CREATE TABLE `m_account_transfer_transaction` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `account_transfer_details_id` BIGINT NOT NULL, - `from_savings_transaction_id` BIGINT NULL DEFAULT NULL, - `from_loan_transaction_id` BIGINT NULL DEFAULT NULL, - `to_savings_transaction_id` BIGINT NULL DEFAULT NULL, - `to_loan_transaction_id` BIGINT NULL DEFAULT NULL, - `is_reversed` tinyint NOT NULL, - `transaction_date` DATE NOT NULL, - `currency_code` VARCHAR(3) NOT NULL, - `currency_digits` SMALLINT NOT NULL, - `currency_multiplesof` SMALLINT NULL DEFAULT NULL, - `amount` DECIMAL(19,6) NOT NULL, - `description` VARCHAR(200) NOT NULL, - PRIMARY KEY (`id`), - INDEX `FK_m_account_transfer_transaction_from_m_savings_transaction` (`from_savings_transaction_id`), - INDEX `FK_m_account_transfer_transaction_to_m_savings_transaction` (`to_savings_transaction_id`), - INDEX `FK_m_account_transfer_transaction_to_m_loan_transaction` (`to_loan_transaction_id`), - INDEX `FK_m_account_transfer_transaction_from_m_loan_transaction` (`from_loan_transaction_id`), - INDEX `FK_m_account_transfer_transaction_account_detail` (`account_transfer_details_id`), - CONSTRAINT `FK_m_account_transfer_transaction_account_detail` FOREIGN KEY (`account_transfer_details_id`) REFERENCES `m_account_transfer_details` (`id`), - CONSTRAINT `FK_m_account_transfer_transaction_from_m_loan_transaction` FOREIGN KEY (`from_loan_transaction_id`) REFERENCES `m_loan_transaction` (`id`), - CONSTRAINT `FK_m_account_transfer_transaction_from_m_savings_transaction` FOREIGN KEY (`from_savings_transaction_id`) REFERENCES `m_savings_account_transaction` (`id`), - CONSTRAINT `FK_m_account_transfer_transaction_to_m_loan_transaction` FOREIGN KEY (`to_loan_transaction_id`) REFERENCES `m_loan_transaction` (`id`), - CONSTRAINT `FK_m_account_transfer_transaction_to_m_savings_transaction` FOREIGN KEY (`to_savings_transaction_id`) REFERENCES `m_savings_account_transaction` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; - - - -INSERT INTO `m_account_transfer_details` (`from_office_id`, `to_office_id`, `from_client_id`, `to_client_id`, `from_savings_account_id`, `to_savings_account_id`, `from_loan_account_id`, `to_loan_account_id`, `from_savings_transaction_id`, `from_loan_transaction_id`, `to_savings_transaction_id`, `to_loan_transaction_id`, `is_reversed`, `transaction_date`, `currency_code`, `currency_digits`, `currency_multiplesof`, `amount`, `description`) select at.from_office_id,at.to_office_id,at.from_client_id,at.to_client_id,at.from_savings_account_id,at.to_savings_account_id,at.from_loan_account_id,at.to_loan_account_id,at.from_savings_transaction_id,at.from_loan_transaction_id,at.to_savings_transaction_id,at.to_loan_transaction_id,at.is_reversed,at.transaction_date,at.currency_code,at.currency_digits,at.currency_multiplesof,at.amount,at.description from m_savings_account_transfer at; - -INSERT INTO `m_account_transfer_transaction` (`account_transfer_details_id`, `from_savings_transaction_id`, `from_loan_transaction_id`, `to_savings_transaction_id`, `to_loan_transaction_id`, `is_reversed`, `transaction_date`, `currency_code`, `currency_digits`, `currency_multiplesof`, `amount`, `description`) select ad.id,ad.from_savings_transaction_id,ad.from_loan_transaction_id,ad.to_savings_transaction_id,ad.to_loan_transaction_id,ad.is_reversed,ad.transaction_date,ad.currency_code,ad.currency_digits,ad.currency_multiplesof,ad.amount,ad.description from m_account_transfer_details ad; - -ALTER TABLE `m_account_transfer_details` - DROP COLUMN `from_savings_transaction_id`, - DROP COLUMN `from_loan_transaction_id`, - DROP COLUMN `to_savings_transaction_id`, - DROP COLUMN `to_loan_transaction_id`, - DROP COLUMN `is_reversed`, - DROP COLUMN `transaction_date`, - DROP COLUMN `currency_code`, - DROP COLUMN `currency_digits`, - DROP COLUMN `currency_multiplesof`, - DROP COLUMN `amount`, - DROP COLUMN `description`; - -DROP TABLE `m_savings_account_transfer`; - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('account_transfer', 'READ_STANDINGINSTRUCTION ', 'STANDINGINSTRUCTION ', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('account_transfer', 'CREATE_STANDINGINSTRUCTION ', 'STANDINGINSTRUCTION ', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('account_transfer', 'UPDATE_STANDINGINSTRUCTION ', 'STANDINGINSTRUCTION ', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('account_transfer', 'DELETE_STANDINGINSTRUCTION ', 'STANDINGINSTRUCTION ', 'DELETE', 0); - - -INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Execute Standing Instruction', 'Execute Standing Instruction', '0 0 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 0, 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V161__added_accrual_batch_job.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V161__added_accrual_batch_job.sql deleted file mode 100644 index 062526a38..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V161__added_accrual_batch_job.sql +++ /dev/null @@ -1,25 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_loan_repayment_schedule` - ADD COLUMN `accrual_interest_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `interest_waived_derived`, - ADD COLUMN `accrual_fee_charges_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `fee_charges_waived_derived`, - ADD COLUMN `accrual_penalty_charges_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `penalty_charges_waived_derived`; - -INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Add Accrual Transactions', 'Add Accrual Transactions', '0 1 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 0, 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V162__overdue_charge_batch_job.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V162__overdue_charge_batch_job.sql deleted file mode 100644 index e170ad2f6..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V162__overdue_charge_batch_job.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Apply penalty to overdue loans', 'Apply penalty to overdue loans', '0 0 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 0, 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V163__added_npa_for_loans.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V163__added_npa_for_loans.sql deleted file mode 100644 index aa282ead8..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V163__added_npa_for_loans.sql +++ /dev/null @@ -1,26 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_product_loan` - ADD COLUMN `overdue_days_for_npa` SMALLINT NULL DEFAULT NULL AFTER `grace_on_arrears_ageing`; - -ALTER TABLE `m_loan` - ADD COLUMN `is_npa` tinyint NOT NULL DEFAULT '0' AFTER `grace_on_arrears_ageing`; - -INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`) VALUES ('Update Non Performing Assets', 'Update Non Performing Assets', '0 0 0 1/1 * ? *', now()); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V164__fd_and_rd_deposit_tables.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V164__fd_and_rd_deposit_tables.sql deleted file mode 100644 index 73e1f37aa..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V164__fd_and_rd_deposit_tables.sql +++ /dev/null @@ -1,256 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE IF NOT EXISTS `m_interest_rate_chart` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `name` varchar(100) DEFAULT NULL, - `description` varchar(200) DEFAULT NULL, - `from_date` date NOT NULL, - `end_date` date DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - - -CREATE TABLE IF NOT EXISTS `m_interest_rate_slab` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `interest_rate_chart_id` BIGINT NOT NULL, - `description` varchar(200) DEFAULT NULL, - `period_type_enum` SMALLINT NOT NULL DEFAULT '1', - `from_period` INT NOT NULL DEFAULT '0', - `to_period` INT DEFAULT NULL, - `amount_range_from` decimal(19,6) DEFAULT NULL, - `amount_range_to` decimal(19,6) DEFAULT NULL, - `annual_interest_rate` decimal(19,6) NOT NULL, - `currency_code` varchar(3) NOT NULL, - PRIMARY KEY (`id`), - KEY `FKIRS00000000000001` (`interest_rate_chart_id`), - CONSTRAINT `FKIRS00000000000001` FOREIGN KEY (`interest_rate_chart_id`) REFERENCES `m_interest_rate_chart` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE IF NOT EXISTS `m_deposit_product_interest_rate_chart` ( - `deposit_product_id` BIGINT NOT NULL, - `interest_rate_chart_id` BIGINT NOT NULL, - UNIQUE KEY `deposit_product_id_interest_rate_chart_id` (`deposit_product_id`,`interest_rate_chart_id`), - KEY `FKDPIRC00000000000002` (`interest_rate_chart_id`), - CONSTRAINT `FKDPIRC00000000000001` FOREIGN KEY (`deposit_product_id`) REFERENCES `m_savings_product` (`id`), - CONSTRAINT `FKDPIRC00000000000002` FOREIGN KEY (`interest_rate_chart_id`) REFERENCES `m_interest_rate_chart` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - - -CREATE TABLE IF NOT EXISTS `m_deposit_product_term_and_preclosure` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `savings_product_id` BIGINT NOT NULL DEFAULT '0', - `min_deposit_term` INT DEFAULT NULL, - `max_deposit_term` INT DEFAULT NULL, - `min_deposit_term_type_enum` SMALLINT DEFAULT NULL, - `max_deposit_term_type_enum` SMALLINT DEFAULT NULL, - `in_multiples_of_deposit_term` INT DEFAULT NULL, - `in_multiples_of_deposit_term_type_enum` SMALLINT DEFAULT NULL, - `interest_free_period_applicable` SMALLINT DEFAULT NULL, - `interest_free_from_period` INT DEFAULT NULL, - `interest_free_to_period` INT DEFAULT NULL, - `interest_free_period_frequency_enum` SMALLINT DEFAULT NULL, - `pre_closure_penal_applicable` SMALLINT DEFAULT NULL, - `pre_closure_penal_interest` decimal(19,6) DEFAULT NULL, - `pre_closure_penal_interest_on_enum` SMALLINT DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `FKDPTP00000000000001` (`savings_product_id`), - CONSTRAINT `FKDPTP00000000000001` FOREIGN KEY (`savings_product_id`) REFERENCES `m_savings_product` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - - -CREATE TABLE IF NOT EXISTS `m_deposit_product_recurring_detail` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `savings_product_id` BIGINT NOT NULL DEFAULT '0', - `recurring_deposit_type_enum` SMALLINT DEFAULT NULL, - `recurring_deposit_frequency` INT DEFAULT NULL, - `recurring_deposit_frequency_type_enum` SMALLINT DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `FKDPRD00000000000001` (`savings_product_id`), - CONSTRAINT `FKDPRD00000000000001` FOREIGN KEY (`savings_product_id`) REFERENCES `m_savings_product` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE IF NOT EXISTS `m_savings_account_interest_rate_chart` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `savings_account_id` BIGINT NOT NULL, - `name` varchar(100) DEFAULT NULL, - `description` varchar(200) DEFAULT NULL, - `from_date` date NOT NULL, - `end_date` date DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `FKSAIRC00000000000001` (`savings_account_id`), - CONSTRAINT `FKSAIRC00000000000001` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE IF NOT EXISTS `m_savings_account_interest_rate_slab` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `savings_account_interest_rate_chart_id` BIGINT NOT NULL, - `description` varchar(200) DEFAULT NULL, - `period_type_enum` SMALLINT NOT NULL DEFAULT '1', - `from_period` INT NOT NULL DEFAULT '0', - `to_period` INT DEFAULT NULL, - `amount_range_from` decimal(19,6) DEFAULT NULL, - `amount_range_to` decimal(19,6) DEFAULT NULL, - `annual_interest_rate` decimal(19,6) NOT NULL, - `currency_code` varchar(3) NOT NULL, - PRIMARY KEY (`id`), - KEY `FKSAIRS00000000000001` (`savings_account_interest_rate_chart_id`), - CONSTRAINT `FKSAIRS00000000000001` FOREIGN KEY (`savings_account_interest_rate_chart_id`) REFERENCES `m_savings_account_interest_rate_chart` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE IF NOT EXISTS `m_deposit_account_recurring_detail` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `savings_account_id` BIGINT NOT NULL DEFAULT '0', - `recurring_deposit_amount` decimal(19,6) DEFAULT NULL, - `recurring_deposit_type_enum` SMALLINT DEFAULT NULL, - `recurring_deposit_frequency` INT DEFAULT NULL, - `recurring_deposit_frequency_type_enum` SMALLINT DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `FKDARD00000000000001` (`savings_account_id`), - CONSTRAINT `FKDARD00000000000001` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE IF NOT EXISTS `m_deposit_account_term_and_preclosure` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `savings_account_id` BIGINT NOT NULL DEFAULT '0', - `min_deposit_term` INT DEFAULT NULL, - `max_deposit_term` INT DEFAULT NULL, - `min_deposit_term_type_enum` SMALLINT DEFAULT NULL, - `max_deposit_term_type_enum` SMALLINT DEFAULT NULL, - `in_multiples_of_deposit_term` INT DEFAULT NULL, - `in_multiples_of_deposit_term_type_enum` SMALLINT DEFAULT NULL, - `interest_free_period_applicable` SMALLINT DEFAULT NULL, - `interest_free_from_period` INT DEFAULT NULL, - `interest_free_to_period` INT DEFAULT NULL, - `interest_free_period_frequency_enum` SMALLINT DEFAULT NULL, - `pre_closure_penal_applicable` SMALLINT DEFAULT NULL, - `pre_closure_penal_interest` decimal(19,6) DEFAULT NULL, - `pre_closure_penal_interest_on_enum` SMALLINT DEFAULT NULL, - `deposit_period` INT DEFAULT NULL, - `deposit_period_frequency_enum` SMALLINT DEFAULT NULL, - `deposit_amount` decimal(19,6) DEFAULT NULL, - `maturity_amount` decimal(19,6) DEFAULT NULL, - `maturity_date` date DEFAULT NULL, - `on_account_closure_enum` SMALLINT DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `FKDATP00000000000001` (`savings_account_id`), - CONSTRAINT `FKDATP00000000000001` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - - -ALTER TABLE `m_savings_product` - ADD COLUMN `deposit_type_enum` SMALLINT NOT NULL DEFAULT '100' AFTER `description`; - -ALTER TABLE `m_savings_account` - ADD COLUMN `deposit_type_enum` SMALLINT NOT NULL DEFAULT '100' AFTER `account_type_enum`; - -ALTER TABLE `m_client` - ADD COLUMN `gender_cv_id` INT NULL DEFAULT NULL AFTER `mobile_no`, - ADD COLUMN `date_of_birth` DATE NULL DEFAULT NULL AFTER `gender_cv_id`; - - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_INTERESTRATECHART', 'INTERESTRATECHART', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_INTERESTRATECHART_CHECKER', 'INTERESTRATECHART', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_INTERESTRATECHART', 'INTERESTRATECHART', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_INTERESTRATECHART', 'INTERESTRATECHART', 'DELETE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_INTERESTRATECHART_CHECKER', 'INTERESTRATECHART', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_INTERESTRATECHART_CHECKER', 'INTERESTRATECHART', 'DELETE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_CHARTSLAB', 'CHARTSLAB', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_CHARTSLAB_CHECKER', 'CHARTSLAB', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_CHARTSLAB', 'CHARTSLAB', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_CHARTSLAB', 'CHARTSLAB', 'DELETE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_CHARTSLAB_CHECKER', 'CHARTSLAB', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_CHARTSLAB_CHECKER', 'CHARTSLAB', 'DELETE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_FIXEDDEPOSITPRODUCT', 'FIXEDDEPOSITPRODUCT', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_FIXEDDEPOSITPRODUCT_CHECKER', 'FIXEDDEPOSITPRODUCT', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_FIXEDDEPOSITPRODUCT', 'FIXEDDEPOSITPRODUCT', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_FIXEDDEPOSITPRODUCT', 'FIXEDDEPOSITPRODUCT', 'DELETE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_FIXEDDEPOSITPRODUCT_CHECKER', 'FIXEDDEPOSITPRODUCT', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_FIXEDDEPOSITPRODUCT_CHECKER', 'FIXEDDEPOSITPRODUCT', 'DELETE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_RECURRINGDEPOSITPRODUCT', 'RECURRINGDEPOSITPRODUCT', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_RECURRINGDEPOSITPRODUCT_CHECKER', 'RECURRINGDEPOSITPRODUCT', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_RECURRINGDEPOSITPRODUCT', 'RECURRINGDEPOSITPRODUCT', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_RECURRINGDEPOSITPRODUCT', 'RECURRINGDEPOSITPRODUCT', 'DELETE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_RECURRINGDEPOSITPRODUCT_CHECKER', 'RECURRINGDEPOSITPRODUCT', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_RECURRINGDEPOSITPRODUCT_CHECKER', 'RECURRINGDEPOSITPRODUCT', 'DELETE', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'READ_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'DELETE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'DELETE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'DEPOSIT_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'DEPOSIT', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'DEPOSIT_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'DEPOSIT', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'WITHDRAWAL_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'WITHDRAWAL', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'WITHDRAWAL_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'WITHDRAWAL', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'ACTIVATE_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'ACTIVATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'ACTIVATE_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'ACTIVATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'CALCULATEINTEREST_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'CALCULATEINTEREST', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'CALCULATEINTEREST_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'CALCULATEINTEREST', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'POSTINTEREST_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'POSTINTEREST', 1); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'POSTINTEREST_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'POSTINTEREST', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'APPROVE_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'APPROVE', 1); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'REJECT_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'REJECT', 1); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'WITHDRAW_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'WITHDRAW', 1); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'APPROVALUNDO_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'APPROVALUNDO', 1); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'CLOSE_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'CLOSE', 1); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'APPROVE_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'APPROVE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'REJECT_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'REJECT', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'WITHDRAW_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'WITHDRAW', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'APPROVALUNDO_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'APPROVALUNDO', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'CLOSE_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'CLOSE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'UNDOTRANSACTION_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'UNDOTRANSACTION', 1); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'UNDOTRANSACTION_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'UNDOTRANSACTION', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'ADJUSTTRANSACTION_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'ADJUSTTRANSACTION', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'READ_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'CREATE_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'UPDATE_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'DELETE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'DELETE_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'DELETE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'DEPOSIT_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'DEPOSIT', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'DEPOSIT_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'DEPOSIT', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'WITHDRAWAL_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'WITHDRAWAL', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'WITHDRAWAL_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'WITHDRAWAL', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'ACTIVATE_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'ACTIVATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'ACTIVATE_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'ACTIVATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'CALCULATEINTEREST_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'CALCULATEINTEREST', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'CALCULATEINTEREST_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'CALCULATEINTEREST', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'POSTINTEREST_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'POSTINTEREST', 1); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'POSTINTEREST_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'POSTINTEREST', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'APPROVE_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'APPROVE', 1); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'REJECT_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'REJECT', 1); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'WITHDRAW_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'WITHDRAW', 1); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'APPROVALUNDO_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'APPROVALUNDO', 1); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'CLOSE_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'CLOSE', 1); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'APPROVE_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'APPROVE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'REJECT_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'REJECT', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'WITHDRAW_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'WITHDRAW', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'APPROVALUNDO_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'APPROVALUNDO', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'CLOSE_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'CLOSE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'UNDOTRANSACTION_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'UNDOTRANSACTION', 1); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'UNDOTRANSACTION_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'UNDOTRANSACTION', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'ADJUSTTRANSACTION_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'ADJUSTTRANSACTION', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('transaction_savings', 'PREMATURECLOSE_FIXEDDEPOSITACCOUNT_CHECKER', 'FIXEDDEPOSITACCOUNT', 'PREMATURECLOSE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`) VALUES ('transaction_savings', 'PREMATURECLOSE_FIXEDDEPOSITACCOUNT', 'FIXEDDEPOSITACCOUNT', 'PREMATURECLOSE'); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('transaction_savings', 'PREMATURECLOSE_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'PREMATURECLOSE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`) VALUES ('transaction_savings', 'PREMATURECLOSE_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'PREMATURECLOSE'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V165__added_permission_for_disburse_to_saving_account.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V165__added_permission_for_disburse_to_saving_account.sql deleted file mode 100644 index 152cb24ee..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V165__added_permission_for_disburse_to_saving_account.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('transaction_loan', 'DISBURSETOSAVINGS_LOAN', 'LOAN', 'DISBURSETOSAVINGS', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V166__added_deposit_amount_to_product_term_and_preclosure.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V166__added_deposit_amount_to_product_term_and_preclosure.sql deleted file mode 100644 index 1a0716589..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V166__added_deposit_amount_to_product_term_and_preclosure.sql +++ /dev/null @@ -1,26 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_deposit_product_term_and_preclosure` - ADD COLUMN `min_deposit_amount` DECIMAL(19,6) NULL DEFAULT NULL, - ADD COLUMN `max_deposit_amount` DECIMAL(19,6) NULL DEFAULT NULL, - ADD COLUMN `deposit_amount` DECIMAL(19,6) NULL DEFAULT NULL; - -ALTER TABLE m_deposit_account_term_and_preclosure - ADD COLUMN `expected_firstdepositon_date` DATE NULL DEFAULT NULL; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V167__added_columns_for_writtenOff_loans_recovered.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V167__added_columns_for_writtenOff_loans_recovered.sql deleted file mode 100644 index 73fc973c4..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V167__added_columns_for_writtenOff_loans_recovered.sql +++ /dev/null @@ -1,46 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` ( -`id` , -`grouping` , -`code` , -`entity_name` , -`action_name` , -`can_maker_checker` -) -VALUES ( -NULL , 'transaction_loan', 'RECOVERYPAYMENT_LOAN', 'LOAN', 'RECOVERYPAYMENT', '0' -); - - -Alter table m_loan -add column total_recovered_derived Decimal(19,6); - - -INSERT INTO `acc_gl_account` (`name`, `hierarchy`, `gl_code`,`account_usage`, `classification_enum`,`description`) -select 'Loan Recovery (Temp)', '.', '220002-Temp', 1, 4,'Temporary account to track income from Loan recovery' -FROM m_product_loan WHERE accounting_type != 1 -limit 1; - -INSERT INTO `acc_product_mapping` (`gl_account_id`,`product_id`,`product_type`,`financial_account_type`) -select (select max(id) from acc_gl_account where classification_enum=4 and account_usage=1 LIMIT 1), mapping.product_id, mapping.product_type, 12 -from acc_product_mapping mapping -where mapping.financial_account_type = 4 and mapping.product_type=1 -group by mapping.product_id; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V168__added_transfer_fixed_deposit_interest_to_linked_account.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V168__added_transfer_fixed_deposit_interest_to_linked_account.sql deleted file mode 100644 index 5f5fdc804..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V168__added_transfer_fixed_deposit_interest_to_linked_account.sql +++ /dev/null @@ -1,28 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `job_run_history` - CHANGE COLUMN `error_message` `error_message` TEXT NULL DEFAULT NULL AFTER `status`; - -ALTER TABLE `m_deposit_account_term_and_preclosure` - ADD COLUMN `transfer_interest_to_linked_account` tinyint NOT NULL DEFAULT '0' AFTER `expected_firstdepositon_date`; - -UPDATE `job` SET `scheduler_group`=1 WHERE `name`='Post Interest For Savings'; - -INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Transfer Interest To Savings', 'Transfer Interest To Savings', '0 2 0 1/1 * ? *', now(), 4, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 1, 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V169__update_dashboard_reports_to_core_reports_use_report_to_false.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V169__update_dashboard_reports_to_core_reports_use_report_to_false.sql deleted file mode 100644 index 25d1e1650..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V169__update_dashboard_reports_to_core_reports_use_report_to_false.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -UPDATE stretchy_report SET core_report=1, use_report=0 WHERE report_name in ('ClientTrendsByDay','ClientTrendsByWeek','ClientTrendsByMonth','LoanTrendsByDay','LoanTrendsByWeek','LoanTrendsByMonth','Demand_Vs_Collection','Disbursal_Vs_Awaitingdisbursal'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V16__drop_min_max_column_on_loan_table.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V16__drop_min_max_column_on_loan_table.sql deleted file mode 100644 index bb0911fbd..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V16__drop_min_max_column_on_loan_table.sql +++ /dev/null @@ -1,26 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_loan` - DROP COLUMN `min_principal_amount`, - DROP COLUMN `max_principal_amount`, - DROP COLUMN `min_nominal_interest_rate_per_period`, - DROP COLUMN `max_nominal_interest_rate_per_period`, - DROP COLUMN `min_number_of_repayments`, - DROP COLUMN `max_number_of_repayments`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V170__update_deposit_accounts_maturity_details_job.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V170__update_deposit_accounts_maturity_details_job.sql deleted file mode 100644 index d2d878a18..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V170__update_deposit_accounts_maturity_details_job.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Update Deposit Accounts Maturity details', 'Update Deposit Accounts Maturity details', '0 0 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 0, 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V171__added_mandatory_savings_and_rd_changes.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V171__added_mandatory_savings_and_rd_changes.sql deleted file mode 100644 index 550c7c7ea..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V171__added_mandatory_savings_and_rd_changes.sql +++ /dev/null @@ -1,90 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `c_configuration` (`name`, `value`, `enabled`) VALUES ('age_limit_for_senior_citizen', 65, 1); -INSERT INTO `c_configuration` (`name`, `value`, `enabled`) VALUES ('age_limit_for_children', 15, 1); - - -ALTER TABLE `m_interest_rate_slab` - ADD COLUMN `interest_rate_for_female` DECIMAL(19,6) NULL AFTER `annual_interest_rate`, - ADD COLUMN `interest_rate_for_children` DECIMAL(19,6) NULL AFTER `interest_rate_for_female`, - ADD COLUMN `interest_rate_for_senior_citizen` DECIMAL(19,6) NULL AFTER `interest_rate_for_children`; - -ALTER TABLE `m_savings_account_interest_rate_slab` - ADD COLUMN `interest_rate_for_female` DECIMAL(19,6) NULL AFTER `annual_interest_rate`, - ADD COLUMN `interest_rate_for_children` DECIMAL(19,6) NULL AFTER `interest_rate_for_female`, - ADD COLUMN `interest_rate_for_senior_citizen` DECIMAL(19,6) NULL AFTER `interest_rate_for_children`; - -ALTER TABLE `m_deposit_account_recurring_detail` - CHANGE COLUMN `recurring_deposit_amount` `mandatory_recommended_deposit_amount` DECIMAL(19,6) NULL DEFAULT NULL, - ADD COLUMN `is_mandatory` TINYINT NOT NULL DEFAULT '0', - ADD COLUMN `allow_withdrawal` TINYINT NOT NULL DEFAULT '0', - ADD COLUMN `adjust_advance_towards_future_payments` TINYINT NOT NULL DEFAULT '1', - ADD COLUMN `is_calendar_inherited` TINYINT NOT NULL DEFAULT '0', - ADD COLUMN `total_overdue_amount` DECIMAL(19,6) NULL DEFAULT NULL, - ADD COLUMN `no_of_overdue_installments` INT NULL DEFAULT NULL, - DROP COLUMN `recurring_deposit_type_enum`, - DROP COLUMN `recurring_deposit_frequency`, - DROP COLUMN `recurring_deposit_frequency_type_enum`; - - -ALTER TABLE `m_deposit_product_term_and_preclosure` - DROP COLUMN `interest_free_period_applicable`, - DROP COLUMN `interest_free_from_period`, - DROP COLUMN `interest_free_to_period`, - DROP COLUMN `interest_free_period_frequency_enum`; - -ALTER TABLE `m_deposit_product_recurring_detail` - ADD COLUMN `is_mandatory` tinyint NOT NULL DEFAULT '1', - ADD COLUMN `allow_withdrawal` tinyint NOT NULL DEFAULT '0', - ADD COLUMN `adjust_advance_towards_future_payments` tinyint NOT NULL DEFAULT '1', - DROP COLUMN `recurring_deposit_type_enum`, - DROP COLUMN `recurring_deposit_frequency`, - DROP COLUMN `recurring_deposit_frequency_type_enum`; - -ALTER TABLE `m_deposit_account_term_and_preclosure` - DROP COLUMN `interest_free_period_applicable`, - DROP COLUMN `interest_free_from_period`, - DROP COLUMN `interest_free_to_period`, - DROP COLUMN `interest_free_period_frequency_enum`; - -CREATE TABLE `m_mandatory_savings_schedule` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `savings_account_id` BIGINT NOT NULL, - `fromdate` DATE NULL DEFAULT NULL, - `duedate` DATE NOT NULL, - `installment` SMALLINT NOT NULL, - `deposit_amount` DECIMAL(19,6) NULL DEFAULT NULL, - `deposit_amount_completed_derived` DECIMAL(19,6) NULL DEFAULT NULL, - `total_paid_in_advance_derived` DECIMAL(19,6) NULL DEFAULT NULL, - `total_paid_late_derived` DECIMAL(19,6) NULL DEFAULT NULL, - `completed_derived` BIT(1) NOT NULL, - `obligations_met_on_date` DATE NULL DEFAULT NULL, - `createdby_id` BIGINT NULL DEFAULT NULL, - `created_date` DATETIME NULL DEFAULT NULL, - `lastmodified_date` DATETIME NULL DEFAULT NULL, - `lastmodifiedby_id` BIGINT NULL DEFAULT NULL, - PRIMARY KEY (`id`), - INDEX `FKMSS0000000001` (`savings_account_id`), - CONSTRAINT `FKMSS0000000001` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`) -); - - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('organisation', 'READ_RECURRINGDEPOSITPRODUCT', 'RECURRINGDEPOSITPRODUCT', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('organisation', 'READ_FIXEDDEPOSITPRODUCT', 'FIXEDDEPOSITPRODUCT', 'READ', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V172__accounting_changes_for_transfers.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V172__accounting_changes_for_transfers.sql deleted file mode 100644 index b26c444bf..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V172__accounting_changes_for_transfers.sql +++ /dev/null @@ -1,40 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'READ_OFFICEGLACCOUNT', 'OFFICEGLACCOUNT', 'READ', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'CREATE_OFFICEGLACCOUNT', 'OFFICEGLACCOUNT', 'CREATE', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'DELETE_OFFICEGLACCOUNT', 'OFFICEGLACCOUNT', 'DELETE', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'UPDATE_OFFICEGLACCOUNT', 'OFFICEGLACCOUNT', 'UPDATE', 0); - -CREATE TABLE `acc_gl_office_mapping` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `gl_account_id` BIGINT NOT NULL DEFAULT '0', - `office_id` BIGINT NOT NULL, - `financial_account_type` SMALLINT NOT NULL, - PRIMARY KEY (`id`), - INDEX `FK_office_mapping_acc_gl_account` (`gl_account_id`), - INDEX `FK_office_mapping_office` (`office_id`), - CONSTRAINT `FK_office_mapping_acc_gl_account` FOREIGN KEY (`gl_account_id`) REFERENCES `acc_gl_account` (`id`), - CONSTRAINT `FK_office_mapping_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V173__ppi.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V173__ppi.sql deleted file mode 100644 index d65b8122f..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V173__ppi.sql +++ /dev/null @@ -1,122 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_code_value` -ADD COLUMN `code_score` INT NULL AFTER `order_position`; - - -CREATE TABLE IF NOT EXISTS `ppi_scores` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `score_from` INT NOT NULL, - `score_to` INT NOT NULL, - PRIMARY KEY (`id`) -) COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; - - -INSERT INTO `ppi_scores` ( `score_from`, `score_to`) -VALUES - (0, 4); - - INSERT INTO `ppi_scores` ( `score_from`, `score_to`) -VALUES - (5, 9); - INSERT INTO `ppi_scores` ( `score_from`, `score_to`) -VALUES - (10, 14); - INSERT INTO `ppi_scores` ( `score_from`, `score_to`) -VALUES - (15, 19); - INSERT INTO `ppi_scores` ( `score_from`, `score_to`) -VALUES - (20, 24); - INSERT INTO `ppi_scores` ( `score_from`, `score_to`) -VALUES - (25,29 ); - INSERT INTO `ppi_scores` ( `score_from`, `score_to`) -VALUES - (30, 34); - INSERT INTO `ppi_scores` ( `score_from`, `score_to`) -VALUES - (35, 39); - INSERT INTO `ppi_scores` ( `score_from`, `score_to`) -VALUES - (40, 44); - INSERT INTO `ppi_scores` ( `score_from`, `score_to`) -VALUES - (45, 49); - INSERT INTO `ppi_scores` ( `score_from`, `score_to`) -VALUES - (50, 54); - INSERT INTO `ppi_scores` ( `score_from`, `score_to`) -VALUES - (55, 59); - INSERT INTO `ppi_scores` ( `score_from`, `score_to`) -VALUES - (60,64); - INSERT INTO `ppi_scores` ( `score_from`, `score_to`) -VALUES - (65, 69); - INSERT INTO `ppi_scores` ( `score_from`, `score_to`) -VALUES - (70, 74); - INSERT INTO `ppi_scores` ( `score_from`, `score_to`) -VALUES - (75, 79); - INSERT INTO `ppi_scores` ( `score_from`, `score_to`) -VALUES - (80,84); - INSERT INTO `ppi_scores` ( `score_from`, `score_to`) -VALUES - (85, 89); - INSERT INTO `ppi_scores` ( `score_from`, `score_to`) -VALUES - (90, 94); - INSERT INTO `ppi_scores` ( `score_from`, `score_to`) -VALUES - (95, 100); - - - -CREATE TABLE IF NOT EXISTS `ppi_likelihoods` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `code` varchar(100) NOT NULL, - `name` varchar(250) NOT NULL, - PRIMARY KEY (`id`) -) COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB ; - - - - CREATE TABLE IF NOT EXISTS `ppi_likelihoods_ppi` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `likelihood_id` BIGINT NOT NULL, - `ppi_name` varchar(250) NOT NULL, - `enabled` INT NOT NULL DEFAULT '100', - PRIMARY KEY (`id`) -) COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; - -/**PPI permission**/ -INSERT INTO `m_permission` (`id`, `grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES (NULL, 'datatable', 'UPDATE_LIKELIHOOD', 'likelihood', 'UPDATE', '0'); - -INSERT INTO `m_permission` (`id`, `grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES (NULL, 'survey', 'REGISTER_SURVEY', 'survey', 'CREATE', '0'); - -/**Registered table category**/ -ALTER TABLE `x_registered_table` ADD `category` INT NOT NULL DEFAULT 100; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V174__remove_interest_accrual.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V174__remove_interest_accrual.sql deleted file mode 100644 index d26c2be0c..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V174__remove_interest_accrual.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -/**Remove all existing apply interest transaction Types**/ -update m_loan_transaction set interest_portion_derived=amount where transaction_type_enum=11; -update m_loan_transaction set transaction_type_enum=10 where transaction_type_enum=11; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V175__added_incentive_interest_rates.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V175__added_incentive_interest_rates.sql deleted file mode 100644 index e2f766a69..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V175__added_incentive_interest_rates.sql +++ /dev/null @@ -1,68 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_client` - ADD COLUMN `client_type_cv_id` INT NULL DEFAULT NULL AFTER `default_savings_account`, - ADD COLUMN `client_classification_cv_id` INT NULL DEFAULT NULL AFTER `client_type_cv_id`, - ADD CONSTRAINT `FK_m_client_type_m_code_value` FOREIGN KEY (`client_type_cv_id`) REFERENCES `m_code_value` (`id`), - ADD CONSTRAINT `FK_m_client_classification_m_code_value` FOREIGN KEY (`client_classification_cv_id`) REFERENCES `m_code_value` (`id`), - ADD CONSTRAINT `FK1_m_client_gender_m_code_value` FOREIGN KEY (`gender_cv_id`) REFERENCES `m_code_value` (`id`); - -INSERT INTO `m_code` (`code_name`, `is_system_defined`) VALUES ('ClientType', 1); -INSERT INTO `m_code` (`code_name`, `is_system_defined`) VALUES ('ClientClassification', 1); - - -CREATE TABLE `m_interest_incentives` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `interest_rate_slab_id` BIGINT NOT NULL, - `entiry_type` SMALLINT NOT NULL, - `attribute_name` SMALLINT NOT NULL, - `condition_type` SMALLINT NOT NULL, - `attribute_value` VARCHAR(50) NOT NULL, - `incentive_type` SMALLINT NOT NULL, - `amount` DECIMAL(19,6) NOT NULL, - PRIMARY KEY (`id`), - INDEX `FK_m_interest_incentives_m_interest_rate_slab` (`interest_rate_slab_id`), - CONSTRAINT `FK_m_interest_incentives_m_interest_rate_slab` FOREIGN KEY (`interest_rate_slab_id`) REFERENCES `m_interest_rate_slab` (`id`) -); - - -CREATE TABLE `m_savings_interest_incentives` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `deposit_account_interest_rate_slab_id` BIGINT NOT NULL, - `entiry_type` SMALLINT NOT NULL, - `attribute_name` SMALLINT NOT NULL, - `condition_type` SMALLINT NOT NULL, - `attribute_value` VARCHAR(50) NOT NULL, - `incentive_type` SMALLINT NOT NULL, - `amount` DECIMAL(19,6) NOT NULL, - PRIMARY KEY (`id`), - INDEX `FK_m_savings_interest_incentives_m_savings_interest_rate_slab` (`deposit_account_interest_rate_slab_id`), - CONSTRAINT `FK_m_savings_interest_incentives_m_savings_interest_rate_slab` FOREIGN KEY (`deposit_account_interest_rate_slab_id`) REFERENCES `m_savings_account_interest_rate_slab` (`id`) -); - -ALTER TABLE `m_interest_rate_slab` - DROP COLUMN `interest_rate_for_female`, - DROP COLUMN `interest_rate_for_children`, - DROP COLUMN `interest_rate_for_senior_citizen`; - -ALTER TABLE `m_savings_account_interest_rate_slab` - DROP COLUMN `interest_rate_for_female`, - DROP COLUMN `interest_rate_for_children`, - DROP COLUMN `interest_rate_for_senior_citizen`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V176__updates_to_financial_activity_accounts.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V176__updates_to_financial_activity_accounts.sql deleted file mode 100644 index 5b94271e6..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V176__updates_to_financial_activity_accounts.sql +++ /dev/null @@ -1,34 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE acc_gl_office_mapping DROP FOREIGN KEY `FK_office_mapping_office`; - -ALTER TABLE acc_gl_office_mapping DROP column office_id; - -ALTER TABLE `acc_gl_office_mapping` - ALTER `financial_account_type` DROP DEFAULT; - -ALTER TABLE `acc_gl_office_mapping` - CHANGE COLUMN `financial_account_type` `financial_activity_type` SMALLINT NOT NULL; - -ALTER TABLE `acc_gl_office_mapping` - ADD UNIQUE INDEX `financial_activity_type` (`financial_activity_type`); - - -RENAME TABLE `acc_gl_office_mapping` TO `acc_gl_financial_activity_account`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V177__cleanup_for_client_incentives.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V177__cleanup_for_client_incentives.sql deleted file mode 100644 index b3ad81587..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V177__cleanup_for_client_incentives.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -DELETE FROM `c_configuration` WHERE `name`='age_limit_for_senior_citizen'; -DELETE FROM `c_configuration` WHERE `name`='age_limit_for_children'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V178__updates_to_financial_activity_accounts_pt2.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V178__updates_to_financial_activity_accounts_pt2.sql deleted file mode 100644 index b5138b798..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V178__updates_to_financial_activity_accounts_pt2.sql +++ /dev/null @@ -1,35 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -update m_permission set entity_name="FINANCIALACTIVITYACCOUNT" where entity_name="OFFICEGLACCOUNT"; -update m_permission set code="READ_FINANCIALACTIVITYACCOUNT" where code="READ_OFFICEGLACCOUNT"; -update m_permission set code="CREATE_FINANCIALACTIVITYACCOUNT" where code="CREATE_OFFICEGLACCOUNT"; -update m_permission set code="DELETE_FINANCIALACTIVITYACCOUNT" where code="DELETE_OFFICEGLACCOUNT"; -update m_permission set code="UPDATE_FINANCIALACTIVITYACCOUNT" where code="UPDATE_OFFICEGLACCOUNT"; - -/*Default Account for tracking account transfer*/ -INSERT INTO `acc_gl_account` (`name`, `hierarchy`, `gl_code`,`account_usage`, `classification_enum`,`description`) -select 'Liability Transfer (Temp)', '.', '220004-Temp', 1, 2,'Temporary Liability account to track Account Transfers' -FROM m_product_loan WHERE accounting_type != 1 -limit 1; - -INSERT INTO `acc_gl_financial_activity_account` (`gl_account_id`,`financial_activity_type`) -select (select max(id) from acc_gl_account where classification_enum=2 and account_usage=1 LIMIT 1), 200 -FROM m_product_loan WHERE accounting_type != 1 -limit 1; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V179__updates_to_action_names_for_maker_checker_permissions.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V179__updates_to_action_names_for_maker_checker_permissions.sql deleted file mode 100644 index ffc53e387..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V179__updates_to_action_names_for_maker_checker_permissions.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -UPDATE m_permission -SET action_name = CONCAT(action_name,'_CHECKER') -WHERE code LIKE "%_CHECKER"; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V17__update_stretchy_reporting_ddl.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V17__update_stretchy_reporting_ddl.sql deleted file mode 100644 index 72f0a6877..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V17__update_stretchy_reporting_ddl.sql +++ /dev/null @@ -1,109 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -/* -Reason for all the tmp tables and renames is had mysql problems with foreign keys doing alter table commands -*/ - -CREATE TABLE `stretchy_report_tmp` ( - `id` INT NOT NULL AUTO_INCREMENT, - `report_name` varchar(100) NOT NULL, - `report_type` varchar(20) NOT NULL, - `report_subtype` varchar(20) DEFAULT NULL, - `report_category` varchar(45) DEFAULT NULL, - `report_sql` text, - `description` text, - `core_report` tinyint DEFAULT '0', - `use_report` tinyint DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE KEY `report_name_UNIQUE` (`report_name`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -insert into stretchy_report_tmp -(id, report_name, report_type, report_subtype, report_category, -report_sql, description, core_report, use_report) -select report_id, report_name, report_type, report_subtype, report_category, -report_sql, description, core_report, use_report -from stretchy_report; - -CREATE TABLE `stretchy_parameter_tmp` ( - `id` INT NOT NULL AUTO_INCREMENT, - `parameter_name` varchar(45) NOT NULL, - `parameter_variable` varchar(45) DEFAULT NULL, - `parameter_label` varchar(45) NOT NULL, - `parameter_displayType` varchar(45) NOT NULL, - `parameter_FormatType` varchar(10) NOT NULL, - `parameter_default` varchar(45) NOT NULL, - `special` varchar(1) DEFAULT NULL, - `selectOne` varchar(1) DEFAULT NULL, - `selectAll` varchar(1) DEFAULT NULL, - `parameter_sql` text, - `parent_id` INT DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `name_UNIQUE` (`parameter_name`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -insert into stretchy_parameter_tmp -(id, parameter_name, parameter_variable, parameter_label, parameter_displayType, parameter_FormatType, -parameter_default, special, selectOne, selectAll, parameter_sql, parent_id) -select parameter_id, parameter_name, parameter_variable, parameter_label, parameter_displayType, parameter_FormatType, -parameter_default, special, selectOne, selectAll, parameter_sql, parent_parameter_id -from stretchy_parameter; - -CREATE TABLE `stretchy_report_parameter_tmp` ( - `id` INT NOT NULL AUTO_INCREMENT, - `report_id` INT NOT NULL, - `parameter_id` INT NOT NULL, - `report_parameter_name` varchar(45) DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `report_id_name_UNIQUE` (`report_id`,`report_parameter_name`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -insert into stretchy_report_parameter_tmp(report_id, parameter_id, report_parameter_name) -select report_id, parameter_id, report_parameter_name -from stretchy_report_parameter; - - -ALTER TABLE `stretchy_parameter_tmp` - ADD CONSTRAINT `fk_stretchy_parameter_001` - FOREIGN KEY (`parent_id` ) - REFERENCES `stretchy_parameter_tmp` (`id` ) - ON DELETE RESTRICT ON UPDATE RESTRICT, - ADD INDEX `fk_stretchy_parameter_001_idx` (`parent_id` ASC); - -SET foreign_key_checks = 0; -ALTER TABLE `stretchy_report_parameter_tmp` - ADD CONSTRAINT `fk_report_parameter_001` FOREIGN KEY (`report_id` ) - REFERENCES `stretchy_report_tmp` (`id` ) ON DELETE CASCADE ON UPDATE RESTRICT, - - ADD CONSTRAINT `fk_report_parameter_002` FOREIGN KEY (`parameter_id` ) - REFERENCES `stretchy_parameter_tmp` (`id` ) ON DELETE RESTRICT ON UPDATE RESTRICT, - - ADD INDEX `fk_report_parameter_001_idx` (`report_id` ASC), - ADD INDEX `fk_report_parameter_002_idx` (`parameter_id` ASC) ; -SET foreign_key_checks = 1; - -drop table stretchy_report_parameter; -drop table stretchy_report; -drop table stretchy_parameter; - -rename table -stretchy_report_tmp to stretchy_report, -stretchy_parameter_tmp to stretchy_parameter, -stretchy_report_parameter_tmp to stretchy_report_parameter; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V180__update_report_schemas_for_disbursed_vs_awaitingdisbursal_and_groupnamesbystaff.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V180__update_report_schemas_for_disbursed_vs_awaitingdisbursal_and_groupnamesbystaff.sql deleted file mode 100644 index c79e427e9..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V180__update_report_schemas_for_disbursed_vs_awaitingdisbursal_and_groupnamesbystaff.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -UPDATE `stretchy_report` SET `report_sql`='select awaitinddisbursal.amount-disbursedAmount.amount as amountToBeDisburse, disbursedAmount.amount as disbursedAmount from \n(\nSELECT COUNT(ln.id) AS noOfLoans, \n IFNULL(SUM(ln.principal_amount),0) AS amount\nFROM \nm_office of\nLEFT JOIN m_client cl ON cl.office_id = of.id\nLEFT JOIN m_loan ln ON cl.id = ln.client_id\nWHERE \nln.expected_disbursedon_date = DATE(NOW()) AND \n(ln.loan_status_id=200 OR ln.loan_status_id=300) AND\n of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" )\n) awaitinddisbursal,\n(\nSELECT COUNT(ltrxn.id) as count, \n IFNULL(SUM(ltrxn.amount),0) as amount \nFROM \nm_office of\nLEFT JOIN m_client cl ON cl.office_id = of.id\nLEFT JOIN m_loan ln ON cl.id = ln.client_id\nLEFT JOIN m_loan_transaction ltrxn ON ln.id = ltrxn.loan_id\nWHERE \nltrxn.transaction_date = DATE(NOW()) AND \nltrxn.is_reversed = 0 AND\nltrxn.transaction_type_enum=1 AND\n of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" ) \n) disbursedAmount' WHERE `report_name`='Disbursal_Vs_Awaitingdisbursal'; -UPDATE `stretchy_report` SET `core_report`=1, `use_report`=0 WHERE `report_name`='GroupNamesByStaff'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V181__standing_instruction_logging.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V181__standing_instruction_logging.sql deleted file mode 100644 index b65391906..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V181__standing_instruction_logging.sql +++ /dev/null @@ -1,30 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_account_transfer_standing_instructions_history` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `standing_instruction_id` BIGINT NOT NULL, - `status` VARCHAR(20) NOT NULL, - `execution_time` DATETIME NOT NULL, - `amount` DECIMAL(19,6) NOT NULL, - `error_log` VARCHAR(500) NULL DEFAULT NULL, - PRIMARY KEY (`id`), - INDEX `FK_m_account_transfer_standing_instructions_history` (`standing_instruction_id`), - CONSTRAINT `FK_m_account_transfer_standing_instructions_m_history` FOREIGN KEY (`standing_instruction_id`) REFERENCES `m_account_transfer_standing_instructions` (`id`) -); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V182__added_min_required_balance_to_savings_product.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V182__added_min_required_balance_to_savings_product.sql deleted file mode 100644 index a67b826a9..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V182__added_min_required_balance_to_savings_product.sql +++ /dev/null @@ -1,26 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_savings_product` - ADD COLUMN `min_required_balance` DECIMAL(19,6) NULL AFTER `overdraft_limit`, - ADD COLUMN `allow_overdraft_min_balance` tinyint NOT NULL DEFAULT '0' AFTER `min_required_balance`; - -ALTER TABLE `m_savings_account` - ADD COLUMN `min_required_balance` DECIMAL(19,6) NULL AFTER `account_balance_derived`, - ADD COLUMN `allow_overdraft_min_balance` tinyint NOT NULL DEFAULT '0' AFTER `min_required_balance`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V183__added_min_balance_for_interest_calculation.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V183__added_min_balance_for_interest_calculation.sql deleted file mode 100644 index 04ec0ff55..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V183__added_min_balance_for_interest_calculation.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_savings_product` - ADD COLUMN `min_balance_for_interest_calculation` DECIMAL(19,6) NULL DEFAULT NULL AFTER `allow_overdraft_min_balance`; - -ALTER TABLE `m_savings_account` - ADD COLUMN `min_balance_for_interest_calculation` DECIMAL(19,6) NULL DEFAULT NULL AFTER `allow_overdraft_min_balance`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V184__update_min_required_balance_for_savings_product.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V184__update_min_required_balance_for_savings_product.sql deleted file mode 100644 index 549d9de01..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V184__update_min_required_balance_for_savings_product.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_savings_product` - CHANGE COLUMN `allow_overdraft_min_balance` `enforce_min_required_balance` tinyint NOT NULL DEFAULT '0' AFTER `min_required_balance`; - -ALTER TABLE `m_savings_account` - CHANGE COLUMN `allow_overdraft_min_balance` `enforce_min_required_balance` tinyint NOT NULL DEFAULT '0' AFTER `min_required_balance`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V185__add_accrual_till_date_for_periodic_accrual.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V185__add_accrual_till_date_for_periodic_accrual.sql deleted file mode 100644 index 7614883bb..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V185__add_accrual_till_date_for_periodic_accrual.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_loan` - ADD COLUMN `accrued_till` DATE NULL DEFAULT NULL AFTER `total_recovered_derived`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V186__added_periodic_accrual_job.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V186__added_periodic_accrual_job.sql deleted file mode 100644 index 8df44762b..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V186__added_periodic_accrual_job.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `scheduler_group`) VALUES ('Add Periodic Accrual Transactions', 'Add Periodic Accrual Transactions', '0 2 0 1/1 * ? *', now(), 4, 3); - -UPDATE `job` SET `scheduler_group`=3 WHERE `name`='Add Accrual Transactions'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V187__added_permission_to_periodic_accrual.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V187__added_permission_to_periodic_accrual.sql deleted file mode 100644 index 0bdf17538..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V187__added_permission_to_periodic_accrual.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'EXECUTE_PERIODICACCRUALACCOUNTING', 'PERIODICACCRUALACCOUNTING', 'EXECUTE', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V188__add_savingscharge_inactivate_permissions.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V188__add_savingscharge_inactivate_permissions.sql deleted file mode 100644 index d6b43ebdd..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V188__add_savingscharge_inactivate_permissions.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'INACTIVATE_SAVINGSACCOUNTCHARGE', 'SAVINGSACCOUNTCHARGE', 'INACTIVATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'INACTIVATE_SAVINGSACCOUNTCHARGE_CHECKER', 'SAVINGSACCOUNTCHARGE', 'INACTIVATE_CHECKER', 0); - -ALTER TABLE `m_savings_account_charge` - ADD COLUMN `inactivated_on_date` DATE NULL DEFAULT NULL AFTER `is_active`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V189__m_loan_interest_recalculation_tables.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V189__m_loan_interest_recalculation_tables.sql deleted file mode 100644 index f660c4d5d..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V189__m_loan_interest_recalculation_tables.sql +++ /dev/null @@ -1,50 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_product_loan` - ADD COLUMN `days_in_month_enum` SMALLINT NOT NULL DEFAULT '1' AFTER `overdue_days_for_npa`, - ADD COLUMN `days_in_year_enum` SMALLINT NOT NULL DEFAULT '1' AFTER `days_in_month_enum`, - ADD COLUMN `interest_recalculation_enabled` TINYINT NOT NULL DEFAULT '0' AFTER `days_in_year_enum`; - -ALTER TABLE `m_loan` - ADD COLUMN `days_in_month_enum` SMALLINT NOT NULL DEFAULT '1' AFTER `accrued_till`, - ADD COLUMN `days_in_year_enum` SMALLINT NOT NULL DEFAULT '1' AFTER `days_in_month_enum`, - ADD COLUMN `interest_recalculation_enabled` TINYINT NOT NULL DEFAULT '0' AFTER `days_in_year_enum`; - -CREATE TABLE `m_product_loan_recalculation_details` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `product_id` BIGINT NOT NULL, - `compound_type_enum` SMALLINT NOT NULL, - `reschedule_strategy_enum` SMALLINT NOT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `FK_m_product_loan_m_product_loan_recalculation_details` FOREIGN KEY (`product_id`) REFERENCES `m_product_loan` (`id`) -) -COLLATE='latin1_swedish_ci' -ENGINE=InnoDB; - -CREATE TABLE `m_loan_recalculation_details` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `loan_id` BIGINT NOT NULL, - `compound_type_enum` SMALLINT NOT NULL, - `reschedule_strategy_enum` SMALLINT NOT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `FK_m_loan_m_loan_recalculation_details` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) -) -COLLATE='latin1_swedish_ci' -ENGINE=InnoDB; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V18__update_stretchy_reporting_reportSql.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V18__update_stretchy_reporting_reportSql.sql deleted file mode 100644 index 6ea129a89..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V18__update_stretchy_reporting_reportSql.sql +++ /dev/null @@ -1,25 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -UPDATE `stretchy_parameter` SET `parameter_sql`='select sp.parameter_name, sp.parameter_variable, sp.parameter_label, sp.parameter_displayType, \r sp.parameter_FormatType, sp.parameter_default, sp.selectOne, sp.selectAll, spp.parameter_name as parentParameterName\r from stretchy_parameter sp\r left join stretchy_parameter spp on spp.id = sp.parent_id\r where sp.special is null\r and exists \r (select \'f\' \r from stretchy_report sr\r join stretchy_report_parameter srp on srp.report_id = sr.id\r where sr.report_name in(${reportListing})\r and srp.parameter_id = sp.id\r )\r order by sp.id' WHERE `id`='1002'; - -UPDATE `stretchy_parameter` SET `parameter_sql`='select r.id as report_id, r.report_name, r.report_type, r.report_subtype, r.report_category,\nrp.id as parameter_id, rp.report_parameter_name, p.parameter_name\n from stretchy_report r\n left join stretchy_report_parameter rp on rp.report_id = r.id \n left join stretchy_parameter p on p.id = rp.parameter_id\n where r.use_report is true\n and exists\n ( select \'f\'\n from m_appuser_role ur \n join m_role r on r.id = ur.role_id\n join m_role_permission rp on rp.role_id = r.id\n join m_permission p on p.id = rp.permission_id\n where ur.appuser_id = ${currentUserId}\n and (p.code in (\'ALL_FUNCTIONS_READ\', \'ALL_FUNCTIONS\') or p.code = concat(\"READ_\", r.report_name)) )\n order by r.report_category, r.report_name, rp.id' WHERE `id`='1001'; - -UPDATE `stretchy_parameter` SET `parameter_sql`='select r.id as report_id, r.report_name, r.report_type, r.report_subtype, r.report_category,\n rp.id as parameter_id, rp.report_parameter_name, p.parameter_name\n from stretchy_report r\n left join stretchy_report_parameter rp on rp.report_id = r.id\n left join stretchy_parameter p on p.id = rp.parameter_id\n where r.report_category = \'${reportCategory}\'\n and r.use_report is true\n and exists\n (select \'f\'\n from m_appuser_role ur \n join m_role r on r.id = ur.role_id\n join m_role_permission rp on rp.role_id = r.id\n join m_permission p on p.id = rp.permission_id\n where ur.appuser_id = ${currentUserId}\n and (p.code in (\'ALL_FUNCTIONS_READ\', \'ALL_FUNCTIONS\') or p.code = concat(\"READ_\", r.report_name)) )\n order by r.report_category, r.report_name, rp.id' WHERE `id`='1003'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V190__add_associategroup_disassociategroup_permissions.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V190__add_associategroup_disassociategroup_permissions.sql deleted file mode 100644 index fc061cd53..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V190__add_associategroup_disassociategroup_permissions.sql +++ /dev/null @@ -1,23 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio_center', 'DISASSOCIATEGROUPS_CENTER', 'CENTER', 'DISASSOCIATEGROUPS', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio_center', 'ASSOCIATEGROUPS_CENTER', 'CENTER', 'ASSOCIATEGROUPS', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio_center', 'DISASSOCIATEGROUPS_CENTER_CHECKER', 'CENTER', 'DISASSOCIATEGROUPS_CHECKER', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio_center', 'ASSOCIATEGROUPS_CENTER_CHECKER', 'CENTER', 'ASSOCIATEGROUPS_CHECKER', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V191__update_gl_account_increase_size_of_name_col.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V191__update_gl_account_increase_size_of_name_col.sql deleted file mode 100644 index 3d936e5e5..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V191__update_gl_account_increase_size_of_name_col.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `acc_gl_account` - CHANGE COLUMN `name` `name` VARCHAR(200) NOT NULL AFTER `id`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V192__interest_recalculate_job.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V192__interest_recalculate_job.sql deleted file mode 100644 index b4f1e7e80..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V192__interest_recalculate_job.sql +++ /dev/null @@ -1,26 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `scheduler_group`) VALUES ('Recalculate Interest For Loans', 'Recalculate Interest For Loans', '0 1 0 1/1 * ? *', now(), 4, 3); - -UPDATE `job` SET `scheduler_group`=3 WHERE `name`='Update Non Performing Assets'; - -UPDATE `job` SET `task_priority`=3 WHERE `name`='Add Accrual Transactions'; - -UPDATE `job` SET `task_priority`=2 WHERE `name`='Add Periodic Accrual Transactions'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V193__added_column_joiningDate_for_staff.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V193__added_column_joiningDate_for_staff.sql deleted file mode 100644 index 53e2df3f4..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V193__added_column_joiningDate_for_staff.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -alter table m_staff -add column joining_date date; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V194__added_recalculatedInterestComponent_for_interest_recalculation.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V194__added_recalculatedInterestComponent_for_interest_recalculation.sql deleted file mode 100644 index ddb168f2a..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V194__added_recalculatedInterestComponent_for_interest_recalculation.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_loan_repayment_schedule` - ADD COLUMN `recalculated_interest_component` tinyint NOT NULL DEFAULT '0'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V195__moved_rest_frequency_to_product_level.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V195__moved_rest_frequency_to_product_level.sql deleted file mode 100644 index f14dfb49e..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V195__moved_rest_frequency_to_product_level.sql +++ /dev/null @@ -1,28 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_product_loan_recalculation_details` - ADD COLUMN `rest_frequency_type_enum` SMALLINT NOT NULL AFTER `reschedule_strategy_enum`, - ADD COLUMN `rest_frequency_interval` SMALLINT NOT NULL DEFAULT '0' AFTER `rest_frequency_type_enum`, - ADD COLUMN `rest_freqency_date` DATE NULL DEFAULT NULL AFTER `rest_frequency_interval`; - -ALTER TABLE `m_loan_recalculation_details` - ADD COLUMN `rest_frequency_type_enum` SMALLINT NOT NULL AFTER `reschedule_strategy_enum`, - ADD COLUMN `rest_frequency_interval` SMALLINT NOT NULL DEFAULT '0' AFTER `rest_frequency_type_enum`, - ADD COLUMN `rest_freqency_date` DATE NULL DEFAULT NULL AFTER `rest_frequency_interval`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V196__added_loan_running_balance_to_transactions.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V196__added_loan_running_balance_to_transactions.sql deleted file mode 100644 index 50ce97ab4..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V196__added_loan_running_balance_to_transactions.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_loan_transaction` - ADD COLUMN `outstanding_loan_balance_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `overpayment_portion_derived`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V197__updated_loan_running_balance_of_transactions.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V197__updated_loan_running_balance_of_transactions.sql deleted file mode 100644 index 9861d81f4..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V197__updated_loan_running_balance_of_transactions.sql +++ /dev/null @@ -1,32 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_loan_transaction_temp` ( - `id` BIGINT NOT NULL, - `loan_id` BIGINT NOT NULL, - `amount` DECIMAL(19,6) NOT NULL DEFAULT '0', - `transaction_date` DATE NOT NULL -); - -INSERT INTO m_loan_transaction_temp(`id`,`loan_id`,`transaction_date`,`amount`) select lt.id, lt.loan_id,lt.transaction_date,if(lt.transaction_type_enum = 1 , IFNULL(lt.amount,0),IFNULL(-lt.principal_portion_derived,0)) from m_loan_transaction lt where lt.is_reversed=0; - - -UPDATE m_loan_transaction lt SET lt.outstanding_loan_balance_derived = (select sum(ltt.amount) from m_loan_transaction_temp ltt where ((ltt.transaction_date = lt.transaction_date and ltt.id <= lt.id) or ltt.transaction_date < lt.transaction_date) and ltt.loan_id = lt.loan_id) where lt.transaction_type_enum != 10 and lt.is_reversed = 0; - -DROP TABLE `m_loan_transaction_temp`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V198__loan_rescheduling_tables_and_permissions.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V198__loan_rescheduling_tables_and_permissions.sql deleted file mode 100644 index ec18e3c57..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V198__loan_rescheduling_tables_and_permissions.sql +++ /dev/null @@ -1,92 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -create table m_loan_reschedule_request ( -id BIGINT primary key auto_increment, -loan_id BIGINT not null, -status_enum SMALLINT not null, -reschedule_from_installment SMALLINT not null comment 'Rescheduling will start from this installment', -grace_on_principal SMALLINT null comment 'Number of installments that should be added with 0 principal amount', -grace_on_interest SMALLINT null comment 'Number of installments that should be added with 0 interest rate', -reschedule_from_date date not null comment 'Rescheduling will start from the installment with due date similar to this date.', -extra_terms SMALLINT comment 'Number of extra terms to be added to the schedule', -interest_rate decimal(19,6) null comment 'If provided, the interest rate for the unpaid installments will be recalculated', -recalculate_interest tinyint null comment 'If set to 1, interest will be recalculated starting from the reschedule period.', -adjusted_due_date date null comment 'New due date for the first rescheduled installment', -reschedule_reason_cv_id INT null comment 'ID of code value of reason for rescheduling', -reschedule_reason_comment varchar(500) null comment 'Text provided in addition to the reason code value', -submitted_on_date date not null, -submitted_by_user_id BIGINT not null, -approved_on_date date null, -approved_by_user_id BIGINT null, -rejected_on_date date null, -rejected_by_user_id BIGINT null, -foreign key (loan_id) references m_loan(id), -foreign key (reschedule_reason_cv_id) references m_code_value(id), -foreign key (submitted_by_user_id) references m_appuser(id), -foreign key (approved_by_user_id) references m_appuser(id), -foreign key (rejected_by_user_id) references m_appuser(id) -); - -create table m_loan_repayment_schedule_history ( - id BIGINT primary key auto_increment, - loan_id BIGINT not null, - loan_reschedule_request_id BIGINT null, - fromdate date null, - duedate date not null, - installment SMALLINT not null, - principal_amount decimal(19,6) null, - principal_completed_derived decimal(19,6) null, - principal_writtenoff_derived decimal(19,6) null, - interest_amount decimal(19,6) null, - interest_completed_derived decimal(19,6) null, - interest_writtenoff_derived decimal(19,6) null, - interest_waived_derived decimal(19,6) null, - accrual_interest_derived decimal(19,6) null, - fee_charges_amount decimal(19,6) null, - fee_charges_completed_derived decimal(19,6) null, - fee_charges_writtenoff_derived decimal(19,6) null, - fee_charges_waived_derived decimal(19,6) null, - accrual_fee_charges_derived decimal(19,6) null, - penalty_charges_amount decimal(19,6) null, - penalty_charges_completed_derived decimal(19,6) null, - penalty_charges_writtenoff_derived decimal(19,6) null, - penalty_charges_waived_derived decimal(19,6) null, - accrual_penalty_charges_derived decimal(19,6) null, - total_paid_in_advance_derived decimal(19,6) null, - total_paid_late_derived decimal(19,6) null, - completed_derived bit(1) not null, - obligations_met_on_date date null, - createdby_id BIGINT null, - created_date datetime null, - lastmodified_date datetime null, - lastmodifiedby_id BIGINT null, - foreign key (loan_id) references m_loan(id), - foreign key (loan_reschedule_request_id) references m_loan_reschedule_request(id) -); - -alter table m_loan add rescheduledon_userid BIGINT null after rescheduledon_date; - -insert into `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) values ('loan_reschedule', 'READ_RESCHEDULELOAN', 'RESCHEDULELOAN', 'READ', '0'); - -insert into `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) values ('loan_reschedule', 'CREATE_RESCHEDULELOAN', 'RESCHEDULELOAN', 'CREATE', '0'); - -insert into `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) values ('loan_reschedule', 'REJECT_RESCHEDULELOAN', 'RESCHEDULELOAN', 'REJECT', '0'); - -insert into `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) values ('loan_reschedule', 'APPROVE_RESCHEDULELOAN', 'RESCHEDULELOAN', 'APPROVE', '0'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V199__removed_extra_columns_from_schedule_history.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V199__removed_extra_columns_from_schedule_history.sql deleted file mode 100644 index 356e5fab3..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V199__removed_extra_columns_from_schedule_history.sql +++ /dev/null @@ -1,39 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_loan_repayment_schedule_history` - DROP COLUMN `principal_completed_derived`, - DROP COLUMN `principal_writtenoff_derived`, - DROP COLUMN `interest_completed_derived`, - DROP COLUMN `interest_writtenoff_derived`, - DROP COLUMN `interest_waived_derived`, - DROP COLUMN `accrual_interest_derived`, - DROP COLUMN `fee_charges_completed_derived`, - DROP COLUMN `fee_charges_writtenoff_derived`, - DROP COLUMN `fee_charges_waived_derived`, - DROP COLUMN `accrual_fee_charges_derived`, - DROP COLUMN `penalty_charges_completed_derived`, - DROP COLUMN `penalty_charges_writtenoff_derived`, - DROP COLUMN `penalty_charges_waived_derived`, - DROP COLUMN `accrual_penalty_charges_derived`, - DROP COLUMN `total_paid_in_advance_derived`, - DROP COLUMN `total_paid_late_derived`, - DROP COLUMN `completed_derived`, - DROP COLUMN `obligations_met_on_date`, - ADD COLUMN `version` INT NOT NULL; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V19__report_maintenance_permissions.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V19__report_maintenance_permissions.sql deleted file mode 100644 index a0c5fb34a..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V19__report_maintenance_permissions.sql +++ /dev/null @@ -1,33 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'READ_REPORT', 'REPORT', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'CREATE_REPORT', 'REPORT', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'CREATE_REPORT_CHECKER', 'REPORT', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'UPDATE_REPORT', 'REPORT', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'UPDATE_REPORT_CHECKER', 'REPORT', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'DELETE_REPORT', 'REPORT', 'DELETE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'DELETE_REPORT_CHECKER', 'REPORT', 'DELETE', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V1__mifosplatform-core-ddl-latest.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V1__mifosplatform-core-ddl-latest.sql deleted file mode 100644 index 11577bef9..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V1__mifosplatform-core-ddl-latest.sql +++ /dev/null @@ -1,965 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - --- drop tables in base-schema -SET foreign_key_checks = 0; - --- drop accounting subsystem -DROP TABLE IF EXISTS `acc_gl_account`; -DROP TABLE IF EXISTS `acc_gl_closure`; -DROP TABLE IF EXISTS `acc_gl_journal_entry`; -DROP TABLE IF EXISTS `acc_product_mapping`; - --- drop portfolio subsystem -DROP TABLE IF EXISTS `c_configuration`; -DROP TABLE IF EXISTS `m_appuser`; -DROP TABLE IF EXISTS `m_appuser_role`; -DROP TABLE IF EXISTS `m_calendar`; -DROP TABLE IF EXISTS `m_calendar_instance`; -DROP TABLE IF EXISTS `m_charge`; -DROP TABLE IF EXISTS `m_client`; -DROP TABLE IF EXISTS `m_client_identifier`; -DROP TABLE IF EXISTS `m_code`; -DROP TABLE IF EXISTS `m_code_value`; -DROP TABLE IF EXISTS `m_currency`; -DROP TABLE IF EXISTS `m_deposit_account`; -DROP TABLE IF EXISTS `m_deposit_account_transaction`; -DROP TABLE IF EXISTS `m_document`; -DROP TABLE IF EXISTS `m_fund`; -DROP TABLE IF EXISTS `m_group`; -DROP TABLE IF EXISTS `m_group_level`; -DROP TABLE IF EXISTS `m_group_client`; -DROP TABLE IF EXISTS `m_guarantor`; -DROP TABLE IF EXISTS `m_loan`; -DROP TABLE IF EXISTS `m_loan_charge`; -DROP TABLE IF EXISTS `m_loan_arrears_aging`; -DROP TABLE IF EXISTS `m_loan_collateral`; -DROP TABLE IF EXISTS `m_loan_officer_assignment_history`; -DROP TABLE IF EXISTS `m_loan_repayment_schedule`; -DROP TABLE IF EXISTS `m_loan_transaction`; -DROP TABLE IF EXISTS `m_note`; -DROP TABLE IF EXISTS `m_office`; -DROP TABLE IF EXISTS `m_office_transaction`; -DROP TABLE IF EXISTS `m_organisation_currency`; -DROP TABLE IF EXISTS `m_permission`; -DROP TABLE IF EXISTS `m_portfolio_command_source`; -DROP TABLE IF EXISTS `m_product_deposit`; -DROP TABLE IF EXISTS `m_product_loan`; -DROP TABLE IF EXISTS `m_product_loan_charge`; -DROP TABLE IF EXISTS `m_role`; -DROP TABLE IF EXISTS `m_role_permission`; -DROP TABLE IF EXISTS `m_savings_account`; -DROP TABLE IF EXISTS `m_savings_account_transaction`; -DROP TABLE IF EXISTS `m_savings_product`; -DROP TABLE IF EXISTS `m_staff`; -DROP TABLE IF EXISTS `ref_loan_transaction_processing_strategy`; -DROP TABLE IF EXISTS `x_registered_table`; - --- drop reporting related tables -DROP TABLE IF EXISTS `r_enum_value`; -DROP TABLE IF EXISTS `rpt_sequence`; -DROP TABLE IF EXISTS `stretchy_parameter`; -DROP TABLE IF EXISTS `stretchy_report`; -DROP TABLE IF EXISTS `stretchy_report_parameter`; - -SET foreign_key_checks = 1; - --- DDL for reference/lookup tables -CREATE TABLE `m_currency` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `code` varchar(3) NOT NULL, - `decimal_places` SMALLINT NOT NULL, - `display_symbol` varchar(10) DEFAULT NULL, - `name` varchar(50) NOT NULL, - `internationalized_name_code` varchar(50) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `code` (`code`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_organisation_currency` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `code` varchar(3) NOT NULL, - `decimal_places` SMALLINT NOT NULL, - `name` varchar(50) NOT NULL, - `display_symbol` varchar(10) DEFAULT NULL, - `internationalized_name_code` varchar(50) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `ref_loan_transaction_processing_strategy` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `code` varchar(100) DEFAULT NULL, - `name` varchar(255) DEFAULT NULL, - `createdby_id` BIGINT DEFAULT NULL, - `created_date` datetime DEFAULT NULL, - `lastmodifiedby_id` BIGINT DEFAULT NULL, - `lastmodified_date` datetime DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `ltp_strategy_code` (`code`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `c_configuration` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `name` varchar(50) DEFAULT NULL, - `enabled` tinyint NOT NULL DEFAULT '0', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_code` ( - `id` INT NOT NULL AUTO_INCREMENT, - `code_name` varchar(100) DEFAULT NULL, - `is_system_defined` tinyint NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE KEY `code_name` (`code_name`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_code_value` ( - `id` INT NOT NULL AUTO_INCREMENT, - `code_id` INT NOT NULL, - `code_value` varchar(100) DEFAULT NULL, - `order_position` INT NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE KEY `code_value` (`code_id`,`code_value`), - KEY `FKCFCEA42640BE071Z` (`code_id`), - CONSTRAINT `FKCFCEA42640BE071Z` FOREIGN KEY (`code_id`) REFERENCES `m_code` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_document` ( - `id` INT NOT NULL AUTO_INCREMENT, - `parent_entity_type` varchar(50) NOT NULL, - `parent_entity_id` INT NOT NULL DEFAULT '0', - `name` varchar(250) NOT NULL, - `file_name` varchar(250) NOT NULL, - `size` INT DEFAULT '0', - `type` varchar(50) DEFAULT NULL, - `description` varchar(1000) DEFAULT NULL, - `location` varchar(500) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -/*not a major table - just intended for database reporting use for enums and values that would be hidden in java*/ -CREATE TABLE `r_enum_value` ( - `enum_name` varchar(100) NOT NULL, - `enum_id` INT NOT NULL, - `enum_message_property` varchar(100) NOT NULL, - `enum_value` varchar(100) NOT NULL, - PRIMARY KEY (`enum_name`,`enum_id`), - UNIQUE KEY `enum_message_property` (`enum_name`,`enum_message_property`), - UNIQUE KEY `enum_value` (`enum_name`,`enum_value`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -/* used to link MySql tables to Mifos X application tables for additional data needs */ -CREATE TABLE `x_registered_table` ( - `registered_table_name` varchar(50) NOT NULL, - `application_table_name` varchar(50) NOT NULL, - PRIMARY KEY (`registered_table_name`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE IF NOT EXISTS `m_calendar` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `title` varchar(50) NOT NULL, - `description` varchar(100) DEFAULT NULL, - `location` varchar(50) DEFAULT NULL, - `start_date` date NOT NULL, - `end_date` date DEFAULT NULL, - `duration` SMALLINT DEFAULT NULL, - `calendar_type_enum` SMALLINT NOT NULL, - `repeating` tinyint NOT NULL DEFAULT '0', - `recurrence` varchar(100) DEFAULT NULL, - `remind_by_enum` SMALLINT DEFAULT NULL, - `first_reminder` smallint DEFAULT NULL, - `second_reminder` smallint DEFAULT NULL, - `createdby_id` BIGINT DEFAULT NULL, - `lastmodifiedby_id` BIGINT DEFAULT NULL, - `created_date` datetime DEFAULT NULL, - `lastmodified_date` datetime DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE IF NOT EXISTS `m_calendar_instance` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `calendar_id` BIGINT NOT NULL, - `entity_id` BIGINT NOT NULL, - `entity_type_enum` SMALLINT NOT NULL, - PRIMARY KEY (`id`), - KEY `FK_m_calendar_m_calendar_instance` (`calendar_id`), - CONSTRAINT `FK_m_calendar_m_calendar_instance` FOREIGN KEY (`calendar_id`) REFERENCES `m_calendar` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - --- ================= end of reference/lookup tables ============= - --- DDL for office related tables -CREATE TABLE `m_office` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `parent_id` BIGINT DEFAULT NULL, - `hierarchy` varchar(100) DEFAULT NULL, - `external_id` varchar(100) DEFAULT NULL, - `name` varchar(50) NOT NULL, - `opening_date` date NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `name_org` (`name`), - UNIQUE KEY `externalid_org` (`external_id`), - KEY `FK2291C477E2551DCC` (`parent_id`), - CONSTRAINT `FK2291C477E2551DCC` FOREIGN KEY (`parent_id`) REFERENCES `m_office` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_office_transaction` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `from_office_id` BIGINT DEFAULT NULL, - `to_office_id` BIGINT DEFAULT NULL, - `currency_code` varchar(3) NOT NULL, - `currency_digits` INT NOT NULL, - `transaction_amount` decimal(19,6) NOT NULL, - `transaction_date` date NOT NULL, - `description` varchar(100) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `FK1E37728B93C6C1B6` (`to_office_id`), - KEY `FK1E37728B783C5C25` (`from_office_id`), - CONSTRAINT `FK1E37728B783C5C25` FOREIGN KEY (`from_office_id`) REFERENCES `m_office` (`id`), - CONSTRAINT `FK1E37728B93C6C1B6` FOREIGN KEY (`to_office_id`) REFERENCES `m_office` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - --- ============ end of office related tables ========== - --- DDL for admin tables -CREATE TABLE `m_permission` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `grouping` varchar(45) DEFAULT NULL, - `code` varchar(100) NOT NULL, - `entity_name` varchar(100) DEFAULT NULL, - `action_name` varchar(100) DEFAULT NULL, - `can_maker_checker` tinyint NOT NULL DEFAULT '1', - PRIMARY KEY (`id`), - UNIQUE KEY `code` (`code`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_role` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `name` varchar(100) NOT NULL, - `description` varchar(500) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `unq_name` (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_role_permission` ( - `role_id` BIGINT NOT NULL, - `permission_id` BIGINT NOT NULL, - PRIMARY KEY (`role_id`,`permission_id`), - KEY `FK8DEDB04815CEC7AB` (`role_id`), - KEY `FK8DEDB048103B544B` (`permission_id`), - CONSTRAINT `FK8DEDB048103B544B` FOREIGN KEY (`permission_id`) REFERENCES `m_permission` (`id`), - CONSTRAINT `FK8DEDB04815CEC7AB` FOREIGN KEY (`role_id`) REFERENCES `m_role` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_appuser` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `is_deleted` tinyint NOT NULL DEFAULT '0', - `office_id` BIGINT DEFAULT NULL, - `username` varchar(100) NOT NULL, - `firstname` varchar(100) NOT NULL, - `lastname` varchar(100) NOT NULL, - `password` varchar(255) NOT NULL, - `email` varchar(100) NOT NULL, - `firsttime_login_remaining` bit(1) NOT NULL, - `nonexpired` bit(1) NOT NULL, - `nonlocked` bit(1) NOT NULL, - `nonexpired_credentials` bit(1) NOT NULL, - `enabled` bit(1) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `username_org` (`username`), - KEY `FKB3D587CE0DD567A` (`office_id`), - CONSTRAINT `FKB3D587CE0DD567A` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_appuser_role` ( - `appuser_id` BIGINT NOT NULL, - `role_id` BIGINT NOT NULL, - PRIMARY KEY (`appuser_id`,`role_id`), - KEY `FK7662CE59B4100309` (`appuser_id`), - KEY `FK7662CE5915CEC7AB` (`role_id`), - CONSTRAINT `FK7662CE5915CEC7AB` FOREIGN KEY (`role_id`) REFERENCES `m_role` (`id`), - CONSTRAINT `FK7662CE59B4100309` FOREIGN KEY (`appuser_id`) REFERENCES `m_appuser` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - --- ================ end of user admin tables =============== - --- DDL for organisation wide related concepts -CREATE TABLE `m_portfolio_command_source` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `action_name` varchar(50) NOT NULL, - `entity_name` varchar(50) NOT NULL, - `office_id` BIGINT DEFAULT NULL, - `group_id` BIGINT DEFAULT NULL, - `client_id` BIGINT DEFAULT NULL, - `loan_id` BIGINT DEFAULT NULL, - `savings_account_id` BIGINT DEFAULT NULL, - `api_get_url` varchar(100) NOT NULL, - `resource_id` BIGINT DEFAULT NULL, - `subresource_id` BIGINT DEFAULT NULL, - `command_as_json` text NOT NULL, - `maker_id` BIGINT NOT NULL, - `made_on_date` datetime NOT NULL, - `checker_id` BIGINT DEFAULT NULL, - `checked_on_date` datetime DEFAULT NULL, - `processing_result_enum` SMALLINT NOT NULL, - PRIMARY KEY (`id`), - KEY `FK_m_maker_m_appuser` (`maker_id`), - KEY `FK_m_checker_m_appuser` (`checker_id`), - KEY `action_name` (`action_name`), - KEY `entity_name` (`entity_name`,`resource_id`), - KEY `made_on_date` (`made_on_date`), - KEY `checked_on_date` (`checked_on_date`), - KEY `processing_result_enum` (`processing_result_enum`), - KEY `office_id` (`office_id`), - KEY `group_id` (`office_id`), - KEY `client_id` (`office_id`), - KEY `loan_id` (`office_id`), - CONSTRAINT `FK_m_checker_m_appuser` FOREIGN KEY (`checker_id`) REFERENCES `m_appuser` (`id`), - CONSTRAINT `FK_m_maker_m_appuser` FOREIGN KEY (`maker_id`) REFERENCES `m_appuser` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_charge` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `name` varchar(100) DEFAULT NULL, - `currency_code` varchar(3) NOT NULL, - `charge_applies_to_enum` SMALLINT NOT NULL, - `charge_time_enum` SMALLINT NOT NULL, - `charge_calculation_enum` SMALLINT NOT NULL, - `amount` decimal(19,6) NOT NULL, - `is_penalty` tinyint NOT NULL DEFAULT '0', - `is_active` tinyint NOT NULL, - `is_deleted` tinyint NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_fund` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `name` varchar(255) DEFAULT NULL, - `external_id` varchar(100) DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `fund_name_org` (`name`), - UNIQUE KEY `fund_externalid_org` (`external_id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_staff` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `is_loan_officer` tinyint NOT NULL DEFAULT '0', - `office_id` BIGINT DEFAULT NULL, - `firstname` varchar(50) DEFAULT NULL, - `lastname` varchar(50) DEFAULT NULL, - `display_name` varchar(100) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `display_name` (`display_name`), - KEY `FK_m_staff_m_office` (`office_id`), - CONSTRAINT `FK_m_staff_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - --- ============ end of organisation wide related tables =========== - --- DDL client/group related tables -CREATE TABLE `m_group_level` ( -`id` INT NOT NULL AUTO_INCREMENT, -`parent_id` INT NULL DEFAULT NULL, -`super_parent` tinyint NOT NULL, -`level_name` VARCHAR(100) NOT NULL, -`recursable` tinyint NOT NULL, -`can_have_clients` tinyint NOT NULL, -PRIMARY KEY (`id`), -INDEX `Parent_levelId_reference` (`parent_id`), -CONSTRAINT `Parent_levelId_reference` FOREIGN KEY (`parent_id`) REFERENCES `m_group_level` (`id`) -)ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_group` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `office_id` BIGINT NOT NULL, - `staff_id` BIGINT DEFAULT NULL, - `parent_id` BIGINT NULL DEFAULT NULL, - `level_Id` INT NOT NULL, - `hierarchy` VARCHAR(100) NULL DEFAULT NULL, - `name` varchar(100) NOT NULL, - `external_id` varchar(100) DEFAULT NULL, - `is_deleted` tinyint NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`, `level_id`), - UNIQUE KEY `external_id` (`external_id`, `level_Id`), - KEY `office_id` (`office_id`), - KEY `staff_id` (`staff_id`), - CONSTRAINT `m_group_ibfk_1` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`), - CONSTRAINT `Parent_Id_reference` FOREIGN KEY (`parent_id`) REFERENCES `m_group` (`id`), - CONSTRAINT `FK_m_group_level` FOREIGN KEY (`level_Id`) REFERENCES `m_group_level` (`id`), - CONSTRAINT `FK_m_group_m_staff` FOREIGN KEY (`staff_id`) REFERENCES `m_staff` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_client` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `account_no` varchar(20) NOT NULL, - `office_id` BIGINT NOT NULL, - `external_id` varchar(100) DEFAULT NULL, - `firstname` varchar(50) DEFAULT NULL, - `middlename` varchar(50) DEFAULT NULL, - `lastname` varchar(50) DEFAULT NULL, - `fullname` varchar(100) DEFAULT NULL, - `display_name` varchar(100) NOT NULL, - `image_key` varchar(500) DEFAULT NULL, - `joined_date` date DEFAULT NULL, - `is_deleted` tinyint NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE KEY `account_no_UNIQUE` (`account_no`), - UNIQUE KEY `external_id` (`external_id`), - KEY `FKCE00CAB3E0DD567A` (`office_id`), - CONSTRAINT `FKCE00CAB3E0DD567A` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_client_identifier` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `client_id` BIGINT NOT NULL, - `document_type_id` INT NOT NULL, - `document_key` varchar(50) NOT NULL, - `description` varchar(500) DEFAULT NULL, - `createdby_id` BIGINT DEFAULT NULL, - `lastmodifiedby_id` BIGINT DEFAULT NULL, - `created_date` datetime DEFAULT NULL, - `lastmodified_date` datetime DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `unique_identifier_key` (`document_type_id`,`document_key`), - UNIQUE KEY `unique_client_identifier` (`client_id`,`document_type_id`), - KEY `FK_m_client_document_m_client` (`client_id`), - KEY `FK_m_client_document_m_code_value` (`document_type_id`), - CONSTRAINT `FK_m_client_document_m_client` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`), - CONSTRAINT `FK_m_client_document_m_code_value` FOREIGN KEY (`document_type_id`) REFERENCES `m_code_value` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_group_client` ( - `group_id` BIGINT NOT NULL, - `client_id` BIGINT NOT NULL, - PRIMARY KEY (`group_id`,`client_id`), - KEY `client_id` (`client_id`), - CONSTRAINT `m_group_client_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `m_group` (`id`), - CONSTRAINT `m_group_client_ibfk_2` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - --- ==== end of client/group related tables ========== - --- DDL for loan and loan related tables -CREATE TABLE `m_product_loan` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `currency_code` varchar(3) NOT NULL, - `currency_digits` SMALLINT NOT NULL, - `principal_amount` decimal(19,6) NOT NULL, - `arrearstolerance_amount` decimal(19,6) DEFAULT NULL, - `name` varchar(100) NOT NULL, - `description` varchar(500) DEFAULT NULL, - `fund_id` BIGINT DEFAULT NULL, - `nominal_interest_rate_per_period` decimal(19,6) NOT NULL, - `interest_period_frequency_enum` SMALLINT NOT NULL, - `annual_nominal_interest_rate` decimal(19,6) NOT NULL, - `interest_method_enum` SMALLINT NOT NULL, - `interest_calculated_in_period_enum` SMALLINT NOT NULL DEFAULT '1', - `repay_every` SMALLINT NOT NULL, - `repayment_period_frequency_enum` SMALLINT NOT NULL, - `number_of_repayments` SMALLINT NOT NULL, - `amortization_method_enum` SMALLINT NOT NULL, - `accounting_type` SMALLINT NOT NULL, - `loan_transaction_strategy_id` BIGINT DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `unq_name` (`name`), - KEY `FKA6A8A7D77240145` (`fund_id`), - KEY `FK_ltp_strategy` (`loan_transaction_strategy_id`), - CONSTRAINT `FKA6A8A7D77240145` FOREIGN KEY (`fund_id`) REFERENCES `m_fund` (`id`), - CONSTRAINT `FK_ltp_strategy` FOREIGN KEY (`loan_transaction_strategy_id`) REFERENCES `ref_loan_transaction_processing_strategy` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_product_loan_charge` ( - `product_loan_id` BIGINT NOT NULL, - `charge_id` BIGINT NOT NULL, - PRIMARY KEY (`product_loan_id`,`charge_id`), - KEY `charge_id` (`charge_id`), - CONSTRAINT `m_product_loan_charge_ibfk_1` FOREIGN KEY (`charge_id`) REFERENCES `m_charge` (`id`), - CONSTRAINT `m_product_loan_charge_ibfk_2` FOREIGN KEY (`product_loan_id`) REFERENCES `m_product_loan` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_loan` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `account_no` varchar(20) NOT NULL, - `external_id` varchar(100) DEFAULT NULL, - `client_id` BIGINT DEFAULT NULL, - `group_id` BIGINT DEFAULT NULL, - `product_id` BIGINT DEFAULT NULL, - `fund_id` BIGINT DEFAULT NULL, - `loan_officer_id` BIGINT DEFAULT NULL, - `loanpurpose_cv_id` INT DEFAULT NULL, - `loan_status_id` SMALLINT NOT NULL, - `currency_code` varchar(3) NOT NULL, - `currency_digits` SMALLINT NOT NULL, - `principal_amount` decimal(19,6) NOT NULL, - `arrearstolerance_amount` decimal(19,6) DEFAULT NULL, - `nominal_interest_rate_per_period` decimal(19,6) NOT NULL, - `interest_period_frequency_enum` SMALLINT NOT NULL, - `annual_nominal_interest_rate` decimal(19,6) NOT NULL, - `interest_method_enum` SMALLINT NOT NULL, - `interest_calculated_in_period_enum` SMALLINT NOT NULL DEFAULT '1', - `term_frequency` SMALLINT NOT NULL DEFAULT '0', - `term_period_frequency_enum` SMALLINT NOT NULL DEFAULT '2', - `repay_every` SMALLINT NOT NULL, - `repayment_period_frequency_enum` SMALLINT NOT NULL, - `number_of_repayments` SMALLINT NOT NULL, - `amortization_method_enum` SMALLINT NOT NULL, - `submittedon_date` date DEFAULT NULL, - `submittedon_userid` BIGINT DEFAULT NULL, - `approvedon_date` date DEFAULT NULL, - `approvedon_userid` BIGINT DEFAULT NULL, - `expected_disbursedon_date` date DEFAULT NULL, - `expected_firstrepaymenton_date` date DEFAULT NULL, - `interest_calculated_from_date` date DEFAULT NULL, - `disbursedon_date` date DEFAULT NULL, - `disbursedon_userid` BIGINT DEFAULT NULL, - `expected_maturedon_date` date DEFAULT NULL, - `maturedon_date` date DEFAULT NULL, - `closedon_date` date DEFAULT NULL, - `closedon_userid` BIGINT DEFAULT NULL, - `total_charges_due_at_disbursement_derived` decimal(19,6) DEFAULT NULL, - `principal_disbursed_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `principal_repaid_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `principal_writtenoff_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `principal_outstanding_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `interest_charged_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `interest_repaid_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `interest_waived_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `interest_writtenoff_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `interest_outstanding_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `fee_charges_charged_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `fee_charges_repaid_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `fee_charges_waived_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `fee_charges_writtenoff_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `fee_charges_outstanding_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `penalty_charges_charged_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `penalty_charges_repaid_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `penalty_charges_waived_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `penalty_charges_writtenoff_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `penalty_charges_outstanding_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `total_expected_repayment_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `total_repayment_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `total_expected_costofloan_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `total_costofloan_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `total_waived_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `total_writtenoff_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `total_outstanding_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `rejectedon_date` date DEFAULT NULL, - `rejectedon_userid` BIGINT DEFAULT NULL, - `rescheduledon_date` date DEFAULT NULL, - `withdrawnon_date` date DEFAULT NULL, - `withdrawnon_userid` BIGINT DEFAULT NULL, - `writtenoffon_date` date DEFAULT NULL, - `loan_transaction_strategy_id` BIGINT DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `loan_account_no_UNIQUE` (`account_no`), - UNIQUE KEY `loan_externalid_UNIQUE` (`external_id`), - KEY `FKB6F935D87179A0CB` (`client_id`), - KEY `FKB6F935D8C8D4B434` (`product_id`), - KEY `FK7C885877240145` (`fund_id`), - KEY `FK_loan_ltp_strategy` (`loan_transaction_strategy_id`), - KEY `FK_m_loan_m_staff` (`loan_officer_id`), - KEY `group_id` (`group_id`), - KEY `FK_m_loanpurpose_codevalue` (`loanpurpose_cv_id`), - KEY `FK_submittedon_userid` (`submittedon_userid`), - KEY `FK_approvedon_userid` (`approvedon_userid`), - KEY `FK_rejectedon_userid` (`rejectedon_userid`), - KEY `FK_withdrawnon_userid` (`withdrawnon_userid`), - KEY `FK_disbursedon_userid` (`disbursedon_userid`), - KEY `FK_closedon_userid` (`closedon_userid`), - CONSTRAINT `FK7C885877240145` FOREIGN KEY (`fund_id`) REFERENCES `m_fund` (`id`), - CONSTRAINT `FKB6F935D87179A0CB` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`), - CONSTRAINT `FKB6F935D8C8D4B434` FOREIGN KEY (`product_id`) REFERENCES `m_product_loan` (`id`), - CONSTRAINT `FK_approvedon_userid` FOREIGN KEY (`approvedon_userid`) REFERENCES `m_appuser` (`id`), - CONSTRAINT `FK_closedon_userid` FOREIGN KEY (`closedon_userid`) REFERENCES `m_appuser` (`id`), - CONSTRAINT `FK_disbursedon_userid` FOREIGN KEY (`disbursedon_userid`) REFERENCES `m_appuser` (`id`), - CONSTRAINT `FK_loan_ltp_strategy` FOREIGN KEY (`loan_transaction_strategy_id`) REFERENCES `ref_loan_transaction_processing_strategy` (`id`), - CONSTRAINT `FK_m_loanpurpose_codevalue` FOREIGN KEY (`loanpurpose_cv_id`) REFERENCES `m_code_value` (`id`), - CONSTRAINT `FK_m_loan_m_staff` FOREIGN KEY (`loan_officer_id`) REFERENCES `m_staff` (`id`), - CONSTRAINT `FK_rejectedon_userid` FOREIGN KEY (`rejectedon_userid`) REFERENCES `m_appuser` (`id`), - CONSTRAINT `FK_submittedon_userid` FOREIGN KEY (`submittedon_userid`) REFERENCES `m_appuser` (`id`), - CONSTRAINT `FK_withdrawnon_userid` FOREIGN KEY (`withdrawnon_userid`) REFERENCES `m_appuser` (`id`), - CONSTRAINT `m_loan_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `m_group` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_loan_arrears_aging` ( - `loan_id` BIGINT NOT NULL AUTO_INCREMENT, - `principal_overdue_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `interest_overdue_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `fee_charges_overdue_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `penalty_charges_overdue_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `total_overdue_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `overdue_since_date_derived` date DEFAULT NULL, - PRIMARY KEY (`loan_id`), - CONSTRAINT `m_loan_arrears_aging_ibfk_1` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_guarantor` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `loan_id` BIGINT NOT NULL, - `client_reln_cv_id` INT DEFAULT NULL, - `type_enum` SMALLINT NOT NULL, - `entity_id` BIGINT NULL DEFAULT NULL, - `firstname` VARCHAR(50) NULL DEFAULT NULL, - `lastname` VARCHAR(50) NULL DEFAULT NULL, - `dob` DATE NULL DEFAULT NULL, - `address_line_1` VARCHAR(500) NULL DEFAULT NULL, - `address_line_2` VARCHAR(500) NULL DEFAULT NULL, - `city` VARCHAR(50) NULL DEFAULT NULL, - `state` VARCHAR(50) NULL DEFAULT NULL, - `country` VARCHAR(50) NULL DEFAULT NULL, - `zip` VARCHAR(20) NULL DEFAULT NULL, - `house_phone_number` VARCHAR(20) NULL DEFAULT NULL, - `mobile_number` VARCHAR(20) NULL DEFAULT NULL, - `comment` VARCHAR(500) NULL DEFAULT NULL, - PRIMARY KEY (`id`), - INDEX `FK_m_guarantor_m_loan` (`loan_id`), - CONSTRAINT `FK_m_guarantor_m_code_value` FOREIGN KEY (`client_reln_cv_id`) REFERENCES `m_code_value` (`id`), - CONSTRAINT `FK_m_guarantor_m_loan` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_loan_charge` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `loan_id` BIGINT NOT NULL, - `charge_id` BIGINT NOT NULL, - `is_penalty` tinyint NOT NULL DEFAULT '0', - `charge_time_enum` SMALLINT NOT NULL, - `due_for_collection_as_of_date` date DEFAULT NULL, - `charge_calculation_enum` SMALLINT NOT NULL, - `calculation_percentage` decimal(19,6) DEFAULT NULL, - `calculation_on_amount` decimal(19,6) DEFAULT NULL, - `amount` decimal(19,6) NOT NULL, - `amount_paid_derived` decimal(19,6) DEFAULT NULL, - `amount_waived_derived` decimal(19,6) DEFAULT NULL, - `amount_writtenoff_derived` decimal(19,6) DEFAULT NULL, - `amount_outstanding_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `is_paid_derived` tinyint NOT NULL DEFAULT '0', - `waived` tinyint NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - KEY `charge_id` (`charge_id`), - KEY `m_loan_charge_ibfk_2` (`loan_id`), - CONSTRAINT `m_loan_charge_ibfk_1` FOREIGN KEY (`charge_id`) REFERENCES `m_charge` (`id`), - CONSTRAINT `m_loan_charge_ibfk_2` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_loan_collateral` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `loan_id` BIGINT NOT NULL, - `type_cv_id` INT NOT NULL, - `value` DECIMAL(19,6) DEFAULT NULL, - `description` varchar(500) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `FK_collateral_m_loan` (`loan_id`), - KEY `FK_collateral_code_value` (`type_cv_id`), - CONSTRAINT `FK_collateral_m_loan` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`), - CONSTRAINT `FK_collateral_code_value` FOREIGN KEY (`type_cv_id`) REFERENCES `m_code_value` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_loan_officer_assignment_history` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `loan_id` BIGINT NOT NULL, - `loan_officer_id` BIGINT DEFAULT NULL, - `start_date` date NOT NULL, - `end_date` date DEFAULT NULL, - `createdby_id` BIGINT DEFAULT NULL, - `created_date` datetime DEFAULT NULL, - `lastmodified_date` datetime DEFAULT NULL, - `lastmodifiedby_id` BIGINT DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `fk_m_loan_officer_assignment_history_0001` (`loan_id`), - KEY `fk_m_loan_officer_assignment_history_0002` (`loan_officer_id`), - CONSTRAINT `fk_m_loan_officer_assignment_history_0001` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`), - CONSTRAINT `fk_m_loan_officer_assignment_history_0002` FOREIGN KEY (`loan_officer_id`) REFERENCES `m_staff` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_loan_repayment_schedule` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `loan_id` BIGINT NOT NULL, - `fromdate` date DEFAULT NULL, - `duedate` date NOT NULL, - `installment` SMALLINT NOT NULL, - `principal_amount` decimal(19,6) DEFAULT NULL, - `principal_completed_derived` decimal(19,6) DEFAULT NULL, - `principal_writtenoff_derived` decimal(19,6) DEFAULT NULL, - `interest_amount` decimal(19,6) DEFAULT NULL, - `interest_completed_derived` decimal(19,6) DEFAULT NULL, - `interest_writtenoff_derived` decimal(19,6) DEFAULT NULL, - `fee_charges_amount` decimal(19,6) DEFAULT NULL, - `fee_charges_completed_derived` decimal(19,6) DEFAULT NULL, - `fee_charges_writtenoff_derived` decimal(19,6) DEFAULT NULL, - `fee_charges_waived_derived` decimal(19,6) DEFAULT NULL, - `penalty_charges_amount` decimal(19,6) DEFAULT NULL, - `penalty_charges_completed_derived` decimal(19,6) DEFAULT NULL, - `penalty_charges_writtenoff_derived` decimal(19,6) DEFAULT NULL, - `penalty_charges_waived_derived` decimal(19,6) DEFAULT NULL, - `completed_derived` bit(1) NOT NULL, - `createdby_id` BIGINT DEFAULT NULL, - `created_date` datetime DEFAULT NULL, - `lastmodified_date` datetime DEFAULT NULL, - `lastmodifiedby_id` BIGINT DEFAULT NULL, - `interest_waived_derived` decimal(19,6) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `FK488B92AA40BE0710` (`loan_id`), - CONSTRAINT `FK488B92AA40BE0710` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_loan_transaction` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `loan_id` BIGINT NOT NULL, - `is_reversed` tinyint NOT NULL, - `transaction_type_enum` SMALLINT NOT NULL, - `transaction_date` date NOT NULL, - `amount` decimal(19,6) NOT NULL, - `principal_portion_derived` decimal(19,6) DEFAULT NULL, - `interest_portion_derived` decimal(19,6) DEFAULT NULL, - `fee_charges_portion_derived` decimal(19,6) DEFAULT NULL, - `penalty_charges_portion_derived` decimal(19,6) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `FKCFCEA42640BE0710` (`loan_id`), - CONSTRAINT `FKCFCEA42640BE0710` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; --- ======== end of loan related tables ========== - -CREATE TABLE `m_savings_product` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `name` varchar(100) NOT NULL, - `description` varchar(500) NOT NULL, - `currency_code` varchar(3) NOT NULL, - `currency_digits` SMALLINT NOT NULL, - `nominal_interest_rate_per_period` decimal(19,6) NOT NULL, - `nominal_interest_rate_period_frequency_enum` SMALLINT NOT NULL, - `interest_period_enum` SMALLINT NOT NULL, - `interest_calculation_type_enum` SMALLINT NOT NULL, - `interest_calculation_days_in_year_type_enum` SMALLINT NOT NULL, - `min_required_opening_balance` decimal(19,6) DEFAULT NULL, - `lockin_period_frequency` decimal(19,6) DEFAULT NULL, - `lockin_period_frequency_enum` SMALLINT DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `sp_unq_name` (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_savings_account` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `account_no` varchar(20) NOT NULL, - `external_id` varchar(100) DEFAULT NULL, - `client_id` BIGINT DEFAULT NULL, - `group_id` BIGINT DEFAULT NULL, - `product_id` BIGINT DEFAULT NULL, - `status_enum` SMALLINT NOT NULL DEFAULT 300, - `activation_date` DATE DEFAULT NULL, - `currency_code` varchar(3) NOT NULL, - `currency_digits` SMALLINT NOT NULL, - `nominal_interest_rate_per_period` decimal(19,6) NOT NULL, - `nominal_interest_rate_period_frequency_enum` SMALLINT NOT NULL, - `annual_nominal_interest_rate` decimal(19,6) NOT NULL, - `interest_period_enum` SMALLINT NOT NULL, - `interest_calculation_type_enum` SMALLINT NOT NULL, - `interest_calculation_days_in_year_type_enum` SMALLINT NOT NULL, - `min_required_opening_balance` decimal(19,6) DEFAULT NULL, - `lockin_period_frequency` decimal(19,6) DEFAULT NULL, - `lockin_period_frequency_enum` SMALLINT DEFAULT NULL, - `lockedin_until_date_derived` DATE DEFAULT NULL, - `total_deposits_derived` decimal(19,6) DEFAULT NULL, - `total_withdrawals_derived` decimal(19,6) DEFAULT NULL, - `total_interest_earned_derived` decimal(19,6) DEFAULT NULL, - `total_interest_posted_derived` decimal(19,6) DEFAULT NULL, - `account_balance_derived` decimal(19,6) NOT NULL DEFAULT 0, - PRIMARY KEY (`id`), - UNIQUE KEY `sa_account_no_UNIQUE` (`account_no`), - UNIQUE KEY `sa_externalid_UNIQUE` (`external_id`), - KEY `FKSA00000000000001` (`client_id`), - KEY `FKSA00000000000002` (`group_id`), - KEY `FKSA00000000000003` (`product_id`), - CONSTRAINT `FKSA00000000000001` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`), - CONSTRAINT `FKSA00000000000002` FOREIGN KEY (`group_id`) REFERENCES `m_group` (`id`), - CONSTRAINT `FKSA00000000000003` FOREIGN KEY (`product_id`) REFERENCES `m_savings_product` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `m_savings_account_transaction` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `savings_account_id` BIGINT NOT NULL, - `transaction_type_enum` SMALLINT NOT NULL, - `transaction_date` date NOT NULL, - `amount` decimal(19,6) NOT NULL, - `is_reversed` tinyint NOT NULL, - `running_balance_derived` DECIMAL(19,6) NULL, - `balance_number_of_days_derived` INT NULL, - `balance_end_date_derived` DATE NULL, - `cumulative_balance_derived` DECIMAL(19,6) NULL, - PRIMARY KEY (`id`), - KEY `FKSAT0000000001` (`savings_account_id`), - CONSTRAINT `FKSAT0000000001` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - --- end of savings account related tables - --- DDL for notes associated with all client/group and financial accounts -CREATE TABLE `m_note` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `client_id` BIGINT DEFAULT NULL, - `group_id` BIGINT DEFAULT NULL, - `loan_id` BIGINT DEFAULT NULL, - `loan_transaction_id` BIGINT DEFAULT NULL, - `note_type_enum` SMALLINT NOT NULL, - `note` varchar(1000) DEFAULT NULL, - `created_date` datetime DEFAULT NULL, - `createdby_id` BIGINT DEFAULT NULL, - `lastmodified_date` datetime DEFAULT NULL, - `lastmodifiedby_id` BIGINT DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `FK7C9708924D26803` (`loan_transaction_id`), - KEY `FK7C97089541F0A56` (`createdby_id`), - KEY `FK7C970897179A0CB` (`client_id`), - KEY `FK_m_note_m_group` (`group_id`), - KEY `FK7C970898F889C3F` (`lastmodifiedby_id`), - KEY `FK7C9708940BE0710` (`loan_id`), - CONSTRAINT `FK7C9708924D26803` FOREIGN KEY (`loan_transaction_id`) REFERENCES `m_loan_transaction` (`id`), - CONSTRAINT `FK7C9708940BE0710` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`), - CONSTRAINT `FK7C97089541F0A56` FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`), - CONSTRAINT `FK7C970897179A0CB` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`), - CONSTRAINT `FK_m_note_m_group` FOREIGN KEY (`group_id`) REFERENCES `m_group` (`id`), - CONSTRAINT `FK7C970898F889C3F` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - --- DDL for accounting sub system related tables -CREATE TABLE `acc_gl_account` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `name` varchar(45) NOT NULL, - `parent_id` BIGINT DEFAULT NULL, - `gl_code` varchar(45) NOT NULL, - `disabled` tinyint NOT NULL DEFAULT '0', - `manual_journal_entries_allowed` tinyint NOT NULL DEFAULT '1', - `account_usage` tinyint NOT NULL DEFAULT '2', - `classification_enum` SMALLINT NOT NULL, - `description` varchar(500) DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `acc_gl_code` (`gl_code`), - KEY `FK_ACC_0000000001` (`parent_id`), - CONSTRAINT `FK_ACC_0000000001` FOREIGN KEY (`parent_id`) REFERENCES `acc_gl_account` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `acc_gl_closure` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `office_id` BIGINT NOT NULL, - `closing_date` date NOT NULL, - `is_deleted` INT NOT NULL DEFAULT '0', - `createdby_id` BIGINT DEFAULT NULL, - `lastmodifiedby_id` BIGINT DEFAULT NULL, - `created_date` datetime DEFAULT NULL, - `lastmodified_date` datetime DEFAULT NULL, - `comments` varchar(500) DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `office_id_closing_date` (`office_id`,`closing_date`), - KEY `FK_acc_gl_closure_m_office` (`office_id`), - KEY `FK_acc_gl_closure_m_appuser` (`createdby_id`), - KEY `FK_acc_gl_closure_m_appuser_2` (`lastmodifiedby_id`), - CONSTRAINT `FK_acc_gl_closure_m_appuser` FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`), - CONSTRAINT `FK_acc_gl_closure_m_appuser_2` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`), - CONSTRAINT `FK_acc_gl_closure_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `acc_gl_journal_entry` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `account_id` BIGINT NOT NULL, - `office_id` BIGINT NOT NULL, - `reversal_id` BIGINT DEFAULT NULL, - `transaction_id` varchar(50) NOT NULL, - `reversed` tinyint NOT NULL DEFAULT '0', - `manual_entry` tinyint NOT NULL DEFAULT '0', - `entry_date` date NOT NULL, - `type_enum` SMALLINT NOT NULL, - `amount` decimal(19,6) NOT NULL, - `description` varchar(500) DEFAULT NULL, - `entity_type_enum` SMALLINT DEFAULT NULL, - `entity_id` BIGINT DEFAULT NULL, - `createdby_id` BIGINT NOT NULL, - `lastmodifiedby_id` BIGINT NOT NULL, - `created_date` datetime NOT NULL, - `lastmodified_date` datetime NOT NULL, - PRIMARY KEY (`id`), - KEY `FK_acc_gl_journal_entry_m_office` (`office_id`), - KEY `FK_acc_gl_journal_entry_m_appuser` (`createdby_id`), - KEY `FK_acc_gl_journal_entry_m_appuser_2` (`lastmodifiedby_id`), - KEY `FK_acc_gl_journal_entry_acc_gl_journal_entry` (`reversal_id`), - KEY `FK_acc_gl_journal_entry_acc_gl_account` (`account_id`), - CONSTRAINT `FK_acc_gl_journal_entry_acc_gl_account` FOREIGN KEY (`account_id`) REFERENCES `acc_gl_account` (`id`), - CONSTRAINT `FK_acc_gl_journal_entry_acc_gl_journal_entry` FOREIGN KEY (`reversal_id`) REFERENCES `acc_gl_journal_entry` (`id`), - CONSTRAINT `FK_acc_gl_journal_entry_m_appuser` FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`), - CONSTRAINT `FK_acc_gl_journal_entry_m_appuser_2` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`), - CONSTRAINT `FK_acc_gl_journal_entry_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `acc_product_mapping` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `gl_account_id` BIGINT DEFAULT NULL, - `product_id` BIGINT DEFAULT NULL, - `product_type` SMALLINT DEFAULT NULL, - `financial_account_type` SMALLINT DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; --- =========== end of accounting related tables ========== - --- DDL for reporting related tables -CREATE TABLE `rpt_sequence` ( - `id` INT NOT NULL AUTO_INCREMENT, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `stretchy_parameter` ( - `parameter_id` INT NOT NULL AUTO_INCREMENT, - `parameter_name` varchar(45) NOT NULL, - `parameter_variable` varchar(45) DEFAULT NULL, - `parameter_label` varchar(45) NOT NULL, - `parameter_displayType` varchar(45) NOT NULL, - `parameter_FormatType` varchar(10) NOT NULL, - `parameter_default` varchar(45) NOT NULL, - `special` varchar(1) DEFAULT NULL, - `selectOne` varchar(1) DEFAULT NULL, - `selectAll` varchar(1) DEFAULT NULL, - `parameter_sql` text, - `parent_parameter_id` INT NULL DEFAULT NULL, - PRIMARY KEY (`parameter_id`), - UNIQUE KEY `name_UNIQUE` (`parameter_name`), - INDEX `fk_stretchy_parameter_0001_idx` (`parent_parameter_id`), - CONSTRAINT `fk_stretchy_parameter_0001` FOREIGN KEY (`parent_parameter_id`) REFERENCES `stretchy_parameter` (`parameter_id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `stretchy_report` ( - `report_id` INT NOT NULL AUTO_INCREMENT, - `report_name` varchar(100) NOT NULL, - `report_type` varchar(20) NOT NULL, - `report_subtype` varchar(20) DEFAULT NULL, - `report_category` varchar(45) DEFAULT NULL, - `report_sql` text, - `description` text, - `core_report` tinyint DEFAULT '0', - `use_report` tinyint DEFAULT '0', - PRIMARY KEY (`report_id`), - UNIQUE KEY `report_name_UNIQUE` (`report_name`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `stretchy_report_parameter` ( - `report_id` INT NOT NULL, - `parameter_id` INT NOT NULL, - `report_parameter_name` varchar(45) DEFAULT NULL, - PRIMARY KEY (`report_id`,`parameter_id`), - UNIQUE KEY `report_id_name_UNIQUE` (`report_id`,`report_parameter_name`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; --- =========== end of reporting related tables ============ diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V200__alter_savings_account_for_start_interest_calculation_date.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V200__alter_savings_account_for_start_interest_calculation_date.sql deleted file mode 100644 index 6a952e366..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V200__alter_savings_account_for_start_interest_calculation_date.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_savings_account` -ADD COLUMN `start_interest_calculation_date` DATE NULL DEFAULT NULL AFTER `min_balance_for_interest_calculation`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V201__webhooks.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V201__webhooks.sql deleted file mode 100644 index f31b2768e..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V201__webhooks.sql +++ /dev/null @@ -1,125 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - --- ----------------------------------------------------- --- Table `m_hook_templates` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `m_hook_templates` ( - `id` SMALLINT NOT NULL AUTO_INCREMENT, - `name` VARCHAR(45) NOT NULL, - PRIMARY KEY (`id`)) -ENGINE = InnoDB DEFAULT CHARSET=UTF8MB4; - - --- ----------------------------------------------------- --- Table `m_hook` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `m_hook` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `template_id` SMALLINT NOT NULL, - `is_active` SMALLINT NOT NULL DEFAULT 1, - `name` VARCHAR(45) NOT NULL, - `createdby_id` BIGINT DEFAULT NULL, - `created_date` datetime DEFAULT NULL, - `lastmodifiedby_id` BIGINT DEFAULT NULL, - `lastmodified_date` datetime DEFAULT NULL, - PRIMARY KEY (`id`), - INDEX `fk_template_id_idx` (`template_id` ASC), - CONSTRAINT `fk_template_id` - FOREIGN KEY (`template_id`) - REFERENCES `m_hook_templates` (`id`)) -ENGINE = InnoDB DEFAULT CHARSET=UTF8MB4; - - --- ----------------------------------------------------- --- Table `m_hook_schema` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `m_hook_schema` ( - `id` SMALLINT NOT NULL AUTO_INCREMENT, - `hook_template_id` SMALLINT NOT NULL, - `field_type` VARCHAR(45) NOT NULL, - `field_name` VARCHAR(100) NOT NULL, - `placeholder` VARCHAR(100) DEFAULT NULL, - `optional` TINYINT NOT NULL DEFAULT 0, - PRIMARY KEY (`id`), - INDEX `fk_hook_template_id_idx` (`hook_template_id` ASC), - CONSTRAINT `fk_hook_template_id` - FOREIGN KEY (`hook_template_id`) - REFERENCES `m_hook_templates` (`id`)) -ENGINE = InnoDB DEFAULT CHARSET=UTF8MB4; - - --- ----------------------------------------------------- --- Table `m_hook_registered_events` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `m_hook_registered_events` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `hook_id` BIGINT NOT NULL, - `entity_name` VARCHAR(45) NOT NULL, - `action_name` VARCHAR(45) NOT NULL, - PRIMARY KEY (`id`), - INDEX `fk_hook_id_idx` (`hook_id` ASC), - CONSTRAINT `fk_hook_idc` - FOREIGN KEY (`hook_id`) - REFERENCES `m_hook` (`id`)) -ENGINE = InnoDB DEFAULT CHARSET=UTF8MB4; - - --- ----------------------------------------------------- --- Table `m_hook_configuration` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `m_hook_configuration` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `hook_id` BIGINT NULL, - `field_type` VARCHAR(45) NOT NULL, - `field_name` VARCHAR(100) NOT NULL, - `field_value` VARCHAR(100) NOT NULL, - PRIMARY KEY (`id`), - INDEX `fk_hook_id_idx` (`hook_id` ASC), - CONSTRAINT `fk_hook_id_cfg` - FOREIGN KEY (`hook_id`) - REFERENCES `m_hook` (`id`)) -ENGINE = InnoDB DEFAULT CHARSET=UTF8MB4; - -insert into `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('configuration', 'CREATE_HOOK', 'HOOK', 'CREATE', 0); -insert into `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('configuration', 'READ_HOOK', 'HOOK', 'READ', 0); -insert into `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('configuration', 'UPDATE_HOOK', 'HOOK', 'UPDATE', 0); -insert into `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('configuration', 'DELETE_HOOK', 'HOOK', 'DELETE', 0); - -insert into m_hook_templates values(1, "Web"); -insert into m_hook_templates values(2, "SMS Bridge"); - -INSERT INTO `m_hook_schema` (`hook_template_id`, `field_type`, `field_name`, `optional`) -VALUES (1, 'string', 'Payload URL', 0); -INSERT INTO `m_hook_schema` (`hook_template_id`, `field_type`, `field_name`, `placeholder`, `optional`) -VALUES (1, 'string', 'Content Type', 'json / form', 0); -INSERT INTO `m_hook_schema` (`hook_template_id`, `field_type`, `field_name`, `optional`) -VALUES (2, 'string', 'Payload URL', 0); -INSERT INTO `m_hook_schema` (`hook_template_id`, `field_type`, `field_name`, `optional`) -VALUES (2, 'string', 'SMS Provider', 0); -INSERT INTO `m_hook_schema` (`hook_template_id`, `field_type`, `field_name`, `optional`) -VALUES (2, 'string', 'Phone Number', 0); -INSERT INTO `m_hook_schema` (`hook_template_id`, `field_type`, `field_name`, `optional`) -VALUES (2, 'string', 'SMS Provider Token', 0); -INSERT INTO `m_hook_schema` (`hook_template_id`, `field_type`, `field_name`, `optional`) -VALUES (2, 'string', 'SMS Provider Account Id', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V202__savings_officer_history_table.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V202__savings_officer_history_table.sql deleted file mode 100644 index bdcaad087..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V202__savings_officer_history_table.sql +++ /dev/null @@ -1,38 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_savings_officer_assignment_history` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `account_id` BIGINT NOT NULL, - `savings_officer_id` BIGINT DEFAULT NULL, - `start_date` date NOT NULL, - `end_date` date DEFAULT NULL, - `createdby_id` BIGINT DEFAULT NULL, - `created_date` datetime DEFAULT NULL, - `lastmodified_date` datetime DEFAULT NULL, - `lastmodifiedby_id` BIGINT DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `fk_m_savings_officer_assignment_history_0001` (`account_id`), - KEY `fk_m_savings_officer_assignment_history_0002` (`savings_officer_id`), - CONSTRAINT `fk_m_savings_officer_assignment_history_0001` FOREIGN KEY (`account_id`) REFERENCES `m_savings_account` (`id`), - CONSTRAINT `fk_m_savings_officer_assignment_history_0002` FOREIGN KEY (`savings_officer_id`) REFERENCES `m_staff` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -insert into m_permission (`grouping`,code,entity_name,action_name) values ('portfolio','REMOVESAVINGSOFFICER_SAVINGSACCOUNT','SAVINGSACCOUNT','REMOVESAVINGSOFFICER'); -insert into m_permission (`grouping`,code,entity_name,action_name) values ('portfolio','UPDATESAVINGSOFFICER_SAVINGSACCOUNT','SAVINGSACCOUNT','UPDATESAVINGSOFFICER'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V203__added_subbmittedDate_loantransaction.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V203__added_subbmittedDate_loantransaction.sql deleted file mode 100644 index cc32273d7..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V203__added_subbmittedDate_loantransaction.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_loan_transaction` ADD `submitted_on_date` DATE NOT NULL; - -UPDATE `m_loan_transaction` SET `submitted_on_date`= `transaction_date` ; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V204__insert_script_for_charges_paid_by_for_accruals.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V204__insert_script_for_charges_paid_by_for_accruals.sql deleted file mode 100644 index 8d2c77caa..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V204__insert_script_for_charges_paid_by_for_accruals.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -insert into m_loan_charge_paid_by (`loan_transaction_id`,`loan_charge_id`,`amount`) select lt.id, lc.id, if(lic.amount is null,lc.amount,lic.amount) from m_loan_transaction lt join m_loan_repayment_schedule rs on rs.loan_id = lt.loan_id and rs.duedate = lt.transaction_date join m_loan_charge lc on lc.loan_id = rs.loan_id and ((lc.due_for_collection_as_of_date > rs.fromdate and lc.due_for_collection_as_of_date <= rs.duedate) or lc.charge_time_enum = 8) and lc.is_active=1 join m_loan loan on loan.id = lt.loan_id join m_product_loan lp on lp.id = loan.product_id and lp.accounting_type =3 left join m_loan_installment_charge lic on lic.loan_charge_id = lc.id and lic.loan_schedule_id = rs.id where lt.transaction_type_enum = 10 and (lt.fee_charges_portion_derived is not null or lt.penalty_charges_portion_derived is not null) and lt.is_reversed = 0; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V205__fix_for_charge_and_interest_waiver_with_accruals.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V205__fix_for_charge_and_interest_waiver_with_accruals.sql deleted file mode 100644 index dfc3ecd6f..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V205__fix_for_charge_and_interest_waiver_with_accruals.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_loan_charge_paid_by` - ADD COLUMN `installment_number` SMALLINT NULL AFTER `amount`; - -ALTER TABLE `m_loan_transaction` - ADD COLUMN `unrecognized_income_portion` DECIMAL(19,6) NULL DEFAULT NULL AFTER `overpayment_portion_derived`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V206__interest_posting_configuration.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V206__interest_posting_configuration.sql deleted file mode 100644 index bd15bd395..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V206__interest_posting_configuration.sql +++ /dev/null @@ -1,26 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE c_configuration ADD `description` varchar(300) DEFAULT NULL; - -INSERT INTO `c_configuration` (`id`, `name`, `enabled`, `description`) -VALUES (NULL, 'savings-interest-posting-current-period-end', '0', "Recommended to be changed only once during start of production. When set as false(default), interest will be posted on the first date of next period. If set as true, interest will be posted on last date of current period. There is no difference in the interest amount posted."); - -INSERT INTO `c_configuration` (`id`, `name`, `value`, `enabled`, `description`) -VALUES (NULL, 'financial-year-beginning-month', '1', '1', "Recommended to be changed only once during start of production. Allowed values 1 - 12 (January - December). Interest posting periods are evaluated based on this configuration."); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V207__min_max_clients_per_group.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V207__min_max_clients_per_group.sql deleted file mode 100644 index a8e7f4af5..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V207__min_max_clients_per_group.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_group_level` - ADD COLUMN `min_clients` INT NOT NULL DEFAULT '0' AFTER `can_have_clients`, - ADD COLUMN `max_clients` INT NOT NULL DEFAULT '0' AFTER `min_clients`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V208__min_max_clients_in_group_redux.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V208__min_max_clients_in_group_redux.sql deleted file mode 100644 index 15f4c13a7..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V208__min_max_clients_in_group_redux.sql +++ /dev/null @@ -1,28 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `c_configuration` (`id`, `name`,`value`, `enabled`, `description`) -VALUES (NULL, 'min-clients-in-group', '5', '0',"Minimum number of Clients that a Group should have"); - -INSERT INTO `c_configuration` (`id`, `name`, `value`, `enabled`, `description`) -VALUES (NULL, 'max-clients-in-group', '5', '0', "Maximum number of Clients that a Group can have"); - -ALTER TABLE `m_group_level` - DROP COLUMN `min_clients`, - DROP COLUMN `max_clients`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V209__add_all_report_names_in_m_permission_table.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V209__add_all_report_names_in_m_permission_table.sql deleted file mode 100644 index d005c0611..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V209__add_all_report_names_in_m_permission_table.sql +++ /dev/null @@ -1,60 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Active Loans - Summary(Pentaho)', 'Active Loans - Summary(Pentaho)', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Active Loans by Disbursal Period(Pentaho)', 'Active Loans by Disbursal Period(Pentaho)', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Active Loans in last installment Summary(Pentaho)', 'Active Loans in last installment Summary(Pentaho)', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Active Loans in last installment(Pentaho)', 'Active Loans in last installment(Pentaho)', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Active Loans Passed Final Maturity Summary(Pentaho)', 'Active Loans Passed Final Maturity Summary(Pentaho)', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Active Loans Passed Final Maturity(Pentaho)', 'Active Loans Passed Final Maturity(Pentaho)', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Aging Detail(Pentaho)', 'Aging Detail(Pentaho)', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Aging Summary (Arrears in Months)(Pentaho)', 'Aging Summary (Arrears in Months)(Pentaho)', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Aging Summary (Arrears in Weeks)(Pentaho)', 'Aging Summary (Arrears in Weeks)(Pentaho)', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Client Listing(Pentaho)', 'Client Listing(Pentaho)', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Client Loan Account Schedule', 'Client Loan Account Schedule', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Client Loans Listing(Pentaho)', 'Client Loans Listing(Pentaho)', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Client Saving Transactions', 'Client Saving Transactions', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Client Savings Summary', 'Client Savings Summary', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_ClientSummary ', 'ClientSummary ', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_ClientTrendsByDay', 'ClientTrendsByDay', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_ClientTrendsByMonth', 'ClientTrendsByMonth', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_ClientTrendsByWeek', 'ClientTrendsByWeek', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Demand_Vs_Collection', 'Demand_Vs_Collection', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Disbursal_Vs_Awaitingdisbursal', 'Disbursal_Vs_Awaitingdisbursal', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Expected Payments By Date - Basic(Pentaho)', 'Expected Payments By Date - Basic(Pentaho)', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Funds Disbursed Between Dates Summary by Office(Pentaho)', 'Funds Disbursed Between Dates Summary by Office(Pentaho)', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Funds Disbursed Between Dates Summary(Pentaho)', 'Funds Disbursed Between Dates Summary(Pentaho)', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_GroupNamesByStaff', 'GroupNamesByStaff', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_GroupSavingSummary', 'GroupSavingSummary', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_LoanCyclePerProduct', 'LoanCyclePerProduct', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Loans Awaiting Disbursal Summary by Month(Pentaho)', 'Loans Awaiting Disbursal Summary by Month(Pentaho)', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Loans Awaiting Disbursal Summary(Pentaho)', 'Loans Awaiting Disbursal Summary(Pentaho)', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Loans Awaiting Disbursal(Pentaho)', 'Loans Awaiting Disbursal(Pentaho)', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Loans Pending Approval(Pentaho)', 'Loans Pending Approval(Pentaho)', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_LoanTrendsByDay', 'LoanTrendsByDay', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_LoanTrendsByMonth', 'LoanTrendsByMonth', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_LoanTrendsByWeek', 'LoanTrendsByWeek', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Obligation Met Loans Details(Pentaho)', 'Obligation Met Loans Details(Pentaho)', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Obligation Met Loans Summary(Pentaho)', 'Obligation Met Loans Summary(Pentaho)', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Portfolio at Risk by Branch(Pentaho)', 'Portfolio at Risk by Branch(Pentaho)', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Portfolio at Risk(Pentaho)', 'Portfolio at Risk(Pentaho)', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Rescheduled Loans(Pentaho)', 'Rescheduled Loans(Pentaho)', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Savings Transactions', 'Savings Transactions', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_TxnRunningBalances(Pentaho)', 'TxnRunningBalances(Pentaho)', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Written-Off Loans(Pentaho)', 'Written-Off Loans(Pentaho)', 'READ', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V20__report_maint_perms_really_configuration.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V20__report_maint_perms_really_configuration.sql deleted file mode 100644 index 8e511e081..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V20__report_maint_perms_really_configuration.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -update m_permission set `grouping` = 'configuration' where entity_name = 'report'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V210__track_manually_adjusted_transactions.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V210__track_manually_adjusted_transactions.sql deleted file mode 100644 index f4b792b3b..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V210__track_manually_adjusted_transactions.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -Alter table m_loan_transaction -Add column manually_adjusted_or_reversed tinyint default 0; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V211__minimum_days_between_disbursal_and_first_repayment.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V211__minimum_days_between_disbursal_and_first_repayment.sql deleted file mode 100644 index 29e379ea2..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V211__minimum_days_between_disbursal_and_first_repayment.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_product_loan` - ADD COLUMN `min_days_between_disbursal_and_first_repayment` INT NULL AFTER `interest_recalculation_enabled`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V212__add_NthDay_and_DayOfWeek_columns_loan.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V212__add_NthDay_and_DayOfWeek_columns_loan.sql deleted file mode 100644 index f18f1dbdb..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V212__add_NthDay_and_DayOfWeek_columns_loan.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_loan` - ADD COLUMN `repayment_frequency_nth_day_enum` SMALLINT NOT NULL DEFAULT '0' AFTER `repayment_period_frequency_enum`, - ADD COLUMN `repayment_frequency_day_of_week_enum` SMALLINT NOT NULL DEFAULT '0' AFTER `repayment_frequency_nth_day_enum`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V213__NthDay_and_DayOfWeek_columns_should_be_nullable.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V213__NthDay_and_DayOfWeek_columns_should_be_nullable.sql deleted file mode 100644 index 9b306ea06..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V213__NthDay_and_DayOfWeek_columns_should_be_nullable.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_loan` - CHANGE COLUMN `repayment_frequency_nth_day_enum` `repayment_frequency_nth_day_enum` SMALLINT NULL DEFAULT '0' AFTER `repayment_period_frequency_enum`, - CHANGE COLUMN `repayment_frequency_day_of_week_enum` `repayment_frequency_day_of_week_enum` SMALLINT NULL DEFAULT '0' AFTER `repayment_frequency_nth_day_enum`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V214__alter_table_add_create_SI_at_disbursement.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V214__alter_table_add_create_SI_at_disbursement.sql deleted file mode 100644 index 080903382..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V214__alter_table_add_create_SI_at_disbursement.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -alter table `m_loan` add `create_standing_instruction_at_disbursement` tinyint null; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V215__guarantee_on_hold_fund_changes.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V215__guarantee_on_hold_fund_changes.sql deleted file mode 100644 index 55cb07ea7..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V215__guarantee_on_hold_fund_changes.sql +++ /dev/null @@ -1,37 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_savings_account` - ADD COLUMN `on_hold_funds_derived` DECIMAL(19,6) NULL DEFAULT NULL; - -ALTER TABLE `m_portfolio_account_associations` - ADD COLUMN `association_type_enum` SMALLINT NOT NULL DEFAULT '1'; - -CREATE TABLE `m_product_loan_guarantee_details` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `loan_product_id` BIGINT NOT NULL, - `mandatory_guarantee` DECIMAL(19,5) NOT NULL, - `minimum_guarantee_from_own_funds` DECIMAL(19,5) NULL, - `minimum_guarantee_from_guarantor_funds` DECIMAL(19,5) NULL, - PRIMARY KEY (`id`), - CONSTRAINT `FK_guarantee_details_loan_product` FOREIGN KEY (`loan_product_id`) REFERENCES `m_product_loan` (`id`) -); - -ALTER TABLE `m_product_loan` - ADD COLUMN `hold_guarantee_funds` tinyint NOT NULL DEFAULT '0'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V216__adding_loan_proposed_amount_to_loan.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V216__adding_loan_proposed_amount_to_loan.sql deleted file mode 100644 index a51aa5697..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V216__adding_loan_proposed_amount_to_loan.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - ALTER TABLE `m_loan` ADD COLUMN `principal_amount_proposed` DECIMAL(19,6) NOT NULL AFTER `currency_multiplesof`; - UPDATE m_loan SET principal_amount_proposed = approved_principal; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V217__client_substatus_and_codevalue_description.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V217__client_substatus_and_codevalue_description.sql deleted file mode 100644 index fac5bf2ae..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V217__client_substatus_and_codevalue_description.sql +++ /dev/null @@ -1,30 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -ALTER TABLE `m_client` - ADD COLUMN `sub_status` INT NULL DEFAULT NULL AFTER `status_enum`, - ADD CONSTRAINT `FK_m_client_substatus_m_code_value` FOREIGN KEY (`sub_status`) REFERENCES `m_code_value` (`id`); - - -INSERT INTO `m_code` (`code_name`, `is_system_defined`) VALUES ('ClientSubStatus', 1); - - -ALTER TABLE `m_code_value` - ADD COLUMN `code_description` VARCHAR(500) NULL DEFAULT NULL AFTER `code_value`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V218__add_user_and_datetime_for_loan_savings_transactions.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V218__add_user_and_datetime_for_loan_savings_transactions.sql deleted file mode 100644 index 85ba51711..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V218__add_user_and_datetime_for_loan_savings_transactions.sql +++ /dev/null @@ -1,27 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_loan_transaction` - ADD COLUMN ( - `created_date` DATETIME, - `appuser_id` BIGINT - ); - -ALTER TABLE `m_savings_account_transaction` - ADD COLUMN `appuser_id` BIGINT; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V219__guarantor_on_hold_fund_changes_for_account.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V219__guarantor_on_hold_fund_changes_for_account.sql deleted file mode 100644 index 2eee0620c..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V219__guarantor_on_hold_fund_changes_for_account.sql +++ /dev/null @@ -1,65 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_portfolio_account_associations` - ADD COLUMN `is_active` tinyint NOT NULL DEFAULT '1'; - -ALTER TABLE `m_guarantor` - ADD COLUMN `is_active` tinyint NOT NULL DEFAULT '1'; - -CREATE TABLE `m_guarantor_funding_details` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `guarantor_id` BIGINT NOT NULL, - `account_associations_id` BIGINT NOT NULL, - `amount` DECIMAL(19,6) NOT NULL, - `amount_released_derived` DECIMAL(19,6) NULL, - `amount_remaining_derived` DECIMAL(19,6) NULL, - `amount_transfered_derived` DECIMAL(19,6) NULL, - `status_enum` SMALLINT NOT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `FK_m_guarantor_fund_details_m_guarantor` FOREIGN KEY (`guarantor_id`) REFERENCES `m_guarantor` (`id`), - CONSTRAINT `FK_m_guarantor_fund_details_account_associations_id` FOREIGN KEY (`account_associations_id`) REFERENCES `m_portfolio_account_associations` (`id`) -); - -CREATE TABLE `m_deposit_account_on_hold_transaction` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `savings_account_id` BIGINT NOT NULL, - `amount` DECIMAL(19,6) NOT NULL, - `transaction_type_enum` SMALLINT NOT NULL, - `transaction_date` DATE NOT NULL, - `is_reversed` tinyint NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - CONSTRAINT `FK_deposit_on_hold_transaction_m_savings_account` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`) -); - -CREATE TABLE `m_guarantor_transaction` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `guarantor_fund_detail_id` BIGINT NOT NULL, - `loan_transaction_id` BIGINT NOT NULL, - `deposit_on_hold_transaction_id` BIGINT NOT NULL, - `is_reversed` tinyint NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - CONSTRAINT `FK_guarantor_transaction_m_deposit_account_on_hold_transaction` FOREIGN KEY (`deposit_on_hold_transaction_id`) REFERENCES `m_deposit_account_on_hold_transaction` (`id`), - CONSTRAINT `FK_guarantor_transaction_guarantor_fund_detail` FOREIGN KEY (`guarantor_fund_detail_id`) REFERENCES `m_guarantor_funding_details` (`id`), - CONSTRAINT `FK_guarantor_transaction_m_loan_transaction` FOREIGN KEY (`loan_transaction_id`) REFERENCES `m_loan_transaction` (`id`) -); - -ALTER TABLE `m_loan` - ADD COLUMN `guarantee_amount_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `interest_recalculation_enabled`, - ADD COLUMN `guarantee_outstanding_amount_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `guarantee_amount_derived`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V21__activation-permissions-for-clients.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V21__activation-permissions-for-clients.sql deleted file mode 100644 index 04cfa0265..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V21__activation-permissions-for-clients.sql +++ /dev/null @@ -1,27 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'ACTIVATE_CLIENT', 'CLIENT', 'ACTIVATE', 1); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'ACTIVATE_CLIENT_CHECKER', 'CLIENT', 'ACTIVATE', 0); - - -ALTER TABLE `m_client` -CHANGE COLUMN `external_id` `external_id` VARCHAR(100) NULL DEFAULT NULL AFTER `account_no`, -CHANGE COLUMN `status_enum` `status_enum` INT NOT NULL DEFAULT '300' AFTER `external_id`, -CHANGE COLUMN `joined_date` `activation_date` DATE NULL DEFAULT NULL AFTER `status_enum`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V220_1__prefix_type_account_number.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V220_1__prefix_type_account_number.sql deleted file mode 100644 index 47bab73f3..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V220_1__prefix_type_account_number.sql +++ /dev/null @@ -1,23 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - - -ALTER TABLE `c_account_number_format` - ADD COLUMN `prefix_character` VARCHAR(50) NULL DEFAULT NULL AFTER `prefix_type_enum`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V220__account_number_preferences.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V220__account_number_preferences.sql deleted file mode 100644 index 93bed74be..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V220__account_number_preferences.sql +++ /dev/null @@ -1,41 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `c_account_number_format` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `account_type_enum` SMALLINT NOT NULL, - `prefix_type_enum` SMALLINT NULL DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE INDEX `account_type_enum` (`account_type_enum`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB -; - - -/*permissions*/ - -insert into `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('configuration', 'CREATE_ACCOUNTNUMBERFORMAT', 'ACCOUNTNUMBERFORMAT', 'CREATE', 0); -insert into `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('configuration', 'READ_ACCOUNTNUMBERFORMAT', 'ACCOUNTNUMBERFORMAT', 'READ', 0); -insert into `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('configuration', 'UPDATE_ACCOUNTNUMBERFORMAT', 'ACCOUNTNUMBERFORMAT', 'UPDATE', 0); -insert into `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('configuration', 'DELETE_ACCOUNTNUMBERFORMAT', 'HOOK', 'DELETE', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V221__add_version_for_m_savings_account.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V221__add_version_for_m_savings_account.sql deleted file mode 100644 index 844756584..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V221__add_version_for_m_savings_account.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_savings_account` - ADD COLUMN `version` INT NOT NULL DEFAULT '1' AFTER `on_hold_funds_derived`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V222__guarantor_on_hold_fund_changes_for_transactions.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V222__guarantor_on_hold_fund_changes_for_transactions.sql deleted file mode 100644 index 61a471d60..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V222__guarantor_on_hold_fund_changes_for_transactions.sql +++ /dev/null @@ -1,32 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_deposit_account_on_hold_transaction` - ADD COLUMN `created_date` DATETIME NOT NULL; - -ALTER TABLE `m_guarantor_transaction` - ALTER `loan_transaction_id` DROP DEFAULT; - -ALTER TABLE `m_guarantor_transaction` - CHANGE COLUMN `loan_transaction_id` `loan_transaction_id` BIGINT NULL ; - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'RECOVERGUARANTEES_LOAN', 'LOAN', 'RECOVERGUARANTEES', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'RECOVERGUARANTEES_LOAN_CHECKER', 'LOAN', 'RECOVERGUARANTEES_CHECKER', 0); -ALTER TABLE `m_loan` - DROP COLUMN `guarantee_outstanding_amount_derived`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V223__add_version_for_m_loan_account.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V223__add_version_for_m_loan_account.sql deleted file mode 100644 index e9166ce98..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V223__add_version_for_m_loan_account.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_loan` - ADD COLUMN `version` INT NOT NULL DEFAULT '1' AFTER `create_standing_instruction_at_disbursement`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V224__client_lifecycle_adding_statuses.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V224__client_lifecycle_adding_statuses.sql deleted file mode 100644 index 8e86dd4fc..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V224__client_lifecycle_adding_statuses.sql +++ /dev/null @@ -1,52 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -/**add columns to m_client**/ -ALTER TABLE `m_client` - ADD COLUMN `reject_reason_cv_id` INT NULL DEFAULT NULL AFTER `client_classification_cv_id`, - ADD COLUMN `rejectedon_date` DATE NULL DEFAULT NULL AFTER `reject_reason_cv_id`, - ADD COLUMN `rejectedon_userid` BIGINT NULL DEFAULT NULL AFTER `rejectedon_date`, - ADD COLUMN `withdraw_reason_cv_id` INT NULL DEFAULT NULL AFTER `rejectedon_userid`, - ADD COLUMN `withdrawn_on_date` DATE NULL DEFAULT NULL AFTER `withdraw_reason_cv_id`, - ADD COLUMN `withdraw_on_userid` BIGINT NULL DEFAULT NULL AFTER `withdrawn_on_date`, - ADD COLUMN `reactivated_on_date` DATE NULL AFTER `withdraw_on_userid`, - ADD COLUMN `reactivated_on_userid` BIGINT NULL AFTER `reactivated_on_date`, - ADD CONSTRAINT `FK_m_client_type_mcode_value_reject` FOREIGN KEY (`reject_reason_cv_id`) REFERENCES `m_code_value` (`id`), - ADD CONSTRAINT `FK_m_client_type_m_code_value_withdraw` FOREIGN KEY (`withdraw_reason_cv_id`) REFERENCES `m_code_value` (`id`); - - -ALTER TABLE `m_client` - ADD COLUMN `updated_by` BIGINT NULL DEFAULT NULL AFTER `closedon_date`, - ADD COLUMN `updated_on` DATE NULL DEFAULT NULL AFTER `updated_by`; - - -/**permissions for client reject and withdraw**/ -INSERT INTO `m_permission` ( `grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'REJECT_CLIENT', 'CLIENT', 'REJECT', 1); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'REJECT_CLIENT_CHECKER', 'CLIENT', 'REJECT_CHECKER', 0); - -INSERT INTO `m_permission` ( `grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'WITHDRAW_CLIENT', 'CLIENT', 'WITHDRAW', 1); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'WITHDRAW_CLIENT_CHECKER', 'CLIENT', 'WITHDRAW_CHECKER', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'REACTIVATE_CLIENT', 'CLIENT', 'REACTIVATE', 1); -INSERT INTO `m_permission` ( `grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'portfolio', 'REACTIVATE_CLIENT_CHECKER', 'CLIENT', 'REACTIVATE_CHECKER', 0); - - -/**Code for capturing reasons for new life cycle events**/ -INSERT INTO `m_code` ( `code_name`, `is_system_defined`) VALUES ( 'ClientRejectReason', 1); -INSERT INTO `m_code` ( `code_name`, `is_system_defined`) VALUES ( 'ClientWithdrawReason', 1); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V225__permissions_for_updating_recurring_deposit_amount.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V225__permissions_for_updating_recurring_deposit_amount.sql deleted file mode 100644 index 09d67c46e..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V225__permissions_for_updating_recurring_deposit_amount.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'UPDATEDEPOSITAMOUNT_RECURRINGDEPOSITACCOUNT', 'RECURRINGDEPOSITACCOUNT', 'UPDATEDEPOSITAMOUNT', 1); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ( 'transaction_savings', 'UPDATEDEPOSITAMOUNT_RECURRINGDEPOSITACCOUNT_CHECKER', 'RECURRINGDEPOSITACCOUNT', 'UPDATEDEPOSITAMOUNT', 1); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V226__configuration_for_enforcing_calendars_for_jlg_loans.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V226__configuration_for_enforcing_calendars_for_jlg_loans.sql deleted file mode 100644 index 771d42c43..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V226__configuration_for_enforcing_calendars_for_jlg_loans.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO c_configuration (`name`, `description`) VALUES ('meetings-mandatory-for-jlg-loans', 'Enforces all JLG loans to follow a meeting schedule belonging to parent group or Center'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V227__loan-refund-permissions.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V227__loan-refund-permissions.sql deleted file mode 100644 index b3bfdc2d0..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V227__loan-refund-permissions.sql +++ /dev/null @@ -1,34 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES - ('transaction_savings', 'REFUNDBYTRANSFER_ACCOUNTTRANSFER_CHECKER', 'ACCOUNTTRANSFER', 'REFUNDBYTRANSFER', 0); - - INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES - ( 'transaction_savings', 'REFUNDBYTRANSFER_ACCOUNTTRANSFER', 'ACCOUNTTRANSFER', 'REFUNDBYTRANSFER', 1); - - INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES - ('transaction_loan', 'REFUNDBYCASH_LOAN', 'LOAN', 'REFUNDBYCASH', 1); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES - ('transaction_loan', 'REFUNDBYCASH_LOAN_CHECKER', 'LOAN', 'REFUNDBYCASH', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V228__entity_to_entity_access.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V228__entity_to_entity_access.sql deleted file mode 100644 index 31aace9a9..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V228__entity_to_entity_access.sql +++ /dev/null @@ -1,64 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - --- Code required to store various types of Entity to Entity Access types that Mifos Supports -insert into m_code (code_name, is_system_defined) -values ('Entity to Entity Access Types', 1); - --- Three Code Values required to support: --- a) Loan Products restricted to specific Offices --- b) Savings Products restricted to specific Offices --- c) Fees/Charges restricted to specific Offices -insert into m_code_value (code_id, code_value, order_position) -values ( - (select id from m_code where code_name = 'Entity to Entity Access Types'), - 'Office Access to Loan Products', 0); - -insert into m_code_value (code_id, code_value, order_position) -values ( - (select id from m_code where code_name = 'Entity to Entity Access Types'), - 'Office Access to Savings Products', 0); - -insert into m_code_value (code_id, code_value, order_position) -values ( - (select id from m_code where code_name = 'Entity to Entity Access Types'), - 'Office Access to Fees/Charges', 0); - --- Table where the actual restrictions will be stored -CREATE TABLE `m_entity_to_entity_access` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `entity_type` VARCHAR(50) NOT NULL, - `entity_id` BIGINT NOT NULL, - `access_type_code_value_id` INT NOT NULL, - `second_entity_type` VARCHAR(50) NOT NULL, - `second_entity_id` BIGINT NOT NULL, - PRIMARY KEY (`id`), - INDEX `IDX_OFFICE` (`entity_type`,`entity_id`), - UNIQUE KEY `id_uniq_m_entity_to_entity_access` (`entity_type`,`entity_id`,`access_type_code_value_id`,`second_entity_type`,`second_entity_id`), - CONSTRAINT `FK_access_type_code_m_code_value` FOREIGN KEY (`access_type_code_value_id`) REFERENCES `m_code_value` (`id`) -); - --- Global Configurations for Entity access restrictions -insert into c_configuration (name, value, enabled, description) - values ('office-specific-products-enabled', 0, 0, - 'Whether products and fees should be office specific or not? This property should NOT be changed once Mifos is Live.'); - -insert into c_configuration (name, value, enabled, description) - values ('restrict-products-to-user-office', 0, 0, - 'This should be enabled only if, products & fees are office specific (i.e. office-specific-products-enabled is enabled). This property specifies if the products should be auto-restricted to office of the user who created the proudct? Note: This property should NOT be changed once Mifos is Live.'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V229__teller_cash_management.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V229__teller_cash_management.sql deleted file mode 100644 index dffe568b3..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V229__teller_cash_management.sql +++ /dev/null @@ -1,126 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_tellers` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `office_id` BIGINT NOT NULL, - `debit_account_id` BIGINT, - `credit_account_id` BIGINT, - `name` VARCHAR(50) NOT NULL, - `description` VARCHAR(100), - `valid_from` DATE, - `valid_to` DATE, - `state` SMALLINT, - PRIMARY KEY (`id`), - UNIQUE INDEX `m_tellers_name_unq` (`name`), - INDEX `IK_m_tellers_m_office` (`office_id`), - CONSTRAINT `FK_m_tellers_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`), - CONSTRAINT `FK_m_tellers_gl_account_debit_account_id` FOREIGN KEY (`debit_account_id`) REFERENCES `acc_gl_account` (`id`), - CONSTRAINT `FK_m_tellers_gl_account_credit_account_id` FOREIGN KEY (`credit_account_id`) REFERENCES `acc_gl_account` (`id`) - ); - -CREATE TABLE `m_cashiers` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `staff_id` BIGINT, - `teller_id` BIGINT, - `description` VARCHAR(100), - `start_date` DATE, - `end_date` DATE, - `start_time` varchar(10), - `end_time` varchar(10), - `full_day` TINYINT, - PRIMARY KEY (`id`), - INDEX `IK_m_cashiers_m_staff` (`staff_id`), - INDEX `IK_m_cashiers_m_teller` (`teller_id`), - CONSTRAINT `FK_m_cashiers_m_staff` FOREIGN KEY (`staff_id`) REFERENCES `m_staff` (`id`), - CONSTRAINT `FK_m_cashiers_m_teller` FOREIGN KEY (`teller_id`) REFERENCES `m_tellers` (`id`) - ); - -CREATE TABLE `m_cashier_transactions` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `cashier_id` BIGINT NOT NULL, - `txn_type` SMALLINT NOT NULL, - `txn_amount` DECIMAL (19,6) NOT NULL, - `txn_date` DATE NOT NULL, - `created_date` DATETIME NOT NULL, - `entity_type` VARCHAR(50), - `entity_id` BIGINT, - `txn_note` VARCHAR(200), - PRIMARY KEY (`id`), - INDEX `IK_m_teller_transactions_m_cashier` (`cashier_id`), - CONSTRAINT `FK_m_teller_transactions_m_cashiers` FOREIGN KEY (`cashier_id`) REFERENCES `m_cashiers` (`id`) - ); - - - INSERT INTO m_permission ( - `grouping`, code, entity_name, action_name, can_maker_checker - ) values ( - 'cash_mgmt', 'CREATE_TELLER', 'TELLER', 'CREATE', 1 - ); - INSERT INTO m_permission ( - `grouping`, code, entity_name, action_name, can_maker_checker - ) values ( - 'cash_mgmt', 'UPDATE_TELLER', 'TELLER', 'CREATE', 1 - ); - - INSERT INTO m_permission ( - `grouping`, code, entity_name, action_name, can_maker_checker - ) values ( - 'cash_mgmt', 'ALLOCATECASHIER_TELLER', 'TELLER', 'ALLOCATE', 1 - ); - - INSERT INTO m_permission ( - `grouping`, code, entity_name, action_name, can_maker_checker - ) values ( - 'cash_mgmt', 'UPDATECASHIERALLOCATION_TELLER', 'TELLER', 'UPDATECASHIERALLOCATION', 1 - ); - - INSERT INTO m_permission ( - `grouping`, code, entity_name, action_name, can_maker_checker - ) values ( - 'cash_mgmt', 'DELETECASHIERALLOCATION_TELLER', 'TELLER', 'DELETECASHIERALLOCATION', 1 - ); - - INSERT INTO m_permission ( - `grouping`, code, entity_name, action_name, can_maker_checker - ) values ( - 'cash_mgmt', 'ALLOCATECASHTOCASHIER_TELLER', 'TELLER', 'ALLOCATECASHTOCASHIER', 1 - ); - - INSERT INTO m_permission ( - `grouping`, code, entity_name, action_name, can_maker_checker - ) values ( - 'cash_mgmt', 'SETTLECASHFROMCASHIER_TELLER', 'TELLER', 'SETTLECASHFROMCASHIER', 1 - ); - - INSERT INTO r_enum_value ( - enum_name, enum_id, enum_message_property, enum_value, enum_type - ) values ( - 'teller_status', 300, 'Active', 'Active',0 - ); - INSERT INTO r_enum_value ( - enum_name, enum_id, enum_message_property, enum_value, enum_type - ) values ( - 'teller_status', 400, 'Inactive', 'Inactive',0 - ); - INSERT INTO r_enum_value ( - enum_name, enum_id, enum_message_property, enum_value, enum_type - ) values ( - 'teller_status', 600, 'Closed', 'Closed',0 - ); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V22__alter-group-for-consistency-add-permissions.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V22__alter-group-for-consistency-add-permissions.sql deleted file mode 100644 index e288d6725..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V22__alter-group-for-consistency-add-permissions.sql +++ /dev/null @@ -1,38 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'ACTIVATE_CENTER', 'CENTER', 'ACTIVATE', 1); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'ACTIVATE_CENTER_CHECKER', 'CENTER', 'ACTIVATE', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'ACTIVATE_GROUP', 'GROUP', 'ACTIVATE', 1); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'ACTIVATE_GROUP_CHECKER', 'GROUP', 'ACTIVATE', 0); - - -ALTER TABLE `m_group` DROP FOREIGN KEY `FK_m_group_level`; -ALTER TABLE `m_group` -CHANGE COLUMN `external_id` `external_id` VARCHAR(100) NULL DEFAULT NULL AFTER `id`, -CHANGE COLUMN `status_enum` `status_enum` INT NOT NULL DEFAULT '300' AFTER `external_id`, -CHANGE COLUMN `name` `display_name` VARCHAR(100) NOT NULL AFTER `level_id`, -CHANGE COLUMN `level_Id` `level_id` INT NOT NULL, -ADD CONSTRAINT `FK_m_group_level` FOREIGN KEY (`level_id`) REFERENCES `m_group_level` (`id`); - - -ALTER TABLE `m_group` -DROP COLUMN `is_deleted`, -ADD COLUMN `activation_date` DATE NULL DEFAULT NULL AFTER `status_enum` ; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V230__role_status_and_correspoding_permissions.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V230__role_status_and_correspoding_permissions.sql deleted file mode 100644 index 38d534e89..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V230__role_status_and_correspoding_permissions.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_role` ADD COLUMN `is_disabled` tinyint NOT NULL DEFAULT 0 AFTER `description`; -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('authorisation', 'DISABLE_ROLE', 'ROLE', 'DISABLE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('authorisation', 'DISABLE_ROLE_CHECKER', 'ROLE', 'DISABLE_CHECKER', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('authorisation', 'ENABLE_ROLE', 'ROLE', 'ENABLE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('authorisation', 'ENABLE_ROLE_CHECKER', 'ROLE', 'ENABLE_CHECKER', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V231__m_cashier_transaction_added_currency_code.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V231__m_cashier_transaction_added_currency_code.sql deleted file mode 100644 index 70d1118ed..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V231__m_cashier_transaction_added_currency_code.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_cashier_transactions` ADD COLUMN `currency_code` VARCHAR(3) NULL AFTER `txn_note`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V232__insert_center_closure_reason.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V232__insert_center_closure_reason.sql deleted file mode 100644 index 986bf4cc2..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V232__insert_center_closure_reason.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_code` (`code_name`,`is_system_defined`) VALUES('CenterClosureReason',1); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V233__Savings_Transaction_Receipt.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V233__Savings_Transaction_Receipt.sql deleted file mode 100644 index 9ae26cabd..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V233__Savings_Transaction_Receipt.sql +++ /dev/null @@ -1,27 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO stretchy_parameter ( parameter_name, parameter_variable, parameter_label, parameter_displayType, parameter_FormatType, parameter_default, special, selectOne, selectAll, parameter_sql, parent_id) VALUES ('transactionId', 'transactionId', 'transactionId', 'text', 'string', 'n/a', NULL, NULL, NULL, NULL, NULL); - -INSERT INTO stretchy_report ( report_name, report_type, report_subtype, report_category, report_sql, description, core_report, use_report) VALUES ( 'Savings Transaction Receipt', 'Pentaho', NULL, NULL, NULL, NULL, 0, 1); - -INSERT INTO stretchy_report_parameter ( report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id from stretchy_report sr where sr.report_name='Savings Transaction Receipt'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='transactionId'), - 'transactionId'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V234__opening_balaces_setup.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V234__opening_balaces_setup.sql deleted file mode 100644 index 3c99ee467..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V234__opening_balaces_setup.sql +++ /dev/null @@ -1,53 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - --- Example: INSERT INTO `acc_gl_account` --- ( --- `name`, `parent_id`, `hierarchy`, `gl_code`, `disabled`, `manual_journal_entries_allowed`, --- `account_usage`, `classification_enum`, `tag_id`, `description` --- ) --- VALUES --- ( --- 'Opening Balances Contra Account', NULL, '.', 'OBCA', 0, 1, --- 1, 3, NULL, NULL --- ); - -INSERT INTO `c_configuration` - ( - `name`, - `value`, - `enabled` - ) - VALUES - ( - 'office-opening-balances-contra-account', - 0, -- Or Example: (SELECT id FROM acc_gl_account WHERE gl_code = 'OBCA' ), - 1); - -ALTER TABLE `c_configuration` - ADD UNIQUE INDEX `name_UNIQUE` (`name`); - -INSERT INTO `m_permission` - ( - `grouping`, `code`, `entity_name`, `action_name` - ) - VALUES - ( - 'accounting', 'DEFINEOPENINGBALANCE_JOURNALENTRY', 'JOURNALENTRY', 'DEFINEOPENINGBALANCE' - ); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V235__add_ugd_template_id_m_hook.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V235__add_ugd_template_id_m_hook.sql deleted file mode 100644 index 86b5ccc3b..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V235__add_ugd_template_id_m_hook.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_hook` ADD COLUMN `ugd_template_id` BIGINT NULL; -ALTER TABLE `m_hook` ADD CONSTRAINT `fk_ugd_template_id` FOREIGN KEY (`ugd_template_id`) REFERENCES `m_template` (`id`); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V236__individual_collection_sheet_permissions.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V236__individual_collection_sheet_permissions.sql deleted file mode 100644 index 6b9fe2187..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V236__individual_collection_sheet_permissions.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('collection_sheet', 'READ_COLLECTIONSHEET', 'COLLECTIONSHEET', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('collection_sheet', 'SAVE_COLLECTIONSHEET', 'COLLECTIONSHEET', 'SAVE', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V237__add_threshold_config_for_last_instalment.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V237__add_threshold_config_for_last_instalment.sql deleted file mode 100644 index c0a87b8cd..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V237__add_threshold_config_for_last_instalment.sql +++ /dev/null @@ -1,23 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_product_loan` - ADD COLUMN `principal_threshold_for_last_instalment` DECIMAL(5,2) NOT NULL DEFAULT '50'; - -update m_product_loan pl set pl.principal_threshold_for_last_instalment = 0 where pl.allow_multiple_disbursals = 0; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V238__update_staff_display_name_length.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V238__update_staff_display_name_length.sql deleted file mode 100644 index 3f36288e4..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V238__update_staff_display_name_length.sql +++ /dev/null @@ -1,23 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_staff` - ALTER `display_name` DROP DEFAULT; -ALTER TABLE `m_staff` - CHANGE COLUMN `display_name` `display_name` VARCHAR(102) NOT NULL AFTER `lastname`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V239__Loan_Transaction_Receipt.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V239__Loan_Transaction_Receipt.sql deleted file mode 100644 index d8cd47128..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V239__Loan_Transaction_Receipt.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO stretchy_report ( report_name, report_type, report_subtype, report_category, report_sql, description, core_report, use_report) VALUES ('Loan Transaction Receipt', 'Pentaho', NULL, NULL, NULL, NULL, 0, 1); -INSERT INTO stretchy_report_parameter ( report_id, parameter_id, report_parameter_name) VALUES ( (select sr.id from stretchy_report sr where sr.report_name='Loan Transaction Receipt'), (select sp.id from stretchy_parameter sp where sp.parameter_name='transactionId'), 'transactionId'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V23__remove-enable-disable-configuration-for-client-group-status.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V23__remove-enable-disable-configuration-for-client-group-status.sql deleted file mode 100644 index 5bc158ae0..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V23__remove-enable-disable-configuration-for-client-group-status.sql +++ /dev/null @@ -1,23 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -DELETE FROM `c_configuration` WHERE `name`='allow-pending-client-status'; -DELETE FROM `c_configuration` WHERE `name`='allow-pending-group-status'; - -ALTER TABLE `m_client` DROP COLUMN `is_deleted`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V240__arrears_aging_config_for_interest_recalculation.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V240__arrears_aging_config_for_interest_recalculation.sql deleted file mode 100644 index 467c4ec48..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V240__arrears_aging_config_for_interest_recalculation.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_product_loan_recalculation_details` - ADD COLUMN `arrears_based_on_original_schedule` tinyint NOT NULL DEFAULT '0'; - -ALTER TABLE `m_product_loan` - ADD COLUMN `account_moves_out_of_npa_only_on_arrears_completion` tinyint NOT NULL DEFAULT '0'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V241__fixed_emi_changes.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V241__fixed_emi_changes.sql deleted file mode 100644 index 0896ce3ec..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V241__fixed_emi_changes.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_product_loan` - ADD COLUMN `can_define_fixed_emi_amount` tinyint NOT NULL DEFAULT '0', - ADD COLUMN `instalment_amount_in_multiples_of` DECIMAL(19,6) NULL DEFAULT NULL; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V242__entitytoentitymappingrelation.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V242__entitytoentitymappingrelation.sql deleted file mode 100644 index 447f1689e..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V242__entitytoentitymappingrelation.sql +++ /dev/null @@ -1,57 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_entity_relation` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `from_entity_type` INT NOT NULL, - `to_entity_type` INT NOT NULL, - `code_name` VARCHAR(50) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE INDEX `from_entity_type_to_entity_type_code_name` (`from_entity_type`, `to_entity_type`, `code_name`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB -AUTO_INCREMENT=1 -; - -CREATE TABLE `m_entity_to_entity_mapping` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `rel_id` BIGINT NOT NULL DEFAULT '0', - `from_id` BIGINT NOT NULL DEFAULT '0', - `to_id` BIGINT UNSIGNED NOT NULL, - `start_date` DATE NULL DEFAULT NULL, - `end_date` DATE NULL DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE INDEX `rel_id_from_id_to_id` (`rel_id`, `from_id`, `to_id`), - CONSTRAINT `FK__rel_id_m_entity_relation_id` FOREIGN KEY (`rel_id`) REFERENCES `m_entity_relation` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB -AUTO_INCREMENT=1 -; - -INSERT INTO `m_entity_relation` (`from_entity_type`, `to_entity_type`, `code_name`) VALUES (1, 2, 'office_access_to_loan_products'); -INSERT INTO `m_entity_relation` (`from_entity_type`, `to_entity_type`, `code_name`) VALUES (1, 3, 'office_access_to_savings_products'); -INSERT INTO `m_entity_relation` (`from_entity_type`, `to_entity_type`, `code_name`) VALUES (1, 4, 'office_access_to_fees/charges'); -INSERT INTO `m_entity_relation` (`from_entity_type`, `to_entity_type`, `code_name`) VALUES (5, 2, 'role_access_to_loan_products'); -INSERT INTO `m_entity_relation` (`from_entity_type`, `to_entity_type`, `code_name`) VALUES (5, 3, 'role_access_to_savings_products'); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('infrastructure', 'CREATE_ENTITYMAPPING', 'ENTITYMAPPING', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('infrastructure', 'UPDATE_ENTITYMAPPING', 'ENTITYMAPPING', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('infrastructure', 'DELETE_ENTITYMAPPING', 'ENTITYMAPPING', 'DELETE', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V243__alter_loan_disbursement_details.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V243__alter_loan_disbursement_details.sql deleted file mode 100644 index abbfe36fb..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V243__alter_loan_disbursement_details.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_loan_disbursement_detail` - DROP COLUMN approved_principal; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V244__staff_assignment_history_table.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V244__staff_assignment_history_table.sql deleted file mode 100644 index 12f97f91e..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V244__staff_assignment_history_table.sql +++ /dev/null @@ -1,41 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE IF NOT EXISTS `m_staff_assignment_history` ( -`id` BIGINT NOT NULL AUTO_INCREMENT, -`centre_id` BIGINT DEFAULT NULL, -`staff_id` BIGINT NOT NULL, -`start_date` date NOT NULL, -`end_date` date DEFAULT NULL, -`createdby_id` BIGINT DEFAULT NULL, -`created_date` datetime DEFAULT NULL, -`lastmodified_date` datetime DEFAULT NULL, -`lastmodifiedby_id` BIGINT DEFAULT NULL, -PRIMARY KEY (`id`), -KEY `FK_m_staff_assignment_history_centre_id_m_group` (`centre_id`), -KEY `FK_m_staff_assignment_history_m_staff` (`staff_id`), -CONSTRAINT `FK_m_staff_assignment_history_centre_id_m_group` FOREIGN KEY (`centre_id`) REFERENCES `m_group` (`id`), -CONSTRAINT `FK_m_staff_assignment_history_m_staff` FOREIGN KEY (`staff_id`) REFERENCES `m_staff` (`id`) -); -INSERT INTO stretchy_parameter ( parameter_name, parameter_variable, parameter_label, parameter_displayType, parameter_FormatType, parameter_default, special, selectOne, selectAll, parameter_sql, parent_id) VALUES ('selectCenterId', 'centerId', 'Enter Center Id', 'text', 'string', 'n/a', NULL, NULL, NULL, NULL, NULL); -INSERT INTO stretchy_report ( report_name, report_type, report_subtype, report_category, report_sql, description, core_report, use_report) VALUES ( 'Staff Assignment History', 'Pentaho', NULL, NULL, NULL, NULL, 0, 1); -INSERT INTO stretchy_report_parameter ( report_id, parameter_id, report_parameter_name) -VALUES ((select sr.id from stretchy_report sr where sr.report_name='Staff Assignment History'), -(select sp.id from stretchy_parameter sp where sp.parameter_name='selectCenterId'), -'centerId'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V245__open_rd_changes.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V245__open_rd_changes.sql deleted file mode 100644 index 98f16736b..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V245__open_rd_changes.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`) VALUES ('Generate Mandatory Savings Schedule', 'Generate Mandatory Savings Schedule', '0 5 0 1/1 * ? *', now()); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V246__drop_group_client_foreign_key_from_m_loan.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V246__drop_group_client_foreign_key_from_m_loan.sql deleted file mode 100644 index 4152c46d4..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V246__drop_group_client_foreign_key_from_m_loan.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_loan` - DROP FOREIGN KEY `fk_m_group_client_001`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V247__consistency_wrt_spelling_principalThresholdForLastInstalment.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V247__consistency_wrt_spelling_principalThresholdForLastInstalment.sql deleted file mode 100644 index 62fccebe8..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V247__consistency_wrt_spelling_principalThresholdForLastInstalment.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -ALTER TABLE `m_product_loan` - CHANGE COLUMN `principal_threshold_for_last_instalment` `principal_threshold_for_last_installment` DECIMAL(5,2) NOT NULL DEFAULT '50.00' AFTER `hold_guarantee_funds`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V248__added_password_never_expired_to_User.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V248__added_password_never_expired_to_User.sql deleted file mode 100644 index 933ed0f9a..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V248__added_password_never_expired_to_User.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_appuser` ADD `password_never_expires` TINYINT NOT NULL DEFAULT '0' COMMENT 'define if the password, should be check for validity period or not'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V249__workingdays_permissions.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V249__workingdays_permissions.sql deleted file mode 100644 index 77c2e1d0a..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V249__workingdays_permissions.sql +++ /dev/null @@ -1,52 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` ( -`grouping` , -`code` , -`entity_name` , -`action_name` , -`can_maker_checker` -) -VALUES ( - 'organisation', 'READ_WORKINGDAYS', 'WORKINGDAYS', 'READ', '0' -); - - -INSERT INTO `m_permission` ( -`grouping` , -`code` , -`entity_name` , -`action_name` , -`can_maker_checker` -) -VALUES ( - 'organisation', 'UPDATE_WORKINGDAYS', 'WORKINGDAYS', 'UPDATE', '0' -); - -INSERT INTO `m_permission` ( -`grouping` , -`code` , -`entity_name` , -`action_name` , -`can_maker_checker` -) -VALUES ( - 'organisation', 'UPDATE_WORKINGDAYS_CHECKER', 'WORKINGDAYS', 'UPDATE_CHECKER', '0' -); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V24__add-group-client-foreign-key-constraint-in-loan-table.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V24__add-group-client-foreign-key-constraint-in-loan-table.sql deleted file mode 100644 index 2cdaf47c3..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V24__add-group-client-foreign-key-constraint-in-loan-table.sql +++ /dev/null @@ -1,26 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE m_loan -ADD CONSTRAINT `fk_m_group_client_001` -FOREIGN KEY (`group_id` , `client_id` ) -REFERENCES m_group_client (`group_id` , `client_id` ) -ON DELETE NO ACTION -ON UPDATE NO ACTION -, ADD INDEX `fk_m_group_client_001_idx` (`group_id` ASC, `client_id` ASC) ; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V250__password_validation_policy.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V250__password_validation_policy.sql deleted file mode 100644 index 0442935f4..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V250__password_validation_policy.sql +++ /dev/null @@ -1,57 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -CREATE TABLE IF NOT EXISTS `m_password_validation_policy` ( - `id` INT NOT NULL AUTO_INCREMENT, - `regex` text NOT NULL, - `description` text NOT NULL, - `active` TINYINT NOT NULL DEFAULT '0', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4 AUTO_INCREMENT=1 ; - - -INSERT INTO `m_password_validation_policy` ( -`id` , -`regex` , -`description` , -`active` -) -VALUES ( -NULL , '^.{1,50}$', 'Password most be at least 1 character and not more that 50 characters long', '1' -); - -INSERT INTO `m_password_validation_policy` ( -`id` , -`regex` , -`description` , -`active` -) -VALUES ( -NULL , '^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?!.*\\s).{6,50}$', 'Password must be at least 6 characters, no more than 50 characters long, must include at least one upper case letter, one lower case letter, one numeric digit and no space', '0' -); - -INSERT INTO m_permission (`grouping`, code, entity_name, action_name, can_maker_checker) -VALUE ("authorisation","READ_PASSWORD_PREFERENCES","PASSWORD_PREFERENCES","READ",0); - -INSERT INTO m_permission (`grouping`, code, entity_name, action_name, can_maker_checker) -VALUE ("authorisation","UPDATE_PASSWORD_PREFERENCES","PASSWORD_PREFERENCES","UPDATE",0); - -INSERT INTO m_permission (`grouping`, code, entity_name, action_name, can_maker_checker) -VALUE ("authorisation","UPDATE_PASSWORD_PREFERENCES_CHECKER","PASSWORD_PREFERENCES","UPDATE_CHECKER",0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V251__paymentType_table.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V251__paymentType_table.sql deleted file mode 100644 index 937e5d9d5..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V251__paymentType_table.sql +++ /dev/null @@ -1,65 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_payment_type` ( - `id` INT NOT NULL AUTO_INCREMENT, - `value` VARCHAR(100) NULL DEFAULT NULL, - `description` VARCHAR(500) NULL DEFAULT NULL, - `is_cash_payment` tinyint NULL DEFAULT '0', - `order_position` INT NOT NULL DEFAULT '0', - PRIMARY KEY (`id`) -) -COLLATE='utf8mb4_general_ci'; - -INSERT INTO m_payment_type (id,value,description,order_position) -SELECT id,code_value,code_description,order_position -FROM m_code_value -where code_id in -(select mc.id -from m_code mc where mc.code_name='PaymentType' -); - -ALTER TABLE `m_payment_detail` - DROP FOREIGN KEY `FK_m_payment_detail_m_code_value`; - -ALTER TABLE `m_payment_detail` - CHANGE COLUMN `payment_type_cv_id` `payment_type_id` INT NULL DEFAULT NULL AFTER `id`; - -ALTER TABLE `m_payment_detail` - ADD CONSTRAINT `FK_m_payment_detail_m_payment_type` FOREIGN KEY (`payment_type_id`) REFERENCES `m_payment_type` (`id`); - -ALTER TABLE `acc_product_mapping` - DROP FOREIGN KEY `FK_acc_product_mapping_m_code_value`; - -ALTER TABLE `acc_product_mapping` - ADD CONSTRAINT `FK_acc_product_mapping_m_payment_type` FOREIGN KEY (`payment_type`) REFERENCES `m_payment_type` (`id`); - -DELETE from m_code_value -WHERE -m_code_value.code_id in -(SELECT mc.id -FROM m_code mc where mc.code_name='PaymentType' ); - -DELETE FROM m_code WHERE code_name="PaymentType"; - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'CREATE_PAYMENTTYPE', 'PAYMENTTYPE', 'CREATE', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATE_PAYMENTTYPE', 'PAYMENTTYPE', 'UPDATE', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'DELETE_PAYMENTTYPE', 'PAYMENTTYPE', 'DELETE', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V252__bug_fix_teller_cash_management.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V252__bug_fix_teller_cash_management.sql deleted file mode 100644 index 53a40db7c..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V252__bug_fix_teller_cash_management.sql +++ /dev/null @@ -1,32 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -UPDATE m_permission SET -action_name="UPDATE" -WHERE -code = "UPDATE_TELLER"; - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`) VALUES ('cash_mgmt', 'DELETE_TELLER', 'TELLER', 'DELETE'); - - -ALTER TABLE `m_cashier_transactions` - DROP FOREIGN KEY `FK_m_teller_transactions_m_cashiers`; - -ALTER TABLE `m_cashier_transactions` - ADD CONSTRAINT `FK_m_teller_transactions_m_cashiers` FOREIGN KEY (`cashier_id`) REFERENCES `m_cashiers` (`id`) ON UPDATE CASCADE ON DELETE CASCADE; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V253__product_loan_configurable_attributes.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V253__product_loan_configurable_attributes.sql deleted file mode 100644 index 9edfaf0a2..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V253__product_loan_configurable_attributes.sql +++ /dev/null @@ -1,40 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_product_loan_configurable_attributes` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `loan_product_id` BIGINT NOT NULL, - `amortization_method_enum` TINYINT NOT NULL DEFAULT '1', - `interest_method_enum` TINYINT NOT NULL DEFAULT '1', - `loan_transaction_strategy_id` TINYINT NOT NULL DEFAULT '1', - `interest_calculated_in_period_enum` TINYINT NOT NULL DEFAULT '1', - `arrearstolerance_amount` TINYINT NOT NULL DEFAULT '1', - `repay_every` TINYINT NOT NULL DEFAULT '1', - `moratorium` TINYINT NOT NULL DEFAULT '1', - `grace_on_arrears_ageing` TINYINT NOT NULL DEFAULT '1', - PRIMARY KEY (`id`), - KEY `fk_m_product_loan_configurable_attributes_0001` (`loan_product_id`), - CONSTRAINT `fk_m_product_loan_configurable_attributes_0001` FOREIGN KEY (`loan_product_id`) REFERENCES `m_product_loan` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - - - INSERT into `m_product_loan_configurable_attributes` -(loan_product_id,amortization_method_enum,interest_method_enum,loan_transaction_strategy_id, -interest_calculated_in_period_enum,arrearstolerance_amount,repay_every,moratorium,grace_on_arrears_ageing) -(select pl.id,'1','1','1','1','1','1','1','1' from `m_product_loan` pl ); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V254__General_Ledger_Report.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V254__General_Ledger_Report.sql deleted file mode 100644 index b71c6c918..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V254__General_Ledger_Report.sql +++ /dev/null @@ -1,42 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('GeneralLedgerReport', 'Pentaho', NULL, 'Accounting', NULL, NULL, 0, 1); - -INSERT INTO `stretchy_parameter` (`parameter_name`, `parameter_variable`, `parameter_label`, `parameter_displayType`, `parameter_FormatType`, `parameter_default`, `special`, `selectOne`, `selectAll`, `parameter_sql`, `parent_id`) VALUES ('SelectGLAccountNO', 'GLAccountNO', 'GLAccountNO', 'select', 'number', '0', NULL, NULL, NULL, '\r\n\r\n\r\n\r\n\r\n(select id aid,name aname\r\nfrom acc_gl_account)\r\nunion\r\n(select -1,\'ALL\') \r\norder by 1 ', NULL); - -INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES - ((select sr.id from stretchy_report sr where sr.report_name='GeneralLedgerReport'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='SelectGLAccountNO'), - 'Account'); - - INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES - ((select sr.id from stretchy_report sr where sr.report_name='GeneralLedgerReport'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='startDateselect'), - 'ondate'); - - INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES - ((select sr.id from stretchy_report sr where sr.report_name='GeneralLedgerReport'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='endDateselect'), - 'todate'); - - INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES - ((select sr.id from stretchy_report sr where sr.report_name='GeneralLedgerReport'), - (select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne'), - 'office'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V255__pre_close_interest_period_config.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V255__pre_close_interest_period_config.sql deleted file mode 100644 index 5080f9b49..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V255__pre_close_interest_period_config.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_product_loan_recalculation_details` - ADD COLUMN `pre_close_interest_calculation_strategy` SMALLINT NOT NULL DEFAULT '1'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V256__Update script for General_Ledger_report.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V256__Update script for General_Ledger_report.sql deleted file mode 100644 index 9bc1b4f11..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V256__Update script for General_Ledger_report.sql +++ /dev/null @@ -1,51 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -update stretchy_report_parameter -set report_parameter_name='account' -where report_id = (select stretchy_report.id from stretchy_report where report_name='GeneralLedgerReport') -and parameter_id=(select p.id from stretchy_parameter p where parameter_name='SelectGLAccountNO'); - - -update stretchy_report_parameter -set report_parameter_name='fromDate' -where report_id =(select stretchy_report.id from stretchy_report where report_name='GeneralLedgerReport') -and parameter_id=(select p.id from stretchy_parameter p where parameter_name='startDateSelect'); - -update stretchy_report_parameter -set report_parameter_name='toDate' -where report_id=(select stretchy_report.id from stretchy_report where report_name='GeneralLedgerReport') -and parameter_id=(select p.id from stretchy_parameter p where parameter_name='endDateSelect'); - -update stretchy_report_parameter -set report_parameter_name='branch' -where report_id=(select stretchy_report.id from stretchy_report where report_name='GeneralLedgerReport') -and parameter_id=(select p.id from stretchy_parameter p where parameter_name='OfficeIdSelectOne'); - -INSERT INTO `m_permission` ( -`grouping` , -`code` , -`entity_name` , -`action_name` , -`can_maker_checker` -) VALUES ('report', 'READ_General Ledger Report', 'General Ledger Report', 'READ', 0); - -update `stretchy_parameter` -set `parameter_sql` = 'select id aid,name aname\r\nfrom acc_gl_account' -where stretchy_parameter.parameter_name='SelectGLAccountNO'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V257__staff_image_association.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V257__staff_image_association.sql deleted file mode 100644 index fb31d9e03..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V257__staff_image_association.sql +++ /dev/null @@ -1,35 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_staff` - ADD COLUMN `image_id` BIGINT NULL, - ADD CONSTRAINT `FK_m_staff_m_image` FOREIGN KEY (`image_id`) REFERENCES `m_image` (`id`); - -INSERT INTO m_permission ( -`grouping` , -code , -entity_name , -action_name , -can_maker_checker -) VALUES -('portfolio', 'READ_STAFFIMAGE', 'STAFFIMAGE', 'READ', '0'), -('portfolio', 'CREATE_STAFFIMAGE', 'STAFFIMAGE', 'CREATE', '1'), -('portfolio', 'CREATE_STAFFIMAGE_CHECKER', 'STAFFIMAGE', 'CREATE', '0'), -('portfolio', 'DELETE_STAFFIMAGE', 'STAFFIMAGE', 'DELETE', '1'), -('portfolio', 'DELETE_STAFFIMAGE_CHECKER', 'STAFFIMAGE', 'DELETE', '0'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V258__interest_compounding_changes.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V258__interest_compounding_changes.sql deleted file mode 100644 index 63497f84f..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V258__interest_compounding_changes.sql +++ /dev/null @@ -1,29 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_product_loan_recalculation_details` - ADD COLUMN `compounding_frequency_type_enum` SMALLINT NULL DEFAULT NULL, - ADD COLUMN `compounding_frequency_interval` SMALLINT NULL DEFAULT NULL, - ADD COLUMN `compounding_freqency_date` DATE NULL DEFAULT NULL; - - -ALTER TABLE `m_loan_recalculation_details` - ADD COLUMN `compounding_frequency_type_enum` SMALLINT NULL DEFAULT NULL, - ADD COLUMN `compounding_frequency_interval` SMALLINT NULL DEFAULT NULL, - ADD COLUMN `compounding_freqency_date` DATE NULL DEFAULT NULL; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V259__alter_working_days.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V259__alter_working_days.sql deleted file mode 100644 index a348e2483..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V259__alter_working_days.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_working_days` ADD extend_term_daily_repayments tinyint NULL DEFAULT '0'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V25__update_client_reports_for_status_and_activation_change.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V25__update_client_reports_for_status_and_activation_change.sql deleted file mode 100644 index d3e616f32..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V25__update_client_reports_for_status_and_activation_change.sql +++ /dev/null @@ -1,101 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -update stretchy_report -set report_sql = "select -concat(repeat("".."", - ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, '.', '')) - 1))), ounder.`name`) as ""Office/Branch"", - c.account_no as ""Client Account No."", -c.display_name as ""Name"", -r.enum_message_property as ""Status"", -c.activation_date as ""Activation"", c.external_id as ""External Id"" -from m_office o -join m_office ounder on ounder.hierarchy like concat(o.hierarchy, '%') -and ounder.hierarchy like concat('${currentUserHierarchy}', '%') -join m_client c on c.office_id = ounder.id -left join r_enum_value r on r.enum_name = 'status_enum' and r.enum_id = c.status_enum -where o.id = ${officeId} -order by ounder.hierarchy, c.account_no" - -where report_name = 'Client Listing'; - -update stretchy_report -set report_sql = "select -concat(repeat("".."", - ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, '.', '')) - 1))), ounder.`name`) as ""Office/Branch"", c.account_no as ""Client Account No."", -c.display_name as ""Name"", -r.enum_message_property as ""Client Status"", -lo.display_name as ""Loan Officer"", l.account_no as ""Loan Account No."", l.external_id as ""External Id"", p.name as Loan, st.enum_message_property as ""Status"", -f.`name` as Fund, purp.code_value as ""Loan Purpose"", -ifnull(cur.display_symbol, l.currency_code) as Currency, -l.principal_amount, l.arrearstolerance_amount as ""Arrears Tolerance Amount"", -l.number_of_repayments as ""Expected No. Repayments"", -l.annual_nominal_interest_rate as "" Annual Nominal Interest Rate"", -l.nominal_interest_rate_per_period as ""Nominal Interest Rate Per Period"", -ipf.enum_message_property as ""Interest Rate Frequency"", -im.enum_message_property as ""Interest Method"", -icp.enum_message_property as ""Interest Calculated in Period"", -l.term_frequency as ""Term Frequency"", -tf.enum_message_property as ""Term Frequency Period"", -l.repay_every as ""Repayment Frequency"", -rf.enum_message_property as ""Repayment Frequency Period"", -am.enum_message_property as ""Amortization"", -l.total_charges_due_at_disbursement_derived as ""Total Charges Due At Disbursement"", -date(l.submittedon_date) as Submitted, date(l.approvedon_date) Approved, l.expected_disbursedon_date As ""Expected Disbursal"", -date(l.expected_firstrepaymenton_date) as ""Expected First Repayment"", -date(l.interest_calculated_from_date) as ""Interest Calculated From"" , -date(l.disbursedon_date) as Disbursed, -date(l.expected_maturedon_date) ""Expected Maturity"", -date(l.maturedon_date) as ""Matured On"", date(l.closedon_date) as Closed, -date(l.rejectedon_date) as Rejected, date(l.rescheduledon_date) as Rescheduled, -date(l.withdrawnon_date) as Withdrawn, date(l.writtenoffon_date) ""Written Off"" -from m_office o -join m_office ounder on ounder.hierarchy like concat(o.hierarchy, '%') -and ounder.hierarchy like concat('${currentUserHierarchy}', '%') -join m_client c on c.office_id = ounder.id -left join r_enum_value r on r.enum_name = 'status_enum' - and r.enum_id = c.status_enum -left join m_loan l on l.client_id = c.id -left join m_staff lo on lo.id = l.loan_officer_id -left join m_product_loan p on p.id = l.product_id -left join m_fund f on f.id = l.fund_id -left join r_enum_value st on st.enum_name = ""loan_status_id"" and st.enum_id = l.loan_status_id -left join r_enum_value ipf on ipf.enum_name = ""interest_period_frequency_enum"" - and ipf.enum_id = l.interest_period_frequency_enum -left join r_enum_value im on im.enum_name = ""interest_method_enum"" - and im.enum_id = l.interest_method_enum -left join r_enum_value tf on tf.enum_name = ""term_period_frequency_enum"" - and tf.enum_id = l.term_period_frequency_enum -left join r_enum_value icp on icp.enum_name = ""interest_calculated_in_period_enum"" - and icp.enum_id = l.interest_calculated_in_period_enum -left join r_enum_value rf on rf.enum_name = ""repayment_period_frequency_enum"" - and rf.enum_id = l.repayment_period_frequency_enum -left join r_enum_value am on am.enum_name = ""amortization_method_enum"" - and am.enum_id = l.amortization_method_enum -left join m_code_value purp on purp.id = l.loanpurpose_cv_id -left join m_currency cur on cur.code = l.currency_code -where o.id = ${officeId} -and (l.currency_code = ""$\{currencyId}"" or ""-1"" = ""$\{currencyId}"") -and (l.product_id = ""${loanProductId}"" or ""-1"" = ""${loanProductId}"") -and (ifnull(l.loan_officer_id, -10) = ""${loanOfficerId}"" or ""-1"" = ""${loanOfficerId}"") -and (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId}) -and (ifnull(l.loanpurpose_cv_id, -10) = ${loanPurposeId} or -1 = ${loanPurposeId}) -order by ounder.hierarchy, 2 , l.id" - -where report_name = 'Client Loans Listing'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V260__alter_password_validation_policy.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V260__alter_password_validation_policy.sql deleted file mode 100644 index fda1ce2b8..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V260__alter_password_validation_policy.sql +++ /dev/null @@ -1,23 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_password_validation_policy` ADD COLUMN `key` VARCHAR(255) NOT NULL; - -UPDATE `m_password_validation_policy` pvp SET pvp.`key`='simple' where pvp.id='1' ; -UPDATE `m_password_validation_policy` pvp SET pvp.`key`='secure' where pvp.id='2' ; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V261__Update script for Client_Loan_Account_Schedule_Report.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V261__Update script for Client_Loan_Account_Schedule_Report.sql deleted file mode 100644 index b953d4182..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V261__Update script for Client_Loan_Account_Schedule_Report.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -update stretchy_report_parameter scr set scr.report_parameter_name='selectLoan' where scr.report_id=(select sr.id from -stretchy_report sr where report_name='Client Loan Account Schedule') -and scr.parameter_id=(select sp.id from stretchy_parameter sp where parameter_label = 'Enter Account No'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V262__accountNumber_for_groups.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V262__accountNumber_for_groups.sql deleted file mode 100644 index eb7210a09..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V262__accountNumber_for_groups.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE m_group ADD COLUMN `account_no` VARCHAR(20) NOT NULL; -UPDATE m_group set account_no = lpad(id,9,0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V263__mifos_reports.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V263__mifos_reports.sql deleted file mode 100644 index 318ba8660..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V263__mifos_reports.sql +++ /dev/null @@ -1,42 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Active Loan Summary per Branch', 'Pentaho', NULL, 'Loans', NULL, NULL, 0, 1); - -INSERT INTO `stretchy_parameter` (`parameter_name`, `parameter_variable`, `parameter_label`, `parameter_displayType`, `parameter_FormatType`, `parameter_default`, `special`, `selectOne`, `selectAll`, `parameter_sql`, `parent_id`) VALUES ('asOnDate', 'asOn', 'As On', 'date', 'date', 'today', NULL, NULL, NULL, NULL, NULL); - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Balance Outstanding', 'Pentaho', NULL, 'Loans', NULL, NULL, 0, 1); - -INSERT INTO `stretchy_report_parameter` (report_id,parameter_id,report_parameter_name) VALUES ((select id from stretchy_report where report_name = 'Balance Outstanding'),(select id from stretchy_parameter where parameter_name='OfficeIdSelectOne'),'branch'); -INSERT INTO `stretchy_report_parameter` (report_id,parameter_id,report_parameter_name) VALUES ((select id from stretchy_report where report_name = 'Balance Outstanding'),(select id from stretchy_parameter where parameter_name='asOnDate'),'ondate'); - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Collection Report', 'Pentaho', NULL, 'Loans', NULL, NULL, 0, 1); -INSERT INTO `stretchy_report_parameter` (report_id,parameter_id,report_parameter_name) VALUES ((select id from stretchy_report where report_name = 'Collection Report'),(select id from stretchy_parameter where parameter_name='OfficeIdSelectOne'),'branch'); -INSERT INTO `stretchy_report_parameter` (report_id,parameter_id,report_parameter_name) VALUES ((select id from stretchy_report where report_name = 'Collection Report'),(select id from stretchy_parameter where parameter_name='startDateSelect'),'fromDate'); -INSERT INTO `stretchy_report_parameter` (report_id,parameter_id,report_parameter_name) VALUES ((select id from stretchy_report where report_name = 'Collection Report'),(select id from stretchy_parameter where parameter_name='endDateSelect'),'toDate'); - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Disbursal Report', 'Pentaho', NULL, 'Loans', NULL, NULL, 0, 1); -INSERT INTO `stretchy_report_parameter` (report_id,parameter_id,report_parameter_name) VALUES ((select id from stretchy_report where report_name = 'Disbursal Report'),(select id from stretchy_parameter where parameter_name='OfficeIdSelectOne'),'branch'); -INSERT INTO `stretchy_report_parameter` (report_id,parameter_id,report_parameter_name) VALUES ((select id from stretchy_report where report_name = 'Disbursal Report'),(select id from stretchy_parameter where parameter_name='startDateSelect'),'fromDate'); -INSERT INTO `stretchy_report_parameter` (report_id,parameter_id,report_parameter_name) VALUES ((select id from stretchy_report where report_name = 'Disbursal Report'),(select id from stretchy_parameter where parameter_name='endDateSelect'),'toDate'); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Active Loan Summary per Branch', 'Active Loan Summary per Branch', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Disbursal Report', 'Disbursal Report', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Balance Outstanding', 'Balance Outstanding', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('report', 'READ_Collection Report', 'Collection Report', 'READ', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V264__insert_paymenttype_and_report_read_permission.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V264__insert_paymenttype_and_report_read_permission.sql deleted file mode 100644 index d4239adea..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V264__insert_paymenttype_and_report_read_permission.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO m_permission (`grouping`,code,entity_name,action_name,can_maker_checker) VALUES ('portfolio','READ_PAYMENTTYPE','PAYMENTTYPE','READ',0); -INSERT INTO m_permission (`grouping`,code,entity_name,action_name,can_maker_checker) VALUES ('report','READ_Staff Assignment History','Staff Assignment History(Pentaho)','READ',0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V265__modify_external_service_schema.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V265__modify_external_service_schema.sql deleted file mode 100644 index b83799cfb..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V265__modify_external_service_schema.sql +++ /dev/null @@ -1,66 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - - - -alter table c_external_service drop index name; - -Rename table c_external_service to c_external_service_properties; - -CREATE TABLE `c_external_service` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `name` VARCHAR(100) NULL DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `name_UNIQUE` (`name`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; - -insert into `c_external_service` ( `name`) values( 'S3'); - -Alter table c_external_service_properties - ADD COLUMN `external_service_id` BIGINT NULL DEFAULT NULL; - -update c_external_service_properties set external_service_id = (select id from c_external_service where name = 'S3'); - -ALTER TABLE `c_external_service_properties` - CHANGE COLUMN `external_service_id` `external_service_id` BIGINT NOT NULL; - -ALTER TABLE `c_external_service_properties` - ADD CONSTRAINT `FK_c_external_service_properties_c_external_service` FOREIGN KEY (`external_service_id`) REFERENCES `c_external_service` (`id`); - - -insert into `c_external_service` ( `name`) values( 'SMTP_Email_Account'); - -insert into c_external_service_properties (`name`, `value`, `external_service_id`) values('username', 'support@cloudmicrofinance.com', (select id from c_external_service where name = 'SMTP_Email_Account')); - -insert into c_external_service_properties (`name`, `value`, `external_service_id`) values('password', 'support80', (select id from c_external_service where name = 'SMTP_Email_Account')); - -insert into c_external_service_properties (`name`, `value`, `external_service_id`) values('host', 'localhost', (select id from c_external_service where name = 'SMTP_Email_Account')); - -insert into c_external_service_properties (`name`, `value`, `external_service_id`) values('port', '3025', (select id from c_external_service where name = 'SMTP_Email_Account')); - -insert into c_external_service_properties (`name`, `value`, `external_service_id`) values('useTLS', 'true', (select id from c_external_service where name = 'SMTP_Email_Account')); - -insert into m_permission(`grouping`, code, entity_name, action_name, can_maker_checker) values('externalservices', 'UPDATE_EXTERNALSERVICES', 'EXTERNALSERVICES', 'UPDATE', 0); - - - -commit; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V266__client_fees.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V266__client_fees.sql deleted file mode 100644 index c12e260e6..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V266__client_fees.sql +++ /dev/null @@ -1,103 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - --- add permissions for Client Fees - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'READ_CLIENTCHARGE', 'CLIENTCHARGE', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'CREATE_CLIENTCHARGE', 'CLIENTCHARGE', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'DELETE_CLIENTCHARGE', 'CLIENTCHARGE', 'DELETE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'WAIVE_CLIENTCHARGE', 'CLIENTCHARGE', 'WAIVE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'PAY_CLIENTCHARGE', 'CLIENTCHARGE', 'PAY', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'INACTIVATE_CLIENTCHARGE', 'CLIENTCHARGE', 'INACTIVATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATE_CLIENTCHARGE', 'CLIENTCHARGE', 'UPDATE', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'CREATE_CLIENTCHARGE_CHECKER', 'CLIENTCHARGE', 'CREATE_CHECKER', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'DELETE_CLIENTCHARGE_CHECKER', 'CLIENTCHARGE', 'DELETE_CHECKER', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'WAIVE_CLIENTCHARGE_CHECKER', 'CLIENTCHARGE', 'WAIVE_CHECKER', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'PAY_CLIENTCHARGE_CHECKER', 'CLIENTCHARGE', 'PAY_CHECKER', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'INACTIVATE_CLIENTCHARGE_CHECKER', 'CLIENTCHARGE', 'INACTIVATE_CHECKER', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATE_CLIENTCHARGE_CHECKER', 'CLIENTCHARGE', 'UPDATE_CHECKER', 0); - - --- new tables -CREATE TABLE `m_client_transaction` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `client_id` BIGINT NOT NULL, - `office_id` BIGINT NOT NULL, - `currency_code` VARCHAR(3) NOT NULL, - `payment_detail_id` BIGINT NULL DEFAULT NULL, - `is_reversed` tinyint NOT NULL, - `external_id` VARCHAR(50) NULL DEFAULT NULL, - `transaction_date` DATE NOT NULL, - `transaction_type_enum` SMALLINT NOT NULL, - `amount` DECIMAL(19,6) NOT NULL, - `created_date` DATETIME NOT NULL, - `appuser_id` BIGINT NOT NULL, - PRIMARY KEY (`id`), - UNIQUE INDEX `external_id` (`external_id`), - INDEX `FK_m_client_transaction_m_client` (`client_id`), - INDEX `FK_m_client_transaction_m_appuser` (`appuser_id`), - CONSTRAINT `FK_m_client_transaction_m_appuser` FOREIGN KEY (`appuser_id`) REFERENCES `m_appuser` (`id`), - CONSTRAINT `FK_m_client_transaction_m_client` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB -; - -CREATE TABLE `m_client_charge` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `client_id` BIGINT NOT NULL, - `charge_id` BIGINT NOT NULL, - `is_penalty` tinyint NOT NULL, - `charge_time_enum` SMALLINT NOT NULL, - `charge_due_date` DATE NULL DEFAULT NULL, - `charge_calculation_enum` SMALLINT NOT NULL, - `amount` DECIMAL(19,6) NOT NULL, - `amount_paid_derived` DECIMAL(19,6) NULL DEFAULT NULL, - `amount_waived_derived` DECIMAL(19,6) NULL DEFAULT NULL, - `amount_writtenoff_derived` DECIMAL(19,6) NULL DEFAULT NULL, - `amount_outstanding_derived` DECIMAL(19,6) NOT NULL, - `is_paid_derived` tinyint NULL DEFAULT NULL, - `waived` tinyint NULL DEFAULT NULL, - `is_active` tinyint NULL DEFAULT NULL, - `inactivated_on_date` DATE NULL DEFAULT NULL, - PRIMARY KEY (`id`), - INDEX `FK_m_client_charge_m_client` (`client_id`), - INDEX `FK_m_client_charge_m_charge` (`charge_id`), - CONSTRAINT `FK_m_client_charge_m_charge` FOREIGN KEY (`charge_id`) REFERENCES `m_charge` (`id`), - CONSTRAINT `FK_m_client_charge_m_client` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB -; - -CREATE TABLE `m_client_charge_paid_by` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `client_transaction_id` BIGINT NOT NULL, - `client_charge_id` BIGINT NOT NULL, - `amount` DECIMAL(19,6) NOT NULL, - PRIMARY KEY (`id`), - INDEX `FK_m_client_charge_paid_by_m_client_transaction` (`client_transaction_id`), - INDEX `FK_m_client_charge_paid_by_m_client_charge` (`client_charge_id`), - CONSTRAINT `FK_m_client_charge_paid_by_m_client_charge` FOREIGN KEY (`client_charge_id`) REFERENCES `m_client_charge` (`id`), - CONSTRAINT `FK_m_client_charge_paid_by_m_client_transaction` FOREIGN KEY (`client_transaction_id`) REFERENCES `m_client_transaction` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB -; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V267__client_transaction_permissions.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V267__client_transaction_permissions.sql deleted file mode 100644 index 5ecafeb33..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V267__client_transaction_permissions.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('transaction_client', 'READTRANSACTION_CLIENT', 'CLIENT', 'READTRANSACTION', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('transaction_client', 'UNDOTRANSACTION_CLIENT', 'CLIENT', 'UNDOTRANSACTION', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('transaction_client', 'UNDOTRANSACTION_CLIENT_CHECKER', 'CLIENT', 'UNDOTRANSACTION_CHECKER', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V268__update_gmail_password.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V268__update_gmail_password.sql deleted file mode 100644 index 4d066c89c..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V268__update_gmail_password.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -update c_external_service_properties set value = 'support81' where name = 'password' and external_service_id = (select id from c_external_service where name = 'SMTP_Email_Account'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V269__increased_calendar_title_length .sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V269__increased_calendar_title_length .sql deleted file mode 100644 index b9ddc3922..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V269__increased_calendar_title_length .sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_calendar` - CHANGE COLUMN `title` `title` VARCHAR(70) NOT NULL; - -ALTER TABLE `m_calendar_history` - CHANGE COLUMN `title` `title` VARCHAR(70) NOT NULL; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V26__add-support-for-withdrawal-fees-on-savings.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V26__add-support-for-withdrawal-fees-on-savings.sql deleted file mode 100644 index 72f67e9e3..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V26__add-support-for-withdrawal-fees-on-savings.sql +++ /dev/null @@ -1,31 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_savings_product` -ADD COLUMN `withdrawal_fee_amount` DECIMAL(19,6) NULL DEFAULT NULL AFTER `lockin_period_frequency_enum`, -ADD COLUMN `withdrawal_fee_type_enum` SMALLINT NULL DEFAULT NULL AFTER `withdrawal_fee_amount`; - - -ALTER TABLE `m_savings_account` -ADD COLUMN `withdrawal_fee_amount` DECIMAL(19,6) NULL DEFAULT NULL AFTER `lockin_period_frequency_enum`, -ADD COLUMN `withdrawal_fee_type_enum` SMALLINT NULL DEFAULT NULL AFTER `withdrawal_fee_amount`; - - -ALTER TABLE `m_savings_account` -ADD COLUMN `total_withdrawal_fees_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `total_withdrawals_derived`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V270__add_rounding_mode_configuration.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V270__add_rounding_mode_configuration.sql deleted file mode 100644 index b858c48c5..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V270__add_rounding_mode_configuration.sql +++ /dev/null @@ -1,23 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `c_configuration` - ADD COLUMN `is_trap_door` boolean NOT NULL DEFAULT '0' AFTER `enabled`; - -insert into c_configuration(name, value, enabled, is_trap_door, description) values('rounding-mode', '6', '1', '1', '0 - UP, 1 - DOWN, 2- CEILING, 3- FLOOR, 4- HALF_UP, 5- HALF_DOWN, 6 - HALF_EVEN'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V271_1__withdrawal_charges_discount.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V271_1__withdrawal_charges_discount.sql deleted file mode 100644 index 76c0db17a..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V271_1__withdrawal_charges_discount.sql +++ /dev/null @@ -1,40 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -ALTER TABLE `m_charge` ADD COLUMN `is_free_withdrawal` INT NOT NULL DEFAULT '0' AFTER `fee_frequency`; - - -ALTER TABLE `m_charge` - ADD COLUMN `free_withdrawal_charge_frequency` INT NULL DEFAULT '0' AFTER `is_free_withdrawal`; - - -ALTER TABLE `m_charge` - ADD COLUMN `restart_frequency` INT NULL DEFAULT '0' AFTER `free_withdrawal_charge_frequency`; - - -ALTER TABLE `m_charge` - ADD COLUMN `restart_frequency_enum` INT NULL DEFAULT '0' AFTER `restart_frequency`; - - -ALTER TABLE `m_savings_account_charge` - ADD COLUMN `free_withdrawal_count` INT NULL DEFAULT '0' AFTER `fee_interval`; - -ALTER TABLE `m_savings_account_charge` - ADD COLUMN `charge_reset_date` DATE NULL DEFAULT NULL AFTER `free_withdrawal_count`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V271_2__withdrawal_charges_paymenttype.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V271_2__withdrawal_charges_paymenttype.sql deleted file mode 100644 index 8a77ba434..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V271_2__withdrawal_charges_paymenttype.sql +++ /dev/null @@ -1,27 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_charge` - ADD COLUMN `is_payment_type` INT NULL DEFAULT '0' AFTER `restart_frequency_enum`; - -ALTER TABLE `m_charge` - ADD COLUMN `payment_type_id` INT(11) NULL DEFAULT NULL AFTER `is_payment_type`; - -ALTER TABLE `m_charge` -ADD CONSTRAINT `FK_m_payment_detail_m_payment_types` FOREIGN KEY (`payment_type_id`) REFERENCES `m_payment_type` (`id`); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V271__accounting_for_client_charges.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V271__accounting_for_client_charges.sql deleted file mode 100644 index c0989cb2a..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V271__accounting_for_client_charges.sql +++ /dev/null @@ -1,28 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - --- Charges have a reference to an Income or Liability account that gets credited when a payment is made -ALTER TABLE `m_charge` - ADD COLUMN `income_or_liability_account_id` BIGINT NULL AFTER `fee_frequency`, - ADD CONSTRAINT `FK_m_charge_acc_gl_account` FOREIGN KEY (`income_or_liability_account_id`) REFERENCES `acc_gl_account` (`id`); - --- Journal entries also refer to Client transactions -ALTER TABLE `acc_gl_journal_entry` - ADD COLUMN `client_transaction_id` BIGINT NULL DEFAULT NULL AFTER `savings_transaction_id`, - ADD CONSTRAINT `FK_acc_gl_journal_entry_m_client_transaction` FOREIGN KEY (`client_transaction_id`) REFERENCES `m_client_transaction` (`id`); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V272__loan_tranche_disbursement_charge.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V272__loan_tranche_disbursement_charge.sql deleted file mode 100644 index c22499305..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V272__loan_tranche_disbursement_charge.sql +++ /dev/null @@ -1,45 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_loan_tranche_disbursement_charge` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `loan_charge_id` BIGINT NOT NULL, - `disbursement_detail_id` BIGINT NULL, - PRIMARY KEY (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB -AUTO_INCREMENT=1 -; - -ALTER TABLE `m_loan_tranche_disbursement_charge` - ADD CONSTRAINT `FK_m_loan_tranche_disbursement_charge_m_loan_charge` FOREIGN KEY (`loan_charge_id`) REFERENCES `m_loan_charge` (`id`), - ADD CONSTRAINT `FK_m_loan_tranche_disbursement_charge_m_loan_disbursement_detail` FOREIGN KEY (`disbursement_detail_id`) REFERENCES `m_loan_disbursement_detail` (`id`); - - -CREATE TABLE `m_loan_tranche_charges` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `loan_id` BIGINT NOT NULL, - `charge_id` BIGINT NOT NULL, - PRIMARY KEY (`id`) -) ; - -ALTER TABLE `m_loan_tranche_charges` - ADD CONSTRAINT `FK_m_loan_tranche_charges_m_loan` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`), - ADD CONSTRAINT `FK_m_loan_tranche_charges_m_charge` FOREIGN KEY (`charge_id`) REFERENCES `m_charge` (`id`); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V273__oauth_changes.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V273__oauth_changes.sql deleted file mode 100644 index 8a35d4821..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V273__oauth_changes.sql +++ /dev/null @@ -1,61 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -CREATE TABLE `oauth_client_details` ( - `client_id` varchar(128) NOT NULL, - `resource_ids` varchar(256) DEFAULT NULL, - `client_secret` varchar(256) DEFAULT NULL, - `scope` varchar(256) DEFAULT NULL, - `authorized_grant_types` varchar(256) DEFAULT NULL, - `web_server_redirect_uri` varchar(256) DEFAULT NULL, - `authorities` varchar(256) DEFAULT NULL, - `access_token_validity` INT DEFAULT NULL, - `refresh_token_validity` INT DEFAULT NULL, - `additional_information` varchar(4096) DEFAULT NULL, - `autoapprove` BIT(1) NULL DEFAULT NULL, - PRIMARY KEY (`client_id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB -AUTO_INCREMENT=1; - -INSERT INTO `oauth_client_details` (`client_id`, `client_secret`, `scope`, `authorized_grant_types`) VALUES ('community-app', '123', 'all', 'password,refresh_token'); - - -CREATE TABLE `oauth_access_token` ( - `token_id` varchar(256) DEFAULT NULL, - `token` blob, - `authentication_id` varchar(256) DEFAULT NULL, - `user_name` varchar(256) DEFAULT NULL, - `client_id` varchar(256) DEFAULT NULL, - `authentication` blob, - `refresh_token` varchar(256) DEFAULT NULL -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB -AUTO_INCREMENT=1; - -CREATE TABLE `oauth_refresh_token` ( - `token_id` varchar(256) DEFAULT NULL, - `token` blob, - `authentication` blob -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V274__Loan_Reschedule_Code_Value.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V274__Loan_Reschedule_Code_Value.sql deleted file mode 100644 index c5a1bf148..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V274__Loan_Reschedule_Code_Value.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_code` (`code_name`, `is_system_defined`) VALUES ('LoanRescheduleReason', '1'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V275__loan_transaction_to_repayment_schedule_mapping.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V275__loan_transaction_to_repayment_schedule_mapping.sql deleted file mode 100644 index 23d3a34de..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V275__loan_transaction_to_repayment_schedule_mapping.sql +++ /dev/null @@ -1,34 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_loan_transaction_repayment_schedule_mapping` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `loan_transaction_id` BIGINT NOT NULL, - `loan_repayment_schedule_id` BIGINT NOT NULL, - `amount` DECIMAL(19,6) NOT NULL, - `principal_portion_derived` DECIMAL(19,6) NULL DEFAULT NULL, - `interest_portion_derived` DECIMAL(19,6) NULL DEFAULT NULL, - `fee_charges_portion_derived` DECIMAL(19,6) NULL DEFAULT NULL, - `penalty_charges_portion_derived` DECIMAL(19,6) NULL DEFAULT NULL, - PRIMARY KEY (`id`), - INDEX `FK_mappings_m_loan_transaction` (`loan_transaction_id`), - INDEX `FK_mappings_m_loan_repayment_schedule` (`loan_repayment_schedule_id`), - CONSTRAINT `FK_mappings_m_loan_repayment_schedule` FOREIGN KEY (`loan_repayment_schedule_id`) REFERENCES `m_loan_repayment_schedule` (`id`), - CONSTRAINT `FK_mappings_m_loan_transaction` FOREIGN KEY (`loan_transaction_id`) REFERENCES `m_loan_transaction` (`id`) -); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V276__loan_recalulated_till_date.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V276__loan_recalulated_till_date.sql deleted file mode 100644 index aa2b8580d..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V276__loan_recalulated_till_date.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_loan` - ADD COLUMN `interest_recalcualated_on` DATE NULL DEFAULT NULL AFTER `accrued_till`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V277__Loan_Product_Provisioning.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V277__Loan_Product_Provisioning.sql deleted file mode 100644 index 7ef3a0868..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V277__Loan_Product_Provisioning.sql +++ /dev/null @@ -1,123 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_provision_category` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `category_name` VARCHAR(100) NOT NULL, - `description` VARCHAR(300) NULL, - PRIMARY KEY (`id`), - UNIQUE INDEX `category_name` (`category_name`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB -AUTO_INCREMENT=1 -; - -INSERT INTO `m_provision_category` (`category_name`, `description`) VALUES ('STANDARD', 'Punctual Payment without any dues'); -INSERT INTO `m_provision_category` (`category_name`, `description`) VALUES ('SUB-STANDARD', 'Principal and/or Interest overdue by x days'); -INSERT INTO `m_provision_category` (`category_name`, `description`) VALUES ('DOUBTFUL', 'Principal and/or Interest overdue by x days and less than y'); -INSERT INTO `m_provision_category` (`category_name`, `description`) VALUES ('LOSS', 'Principal and/or Interest overdue by y days'); - -CREATE TABLE `m_provisioning_criteria` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `criteria_name` VARCHAR(200) NOT NULL, - `createdby_id` BIGINT NULL DEFAULT NULL, - `created_date` DATETIME NULL DEFAULT NULL, - `lastmodifiedby_id` BIGINT NULL DEFAULT NULL, - `lastmodified_date` DATETIME NULL DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE INDEX `criteria_name` (`criteria_name`), - FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`), - FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`) -); - -CREATE TABLE `m_provisioning_criteria_definition` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `criteria_id` BIGINT NOT NULL, - `category_id` BIGINT NOT NULL, - `min_age` BIGINT NOT NULL, - `max_age` BIGINT NOT NULL, - `provision_percentage` DECIMAL(5,2) NOT NULL, - `liability_account` BIGINT, - `expense_account` BIGINT, - PRIMARY KEY (`id`), - FOREIGN KEY (`criteria_id`) REFERENCES `m_provisioning_criteria` (`id`), - FOREIGN KEY (`category_id`) REFERENCES `m_provision_category` (`id`), - FOREIGN KEY (`liability_account`) REFERENCES `acc_gl_account` (`id`), - FOREIGN KEY (`expense_account`) REFERENCES `acc_gl_account` (`id`) -); - -CREATE TABLE `m_loanproduct_provisioning_mapping` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `product_id` BIGINT NOT NULL, - `criteria_id` BIGINT NOT NULL, - PRIMARY KEY (`id`), - UNIQUE INDEX `product_id` (`product_id`), - FOREIGN KEY (`product_id`) REFERENCES `m_product_loan` (`id`), - FOREIGN KEY (`criteria_id`) REFERENCES `m_provisioning_criteria` (`id`) -); - -CREATE TABLE `m_provisioning_history` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `journal_entry_created` BIT(1) DEFAULT 0, - `createdby_id` BIGINT NULL DEFAULT NULL, - `created_date` DATE NULL DEFAULT NULL, - `lastmodifiedby_id` BIGINT NULL DEFAULT NULL, - `lastmodified_date` DATE NULL DEFAULT NULL, - PRIMARY KEY (`id`), - FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`), - FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`) -); - -CREATE TABLE `m_loanproduct_provisioning_entry` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `history_id` BIGINT NOT NULL, - `criteria_id` BIGINT NOT NULL, - `currency_code` VARCHAR(3) NOT NULL, - `office_id` BIGINT NOT NULL, - `product_id` BIGINT NOT NULL, - `category_id` BIGINT NOT NULL, - `overdue_in_days` BIGINT DEFAULT 0, - `reseve_amount` DECIMAL(20,6) DEFAULT 0, - `liability_account` BIGINT NULL DEFAULT NULL, - `expense_account` BIGINT NULL DEFAULT NULL, - PRIMARY KEY (`id`), - FOREIGN KEY (`history_id`) REFERENCES `m_provisioning_history` (`id`), - FOREIGN KEY (`criteria_id`) REFERENCES `m_provisioning_criteria` (`id`), - FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`), - FOREIGN KEY (`product_id`) REFERENCES `m_product_loan` (`id`), - FOREIGN KEY (`category_id`) REFERENCES `m_provision_category` (`id`), - FOREIGN KEY (`liability_account`) REFERENCES `acc_gl_account` (`id`), - FOREIGN KEY (`expense_account`) REFERENCES `acc_gl_account` (`id`) -); - -INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Generate Loan Loss Provisioning', 'Generate Loan Loss Provisioning', '0 0 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 0, 0); - -INSERT INTO `m_permission`(`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES -('LOAN_PROVISIONING', 'CREATE_PROVISIONCATEGORY', 'PROVISIONCATEGORY', 'CREATE', 0), -('LOAN_PROVISIONING', 'DELETE_PROVISIONCATEGORY', 'PROVISIONCATEGORY', 'DELETE', 0), -('LOAN_PROVISIONING', 'CREATE_PROVISIONCRITERIA', 'PROVISIONINGCRITERIA', 'CREATE', 0), -('LOAN_PROVISIONING', 'UPDATE_PROVISIONCRITERIA', 'PROVISIONINGCRITERIA', 'UPDATE', 0), -('LOAN_PROVISIONING', 'DELETE_PROVISIONCRITERIA', 'PROVISIONINGCRITERIA', 'DELETE', 0), -('LOAN_PROVISIONING', 'CREATE_PROVISIONENTRIES', 'PROVISIONINGENTRIES', 'CREATE', 0), -('LOAN_PROVISIONING', 'CREATE_PROVISIONJOURNALENTRIES', 'PROVISIONINGENTRIES', 'CREATE', 0), -('LOAN_PROVISIONING', 'RECREATE_PROVISIONENTRIES', 'PROVISIONINGENTRIES', 'RECREATE', 0); - -INSERT INTO `m_appuser` ( `is_deleted`, `office_id`, `staff_id`, `username`, `firstname`, `lastname`, `password`, `email`, `firsttime_login_remaining`, `nonexpired`, `nonlocked`, `nonexpired_credentials`, `enabled`, `last_time_password_updated`, `password_never_expires`) VALUES - (0, 1, NULL, 'system', 'system', 'system', '5787039480429368bf94732aacc771cd0a3ea02bcf504ffe1185ab94213bc63a', 'demomfi@mifos.org', b'0', b'1', b'1', b'1', b'1', '2014-03-07', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V278__LoanTransactionProcessingStrategy.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V278__LoanTransactionProcessingStrategy.sql deleted file mode 100644 index 78b6ea94e..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V278__LoanTransactionProcessingStrategy.sql +++ /dev/null @@ -1,38 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -UPDATE `ref_loan_transaction_processing_strategy` SET `name`='Penalties, Fees, Interest, Principal order' -WHERE code='mifos-standard-strategy' ; -UPDATE `ref_loan_transaction_processing_strategy` SET `name`='Overdue/Due Fee/Int,Principal' WHERE code='rbi-india-strategy' ; -UPDATE `ref_loan_transaction_processing_strategy` SET `name`='HeavensFamily Unique' WHERE code='heavensfamily-strategy' ; -UPDATE `ref_loan_transaction_processing_strategy` SET `name`='Creocore Unique' WHERE code='creocore-strategy' ; -UPDATE `ref_loan_transaction_processing_strategy` SET `name`='Principal, Interest, Penalties, Fees Order' -WHERE code='principal-interest-penalties-fees-order-strategy' ; -UPDATE `ref_loan_transaction_processing_strategy` SET `name`='Interest, Principal, Penalties, Fees Order' -WHERE code='interest-principal-penalties-fees-order-strategy' ; - -ALTER TABLE `ref_loan_transaction_processing_strategy`ADD `sort_order` INT ; - -UPDATE `ref_loan_transaction_processing_strategy` SET `sort_order`=1 WHERE code='mifos-standard-strategy' ; -UPDATE `ref_loan_transaction_processing_strategy` SET `sort_order`=2 WHERE code='rbi-india-strategy' ; -UPDATE `ref_loan_transaction_processing_strategy` SET `sort_order`=3 WHERE code='principal-interest-penalties-fees-order-strategy' ; -UPDATE `ref_loan_transaction_processing_strategy` SET `sort_order`=4 WHERE code='interest-principal-penalties-fees-order-strategy' ; -UPDATE `ref_loan_transaction_processing_strategy` SET `sort_order`=5 WHERE code='early-repayment-strategy' ; -UPDATE `ref_loan_transaction_processing_strategy` SET `sort_order`=6 WHERE code='heavensfamily-strategy' ; -UPDATE `ref_loan_transaction_processing_strategy` SET `sort_order`=7 WHERE code='creocore-strategy' ; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V279__floating_rates.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V279__floating_rates.sql deleted file mode 100644 index 278d4a71f..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V279__floating_rates.sql +++ /dev/null @@ -1,80 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_floating_rates` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `name` VARCHAR(200) NOT NULL, - `is_base_lending_rate` BIT(1) NOT NULL DEFAULT 0, - `is_active` BIT(1) NOT NULL DEFAULT 1, - `createdby_id` BIGINT NOT NULL, - `created_date` DATETIME NOT NULL, - `lastmodifiedby_id` BIGINT NOT NULL, - `lastmodified_date` DATETIME NOT NULL, - PRIMARY KEY (`id`), - UNIQUE INDEX `unq_name` (`name`) -); - -CREATE TABLE `m_floating_rates_periods` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `floating_rates_id` BIGINT NOT NULL, - `from_date` DATETIME NOT NULL, - `interest_rate` DECIMAL(19,6) NOT NULL, - `is_differential_to_base_lending_rate` BIT(1) NOT NULL DEFAULT 0, - `is_active` BIT(1) NOT NULL DEFAULT 1, - `createdby_id` BIGINT NOT NULL, - `created_date` DATETIME NOT NULL, - `lastmodifiedby_id` BIGINT NOT NULL, - `lastmodified_date` DATETIME NOT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `FK_mappings_m_floating_rates` FOREIGN KEY (`floating_rates_id`) REFERENCES `m_floating_rates` (`id`) -); - -ALTER TABLE `m_product_loan` -ADD COLUMN `is_linked_to_floating_interest_rates` BIT(1) NOT NULL DEFAULT 0 AFTER `fund_id`, -MODIFY COLUMN `nominal_interest_rate_per_period` DECIMAL(19,6) NULL DEFAULT NULL, -MODIFY COLUMN `interest_period_frequency_enum` SMALLINT NULL DEFAULT NULL, -MODIFY COLUMN `annual_nominal_interest_rate` DECIMAL(19,6) NULL DEFAULT NULL; - -CREATE TABLE `m_product_loan_floating_rates` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `loan_product_id` BIGINT NOT NULL, - `floating_rates_id` BIGINT NOT NULL, - `interest_rate_differential` DECIMAL(19,6) NOT NULL DEFAULT 0, - `min_differential_lending_rate` DECIMAL(19,6) NOT NULL DEFAULT 0, - `default_differential_lending_rate` DECIMAL(19,6) NOT NULL DEFAULT 0, - `max_differential_lending_rate` DECIMAL(19,6) NOT NULL DEFAULT 0, - `is_floating_interest_rate_calculation_allowed` BIT(1) NOT NULL DEFAULT 0, - PRIMARY KEY (`id`), - CONSTRAINT `FK_mappings_m_product_loan_id` FOREIGN KEY (`loan_product_id`) REFERENCES `m_product_loan` (`id`), - CONSTRAINT `FK_mappings_m_floating_rates_id` FOREIGN KEY (`floating_rates_id`) REFERENCES `m_floating_rates` (`id`) -); - -ALTER TABLE `m_loan` -ADD COLUMN `is_floating_interest_rate` BIT(1) NULL DEFAULT 0 AFTER `arrearstolerance_amount`, -ADD COLUMN `interest_rate_differential` DECIMAL(19,6) NULL DEFAULT 0 AFTER `is_floating_interest_rate`, -MODIFY COLUMN `nominal_interest_rate_per_period` DECIMAL(19,6) NULL DEFAULT NULL, -MODIFY COLUMN `interest_period_frequency_enum` SMALLINT NULL DEFAULT NULL, -MODIFY COLUMN `annual_nominal_interest_rate` DECIMAL(19,6) NULL DEFAULT NULL; - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('portfolio', 'READ_FLOATINGRATE', 'FLOATINGRATE', 'READ', 0), - ('portfolio', 'CREATE_FLOATINGRATE', 'FLOATINGRATE', 'CREATE', 1), - ('portfolio', 'CREATE_FLOATINGRATE_CHECKER', 'FLOATINGRATE', 'CREATE_CHECKER', 0), - ('portfolio', 'UPDATE_FLOATINGRATE', 'FLOATINGRATE', 'UPDATE', 1), - ('portfolio', 'UPDATE_FLOATINGRATE_CHECKER', 'FLOATINGRATE', 'UPDATE_CHECKER', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V27__add-loan-type-column-to-loan-table.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V27__add-loan-type-column-to-loan-table.sql deleted file mode 100644 index cad7fe82a..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V27__add-loan-type-column-to-loan-table.sql +++ /dev/null @@ -1,66 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_loan` - ADD COLUMN `loan_type_enum` SMALLINT NOT NULL AFTER `loan_status_id`; - --- create collateral management table -CREATE TABLE IF NOT EXISTS `m_collateral_management` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `name` varchar(50) NOT NULL, - `quality` varchar(40) NOT NULL, - `base_price` decimal(20,5) NOT NULL, - `unit_type` varchar(10) NOT NULL, - `pct_to_base` decimal(20,5) NOT NULL, - `currency` bigint(20) DEFAULT NULL, - PRIMARY KEY (`id`) USING BTREE, - KEY `fkCurrencyCode` (`currency`), - CONSTRAINT `fkCurrencyCode` FOREIGN KEY (`currency`) REFERENCES `m_currency` (`id`) ON DELETE CASCADE -); - --- create client collateral management -CREATE TABLE IF NOT EXISTS `m_client_collateral_management` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `quantity` decimal(20,5) NOT NULL, - `client_id` bigint(20) DEFAULT NULL, - `collateral_id` bigint(20) DEFAULT NULL, - PRIMARY KEY (`id`) USING BTREE, - KEY `fkClient` (`client_id`), - KEY `fkCollateral` (`collateral_id`), - CONSTRAINT `fkClient` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `fkCollateral` FOREIGN KEY (`collateral_id`) REFERENCES `m_collateral_management` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -); - - --- create loan collateral management -CREATE TABLE IF NOT EXISTS `m_loan_collateral_management` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `quantity` decimal(20,5) NOT NULL, - `loan_id` bigint(20) DEFAULT NULL, - `client_collateral_id` bigint(20) DEFAULT NULL, - `is_released` tinyint(4) DEFAULT '0', - `transaction_id` bigint(20) DEFAULT NULL, - PRIMARY KEY (`id`) USING BTREE, - KEY `fkLoan` (`loan_id`), - KEY `fkTransaction` (`transaction_id`), - KEY `fkClientCollateral` (`client_collateral_id`), - CONSTRAINT `fkClientCollateral` FOREIGN KEY (`client_collateral_id`) REFERENCES `m_client_collateral_management` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `fkLoan` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `fkTransaction` FOREIGN KEY (`transaction_id`) REFERENCES `m_loan_transaction` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V280__spm_framework_initial_tables.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V280__spm_framework_initial_tables.sql deleted file mode 100644 index 34d6bd36d..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V280__spm_framework_initial_tables.sql +++ /dev/null @@ -1,91 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_surveys` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `a_key` VARCHAR(32) NOT NULL, - `a_name` VARCHAR(255) NOT NULL, - `description` VARCHAR(4000) NULL, - `country_code` VARCHAR(2) NOT NULL, - `valid_from` DATETIME NULL DEFAULT NULL, - `valid_to` DATETIME NULL DEFAULT NULL, - PRIMARY KEY (`id`) -); - -CREATE TABLE `m_survey_components` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `survey_id` BIGINT NOT NULL, - `a_key` VARCHAR(32) NOT NULL, - `a_text` VARCHAR(255) NOT NULL, - `description` VARCHAR(4000) NULL, - `sequence_no` INT NOT NULL, - PRIMARY KEY (`id`), - FOREIGN KEY (`survey_id`) REFERENCES `m_surveys` (`id`) -); - -CREATE TABLE `m_survey_questions` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `survey_id` BIGINT NOT NULL, - `component_key` VARCHAR(32) NULL, - `a_key` VARCHAR(32) NOT NULL, - `a_text` VARCHAR(255) NOT NULL, - `description` VARCHAR(4000) NULL, - `sequence_no` INT NOT NULL, - PRIMARY KEY (`id`), - FOREIGN KEY (`survey_id`) REFERENCES `m_surveys` (`id`) -); - -CREATE TABLE `m_survey_responses` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `question_id` BIGINT NOT NULL, - `a_text` VARCHAR(255) NOT NULL, - `a_value` INT NOT NULL, - `sequence_no` INT NOT NULL, - PRIMARY KEY (`id`), - FOREIGN KEY (`question_id`) REFERENCES `m_survey_questions` (`id`) -); - -CREATE TABLE `m_survey_lookup_tables` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `survey_id` BIGINT NOT NULL, - `a_key` VARCHAR(255) NOT NULL, - `description` INT NULL, - `value_from` INT NOT NULL, - `value_to` INT NOT NULL, - `score` DECIMAL(5, 2) NOT NULL, - PRIMARY KEY (`id`), - FOREIGN KEY (`survey_id`) REFERENCES `m_surveys` (`id`) -); - -CREATE TABLE `m_survey_scorecards` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `survey_id` BIGINT NOT NULL, - `question_id` BIGINT NOT NULL, - `response_id` BIGINT NOT NULL, - `staff_id` BIGINT NOT NULL, - `client_id` BIGINT NOT NULL, - `created_on` DATETIME NULL DEFAULT NULL, - `a_value` INT NOT NULL, - PRIMARY KEY (`id`), - FOREIGN KEY (`survey_id`) REFERENCES `m_surveys` (`id`), - FOREIGN KEY (`question_id`) REFERENCES `m_survey_questions` (`id`), - FOREIGN KEY (`response_id`) REFERENCES `m_survey_responses` (`id`), - FOREIGN KEY (`staff_id`) REFERENCES `m_staff` (`id`), - FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) -); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V281__add_configuration_param_backdate-penalties.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V281__add_configuration_param_backdate-penalties.sql deleted file mode 100644 index 0c7e084be..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V281__add_configuration_param_backdate-penalties.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `c_configuration` ( `name`, `value`, `enabled`, `description`) -VALUES - ( 'backdate-penalties-enabled', 0, 1, 'If this parameter is disabled penalties will only be added to instalments due moving forward, any old overdue instalments will not be affected.'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V282__CustomerSelfService.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V282__CustomerSelfService.sql deleted file mode 100644 index 13f9c36f8..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V282__CustomerSelfService.sql +++ /dev/null @@ -1,34 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_appuser` -ADD COLUMN `is_self_service_user` BIT(1) NOT NULL DEFAULT 0; - -CREATE TABLE `m_selfservice_user_client_mapping` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `appuser_id` BIGINT NOT NULL, - `client_id` BIGINT NOT NULL, - PRIMARY KEY (`id`), - UNIQUE INDEX `appuser_id_client_id` (`appuser_id`, `client_id`), - CONSTRAINT `m_selfservice_appuser_id` FOREIGN KEY (`appuser_id`) REFERENCES `m_appuser` (`id`), - CONSTRAINT `m_selfservice_client_id` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB -AUTO_INCREMENT=1; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V283__Variable_Installments.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V283__Variable_Installments.sql deleted file mode 100644 index 3183f022d..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V283__Variable_Installments.sql +++ /dev/null @@ -1,45 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_product_loan` -ADD COLUMN `allow_variabe_installments` BIT(1) NOT NULL DEFAULT 0 AFTER `is_linked_to_floating_interest_rates` ; - -CREATE TABLE `m_product_loan_variable_installment_config` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `loan_product_id` BIGINT NOT NULL, - `minimum_gap` INT NOT NULL, - `maximum_gap` INT NOT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `FK_mappings_m_variable_product_loan_id` FOREIGN KEY (`loan_product_id`) REFERENCES `m_product_loan` (`id`) -); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'CREATESCHEDULEEXCEPTIONS_LOAN', 'LOAN', 'CREATESCHEDULEEXCEPTIONS', 0), ('portfolio', 'CREATESCHEDULEEXCEPTIONS_LOAN_CHECKER', 'LOAN', 'CREATESCHEDULEEXCEPTIONS_CHECKER', 0), ('portfolio', 'DELETESCHEDULEEXCEPTIONS_LOAN', 'LOAN', 'DELETESCHEDULEEXCEPTIONS', 0),('portfolio', 'DELETESCHEDULEEXCEPTIONS_LOAN_CHECKER', 'LOAN', 'DELETESCHEDULEEXCEPTIONS_CHECKER', 0); - - -ALTER TABLE `m_loan_term_variations` - ALTER `applicable_from` DROP DEFAULT, - ALTER `term_value` DROP DEFAULT; -ALTER TABLE `m_loan_term_variations` - CHANGE COLUMN `applicable_from` `applicable_date` DATE NOT NULL AFTER `term_type`, - CHANGE COLUMN `term_value` `decimal_value` DECIMAL(19,6) NULL AFTER `applicable_date`, - ADD COLUMN `date_value` DATE NULL AFTER `decimal_value`, - ADD COLUMN `is_specific_to_installment` TINYINT NOT NULL DEFAULT '0' AFTER `date_value`, - ADD COLUMN `applied_on_loan_status` SMALLINT NOT NULL AFTER `is_specific_to_installment`; - -UPDATE `m_loan_term_variations` SET `applied_on_loan_status`=300; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V284__update_codevalue.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V284__update_codevalue.sql deleted file mode 100644 index 69d1bddb1..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V284__update_codevalue.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_code_value` - ADD COLUMN `is_active` tinyint NOT NULL DEFAULT '1' AFTER `code_score`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V285__undo_last_tranche_script.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V285__undo_last_tranche_script.sql deleted file mode 100644 index e0ac46e83..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V285__undo_last_tranche_script.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('transaction_loan', 'DISBURSALLASTUNDO_LOAN', 'LOAN', 'DISBURSALLASTUNDO', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('transaction_loan', 'DISBURSALLASTUNDO_LOAN_CHECKER', 'LOAN', 'DISBURSALLASTUNDO_CHECKER', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V286__partial_period_interest_calcualtion.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V286__partial_period_interest_calcualtion.sql deleted file mode 100644 index 619f27945..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V286__partial_period_interest_calcualtion.sql +++ /dev/null @@ -1,28 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_product_loan` - ADD COLUMN `allow_partial_period_interest_calcualtion` tinyint NOT NULL DEFAULT '0' AFTER `interest_calculated_in_period_enum`; - -ALTER TABLE `m_loan` - ADD COLUMN `allow_partial_period_interest_calcualtion` tinyint NOT NULL DEFAULT '0' AFTER `interest_calculated_in_period_enum`; - -UPDATE m_product_loan mpl inner join (select mp.id as productId from m_product_loan mp where mp.interest_calculated_in_period_enum = 1 and (mp.interest_recalculation_enabled = 1 or mp.allow_multiple_disbursals = 1 or mp.is_linked_to_floating_interest_rates =1 or mp.allow_variabe_installments =1)) x on x.productId = mpl.id SET mpl.allow_partial_period_interest_calcualtion = 1; - -UPDATE m_loan ml inner join (select loan.id as loanId from m_product_loan mp inner join m_loan loan on loan.product_id = mp.id where mp.allow_partial_period_interest_calcualtion = 1) x on x.loanId = ml.id SET ml.allow_partial_period_interest_calcualtion=1; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V287__alter_spm_scorecard.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V287__alter_spm_scorecard.sql deleted file mode 100644 index 6bc38a337..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V287__alter_spm_scorecard.sql +++ /dev/null @@ -1,38 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -SET FOREIGN_KEY_CHECKS = 0; -DROP TABLE IF EXISTS `m_survey_scorecards`; -CREATE TABLE `m_survey_scorecards` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `survey_id` BIGINT NOT NULL, - `question_id` BIGINT NOT NULL, - `response_id` BIGINT NOT NULL, - `user_id` BIGINT NOT NULL, - `client_id` BIGINT NOT NULL, - `created_on` DATETIME NULL DEFAULT NULL, - `a_value` INT NOT NULL, - PRIMARY KEY (`id`), - FOREIGN KEY (`survey_id`) REFERENCES `m_surveys` (`id`), - FOREIGN KEY (`question_id`) REFERENCES `m_survey_questions` (`id`), - FOREIGN KEY (`response_id`) REFERENCES `m_survey_responses` (`id`), - FOREIGN KEY (`user_id`) REFERENCES `m_appusers` (`id`), - FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) -); -SET FOREIGN_KEY_CHECKS = 1; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V288__overdraft_interest.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V288__overdraft_interest.sql deleted file mode 100644 index 11d1f5db2..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V288__overdraft_interest.sql +++ /dev/null @@ -1,27 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_savings_account` -ADD COLUMN `nominal_annual_interest_rate_overdraft` DECIMAL(19,6) NULL DEFAULT 0 AFTER `overdraft_limit`, -ADD COLUMN `total_overdraft_interest_derived` DECIMAL(19,6) NULL DEFAULT 0 AFTER `total_interest_posted_derived`, -ADD COLUMN `min_overdraft_for_interest_calculation` DECIMAL(19,6) NULL DEFAULT 0 AFTER `nominal_annual_interest_rate_overdraft`; - -ALTER TABLE `m_savings_product` -ADD COLUMN `nominal_annual_interest_rate_overdraft` DECIMAL(19,6) NULL DEFAULT 0 AFTER `overdraft_limit`, -ADD COLUMN `min_overdraft_for_interest_calculation` DECIMAL(19,6) NULL DEFAULT 0 AFTER `nominal_annual_interest_rate_overdraft`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V289__client_non_person.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V289__client_non_person.sql deleted file mode 100644 index 7241ff4a1..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V289__client_non_person.sql +++ /dev/null @@ -1,40 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -INSERT INTO `m_code` (`code_name`, `is_system_defined`) values - ("Constitution", true); - -INSERT INTO `m_code` (`code_name`, `is_system_defined`) values - ("Main Business Line", true); - -ALTER TABLE `m_client` ADD `legal_form_enum` INT; - -CREATE TABLE `m_client_non_person` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `client_id` BIGINT NOT NULL UNIQUE, - `constitution_cv_id` INT NOT NULL, - `incorp_no` varchar(50), - `incorp_validity_till` DATETIME, - `main_business_line_cv_id` INT, - `remarks` varchar(150), - PRIMARY KEY (`id`), - INDEX `FK_client_id` (`client_id`), - CONSTRAINT `FK_client_id` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) -); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V28__accounting-abstractions-and-autoposting.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V28__accounting-abstractions-and-autoposting.sql deleted file mode 100644 index 7c3be48e9..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V28__accounting-abstractions-and-autoposting.sql +++ /dev/null @@ -1,65 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `acc_accounting_rule` ( - `id` BIGINT NOT NULL, - `name` VARCHAR(100) NULL DEFAULT NULL, - `office_id` BIGINT NULL DEFAULT NULL, - `debit_account_id` BIGINT NOT NULL, - `credit_account_id` BIGINT NOT NULL, - `description` VARCHAR(500) NULL DEFAULT NULL, - `system_defined` tinyint NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE INDEX `accounting_rule_name_unique` (`name`), - INDEX `FK_acc_accounting_rule_acc_gl_account_debit` (`debit_account_id`), - INDEX `FK_acc_accounting_rule_acc_gl_account_credit` (`credit_account_id`), - INDEX `FK_acc_accounting_rule_m_office` (`office_id`), - CONSTRAINT `FK_acc_accounting_rule_acc_gl_account_credit` FOREIGN KEY (`credit_account_id`) REFERENCES `acc_gl_account` (`id`), - CONSTRAINT `FK_acc_accounting_rule_acc_gl_account_debit` FOREIGN KEY (`debit_account_id`) REFERENCES `acc_gl_account` (`id`), - CONSTRAINT `FK_acc_accounting_rule_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; - -CREATE TABLE `acc_auto_posting` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `name` VARCHAR(100) NOT NULL, - `description` VARCHAR(500) NULL DEFAULT NULL, - `office_id` BIGINT NULL DEFAULT NULL, - `product_type_enum` SMALLINT NOT NULL, - `product_id` BIGINT NULL DEFAULT NULL, - `charge_id` BIGINT NULL DEFAULT NULL, - `event` INT NOT NULL, - `event_attribute` INT NULL DEFAULT NULL, - `accounting_rule_id` BIGINT NOT NULL, - PRIMARY KEY (`id`), - UNIQUE INDEX `auto_posting_name_unique` (`name`), - INDEX `FK_acc_auto_posting_m_office` (`office_id`), - INDEX `FK_acc_auto_posting_acc_accounting_rule` (`accounting_rule_id`), - INDEX `FK_acc_auto_posting_m_code` (`event`), - INDEX `FK_acc_auto_posting_m_charge` (`charge_id`), - INDEX `FK_acc_auto_posting_m_code_value` (`event_attribute`), - CONSTRAINT `FK_acc_auto_posting_acc_accounting_rule` FOREIGN KEY (`accounting_rule_id`) REFERENCES `acc_accounting_rule` (`id`), - CONSTRAINT `FK_acc_auto_posting_m_charge` FOREIGN KEY (`charge_id`) REFERENCES `m_charge` (`id`), - CONSTRAINT `FK_acc_auto_posting_m_code` FOREIGN KEY (`event`) REFERENCES `m_code` (`id`), - CONSTRAINT `FK_acc_auto_posting_m_code_value` FOREIGN KEY (`event_attribute`) REFERENCES `m_code_value` (`id`), - CONSTRAINT `FK_acc_auto_posting_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V290__shares_dividends_permissions_script.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V290__shares_dividends_permissions_script.sql deleted file mode 100644 index 7aca49930..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V290__shares_dividends_permissions_script.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission`(`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES -('SHAREPRODUCT', 'CREATE_SHAREPRODUCT', 'SHAREPRODUCT', 'CREATE', 0), -('SHAREPRODUCT', 'UPDATE_SHAREPRODUCT', 'SHAREPRODUCT', 'CREATE', 0), -('SHAREACCOUNT', 'CREATE_SHAREACCOUNT', 'SHAREACCOUNT', 'CREATE', 0), -('SHAREACCOUNT', 'UPDATE_SHAREACCOUNT', 'SHAREACCOUNT', 'CREATE', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V291__organisation_start_date_config.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V291__organisation_start_date_config.sql deleted file mode 100644 index eed52c212..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V291__organisation_start_date_config.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `c_configuration` - ADD COLUMN `date_value` DATE NULL DEFAULT NULL AFTER `value`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V292__update_organisation_start_date.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V292__update_organisation_start_date.sql deleted file mode 100644 index 2b2164130..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V292__update_organisation_start_date.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `c_configuration` ( `name`, `value`, `date_value`, `enabled`, `is_trap_door`, `description`) VALUES ('organisation-start-date', 0, NULL, 0, 0, NULL); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V293__interest_rate_chart_support_for_amounts.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V293__interest_rate_chart_support_for_amounts.sql deleted file mode 100644 index a4017c79e..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V293__interest_rate_chart_support_for_amounts.sql +++ /dev/null @@ -1,32 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_interest_rate_slab` - CHANGE COLUMN `from_period` `from_period` INT NULL DEFAULT NULL, - CHANGE COLUMN `period_type_enum` `period_type_enum` SMALLINT NULL DEFAULT NULL ; - -ALTER TABLE `m_interest_rate_chart` - ADD COLUMN `is_primary_grouping_by_amount` tinyint NOT NULL DEFAULT '0'; - -ALTER TABLE `m_savings_account_interest_rate_chart` - ADD COLUMN `is_primary_grouping_by_amount` TINYINT NOT NULL DEFAULT '0' ; - -ALTER TABLE `m_savings_account_interest_rate_slab` - CHANGE COLUMN `period_type_enum` `period_type_enum` SMALLINT NULL DEFAULT NULL, - CHANGE COLUMN `from_period` `from_period` INT NULL DEFAULT NULL; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V294__configuration_for_paymnettype_application_forDisbursement_charge.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V294__configuration_for_paymnettype_application_forDisbursement_charge.sql deleted file mode 100644 index 70a39b704..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V294__configuration_for_paymnettype_application_forDisbursement_charge.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `c_configuration` (`name`, `value`, `enabled`, `is_trap_door`, `description`) VALUES ('paymenttype-applicable-for-disbursement-charges', NULL, 0, 0, 'Is the Disbursement Entry need to be considering the fund source of the paymnet type'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V295__configuration_for_interest_charged_date_same_as_disbursal_date.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V295__configuration_for_interest_charged_date_same_as_disbursal_date.sql deleted file mode 100644 index f995b836c..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V295__configuration_for_interest_charged_date_same_as_disbursal_date.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `c_configuration` (`name`, `value`, `date_value`, `enabled`, `is_trap_door`, `description`) VALUES ('interest-charged-from-date-same-as-disbursal-date', 0, NULL, 0, 0, NULL); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V296__skip_repayment_on first-day_of_month.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V296__skip_repayment_on first-day_of_month.sql deleted file mode 100644 index 1da0585ec..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V296__skip_repayment_on first-day_of_month.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -insert into c_configuration(name,value,description) values("skip-repayment-on-first-day-of-month",14,"skipping repayment on first day of month"); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V297__Adding_Meeting_Time_column.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V297__Adding_Meeting_Time_column.sql deleted file mode 100644 index b078ad3b2..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V297__Adding_Meeting_Time_column.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -alter table m_calendar add meeting_time Time diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V298__savings_interest_tax.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V298__savings_interest_tax.sql deleted file mode 100644 index 1b725b699..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V298__savings_interest_tax.sql +++ /dev/null @@ -1,125 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_tax_component` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `name` VARCHAR(50) NOT NULL, - `percentage` DECIMAL(19,6) NOT NULL, - `debit_account_type_enum` SMALLINT NULL DEFAULT NULL, - `debit_account_id` BIGINT NULL DEFAULT NULL, - `credit_account_type_enum` SMALLINT NULL DEFAULT NULL, - `credit_account_id` BIGINT NULL DEFAULT NULL, - `start_date` DATE NOT NULL, - `createdby_id` BIGINT NOT NULL, - `created_date` DATETIME NOT NULL, - `lastmodifiedby_id` BIGINT NOT NULL, - `lastmodified_date` DATETIME NOT NULL, - PRIMARY KEY (`id`), - INDEX `FK_tax_component_debit_gl_account` (`debit_account_id`), - INDEX `FK_tax_component_credit_gl_account` (`credit_account_id`), - INDEX `FK_tax_component_createdby` (`createdby_id`), - INDEX `FK_tax_component_lastmodifiedby` (`lastmodifiedby_id`), - CONSTRAINT `FK_tax_component_createdby` FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`), - CONSTRAINT `FK_tax_component_credit_gl_account` FOREIGN KEY (`credit_account_id`) REFERENCES `acc_gl_account` (`id`), - CONSTRAINT `FK_tax_component_debit_gl_account` FOREIGN KEY (`debit_account_id`) REFERENCES `acc_gl_account` (`id`), - CONSTRAINT `FK_tax_component_lastmodifiedby` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`) -); - -CREATE TABLE `m_tax_component_history` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `tax_component_id` BIGINT NOT NULL, - `percentage` DECIMAL(19,6) NOT NULL, - `start_date` DATE NOT NULL, - `end_date` DATE NOT NULL, - `createdby_id` BIGINT NOT NULL, - `created_date` DATETIME NOT NULL, - `lastmodifiedby_id` BIGINT NOT NULL, - `lastmodified_date` DATETIME NOT NULL, - PRIMARY KEY (`id`), - INDEX `FK_tax_component_history_tax_component_id` (`tax_component_id`), - INDEX `FK_tax_component_history_createdby` (`createdby_id`), - INDEX `FK_tax_component_history_lastmodifiedby` (`lastmodifiedby_id`), - CONSTRAINT `FK_tax_component_history_createdby` FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`), - CONSTRAINT `FK_tax_component_history_lastmodifiedby` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`), - CONSTRAINT `FK_tax_component_history_tax_component_id` FOREIGN KEY (`tax_component_id`) REFERENCES `m_tax_component` (`id`) -); - -CREATE TABLE `m_tax_group` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `name` VARCHAR(50) NOT NULL, - `createdby_id` BIGINT NOT NULL, - `created_date` DATETIME NOT NULL, - `lastmodifiedby_id` BIGINT NOT NULL, - `lastmodified_date` DATETIME NOT NULL, - PRIMARY KEY (`id`), - INDEX `FK_tax_group_createdby` (`createdby_id`), - INDEX `FK_tax_group_lastmodifiedby` (`lastmodifiedby_id`), - CONSTRAINT `FK_tax_group_createdby` FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`), - CONSTRAINT `FK_tax_group_lastmodifiedby` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`) -); - -CREATE TABLE `m_tax_group_mappings` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `tax_group_id` BIGINT NOT NULL, - `tax_component_id` BIGINT NOT NULL, - `start_date` DATE NOT NULL, - `end_date` DATE NULL DEFAULT NULL, - `createdby_id` BIGINT NOT NULL, - `created_date` DATETIME NOT NULL, - `lastmodifiedby_id` BIGINT NOT NULL, - `lastmodified_date` DATETIME NOT NULL, - PRIMARY KEY (`id`), - INDEX `FK_tax_group_mappings_tax_group` (`tax_group_id`), - INDEX `FK_tax_group_mappings_tax_component` (`tax_component_id`), - INDEX `FK_tax_group_mappings_createdby` (`createdby_id`), - INDEX `FK_tax_group_mappings_lastmodifiedby` (`lastmodifiedby_id`), - CONSTRAINT `FK_tax_group_mappings_createdby` FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`), - CONSTRAINT `FK_tax_group_mappings_lastmodifiedby` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`), - CONSTRAINT `FK_tax_group_mappings_tax_component` FOREIGN KEY (`tax_component_id`) REFERENCES `m_tax_component` (`id`), - CONSTRAINT `FK_tax_group_mappings_tax_group` FOREIGN KEY (`tax_group_id`) REFERENCES `m_tax_group` (`id`) -); - -ALTER TABLE `m_charge` - ADD COLUMN `tax_group_id` BIGINT NULL DEFAULT NULL, - ADD CONSTRAINT `FK_m_charge_m_tax_group` FOREIGN KEY (`tax_group_id`) REFERENCES `m_tax_group` (`id`); - -ALTER TABLE `m_savings_product` - ADD COLUMN `withhold_tax` TINYINT NOT NULL DEFAULT '0', - ADD COLUMN `tax_group_id` BIGINT NULL DEFAULT NULL, - ADD CONSTRAINT `FK_savings_product_tax_group` FOREIGN KEY (`tax_group_id`) REFERENCES `m_tax_group` (`id`); - -ALTER TABLE `m_savings_account` - ADD COLUMN `withhold_tax` TINYINT NOT NULL DEFAULT '0', - ADD COLUMN `tax_group_id` BIGINT NULL DEFAULT NULL, - ADD COLUMN `total_withhold_tax_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `total_overdraft_interest_derived`, - ADD CONSTRAINT `FK_savings_account_tax_group` FOREIGN KEY (`tax_group_id`) REFERENCES `m_tax_group` (`id`); - -CREATE TABLE `m_savings_account_transaction_tax_details` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `savings_transaction_id` BIGINT NOT NULL, - `tax_component_id` BIGINT NOT NULL, - `amount` DECIMAL(19,6) NOT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `FK_savings_account_transaction_tax_details_savings_transaction` FOREIGN KEY (`savings_transaction_id`) REFERENCES `m_savings_account_transaction` (`id`), - CONSTRAINT `FK_savings_account_transaction_tax_details_tax_component` FOREIGN KEY (`tax_component_id`) REFERENCES `m_tax_component` (`id`) -); - - - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('organisation', 'READ_TAXCOMPONENT', 'TAXCOMPONENT', 'READ', 0),('organisation', 'CREATE_TAXCOMPONENT', 'TAXCOMPONENT', 'CREATE', 0),('organisation', 'CREATE_TAXCOMPONENT_CHECKER', 'TAXCOMPONENT', 'CREATE_CHECKER', 0), ('organisation', 'UPDATE_TAXCOMPONENT', 'TAXCOMPONENT', 'UPDATE', 0),('organisation', 'UPDATE_TAXCOMPONENT_CHECKER', 'TAXCOMPONENT', 'UPDATE_CHECKER', 0),('organisation', 'READ_TAXGROUP', 'TAXGROUP', 'READ', 0),('organisation', 'CREATE_TAXGROUP', 'TAXGROUP', 'CREATE', 0),('organisation', 'CREATE_TAXGROUP_CHECKER', 'TAXGROUP', 'CREATE_CHECKER', 0), ('organisation', 'UPDATE_TAXGROUP', 'TAXGROUP', 'UPDATE', 0),('organisation', 'UPDATE_TAXGROUP_CHECKER', 'TAXGROUP', 'UPDATE_CHECKER', 0),('portfolio', 'UPDATEWITHHOLDTAX_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'UPDATEWITHHOLDTAX', 0),('portfolio', 'UPDATEWITHHOLDTAX_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'UPDATEWITHHOLDTAX_CHECKER', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V299__share_products.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V299__share_products.sql deleted file mode 100644 index c7e0e83b2..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V299__share_products.sql +++ /dev/null @@ -1,213 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_share_product` ( -`id` BIGINT NOT NULL AUTO_INCREMENT, -`name` VARCHAR(200) NOT NULL, -`short_name` VARCHAR(4) NOT NULL, -`external_id` VARCHAR(100) NULL DEFAULT NULL, -`description` VARCHAR(500) NOT NULL, -`start_date` DATETIME NULL DEFAULT NULL, -`end_date` DATETIME NULL DEFAULT NULL, -`currency_code` VARCHAR(3) NOT NULL, -`currency_digits` SMALLINT NOT NULL, -`currency_multiplesof` SMALLINT NULL DEFAULT NULL, -`total_shares` BIGINT NOT NULL, -`issued_shares` BIGINT NULL DEFAULT NULL, -`totalsubscribed_shares` BIGINT NULL DEFAULT NULL, -`unit_price` DECIMAL(10,2) NOT NULL, -`capital_amount` DECIMAL(20,2) NOT NULL, -`minimum_client_shares` BIGINT NULL DEFAULT NULL, -`nominal_client_shares` BIGINT NOT NULL, -`maximum_client_shares` BIGINT NULL DEFAULT NULL, -`minimum_active_period_frequency` DECIMAL(19,6) NULL DEFAULT NULL, -`minimum_active_period_frequency_enum` SMALLINT NULL DEFAULT NULL, -`lockin_period_frequency` DECIMAL(19,6) NULL DEFAULT NULL, -`lockin_period_frequency_enum` SMALLINT NULL DEFAULT NULL, -`allow_dividends_inactive_clients` SMALLINT NULL DEFAULT 0, -`createdby_id` BIGINT NULL DEFAULT NULL, -`created_date` DATETIME NULL DEFAULT NULL, -`lastmodifiedby_id` BIGINT NULL DEFAULT NULL, -`lastmodified_date` DATETIME NULL DEFAULT NULL, -`accounting_type` SMALLINT NOT NULL, -PRIMARY KEY (`id`), -UNIQUE INDEX `name` (`name`), -CONSTRAINT `m_share_product_ibfk_1` FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`), -CONSTRAINT `m_share_product_ibfk_2` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`) -) ; - -CREATE TABLE `m_share_product_market_price` ( -`id` BIGINT NOT NULL AUTO_INCREMENT, -`product_id` BIGINT NOT NULL, -`from_date` DATE NULL DEFAULT NULL, -`share_value` DECIMAL(10,2) NOT NULL, -PRIMARY KEY (`id`), -CONSTRAINT `m_share_product_market_price_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `m_share_product` (`id`) -) ; - -CREATE TABLE `m_share_product_charge` ( -`product_id` BIGINT NOT NULL, -`charge_id` BIGINT NOT NULL, -PRIMARY KEY (`product_id`, `charge_id`), -CONSTRAINT `m_share_product_charge_ibfk_1` FOREIGN KEY (`charge_id`) REFERENCES `m_charge` (`id`), -CONSTRAINT `m_share_product_charge_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `m_share_product` (`id`) -) ; - -CREATE TABLE `m_share_account` ( -`id` BIGINT NOT NULL AUTO_INCREMENT, -`account_no` VARCHAR(50) NOT NULL, -`product_id` BIGINT NOT NULL, -`client_id` BIGINT NOT NULL, -`external_id` VARCHAR(100) NULL DEFAULT NULL, -`status_enum` SMALLINT NOT NULL DEFAULT '300', -`total_approved_shares` BIGINT NULL DEFAULT NULL, -`total_pending_shares` BIGINT NULL DEFAULT NULL, -`submitted_date` DATE NOT NULL, -`submitted_userid` BIGINT NULL DEFAULT NULL, -`approved_date` DATE NULL DEFAULT NULL, -`approved_userid` BIGINT NULL DEFAULT NULL, -`rejected_date` DATE NULL DEFAULT NULL, -`rejected_userid` BIGINT NULL DEFAULT NULL, -`activated_date` DATE NULL DEFAULT NULL, -`activated_userid` BIGINT NULL DEFAULT NULL, -`closed_date` DATE NULL DEFAULT NULL, -`closed_userid` BIGINT NULL DEFAULT NULL, -`currency_code` VARCHAR(3) NOT NULL, -`currency_digits` SMALLINT NOT NULL, -`currency_multiplesof` SMALLINT NULL DEFAULT NULL, -`savings_account_id` BIGINT NOT NULL, -`minimum_active_period_frequency` DECIMAL(19,6) NULL DEFAULT NULL, -`minimum_active_period_frequency_enum` SMALLINT NULL DEFAULT NULL, -`lockin_period_frequency` DECIMAL(19,6) NULL DEFAULT NULL, -`lockin_period_frequency_enum` SMALLINT NULL DEFAULT NULL, -`allow_dividends_inactive_clients` SMALLINT NULL DEFAULT 0, -`created_date` DATETIME NULL DEFAULT NULL, -`lastmodifiedby_id` BIGINT NULL DEFAULT NULL, -`lastmodified_date` DATETIME NULL DEFAULT NULL, -PRIMARY KEY (`id`), -CONSTRAINT `m_share_account_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `m_share_product` (`id`), -CONSTRAINT `m_share_account_ibfk_2` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`), -CONSTRAINT `m_share_account_ibfk_3` FOREIGN KEY (`submitted_userid`) REFERENCES `m_appuser` (`id`), -CONSTRAINT `m_share_account_ibfk_4` FOREIGN KEY (`approved_userid`) REFERENCES `m_appuser` (`id`), -CONSTRAINT `m_share_account_ibfk_5` FOREIGN KEY (`rejected_userid`) REFERENCES `m_appuser` (`id`), -CONSTRAINT `m_share_account_ibfk_6` FOREIGN KEY (`activated_userid`) REFERENCES `m_appuser` (`id`), -CONSTRAINT `m_share_account_ibfk_7` FOREIGN KEY (`closed_userid`) REFERENCES `m_appuser` (`id`), -CONSTRAINT `m_share_account_ibfk_8` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`), -CONSTRAINT `m_share_account_ibfk_9` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) -) ; - -CREATE TABLE `m_share_account_charge` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `account_id` BIGINT NOT NULL, - `charge_id` BIGINT NOT NULL, - `charge_time_enum` SMALLINT NOT NULL, - `charge_calculation_enum` SMALLINT NOT NULL, - `charge_payment_mode_enum` SMALLINT NOT NULL DEFAULT '0', - `calculation_percentage` DECIMAL(19,6) NULL DEFAULT NULL, - `calculation_on_amount` DECIMAL(19,6) NULL DEFAULT NULL, - `charge_amount_or_percentage` DECIMAL(19,6) NULL DEFAULT NULL, - `amount` DECIMAL(19,6) NOT NULL, - `amount_paid_derived` DECIMAL(19,6) NULL DEFAULT NULL, - `amount_waived_derived` DECIMAL(19,6) NULL DEFAULT NULL, - `amount_writtenoff_derived` DECIMAL(19,6) NULL DEFAULT NULL, - `amount_outstanding_derived` DECIMAL(19,6) NOT NULL DEFAULT '0.000000', - `is_paid_derived` tinyint NOT NULL DEFAULT '0', - `waived` tinyint NOT NULL DEFAULT '0', - `min_cap` DECIMAL(19,6) NULL DEFAULT NULL, - `max_cap` DECIMAL(19,6) NULL DEFAULT NULL, - `is_active` tinyint NOT NULL DEFAULT '1', - PRIMARY KEY (`id`), - INDEX `charge_id` (`charge_id`), - INDEX `m_share_account_charge_ibfk_2` (`account_id`), - CONSTRAINT `m_share_account_charge_ibfk_1` FOREIGN KEY (`charge_id`) REFERENCES `m_charge` (`id`), - CONSTRAINT `m_share_account_charge_ibfk_2` FOREIGN KEY (`account_id`) REFERENCES `m_share_account` (`id`) -); - - -CREATE TABLE `m_share_account_transactions` ( -`id` BIGINT NOT NULL AUTO_INCREMENT, -`account_id` BIGINT NOT NULL, -`transaction_date` DATE NULL DEFAULT NULL, -`total_shares` BIGINT NULL DEFAULT NULL, -`unit_price` DECIMAL(10,2) NULL DEFAULT NULL, -`amount` DECIMAL(20,2) NULL DEFAULT NULL, -`charge_amount` DECIMAL(20,2) NULL DEFAULT NULL, -`amount_paid` DECIMAL(20,2) NULL DEFAULT NULL, -`status_enum` SMALLINT NOT NULL DEFAULT '300', -`type_enum` SMALLINT NULL DEFAULT NULL, -`is_active` tinyint NOT NULL DEFAULT '1', -PRIMARY KEY (`id`), -CONSTRAINT `m_share_account_purchased_shares_ibfk_1` FOREIGN KEY (`account_id`) REFERENCES `m_share_account` (`id`) -) ; - -CREATE TABLE `m_share_account_charge_paid_by` ( -`id` BIGINT NOT NULL AUTO_INCREMENT, -`share_transaction_id` BIGINT NULL DEFAULT NULL, -`charge_transaction_id` BIGINT NULL DEFAULT NULL, -`amount` DECIMAL(20,2) NOT NULL, -PRIMARY KEY (`id`), -CONSTRAINT `m_share_account_transactions_charge_mapping_ibfk1` FOREIGN KEY (`share_transaction_id`) REFERENCES `m_share_account_transactions` (`id`), -CONSTRAINT `m_share_account_transactions_charge_mapping_ibfk2` FOREIGN KEY (`charge_transaction_id`) REFERENCES `m_share_account_charge` (`id`) -) ; - -CREATE TABLE `m_share_product_dividend_pay_out` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `product_id` BIGINT NOT NULL, - `amount` DECIMAL(19,6) NOT NULL, - `dividend_period_start_date` DATE NOT NULL, - `dividend_period_end_date` DATE NOT NULL, - `status` SMALLINT NOT NULL, - `createdby_id` BIGINT NULL DEFAULT NULL, - `created_date` DATETIME NULL DEFAULT NULL, - `lastmodifiedby_id` BIGINT NULL DEFAULT NULL, - `lastmodified_date` DATETIME NULL DEFAULT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `FK_m_share_product_dividend_pay_out_product_id` FOREIGN KEY (`product_id`) REFERENCES `m_share_product` (`id`), - CONSTRAINT `FK_m_share_product_dividend_pay_out_createdby_id` FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`), - CONSTRAINT `FK_m_share_product_dividend_pay_out_lastmodifiedby_id` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`) -); - -CREATE TABLE `m_share_account_dividend_details` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `dividend_pay_out_id` BIGINT NOT NULL, - `account_id` BIGINT NOT NULL, - `amount` DECIMAL(19,6) NOT NULL, - `status` SMALLINT NOT NULL, - `savings_transaction_id` BIGINT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `FK_m_share_account_dividend_details_dividend_pay_out_id` FOREIGN KEY (`dividend_pay_out_id`) REFERENCES `m_share_product_dividend_pay_out` (`id`), - CONSTRAINT `FK_m_share_account_dividend_details_account_id` FOREIGN KEY (`account_id`) REFERENCES `m_share_account` (`id`) -); - -ALTER TABLE `acc_gl_journal_entry` -ADD COLUMN `share_transaction_id` BIGINT NULL AFTER `payment_details_id`, -ADD CONSTRAINT `FK_acc_gl_journal_entry_m_share_account_transaction` FOREIGN KEY (`share_transaction_id`) REFERENCES `m_share_account_transactions` (`id`); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('SHAREPRODUCT', 'CREATE_DIVIDEND_SHAREPRODUCT', 'SHAREPRODUCT', 'CREATE_DIVIDEND', 0), ('SHAREPRODUCT', 'CREATE_DIVIDEND_SHAREPRODUCT_CHECKER', 'SHAREPRODUCT', 'CREATE_DIVIDEND_CHECKER', 0),('SHAREPRODUCT', 'APPROVE_DIVIDEND_SHAREPRODUCT', 'SHAREPRODUCT', 'APPROVE_DIVIDEND', 0), ('SHAREPRODUCT', 'APPROVE_DIVIDEND_SHAREPRODUCT_CHECKER', 'SHAREPRODUCT', 'APPROVE_DIVIDEND_CHECKER', 0),('SHAREPRODUCT', 'DELETE_DIVIDEND_SHAREPRODUCT', 'SHAREPRODUCT', 'DELETE_DIVIDEND', 0), ('SHAREPRODUCT', 'DELETE_DIVIDEND_SHAREPRODUCT_CHECKER', 'SHAREPRODUCT', 'DELETE_DIVIDEND_CHECKER', 0),('SHAREPRODUCT', 'READ_DIVIDEND_SHAREPRODUCT', 'SHAREPRODUCT', 'READ_DIVIDEND', 0),('SHAREACCOUNT', 'APPROVE_SHAREACCOUNT', 'SHAREACCOUNT', 'APPROVE', 0), -('SHAREACCOUNT', 'ACTIVATE_SHAREACCOUNT', 'SHAREACCOUNT', 'ACTIVATE', 0), -('SHAREACCOUNT', 'UNDOAPPROVAL_SHAREACCOUNT', 'SHAREACCOUNT', 'UNDOAPPROVAL', 0), -('SHAREACCOUNT', 'REJECT_SHAREACCOUNT', 'SHAREACCOUNT', 'REJECT', 0), -('SHAREACCOUNT', 'APPLYADDITIONALSHARES_SHAREACCOUNT', 'SHAREACCOUNT', 'APPLYADDITIONALSHARES', 0), -('SHAREACCOUNT', 'APPROVEADDITIONALSHARES_SHAREACCOUNT', 'SHAREACCOUNT', 'APPROVEADDITIONALSHARES', 0), -('SHAREACCOUNT', 'REJECTADDITIONALSHARES_SHAREACCOUNT', 'SHAREACCOUNT', 'REJECTADDITIONALSHARES', 0), -('SHAREACCOUNT', 'REDEEMSHARES_SHAREACCOUNT', 'SHAREACCOUNT', 'REDEEMSHARES', 0), -('SHAREACCOUNT', 'CLOSE_SHAREACCOUNT', 'SHAREACCOUNT', 'CLOSE', 0) -; - -INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`) VALUES ('Post Dividends For Shares', 'Post Dividends For Shares', '0 0 0 1/1 * ? *', now()); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V29__add-support-for-annual-fees-on-savings.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V29__add-support-for-annual-fees-on-savings.sql deleted file mode 100644 index ef4611ea0..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V29__add-support-for-annual-fees-on-savings.sql +++ /dev/null @@ -1,32 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_savings_product` -ADD COLUMN `annual_fee_amount` DECIMAL(19,6) NULL DEFAULT NULL AFTER `withdrawal_fee_type_enum`, -ADD COLUMN `annual_fee_on_month` SMALLINT NULL DEFAULT NULL AFTER `annual_fee_amount`, -ADD COLUMN `annual_fee_on_day` SMALLINT NULL DEFAULT NULL AFTER `annual_fee_on_month`; - -ALTER TABLE `m_savings_account` -ADD COLUMN `annual_fee_amount` DECIMAL(19,6) NULL DEFAULT NULL AFTER `withdrawal_fee_type_enum`, -ADD COLUMN `annual_fee_on_month` SMALLINT NULL DEFAULT NULL AFTER `annual_fee_amount`, -ADD COLUMN `annual_fee_on_day` SMALLINT NULL DEFAULT NULL AFTER `annual_fee_on_month`, -ADD COLUMN `annual_fee_next_due_date` DATE NULL DEFAULT NULL AFTER `annual_fee_on_day`; - -ALTER TABLE `m_savings_account` -ADD COLUMN `total_annual_fees_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `total_withdrawal_fees_derived`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V2__mifosx-base-reference-data-utf8.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V2__mifosx-base-reference-data-utf8.sql deleted file mode 100644 index ac9adda17..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V2__mifosx-base-reference-data-utf8.sql +++ /dev/null @@ -1,340 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - --- currency symbols may not apply through command line on windows so use a different client like mysql workbench - -INSERT INTO `ref_loan_transaction_processing_strategy` -(`id`,`code`,`name`) -VALUES -(1, 'mifos-standard-strategy', 'Mifos style'), -(2, 'heavensfamily-strategy', 'Heavensfamily'), -(3, 'creocore-strategy', 'Creocore'), -(4, 'rbi-india-strategy', 'RBI (India)'); - -INSERT INTO `c_configuration` -(`name`, `enabled`) -VALUES -('maker-checker', 0); - -INSERT INTO `r_enum_value` -VALUES -('amortization_method_enum',0,'Equal principle payments','Equal principle payments'), -('amortization_method_enum',1,'Equal installments','Equal installments'), -('interest_calculated_in_period_enum',0,'Daily','Daily'), -('interest_calculated_in_period_enum',1,'Same as repayment period','Same as repayment period'), -('interest_method_enum',0,'Declining Balance','Declining Balance'), -('interest_method_enum',1,'Flat','Flat'), -('interest_period_frequency_enum',2,'Per month','Per month'), -('interest_period_frequency_enum',3,'Per year','Per year'), -('loan_status_id',100,'Submitted and awaiting approval','Submitted and awaiting approval'), -('loan_status_id',200,'Approved','Approved'), -('loan_status_id',300,'Active','Active'), -('loan_status_id',400,'Withdrawn by client','Withdrawn by client'), -('loan_status_id',500,'Rejected','Rejected'), -('loan_status_id',600,'Closed','Closed'), -('loan_status_id',601,'Written-Off','Written-Off'), -('loan_status_id',602,'Rescheduled','Rescheduled'), -('loan_status_id',700,'Overpaid','Overpaid'), -('loan_transaction_strategy_id',1,'mifos-standard-strategy','Mifos style'), -('loan_transaction_strategy_id',2,'heavensfamily-strategy','Heavensfamily'), -('loan_transaction_strategy_id',3,'creocore-strategy','Creocore'), -('loan_transaction_strategy_id',4,'rbi-india-strategy','RBI (India)'), -('processing_result_enum',0,'invalid','Invalid'), -('processing_result_enum',1,'processed','Processed'), -('processing_result_enum',2,'awaiting.approval','Awaiting Approval'), -('processing_result_enum',3,'rejected','Rejected'), -('repayment_period_frequency_enum',0,'Days','Days'), -('repayment_period_frequency_enum',1,'Weeks','Weeks'), -('repayment_period_frequency_enum',2,'Months','Months'), -('term_period_frequency_enum',0,'Days','Days'), -('term_period_frequency_enum',1,'Weeks','Weeks'), -('term_period_frequency_enum',2,'Months','Months'), -('term_period_frequency_enum',3,'Years','Years'); - -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`) -VALUES ('transaction_type_enum', '1', 'Disbursement', 'Disbursement'); - -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`) -VALUES ('transaction_type_enum', '2', 'Repayment', 'Repayment'); - -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`) -VALUES ('transaction_type_enum', '3', 'Contra', 'Contra'); - -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`) -VALUES ('transaction_type_enum', '4', 'Waive Interest', 'Waive Interest'); - -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`) -VALUES ('transaction_type_enum', '5', 'Repayment At Disbursement', 'Repayment At Disbursement'); - -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`) -VALUES ('transaction_type_enum', '6', 'Write-Off', 'Write-Off'); - -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`) -VALUES ('transaction_type_enum', '7', 'Marked for Rescheduling', 'Marked for Rescheduling'); - -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`) -VALUES ('transaction_type_enum', '8', 'Recovery Repayment', 'Recovery Repayment'); - -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`) -VALUES ('transaction_type_enum', '9', 'Waive Charges', 'Waive Charges'); - -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`) -VALUES ('transaction_type_enum', '10', 'Apply Charges', 'Apply Charges'); - -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`) -VALUES ('transaction_type_enum', '11', 'Apply Interest', 'Apply Interest'); - -INSERT INTO `m_currency` -(`id`,`code`,`decimal_places`,`display_symbol`,`name`, `internationalized_name_code`) -VALUES -(1,'AED',2,NULL,'UAE Dirham','currency.AED'), -(2,'AFN',2,NULL,'Afghanistan Afghani','currency.AFN'), -(3,'ALL',2,NULL,'Albanian Lek','currency.ALL'), -(4,'AMD',2,NULL,'Armenian Dram','currency.AMD'), -(5,'ANG',2,NULL,'Netherlands Antillian Guilder','currency.ANG'), -(6,'AOA',2,NULL,'Angolan Kwanza','currency.AOA'), -(7,'ARS',2,'$','Argentine Peso','currency.ARS'), -(8,'AUD',2,'A$','Australian Dollar','currency.AUD'), -(9,'AWG',2,NULL,'Aruban Guilder','currency.AWG'), -(10,'AZM',2,NULL,'Azerbaijanian Manat','currency.AZM'), -(11,'BAM',2,NULL,'Bosnia and Herzegovina Convertible Marks','currency.BAM'), -(12,'BBD',2,NULL,'Barbados Dollar','currency.BBD'), -(13,'BDT',2,NULL,'Bangladesh Taka','currency.BDT'), -(14,'BGN',2,NULL,'Bulgarian Lev','currency.BGN'), -(15,'BHD',3,NULL,'Bahraini Dinar','currency.BHD'), -(16,'BIF',0,NULL,'Burundi Franc','currency.BIF'), -(17,'BMD',2,NULL,'Bermudian Dollar','currency.BMD'), -(18,'BND',2,'B$','Brunei Dollar','currency.BND'), -(19,'BOB',2,'Bs.','Bolivian Boliviano','currency.BOB'), -(20,'BRL',2,'R$','Brazilian Real','currency.BRL'), -(21,'BSD',2,NULL,'Bahamian Dollar','currency.BSD'), -(22,'BTN',2,NULL,'Bhutan Ngultrum','currency.BTN'), -(23,'BWP',2,NULL,'Botswana Pula','currency.BWP'), -(24,'BYR',0,NULL,'Belarussian Ruble','currency.BYR'), -(25,'BZD',2,'BZ$','Belize Dollar','currency.BZD'), -(26,'CAD',2,NULL,'Canadian Dollar','currency.CAD'), -(27,'CDF',2,NULL,'Franc Congolais','currency.CDF'), -(28,'CHF',2,NULL,'Swiss Franc','currency.CHF'), -(29,'CLP',0,'$','Chilean Peso','currency.CLP'), -(30,'CNY',2,NULL,'Chinese Yuan Renminbi','currency.CNY'), -(31,'COP',2,'$','Colombian Peso','currency.COP'), -(32,'CRC',2,'₡','Costa Rican Colon','currency.CRC'), -(33,'CSD',2,NULL,'Serbian Dinar','currency.CSD'), -(34,'CUP',2,'$MN','Cuban Peso','currency.CUP'), -(35,'CVE',2,NULL,'Cape Verde Escudo','currency.CVE'), -(36,'CYP',2,NULL,'Cyprus Pound','currency.CYP'), -(37,'CZK',2,NULL,'Czech Koruna','currency.CZK'), -(38,'DJF',0,NULL,'Djibouti Franc','currency.DJF'), -(39,'DKK',2,NULL,'Danish Krone','currency.DKK'), -(40,'DOP',2,'RD$','Dominican Peso','currency.DOP'), -(41,'DZD',2,NULL,'Algerian Dinar','currency.DZD'), -(42,'EEK',2,NULL,'Estonian Kroon','currency.EEK'), -(43,'EGP',2,NULL,'Egyptian Pound','currency.EGP'), -(44,'ERN',2,NULL,'Eritrea Nafka','currency.ERN'), -(45,'ETB',2,NULL,'Ethiopian Birr','currency.ETB'), -(46,'EUR',2,'€','Euro','currency.EUR'), -(47,'FJD',2,NULL,'Fiji Dollar','currency.FJD'), -(48,'FKP',2,NULL,'Falkland Islands Pound','currency.FKP'), -(49,'GBP',2,NULL,'Pound Sterling','currency.GBP'), -(50,'GEL',2,NULL,'Georgian Lari','currency.GEL'), -(51,'GHC',2,'GHc','Ghana Cedi','currency.GHC'), -(52,'GIP',2,NULL,'Gibraltar Pound','currency.GIP'), -(53,'GMD',2,NULL,'Gambian Dalasi','currency.GMD'), -(54,'GNF',0,NULL,'Guinea Franc','currency.GNF'), -(55,'GTQ',2,'Q','Guatemala Quetzal','currency.GTQ'), -(56,'GYD',2,NULL,'Guyana Dollar','currency.GYD'), -(57,'HKD',2,NULL,'Hong Kong Dollar','currency.HKD'), -(58,'HNL',2,'L','Honduras Lempira','currency.HNL'), -(59,'HRK',2,NULL,'Croatian Kuna','currency.HRK'), -(60,'HTG',2,'G','Haiti Gourde','currency.HTG'), -(61,'HUF',2,NULL,'Hungarian Forint','currency.HUF'), -(62,'IDR',2,NULL,'Indonesian Rupiah','currency.IDR'), -(63,'ILS',2,NULL,'New Israeli Shekel','currency.ILS'), -(64,'INR',2,'₹','Indian Rupee','currency.INR'), -(65,'IQD',3,NULL,'Iraqi Dinar','currency.IQD'), -(66,'IRR',2,NULL,'Iranian Rial','currency.IRR'), -(67,'ISK',0,NULL,'Iceland Krona','currency.ISK'), -(68,'JMD',2,NULL,'Jamaican Dollar','currency.JMD'), -(69,'JOD',3,NULL,'Jordanian Dinar','currency.JOD'), -(70,'JPY',0,NULL,'Japanese Yen','currency.JPY'), -(71,'KES',2,'KSh','Kenyan Shilling','currency.KES'), -(72,'KGS',2,NULL,'Kyrgyzstan Som','currency.KGS'), -(73,'KHR',2,NULL,'Cambodia Riel','currency.KHR'), -(74,'KMF',0,NULL,'Comoro Franc','currency.KMF'), -(75,'KPW',2,NULL,'North Korean Won','currency.KPW'), -(76,'KRW',0,NULL,'Korean Won','currency.KRW'), -(77,'KWD',3,NULL,'Kuwaiti Dinar','currency.KWD'), -(78,'KYD',2,NULL,'Cayman Islands Dollar','currency.KYD'), -(79,'KZT',2,NULL,'Kazakhstan Tenge','currency.KZT'), -(80,'LAK',2,NULL,'Lao Kip','currency.LAK'), -(81,'LBP',2,'L£','Lebanese Pound','currency.LBP'), -(82,'LKR',2,NULL,'Sri Lanka Rupee','currency.LKR'), -(83,'LRD',2,NULL,'Liberian Dollar','currency.LRD'), -(84,'LSL',2,NULL,'Lesotho Loti','currency.LSL'), -(85,'LTL',2,NULL,'Lithuanian Litas','currency.LTL'), -(86,'LVL',2,NULL,'Latvian Lats','currency.LVL'), -(87,'LYD',3,NULL,'Libyan Dinar','currency.LYD'), -(88,'MAD',2,NULL,'Moroccan Dirham','currency.MAD'), -(89,'MDL',2,NULL,'Moldovan Leu','currency.MDL'), -(90,'MGA',2,NULL,'Malagasy Ariary','currency.MGA'), -(91,'MKD',2,NULL,'Macedonian Denar','currency.MKD'), -(92,'MMK',2,'K','Myanmar Kyat','currency.MMK'), -(93,'MNT',2,NULL,'Mongolian Tugrik','currency.MNT'), -(94,'MOP',2,NULL,'Macau Pataca','currency.MOP'), -(95,'MRO',2,NULL,'Mauritania Ouguiya','currency.MRO'), -(96,'MTL',2,NULL,'Maltese Lira','currency.MTL'), -(97,'MUR',2,NULL,'Mauritius Rupee','currency.MUR'), -(98,'MVR',2,NULL,'Maldives Rufiyaa','currency.MVR'), -(99,'MWK',2,NULL,'Malawi Kwacha','currency.MWK'), -(100,'MXN',2,'$','Mexican Peso','currency.MXN'), -(101,'MYR',2,NULL,'Malaysian Ringgit','currency.MYR'), -(102,'MZM',2,NULL,'Mozambique Metical','currency.MZM'), -(103,'NAD',2,NULL,'Namibia Dollar','currency.NAD'), -(104,'NGN',2,NULL,'Nigerian Naira','currency.NGN'), -(105,'NIO',2,'C$','Nicaragua Cordoba Oro','currency.NIO'), -(106,'NOK',2,NULL,'Norwegian Krone','currency.NOK'), -(107,'NPR',2,NULL,'Nepalese Rupee','currency.NPR'), -(108,'NZD',2,NULL,'New Zealand Dollar','currency.NZD'), -(109,'OMR',3,NULL,'Rial Omani','currency.OMR'), -(110,'PAB',2,'B/.','Panama Balboa','currency.PAB'), -(111,'PEN',2,'S/.','Peruvian Nuevo Sol','currency.PEN'), -(112,'PGK',2,NULL,'Papua New Guinea Kina','currency.PGK'), -(113,'PHP',2,NULL,'Philippine Peso','currency.PHP'), -(114,'PKR',2,NULL,'Pakistan Rupee','currency.PKR'), -(115,'PLN',2,NULL,'Polish Zloty','currency.PLN'), -(116,'PYG',0,'₲','Paraguayan Guarani','currency.PYG'), -(117,'QAR',2,NULL,'Qatari Rial','currency.QAR'), -(118,'RON',2,NULL,'Romanian Leu','currency.RON'), -(119,'RUB',2,NULL,'Russian Ruble','currency.RUB'), -(120,'RWF',0,NULL,'Rwanda Franc','currency.RWF'), -(121,'SAR',2,NULL,'Saudi Riyal','currency.SAR'), -(122,'SBD',2,NULL,'Solomon Islands Dollar','currency.SBD'), -(123,'SCR',2,NULL,'Seychelles Rupee','currency.SCR'), -(124,'SDD',2,NULL,'Sudanese Dinar','currency.SDD'), -(125,'SEK',2,NULL,'Swedish Krona','currency.SEK'), -(126,'SGD',2,NULL,'Singapore Dollar','currency.SGD'), -(127,'SHP',2,NULL,'St Helena Pound','currency.SHP'), -(128,'SIT',2,NULL,'Slovenian Tolar','currency.SIT'), -(129,'SKK',2,NULL,'Slovak Koruna','currency.SKK'), -(130,'SLL',2,NULL,'Sierra Leone Leone','currency.SLL'), -(131,'SOS',2,NULL,'Somali Shilling','currency.SOS'), -(132,'SRD',2,NULL,'Surinam Dollar','currency.SRD'), -(133,'STD',2,NULL,'Sao Tome and Principe Dobra','currency.STD'), -(134,'SVC',2,NULL,'El Salvador Colon','currency.SVC'), -(135,'SYP',2,NULL,'Syrian Pound','currency.SYP'), -(136,'SZL',2,NULL,'Swaziland Lilangeni','currency.SZL'), -(137,'THB',2,NULL,'Thai Baht','currency.THB'), -(138,'TJS',2,NULL,'Tajik Somoni','currency.TJS'), -(139,'TMM',2,NULL,'Turkmenistan Manat','currency.TMM'), -(140,'TND',3,'DT','Tunisian Dinar','currency.TND'), -(141,'TOP',2,NULL,'Tonga Pa\'anga','currency.TOP'), -(142,'TRY',2,NULL,'Turkish Lira','currency.TRY'), -(143,'TTD',2,NULL,'Trinidad and Tobago Dollar','currency.TTD'), -(144,'TWD',2,NULL,'New Taiwan Dollar','currency.TWD'), -(145,'TZS',2,NULL,'Tanzanian Shilling','currency.TZS'), -(146,'UAH',2,NULL,'Ukraine Hryvnia','currency.UAH'), -(147,'UGX',2,'USh','Uganda Shilling','currency.UGX'), -(148,'USD',2,'$','US Dollar','currency.USD'), -(149,'UYU',2,'$U','Peso Uruguayo','currency.UYU'), -(150,'UZS',2,NULL,'Uzbekistan Sum','currency.UZS'), -(151,'VEB',2,'Bs.F.','Venezuelan Bolivar','currency.VEB'), -(152,'VND',2,NULL,'Vietnamese Dong','currency.VND'), -(153,'VUV',0,NULL,'Vanuatu Vatu','currency.VUV'), -(154,'WST',2,NULL,'Samoa Tala','currency.WST'), -(155,'XAF',0,NULL,'CFA Franc BEAC','currency.XAF'), -(156,'XCD',2,NULL,'East Caribbean Dollar','currency.XCD'), -(157,'XDR',5,NULL,'SDR (Special Drawing Rights)','currency.XDR'), -(158,'XOF',0, 'CFA','CFA Franc BCEAO','currency.XOF'), -(159,'XPF',0,NULL,'CFP Franc','currency.XPF'), -(160,'YER',2,NULL,'Yemeni Rial','currency.YER'), -(161,'ZAR',2, 'R','South African Rand','currency.ZAR'), -(162,'ZMK',2,NULL,'Zambian Kwacha','currency.ZMK'), -(163,'ZWD',2,NULL,'Zimbabwe Dollar','currency.ZWD'); --- ======== end of currencies == - -INSERT INTO `m_organisation_currency` (`id`, `code`, `decimal_places`, `name`, `display_symbol`, `internationalized_name_code`) -VALUES (21,'USD',2,'US Dollar','$','currency.USD'); - -INSERT INTO `m_office` (`id`, `parent_id`, `hierarchy`, `external_id`, `name`, `opening_date`) -VALUES -(1,NULL,'.','1','Head Office','2009-01-01'); - -INSERT INTO `m_group_level` (`id`, `parent_id`, `super_parent`, `level_name`, `recursable`, `can_have_clients`) -VALUES (1, NULL, 1, 'Center', 1, 0); -INSERT INTO `m_group_level` (`id`, `parent_id`, `super_parent`, `level_name`, `recursable`, `can_have_clients`) -VALUES (2, 1, 0, 'Group', 0, 1); - - - --- create single code and code value for client identifiers -INSERT INTO `m_code` -(`code_name`, `is_system_defined`) -VALUES -('Customer Identifier',1), -('LoanCollateral',1), -('LoanPurpose',1), -('Gender',1), -('YesNo',1), -('GuarantorRelationship',1); - -INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`) -select mc.id, 'Passport', 1 -from m_code mc -where mc.`code_name` = "Customer Identifier"; - -INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`) -select mc.id, 'Id', 2 -from m_code mc -where mc.`code_name` = "Customer Identifier"; - -INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`) -select mc.id, 'Drivers License', 3 -from m_code mc -where mc.`code_name` = "Customer Identifier"; - -INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`) -select mc.id, 'Any Other Id Type', 4 -from m_code mc -where mc.`code_name` = "Customer Identifier"; - --- Adding a few Default Guarantor Relationships -insert into m_code_value (code_id,code_value,order_position) - select id,"Spouse",0 - from m_code - where m_code.code_name="GuarantorRelationship"; - -insert into m_code_value (code_id,code_value,order_position) - select id,"Parent",0 - from m_code - where m_code.code_name="GuarantorRelationship"; - -insert into m_code_value (code_id,code_value,order_position) - select id,"Sibling",0 - from m_code - where m_code.code_name="GuarantorRelationship"; - -insert into m_code_value (code_id,code_value,order_position) - select id,"Business Associate",0 - from m_code - where m_code.code_name="GuarantorRelationship"; - -insert into m_code_value (code_id,code_value,order_position) - select id,"Other",0 - from m_code - where m_code.code_name="GuarantorRelationship"; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V300__configuration_for_allow_changing_of_emi_amount.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V300__configuration_for_allow_changing_of_emi_amount.sql deleted file mode 100644 index 54bc150ba..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V300__configuration_for_allow_changing_of_emi_amount.sql +++ /dev/null @@ -1,23 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `c_configuration` - CHANGE COLUMN `name` `name` VARCHAR(100) NULL DEFAULT NULL AFTER `id`; - -INSERT INTO `c_configuration` (`name`, `value`, `date_value`, `enabled`, `is_trap_door`, `description`) VALUES ( 'change-emi-if-repaymentdate-same-as-disbursementdate', 0, NULL, 1, 0, 'In tranche loans, if repayment date is same as tranche disbursement date then allow to change the emi amount'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V301__recurring_moratorium_principal_periods.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V301__recurring_moratorium_principal_periods.sql deleted file mode 100644 index 81a0183a3..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V301__recurring_moratorium_principal_periods.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE m_product_loan - ADD COLUMN `recurring_moratorium_principal_periods` SMALLINT NULL DEFAULT NULL AFTER `grace_on_principal_periods`; - -ALTER TABLE m_loan - ADD COLUMN `recurring_moratorium_principal_periods` SMALLINT NULL DEFAULT NULL AFTER `grace_on_principal_periods`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V302__add_status_to_client_identifier.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V302__add_status_to_client_identifier.sql deleted file mode 100644 index a26b4623b..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V302__add_status_to_client_identifier.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_client_identifier` - ADD COLUMN `status` INT NOT NULL DEFAULT 300 AFTER `document_key`, - DROP INDEX `unique_client_identifier`, - ADD COLUMN `active` INT NULL DEFAULT NULL AFTER `status`, - ADD UNIQUE INDEX `unique_active_client_identifier` (`client_id`, `document_type_id`, `active` ); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V303__Savings_Account_Dormancy.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V303__Savings_Account_Dormancy.sql deleted file mode 100644 index a129dcb75..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V303__Savings_Account_Dormancy.sql +++ /dev/null @@ -1,37 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_savings_product` -ADD COLUMN `is_dormancy_tracking_active` SMALLINT NULL, -ADD COLUMN `days_to_inactive` INT NULL, -ADD COLUMN `days_to_dormancy` INT NULL, -ADD COLUMN `days_to_escheat` INT NULL; - -ALTER TABLE `m_savings_account` -ADD COLUMN `sub_status_enum` SMALLINT NOT NULL DEFAULT '0' AFTER `status_enum`; - -INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`) VALUES ('Update Savings Dormant Accounts', 'Update Savings Dormant Accounts', '0 0 0 1/1 * ? *', now()); - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Savings Accounts Dormancy Report', 'Table', 'Savings', 'select cl.display_name as \'Client Display Name\',\r\nsa.account_no as \'Account Number\',\r\ncl.mobile_no as \'Mobile Number\',\r\n@lastdate:=(select IFNULL(max(sat.transaction_date),sa.activatedon_date) \r\n from m_savings_account_transaction as sat \r\n where sat.is_reversed = 0 \r\n and sat.transaction_type_enum in (1,2) \r\n and sat.savings_account_id = sa.id) as \'Date of Last Activity\',\r\nDATEDIFF(now(), @lastdate) as \'Days Since Last Activity\'\r\nfrom m_savings_account as sa \r\ninner join m_savings_product as sp on (sa.product_id = sp.id and sp.is_dormancy_tracking_active = 1) \r\nleft join m_client as cl on sa.client_id = cl.id \r\nwhere sa.sub_status_enum = ${subStatus}\r\nand cl.office_id = ${officeId}', NULL, 1, 1); - -INSERT INTO `stretchy_parameter` (`parameter_name`, `parameter_variable`, `parameter_label`, `parameter_displayType`, `parameter_FormatType`, `parameter_default`, `parameter_sql`) VALUES ('SavingsAccountSubStatus', 'subStatus', 'SavingsAccountDormancyStatus', 'select', 'number', '100', 'select * from\r\n(select 100 as id, "Inactive" as name union all\r\nselect 200 as id, "Dormant" as name union all \r\nselect 300 as id, "Escheat" as name) x\r\norder by x.`id`'); - -INSERT INTO stretchy_report_parameter (report_id, parameter_id) VALUES ((select sr.id From stretchy_report sr where sr.report_name='Savings Accounts Dormancy Report'),(select sp.id from stretchy_parameter sp where sp.parameter_name='SavingsAccountSubStatus')); - -INSERT INTO stretchy_report_parameter (report_id, parameter_id) VALUES ((select sr.id From stretchy_report sr where sr.report_name='Savings Accounts Dormancy Report'),(select sp.id from stretchy_parameter sp where sp.parameter_name='OfficeIdSelectOne')); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V304__customer_self_service_third_party_transfers.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V304__customer_self_service_third_party_transfers.sql deleted file mode 100644 index 59c3bbc8f..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V304__customer_self_service_third_party_transfers.sql +++ /dev/null @@ -1,43 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `c_configuration` (`name`, `value`, `date_value`, `enabled`, `is_trap_door`, `description`) VALUES ( 'daily-tpt-limit', 0, NULL, 0, 0, 'Daily limit for third party transfers'); - -CREATE TABLE `m_selfservice_beneficiaries_tpt` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `app_user_id` BIGINT NOT NULL, - `name` VARCHAR(50) NOT NULL, - `office_id` BIGINT NOT NULL, - `client_id` BIGINT NOT NULL, - `account_id` BIGINT NOT NULL, - `account_type` SMALLINT NOT NULL, - `transfer_limit` BIGINT NULL DEFAULT 0, - `is_active` BIT(1) NOT NULL DEFAULT 0, - PRIMARY KEY (`id`), - UNIQUE INDEX `name` (`name`, `app_user_id`, `is_active`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB -; - -INSERT INTO `m_permission`(`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES -('SSBENEFICIARYTPT', 'READ_SSBENEFICIARYTPT', 'SSBENEFICIARYTPT', 'READ', 0), -('SSBENEFICIARYTPT', 'CREATE_SSBENEFICIARYTPT', 'SSBENEFICIARYTPT', 'CREATE', 0), -('SSBENEFICIARYTPT', 'UPDATE_SSBENEFICIARYTPT', 'SSBENEFICIARYTPT', 'UPDATE', 0), -('SSBENEFICIARYTPT', 'DELETE_SSBENEFICIARYTPT', 'SSBENEFICIARYTPT', 'DELETE', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V305__compounding_and_rest_frequency_nth_day_freq_and_insertion_script_for_accrual_job.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V305__compounding_and_rest_frequency_nth_day_freq_and_insertion_script_for_accrual_job.sql deleted file mode 100644 index 75a56e3ee..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V305__compounding_and_rest_frequency_nth_day_freq_and_insertion_script_for_accrual_job.sql +++ /dev/null @@ -1,79 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_loan_interest_recalculation_additional_details` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `loan_repayment_schedule_id` BIGINT NOT NULL, - `effective_date` DATE NOT NULL, - `amount` DECIMAL(19,6) NOT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `FK_additional_details_repayment_schedule_id` FOREIGN KEY (`loan_repayment_schedule_id`) REFERENCES `m_loan_repayment_schedule` (`id`) -); - - -ALTER TABLE `m_loan` DROP `repayment_frequency_nth_day_enum`, DROP `repayment_frequency_day_of_week_enum`; - - -ALTER TABLE `m_product_loan_recalculation_details` ADD `rest_frequency_nth_day_enum` INT, ADD `rest_frequency_on_day` INT, ADD `rest_frequency_weekday_enum` INT, -ADD `compounding_frequency_nth_day_enum` INT, ADD `compounding_frequency_on_day` INT, ADD `compounding_frequency_weekday_enum` INT, ADD `is_compounding_to_be_posted_as_transaction` tinyint NOT NULL DEFAULT '0', ADD `allow_compounding_on_eod` tinyint NOT NULL DEFAULT '0'; - - -ALTER TABLE `m_loan_recalculation_details` ADD `rest_frequency_nth_day_enum` INT, ADD `rest_frequency_on_day` INT, ADD `rest_frequency_weekday_enum` INT, -ADD `compounding_frequency_nth_day_enum` INT, ADD `compounding_frequency_on_day` INT, -ADD `is_compounding_to_be_posted_as_transaction` tinyint NOT NULL DEFAULT '0', -ADD `compounding_frequency_weekday_enum` INT, ADD `allow_compounding_on_eod` tinyint NOT NULL DEFAULT '0'; - - -UPDATE m_product_loan_recalculation_details plr SET plr.compounding_frequency_weekday_enum = (WEEKDAY(plr.compounding_freqency_date) + 1) WHERE plr.compounding_frequency_type_enum = 3 AND plr.compounding_freqency_date IS NOT NULL; - - -UPDATE m_product_loan_recalculation_details plr SET plr.compounding_frequency_on_day = DAYOFMONTH(plr.compounding_freqency_date) WHERE plr.compounding_frequency_type_enum = 4 AND plr.compounding_freqency_date IS NOT NULL; - - -UPDATE m_loan_recalculation_details lrd SET lrd.compounding_frequency_weekday_enum = (WEEKDAY(lrd.compounding_freqency_date) + 1) WHERE lrd.compounding_frequency_type_enum = 3 AND lrd.compounding_freqency_date IS NOT NULL; - - -UPDATE m_loan_recalculation_details lrd SET lrd.compounding_frequency_on_day = DAYOFMONTH(lrd.compounding_freqency_date) WHERE lrd.compounding_frequency_type_enum = 4 AND lrd.compounding_freqency_date IS NOT NULL; - - -UPDATE m_product_loan_recalculation_details plr SET plr.rest_frequency_weekday_enum = (WEEKDAY(plr.rest_freqency_date) + 1) WHERE plr.rest_frequency_type_enum = 3 AND plr.rest_freqency_date IS NOT NULL; - - -UPDATE m_product_loan_recalculation_details plr SET plr.rest_frequency_on_day = DAYOFMONTH(plr.rest_freqency_date) WHERE plr.rest_frequency_type_enum = 4 AND plr.rest_freqency_date IS NOT NULL; - - -UPDATE m_loan_recalculation_details lrd SET lrd.rest_frequency_weekday_enum = (WEEKDAY(lrd.rest_freqency_date) + 1) WHERE lrd.rest_frequency_type_enum = 3 AND lrd.rest_freqency_date IS NOT NULL; - - -UPDATE m_loan_recalculation_details lrd SET lrd.rest_frequency_on_day = DAYOFMONTH(lrd.rest_freqency_date) WHERE lrd.rest_frequency_type_enum = 4 AND lrd.rest_freqency_date IS NOT NULL; - - -ALTER TABLE `m_product_loan_recalculation_details` DROP `rest_freqency_date`, DROP `compounding_freqency_date`; - - -ALTER TABLE `m_loan_recalculation_details` DROP `rest_freqency_date`, DROP `compounding_freqency_date`; - - -ALTER TABLE `job` - CHANGE COLUMN `name` `name` VARCHAR(100) NOT NULL AFTER `id`, - CHANGE COLUMN `display_name` `display_name` VARCHAR(100) NOT NULL AFTER `name`; - -INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Add Accrual Transactions For Loans With Income Posted As Transactions', 'Add Accrual Transactions For Loans With Income Posted As Transactions', '0 1 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 3, 0); - -UPDATE `job` SET `task_priority`=6 WHERE `name`='Update Non Performing Assets'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V306__add_domancy_tracking_job_to_savings_group.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V306__add_domancy_tracking_job_to_savings_group.sql deleted file mode 100644 index 0c829e046..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V306__add_domancy_tracking_job_to_savings_group.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -UPDATE `job` -SET `task_priority`=3, `scheduler_group`=1 -WHERE `name`='Update Savings Dormant Accounts'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V307__add_share_notes.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V307__add_share_notes.sql deleted file mode 100644 index 43310be87..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V307__add_share_notes.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_note` -ADD COLUMN `share_account_id` BIGINT NULL DEFAULT NULL AFTER `savings_account_transaction_id`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V308__add_interest_recalculation_in_savings_account.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V308__add_interest_recalculation_in_savings_account.sql deleted file mode 100644 index ecf05e138..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V308__add_interest_recalculation_in_savings_account.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_savings_account` - ADD COLUMN `last_interest_calculation_date` DATE NULL DEFAULT NULL AFTER `tax_group_id`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V309__add_loan_write_off_reason_code.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V309__add_loan_write_off_reason_code.sql deleted file mode 100644 index 21708ff22..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V309__add_loan_write_off_reason_code.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_code` (`code_name`, `is_system_defined`) VALUES ('WriteOffReasons', 1); - -ALTER TABLE `m_loan` -add column `writeoff_reason_cv_id` INT NULL DEFAULT NULL, -add CONSTRAINT `FK_writeoffreason_m_loan_m_code_value` FOREIGN KEY (`writeoff_reason_cv_id`) REFERENCES `m_code_value` (`id`); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V30__add-referenceNumber-to-acc_gl_journal_entry.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V30__add-referenceNumber-to-acc_gl_journal_entry.sql deleted file mode 100644 index c969b524f..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V30__add-referenceNumber-to-acc_gl_journal_entry.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -alter table `acc_gl_journal_entry` -add column `ref_num` varchar(100) default NULL AFTER `reversed`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V310__copy_data_from_entitytoentityaccess_to_entitytoentitymapping.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V310__copy_data_from_entitytoentityaccess_to_entitytoentitymapping.sql deleted file mode 100644 index 6be70f98a..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V310__copy_data_from_entitytoentityaccess_to_entitytoentitymapping.sql +++ /dev/null @@ -1,28 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -insert ignore into m_entity_to_entity_mapping (from_id,to_id,rel_id) -select mea.entity_id as fromId, -mea.second_entity_id as toid, -case mea.access_type_code_value_id -when (select mcv.id from m_code_value mcv where mcv.code_value like'Office Access to Loan Products') then (select mer.id from m_entity_relation mer where mer.code_name like 'office_access_to_loan_products') -when (select mcv.id from m_code_value mcv where mcv.code_value like'Office Access to Savings Products') then (select mer.id from m_entity_relation mer where mer.code_name like 'office_access_to_savings_products') -when (select mcv.id from m_code_value mcv where mcv.code_value like'Office Access to Fees/Charges') then (select mer.id from m_entity_relation mer where mer.code_name like 'office_access_to_fees/charges') -end as reId -from m_entity_to_entity_access mea diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V311__foreclosure_details.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V311__foreclosure_details.sql deleted file mode 100644 index 37214bf86..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V311__foreclosure_details.sql +++ /dev/null @@ -1,26 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES -('portfolio', 'FORECLOSURE_LOAN', 'LOAN', 'FORECLOSURE', 0), -('portfolio', 'FORECLOSURE_LOAN_CHECKER', 'LOAN', 'FORECLOSURE_CHECKER', 0); - - -ALTER TABLE `m_loan` - ADD COLUMN `loan_sub_status_id` SMALLINT NULL DEFAULT NULL; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V312__add_is_mandatory_to_code_value.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V312__add_is_mandatory_to_code_value.sql deleted file mode 100644 index 0bb5361bc..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V312__add_is_mandatory_to_code_value.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -alter table `m_code_value` add `is_mandatory` tinyint not null default '0'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V313__multi_rescheduling_script.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V313__multi_rescheduling_script.sql deleted file mode 100644 index 28c8a31c9..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V313__multi_rescheduling_script.sql +++ /dev/null @@ -1,161 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_loan_term_variations` - ADD COLUMN `is_active` tinyint NOT NULL DEFAULT '1' AFTER `applied_on_loan_status`; - -ALTER TABLE `m_loan_term_variations` - ADD COLUMN `parent_id` BIGINT NULL DEFAULT NULL AFTER `is_active`; - -ALTER TABLE `m_loan_term_variations` - ADD COLUMN `reshedule_request_id` BIGINT NULL DEFAULT NULL AFTER `parent_id`; - -insert into m_loan_term_variations(`loan_id`, `term_type`, `applicable_date`, `decimal_value`, `date_value` , `is_specific_to_installment`, `applied_on_loan_status`, `reshedule_request_id` , `is_active` , `parent_id`) -( -select -mlrr.loan_id, - 7 term_type, - ifnull(mlrr.adjusted_due_date,mlrr.reschedule_from_date) applicable_date, - mlrr.grace_on_interest decimal_value, - null date_value, - 1 is_specific_to_installment, - 300 applied_on_loan_status_id, - mlrr.id reshedule_request_id, - if(mlrr.status_enum = 200 ,1,0) is_active, - null parent_id -from m_loan_reschedule_request mlrr -where mlrr.grace_on_interest is not null); - -insert into m_loan_term_variations(`loan_id`, `term_type`, `applicable_date`, `decimal_value`, `date_value` , `is_specific_to_installment`, `applied_on_loan_status`, `reshedule_request_id` , `is_active` , `parent_id`) -( -select -mlrr.loan_id, - 8 term_type, - ifnull(mlrr.adjusted_due_date,mlrr.reschedule_from_date) applicable_date, - mlrr.grace_on_principal decimal_value, - null date_value, - 1 is_specific_to_installment, - 300 applied_on_loan_status_id, - mlrr.id reshedule_request_id, - if(mlrr.status_enum = 200 ,1,0) is_active, - null parent_id -from m_loan_reschedule_request mlrr -where mlrr.grace_on_principal is not null); - -insert into m_loan_term_variations(`loan_id`, `term_type`, `applicable_date`, `decimal_value`, `date_value` , `is_specific_to_installment`, `applied_on_loan_status`, `reshedule_request_id` , `is_active` , `parent_id`) -( -select -mlrr.loan_id, - 4 term_type, - mlrr.reschedule_from_date applicable_date, - null decimal_value, - mlrr.adjusted_due_date date_value, - 1 is_specific_to_installment, - 300 applied_on_loan_status_id, - mlrr.id reshedule_request_id, - if(mlrr.status_enum = 200 ,1,0) is_active, - null parent_id -from m_loan_reschedule_request mlrr -where mlrr.adjusted_due_date is not null); - -insert into m_loan_term_variations(`loan_id`, `term_type`, `applicable_date`, `decimal_value`, `date_value` , `is_specific_to_installment`, `applied_on_loan_status`, `reshedule_request_id` , `is_active` , `parent_id`) -( -select -mlrr.loan_id, - 9 term_type, - ifnull(mlrr.adjusted_due_date,mlrr.reschedule_from_date) applicable_date, - mlrr.extra_terms decimal_value, - null date_value, - 1 is_specific_to_installment, - 300 applied_on_loan_status_id, - mlrr.id reshedule_request_id, - if(mlrr.status_enum = 200 ,1,0) is_active, - null parent_id -from m_loan_reschedule_request mlrr -where mlrr.extra_terms is not null); - -insert into m_loan_term_variations(`loan_id`, `term_type`, `applicable_date`, `decimal_value`, `date_value` , `is_specific_to_installment`, `applied_on_loan_status`, `reshedule_request_id` , `is_active` , `parent_id`) -( -select -mlrr.loan_id, - 2 term_type, - ifnull(mlrr.adjusted_due_date,mlrr.reschedule_from_date) applicable_date, - mlrr.interest_rate decimal_value, - null date_value, - 1 is_specific_to_installment, - 300 applied_on_loan_status_id, - mlrr.id reshedule_request_id, - if(mlrr.status_enum = 200 ,1,0) is_active, - null parent_id -from m_loan_reschedule_request mlrr -where mlrr.interest_rate is not null); - -insert into m_loan_term_variations(`loan_id`, `term_type`, `applicable_date`, `decimal_value`, `date_value` , `is_specific_to_installment`, `applied_on_loan_status`, `reshedule_request_id` , `is_active` , `parent_id`) -( -select -mlrr.loan_id, - 9 term_type, - mlrr.reschedule_from_date applicable_date, - if(ifnull(mlrr.grace_on_principal,0) > ifnull(mlrr.grace_on_interest,0),mlrr.grace_on_principal,mlrr.grace_on_interest) decimal_value, - null date_value, - 1 is_specific_to_installment, - 300 applied_on_loan_status_id, - mlrr.id reshedule_request_id, - if(mlrr.status_enum = 200 ,1,0) is_active, - (select distinct mlt.id - from m_loan_term_variations mlt - where mlt.reshedule_request_id is not null - and (mlt.term_type =8 or mlt.term_type = 7) - and mlt.reshedule_request_id = mlrr.id - group by mlt.id - order by mlt.term_type desc limit 1) parent_id -from m_loan_reschedule_request mlrr -where (mlrr.grace_on_interest is not null or mlrr.grace_on_principal is not null)); - -ALTER TABLE `m_loan_reschedule_request` - DROP COLUMN `grace_on_principal`, - DROP COLUMN `grace_on_interest`, - DROP COLUMN `extra_terms`, - DROP COLUMN `interest_rate`, - DROP COLUMN `adjusted_due_date`; - -CREATE TABLE `m_loan_reschedule_request_term_variations_mapping` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `loan_reschedule_request_id` BIGINT NOT NULL, - `loan_term_variations_id` BIGINT NOT NULL, - PRIMARY KEY (`id`), - INDEX `FK__m_loan_reschedule_request` (`loan_reschedule_request_id`), - INDEX `FK__m_loan_term_variations` (`loan_term_variations_id`), - CONSTRAINT `FK__m_loan_reschedule_request` FOREIGN KEY (`loan_reschedule_request_id`) REFERENCES `m_loan_reschedule_request` (`id`), - CONSTRAINT `FK__m_loan_term_variations` FOREIGN KEY (`loan_term_variations_id`) REFERENCES `m_loan_term_variations` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB -AUTO_INCREMENT=1 -; - -insert ignore into m_loan_reschedule_request_term_variations_mapping (`loan_reschedule_request_id`, `loan_term_variations_id`) -( -select distinct mltv.reshedule_request_id,mltv.id -from m_loan_term_variations mltv -where reshedule_request_id is not null -); - -ALTER TABLE `m_loan_term_variations` - DROP COLUMN `reshedule_request_id`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V314__updating_r_enum_table.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V314__updating_r_enum_table.sql deleted file mode 100644 index d3ef014fc..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V314__updating_r_enum_table.sql +++ /dev/null @@ -1,112 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('loan_transaction_type_enum', 0, 'INVALID', 'INVALID', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('loan_transaction_type_enum', 1, 'DISBURSEMENT', 'DISBURSEMENT', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('loan_transaction_type_enum', 2, 'REPAYMENT', 'REPAYMENT', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('loan_transaction_type_enum', 3, 'CONTRA', 'CONTRA', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('loan_transaction_type_enum', 4, 'WAIVE_INTEREST', 'WAIVE_INTEREST', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('loan_transaction_type_enum', 5, 'REPAYMENT_AT_DISBURSEMENT', 'REPAYMENT_AT_DISBURSEMENT', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('loan_transaction_type_enum', 6, 'WRITEOFF', 'WRITEOFF', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('loan_transaction_type_enum', 7, 'MARKED_FOR_RESCHEDULING', 'MARKED_FOR_RESCHEDULING', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('loan_transaction_type_enum', 8, 'RECOVERY_REPAYMENT', 'RECOVERY_REPAYMENT', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('loan_transaction_type_enum', 9, 'WAIVE_CHARGES', 'WAIVE_CHARGES', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('loan_transaction_type_enum', 10, 'ACCRUAL', 'ACCRUAL', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('loan_transaction_type_enum', 12, 'INITIATE_TRANSFER', 'INITIATE_TRANSFER', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('loan_transaction_type_enum', 13, 'APPROVE_TRANSFER', 'APPROVE_TRANSFER', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('loan_transaction_type_enum', 14, 'WITHDRAW_TRANSFER', 'WITHDRAW_TRANSFER', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('loan_transaction_type_enum', 15, 'REJECT_TRANSFER', 'REJECT_TRANSFER', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('loan_transaction_type_enum', 16, 'REFUND', 'REFUND', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('loan_transaction_type_enum', 17, 'CHARGE_PAYMENT', 'CHARGE_PAYMENT', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('loan_transaction_type_enum', 18, 'REFUND_FOR_ACTIVE_LOAN', 'REFUND_FOR_ACTIVE_LOAN', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('loan_transaction_type_enum', 19, 'INCOME_POSTING', 'INCOME_POSTING', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 0, 'INVALID', 'INVALID', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 8, 'DIVIDEND_PAYOUT', 'DIVIDEND_PAYOUT', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 19, 'WITHHOLD_TAX', 'WITHHOLD_TAX', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('client_transaction_type_enum', 1, 'PAY_CHARGE', 'PAY_CHARGE', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('client_transaction_type_enum', 2, 'WAIVE_CHARGE', 'WAIVE_CHARGE', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('entity_account_type_enum', 1, 'CLIENT', 'CLIENT', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('entity_account_type_enum', 2, 'LOAN', 'LOAN', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('entity_account_type_enum', 3, 'SAVINGS', 'SAVINGS', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('entity_account_type_enum', 4, 'CENTER', 'CENTER', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('entity_account_type_enum', 5, 'GROUP', 'GROUP', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('entity_account_type_enum', 6, 'SHARES', 'SHARES', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('calendar_type_enum', 0, 'INVALID', 'INVALID', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('calendar_type_enum', 1, 'CLIENTS', 'CLIENTS', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('calendar_type_enum', 2, 'GROUPS', 'GROUPS', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('calendar_type_enum', 3, 'LOANS', 'LOANS', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('calendar_type_enum', 4, 'CENTERS', 'CENTERS', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('calendar_type_enum', 5, 'SAVINGS', 'SAVINGS', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('calendar_type_enum', 6, 'LOAN_RECALCULATION_REST_DETAIL', 'LOAN_RECALCULATION_REST_DETAIL', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('calendar_type_enum', 7, 'LOAN_RECALCULATION_COMPOUNDING_DETAIL', 'LOAN_RECALCULATION_COMPOUNDING_DETAIL', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('glaccount_type_enum', 1, 'ASSET', 'ASSET', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('glaccount_type_enum', 2, 'LIABILITY', 'LIABILITY', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('glaccount_type_enum', 3, 'EQUITY', 'EQUITY', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('glaccount_type_enum', 4, 'INCOME', 'INCOME', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('glaccount_type_enum', 5, 'EXPENSE', 'EXPENSE', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('portfolio_account_type_enum', 1, 'LOAN', 'LOAN', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('portfolio_account_type_enum', 2, 'SAVING', 'EXPENSE', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('portfolio_account_type_enum', 3, 'PROVISIONING', 'PROVISIONING', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('portfolio_account_type_enum', 4, 'SHARES', 'SHARES', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('accrual_accounts_for_loan_type_enum', 1, 'FUND_SOURCE', 'FUND_SOURCE', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('accrual_accounts_for_loan_type_enum', 2, 'LOAN_PORTFOLIO', 'LOAN_PORTFOLIO', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('accrual_accounts_for_loan_type_enum', 3, 'INTEREST_ON_LOANS', 'INTEREST_ON_LOANS', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('accrual_accounts_for_loan_type_enum', 4, 'INCOME_FROM_FEES', 'INCOME_FROM_FEES', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('accrual_accounts_for_loan_type_enum', 5, 'INCOME_FROM_PENALTIES', 'INCOME_FROM_PENALTIES', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('accrual_accounts_for_loan_type_enum', 6, 'LOSSES_WRITTEN_OFF', 'LOSSES_WRITTEN_OFF', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('accrual_accounts_for_loan_type_enum', 7, 'INTEREST_RECEIVABLE', 'INTEREST_RECEIVABLE', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('accrual_accounts_for_loan_type_enum', 8, 'FEES_RECEIVABLE', 'FEES_RECEIVABLE', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('accrual_accounts_for_loan_type_enum', 9, 'PENALTIES_RECEIVABLE', 'PENALTIES_RECEIVABLE', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('accrual_accounts_for_loan_type_enum', 10, 'TRANSFERS_SUSPENSE', 'TRANSFERS_SUSPENSE', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('accrual_accounts_for_loan_type_enum', 11, 'OVERPAYMENT', 'OVERPAYMENT', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('accrual_accounts_for_loan_type_enum', 12, 'INCOME_FROM_RECOVERY', 'INCOME_FROM_RECOVERY', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('cash_accounts_for_loan_type_enum', 1, 'FUND_SOURCE', 'FUND_SOURCE', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('cash_accounts_for_loan_type_enum', 2, 'LOAN_PORTFOLIO', 'LOAN_PORTFOLIO', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('cash_accounts_for_loan_type_enum', 3, 'INTEREST_ON_LOANS', 'INTEREST_ON_LOANS', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('cash_accounts_for_loan_type_enum', 4, 'INCOME_FROM_FEES', 'INCOME_FROM_FEES', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('cash_accounts_for_loan_type_enum', 5, 'INCOME_FROM_PENALTIES', 'INCOME_FROM_PENALTIES', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('cash_accounts_for_loan_type_enum', 6, 'LOSSES_WRITTEN_OFF', 'LOSSES_WRITTEN_OFF', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('cash_accounts_for_loan_type_enum', 10, 'TRANSFERS_SUSPENSE', 'TRANSFERS_SUSPENSE', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('cash_accounts_for_loan_type_enum', 11, 'OVERPAYMENT', 'OVERPAYMENT', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('cash_accounts_for_loan_type_enum', 12, 'INCOME_FROM_RECOVERY', 'INCOME_FROM_RECOVERY', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('cash_accounts_for_savings_type_enum', 1, 'SAVINGS_REFERENCE', 'SAVINGS_REFERENCE', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('cash_accounts_for_savings_type_enum', 2, 'SAVINGS_CONTROL', 'SAVINGS_CONTROL', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('cash_accounts_for_savings_type_enum', 3, 'INTEREST_ON_SAVINGS', 'INTEREST_ON_SAVINGS', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('cash_accounts_for_savings_type_enum', 4, 'INCOME_FROM_FEES', 'INCOME_FROM_FEES', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('cash_accounts_for_savings_type_enum', 5, 'INCOME_FROM_PENALTIES', 'INCOME_FROM_PENALTIES', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('cash_accounts_for_savings_type_enum', 10, 'TRANSFERS_SUSPENSE', 'TRANSFERS_SUSPENSE', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('cash_accounts_for_savings_type_enum', 11, 'OVERDRAFT_PORTFOLIO_CONTROL', 'OVERDRAFT_PORTFOLIO_CONTROL', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('cash_accounts_for_savings_type_enum', 12, 'INCOME_FROM_INTEREST', 'INCOME_FROM_INTEREST', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('financial_activity_type_enum', 100, 'ASSET_TRANSFER', 'ASSET_TRANSFER', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('financial_activity_type_enum', 200, 'LIABILITY_TRANSFER', 'LIABILITY_TRANSFER', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('financial_activity_type_enum', 101, 'CASH_AT_MAINVAULT', 'CASH_AT_MAINVAULT', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('financial_activity_type_enum', 102, 'CASH_AT_TELLER', 'CASH_AT_TELLER', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('financial_activity_type_enum', 300, 'OPENING_BALANCES_TRANSFER_CONTRA', 'OPENING_BALANCES_TRANSFER_CONTRA', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('financial_activity_type_enum', 103, 'ASSET_FUND_SOURCE', 'ASSET_FUND_SOURCE', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('financial_activity_type_enum', 201, 'PAYABLE_DIVIDENDS', 'PAYABLE_DIVIDENDS', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('cash_account_for_shares_type_enum', 1, 'SHARES_REFERENCE', 'SHARES_REFERENCE', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('cash_account_for_shares_type_enum', 2, 'SHARES_SUSPENSE', 'SHARES_SUSPENSE', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('cash_account_for_shares_type_enum', 3, 'INCOME_FROM_FEES', 'INCOME_FROM_FEES', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('cash_account_for_shares_type_enum', 4, 'SHARES_EQUITY', 'SHARES_EQUITY', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('journal_entry_type_type_enum', 1, 'CREDIT', 'CREDIT', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('journal_entry_type_type_enum', 2, 'DEBIT', 'DEBIT', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('account_type_type_enum', 0, 'INVALID', 'INVALID', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('account_type_type_enum', 1, 'INDIVIDUAL', 'INDIVIDUAL', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('account_type_type_enum', 2, 'GROUP', 'GROUP', 0); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('account_type_type_enum', 3, 'JLG', 'JLG', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V315__add_sync_expected_with_disbursement_date_in_m_product_loan.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V315__add_sync_expected_with_disbursement_date_in_m_product_loan.sql deleted file mode 100644 index 46a6ed970..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V315__add_sync_expected_with_disbursement_date_in_m_product_loan.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_product_loan`ADD COLUMN `sync_expected_with_disbursement_date` TINYINT NULL DEFAULT '0' AFTER `instalment_amount_in_multiples_of`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V316__address_module_tables_metadat.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V316__address_module_tables_metadat.sql deleted file mode 100644 index f7b97ccc8..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V316__address_module_tables_metadat.sql +++ /dev/null @@ -1,123 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - - --- code inserts -INSERT INTO `m_code` (`code_name`, `is_system_defined`) VALUES ('STATE',1); -INSERT INTO `m_code` (`code_name`, `is_system_defined`) VALUES ('COUNTRY',1); -INSERT INTO `m_code` (`code_name`, `is_system_defined`) VALUES ('ADDRESS_TYPE',1); - - --- configuration -INSERT INTO `c_configuration` (`name`, `value`, `date_value`, `enabled`, `is_trap_door`, `description`) VALUES ('Enable-Address', NULL, NULL, 0, 0, NULL); - --- add address table -CREATE TABLE `m_address` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `street` VARCHAR(100) NULL DEFAULT NULL, - `address_line_1` VARCHAR(100) NULL DEFAULT NULL, - `address_line_2` VARCHAR(100) NULL DEFAULT NULL, - `address_line_3` VARCHAR(100) NULL DEFAULT NULL, - `town_village` VARCHAR(100) NULL DEFAULT NULL, - `city` VARCHAR(100) NULL DEFAULT NULL, - `county_district` VARCHAR(100) NULL DEFAULT NULL, - `state_province_id` INT NULL DEFAULT NULL, - `country_id` INT NULL DEFAULT NULL, - `postal_code` VARCHAR(10) NULL DEFAULT NULL, - `latitude` DECIMAL(10,8) NULL DEFAULT '0.00000000', - `longitude` DECIMAL(10,8) NULL DEFAULT '0.00000000', - `created_by` VARCHAR(100) NULL DEFAULT NULL, - `created_on` DATE NULL DEFAULT NULL, - `updated_by` VARCHAR(100) NULL DEFAULT NULL, - `updated_on` DATE NULL DEFAULT NULL, - PRIMARY KEY (`id`), - INDEX `address_fields_codefk1` (`state_province_id`), - INDEX `address_fields_codefk2` (`country_id`), - CONSTRAINT `address_fields_codefk1` FOREIGN KEY (`state_province_id`) REFERENCES `m_code_value` (`id`), - CONSTRAINT `address_fields_codefk2` FOREIGN KEY (`country_id`) REFERENCES `m_code_value` (`id`) -) -ENGINE=InnoDB -AUTO_INCREMENT=1 -; - - --- entity address table -CREATE TABLE `m_client_address` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `client_id` BIGINT NOT NULL DEFAULT '0', - `address_id` BIGINT NOT NULL DEFAULT '0', - `address_type_id` INT NOT NULL DEFAULT '0', - `is_active` TINYINT NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - INDEX `addressIdFk` (`address_id`), - INDEX `address_codefk` (`address_type_id`), - INDEX `clientaddressfk` (`client_id`), - CONSTRAINT `address_codefk` FOREIGN KEY (`address_type_id`) REFERENCES `m_code_value` (`id`), - CONSTRAINT `clientaddressfk` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) -) -ENGINE=InnoDB -AUTO_INCREMENT=1 -; - - --- field configuration -CREATE TABLE `m_field_configuration` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `entity` VARCHAR(100) NOT NULL, - `subentity` VARCHAR(100) NOT NULL, - `field` VARCHAR(100) NOT NULL, - `is_enabled` TINYINT NOT NULL, - `is_mandatory` TINYINT NOT NULL, - `validation_regex` VARCHAR(50) NULL DEFAULT NULL, - PRIMARY KEY (`id`) -) -ENGINE=InnoDB -AUTO_INCREMENT=1 -; - - -INSERT INTO `m_field_configuration` ( `entity`, `subentity`, `field`, `is_enabled`, `is_mandatory`, `validation_regex`) VALUES - ('ADDRESS', 'CLIENT', 'addressType', 1, 0, ''), - ('ADDRESS', 'CLIENT', 'street', 1, 1, ''), - ('ADDRESS', 'CLIENT', 'addressLine1', 1, 0, ''), - ('ADDRESS', 'CLIENT', 'addressLine2', 1, 0, ''), - ('ADDRESS', 'CLIENT', 'addressLine3', 1, 0, ''), - ('ADDRESS', 'CLIENT', 'townVillage', 0, 0, ''), - ('ADDRESS', 'CLIENT', 'city', 1, 0, ''), - ('ADDRESS', 'CLIENT', 'countyDistrict', 0, 0, ''), - ('ADDRESS', 'CLIENT', 'stateProvinceId', 1, 0, ''), - ('ADDRESS', 'CLIENT', 'countryId', 1, 0, ''), - ('ADDRESS', 'CLIENT', 'postalCode', 1, 0, ''), - ('ADDRESS', 'CLIENT', 'latitude', 0, 0, ''), - ('ADDRESS', 'CLIENT', 'longitude', 0, 0, ''), - ('ADDRESS', 'CLIENT', 'createdBy', 1, 0, ''), - ('ADDRESS', 'CLIENT', 'createdOn', 1, 0, ''), - ('ADDRESS', 'CLIENT', 'updatedBy', 1, 0, ''), - ('ADDRESS', 'CLIENT', 'updatedOn', 1, 0, ''), - ('ADDRESS', 'CLIENT', 'isActive', 1, 0, ''); - --- inserts for permission -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'CREATE_ADDRESS', 'ADDRESS', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'CREATE_ADDRESS_CHECKER', 'ADDRESS', 'CREATE_CHECKER', 1); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATE_ADDRESS', 'ADDRESS', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATE_ADDRESS_CHECKER', 'ADDRESS', 'UPDATE_CHECKER', 1); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'READ_ADDRESS', 'ADDRESS', 'READ', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'DELETE_ADDRESS', 'ADDRESS', 'DELETE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'DELETE_ADDRESS_CHECKER', 'ADDRESS', 'DELETE_CHECKER', 1); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V317__report_mailing_job_module.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V317__report_mailing_job_module.sql deleted file mode 100644 index 8e7f61376..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V317__report_mailing_job_module.sql +++ /dev/null @@ -1,80 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -create table if not exists m_report_mailing_job ( -id bigint primary key auto_increment, -name varchar(100) not null, -description text null, -start_datetime datetime not null, -recurrence varchar(100) null, -created_date date not null, -createdby_id bigint not null, -lastmodified_date date null, -lastmodifiedby_id bigint null, -email_recipients text not null, -email_subject varchar(100) not null, -email_message text not null, -email_attachment_file_format varchar(10) not null, -stretchy_report_id INT not null, -stretchy_report_param_map text null, -previous_run_datetime datetime null, -next_run_datetime datetime null, -previous_run_status varchar(10) null, -previous_run_error_log text null, -previous_run_error_message text null, -number_of_runs INT not null default 0, -is_active tinyint not null default 0, -is_deleted tinyint not null default 0, -run_as_userid bigint not null, -foreign key (createdby_id) references m_appuser(id), -foreign key (lastmodifiedby_id) references m_appuser(id), -foreign key (stretchy_report_id) references stretchy_report(id), -foreign key (run_as_userid) references m_appuser(id), -constraint unique_name unique (name) -); - -create table if not exists m_report_mailing_job_run_history ( -id bigint primary key auto_increment, -job_id bigint not null, -start_datetime datetime not null, -end_datetime datetime not null, -status varchar(10) not null, -error_message text null, -error_log text null, -foreign key (job_id) references m_report_mailing_job (id) -); - -create table if not exists m_report_mailing_job_configuration ( -id INT primary key auto_increment, -name varchar(50) not null, -`value` varchar(200) not null, -constraint unique_name unique (name) -); - -insert into m_permission (`grouping`, code, entity_name, action_name, can_maker_checker) -values ('jobs', 'CREATE_REPORTMAILINGJOB', 'REPORTMAILINGJOB', 'CREATE', 0), -('jobs', 'UPDATE_REPORTMAILINGJOB', 'REPORTMAILINGJOB', 'UPDATE', 0), -('jobs', 'DELETE_REPORTMAILINGJOB', 'REPORTMAILINGJOB', 'DELETE', 0), -('jobs', 'READ_REPORTMAILINGJOB', 'REPORTMAILINGJOB', 'READ', 0); - -insert into m_report_mailing_job_configuration (name, `value`) -values ('GMAIL_SMTP_SERVER', 'smtp.gmail.com'), ('GMAIL_SMTP_PORT', 587), ('GMAIL_SMTP_USERNAME', ''), ('GMAIL_SMTP_PASSWORD', ''); - -insert into job (name, display_name, cron_expression, create_time) -values ('Execute Report Mailing Jobs', 'Execute Report Mailing Jobs', '0 0/15 * * * ?', NOW()); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V318__topuploan.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V318__topuploan.sql deleted file mode 100644 index d9f0566e3..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V318__topuploan.sql +++ /dev/null @@ -1,39 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_product_loan` - ADD COLUMN `can_use_for_topup` tinyint NOT NULL DEFAULT 0 AFTER `instalment_amount_in_multiples_of`; - -ALTER TABLE `m_loan` - ADD COLUMN `is_topup` tinyint NOT NULL DEFAULT 0 AFTER `loan_sub_status_id`; - -CREATE TABLE `m_loan_topup` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `loan_id` BIGINT NOT NULL, - `closure_loan_id` BIGINT NOT NULL, - `account_transfer_details_id` BIGINT NULL, - `topup_amount` DECIMAL(19,6) NULL DEFAULT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `m_loan_topup_FK_loan_id` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`), - CONSTRAINT `m_loan_topup_FK_closure_loan_id` FOREIGN KEY (`closure_loan_id`) REFERENCES `m_loan` (`id`), - CONSTRAINT `m_loan_topup_FK_account_transfer_details_id` FOREIGN KEY (`account_transfer_details_id`) REFERENCES `m_account_transfer_details` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB -; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V319__client_undoreject.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V319__client_undoreject.sql deleted file mode 100644 index 8b82df989..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V319__client_undoreject.sql +++ /dev/null @@ -1,25 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_client` - ADD COLUMN `reopened_on_date` DATE NULL AFTER `legal_form_enum`, - ADD COLUMN `reopened_by_userid` BIGINT NULL AFTER `reopened_on_date`; - -INSERT INTO `m_permission` ( `grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UNDOREJECT_CLIENT', 'CLIENT', 'UNDOREJECT', 1), -('portfolio', 'UNDOREJECT_CLIENT_CHECKER', 'CLIENT', 'UNDOREJECT_CHECKER', 1),('portfolio', 'UNDOWITHDRAWAL_CLIENT', 'CLIENT', 'UNDOWITHDRAWAL', 1),('portfolio', 'UNDOWITHDRAWAL_CLIENT_CHECKER', 'CLIENT', 'UNDOWITHDRAWAL_CHECKER', 1); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V31__drop-autopostings.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V31__drop-autopostings.sql deleted file mode 100755 index 7aa3ea951..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V31__drop-autopostings.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -drop table `acc_auto_posting`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V320__add_holiday_payment_reschedule.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V320__add_holiday_payment_reschedule.sql deleted file mode 100644 index 0b25e00ca..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V320__add_holiday_payment_reschedule.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE m_working_days ADD extend_term_holiday_repayment BOOLEAN NOT NULL DEFAULT 0; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V321__boolean_field_As_Interest_PostedOn.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V321__boolean_field_As_Interest_PostedOn.sql deleted file mode 100644 index 7f163526c..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V321__boolean_field_As_Interest_PostedOn.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE m_savings_account_transaction -ADD is_manual boolean default 0 diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V322_1__scheduled_email_campaign.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V322_1__scheduled_email_campaign.sql deleted file mode 100644 index 3881925ed..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V322_1__scheduled_email_campaign.sql +++ /dev/null @@ -1,167 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `scheduled_email_campaign` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `campaign_name` VARCHAR(100) NOT NULL, - `campaign_type` INT NOT NULL, - `businessRule_id` INT NOT NULL, - `param_value` TEXT NULL, - `status_enum` INT NOT NULL, - `email_subject` VARCHAR(100) NOT NULL, - `email_message` TEXT NOT NULL, - `email_attachment_file_format` VARCHAR(10) NOT NULL, - `stretchy_report_id` INT NOT NULL, - `stretchy_report_param_map` TEXT NULL DEFAULT NULL, - `closedon_date` DATE NULL DEFAULT NULL, - `closedon_userid` BIGINT NULL DEFAULT NULL, - `submittedon_date` DATE NULL DEFAULT NULL, - `submittedon_userid` BIGINT NULL DEFAULT NULL, - `approvedon_date` DATE NULL DEFAULT NULL, - `approvedon_userid` BIGINT NULL DEFAULT NULL, - `recurrence` VARCHAR(100) NULL DEFAULT NULL, - `next_trigger_date` DATETIME NULL DEFAULT NULL, - `last_trigger_date` DATETIME NULL DEFAULT NULL, - `recurrence_start_date` DATETIME NULL DEFAULT NULL, - `is_visible` tinyint NULL DEFAULT '1', - `previous_run_error_log` TEXT NULL DEFAULT NULL, - `previous_run_error_message` TEXT NULL DEFAULT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `scheduled_email_campaign_ibfk_1` FOREIGN KEY (`stretchy_report_id`) REFERENCES `stretchy_report` (`id`) -); - -CREATE TABLE IF NOT EXISTS scheduled_email_messages_outbound ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `group_id` BIGINT DEFAULT NULL, - `client_id` BIGINT DEFAULT NULL, - `staff_id` BIGINT DEFAULT NULL, - `email_campaign_id` BIGINT DEFAULT NULL, - `status_enum` INT NOT NULL DEFAULT '100', - `email_address` varchar(50) NOT NULL, - `email_subject` varchar(50) NOT NULL, - `message` text NOT NULL, - `campaign_name` varchar(200) DEFAULT NULL, - `submittedon_date` date, - `error_message` text, - PRIMARY KEY (`id`), - KEY `SEFKGROUP000000001` (`group_id`), - KEY `SEFKCLIENT00000001` (`client_id`), - key `SEFKSTAFF000000001` (`staff_id`), - CONSTRAINT `SEFKGROUP000000001` FOREIGN KEY (`group_id`) REFERENCES `m_group` (`id`), - CONSTRAINT `SEFKCLIENT00000001` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`), - CONSTRAINT `SEFKSTAFF000000001` FOREIGN KEY (`staff_id`) REFERENCES `m_staff` (`id`), - CONSTRAINT `fk_schedule_email_campign1` FOREIGN KEY (`email_campaign_id`) REFERENCES `scheduled_email_campaign` (`id`) -); - -create table if not exists scheduled_email_configuration ( -id INT primary key auto_increment, -name varchar(50) not null, -`value` varchar(200) null, -constraint unique_name unique (name) -); - -DELETE FROM `m_permission` WHERE `code`='READ_EMAIL'; -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organisation', 'READ_EMAIL', 'EMAIL', 'READ', 0); - -DELETE FROM `m_permission` WHERE `code`='CREATE_EMAIL'; -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organisation', 'CREATE_EMAIL', 'EMAIL', 'CREATE', 0); - -DELETE FROM `m_permission` WHERE `code`='CREATE_EMAIL_CHECKER'; -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organisation', 'CREATE_EMAIL_CHECKER', 'EMAIL', 'CREATE_CHECKER', 0); - -DELETE FROM `m_permission` WHERE `code`='UPDATE_EMAIL'; -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organisation', 'UPDATE_EMAIL', 'EMAIL', 'UPDATE', 0); - -DELETE FROM `m_permission` WHERE `code`='UPDATE_EMAIL_CHECKER'; -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organisation', 'UPDATE_EMAIL_CHECKER', 'EMAIL', 'UPDATE_CHECKER', 0); - -DELETE FROM `m_permission` WHERE `code`='DELETE_EMAIL'; -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organisation', 'DELETE_EMAIL', 'EMAIL', 'DELETE', 0); - -DELETE FROM `m_permission` WHERE `code`='DELETE_EMAIL_CHECKER'; -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organisation', 'DELETE_EMAIL_CHECKER', 'EMAIL', 'DELETE_CHECKER', 0); - -DELETE FROM `m_permission` WHERE `code`='READ_EMAIL_CAMPAIGN'; -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organisation', 'READ_EMAIL_CAMPAIGN', 'EMAIL_CAMPAIGN', 'READ', 0); - -DELETE FROM `m_permission` WHERE `code`='CREATE_EMAIL_CAMPAIGN'; -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organisation', 'CREATE_EMAIL_CAMPAIGN', 'EMAIL_CAMPAIGN', 'CREATE', 0); - -DELETE FROM `m_permission` WHERE `code`='CREATE_EMAIL_CAMPAIGN_CHECKER'; -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organisation', 'CREATE_EMAIL_CAMPAIGN_CHECKER', 'EMAIL_CAMPAIGN', 'CREATE_CHECKER', 0); - -DELETE FROM `m_permission` WHERE `code`='UPDATE_EMAIL_CAMPAIGN'; -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organisation', 'UPDATE_EMAIL_CAMPAIGN', 'EMAIL_CAMPAIGN', 'UPDATE', 0); - -DELETE FROM `m_permission` WHERE `code`='UPDATE_EMAIL_CAMPAIGN_CHECKER'; -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organisation', 'UPDATE_EMAIL_CAMPAIGN_CHECKER', 'EMAIL_CAMPAIGN', 'UPDATE_CHECKER', 0); - -DELETE FROM `m_permission` WHERE `code`='DELETE_EMAIL_CAMPAIGN'; -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organisation', 'DELETE_EMAIL_CAMPAIGN', 'EMAIL_CAMPAIGN', 'DELETE', 0); - -DELETE FROM `m_permission` WHERE `code`='DELETE_EMAIL_CAMPAIGN_CHECKER'; -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organisation', 'DELETE_EMAIL_CAMPAIGN_CHECKER', 'EMAIL_CAMPAIGN', 'DELETE_CHECKER', 0); - -DELETE FROM `m_permission` WHERE `code`='CLOSE_EMAIL_CAMPAIGN'; -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organisation', 'CLOSE_EMAIL_CAMPAIGN', 'EMAIL_CAMPAIGN', 'CLOSE', 0); - -DELETE FROM `m_permission` WHERE `code`='ACTIVATE_EMAIL_CAMPAIGN'; -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organisation', 'ACTIVATE_EMAIL_CAMPAIGN', 'EMAIL_CAMPAIGN', 'ACTIVATE', 0); - -DELETE FROM `m_permission` WHERE `code`='REACTIVATE_EMAIL_CAMPAIGN'; -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organisation', 'REACTIVATE_EMAIL_CAMPAIGN', 'EMAIL_CAMPAIGN', 'REACTIVATE', 0); - - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('organisation', 'READ_EMAIL_CONFIGURATION', 'EMAIL_CONFIGURATION', 'READ', 0), -('organisation', 'UPDATE_EMAIL_CONFIGURATION', 'EMAIL_CONFIGURATION', 'UPDATE', 0); - -Alter table m_client -ADD Column email_address varchar(150); - -Alter table m_staff -ADD Column email_address varchar(150); - - -insert into job (name, display_name, cron_expression, create_time) -values ('Execute Email', 'Execute Email', '0 0/10 * * * ?', NOW()); - -insert into job (name, display_name, cron_expression, create_time) -values ('Update Email Outbound with campaign message', 'Update Email Outbound with campaign message', '0 0/15 * * * ?', NOW()); - -INSERT INTO `scheduled_email_configuration` (`name`) -VALUES ('SMTP_SERVER'), -('SMTP_PORT'),('SMTP_USERNAME'), ('SMTP_PASSWORD'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V322_2__email_business_rules.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V322_2__email_business_rules.sql deleted file mode 100644 index b79c8adce..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V322_2__email_business_rules.sql +++ /dev/null @@ -1,38 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES -('report', 'READ_Active Clients - Email', 'Active Clients - Email', 'READ', 0), -('report', 'READ_Prospective Clients - Email', 'Prospective Clients - Email', 'READ', 0), -('report', 'READ_Active Loan Clients - Email', 'Active Loan Clients - Email', 'READ', 0), -('report', 'READ_Loans in arrears - Email', 'Loans in arrears - Email', 'READ', 0), -('report', 'READ_Loans disbursed to clients - Email', 'Loans disbursed to clients - Email', 'READ', 0), -('report', 'READ_Loan payments due - Email', 'Loan payments due - Email', 'READ', 0), -('report', 'READ_Dormant Prospects - Email', 'Dormant Prospects - Email', 'READ', 0), -('report', 'READ_Active Group Leaders - Email', 'Active Group Leaders - Email', 'READ', 0), -('report', 'READ_Loan Payments Due (Overdue Loans) - Email', 'Loan Payments Due (Overdue Loans) - Email', 'READ', 0), -('report', 'READ_Loan Payments Received (Active Loans) - Email', 'Loan Payments Received (Active Loans) - Email', 'READ', 0), -('report', 'READ_Loan Payments Received (Overdue Loans) - Email', 'Loan Payments Received (Overdue Loans) - Email', 'READ', 0), -('report', 'READ_Loan Fully Repaid - Email', 'Loan Fully Repaid - Email', 'READ', 0), -('report', 'READ_Loans Outstanding after final instalment date - Email', 'Loans Outstanding after final instalment date - Email', 'READ', 0), -('report', 'READ_Happy Birthday - Email', 'Happy Birthday - Email', 'READ', 0), -('report', 'READ_Loan Rejected - Email', 'Loan Rejected - Email', 'READ', 0), -('report', 'READ_Loan Approved - Email', 'Loan Approved - Email', 'READ', 0), -('report', 'READ_Loan Repayment - Email', 'Loan Repayment - Email', 'READ', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V322__sms_campaign.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V322__sms_campaign.sql deleted file mode 100644 index 84a8ecef0..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V322__sms_campaign.sql +++ /dev/null @@ -1,275 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `sms_campaign` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `campaign_name` VARCHAR(100) NOT NULL, - `campaign_type` INT NOT NULL, - `campaign_trigger_type` INT NOT NULL, - `report_id` INT NOT NULL, - `provider_id` BIGINT NOT NULL, - `param_value` TEXT NULL, - `status_enum` INT NOT NULL, - `message` TEXT NOT NULL, - `submittedon_date` DATE NULL DEFAULT NULL, - `submittedon_userid` BIGINT NULL DEFAULT NULL, - `approvedon_date` DATE NULL DEFAULT NULL, - `approvedon_userid` BIGINT NULL DEFAULT NULL, - `closedon_date` DATE NULL DEFAULT NULL, - `closedon_userid` BIGINT NULL DEFAULT NULL, - `recurrence` VARCHAR(100) NULL DEFAULT NULL, - `next_trigger_date` DATETIME NULL DEFAULT NULL, - `last_trigger_date` DATETIME NULL DEFAULT NULL, - `recurrence_start_date` DATETIME NULL DEFAULT NULL, - `is_visible` tinyint NULL DEFAULT '1', - PRIMARY KEY (`id`), - INDEX `report_id` (`report_id`), - CONSTRAINT `sms_campaign_ibfk_1` FOREIGN KEY (`report_id`) REFERENCES `stretchy_report` (`id`) -); - - -ALTER TABLE `sms_messages_outbound` - ADD COLUMN `campaign_id` BIGINT NOT NULL, - ADD COLUMN `external_id` VARCHAR(100) NULL DEFAULT NULL, - ADD COLUMN `submittedon_date` DATE NULL DEFAULT NULL, - ADD COLUMN `delivered_on_date` DATETIME NULL DEFAULT NULL, - ADD INDEX `FKCAMPAIGN00000001` (`campaign_id`), - ADD CONSTRAINT `FKCAMPAIGN00000001` FOREIGN KEY (`campaign_id`) REFERENCES `sms_campaign` (`id`); - - -INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES -('Update SMS Outbound with Campaign Message', 'Update SMS Outbound with Campaign Message', '0 0 5 1/1 * ? *', NOW(), 3, NULL, NULL, NULL, 'Update SMS Outbound with Campaign Message1 _ DEFAULT', NULL, 1, 0, 1, 4, 0), -('Send Messages to SMS Gateway', 'Send Messages to SMS Gateway', '0 0 5 1/1 * ? *', NOW(), 2, NULL, NULL, NULL, 'Send Messages to SMS Gateway1 _ DEFAULT', NULL, 1, 0, 1, 4, 0), -('Get Delivery Reports from SMS Gateway', 'Get Delivery Reports from SMS Gateway', '0 0 5 1/1 * ? *', NOW(), 1, NULL, NULL, NULL, 'Get Delivery Reports from SMS Gateway1 _ DEFAULT', NULL, 1, 0, 1, 4, 0); - -INSERT INTO `m_permission` -(`grouping` ,`code` ,`entity_name`, `action_name`, `can_maker_checker`) VALUES -('organisation', 'READ_SMSCAMPAIGN', 'SMSCAMPAIGN', 'READ', '0'), -('organisation', 'CREATE_SMSCAMPAIGN', 'SMSCAMPAIGN', 'CREATE', '0'), -('organisation', 'CREATE_SMSCAMPAIGN_CHECKER', 'SMSCAMPAIGN', 'CREATE', '0'), -('organisation', 'UPDATE_SMSCAMPAIGN', 'SMSCAMPAIGN', 'UPDATE', '0'), -('organisation', 'UPDATE_SMSCAMPAIGN_CHECKER', 'SMSCAMPAIGN', 'UPDATE', '0'), -('organisation', 'DELETE_SMSCAMPAIGN', 'SMSCAMPAIGN', 'DELETE', '0'), -('organisation', 'DELETE_SMSCAMPAIGN_CHECKER', 'SMSCAMPAIGN', 'DELETE', '0'), -('organisation', 'ACTIVATE_SMSCAMPAIGN', 'SMSCAMPAIGN', 'ACTIVATE', '0'), -('organisation', 'CLOSE_SMSCAMPAIGN', 'SMSCAMPAIGN', 'CLOSE', '0'), -('organisation', 'REACTIVATE_SMSCAMPAIGN', 'SMSCAMPAIGN', 'REACTIVATE', '0'); - - - - -INSERT INTO `m_code_value` (`code_id`, `code_value`, `code_description`, `order_position`, `code_score`, `is_active`, `is_mandatory`) VALUES ((SELECT `id` FROM `m_code` mc WHERE mc.code_name = "GROUPROLE" AND is_system_defined), 'Leader', 'Group Leader Role', 1, NULL, 1, 0); - - - - -INSERT INTO `stretchy_parameter` (`parameter_name`, `parameter_variable`, `parameter_label`, `parameter_displayType`, `parameter_FormatType`, `parameter_default`, `special`, `selectOne`, `selectAll`, `parameter_sql`, `parent_id`) VALUES ('cycleXSelect', 'cycleX', 'Cycle X Number', 'text', 'number', 'n/a', NULL, NULL, NULL, NULL, NULL), -('cycleYSelect', 'cycleY', 'Cycle Y Number', 'text', 'number', 'n/a', NULL, NULL, NULL, NULL, NULL), -('fromXSelect', 'fromX', 'From X Number', 'text', 'number', 'n/a', NULL, NULL, NULL, NULL, NULL), -('toYSelect', 'toY', 'To Y Number', 'text', 'number', 'n/a', NULL, NULL, NULL, NULL, NULL), -('overdueXSelect', 'overdueX', 'Overdue X Number', 'text', 'number', 'n/a', NULL, NULL, NULL, NULL, NULL), -('overdueYSelect', 'overdueY', 'Overdue Y Number', 'text', 'number', 'n/a', NULL, NULL, NULL, NULL, NULL); - - - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Active Clients', 'SMS', 'NonTriggered', 'Clients', 'SELECT c.id AS "id", \r\nc.firstname AS "firstName",\r\nc.middlename AS "middleName",\r\nc.lastname AS "lastName",\r\nc.display_name AS "fullName",\r\nc.mobile_no AS "mobileNo", CONCAT(REPEAT("..", ((LENGTH(ounder.`hierarchy`) - LENGTH(\r\nREPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) AS "officeName", \r\no.id AS "officeNumber"\r\nFROM m_office o\r\nJOIN m_office ounder ON ounder.hierarchy LIKE CONCAT(o.hierarchy, \'%\')\r\nJOIN m_client c ON c.office_id = ounder.id\r\nLEFT JOIN r_enum_value r ON r.enum_name = \'status_enum\' AND r.enum_id = c.status_enum\r\nWHERE o.id = ${officeId} AND c.status_enum = 300 AND (IFNULL(c.staff_id, -10) = ${loanOfficerId} OR "-1" = ${loanOfficerId})\r\nGROUP BY c.id\r\nORDER BY ounder.hierarchy, c.account_no', 'All clients with the status ‘Active’', 0, 1); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Prospective Clients', 'SMS', 'NonTriggered', 'Clients', 'SELECT c.id AS "id", \r\nc.firstname AS "firstName",\r\nc.middlename AS "middleName",\r\nc.lastname AS "lastName",\r\nc.display_name AS "fullName",\r\nc.mobile_no AS "mobileNo", CONCAT(REPEAT("..", ((LENGTH(ounder.`hierarchy`) - LENGTH(\r\nREPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) AS "officeName", \r\no.id AS "officeNumber"\r\nFROM m_office o\r\nJOIN m_office ounder ON ounder.hierarchy LIKE CONCAT(o.hierarchy, \'%\')\r\nJOIN m_client c ON c.office_id = ounder.id\r\nLEFT JOIN r_enum_value r ON r.enum_name = \'status_enum\' AND r.enum_id = c.status_enum\r\nLEFT JOIN m_loan l ON l.client_id = c.id\r\nWHERE o.id = ${officeId} AND c.status_enum = 300 AND (IFNULL(c.staff_id, -10) = ${loanOfficerId} OR "-1" = ${loanOfficerId}) AND l.client_id IS NULL\r\nGROUP BY c.id\r\nORDER BY ounder.hierarchy, c.account_no', 'All clients with the status ‘Active’ who have never had a loan before', 0, 1); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Active Loan Clients', 'SMS', 'NonTriggered', 'Clients', 'SELECT \r\nc.id AS "id", \r\nc.firstname AS "firstName",\r\nc.middlename AS "middleName",\r\nc.lastname AS "lastName",\r\nc.display_name AS "fullName",\r\nc.mobile_no AS "mobileNo", \r\nl.principal_amount AS "loanAmount", \r\n(IFNULL(l.principal_outstanding_derived, 0) + IFNULL(l.interest_outstanding_derived, 0) + IFNULL(l.fee_charges_outstanding_derived, 0) + IFNULL(l.penalty_charges_outstanding_derived, 0)) AS "loanOutstanding",\r\nl.principal_disbursed_derived AS "loanDisbursed",\r\nounder.id AS "officeNumber", \r\nl.account_no AS "loanAccountId", \r\ngua.lastname AS "guarantorLastName", COUNT(gua.id) AS "numberOfGuarantors",\r\ng.display_name AS "groupName"\r\n\r\nFROM m_office o\r\nJOIN m_office ounder ON ounder.hierarchy LIKE CONCAT(o.hierarchy, \'%\')\r\nJOIN m_client c ON c.office_id = ounder.id\r\nJOIN m_loan l ON l.client_id = c.id\r\nJOIN m_product_loan pl ON pl.id = l.product_id\r\nLEFT JOIN m_group_client gc ON gc.client_id = c.id\r\nLEFT JOIN m_group g ON g.id = gc.group_id\r\nLEFT JOIN m_staff lo ON lo.id = l.loan_officer_id\r\nLEFT JOIN m_currency cur ON cur.code = l.currency_code\r\nLEFT JOIN m_guarantor gua ON gua.loan_id = l.id\r\nWHERE o.id = ${officeId} AND (IFNULL(l.loan_officer_id, -10) = ${loanOfficerId} OR "-1" = ${loanOfficerId}) AND l.loan_status_id = 300 AND (DATEDIFF(CURDATE(), l.disbursedon_date) BETWEEN ${cycleX} AND ${cycleY})\r\nGROUP BY l.id\r\nORDER BY ounder.hierarchy, l.currency_code, c.account_no, l.account_no', 'All clients with an outstanding loan between cycleX and cycleY days', 0, 1); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Loan in arrears', 'SMS', 'NonTriggered', 'Loan', 'SELECT \r\nmc.id AS "id", \r\nmc.firstname AS "firstName",\r\nmc.middlename AS "middleName",\r\nmc.lastname AS "lastName",\r\nmc.display_name AS "fullName",\r\nmc.mobile_no AS "mobileNo", \r\nml.principal_amount AS "loanAmount", \r\n(IFNULL(ml.principal_outstanding_derived, 0) + IFNULL(ml.interest_outstanding_derived, 0) + IFNULL(ml.fee_charges_outstanding_derived, 0) + IFNULL(ml.penalty_charges_outstanding_derived, 0)) AS "loanOutstanding",\r\nml.principal_disbursed_derived AS "loanDisbursed",\r\nlaa.overdue_since_date_derived AS "paymentDueDate",\r\nIFNULL(laa.total_overdue_derived, 0) AS "totalDue",\r\nounder.id AS "officeNumber", \r\nml.account_no AS "loanAccountId", \r\ngua.lastname AS "guarantorLastName", \r\nCOUNT(gua.id) AS "numberOfGuarantors",\r\ng.display_name AS "groupName"\r\n\r\nFROM m_office mo\r\nJOIN m_office ounder ON ounder.hierarchy LIKE CONCAT(mo.hierarchy, \'%\')\r\nINNER JOIN m_client mc ON mc.office_id=ounder.id\r\nINNER JOIN m_loan ml ON ml.client_id = mc.id\r\nINNER JOIN r_enum_value rev ON rev.enum_id=ml.loan_status_id AND rev.enum_name = \'loan_status_id\'\r\nINNER JOIN m_loan_arrears_aging laa ON laa.loan_id=ml.id\r\nLEFT JOIN m_currency cur ON cur.code = ml.currency_code\r\nLEFT JOIN m_group_client gc ON gc.client_id = mc.id\r\nLEFT JOIN m_group g ON g.id = gc.group_id\r\nLEFT JOIN m_staff lo ON lo.id = ml.loan_officer_id\r\nLEFT JOIN m_guarantor gua ON gua.loan_id = ml.id\r\nWHERE ml.loan_status_id=300 AND mo.id=${officeId} AND (IFNULL(ml.loan_officer_id, -10) = ${loanOfficerId} OR "-1" = ${loanOfficerId}) AND (DATEDIFF(CURDATE(), laa.overdue_since_date_derived) BETWEEN ${fromX} AND ${toY})\r\nGROUP BY ml.id\r\nORDER BY ounder.hierarchy, ml.currency_code, mc.account_no, ml.account_no', 'All clients with an outstanding loan in arrears between fromX and toY days', 0, 1); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Loan payments due', 'SMS', 'NonTriggered', 'Loan', 'SELECT \r\ncl.id AS "id", \r\ncl.firstname AS "firstName",\r\ncl.middlename AS "middleName",\r\ncl.lastname AS "lastName",\r\ncl.display_name AS "fullName",\r\ncl.mobile_no AS "mobileNo", \r\nl.principal_amount AS "loanAmount",\r\nof.id AS "officeNumber",\r\n(IFNULL(l.principal_outstanding_derived, 0) + IFNULL(l.interest_outstanding_derived, 0) + IFNULL(l.fee_charges_outstanding_derived, 0) + IFNULL(l.penalty_charges_outstanding_derived, 0)) AS "loanOutstanding",\r\nl.principal_disbursed_derived AS "loanDisbursed",\r\nls.duedate AS "paymentDueDate",\r\n(IFNULL(SUM(ls.principal_amount),0) - IFNULL(SUM(ls.principal_writtenoff_derived),0)\r\n + IFNULL(SUM(ls.interest_amount),0) - IFNULL(SUM(ls.interest_writtenoff_derived),0) \r\n - IFNULL(SUM(ls.interest_waived_derived),0)\r\n + IFNULL(SUM(ls.fee_charges_amount),0) - IFNULL(SUM(ls.fee_charges_writtenoff_derived),0) \r\n - IFNULL(SUM(ls.fee_charges_waived_derived),0)\r\n + IFNULL(SUM(ls.penalty_charges_amount),0) - IFNULL(SUM(ls.penalty_charges_writtenoff_derived),0) \r\n - IFNULL(SUM(ls.penalty_charges_waived_derived),0)\r\n) AS "totalDue",\r\nlaa.total_overdue_derived AS "totalOverdue",\r\nl.account_no AS "loanAccountId",\r\ngua.lastname AS "guarantorLastName",\r\nCOUNT(gua.id) AS "numberOfGuarantors",\r\ngp.display_name AS "groupName"\r\n\r\nFROM m_office of\r\nLEFT JOIN m_client cl ON of.id = cl.office_id\r\nLEFT JOIN m_loan l ON cl.id = l.client_id\r\nLEFT JOIN m_group_client gc ON gc.client_id = cl.id\r\nLEFT JOIN m_group gp ON gp.id = l.group_id\r\nLEFT JOIN m_loan_repayment_schedule ls ON l.id = ls.loan_id\r\nLEFT JOIN m_guarantor gua ON gua.loan_id = l.id\r\nINNER JOIN m_loan_arrears_aging laa ON laa.loan_id=l.id\r\nWHERE of.id = ${officeId} AND (IFNULL(l.loan_officer_id, -10) = ${loanOfficerId} OR "-1" = ${loanOfficerId}) AND (DATEDIFF(CURDATE(), ls.duedate) BETWEEN ${fromX} AND ${toY}) \r\nAND (of.hierarchy LIKE CONCAT((\r\nSELECT ino.hierarchy\r\nFROM m_office ino\r\nWHERE ino.id = ${officeId}),"%"))\r\nGROUP BY l.id\r\nORDER BY of.hierarchy, l.currency_code, cl.account_no, l.account_no', 'All clients with an unpaid installment due on their loan between fromX and toY days', 0, 1); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Dormant Prospects', 'SMS', 'NonTriggered', 'Clients', 'SELECT c.id AS "id", CONCAT(REPEAT("..", ((LENGTH(ounder.`hierarchy`) - LENGTH(\r\nREPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) AS "officeName", \r\nc.firstname AS "firstName",\r\nc.middlename AS "middleName",\r\nc.lastname AS "lastName",\r\nc.display_name AS "fullName",\r\nc.mobile_no AS "mobileNo", \r\no.id AS "officeNumber", \r\nTIMESTAMPDIFF(MONTH, c.activation_date, CURDATE()) AS "dormant"\r\nFROM m_office o\r\nJOIN m_office ounder ON ounder.hierarchy LIKE CONCAT(o.hierarchy, \'%\')\r\nJOIN m_client c ON c.office_id = ounder.id\r\nLEFT JOIN r_enum_value r ON r.enum_name = \'status_enum\' AND r.enum_id = c.status_enum\r\nLEFT JOIN m_loan l ON l.client_id = c.id\r\nWHERE o.id = ${officeId} AND c.status_enum = 300 AND (IFNULL(c.staff_id, -10) = ${loanOfficerId} OR "-1" = ${loanOfficerId}) AND l.client_id IS NULL AND (TIMESTAMPDIFF(MONTH, c.activation_date, CURDATE()) > 3)\r\nGROUP BY c.id\r\nORDER BY ounder.hierarchy, c.account_no', 'All individuals who have not yet received a loan but were also entered into the system more than 3 months', 0, 1); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Active group leaders', 'SMS', 'NonTriggered', 'Clients', 'SELECT c.id AS "id", \r\nc.firstname AS "firstName",\r\nc.middlename AS "middleName",\r\nc.lastname AS "lastName",\r\nc.display_name AS "fullName",\r\nc.mobile_no AS "mobileNo", CONCAT(REPEAT("..", ((LENGTH(ounder.`hierarchy`) - LENGTH(\r\nREPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) AS "officeName", \r\no.id AS "officeNumber"\r\nFROM m_office o\r\nJOIN m_office ounder ON ounder.hierarchy LIKE CONCAT(o.hierarchy, \'%\')\r\nJOIN m_group g ON g.office_id = ounder.id\r\nJOIN m_client c ON c.office_id = ounder.id\r\nLEFT JOIN m_group_client gc ON gc.group_id = g.id AND gc.client_id = c.id\r\nLEFT JOIN m_group_roles gr ON gr.group_id = g.id AND gr.client_id = c.id\r\nLEFT JOIN m_staff ms ON ms.id = c.staff_id\r\nLEFT JOIN r_enum_value r ON r.enum_name = \'status_enum\' AND r.enum_id = c.status_enum\r\nLEFT JOIN m_code_value cv ON cv.id = gr.role_cv_id\r\nLEFT JOIN m_code code ON code.id = cv.code_id\r\nWHERE o.id = ${officeId} AND g.status_enum = 300 AND c.status_enum = 300 AND (IFNULL(c.staff_id, -10) = ${loanOfficerId} OR "-1" = ${loanOfficerId}) AND code.code_name = \'GROUPROLE\' AND cv.code_value = \'Leader\'\r\nGROUP BY c.id\r\nORDER BY ounder.hierarchy, c.account_no', 'All active group chairmen', 0, 1); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Loan payments due (Overdue Loans)', 'SMS', 'NonTriggered', 'Loan', 'SELECT \r\nmc.id AS "id", \r\nmc.firstname AS "firstName",\r\nmc.middlename AS "middleName",\r\nmc.lastname AS "lastName",\r\nmc.display_name AS "fullName",\r\nmc.mobile_no AS "mobileNo", \r\nml.principal_amount AS "loanAmount", \r\n(IFNULL(ml.principal_outstanding_derived, 0) + IFNULL(ml.interest_outstanding_derived, 0) + IFNULL(ml.fee_charges_outstanding_derived, 0) + IFNULL(ml.penalty_charges_outstanding_derived, 0)) AS "loanOutstanding",\r\nml.principal_disbursed_derived AS "loanDisbursed",\r\nlaa.overdue_since_date_derived AS "paymentDueDate",\r\n(IFNULL(SUM(ls.principal_amount),0) - IFNULL(SUM(ls.principal_writtenoff_derived),0)\r\n + IFNULL(SUM(ls.interest_amount),0) - IFNULL(SUM(ls.interest_writtenoff_derived),0) \r\n - IFNULL(SUM(ls.interest_waived_derived),0)\r\n + IFNULL(SUM(ls.fee_charges_amount),0) - IFNULL(SUM(ls.fee_charges_writtenoff_derived),0) \r\n - IFNULL(SUM(ls.fee_charges_waived_derived),0)\r\n + IFNULL(SUM(ls.penalty_charges_amount),0) - IFNULL(SUM(ls.penalty_charges_writtenoff_derived),0) \r\n - IFNULL(SUM(ls.penalty_charges_waived_derived),0)\r\n) AS "totalDue",\r\nlaa.total_overdue_derived AS "totalOverdue",\r\nounder.id AS "officeNumber", \r\nml.account_no AS "loanAccountId", \r\ngua.lastname AS "guarantorLastName", \r\nCOUNT(gua.id) AS "numberOfGuarantors",\r\ng.display_name AS "groupName"\r\n\r\nFROM m_office mo\r\nJOIN m_office ounder ON ounder.hierarchy LIKE CONCAT(mo.hierarchy, \'%\')\r\nINNER JOIN m_client mc ON mc.office_id=ounder.id\r\nINNER JOIN m_loan ml ON ml.client_id = mc.id\r\nINNER JOIN r_enum_value rev ON rev.enum_id=ml.loan_status_id AND rev.enum_name = \'loan_status_id\'\r\nINNER JOIN m_loan_arrears_aging laa ON laa.loan_id=ml.id\r\nLEFT JOIN m_loan_repayment_schedule ls ON ls.loan_id = ml.id\r\nLEFT JOIN m_currency cur ON cur.code = ml.currency_code\r\nLEFT JOIN m_group_client gc ON gc.client_id = mc.id\r\nLEFT JOIN m_group g ON g.id = gc.group_id\r\nLEFT JOIN m_staff lo ON lo.id = ml.loan_officer_id\r\nLEFT JOIN m_guarantor gua ON gua.loan_id = ml.id\r\nWHERE ml.loan_status_id=300 AND mo.id=${officeId} AND (IFNULL(ml.loan_officer_id, -10) = ${loanOfficerId} OR "-1" = ${loanOfficerId}) \r\nAND (DATEDIFF(CURDATE(), ls.duedate) BETWEEN ${fromX} AND ${toY})\r\nAND (DATEDIFF(CURDATE(), laa.overdue_since_date_derived) BETWEEN ${overdueX} AND ${overdueY})\r\nGROUP BY ml.id\r\nORDER BY ounder.hierarchy, ml.currency_code, mc.account_no, ml.account_no', 'Loan Payments Due between fromX to toY days for clients in arrears between overdueX and overdueY days', 0, 1); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Loan payments received (Active Loans)', 'SMS', 'NonTriggered', 'Loan', 'SELECT \r\nmc.id AS "id", \r\nmc.firstname AS "firstName",\r\nmc.middlename AS "middleName",\r\nmc.lastname AS "lastName",\r\nmc.display_name AS "fullName",\r\nmc.mobile_no AS "mobileNo", \r\nml.principal_amount AS "loanAmount", \r\n(IFNULL(ml.principal_outstanding_derived, 0) + IFNULL(ml.interest_outstanding_derived, 0) + IFNULL(ml.fee_charges_outstanding_derived, 0) + IFNULL(ml.penalty_charges_outstanding_derived, 0)) AS "loanOutstanding",\r\nounder.id AS "officeNumber", \r\nml.account_no AS "loanAccountNumber",\r\nSUM(lt.amount) AS "repaymentAmount"\r\nFROM m_office mo\r\nJOIN m_office ounder ON ounder.hierarchy LIKE CONCAT(mo.hierarchy, \'%\')\r\nINNER JOIN m_client mc ON mc.office_id=ounder.id\r\nINNER JOIN m_loan ml ON ml.client_id = mc.id\r\nINNER JOIN r_enum_value rev ON rev.enum_id=ml.loan_status_id AND rev.enum_name = \'loan_status_id\'\r\nINNER JOIN m_loan_transaction lt ON lt.loan_id = ml.id\r\nINNER JOIN m_appuser au ON au.id = lt.appuser_id\r\nLEFT JOIN m_loan_arrears_aging laa ON laa.loan_id=ml.id\r\nLEFT JOIN m_payment_detail mpd ON mpd.id=lt.payment_detail_id\r\nLEFT JOIN m_currency cur ON cur.code = ml.currency_code\r\nLEFT JOIN m_group_client gc ON gc.client_id = mc.id\r\nLEFT JOIN m_group g ON g.id = gc.group_id\r\nLEFT JOIN m_staff lo ON lo.id = ml.loan_officer_id\r\nLEFT JOIN m_guarantor gua ON gua.loan_id = ml.id\r\nWHERE ml.loan_status_id=300 AND mo.id=${officeId} AND (IFNULL(ml.loan_officer_id, -10) = ${loanOfficerId} OR "-1" = ${loanOfficerId}) AND (DATEDIFF(CURDATE(), lt.transaction_date) BETWEEN ${fromX} AND ${toY}) AND lt.is_reversed=0 AND lt.transaction_type_enum=2 AND laa.loan_id IS NULL\r\nGROUP BY ml.id\r\nORDER BY ounder.hierarchy, ml.currency_code, mc.account_no, ml.account_no', 'Payments received in the last fromX to toY days for any loan with the status Active (on-time)', 0, 1); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Loan payments received (Overdue Loans)', 'SMS', 'NonTriggered', 'Loan', 'SELECT \r\nml.id AS "loanId", \r\nmc.id AS "id", \r\nmc.firstname AS "firstName",\r\nmc.middlename AS "middleName",\r\nmc.lastname AS "lastName",\r\nmc.display_name AS "fullName",\r\nmc.mobile_no AS "mobileNo", \r\nml.principal_amount AS "loanAmount", \r\n(IFNULL(ml.principal_outstanding_derived, 0) + IFNULL(ml.interest_outstanding_derived, 0) + IFNULL(ml.fee_charges_outstanding_derived, 0) + IFNULL(ml.penalty_charges_outstanding_derived, 0)) AS "loanOutstanding",\r\nounder.id AS "officeNumber", \r\nml.account_no AS "loanAccountNumber",\r\nSUM(lt.amount) AS "repaymentAmount"\r\nFROM m_office mo\r\nJOIN m_office ounder ON ounder.hierarchy LIKE CONCAT(mo.hierarchy, \'%\')\r\nINNER JOIN m_client mc ON mc.office_id=ounder.id\r\nINNER JOIN m_loan ml ON ml.client_id = mc.id\r\nINNER JOIN r_enum_value rev ON rev.enum_id=ml.loan_status_id AND rev.enum_name = \'loan_status_id\'\r\nINNER JOIN m_loan_arrears_aging laa ON laa.loan_id=ml.id\r\nINNER JOIN m_loan_transaction lt ON lt.loan_id = ml.id\r\nINNER JOIN m_appuser au ON au.id = lt.appuser_id\r\nLEFT JOIN m_payment_detail mpd ON mpd.id=lt.payment_detail_id\r\nLEFT JOIN m_currency cur ON cur.code = ml.currency_code\r\nLEFT JOIN m_group_client gc ON gc.client_id = mc.id\r\nLEFT JOIN m_group g ON g.id = gc.group_id\r\nLEFT JOIN m_staff lo ON lo.id = ml.loan_officer_id\r\nLEFT JOIN m_guarantor gua ON gua.loan_id = ml.id\r\nWHERE ml.loan_status_id=300 AND mo.id=${officeId} AND (IFNULL(ml.loan_officer_id, -10) = ${loanOfficerId} OR "-1" = ${loanOfficerId}) AND (DATEDIFF(CURDATE(), lt.transaction_date) BETWEEN ${fromX} AND ${toY}) AND (DATEDIFF(CURDATE(), laa.overdue_since_date_derived) BETWEEN ${overdueX} AND ${overdueY}) AND lt.is_reversed=0 AND lt.transaction_type_enum=2\r\nGROUP BY ml.id\r\nORDER BY ounder.hierarchy, ml.currency_code, mc.account_no, ml.account_no', 'Payments received in the last fromX to toY days for any loan with the status Overdue (arrears) between overdueX and overdueY days', 0, 1); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Happy Birthday', 'SMS', 'NonTriggered', 'Clients', 'SELECT \r\nc.id AS "id", \r\nc.firstname AS "firstName",\r\nc.middlename AS "middleName",\r\nc.lastname AS "lastName",\r\nc.display_name AS "fullName",\r\nc.mobile_no AS "mobileNo", CONCAT(REPEAT("..", ((LENGTH(ounder.`hierarchy`) - LENGTH(\r\nREPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) AS "officeName", \r\no.id AS "officeNumber", \r\nc.date_of_birth AS "dateOfBirth",\r\nIF(c.date_of_birth IS NULL, 0, CEIL(DATEDIFF (NOW(), c.date_of_birth)/365)) AS "age"\r\nFROM m_office o\r\nJOIN m_office ounder ON ounder.hierarchy LIKE CONCAT(o.hierarchy, \'%\')\r\nJOIN m_client c ON c.office_id = ounder.id\r\nLEFT JOIN r_enum_value r ON r.enum_name = \'status_enum\' AND r.enum_id = c.status_enum\r\nLEFT JOIN m_staff ms ON ms.id = c.staff_id\r\nWHERE o.id = ${officeId} AND c.status_enum = 300 AND (IFNULL(c.staff_id, -10) = ${loanOfficerId} OR "-1" = ${loanOfficerId}) AND c.date_of_birth IS NOT NULL AND (DAY(c.date_of_birth)=DAY(NOW())) AND (MONTH(c.date_of_birth)=MONTH(NOW()))\r\nORDER BY ounder.hierarchy, c.account_no', 'This sends a message to all clients with the status Active on their Birthday', 0, 1); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Loan fully repaid', 'SMS', 'NonTriggered', 'Loan', 'SELECT \r\nc.id AS "id", \r\nc.firstname AS "firstName",\r\nc.middlename AS "middleName",\r\nc.lastname AS "lastName",\r\nc.display_name AS "fullName",\r\nc.mobile_no AS "mobileNo", \r\nl.principal_amount AS "loanAmount",\r\n(IFNULL(l.principal_outstanding_derived, 0) + IFNULL(l.interest_outstanding_derived, 0) + IFNULL(l.fee_charges_outstanding_derived, 0) + IFNULL(l.penalty_charges_outstanding_derived, 0)) AS "loanOutstanding",\r\nl.principal_disbursed_derived AS "loanDisbursed",\r\no.id AS "officeNumber",\r\nl.account_no AS "loanAccountId",\r\ngua.lastname AS "guarantorLastName", COUNT(gua.id) AS "numberOfGuarantors",\r\nls.duedate AS "dueDate",\r\nlaa.total_overdue_derived AS "totalDue",\r\ngp.display_name AS "groupName",\r\nl.total_repayment_derived AS "totalFullyPaid"\r\nFROM m_office o\r\nJOIN m_office ounder ON ounder.hierarchy LIKE CONCAT(o.hierarchy, \'%\')\r\nJOIN m_client c ON c.office_id = ounder.id\r\nJOIN m_loan l ON l.client_id = c.id\r\nLEFT JOIN m_staff lo ON lo.id = l.loan_officer_id\r\nLEFT JOIN m_currency cur ON cur.code = l.currency_code\r\nLEFT JOIN m_group_client gc ON gc.client_id = c.id\r\nLEFT JOIN m_group gp ON gp.id = l.group_id\r\nLEFT JOIN m_loan_repayment_schedule ls ON l.id = ls.loan_id\r\nLEFT JOIN m_guarantor gua ON gua.loan_id = l.id\r\nLEFT JOIN m_loan_arrears_aging laa ON laa.loan_id=l.id\r\nWHERE o.id = ${officeId} AND (IFNULL(l.loan_officer_id, -10) = ${loanOfficerId} OR "-1" = ${loanOfficerId}) AND \r\n(DATEDIFF(CURDATE(), l.closedon_date) BETWEEN ${fromX} AND ${toY})\r\n AND (l.loan_status_id IN (600, 700))\r\nGROUP BY l.id\r\nORDER BY ounder.hierarchy, l.currency_code, c.account_no, l.account_no', 'All loans that have been fully repaid (Closed or Overpaid) in the last fromX to toY days', 0, 1); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Loan outstanding after final instalment date', 'SMS', 'NonTriggered', 'Loan', 'SELECT \r\nc.id AS "id", \r\nc.firstname AS "firstName",\r\nc.middlename AS "middleName",\r\nc.lastname AS "lastName",\r\nc.display_name AS "fullName",\r\nc.mobile_no AS "mobileNo", \r\nl.principal_amount AS "loanAmount",\r\no.id AS "officeNumber",\r\n(IFNULL(l.principal_outstanding_derived, 0) + IFNULL(l.interest_outstanding_derived, 0) + IFNULL(l.fee_charges_outstanding_derived, 0) + IFNULL(l.penalty_charges_outstanding_derived, 0)) AS "loanOutstanding",\r\nl.principal_disbursed_derived AS "loanDisbursed",\r\nls.duedate AS "paymentDueDate",\r\n(IFNULL(SUM(ls.principal_amount),0) - IFNULL(SUM(ls.principal_writtenoff_derived),0)\r\n + IFNULL(SUM(ls.interest_amount),0) - IFNULL(SUM(ls.interest_writtenoff_derived),0) \r\n - IFNULL(SUM(ls.interest_waived_derived),0)\r\n + IFNULL(SUM(ls.fee_charges_amount),0) - IFNULL(SUM(ls.fee_charges_writtenoff_derived),0) \r\n - IFNULL(SUM(ls.fee_charges_waived_derived),0)\r\n + IFNULL(SUM(ls.penalty_charges_amount),0) - IFNULL(SUM(ls.penalty_charges_writtenoff_derived),0) \r\n - IFNULL(SUM(ls.penalty_charges_waived_derived),0)\r\n) AS "totalDue",\r\nlaa.total_overdue_derived AS "totalOverdue",\r\nl.account_no AS "loanAccountId",\r\ngua.lastname AS "guarantorLastName",\r\nCOUNT(gua.id) AS "numberOfGuarantors",\r\ngp.display_name AS "groupName"\r\n\r\nFROM m_office o\r\nJOIN m_office ounder ON ounder.hierarchy LIKE CONCAT(o.hierarchy, \'%\')\r\nJOIN m_client c ON c.office_id = ounder.id\r\nJOIN m_loan l ON l.client_id = c.id\r\nLEFT JOIN m_staff lo ON lo.id = l.loan_officer_id\r\nLEFT JOIN m_currency cur ON cur.code = l.currency_code\r\nLEFT JOIN m_loan_arrears_aging laa ON laa.loan_id = l.id\r\nLEFT JOIN m_group_client gc ON gc.client_id = c.id\r\nLEFT JOIN m_group gp ON gp.id = l.group_id\r\nLEFT JOIN m_loan_repayment_schedule ls ON l.id = ls.loan_id\r\nLEFT JOIN m_guarantor gua ON gua.loan_id = l.id\r\nWHERE o.id = ${officeId} AND (IFNULL(l.loan_officer_id, -10) = ${loanOfficerId} OR "-1" = ${loanOfficerId}) AND l.loan_status_id = 300 AND l.expected_maturedon_date < CURDATE() \r\nAND (DATEDIFF(CURDATE(), l.expected_maturedon_date) BETWEEN ${fromX} AND ${toY})\r\nGROUP BY l.id\r\nORDER BY ounder.hierarchy, l.currency_code, c.account_no, l.account_no', 'All active loans (with an outstanding balance) between fromX to toY days after the final instalment date on their loan schedule', 0, 1); - - -INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES -((SELECT id FROM stretchy_report WHERE report_name='Active Clients' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='OfficeIdSelectOne' AND parameter_variable = 'officeId'), 'officeId'), -((SELECT id FROM stretchy_report WHERE report_name='Active Clients' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='loanOfficerIdSelectAll' AND parameter_variable = 'loanOfficerId'), 'loanOfficerId'), - -((SELECT id FROM stretchy_report WHERE report_name='Prospective Clients' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='OfficeIdSelectOne' AND parameter_variable = 'officeId'), 'officeId'), -((SELECT id FROM stretchy_report WHERE report_name='Prospective Clients' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='loanOfficerIdSelectAll' AND parameter_variable = 'loanOfficerId'), 'loanOfficerId'), - -((SELECT id FROM stretchy_report WHERE report_name='Active Loan Clients' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='OfficeIdSelectOne' AND parameter_variable = 'officeId'), 'officeId'), -((SELECT id FROM stretchy_report WHERE report_name='Active Loan Clients' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='loanOfficerIdSelectAll' AND parameter_variable = 'loanOfficerId'), 'loanOfficerId'), -((SELECT id FROM stretchy_report WHERE report_name='Active Loan Clients' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='cycleXSelect' AND parameter_variable = 'cycleX'), 'cycleX'), -((SELECT id FROM stretchy_report WHERE report_name='Active Loan Clients' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='cycleYSelect' AND parameter_variable = 'cycleY'), 'cycleY'), - -((SELECT id FROM stretchy_report WHERE report_name='Loan in arrears' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='OfficeIdSelectOne' AND parameter_variable = 'officeId'), 'officeId'), -((SELECT id FROM stretchy_report WHERE report_name='Loan in arrears' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='loanOfficerIdSelectAll' AND parameter_variable = 'loanOfficerId'), 'loanOfficerId'), -((SELECT id FROM stretchy_report WHERE report_name='Loan in arrears' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='fromXSelect' AND parameter_variable = 'fromX'), 'fromX'), -((SELECT id FROM stretchy_report WHERE report_name='Loan in arrears' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='toYSelect' AND parameter_variable = 'toY'), 'toY'), - -((SELECT id FROM stretchy_report WHERE report_name='Loan payments due' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='OfficeIdSelectOne' AND parameter_variable = 'officeId'), 'officeId'), -((SELECT id FROM stretchy_report WHERE report_name='Loan payments due' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='loanOfficerIdSelectAll' AND parameter_variable = 'loanOfficerId'), 'loanOfficerId'), -((SELECT id FROM stretchy_report WHERE report_name='Loan payments due' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='fromXSelect' AND parameter_variable = 'fromX'), 'fromX'), -((SELECT id FROM stretchy_report WHERE report_name='Loan payments due' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='toYSelect' AND parameter_variable = 'toY'), 'toY'), - -((SELECT id FROM stretchy_report WHERE report_name='Dormant Prospects' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='OfficeIdSelectOne' AND parameter_variable = 'officeId'), 'officeId'), -((SELECT id FROM stretchy_report WHERE report_name='Dormant Prospects' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='loanOfficerIdSelectAll' AND parameter_variable = 'loanOfficerId'), 'loanOfficerId'), - -((SELECT id FROM stretchy_report WHERE report_name='Active group leaders' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='OfficeIdSelectOne' AND parameter_variable = 'officeId'), 'officeId'), -((SELECT id FROM stretchy_report WHERE report_name='Active group leaders' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='loanOfficerIdSelectAll' AND parameter_variable = 'loanOfficerId'), 'loanOfficerId'), - -((SELECT id FROM stretchy_report WHERE report_name='Loan payments due (Overdue Loans)' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='OfficeIdSelectOne' AND parameter_variable = 'officeId'), 'officeId'), -((SELECT id FROM stretchy_report WHERE report_name='Loan payments due (Overdue Loans)' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='loanOfficerIdSelectAll' AND parameter_variable = 'loanOfficerId'), 'loanOfficerId'), -((SELECT id FROM stretchy_report WHERE report_name='Loan payments due (Overdue Loans)' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='fromXSelect' AND parameter_variable = 'fromX'), 'fromX'), -((SELECT id FROM stretchy_report WHERE report_name='Loan payments due (Overdue Loans)' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='toYSelect' AND parameter_variable = 'toY'), 'toY'), -((SELECT id FROM stretchy_report WHERE report_name='Loan payments due (Overdue Loans)' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='overdueXSelect' AND parameter_variable = 'overdueX'), 'overdueX'), -((SELECT id FROM stretchy_report WHERE report_name='Loan payments due (Overdue Loans)' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='overdueYSelect' AND parameter_variable = 'overdueY'), 'overdueY'), - -((SELECT id FROM stretchy_report WHERE report_name='Loan payments received (Active Loans)' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='OfficeIdSelectOne' AND parameter_variable = 'officeId'), 'officeId'), -((SELECT id FROM stretchy_report WHERE report_name='Loan payments received (Active Loans)' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='loanOfficerIdSelectAll' AND parameter_variable = 'loanOfficerId'), 'loanOfficerId'), -((SELECT id FROM stretchy_report WHERE report_name='Loan payments received (Active Loans)' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='fromXSelect' AND parameter_variable = 'fromX'), 'fromX'), -((SELECT id FROM stretchy_report WHERE report_name='Loan payments received (Active Loans)' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='toYSelect' AND parameter_variable = 'toY'), 'toY'), - -((SELECT id FROM stretchy_report WHERE report_name='Loan payments received (Overdue Loans)' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='OfficeIdSelectOne' AND parameter_variable = 'officeId'), 'officeId'), -((SELECT id FROM stretchy_report WHERE report_name='Loan payments received (Overdue Loans)' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='loanOfficerIdSelectAll' AND parameter_variable = 'loanOfficerId'), 'loanOfficerId'), -((SELECT id FROM stretchy_report WHERE report_name='Loan payments received (Overdue Loans)' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='fromXSelect' AND parameter_variable = 'fromX'), 'fromX'), -((SELECT id FROM stretchy_report WHERE report_name='Loan payments received (Overdue Loans)' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='toYSelect' AND parameter_variable = 'toY'), 'toY'), -((SELECT id FROM stretchy_report WHERE report_name='Loan payments received (Overdue Loans)' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='overdueXSelect' AND parameter_variable = 'overdueX'), 'overdueX'), -((SELECT id FROM stretchy_report WHERE report_name='Loan payments received (Overdue Loans)' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='overdueYSelect' AND parameter_variable = 'overdueY'), 'overdueY'), - -((SELECT id FROM stretchy_report WHERE report_name='Happy Birthday' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='OfficeIdSelectOne' AND parameter_variable = 'officeId'), 'officeId'), -((SELECT id FROM stretchy_report WHERE report_name='Happy Birthday' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='loanOfficerIdSelectAll' AND parameter_variable = 'loanOfficerId'), 'loanOfficerId'), - -((SELECT id FROM stretchy_report WHERE report_name='Loan fully repaid' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='OfficeIdSelectOne' AND parameter_variable = 'officeId'), 'officeId'), -((SELECT id FROM stretchy_report WHERE report_name='Loan fully repaid' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='loanOfficerIdSelectAll' AND parameter_variable = 'loanOfficerId'), 'loanOfficerId'), -((SELECT id FROM stretchy_report WHERE report_name='Loan fully repaid' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='fromXSelect' AND parameter_variable = 'fromX'), 'fromX'), -((SELECT id FROM stretchy_report WHERE report_name='Loan fully repaid' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='toYSelect' AND parameter_variable = 'toY'), 'toY'), - -((SELECT id FROM stretchy_report WHERE report_name='Loan outstanding after final instalment date' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='OfficeIdSelectOne' AND parameter_variable = 'officeId'), 'officeId'), -((SELECT id FROM stretchy_report WHERE report_name='Loan outstanding after final instalment date' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='loanOfficerIdSelectAll' AND parameter_variable = 'loanOfficerId'), 'loanOfficerId'), -((SELECT id FROM stretchy_report WHERE report_name='Loan outstanding after final instalment date' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='fromXSelect' AND parameter_variable = 'fromX'), 'fromX'), -((SELECT id FROM stretchy_report WHERE report_name='Loan outstanding after final instalment date' AND report_type = 'SMS'), (SELECT id FROM stretchy_parameter WHERE parameter_name='toYSelect' AND parameter_variable = 'toY'), 'toY'); - - - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES -('Loan Repayment', 'SMS', 'Triggered', NULL, 'select ml.id as loanId,mc.id, mc.firstname, ifnull(mc.middlename,\'\') as middlename, mc.lastname, mc.display_name as FullName, mobile_no as mobileNo, mc.group_name as GroupName, round(ml.principal_amount, ml.currency_digits) as LoanAmount, round(ml.`total_outstanding_derived`, ml.currency_digits) as LoanOutstanding,\nml.`account_no` as LoanAccountId, round(mlt.amountPaid, ml.currency_digits) as repaymentAmount\nFROM m_office mo\nJOIN m_office ounder ON ounder.hierarchy LIKE CONCAT(mo.hierarchy, \'%\')\nAND ounder.hierarchy like CONCAT(\'.\', \'%\')\nLEFT JOIN (\n select \n ml.id as loanId, \n ifnull(mc.id,mc2.id) as id, \n ifnull(mc.firstname,mc2.firstname) as firstname, \n ifnull(mc.middlename,ifnull(mc2.middlename,(\'\'))) as middlename, \n ifnull(mc.lastname,mc2.lastname) as lastname, \n ifnull(mc.display_name,mc2.display_name) as display_name, \n ifnull(mc.status_enum,mc2.status_enum) as status_enum,\n ifnull(mc.mobile_no,mc2.mobile_no) as mobile_no,\n ifnull(mg.office_id,mc2.office_id) as office_id,\n ifnull(mg.staff_id,mc2.staff_id) as staff_id,\n mg.id as group_id, \nmg.display_name as group_name\n from\n m_loan ml\n left join m_group mg on mg.id = ml.group_id\n left join m_group_client mgc on mgc.group_id = mg.id\n left join m_client mc on mc.id = mgc.client_id\n left join m_client mc2 on mc2.id = ml.client_id\n order by loanId\n ) mc on mc.office_id = ounder.id\nright join m_loan as ml on mc.loanId = ml.id\nright join(\nselect mlt.amount as amountPaid,mlt.id,mlt.loan_id\nfrom m_loan_transaction mlt\nwhere mlt.is_reversed = 0 \ngroup by mlt.loan_id\n) as mlt on mlt.loan_id = ml.id\nright join m_loan_repayment_schedule as mls1 on ml.id = mls1.loan_id and mls1.`completed_derived` = 0\nand mls1.installment = (SELECT MIN(installment) from m_loan_repayment_schedule where loan_id = ml.id and duedate <= CURDATE() and completed_derived=0)\nwhere mc.status_enum = 300 and mobile_no is not null and ml.`loan_status_id` = 300\nand (mo.id = ${officeId} or ${officeId} = -1)\nand (mc.staff_id = ${loanOfficerId} or ${loanOfficerId} = -1)\nand (ml.loan_type_enum = ${loanType} or ${loanType} = -1)\nand ml.id in (select mla.loan_id from m_loan_arrears_aging mla)\ngroup by ml.id', 'Loan Repayment', 0, 0); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES -('Loan Approved', 'SMS', 'Triggered', NULL, 'SELECT mc.id, mc.firstname, mc.middlename as middlename, mc.lastname, mc.display_name as FullName, mc.mobile_no as mobileNo, mc.group_name as GroupName, mo.name as officename, ml.id as loanId, ml.account_no as accountnumber, ml.principal_amount_proposed as loanamount, ml.annual_nominal_interest_rate as annualinterestrate FROM m_office mo JOIN m_office ounder ON ounder.hierarchy LIKE CONCAT(mo.hierarchy, \'%\') AND ounder.hierarchy like CONCAT(\'.\', \'%\') LEFT JOIN ( select ml.id as loanId, ifnull(mc.id,mc2.id) as id, ifnull(mc.firstname,mc2.firstname) as firstname, ifnull(mc.middlename,ifnull(mc2.middlename,(\'\'))) as middlename, ifnull(mc.lastname,mc2.lastname) as lastname, ifnull(mc.display_name,mc2.display_name) as display_name, ifnull(mc.status_enum,mc2.status_enum) as status_enum, ifnull(mc.mobile_no,mc2.mobile_no) as mobile_no, ifnull(mg.office_id,mc2.office_id) as office_id, ifnull(mg.staff_id,mc2.staff_id) as staff_id, mg.id as group_id, mg.display_name as group_name from m_loan ml left join m_group mg on mg.id = ml.group_id left join m_group_client mgc on mgc.group_id = mg.id left join m_client mc on mc.id = mgc.client_id left join m_client mc2 on mc2.id = ml.client_id order by loanId ) mc on mc.office_id = ounder.id left join m_loan ml on ml.id = mc.loanId WHERE mc.status_enum = 300 and mc.mobile_no is not null and (mo.id = ${officeId} or ${officeId} = -1) and (mc.staff_id = ${loanOfficerId} or ${loanOfficerId} = -1)and (ml.id = ${loanId} or ${loanId} = -1)and (mc.id = ${clientId} or ${clientId} = -1)and (mc.group_id = ${groupId} or ${groupId} = -1)and (ml.loan_type_enum = ${loanType} or ${loanType} = -1)', 'Loan and client data of approved loan', 0, 0); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES -('Loan Rejected', 'SMS', 'Triggered', NULL, 'SELECT mc.id, mc.firstname, mc.middlename as middlename, mc.lastname, mc.display_name as FullName, mc.mobile_no as mobileNo, mc.group_name as GroupName, mo.name as officename, ml.id as loanId, ml.account_no as accountnumber, ml.principal_amount_proposed as loanamount, ml.annual_nominal_interest_rate as annualinterestrate FROM m_office mo JOIN m_office ounder ON ounder.hierarchy LIKE CONCAT(mo.hierarchy, \'%\') AND ounder.hierarchy like CONCAT(\'.\', \'%\') LEFT JOIN ( select ml.id as loanId, ifnull(mc.id,mc2.id) as id, ifnull(mc.firstname,mc2.firstname) as firstname, ifnull(mc.middlename,ifnull(mc2.middlename,(\'\'))) as middlename, ifnull(mc.lastname,mc2.lastname) as lastname, ifnull(mc.display_name,mc2.display_name) as display_name, ifnull(mc.status_enum,mc2.status_enum) as status_enum, ifnull(mc.mobile_no,mc2.mobile_no) as mobile_no, ifnull(mg.office_id,mc2.office_id) as office_id, ifnull(mg.staff_id,mc2.staff_id) as staff_id, mg.id as group_id, mg.display_name as group_name from m_loan ml left join m_group mg on mg.id = ml.group_id left join m_group_client mgc on mgc.group_id = mg.id left join m_client mc on mc.id = mgc.client_id left join m_client mc2 on mc2.id = ml.client_id order by loanId ) mc on mc.office_id = ounder.id left join m_loan ml on ml.id = mc.loanId WHERE mc.status_enum = 300 and mc.mobile_no is not null and (mo.id = ${officeId} or ${officeId} = -1) and (mc.staff_id = ${loanOfficerId} or ${loanOfficerId} = -1) and (ml.id = ${loanId} or ${loanId} = -1) and (mc.id = ${clientId} or ${clientId} = -1) and (mc.group_id = ${groupId} or ${groupId} = -1) and (ml.loan_type_enum = ${loanType} or ${loanType} = -1)', 'Loan and client data of rejected loan', 0, 0); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `use_report`) VALUES -('Client Rejected', 'SMS', 'Triggered', 'Clients', 'SELECT c.id AS "id", \r\nc.firstname AS "firstName",\r\nc.middlename AS "middleName",\r\nc.lastname AS "lastName",\r\nc.display_name AS "fullName",\r\nc.mobile_no AS "mobileNo", CONCAT(REPEAT("..", ((LENGTH(ounder.`hierarchy`) - LENGTH(\r\nREPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) AS "officeName", \r\no.id AS "officeNumber"\r\nFROM m_office o\r\nJOIN m_office ounder ON ounder.hierarchy LIKE CONCAT(o.hierarchy, \'%\')\r\nJOIN m_client c ON c.office_id = ounder.id\r\nLEFT JOIN r_enum_value r ON r.enum_name = \'status_enum\' AND r.enum_id = c.status_enum\r\nWHERE o.id = ${officeId} AND c.id = ${clientId} AND (IFNULL(c.staff_id, -10) = ${loanOfficerId} OR "-1" = ${loanOfficerId})', 'Client Rejection', '1'), -('Client Activated', 'SMS', 'Triggered', 'Clients', 'SELECT c.id AS "id", \r\nc.firstname AS "firstName",\r\nc.middlename AS "middleName",\r\nc.lastname AS "lastName",\r\nc.display_name AS "fullName",\r\nc.mobile_no AS "mobileNo", CONCAT(REPEAT("..", ((LENGTH(ounder.`hierarchy`) - LENGTH(\r\nREPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) AS "officeName", \r\no.id AS "officeNumber"\r\nFROM m_office o\r\nJOIN m_office ounder ON ounder.hierarchy LIKE CONCAT(o.hierarchy, \'%\')\r\nJOIN m_client c ON c.office_id = ounder.id\r\nLEFT JOIN r_enum_value r ON r.enum_name = \'status_enum\' AND r.enum_id = c.status_enum\r\nWHERE o.id = ${officeId} AND c.id = ${clientId} AND (IFNULL(c.staff_id, -10) = ${loanOfficerId} OR "-1" = ${loanOfficerId})', 'Client Activation', '1'), -('Savings Rejected', 'SMS', 'Triggered', 'Savings', 'SELECT \r\nc.id AS "id",\r\nc.firstname AS "firstName",\r\nc.middlename AS "middleName",\r\nc.lastname AS "lastName",\r\nc.display_name AS "fullName",\r\nc.mobile_no AS "mobileNo",\r\ns.account_no AS "savingsAccountNo",\r\nounder.id AS "officeNumber",\r\nounder.name AS "officeName"\r\n\r\nFROM m_office o\r\nJOIN m_office ounder ON ounder.hierarchy LIKE CONCAT(o.hierarchy, \'%\')\r\nJOIN m_client c ON c.office_id = ounder.id\r\nJOIN m_savings_account s ON s.client_id = c.id\r\nJOIN m_savings_product sp ON sp.id = s.product_id\r\nLEFT JOIN m_staff st ON st.id = s.field_officer_id\r\nLEFT JOIN m_currency cur ON cur.code = s.currency_code\r\nWHERE o.id = ${officeId} AND (IFNULL(s.field_officer_id, -10) = ${loanOfficerId} OR "-1" = ${loanOfficerId}) AND s.id = ${savingsId}', 'Savings Rejected', '1'), -('Savings Activated', 'SMS', 'Triggered', 'Savings', 'SELECT \r\nc.id AS "id",\r\nc.firstname AS "firstName",\r\nc.middlename AS "middleName",\r\nc.lastname AS "lastName",\r\nc.display_name AS "fullName",\r\nc.mobile_no AS "mobileNo",\r\ns.account_no AS "savingsAccountNo",\r\nounder.id AS "officeNumber",\r\nounder.name AS "officeName"\r\n\r\nFROM m_office o\r\nJOIN m_office ounder ON ounder.hierarchy LIKE CONCAT(o.hierarchy, \'%\')\r\nJOIN m_client c ON c.office_id = ounder.id\r\nJOIN m_savings_account s ON s.client_id = c.id\r\nJOIN m_savings_product sp ON sp.id = s.product_id\r\nLEFT JOIN m_staff st ON st.id = s.field_officer_id\r\nLEFT JOIN m_currency cur ON cur.code = s.currency_code\r\nWHERE o.id = ${officeId} AND (IFNULL(s.field_officer_id, -10) = ${loanOfficerId} OR "-1" = ${loanOfficerId}) AND s.id = ${savingsId}', 'Savings Activation', '1'); - -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) -VALUES ('loan_type_enum', '1', 'Individual Loan', 'Individual Loan', '0'); -INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) -VALUES ('loan_type_enum', '2', 'Group Loan', 'Group Loan', '0'); - - -INSERT INTO `stretchy_parameter` (`parameter_name`, `parameter_variable`, `parameter_label`, `parameter_displayType`, `parameter_FormatType`, `parameter_default`, `selectAll`, `parameter_sql`, `parent_id`) -VALUES ('DefaultLoan', 'loanId', 'Loan', 'none', 'number', '-1', 'Y', 'select ml.id \nfrom m_loan ml \nleft join m_client mc on mc.id = ml.client_id \nleft join m_office mo on mo.id = mc.office_id \nwhere mo.id = ${officeId} or ${officeId} = -1', '5'); -INSERT INTO `stretchy_parameter` (`parameter_name`, `parameter_variable`, `parameter_label`, `parameter_displayType`, `parameter_FormatType`, `parameter_default`, `selectAll`, `parameter_sql`, `parent_id`) -VALUES ('DefaultClient', 'clientId', 'Client', 'none', 'number', '-1', 'Y', 'select mc.id \nfrom m_client mc\n left join m_office on mc.office_id = mo.id\n where mo.id = ${officeId} or ${officeId} = -1', '5'); -INSERT INTO `stretchy_parameter` (`parameter_name`, `parameter_variable`, `parameter_label`, `parameter_displayType`, `parameter_FormatType`, `parameter_default`, `selectAll`, `parameter_sql`, `parent_id`) -VALUES ('DefaultGroup', 'groupId', 'Group', 'none', 'number', '-1', 'Y', 'select mg.id \nfrom m_group mg\nleft join m_office mo on mg.office_id = mo.id\nwhere mo.id = ${officeId} or ${officeId} = -1', '5'); -INSERT INTO `stretchy_parameter` (`parameter_name`, `parameter_variable`, `parameter_label`, `parameter_displayType`, `parameter_FormatType`, `parameter_default`, `selectAll`, `parameter_sql`, `parent_id`) -VALUES ('SelectLoanType', 'loanType', 'Loan Type', 'select', 'number', '-1', 'Y', "select\nenum_id as id,\nenum_value as value\nfrom r_enum_value\nwhere enum_name = 'loan_type_enum'", NULL); -INSERT INTO `stretchy_parameter` (`parameter_name`, `parameter_variable`, `parameter_label`, `parameter_displayType`, `parameter_FormatType`, `parameter_default`, `special`, `selectOne`, `selectAll`, `parameter_sql`, `parent_id`) VALUES -('DefaultSavings', 'savingsId', 'Savings', 'none', 'number', '-1', NULL, NULL, 'Y', NULL, 5); -INSERT INTO `stretchy_parameter` (`parameter_name`, `parameter_variable`, `parameter_label`, `parameter_displayType`, `parameter_FormatType`, `parameter_default`, `selectAll`, `parameter_sql`, `parent_id`) VALUES ('DefaultSavingsTransactionId', 'savingsTransactionId', 'Savings Transaction', 'none', 'number', '-1', 'Y', NULL, '5'); - -SET @LRej = (select id from `stretchy_report` where `report_name`='Loan Rejected'); -SET @LApp = (select id from `stretchy_report` where `report_name`='Loan Approved'); -SET @LRep = (select id from `stretchy_report` where `report_name`='Loan Repayment'); -SET @Office = (select id from `stretchy_parameter` where `parameter_name`='OfficeIdSelectOne'); -SET @loanOfficer = (select id from `stretchy_parameter` where `parameter_name`='loanOfficerIdSelectAll'); -SET @DLoan = (select id from `stretchy_parameter` where `parameter_name`='DefaultLoan'); -SET @DClient = (select id from `stretchy_parameter` where `parameter_name`='DefaultClient'); -SET @DGroup = (select id from `stretchy_parameter` where `parameter_name`='DefaultGroup'); -SET @LoanType = (select id from `stretchy_parameter` where `parameter_name`='SelectLoanType'); - -INSERT IGNORE INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) -VALUES (@LRej, @Office, 'officeId'), -(@LApp, @Office, 'officeId'), -(@LRep, @Office, 'officeId'), -(@LRej, @loanOfficer, 'loanOfficerId'), -(@LApp, @loanOfficer, 'loanOfficerId'), -(@LRep, @loanOfficer, 'loanOfficerId'), -(@LRej, @DLoan, 'loanId'), -(@LApp, @DLoan, 'loanId'), -(@LRej, @DClient, 'clientId'), -(@LApp, @DClient, 'clientId'), -(@LRej, @DGroup, 'groupId'), -(@LApp, @DGroup, 'groupId'), -(@LRej, @LoanType, 'loanType'), -(@LApp, @LoanType, 'loanType'), -(@LRep, @LoanType, 'loanType'); - -SET @CRej = (select id from `stretchy_report` where `report_name`='Client Rejected'); -SET @CAct = (select id from `stretchy_report` where `report_name`='Client Activated'); -SET @SRej = (select id from `stretchy_report` where `report_name`='Savings Rejected'); -SET @SAct = (select id from `stretchy_report` where `report_name`='Savings Activated'); - -SET @Office = (select id from `stretchy_parameter` where `parameter_name`='OfficeIdSelectOne'); -SET @fieldOfficer = (select id from `stretchy_parameter` where `parameter_name`='loanOfficerIdSelectAll'); -SET @DClient = (select id from `stretchy_parameter` where `parameter_name`='DefaultClient'); -SET @DSavings = (select id from `stretchy_parameter` where `parameter_name`='DefaultSavings'); - -INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES -(@CRej, @Office, 'officeId'), -(@CAct, @Office, 'officeId'), -(@CRej, @fieldOfficer, 'loanOfficerId'), -(@CAct, @fieldOfficer, 'loanOfficerId'), -(@CRej, @DClient, 'clientId'), -(@CAct, @DClient, 'clientId'), - -(@SRej, @Office, 'officeId'), -(@SRej, @fieldOfficer, 'loanOfficerId'), -(@SRej, @DSavings, 'savingsId'), -(@SAct, @Office, 'officeId'), -(@SAct, @fieldOfficer, 'loanOfficerId'), -(@SAct, @DSavings, 'savingsId'); - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Savings Deposit', 'SMS', 'Triggered', NULL, 'SELECT sc.savingsId AS savingsId, sc.id AS clientId, sc.firstname, IFNULL(sc.middlename,\'\') AS middlename, sc.lastname, sc.display_name AS FullName, sc.mobile_no AS mobileNo,\r\nms.`account_no` AS savingsAccountNo, ROUND(mst.amountPaid, ms.currency_digits) AS depositAmount, ms.account_balance_derived AS balance, \r\nmst.transactionDate AS transactionDate\r\nFROM m_office mo\r\nJOIN m_office ounder ON ounder.hierarchy LIKE CONCAT(mo.hierarchy, \'%\') AND ounder.hierarchy LIKE CONCAT(\'.\', \'%\')\r\nLEFT JOIN (\r\nSELECT \r\n sa.id AS savingsId, mc.id AS id, mc.firstname AS firstname, mc.middlename AS middlename, mc.lastname AS lastname, \r\n mc.display_name AS display_name, mc.status_enum AS status_enum, \r\n mc.mobile_no AS mobile_no, mc.office_id AS office_id, \r\n mc.staff_id AS staff_id\r\nFROM\r\nm_savings_account sa\r\nLEFT JOIN m_client mc ON mc.id = sa.client_id\r\nORDER BY savingsId) sc ON sc.office_id = ounder.id\r\nRIGHT JOIN m_savings_account AS ms ON sc.savingsId = ms.id\r\nRIGHT JOIN(\r\nSELECT st.amount AS amountPaid, st.id, st.savings_account_id, st.id AS savingsTransactionId, st.transaction_date AS transactionDate\r\nFROM m_savings_account_transaction st\r\nWHERE st.is_reversed = 0\r\nGROUP BY st.savings_account_id\r\n) AS mst ON mst.savings_account_id = ms.id\r\nWHERE sc.mobile_no IS NOT NULL AND (mo.id = ${officeId} OR ${officeId} = -1) AND (sc.staff_id = ${loanOfficerId} OR ${loanOfficerId} = -1) AND mst.savingsTransactionId = ${savingsTransactionId}', 'Savings Deposit', 0, 1), -('Savings Withdrawal', 'SMS', 'Triggered', NULL, 'SELECT sc.savingsId AS savingsId, sc.id AS clientId, sc.firstname, IFNULL(sc.middlename,\'\') AS middlename, sc.lastname, sc.display_name AS FullName, sc.mobile_no AS mobileNo,\r\nms.`account_no` AS savingsAccountNo, ROUND(mst.amountPaid, ms.currency_digits) AS withdrawAmount, ms.account_balance_derived AS balance, \r\nmst.transactionDate AS transactionDate\r\nFROM m_office mo\r\nJOIN m_office ounder ON ounder.hierarchy LIKE CONCAT(mo.hierarchy, \'%\') AND ounder.hierarchy LIKE CONCAT(\'.\', \'%\')\r\nLEFT JOIN (\r\nSELECT \r\n sa.id AS savingsId, mc.id AS id, mc.firstname AS firstname, mc.middlename AS middlename, mc.lastname AS lastname, \r\n mc.display_name AS display_name, mc.status_enum AS status_enum, \r\n mc.mobile_no AS mobile_no, mc.office_id AS office_id, \r\n mc.staff_id AS staff_id\r\nFROM\r\nm_savings_account sa\r\nLEFT JOIN m_client mc ON mc.id = sa.client_id\r\nORDER BY savingsId) sc ON sc.office_id = ounder.id\r\nRIGHT JOIN m_savings_account AS ms ON sc.savingsId = ms.id\r\nRIGHT JOIN(\r\nSELECT st.amount AS amountPaid, st.id, st.savings_account_id, st.id AS savingsTransactionId, st.transaction_date AS transactionDate\r\nFROM m_savings_account_transaction st\r\nWHERE st.is_reversed = 0\r\nGROUP BY st.savings_account_id\r\n) AS mst ON mst.savings_account_id = ms.id\r\nWHERE sc.mobile_no IS NOT NULL AND (mo.id = ${officeId} OR ${officeId} = -1) AND (sc.staff_id = ${loanOfficerId} OR ${loanOfficerId} = -1) AND mst.savingsTransactionId = ${savingsTransactionId}', 'Savings Withdrawal', 0, 1); - - -SET @SDep = (select id from `stretchy_report` where `report_name`='Savings Deposit'); -SET @SWith = (select id from `stretchy_report` where `report_name`='Savings Withdrawal'); - -SET @savingsTransaction = (select id from `stretchy_parameter` where `parameter_name`='DefaultSavingsTransactionId'); - -INSERT IGNORE INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES -(@SDep, @Office, 'officeId'), -(@SDep, @loanOfficer, 'loanOfficerId'), -(@SDep, @savingsTransaction, 'savingsTransactionId'), -(@SWith, @Office, 'officeId'), -(@SWith, @loanOfficer, 'loanOfficerId'), -(@SWith, @savingsTransaction, 'savingsTransactionId'); - -INSERT INTO `c_external_service` (`name`) VALUES ('MESSAGE_GATEWAY'); - -SET @EId = (SELECT `id` FROM `c_external_service` WHERE name = 'MESSAGE_GATEWAY'); - -INSERT INTO `c_external_service_properties` (`name`, `value`, `external_service_id`) VALUES -('host_name', 'localhost', @EId), -('port_number', '9191', @EId), -('end_point', '/', @EId), -('tenant_app_key', NULL, @EId); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V323__spm_replace_dead_fk_with_exisiting_one.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V323__spm_replace_dead_fk_with_exisiting_one.sql deleted file mode 100644 index ccd2b28b7..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V323__spm_replace_dead_fk_with_exisiting_one.sql +++ /dev/null @@ -1,38 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -SET FOREIGN_KEY_CHECKS = 0; -DROP TABLE IF EXISTS `m_survey_scorecards`; -CREATE TABLE `m_survey_scorecards` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `survey_id` BIGINT NOT NULL, - `question_id` BIGINT NOT NULL, - `response_id` BIGINT NOT NULL, - `user_id` BIGINT NOT NULL, - `client_id` BIGINT NOT NULL, - `created_on` DATETIME NULL DEFAULT NULL, - `a_value` INT NOT NULL, - PRIMARY KEY (`id`), - FOREIGN KEY (`survey_id`) REFERENCES `m_surveys` (`id`), - FOREIGN KEY (`question_id`) REFERENCES `m_survey_questions` (`id`), - FOREIGN KEY (`response_id`) REFERENCES `m_survey_responses` (`id`), - FOREIGN KEY (`user_id`) REFERENCES `m_appuser` (`id`), - FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) -); -SET FOREIGN_KEY_CHECKS = 1; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V324_1__add_entity_subtype_registered_table.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V324_1__add_entity_subtype_registered_table.sql deleted file mode 100644 index 0867962be..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V324_1__add_entity_subtype_registered_table.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `x_registered_table` ADD COLUMN `entity_subtype` VARCHAR(50) NULL AFTER `application_table_name`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V324__datatable_checks.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V324__datatable_checks.sql deleted file mode 100644 index cc79b35f1..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V324__datatable_checks.sql +++ /dev/null @@ -1,43 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_entity_datatable_check` ( - `id` INT NOT NULL AUTO_INCREMENT, - `application_table_name` VARCHAR(200) NOT NULL, - `x_registered_table_name` VARCHAR(50) NOT NULL, - `status_enum` INT NOT NULL, - `system_defined` TINYINT NOT NULL DEFAULT '0', - `product_id` BIGINT NULL DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE INDEX `unique_entity_check` (`application_table_name`, `x_registered_table_name`, `status_enum`, `product_id`), - INDEX `x_registered_table_name` (`x_registered_table_name`), - INDEX `product_id` (`product_id`), - CONSTRAINT `m_entity_datatable_check_ibfk_1` FOREIGN KEY (`x_registered_table_name`) - REFERENCES `x_registered_table` (`registered_table_name`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - - -INSERT INTO m_permission (`grouping`, code, entity_name, action_name, can_maker_checker) -VALUE ("datatable","READ_ENTITY_DATATABLE_CHECK","ENTITY_DATATABLE_CHECK","READ",0); - -INSERT INTO m_permission (`grouping`, code, entity_name, action_name, can_maker_checker) -VALUE ("datatable","CREATE_ENTITY_DATATABLE_CHECK","ENTITY_DATATABLE_CHECK","CREATE",0); - -INSERT INTO m_permission (`grouping`, code, entity_name, action_name, can_maker_checker) -VALUE ("datatable","DELETE_ENTITY_DATATABLE_CHECK","ENTITY_DATATABLE_CHECK","DELETE",0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V325__add_is_staff_client_data.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V325__add_is_staff_client_data.sql deleted file mode 100644 index 0122f8458..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V325__add_is_staff_client_data.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_client` - ADD COLUMN `is_staff` tinyint NOT NULL DEFAULT '0' AFTER `mobile_no`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V326__data_migration_for_client_tr_gl_entries.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V326__data_migration_for_client_tr_gl_entries.sql deleted file mode 100644 index 09e8888d6..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V326__data_migration_for_client_tr_gl_entries.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -UPDATE acc_gl_journal_entry g SET g.entity_type_enum = 5 WHERE g.client_transaction_id IS NOT NULL AND g.entity_type_enum = 2; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V327_1__creditbureau_integration.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V327_1__creditbureau_integration.sql deleted file mode 100644 index 62521837c..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V327_1__creditbureau_integration.sql +++ /dev/null @@ -1,76 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -CREATE TABLE `m_creditbureau_token` ( - `id` INT(128) NOT NULL AUTO_INCREMENT, - `username` varchar(128) DEFAULT NULL, - `token` MEDIUMTEXT DEFAULT NULL, - `tokenType` varchar(128) DEFAULT NULL, - `expiresIn` varchar(128) DEFAULT NULL, - `issued` varchar(128) DEFAULT NULL, - `expiryDate` DATE DEFAULT NULL, - PRIMARY KEY (`id`) -); - -CREATE TABLE `m_creditreport` ( - `id` INT(128) NOT NULL AUTO_INCREMENT, - `creditBureauId` BIGINT(128) DEFAULT NULL, - `nationalId` varchar(128) DEFAULT NULL, - `creditReports` BLOB DEFAULT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `cbId` FOREIGN KEY (`creditBureauId`) REFERENCES `m_creditbureau` (`id`) -); - - -ALTER TABLE m_creditbureau_configuration -DROP FOREIGN KEY cbConfigfk1; - -ALTER TABLE m_creditbureau_configuration -ADD CONSTRAINT cbConfigfk1 -FOREIGN KEY (organisation_creditbureau_id) REFERENCES `m_creditbureau` (`id`); - -ALTER TABLE m_creditbureau_configuration MODIFY COLUMN value longtext; - -ALTER TABLE m_organisation_creditbureau CHANGE is_active isActive TINYINT(4) NOT NULL; -ALTER TABLE m_creditbureau_loanproduct_mapping CHANGE is_active isActive TINYINT(4) NULL; - --- Integrated credit bureau added - -INSERT INTO `m_creditbureau` (`id`, `name`, `product`, `country`, `implementationKey`) VALUES ('1', 'THITSAWORKS', '1', 'Myanmar', '1'); - - --- permissions added - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('configuration', 'GET_CREDITREPORT', 'CREDITREPORT', 'GET', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('configuration', 'CREATE_CREDITBUREAU_CONFIGURATION', 'CREDITBUREAU_CONFIGURATION', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('configuration', 'UPDATE_CREDITBUREAU_CONFIGURATION', 'CREDITBUREAU_CONFIGURATION', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('configuration', 'SAVE_CREDITREPORT', 'CREDITREPORT', 'SAVE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('configuration', 'DELETE_CREDITREPORT', 'CREDITREPORT', 'DELETE', 0); - --- configkeys added - -INSERT INTO `m_creditbureau_configuration` (`id`, `configkey`, `value`, `organisation_creditbureau_id`, `description`) VALUES ('1', 'Password', '', '1', ''); -INSERT INTO `m_creditbureau_configuration` (`id`, `configkey`, `value`, `organisation_creditbureau_id`, `description`) VALUES ('2', 'SubscriptionId', '', '1', ''); -INSERT INTO `m_creditbureau_configuration` (`id`, `configkey`, `value`, `organisation_creditbureau_id`, `description`) VALUES ('3', 'SubscriptionKey', '', '1', ''); -INSERT INTO `m_creditbureau_configuration` (`id`, `configkey`, `value`, `organisation_creditbureau_id`, `description`) VALUES ('4', 'Username', '', '1', ''); -INSERT INTO `m_creditbureau_configuration` (`id`, `configkey`, `value`, `organisation_creditbureau_id`, `description`) VALUES ('5', 'tokenurl', '', '1', ''); -INSERT INTO `m_creditbureau_configuration` (`id`, `configkey`, `value`, `organisation_creditbureau_id`, `description`) VALUES ('6', 'searchurl', '', '1', ''); -INSERT INTO `m_creditbureau_configuration` (`id`, `configkey`, `value`, `organisation_creditbureau_id`, `description`) VALUES ('7', 'creditReporturl', '', '1', ''); -INSERT INTO `m_creditbureau_configuration` (`id`, `configkey`, `value`, `organisation_creditbureau_id`, `description`) VALUES ('8', 'addCreditReporturl', '', '1', ''); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V327__creditbureau_configuration.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V327__creditbureau_configuration.sql deleted file mode 100644 index 836861274..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V327__creditbureau_configuration.sql +++ /dev/null @@ -1,89 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -- credit bureau tables -CREATE TABLE `m_creditbureau` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `name` varchar(100) NOT NULL, - `product` varchar(100) NOT NULL, - `country` varchar(100) NOT NULL, - `implementationKey` varchar(100) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `unique impl` (`name`,`product`,`country`,`implementationKey`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - - -CREATE TABLE `m_organisation_creditbureau` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `alias` varchar(50) NOT NULL, - `creditbureau_id` BIGINT NOT NULL, - `is_active` TINYINT NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `morgcb` (`alias`,`creditbureau_id`), - KEY `orgcb_cbfk` (`creditbureau_id`), - CONSTRAINT `orgcb_cbfk` FOREIGN KEY (`creditbureau_id`) REFERENCES `m_creditbureau` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - - - - -CREATE TABLE `m_creditbureau_configuration` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `configkey` varchar(50) DEFAULT NULL, - `value` varchar(50) DEFAULT NULL, - `organisation_creditbureau_id` BIGINT DEFAULT NULL, - `description` varchar(50) DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `mcbconfig` (`configkey`,`organisation_creditbureau_id`), - KEY `cbConfigfk1` (`organisation_creditbureau_id`), - CONSTRAINT `cbConfigfk1` FOREIGN KEY (`organisation_creditbureau_id`) REFERENCES `m_organisation_creditbureau` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - - - - - -CREATE TABLE `m_creditbureau_loanproduct_mapping` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `organisation_creditbureau_id` BIGINT NOT NULL, - `loan_product_id` BIGINT NOT NULL, - `is_creditcheck_mandatory` tinyint DEFAULT NULL, - `skip_creditcheck_in_failure` tinyint DEFAULT NULL, - `stale_period` INT DEFAULT NULL, - `is_active` tinyint DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `cblpunique_key` (`organisation_creditbureau_id`,`loan_product_id`), - KEY `fk_cb_lp2` (`loan_product_id`), - CONSTRAINT `cblpfk2` FOREIGN KEY (`organisation_creditbureau_id`) REFERENCES `m_organisation_creditbureau` (`id`), - CONSTRAINT `fk_cb_lp2` FOREIGN KEY (`loan_product_id`) REFERENCES `m_product_loan` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - - --- modify `m_portfolio_command_source` command - -ALTER TABLE `m_portfolio_command_source` - ADD COLUMN `creditbureau_id` BIGINT NULL DEFAULT NULL AFTER `transaction_id`, - ADD COLUMN `organisation_creditbureau_id` BIGINT NULL DEFAULT NULL AFTER `creditbureau_id`; - - --- permissions -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('configuration', 'CREATE_CREDITBUREAU_LOANPRODUCT_MAPPING', 'CREDITBUREAU_LOANPRODUCT_MAPPING', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('configuration', 'CREATE_ORGANISATIONCREDITBUREAU', 'ORGANISATIONCREDITBUREAU', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('configuration', 'UPDATE_ORGANISATIONCREDITBUREAU', 'ORGANISATIONCREDITBUREAU', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('configuration', 'UPDATE_CREDITBUREAU_LOANPRODUCT_MAPPING', 'CREDITBUREAU_LOANPRODUCT_MAPPING', 'UPDATE', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V328__family_members_sql_support.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V328__family_members_sql_support.sql deleted file mode 100644 index e624a9620..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V328__family_members_sql_support.sql +++ /dev/null @@ -1,60 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -CREATE TABLE `m_family_members` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `client_id` BIGINT NOT NULL, - `firstname` varchar(50) NOT NULL, - `middlename` varchar(50) DEFAULT NULL, - `lastname` varchar(50) DEFAULT NULL, - `qualification` varchar(50) DEFAULT NULL, - `relationship_cv_id` INT NOT NULL, - `marital_status_cv_id` INT DEFAULT NULL, - `gender_cv_id` INT DEFAULT NULL, - `date_of_birth` date DEFAULT NULL, - `age` INT DEFAULT NULL, - `profession_cv_id` INT DEFAULT NULL, - `mobile_number` varchar(50) DEFAULT NULL, - `is_dependent` TINYINT DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `FK_m_family_members_client_id_m_client` (`client_id`), - KEY `FK_m_family_members_relationship_m_code_value` (`relationship_cv_id`), - KEY `FK_m_family_members_marital_status_m_code_value` (`marital_status_cv_id`), - KEY `FK_m_family_members_gender_m_code_value` (`gender_cv_id`), - KEY `FK_m_family_members_profession_m_code_value` (`profession_cv_id`), - CONSTRAINT `FK_m_family_members_client_id_m_client` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`), - CONSTRAINT `FK_m_family_members_gender_m_code_value` FOREIGN KEY (`gender_cv_id`) REFERENCES `m_code_value` (`id`), - CONSTRAINT `FK_m_family_members_marital_status_m_code_value` FOREIGN KEY (`marital_status_cv_id`) REFERENCES `m_code_value` (`id`), - CONSTRAINT `FK_m_family_members_profession_m_code_value` FOREIGN KEY (`profession_cv_id`) REFERENCES `m_code_value` (`id`), - CONSTRAINT `FK_m_family_members_relationship_m_code_value` FOREIGN KEY (`relationship_cv_id`) REFERENCES `m_code_value` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=UTF8MB4; - - --- permissions - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'CREATE_FAMILYMEMBERS', 'FAMILYMEMBERS', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATE_FAMILYMEMBERS', 'FAMILYMEMBERS', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'DELETE_FAMILYMEMBERS', 'FAMILYMEMBERS', 'DELETE', 0); - --- code inserts - -INSERT INTO `m_code` (`code_name`, `is_system_defined`) VALUES ('MARITAL STATUS', 1); -INSERT INTO `m_code` (`code_name`, `is_system_defined`) VALUES ('RELATIONSHIP', 1); -INSERT INTO `m_code` (`code_name`, `is_system_defined`) VALUES ('PROFESSION', 1); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V329__sms_messages_without_campaign.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V329__sms_messages_without_campaign.sql deleted file mode 100644 index cdb786002..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V329__sms_messages_without_campaign.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `sms_messages_outbound` CHANGE `campaign_id` `campaign_id` BIGINT NULL DEFAULT NULL; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V32__associate-disassociate-clients-from-group-permissions.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V32__associate-disassociate-clients-from-group-permissions.sql deleted file mode 100644 index 6ab4cf43c..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V32__associate-disassociate-clients-from-group-permissions.sql +++ /dev/null @@ -1,23 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'ASSOCIATECLIENTS_GROUP', 'GROUP', 'ASSOCIATECLIENTS', 0); - - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'DISASSOCIATECLIENTS_GROUP', 'GROUP', 'DISASSOCIATECLIENTS', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V330__savings_account_transaction_releaseId.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V330__savings_account_transaction_releaseId.sql deleted file mode 100644 index 8eeafe828..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V330__savings_account_transaction_releaseId.sql +++ /dev/null @@ -1,45 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -- permissions -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES -('transaction_savings', 'HOLDAMOUNT_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'HOLDAMOUNT', 0), -('transaction_savings', 'HOLDAMOUNT_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'HOLDAMOUNT_CHECKER', 0), -('transaction_savings', 'BLOCKDEBIT_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'BLOCKDEBIT', 0), -('transaction_savings', 'BLOCKDEBIT_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'BLOCKDEBIT_CHECKER', 0), -('transaction_savings', 'UNBLOCKDEBIT_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'UNBLOCKDEBIT', 0), -('transaction_savings', 'UNBLOCKDEBIT_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'UNBLOCKDEBIT_CHECKER', 0), -('transaction_savings', 'BLOCKCREDIT_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'BLOCKCREDIT', 0), -('transaction_savings', 'BLOCKCREDIT_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'BLOCKCREDIT_CHECKER', 0), -('transaction_savings', 'UNBLOCKCREDIT_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'UNBLOCKCREDIT', 0), -('transaction_savings', 'UNBLOCKCREDIT_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'UNBLOCKCREDIT_CHECKER', 0), -('transaction_savings', 'BLOCK_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'BLOCK', 0), -('transaction_savings', 'BLOCK_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'BLOCK_CHECKER', 0), -('transaction_savings', 'UNBLOCK_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'UNBLOCK', 0), -('transaction_savings', 'UNBLOCK_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'UNBLOCK_CHECKER', 0), -('transaction_savings', 'RELEASEAMOUNT_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'RELEASEAMOUNT', 0), -('transaction_savings', 'RELEASEAMOUNT_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'RELEASEAMOUNT_CHECKER', 0); - --- modify `m_savings_account_transaction` - -ALTER TABLE `m_savings_account_transaction` ADD COLUMN `release_id_of_hold_amount` BIGINT NULL DEFAULT NULL; - --- modify `m_savings_account` - -ALTER TABLE `m_savings_account` ADD COLUMN `total_savings_amount_on_hold` DECIMAL(19,6) NULL DEFAULT NULL; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V331__holiday_schema_changes.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V331__holiday_schema_changes.sql deleted file mode 100644 index 30c5096e8..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V331__holiday_schema_changes.sql +++ /dev/null @@ -1,23 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -ALTER TABLE m_holiday -MODIFY COLUMN repayments_rescheduled_to DATETIME NULL DEFAULT NULL, -ADD COLUMN `rescheduling_type` INT NOT NULL DEFAULT '2'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V332__self_service_registration_schema.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V332__self_service_registration_schema.sql deleted file mode 100644 index 850cda4b5..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V332__self_service_registration_schema.sql +++ /dev/null @@ -1,38 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `request_audit_table` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `lastname` VARCHAR(100) NOT NULL, - `username` VARCHAR(100) NOT NULL, - `mobile_number` VARCHAR(50) NULL DEFAULT NULL, - `firstname` VARCHAR(100) NOT NULL, - `authentication_token` VARCHAR(100) NULL DEFAULT NULL, - `password` VARCHAR(250) NOT NULL, - `email` VARCHAR(100) NOT NULL, - `client_id` BIGINT NOT NULL, - `created_date` DATE NOT NULL, - `account_number` VARCHAR(100) NOT NULL, - PRIMARY KEY (`id`), - INDEX `FK1_request_audit_table_m_client` (`client_id`), - CONSTRAINT `FK1_request_audit_table_m_client` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB -; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V333__adhocquery.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V333__adhocquery.sql deleted file mode 100644 index 643509538..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V333__adhocquery.sql +++ /dev/null @@ -1,49 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_adhoc` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `name` VARCHAR(100) NULL DEFAULT NULL, - `query` VARCHAR(2000) NULL DEFAULT NULL, - `table_name` VARCHAR(100) NULL DEFAULT NULL, - `table_fields` VARCHAR(1000) NULL DEFAULT NULL, - `email` VARCHAR(500) NOT NULL, - `IsActive` tinyint NOT NULL DEFAULT '0', - `created_date` DATETIME NULL DEFAULT NULL, - `createdby_id` BIGINT NOT NULL, - `lastmodifiedby_id` BIGINT NOT NULL, - `lastmodified_date` DATETIME NULL DEFAULT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `createdby_id` FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`), - CONSTRAINT `lastmodifiedby_id` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`) -) -COLLATE='latin1_swedish_ci' -ENGINE=InnoDB -; - -INSERT INTO `m_permission` -(`grouping`,`code`,`entity_name`,`action_name`,`can_maker_checker`) VALUES -('authorisation','UPDATE_ADHOC','ADHOC','UPDATE',1), -('authorisation','UPDATE_ADHOC_CHECKER','ADHOC','UPDATE',0), -('authorisation','DELETE_ADHOC','ADHOC','DELETE',1), -('authorisation','DELETE_ADHOC_CHECKER','ADHOC','DELETE',0), -('authorisation','CREATE_ADHOC','ADHOC','CREATE',1), -('authorisation','CREATE_ADHOC_CHECKER','ADHOC','CREATE',0); - -INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`) VALUES ('Generate AdhocClient Schedule', 'Generate AdhocClient Schedule', '0 0 12 1/1 * ? *', now()); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V334__notification_module_tables.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V334__notification_module_tables.sql deleted file mode 100644 index d321019c8..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V334__notification_module_tables.sql +++ /dev/null @@ -1,46 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE IF NOT EXISTS `notification_generator` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `object_type` text, - `object_identifier` BIGINT DEFAULT NULL, - `action` text, - `actor` BIGINT, - `is_system_generated` tinyint DEFAULT '0', - `notification_content` text, - `created_at` datetime DEFAULT NULL, - PRIMARY KEY (`id`) -); - - -CREATE TABLE IF NOT EXISTS `notification_mapper` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `notification_id` BIGINT DEFAULT NULL, - `user_id` BIGINT DEFAULT NULL, - `is_read` tinyint DEFAULT '0', - `created_at` datetime DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `notification_mapper` (`user_id`), - KEY `notification_id` (`notification_id`) -); - -ALTER TABLE `notification_mapper` - ADD CONSTRAINT `notification_mapper_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `m_appuser` (`id`), - ADD CONSTRAINT `notification_mapper_ibfk_3` FOREIGN KEY (`notification_id`) REFERENCES `notification_generator` (`id`); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V335__self_service_user_role.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V335__self_service_user_role.sql deleted file mode 100644 index ce4be3f20..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V335__self_service_user_role.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_role` (`name`, `description`, `is_disabled`) VALUES ('Self Service User', 'self service user role', 1); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V336__sms_campaign_notification.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V336__sms_campaign_notification.sql deleted file mode 100644 index 594e18002..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V336__sms_campaign_notification.sql +++ /dev/null @@ -1,47 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `client_device_registration` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `client_id` BIGINT NOT NULL, - `updatedon_date` DATETIME NOT NULL, - `registration_id` VARCHAR(255) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE INDEX `registration_key_client_device_registration` (`registration_id`), - UNIQUE INDEX `client_key_client_device_registration` (`client_id`), - INDEX `FK1_client_device_registration_m_client` (`client_id`), - CONSTRAINT `FK1_client_device_registration_m_client` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) -); - -INSERT INTO `c_external_service` (`name`) VALUES ('NOTIFICATION'); - -INSERT INTO `c_external_service_properties` (`name`, `value`, `external_service_id`) VALUES ('server_key', -'AAAAToBmqQQ:APA91bEodkE12CwFl8VHqanUbeJYg1E05TiheVz59CZZYrBnCq3uM40UYhHfdP-JfeTQ0L0zoLqS8orjvW_ze0_VF8DSuyyqkrDibflhtUainsI0lwgVz5u1YP3q3c3erqjlySEuRShS', -(select id from `c_external_service` where name ='NOTIFICATION') -),('gcm_end_point','https://gcm-http.googleapis.com/gcm/send',(select id from `c_external_service` where name ='NOTIFICATION') -),('fcm_end_point','https://fcm.googleapis.com/fcm/send',(select id from `c_external_service` where name ='NOTIFICATION') -); - -ALTER TABLE sms_campaign -MODIFY COLUMN provider_id BIGINT NULL DEFAULT NULL, -ADD COLUMN is_notification tinyint NULL DEFAULT '0'; - -ALTER TABLE sms_messages_outbound -MODIFY COLUMN mobile_no VARCHAR(50) NULL DEFAULT NULL, -ADD COLUMN is_notification tinyint NOT NULL DEFAULT '0' diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V337__equal_amortization.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V337__equal_amortization.sql deleted file mode 100644 index 1f95ae1a0..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V337__equal_amortization.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_product_loan` ADD COLUMN `is_equal_amortization` tinyint NOT NULL DEFAULT '0'; -ALTER TABLE `m_loan` ADD COLUMN `is_equal_amortization` tinyint NOT NULL DEFAULT '0'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V338__two_factor_authentication.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V338__two_factor_authentication.sql deleted file mode 100644 index c15db90bf..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V338__two_factor_authentication.sql +++ /dev/null @@ -1,63 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - --- Access Token Table - -CREATE TABLE `twofactor_access_token` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `token` varchar(32) NOT NULL, - `appuser_id` BIGINT NOT NULL, - `valid_from` datetime NOT NULL, - `valid_to` datetime NOT NULL, - `enabled` bit(1) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `token_appuser_UNIQUE` (`token`,`appuser_id`), - KEY `user` (`appuser_id`), - KEY `token` (`token`), - CONSTRAINT `fk_2fa_access_token_user_id` FOREIGN KEY (`appuser_id`) REFERENCES `m_appuser` (`id`) -); - --- Configuration - -CREATE TABLE `twofactor_configuration` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `name` varchar(40) NOT NULL, - `value` varchar(1024) DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `key_UNIQUE` (`name`) -); - -INSERT INTO `twofactor_configuration` (`name`, `value`) VALUES - ('otp-delivery-email-enable', 'true'), - ('otp-delivery-email-subject', 'Fineract Two-Factor Authentication Token'), - ('otp-delivery-email-body', 'Hello {{username}}.\nYour OTP login token is {{token}}.'), - ('otp-delivery-sms-enable', 'false'), - ('otp-delivery-sms-provider', '1'), - ('otp-delivery-sms-text', 'Your authentication token for Fineract is {{token}}.'), - ('otp-token-live-time', '300'), - ('otp-token-length', '5'), - ('access-token-live-time', '86400'), - ('access-token-live-time-extended', '604800'); - - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES - ('authorisation', 'INVALIDATE_TWOFACTOR_ACCESSTOKEN', 'TWOFACTOR_ACCESSTOKEN', 'INVALIDATE', '0'), - ('configuration', 'READ_TWOFACTOR_CONFIGURATION', 'TWOFACTOR_CONFIGURATION', 'READ', '0'), - ('configuration', 'UPDATE_TWOFACTOR_CONFIGURATION', 'TWOFACTOR_CONFIGURATION', 'UPDATE', '0'), - ('special', 'BYPASS_TWOFACTOR', NULL, NULL, '0'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V339__report-run-frequency.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V339__report-run-frequency.sql deleted file mode 100644 index 51c65a4f4..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V339__report-run-frequency.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE m_adhoc ADD COLUMN report_run_frequency_code INT NULL DEFAULT NULL; -ALTER TABLE m_adhoc ADD COLUMN report_run_every INT NULL DEFAULT NULL; -ALTER TABLE m_adhoc ADD COLUMN last_run TIMESTAMP NULL DEFAULT NULL; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V33__drop_unique_check_on_stretchy_report_parameter.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V33__drop_unique_check_on_stretchy_report_parameter.sql deleted file mode 100644 index 2fe5faac1..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V33__drop_unique_check_on_stretchy_report_parameter.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -ALTER TABLE stretchy_report_parameter - DROP INDEX `report_id_name_UNIQUE` ; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V340__nullable-adhoc-email.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V340__nullable-adhoc-email.sql deleted file mode 100644 index 8ecaaa3ab..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V340__nullable-adhoc-email.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE m_adhoc MODIFY `email` VARCHAR(500) NULL DEFAULT NULL; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V341__m_import_document.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V341__m_import_document.sql deleted file mode 100644 index 08a42d4ba..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V341__m_import_document.sql +++ /dev/null @@ -1,39 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_import_document` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `document_id` INT NOT NULL, - `import_time` datetime NOT NULL, - `end_time` datetime DEFAULT NULL, - `entity_type` TINYINT NOT NULL, - `completed` TINYINT DEFAULT 0, - `total_records` BIGINT DEFAULT 0, - `success_count` BIGINT DEFAULT 0, - `failure_count` BIGINT DEFAULT 0, - `createdby_id` BIGINT DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `import_document_id` (`document_id`), - CONSTRAINT `FK_m_import_m_document` FOREIGN KEY (`document_id`) REFERENCES `m_document` (`id`), - CONSTRAINT `FK_m_import_m_appuser` FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`) -); - -INSERT INTO `m_permission` -(`grouping`,`code`,`entity_name`,`action_name`,`can_maker_checker`) VALUES -('infrastructure','READ_IMPORT','IMPORT','READ', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V342__topic_module_table.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V342__topic_module_table.sql deleted file mode 100644 index fe2d350d6..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V342__topic_module_table.sql +++ /dev/null @@ -1,45 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE IF NOT EXISTS `topic` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `title` VARCHAR(100) NOT NULL, - `enabled` tinyint NULL, - `entity_id` BIGINT NOT NULL, - `entity_type` TEXT NOT NULL, - `member_type` TEXT NOT NULL, - PRIMARY KEY (`id`), - UNIQUE INDEX `title_UNIQUE` (`title` ASC) -)ENGINE = InnoDB; - -CREATE TABLE IF NOT EXISTS `topic_subscriber` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `topic_id` BIGINT NOT NULL, - `user_id` BIGINT NOT NULL, - `subscription_date` DATE NOT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `fk_topic_has_m_appuser_topic` FOREIGN KEY (`topic_id`) REFERENCES `topic` (`id`), - CONSTRAINT `fk_topic_has_m_appuser_m_appuser1` FOREIGN KEY (`user_id`) REFERENCES `m_appuser` (`id`) -) ENGINE = InnoDB; - -INSERT INTO topic (enabled, entity_type, entity_id, member_type, title) SELECT true, 'OFFICE', o.id as entity_id, UPPER(r.name) as member_type, CONCAT(r.name, ' of ', o.name) as title FROM m_office o, m_role r WHERE o.parent_id IS NULL AND CONCAT(r.name, ' of ', o.name) COLLATE utf8mb4_general_ci NOT IN (SELECT title FROM topic); - -INSERT INTO topic (enabled, entity_type, entity_id, member_type, title) SELECT true, 'BRANCH', o.id as entity_id, UPPER(r.name) as member_type, CONCAT(r.name, ' of ', o.name) as title FROM m_office o, m_role r WHERE o.parent_id IS NOT NULL AND CONCAT(r.name, ' of ', o.name) COLLATE utf8mb4_general_ci NOT IN (SELECT title FROM topic); - -INSERT INTO topic_subscriber( user_id, topic_id, subscription_date ) SELECT u.id AS user_id, t.id AS topic_id, NOW() FROM topic t, m_appuser u, m_appuser_role ur, m_role r WHERE u.office_id = t.entity_id AND u.id = ur.appuser_id AND ur.role_id = r.id AND r.name COLLATE utf8mb4_general_ci = t.member_type AND NOT EXISTS (SELECT user_id, topic_id FROM topic_subscriber WHERE user_id = u.id AND topic_id = t.id); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V343__scheduled_email_campaign_status.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V343__scheduled_email_campaign_status.sql deleted file mode 100644 index bc3cbce60..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V343__scheduled_email_campaign_status.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `scheduled_email_campaign` ADD `previous_run_status` VARCHAR(10) NULL; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V344__parallelizing_and_paging_recalculate_interest_for_loans_job.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V344__parallelizing_and_paging_recalculate_interest_for_loans_job.sql deleted file mode 100644 index ab1371c24..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V344__parallelizing_and_paging_recalculate_interest_for_loans_job.sql +++ /dev/null @@ -1,33 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE IF NOT EXISTS `job_parameters` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `job_id` BIGINT NOT NULL, - `parameter_name` VARCHAR(100) NOT NULL, - `parameter_value` INT NOT NULL, - PRIMARY KEY (`id`), - KEY `FK_job_id` (`job_id`), - CONSTRAINT `FK_job_id` FOREIGN KEY (`job_id`) REFERENCES `job` (`id`) - -); - -INSERT IGNORE INTO `job_parameters`(`job_id`,`parameter_name`,`parameter_value`) VALUES(17,'thread-pool-size',10); -INSERT IGNORE INTO `job_parameters`(`job_id`,`parameter_name`,`parameter_value`) VALUES(17,'batch-size',100); -INSERT IGNORE INTO `job_parameters`(`job_id`,`parameter_name`,`parameter_value`) VALUES(17,'officeId',1); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V345__reports_for_self_service_user.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V345__reports_for_self_service_user.sql deleted file mode 100644 index 813acde2b..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V345__reports_for_self_service_user.sql +++ /dev/null @@ -1,28 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `stretchy_report` - ADD COLUMN `self_service_user_report` tinyint NOT NULL DEFAULT '0' AFTER `use_report`; - - -UPDATE `stretchy_parameter` SET `parameter_sql`='select sp.parameter_name, sp.parameter_variable, sp.parameter_label, sp.parameter_displayType, \r sp.parameter_FormatType, sp.parameter_default, sp.selectOne, sp.selectAll, spp.parameter_name as parentParameterName\r from stretchy_parameter sp\r left join stretchy_parameter spp on spp.id = sp.parent_id\r where sp.special is null\r and exists \r (select \'f\' \r from stretchy_report sr\r join stretchy_report_parameter srp on srp.report_id = sr.id and sr.self_service_user_report = \'${isSelfServiceUser}\'\r where sr.report_name in(${reportListing})\r and srp.parameter_id = sp.id\r )\r order by sp.id' WHERE `parameter_name` = 'FullParameterList'; - -UPDATE `stretchy_parameter` SET `parameter_sql`='select r.id as report_id, r.report_name, r.report_type, r.report_subtype, r.report_category,\nrp.id as parameter_id, rp.report_parameter_name, p.parameter_name\n from stretchy_report r\n left join stretchy_report_parameter rp on rp.report_id = r.id \n left join stretchy_parameter p on p.id = rp.parameter_id\n where r.use_report is true and r.self_service_user_report = \'${isSelfServiceUser}\'\n and exists\n ( select \'f\'\n from m_appuser_role ur \n join m_role r on r.id = ur.role_id\n join m_role_permission rp on rp.role_id = r.id\n join m_permission p on p.id = rp.permission_id\n where ur.appuser_id = ${currentUserId}\n and (p.code in (\'ALL_FUNCTIONS_READ\', \'ALL_FUNCTIONS\') or p.code = concat("READ_", r.report_name)) )\n order by r.report_category, r.report_name, rp.id' WHERE `parameter_name` = 'FullReportList'; - -UPDATE `stretchy_parameter` SET `parameter_sql`='select r.id as report_id, r.report_name, r.report_type, r.report_subtype, r.report_category,\n rp.id as parameter_id, rp.report_parameter_name, p.parameter_name\n from stretchy_report r\n left join stretchy_report_parameter rp on rp.report_id = r.id\n left join stretchy_parameter p on p.id = rp.parameter_id\n where r.report_category = \'${reportCategory}\'\n and r.use_report is true and r.self_service_user_report = \'${isSelfServiceUser}\' \n and exists\n (select \'f\'\n from m_appuser_role ur \n join m_role r on r.id = ur.role_id\n join m_role_permission rp on rp.role_id = r.id\n join m_permission p on p.id = rp.permission_id\n where ur.appuser_id = ${currentUserId}\n and (p.code in (\'ALL_FUNCTIONS_READ\', \'ALL_FUNCTIONS\') or p.code = concat("READ_", r.report_name)) )\n order by r.report_category, r.report_name, rp.id' WHERE `parameter_name`='reportCategoryList'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V346__nullable_saving_product_description.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V346__nullable_saving_product_description.sql deleted file mode 100644 index 887657119..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V346__nullable_saving_product_description.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_savings_product` MODIFY `description` VARCHAR(500) NULL DEFAULT NULL; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V347__correcting_report_category.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V347__correcting_report_category.sql deleted file mode 100644 index 028b67284..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V347__correcting_report_category.sql +++ /dev/null @@ -1,31 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -UPDATE IGNORE stretchy_report s1 -JOIN stretchy_report s2 ON s2.id = s1.id AND s2.report_category='Clients' SET s1.report_category = 'Client'; - - -UPDATE IGNORE stretchy_report s1 -JOIN stretchy_report s2 ON s2.id = s1.id AND s2.report_category='Loans' SET s1.report_category = 'Loan'; - -UPDATE IGNORE stretchy_report s1 -JOIN stretchy_report s2 ON s2.id = s1.id AND s2.report_category='Saving' SET s1.report_category = 'Savings'; - -UPDATE IGNORE stretchy_report s1 -JOIN stretchy_report s2 ON s2.id = s1.id AND s2.report_category='Funds' SET s1.report_category = 'Fund'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V348__m_trial_balance_table.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V348__m_trial_balance_table.sql deleted file mode 100644 index f0d7f4c35..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V348__m_trial_balance_table.sql +++ /dev/null @@ -1,36 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_trial_balance` ( - `office_id` BIGINT NOT NULL, - `account_id` BIGINT NOT NULL, - `amount` DECIMAL(19,6) NOT NULL, - `entry_date` DATE NOT NULL, - `created_date` DATE NULL, - `closing_balance` DECIMAL(19,6) NOT NULL -); - - -INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Update Trial Balance Details', 'Update Trial Balance Details', '0 1 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 0, 0); - -ALTER TABLE acc_gl_journal_entry ADD transaction_date date; - -ALTER TABLE acc_gl_journal_entry ADD INDEX transaction_date_index (transaction_date); - -UPDATE `acc_gl_journal_entry` SET transaction_date=DATE(created_date); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V349__client_transfer_details.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V349__client_transfer_details.sql deleted file mode 100644 index 1fdedda78..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V349__client_transfer_details.sql +++ /dev/null @@ -1,41 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_client` - ADD COLUMN `proposed_transfer_date` DATE NULL DEFAULT NULL AFTER `email_address`; - - CREATE TABLE `m_client_transfer_details` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `client_id` BIGINT NOT NULL, - `from_office_id` BIGINT NOT NULL, - `to_office_id` BIGINT NOT NULL, - `proposed_transfer_date` DATE NULL DEFAULT NULL, - `transfer_type` TINYINT NOT NULL, - `submitted_on` DATE NOT NULL, - `submitted_by` BIGINT NOT NULL, - PRIMARY KEY (`id`), - INDEX `FK_m_client_transfer_details_m_client` (`client_id`), - INDEX `FK_m_client_transfer_details_m_office` (`from_office_id`), - INDEX `FK_m_client_transfer_details_m_office_2` (`to_office_id`), - INDEX `FK_m_client_transfer_details_m_appuser` (`submitted_by`), - CONSTRAINT `FK_m_client_transfer_details_m_appuser` FOREIGN KEY (`submitted_by`) REFERENCES `m_appuser` (`id`), - CONSTRAINT `FK_m_client_transfer_details_m_client` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`), - CONSTRAINT `FK_m_client_transfer_details_m_office` FOREIGN KEY (`from_office_id`) REFERENCES `m_office` (`id`), - CONSTRAINT `FK_m_client_transfer_details_m_office_2` FOREIGN KEY (`to_office_id`) REFERENCES `m_office` (`id`) -); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V34__add_unique_check_on_stretchy_report_parameter.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V34__add_unique_check_on_stretchy_report_parameter.sql deleted file mode 100644 index e2706414a..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V34__add_unique_check_on_stretchy_report_parameter.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE stretchy_report_parameter - ADD UNIQUE INDEX `report_parameter_unique` (`report_id` ASC, `parameter_id` ASC) ; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V350__email_from.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V350__email_from.sql deleted file mode 100644 index 7840e89c6..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V350__email_from.sql +++ /dev/null @@ -1,41 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -INSERT INTO `c_external_service_properties` (`name`, `value`, `external_service_id`) - -(SELECT - 'fromEmail' as name, - value as value, - c_external_service.id as external_service_id - FROM c_external_service_properties - JOIN c_external_service ON c_external_service_properties.external_service_id=c_external_service.id -WHERE c_external_service_properties.name='username' - AND c_external_service.name='SMTP_Email_Account') - - UNION ALL - -(SELECT - 'fromName' as name, - value as value, - c_external_service.id as external_service_id - FROM c_external_service_properties - JOIN c_external_service ON c_external_service_properties.external_service_id=c_external_service.id -WHERE c_external_service_properties.name='username' - AND c_external_service.name='SMTP_Email_Account'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V351__pocket_mapping.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V351__pocket_mapping.sql deleted file mode 100644 index 5d2c08e8f..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V351__pocket_mapping.sql +++ /dev/null @@ -1,40 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_pocket` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `app_user_id` BIGINT NOT NULL, - PRIMARY KEY (`id`), - UNIQUE INDEX `app_user_id` (`app_user_id`), - CONSTRAINT `FK__m_appuser__pocket` FOREIGN KEY (`app_user_id`) REFERENCES `m_appuser` (`id`) -); - -CREATE TABLE `m_pocket_accounts_mapping` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `pocket_id` BIGINT NOT NULL, - `account_id` BIGINT NOT NULL, - `account_type` INT NOT NULL, - `account_number` VARCHAR(20) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE INDEX `unique_pocket_mapping` (`pocket_id`, `account_id`, `account_type`), - CONSTRAINT `FK__m_pocket` FOREIGN KEY (`pocket_id`) REFERENCES `m_pocket` (`id`) -); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'LINK_ACCOUNT_TO_POCKET', 'POCKET', 'LINK_ACCOUNT_TO', 0), -('portfolio', 'DELINK_ACCOUNT_FROM_POCKET', 'POCKET', 'DELINK_ACCOUNT_FROM', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V352__interop_init.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V352__interop_init.sql deleted file mode 100644 index 0b0ce6f25..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V352__interop_init.sql +++ /dev/null @@ -1,86 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -DROP TABLE IF EXISTS `interop_identifier`; -CREATE TABLE `interop_identifier` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `account_id` BIGINT NOT NULL, - `type` VARCHAR(32) NOT NULL, - `a_value` VARCHAR(128) NOT NULL, - `sub_value_or_type` VARCHAR(128) NULL, - `created_by` VARCHAR(32) NOT NULL, - `created_on` TIMESTAMP NOT NULL, - `modified_by` VARCHAR(32) NULL, - `modified_on` TIMESTAMP NULL, - PRIMARY KEY (`id`), - UNIQUE INDEX `uk_interop_identifier_account` (`account_id`, `type`), - UNIQUE INDEX `uk_interop_identifier_value` (`type`, `a_value`, `sub_value_or_type`), - INDEX `fk_interop_identifier_account` (`account_id`), - CONSTRAINT `fk_interop_identifier_account` FOREIGN KEY (`account_id`) REFERENCES `m_savings_account` (`id`) -) - COLLATE = 'utf8mb4_general_ci' - ENGINE = InnoDB; - --- user+roles - -SET @interop_username = 'interopUser'; -INSERT INTO `m_appuser` -VALUES (NULL, 0, 1, NULL, @interop_username, 'Interop', 'User', '5787039480429368bf94732aacc771cd0a3ea02bcf504ffe1185ab94213bc63a', - 'email@email.com', b'0', b'1', b'1', b'1', b'1', CURDATE(), 0, b'0'); - -INSERT INTO `m_appuser_role` VALUES ((SELECT id FROM m_appuser WHERE username COLLATE utf8mb4_general_ci = @interop_username), 1); - --- Interoperation permissions - -INSERT INTO m_permission (`grouping`, code, entity_name, action_name, can_maker_checker) -VALUES ('interop', 'READ_INTERID', 'INTERID', 'READ', 0); -INSERT INTO m_permission (`grouping`, code, entity_name, action_name, can_maker_checker) -VALUES ('interop', 'READ_INTERREQUEST', 'INTERREQUEST', 'READ', 0); -INSERT INTO m_permission (`grouping`, code, entity_name, action_name, can_maker_checker) -VALUES ('interop', 'READ_INTERQUOTE', 'INTERQUOTE', 'READ', 0); -INSERT INTO m_permission (`grouping`, code, entity_name, action_name, can_maker_checker) -VALUES ('interop', 'READ_INTERTRANSFER', 'INTERTRANSFER', 'READ', 0); - -INSERT INTO m_permission (`grouping`, code, entity_name, action_name, can_maker_checker) -VALUES ('interop', 'PREPARE_INTERTRANSFER', 'INTERTRANSFER', 'PREPARE', 0); - -INSERT INTO m_permission (`grouping`, code, entity_name, action_name, can_maker_checker) -VALUES ('interop', 'RELEASE_INTERTRANSFER', 'INTERTRANSFER', 'RELEASE', 0); - -INSERT INTO m_permission (`grouping`, code, entity_name, action_name, can_maker_checker) -VALUES ('interop', 'CREATE_INTERID', 'INTERID', 'CREATE', 0); -INSERT INTO m_permission (`grouping`, code, entity_name, action_name, can_maker_checker) -VALUES ('interop', 'CREATE_INTERREQUEST', 'INTERREQUEST', 'CREATE', 0); -INSERT INTO m_permission (`grouping`, code, entity_name, action_name, can_maker_checker) -VALUES ('interop', 'CREATE_INTERQUOTE', 'INTERQUOTE', 'CREATE', 0); -INSERT INTO m_permission (`grouping`, code, entity_name, action_name, can_maker_checker) -VALUES ('interop', 'CREATE_INTERTRANSFER', 'INTERTRANSFER', 'CREATE', 0); - -INSERT INTO m_permission (`grouping`, code, entity_name, action_name, can_maker_checker) -VALUES ('interop', 'DELETE_INTERID', 'INTERID', 'DELETE', 0); - - -INSERT IGNORE INTO m_code (code_name, is_system_defined) VALUES ('PaymentType', 1); - -SET @code_id = -1; -SELECT id FROM m_code WHERE code_name = 'PaymentType' INTO @code_id; - -INSERT IGNORE INTO m_code_value (code_id, code_value, order_position) VALUES (@code_id, 'Money Transfer', 1); - -INSERT IGNORE INTO m_payment_type (value, description, order_position) VALUES ('Money Transfer', 'Money Transfer', 1); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V353__migrate_passwords_to_ss_5.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V353__migrate_passwords_to_ss_5.sql deleted file mode 100644 index bfd23a567..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V353__migrate_passwords_to_ss_5.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -UPDATE m_appuser SET password = CONCAT('{SHA-256}{', id, '}', password) WHERE password NOT LIKE '{%'; -UPDATE oauth_client_details SET client_secret = CONCAT('{SHA-256}', SHA2(client_secret, 256)) WHERE client_secret NOT LIKE '{%'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V354__self_service_user_unique_for_client.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V354__self_service_user_unique_for_client.sql deleted file mode 100644 index 5f2333497..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V354__self_service_user_unique_for_client.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_selfservice_user_client_mapping` ADD CONSTRAINT `unique_self_client` UNIQUE (`client_id`); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V355__rates.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V355__rates.sql deleted file mode 100644 index 820737467..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V355__rates.sql +++ /dev/null @@ -1,67 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE IF NOT EXISTS `m_rate` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `name` varchar(250) NOT NULL, - `percentage` decimal(10,2) NOT NULL, - `active` tinyint DEFAULT '0', - `product_apply` SMALLINT NOT NULL, - `created_date` datetime NULL DEFAULT NULL, - `createdby_id` BIGINT NOT NULL, - `lastmodifiedby_id` BIGINT NOT NULL, - `lastmodified_date` datetime NULL DEFAULT NULL, - `approve_user` BIGINT DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `FK_M_RATE_CREATE_USER` (`createdby_id`), - KEY `FK_M_RATE_APPROVE_USER` (`approve_user`), - CONSTRAINT `FK_M_RATE_APPROVE_USER` FOREIGN KEY (`approve_user`) REFERENCES `m_appuser` (`id`), - CONSTRAINT `FK_M_RATE_CREATE_USER` FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`) -); - - -CREATE TABLE IF NOT EXISTS `m_loan_rate` ( - `loan_id` BIGINT NOT NULL, - `rate_id` BIGINT NOT NULL, - PRIMARY KEY (`loan_id`,`rate_id`), - KEY `FK_M_LOAN_RATE_RATE` (`rate_id`), - CONSTRAINT `FK_M_LOAN_RATE_LOAN` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`), - CONSTRAINT `FK_M_LOAN_RATE_RATE` FOREIGN KEY (`rate_id`) REFERENCES `m_rate` (`id`) -); - - -CREATE TABLE IF NOT EXISTS `m_product_loan_rate` ( - `product_loan_id` BIGINT NOT NULL, - `rate_id` BIGINT NOT NULL, - PRIMARY KEY (`product_loan_id`,`rate_id`), - KEY `FK_M_PRODUCT_LOAN_RATE_RATE` (`rate_id`), - CONSTRAINT `FK_M_PRODUCT_LOAN_RATE_LOAN` FOREIGN KEY (`product_loan_id`) REFERENCES `m_product_loan` (`id`), - CONSTRAINT `FK_M_PRODUCT_LOAN_RATE_RATE` FOREIGN KEY (`rate_id`) REFERENCES `m_rate` (`id`) -); - - -INSERT INTO `m_permission` -(`grouping`,`code`,`entity_name`,`action_name`,`can_maker_checker`) VALUES - ('organisation', 'READ_RATE', 'RATE', 'CREATE', '1'), - ('organisation', 'CREATE_RATE', 'RATE', 'CREATE', '1'), - ('organisation', 'UPDATE_RATE', 'RATE', 'UPDATE', '1'); - -INSERT INTO `c_configuration` -(`name`, `value`, `enabled`, `is_trap_door`, `description`) VALUES -('sub-rates', 0, 0, 0, 'Enable Rates Module'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V356__GSIM_migration_script.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V356__GSIM_migration_script.sql deleted file mode 100644 index 2cd1a7635..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V356__GSIM_migration_script.sql +++ /dev/null @@ -1,63 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - --- permissions added - - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'CREATE_GSIMACCOUNT', 'GSIMACCOUNT', 'CREATE', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'APPROVE_GSIMACCOUNT', 'GSIMACCOUNT', 'APPROVE', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'ACTIVATE_GSIMACCOUNT', 'GSIMACCOUNT', 'ACTIVATE', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'APPROVALUNDO_GSIMACCOUNT', 'GSIMACCOUNT', 'APPROVALUNDO', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATE_GSIMACCOUNT', 'GSIMACCOUNT', 'UPDATE', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'REJECT_GSIMACCOUNT', 'GSIMACCOUNT', 'REJECT', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'DEPOSIT_GSIMACCOUNT', 'GSIMACCOUNT', 'DEPOSIT', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'CLOSE_GSIMACCOUNT', 'GSIMACCOUNT', 'CLOSE', 0); - - --- new gsim table -CREATE TABLE `gsim_accounts` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `group_id` BIGINT NOT NULL DEFAULT '0', - `account_number` VARCHAR(50) NOT NULL, - `parent_deposit` DECIMAL(19,6) NOT NULL DEFAULT '0.000000', - `child_accounts_count` INT NOT NULL, - `accepting_child` TINYINT NOT NULL DEFAULT '0', - `savings_status_id` SMALLINT NOT NULL DEFAULT '0', - `application_id` DECIMAL(10,0) NULL DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE INDEX `gsim_account_no_UNIQUE` (`account_number`), - INDEX `FK_gsim_group_id` (`group_id`), - CONSTRAINT `FK_gsim_group_id` FOREIGN KEY (`group_id`) REFERENCES `m_group` (`id`) -); - - -- changes to savings - ALTER TABLE `m_savings_account` ADD COLUMN `gsim_id` BIGINT DEFAULT NULL AFTER `group_id`; - - ALTER TABLE `m_savings_account` ADD CONSTRAINT `FK_gsim_id` FOREIGN KEY (`gsim_id`) REFERENCES `gsim_accounts` (`id`); - - -- changes to savings_Transaction - ALTER TABLE `m_savings_account_transaction` ADD COLUMN `is_loan_disbursement` BIGINT; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V357__GLIM_migration_script.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V357__GLIM_migration_script.sql deleted file mode 100644 index 08799ba0f..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V357__GLIM_migration_script.sql +++ /dev/null @@ -1,52 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - - --- permissions added - - INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'APPROVE_GLIMLOAN', 'GLIMLOAN', 'APPROVE', 0); - INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'DISBURSE_GLIMLOAN', 'GLIMLOAN', 'DISBURSE', 0); - INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'REPAYMENT_GLIMLOAN', 'GLIMLOAN', 'REPAYMENT', 0); - INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UNDODISBURSAL_GLIMLOAN', 'GLIMLOAN', 'UNDODISBURSAL', 0); - INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UNDOAPPROVAL_GLIMLOAN', 'GLIMLOAN', 'UNDOAPPROVAL', 0); - INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'REJECT_GLIMLOAN', 'GLIMLOAN', 'REJECT', 0); - - -- new table glim_accounts added - - CREATE TABLE `glim_accounts` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `group_id` BIGINT NOT NULL DEFAULT '0', - `account_number` VARCHAR(50) NOT NULL, - `principal_amount` DECIMAL(19,6) NOT NULL DEFAULT '0.000000', - `child_accounts_count` INT NOT NULL, - `accepting_child` TINYINT NOT NULL DEFAULT '0', - `loan_status_id` SMALLINT NOT NULL DEFAULT '0', - `application_id` DECIMAL(10,0) NULL DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE INDEX `glim_account_no_UNIQUE` (`account_number`), - INDEX `FK_group_id` (`group_id`), - CONSTRAINT `FK_group_id` FOREIGN KEY (`group_id`) REFERENCES `m_group` (`id`) -); - - -- change m_loan table - - alter table `m_loan` add COLUMN `glim_id` BIGINT DEFAULT NULL AFTER `group_id`; - - alter table `m_loan` add CONSTRAINT `FK_glim_id` FOREIGN KEY (`glim_id`) REFERENCES `glim_accounts` (`id`); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V358__fixed_deposit_rollover_transfer.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V358__fixed_deposit_rollover_transfer.sql deleted file mode 100644 index dc86b3ba3..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V358__fixed_deposit_rollover_transfer.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -alter table m_deposit_account_term_and_preclosure add column transfer_to_savings_account_id bigint(20) DEFAULT NULL, -add CONSTRAINT FOREIGN KEY (`transfer_to_savings_account_id`) REFERENCES `m_savings_account` (`id`); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V359__remove_fied_from_address.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V359__remove_fied_from_address.sql deleted file mode 100644 index 60836047f..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V359__remove_fied_from_address.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -DELETE FROM `m_field_configuration` WHERE field = 'street'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V35__add_hierarchy_column_for_acc_gl_account.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V35__add_hierarchy_column_for_acc_gl_account.sql deleted file mode 100644 index 95e6facd5..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V35__add_hierarchy_column_for_acc_gl_account.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `acc_gl_account` ADD COLUMN `hierarchy` varchar(50) AFTER `parent_id`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V360__conf_loan_payday_on_holiday.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V360__conf_loan_payday_on_holiday.sql deleted file mode 100644 index a10d0f00f..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V360__conf_loan_payday_on_holiday.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `c_configuration` (`name`, `value`, `date_value`, `enabled`, `is_trap_door`, `description`) -VALUES - ('loan-reschedule-is-first-payday-allowed-on-holiday', 0, NULL, 0, 0, 'If enabled, while loan reschedule the first repayment date can be on a holiday/non working day'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V361__conf_interest_appropriations.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V361__conf_interest_appropriations.sql deleted file mode 100644 index a301631bc..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V361__conf_interest_appropriations.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `c_configuration` (`name`, `value`, `date_value`, `enabled`, `is_trap_door`, `description`) -VALUES - ('is-interest-to-be-appropriated-equally-when-greater-than-emi', 0, NULL, 0, 0, 'If enabled, while loan reschedule when interest amount is greater than EMI, the additional interest is spread equally over remaining installments'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V362__reschedule_interest_to_lrs.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V362__reschedule_interest_to_lrs.sql deleted file mode 100644 index e37caf32f..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V362__reschedule_interest_to_lrs.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -alter table m_loan_repayment_schedule - add column `reschedule_interest_portion` decimal(19,6) DEFAULT NULL after `accrual_interest_derived`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V363__mnote_indexing_for_performance.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V363__mnote_indexing_for_performance.sql deleted file mode 100644 index a2e2ee8ae..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V363__mnote_indexing_for_performance.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_note` - ADD INDEX `savings_account_transaction_id` (`savings_account_transaction_id`); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V364__elastic_hook_template.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V364__elastic_hook_template.sql deleted file mode 100644 index 1e158ecbd..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V364__elastic_hook_template.sql +++ /dev/null @@ -1,33 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -INSERT INTO m_hook_templates -( name) -VALUES('Elastic Search'); - -INSERT INTO m_hook_schema -(hook_template_id, field_type, field_name, placeholder, optional) -VALUES( (select id from m_hook_templates mht where name = 'Elastic Search'), 'string', 'Payload URL', 'http:////', 0); -INSERT INTO m_hook_schema -( hook_template_id, field_type, field_name, placeholder, optional) -VALUES( (select id from m_hook_templates mht where name = 'Elastic Search'), 'string', 'Content Type', 'json', 0); -INSERT INTO m_hook_schema -( hook_template_id, field_type, field_name, placeholder, optional) -VALUES( (select id from m_hook_templates mht where name = 'Elastic Search'), 'string', 'Index Name', NULL, 1); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V365__reportCategoryList-FINERACT-1306.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V365__reportCategoryList-FINERACT-1306.sql deleted file mode 100644 index 70ffd5df9..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V365__reportCategoryList-FINERACT-1306.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - --- two tables added: ReportCategoryList and FullReportList (FINERACT-1306) -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report)VALUES ("ReportCategoryList", 'Table', '(NULL)', '(NULL)', '(NULL)', 1, 1); -INSERT INTO stretchy_report (report_name, report_type, report_category, report_sql, description, core_report, use_report)VALUES ("FullReportList", 'Table', '(NULL)', '(NULL)', '(NULL)', 1, 1); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V366_remove_leading_or_trailing_spaces_in_reportnames.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V366_remove_leading_or_trailing_spaces_in_reportnames.sql deleted file mode 100644 index a29cd1eea..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V366_remove_leading_or_trailing_spaces_in_reportnames.sql +++ /dev/null @@ -1,23 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -UPDATE stretchy_report SET report_name = TRIM(report_name) WHERE id IN -(SELECT id FROM -( SELECT id FROM stretchy_report WHERE CHAR_LENGTH(report_name) != CHAR_LENGTH(TRIM(report_name)))Y -); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V367__reports_for_email_campaigns.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V367__reports_for_email_campaigns.sql deleted file mode 100644 index 86a97fc87..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V367__reports_for_email_campaigns.sql +++ /dev/null @@ -1,26 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_sql`, `description`, `core_report`, `use_report`, `self_service_user_report`) VALUES ('Loan Approved - Email', 'Email', 'Triggered', 'select ml.id as loanId, ifnull(mc.id,mc2.id) as id, ifnull(mc.firstname,mc2.firstname) as firstname, \nifnull(mc.middlename,ifnull(mc2.middlename,(\'\'))) as middlename, ifnull(mc.lastname,mc2.lastname) as lastname, \nifnull(mc.display_name,mc2.display_name) as display_name, ifnull(mc.status_enum,mc2.status_enum) as status_enum, \nifnull(mc.mobile_no,mc2.mobile_no) as mobile_no, ifnull(mg.office_id,mc2.office_id) as office_id, ifnull(mg.staff_id,mc2.staff_id) as staff_id, \nmg.id as group_id, mg.display_name as group_name, ifnull(mc.email_address,mc2.email_address) as emailAddress\nfrom m_loan ml left join m_group mg on mg.id = ml.group_id \nleft join m_group_client mgc on mgc.group_id = mg.id \nleft join m_client mc on mc.id = mgc.client_id \nleft join m_client mc2 on mc2.id = ml.client_id\nWHERE (mc.status_enum = 300 or mc2.status_enum = 300) and (mc.email_address is not null or mc2.email_address is not null) and ml.id = ${loanId}\n', 'Loan and client data of approved loan', '0', '1', '0'); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_sql`, `description`, `core_report`, `use_report`, `self_service_user_report`) VALUES ('Loan Rejected - Email', 'Email', 'Triggered', 'select ml.id as loanId, ifnull(mc.id,mc2.id) as id, ifnull(mc.firstname,mc2.firstname) as firstname, \nifnull(mc.middlename,ifnull(mc2.middlename,(\'\'))) as middlename, ifnull(mc.lastname,mc2.lastname) as lastname, \nifnull(mc.display_name,mc2.display_name) as display_name, ifnull(mc.status_enum,mc2.status_enum) as status_enum, \nifnull(mc.mobile_no,mc2.mobile_no) as mobile_no, ifnull(mg.office_id,mc2.office_id) as office_id, ifnull(mg.staff_id,mc2.staff_id) as staff_id, \nmg.id as group_id, mg.display_name as group_name, ifnull(mc.email_address,mc2.email_address) as emailAddress\nfrom m_loan ml left join m_group mg on mg.id = ml.group_id \nleft join m_group_client mgc on mgc.group_id = mg.id \nleft join m_client mc on mc.id = mgc.client_id \nleft join m_client mc2 on mc2.id = ml.client_id\nWHERE (mc.status_enum = 300 or mc2.status_enum = 300) and (mc.email_address is not null or mc2.email_address is not null) and ml.id = ${loanId}\n', 'Loan and client data of rejected loan', '0', '1', '0'); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_sql`, `description`, `core_report`, `use_report`, `self_service_user_report`) VALUES ('Loan Repayment - Email', 'Email', 'Triggered', 'select ml.id as loanId, ifnull(mc.id,mc2.id) as id, ifnull(mc.firstname,mc2.firstname) as firstname, \nifnull(mc.middlename,ifnull(mc2.middlename,(\'\'))) as middlename, ifnull(mc.lastname,mc2.lastname) as lastname, \nifnull(mc.display_name,mc2.display_name) as display_name, ifnull(mc.status_enum,mc2.status_enum) as status_enum, \nifnull(mc.mobile_no,mc2.mobile_no) as mobile_no, ifnull(mg.office_id,mc2.office_id) as office_id, ifnull(mg.staff_id,mc2.staff_id) as staff_id, \nmg.id as group_id, mg.display_name as group_name, ifnull(mc.email_address,mc2.email_address) as emailAddress, lt.amount as repaymentAmount \nfrom m_loan_transaction lt join m_loan ml on ml.id=lt.loan_id left join m_group mg on mg.id = ml.group_id \nleft join m_group_client mgc on mgc.group_id = mg.id \nleft join m_client mc on mc.id = mgc.client_id \nleft join m_client mc2 on mc2.id = ml.client_id\nWHERE (mc.status_enum = 300 or mc2.status_enum = 300) and (mc.email_address is not null or mc2.email_address is not null) and ml.id = ${loanId} and lt.id = ${loanTransactionId}\n', 'Loan and client data of rejected loan', '0', '1', '0'); - -ALTER TABLE `scheduled_email_campaign` -CHANGE COLUMN `email_attachment_file_format` `email_attachment_file_format` VARCHAR(10) NULL , -CHANGE COLUMN `stretchy_report_id` `stretchy_report_id` INT(11) NULL ; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V368__collateral_management.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V368__collateral_management.sql deleted file mode 100644 index 40ec486db..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V368__collateral_management.sql +++ /dev/null @@ -1,73 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - --- create collateral management table -CREATE TABLE IF NOT EXISTS `m_collateral_management` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `name` varchar(50) NOT NULL, - `quality` varchar(40) NOT NULL, - `base_price` decimal(20,5) NOT NULL, - `unit_type` varchar(10) NOT NULL, - `pct_to_base` decimal(20,5) NOT NULL, - `currency` bigint(20) DEFAULT NULL, - PRIMARY KEY (`id`) USING BTREE, - KEY `fkCurrencyCode` (`currency`), - CONSTRAINT `fkCurrencyCode` FOREIGN KEY (`currency`) REFERENCES `m_currency` (`id`) ON DELETE CASCADE -); - --- create client collateral management -CREATE TABLE IF NOT EXISTS `m_client_collateral_management` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `quantity` decimal(20,5) NOT NULL, - `client_id` bigint(20) DEFAULT NULL, - `collateral_id` bigint(20) DEFAULT NULL, - PRIMARY KEY (`id`) USING BTREE, - KEY `fkClient` (`client_id`), - KEY `fkCollateral` (`collateral_id`), - CONSTRAINT `fkClient` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `fkCollateral` FOREIGN KEY (`collateral_id`) REFERENCES `m_collateral_management` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -); - - --- create loan collateral management -CREATE TABLE IF NOT EXISTS `m_loan_collateral_management` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `quantity` decimal(20,5) NOT NULL, - `loan_id` bigint(20) DEFAULT NULL, - `client_collateral_id` bigint(20) DEFAULT NULL, - `is_released` tinyint(4) DEFAULT '0', - `transaction_id` bigint(20) DEFAULT NULL, - PRIMARY KEY (`id`) USING BTREE, - KEY `fkLoan` (`loan_id`), - KEY `fkTransaction` (`transaction_id`), - KEY `fkClientCollateral` (`client_collateral_id`), - CONSTRAINT `fkClientCollateral` FOREIGN KEY (`client_collateral_id`) REFERENCES `m_client_collateral_management` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `fkLoan` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `fkTransaction` FOREIGN KEY (`transaction_id`) REFERENCES `m_loan_transaction` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -); - -INSERT INTO `m_permission` -(`grouping`,`code`,`entity_name`,`action_name`,`can_maker_checker`) VALUES -('portfolio', 'CREATE_CLIENT_COLLATERAL_PRODUCT', 'CLIENT_COLLATERAL_PRODUCT', 'CREATE', '0'), -('portfolio', 'CREATE_COLLATERAL_PRODUCT', 'COLLATERAL_PRODUCT', 'CREATE', '0'), -('portfolio', 'DELETE_CLIENT_COLLATERAL_PRODUCT', 'CLIENT_COLLATERAL_PRODUCT', 'DELETE', '0'), -('portfolio', 'DELETE_COLLATERAL_PRODUCT', 'COLLATERAL_PRODUCT', 'DELETE', '0'), -('portfolio', 'DELETE_LOAN_COLLATERAL_PRODUCT', 'LOAN_COLLATERAL_PRODUCT', 'DELETE', '0'), -('portfolio', 'UPDATE_CLIENT_COLLATERAL_PRODUCT', 'CLIENT_COLLATERAL_PRODUCT', 'UPDATE', '0'), -('portfolio', 'UPDATE_COLLATERAL_PRODUCT', 'COLLATERAL_PRODUCT', 'UPDATE', '0'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V369__repayment_with_post_dated_checks.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V369__repayment_with_post_dated_checks.sql deleted file mode 100644 index 61f7ca60f..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V369__repayment_with_post_dated_checks.sql +++ /dev/null @@ -1,40 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - --- create m_repayment_with_post_dated_checks management -CREATE TABLE `m_repayment_with_post_dated_checks` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `check_no` bigint(20) NOT NULL UNIQUE, - `amount` decimal(20,5) NOT NULL, - `loan_id` bigint(20) DEFAULT NULL, - `repayment_id` bigint(20) DEFAULT NULL, - `account_no` bigint(20) NOT NULL, - `bank_name` VARCHAR(200) NOT NULL, - `repayment_date` DATE NOT NULL, - `status` SMALLINT(1) DEFAULT 0, - PRIMARY KEY (`id`) USING BTREE, - CONSTRAINT `fkloanrepayment` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `fkrepaymentwithpostdated` FOREIGN KEY (`repayment_id`) REFERENCES `m_loan_repayment_schedule` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -); - -INSERT INTO `m_permission` -(`grouping`,`code`,`entity_name`,`action_name`,`can_maker_checker`) VALUES -('portfolio', 'UPDATE_REPAYMENT_WITH_POSTDATEDCHECKS', 'REPAYMENT_WITH_POSTDATEDCHECKS', 'UPDATE', '0'), -('portfolio', 'DELETE_REPAYMENT_WITH_POSTDATEDCHECKS', 'REPAYMENT_WITH_POSTDATEDCHECKS', 'DELETE', '0'), -('portfolio', 'BOUNCE_REPAYMENT_WITH_POSTDATEDCHECKS', 'REPAYMENT_WITH_POSTDATEDCHECKS', 'BOUNCE', '0'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V36__add_tag_id_column_for_acc_gl_account.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V36__add_tag_id_column_for_acc_gl_account.sql deleted file mode 100644 index eb6e1c7dc..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V36__add_tag_id_column_for_acc_gl_account.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `acc_gl_account` -ADD COLUMN `tag_id` INT NULL DEFAULT NULL AFTER `classification_enum`, -ADD INDEX `FKGLACC000000002` (`tag_id`), -ADD CONSTRAINT `FKGLACC000000002` FOREIGN KEY (`tag_id`) REFERENCES `m_code_value` (`id`); -INSERT into m_code(`code_name`,`is_system_defined`) values ('AssetAccountTags',1),('LiabilityAccountTags',1),('EquityAccountTags',1),('IncomeAccountTags',1),('ExpenseAccountTags',1); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V370__message_gateway_hook_template.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V370__message_gateway_hook_template.sql deleted file mode 100644 index 346c88a2e..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V370__message_gateway_hook_template.sql +++ /dev/null @@ -1,27 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -INSERT INTO m_hook_templates -( name) -VALUES('Message Gateway'); - -INSERT INTO m_hook_schema -(hook_template_id, field_type, field_name, placeholder, optional) -VALUES( (select id from m_hook_templates where name = 'Message Gateway'), 'string', 'SMS Provider Id', NULL, 0);; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V371__loan_net_disbursal_amount.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V371__loan_net_disbursal_amount.sql deleted file mode 100644 index 456fa7afc..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V371__loan_net_disbursal_amount.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_loan` ADD COLUMN `net_disbursal_amount` DECIMAL(19,6) NOT NULL AFTER `approved_principal`; -ALTER TABLE `m_loan_disbursement_detail` ADD COLUMN `net_disbursal_amount` DECIMAL(19,6); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V372__fixed_principal_percentage.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V372__fixed_principal_percentage.sql deleted file mode 100644 index a22a4ddae..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V372__fixed_principal_percentage.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -alter table m_product_loan add column fixed_principal_percentage_per_installment decimal(5,2) DEFAULT NULL; -alter table m_loan add column fixed_principal_percentage_per_installment decimal(5,2) DEFAULT NULL; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V373__node_aware_scheduler_jobs.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V373__node_aware_scheduler_jobs.sql deleted file mode 100644 index 9f355213c..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V373__node_aware_scheduler_jobs.sql +++ /dev/null @@ -1,26 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE job ADD COLUMN node_id int; - -UPDATE job SET node_id = 1; - -ALTER TABLE job ADD COLUMN is_mismatched_job TINYINT(1) DEFAULT 1; - -INSERT INTO `job` (`node_id`, `name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`,`is_mismatched_job`) VALUES (0,'Execute All Dirty Jobs', 'Execute All Dirty Jobs', '0 1 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, 'Execute All Dirty JobsJobDetail1 _ DEFAULT', NULL, 1, 0, 1, 0, 0,0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V374__adding_expenseliablity_to_paymentorfeetype.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V374__adding_expenseliablity_to_paymentorfeetype.sql deleted file mode 100644 index 9946bb92a..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V374__adding_expenseliablity_to_paymentorfeetype.sql +++ /dev/null @@ -1,25 +0,0 @@ - -- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `c_configuration` - ADD COLUMN `string_value` VARCHAR(100) NULL DEFAULT NULL AFTER `date_value`; - -insert into c_configuration(name, string_value, enabled, description) values('account-mapping-for-payment-type', 'Asset', 1, 'Asset: default for asset, Use comma seperated values for Liability, Asset and Expense accounts'); - -insert into c_configuration(name, string_value, enabled, description) values('account-mapping-for-charge', 'Income', 1, 'Income: default for Income, Use comma seperated values for Income, Liability and Expense accounts'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V375__transfer_fixed_deposit_interest_next_day_for_period_end_posting.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V375__transfer_fixed_deposit_interest_next_day_for_period_end_posting.sql deleted file mode 100644 index acc20cf2f..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V375__transfer_fixed_deposit_interest_next_day_for_period_end_posting.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -INSERT INTO `c_configuration` (`id`, `name`, `enabled`, `description`) -VALUES (NULL, 'fixed-deposit-transfer-interest-next-day-for-period-end-posting', '0', "Transfer fixed transfer interest next day(t+1) for period end posting"); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V376__savings_last_transaction_date.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V376__savings_last_transaction_date.sql deleted file mode 100644 index 63dc67f44..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V376__savings_last_transaction_date.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE m_savings_account ADD COLUMN interest_posted_till_date DATE NULL DEFAULT NULL; - -insert into c_configuration(name, enabled, value, description) values('allow-backdated-transaction-before-interest-posting', 1, 0, 'Avoid retrieving all transactions in a savings account'); - -insert into c_configuration(name, enabled, value, description) values('allow-backdated-transaction-before-interest-posting-date-for-days', 0, 0, 'One time configuration to relax the backdated transactions'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V377__job_prams_for_parallelizing_savings_interest_posting.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V377__job_prams_for_parallelizing_savings_interest_posting.sql deleted file mode 100644 index 6983df663..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V377__job_prams_for_parallelizing_savings_interest_posting.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -INSERT IGNORE INTO `job_parameters`(`job_id`,`parameter_name`,`parameter_value`) VALUES((select id from job where name = 'Post Interest For Savings'),'thread-pool-size',10); -INSERT IGNORE INTO `job_parameters`(`job_id`,`parameter_name`,`parameter_value`) VALUES((select id from job where name = 'Post Interest For Savings'),'batch-size',100); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V378__configuration_for_variable_length_acoountNumber.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V378__configuration_for_variable_length_acoountNumber.sql deleted file mode 100644 index 45bad58b1..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V378__configuration_for_variable_length_acoountNumber.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO c_configuration ( name, description) VALUES ( 'custom-account-number-length', 'if enabled, the value if this configuration will set accounnumber length'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V379__user_cannot_change_password.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V379__user_cannot_change_password.sql deleted file mode 100644 index 3dc7a25a2..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V379__user_cannot_change_password.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE m_appuser ADD COLUMN cannot_change_password BOOLEAN NULL DEFAULT NULL; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V37__add-center-group-collection-sheet-permissions.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V37__add-center-group-collection-sheet-permissions.sql deleted file mode 100644 index 24c0ab790..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V37__add-center-group-collection-sheet-permissions.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'SAVECOLLECTIONSHEET_GROUP', 'GROUP', 'SAVECOLLECTIONSHEET', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'SAVECOLLECTIONSHEET_CENTER', 'CENTER', 'SAVECOLLECTIONSHEET', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V380__configuration_for_random_account_number.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V380__configuration_for_random_account_number.sql deleted file mode 100644 index 034ec4cc1..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V380__configuration_for_random_account_number.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO c_configuration ( name, description) VALUES ( 'random-account-number', 'if enabled, the client accounts, saving accounts, loan accounts will be created with Random Account Number'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V381__update_currencies_new_currencies.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V381__update_currencies_new_currencies.sql deleted file mode 100644 index 9778053e2..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V381__update_currencies_new_currencies.sql +++ /dev/null @@ -1,28 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_currency` -(`code`,`decimal_places`,`display_symbol`,`name`, `internationalized_name_code`) -VALUES -('SSP',2,'SS£','South Sudanese Pound','currency.SSP'); - -UPDATE `m_currency` SET `name` = 'Eswatini Lilangeni' WHERE `code` = 'SZL' ; - -/***Update organization currencies if applicable***/ -UPDATE m_organisation_currency SET`name` = 'Eswatini Lilangeni' WHERE `code` = 'SZL' ; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V38__add-group-summary-details-report.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V38__add-group-summary-details-report.sql deleted file mode 100644 index 848aca51a..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V38__add-group-summary-details-report.sql +++ /dev/null @@ -1,89 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `core_report`, `use_report`, `description`, `report_sql`) -VALUES ('GroupSummaryDetails', 'Table', true, false, 'Utility query for getting group summary details for a group_id', - -"/* -Active Client is a client linked to the 'group' via m_group_client -and with an active status_enum (not sure what it means if the group is inactive) - -Active Borrowers - Borrow may be a client or a 'group' - -Currency is an outstanding issue - -Couldn't set up group savings for a client -(as opposed to opening a individual clients savings account) -*/ -select x.* -from m_office o, -m_group g, - -(select a.activeClients, -(b.activeClientLoans + c.activeGroupLoans) as activeLoans, -b.activeClientLoans, c.activeGroupLoans, -(b.activeClientBorrowers + c.activeGroupBorrowers) as activeBorrowers, -b.activeClientBorrowers, c.activeGroupBorrowers, d.*, -0 as activeSavings, 0 as totalSavingsAmount -from -(select count(*) as activeClients -from m_group topgroup -join m_group g on g.hierarchy like concat(topgroup.hierarchy, '%') -join m_group_client gc on gc.group_id = g.id -join m_client c on c.id = gc.client_id -where topgroup.id = ${groupId} -and c.status_enum = 300) a, - -(select count(*) as activeClientLoans, -count(distinct(l.client_id)) as activeClientBorrowers -from m_group topgroup -join m_group g on g.hierarchy like concat(topgroup.hierarchy, '%') -join m_loan l on l.group_id = g.id and l.client_id is not null -where topgroup.id = ${groupId} -and l.loan_status_id = 300) b, - -(select count(*) as activeGroupLoans, -count(distinct(l.group_id)) as activeGroupBorrowers -from m_group topgroup -join m_group g on g.hierarchy like concat(topgroup.hierarchy, '%') -join m_loan l on l.group_id = g.id and l.client_id is null -where topgroup.id = ${groupId} -and l.loan_status_id = 300) c, - -(select ifnull(sum(l.principal_disbursed_derived),0) as totalDisbursedAmount, -ifnull(sum(l.principal_outstanding_derived),0) as totalLoanOutstandingAmount, -count(laa.loan_id) as overdueLoans, ifnull(sum(laa.total_overdue_derived), 0) as totalLoanOverdueAmount -from m_group topgroup -join m_group g on g.hierarchy like concat(topgroup.hierarchy, '%') -join m_loan l on l.group_id = g.id -left join m_loan_arrears_aging laa on laa.loan_id = l.id -where topgroup.id = ${groupId} -and l.disbursedon_date is not null) d) x - -where g.id = ${groupId} -and o.id = g.office_id -and o.hierarchy like concat('${currentUserHierarchy}', '%')"); - - - - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'READ_GroupSummaryDetails', 'GroupSummaryDetails', 'READ', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V390__clientdoc-code.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V390__clientdoc-code.sql deleted file mode 100644 index eabb646cc..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V390__clientdoc-code.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_code` (`code_name`, `is_system_defined`) VALUES ('Customer Documents', '1'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V391__add_transaction_ref_column.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V391__add_transaction_ref_column.sql deleted file mode 100644 index d94b2d4b6..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V391__add_transaction_ref_column.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_savings_account_transaction` ADD COLUMN `ref_no` VARCHAR(128) DEFAULT NULL; - -ALTER TABLE `m_savings_account_transaction` ADD UNIQUE INDEX `transaction_ref_no` (`ref_no`); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V392__interest_recovery_conf_for_rescedule.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V392__interest_recovery_conf_for_rescedule.sql deleted file mode 100644 index edbdc7739..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V392__interest_recovery_conf_for_rescedule.sql +++ /dev/null @@ -1,29 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -delete from c_configuration where name = 'is-interest-to-be-appropriated-equally-when-greater-than-emi'; - -INSERT INTO `c_configuration` (`name`, `value`, `date_value`, `enabled`, `is_trap_door`, `description`) -VALUES - ('is-interest-to-be-recovered-first-when-greater-than-emi', 0, NULL, 0, 0, 'If enabled, when interest amount is greater than EMI, the additional interest is recovered first before principal'); - - -INSERT INTO `c_configuration` (`name`, `value`, `date_value`, `enabled`, `is_trap_door`, `description`) -VALUES - ('is-principal-compounding-disabled-for-overdue-loans', 0, NULL, 0, 0, 'If enabled, it donot consider principal of an unpaid installment for calculating interest of next installment. this is for testing back-dated loan schedule'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V39__payment-channels-updates.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V39__payment-channels-updates.sql deleted file mode 100644 index b0aa2508f..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V39__payment-channels-updates.sql +++ /dev/null @@ -1,36 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_code` (`code_name`, `is_system_defined`) VALUES -('PaymentType',1); - -/*Update payment detail to add foreign key relationship to user defined Code Value*/ -update m_loan_transaction set payment_detail_id=null; -ALTER TABLE `m_payment_detail` - ALTER `payment_type_enum` DROP DEFAULT; -ALTER TABLE `m_payment_detail` - CHANGE COLUMN `payment_type_enum` `payment_type_cv_id` INT NULL AFTER `id`; -delete from m_payment_detail; -ALTER TABLE `m_payment_detail` - ADD CONSTRAINT `FK_m_payment_detail_m_code_value` FOREIGN KEY (`payment_type_cv_id`) REFERENCES `m_code_value` (`id`); - -/*Map Different Payment Channels to payment Types*/ -ALTER TABLE `acc_product_mapping` - ADD COLUMN `payment_type` INT NULL DEFAULT NULL AFTER `product_type`, - ADD CONSTRAINT `FK_acc_product_mapping_m_code_value` FOREIGN KEY (`payment_type`) REFERENCES `m_code_value` (`id`); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V3__mifosx-permissions-and-authorisation-utf8.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V3__mifosx-permissions-and-authorisation-utf8.sql deleted file mode 100644 index fc9a66190..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V3__mifosx-permissions-and-authorisation-utf8.sql +++ /dev/null @@ -1,354 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - --- ========= roles and permissions ========= - -/* -this scripts removes all current m_role_permission and m_permission entries -and then inserts new m_permission entries and just one m_role_permission entry -which gives the role (id 1 - super user) an ALL_FUNCTIONS permission - -If you had other roles set up with specific permissions you will have to set up their permissions again. -*/ - --- truncate `m_role_permission`; --- truncate `m_permission`; --- truncate `x_registered_table`; - -INSERT INTO `m_permission` -(`grouping`,`code`,`entity_name`,`action_name`,`can_maker_checker`) VALUES -('special','ALL_FUNCTIONS',NULL,NULL,0), -('special','ALL_FUNCTIONS_READ',NULL,NULL,0), -('special', 'CHECKER_SUPER_USER', NULL, NULL, '0'), -('special','REPORTING_SUPER_USER',NULL,NULL,0), -('authorisation','READ_PERMISSION','PERMISSION','READ',0), -('authorisation','PERMISSIONS_ROLE','ROLE','PERMISSIONS',1), -('authorisation','CREATE_ROLE','ROLE','CREATE',1), -('authorisation','CREATE_ROLE_CHECKER','ROLE','CREATE',0), -('authorisation','READ_ROLE','ROLE','READ',0), -('authorisation','UPDATE_ROLE','ROLE','UPDATE',1), -('authorisation','UPDATE_ROLE_CHECKER','ROLE','UPDATE',0), -('authorisation','DELETE_ROLE','ROLE','DELETE',1), -('authorisation','DELETE_ROLE_CHECKER','ROLE','DELETE',0), -('authorisation','CREATE_USER','USER','CREATE',1), -('authorisation','CREATE_USER_CHECKER','USER','CREATE',0), -('authorisation','READ_USER','USER','READ',0), -('authorisation','UPDATE_USER','USER','UPDATE',1), -('authorisation','UPDATE_USER_CHECKER','USER','UPDATE',0), -('authorisation','DELETE_USER','USER','DELETE',1), -('authorisation','DELETE_USER_CHECKER','USER','DELETE',0), -('configuration','READ_CONFIGURATION','CONFIGURATION','READ',1), -('configuration','UPDATE_CONFIGURATION','CONFIGURATION','UPDATE',1), -('configuration','UPDATE_CONFIGURATION_CHECKER','CONFIGURATION','UPDATE',0), -('configuration','READ_CODE','CODE','READ',0), -('configuration','CREATE_CODE','CODE','CREATE',1), -('configuration','CREATE_CODE_CHECKER','CODE','CREATE',0), -('configuration','UPDATE_CODE','CODE','UPDATE',1), -('configuration','UPDATE_CODE_CHECKER','CODE','UPDATE',0), -('configuration','DELETE_CODE','CODE','DELETE',1), -('configuration','DELETE_CODE_CHECKER','CODE','DELETE',0), -('configuration', 'READ_CODEVALUE', 'CODEVALUE', 'READ', '0'), -('configuration', 'CREATE_CODEVALUE', 'CODEVALUE', 'CREATE', '1'), -('configuration', 'CREATE_CODEVALUE_CHECKER', 'CODEVALUE', 'CREATE', '0'), -('configuration', 'UPDATE_CODEVALUE', 'CODEVALUE', 'UPDATE', '1'), -('configuration', 'UPDATE_CODEVALUE_CHECKER', 'CODEVALUE', 'UPDATE', '0'), -('configuration', 'DELETE_CODEVALUE', 'CODEVALUE', 'DELETE', '1'), -('configuration', 'DELETE_CODEVALUE_CHECKER', 'CODEVALUE', 'DELETE', '0'), -('configuration','READ_CURRENCY','CURRENCY','READ',0), -('configuration','UPDATE_CURRENCY','CURRENCY','UPDATE',1), -('configuration','UPDATE_CURRENCY_CHECKER','CURRENCY','UPDATE',0), -('configuration', 'UPDATE_PERMISSION', 'PERMISSION', 'UPDATE', '1'), -('configuration', 'UPDATE_PERMISSION_CHECKER', 'PERMISSION', 'UPDATE', '0'), -('configuration', 'READ_DATATABLE', 'DATATABLE', 'READ', '0'), -('configuration', 'REGISTER_DATATABLE', 'DATATABLE', 'REGISTER', '1'), -('configuration', 'REGISTER_DATATABLE_CHECKER', 'DATATABLE', 'REGISTER', '0'), -('configuration', 'DEREGISTER_DATATABLE', 'DATATABLE', 'DEREGISTER', '1'), -('configuration', 'DEREGISTER_DATATABLE_CHECKER', 'DATATABLE', 'DEREGISTER', '0'), -('configuration', 'READ_AUDIT', 'AUDIT', 'READ', '0'), -('configuration', 'CREATE_CALENDAR', 'CALENDAR', 'CREATE', '0'), -('configuration', 'READ_CALENDAR', 'CALENDAR', 'READ', '0'), -('configuration', 'UPDATE_CALENDAR', 'CALENDAR', 'UPDATE', '0'), -('configuration', 'DELETE_CALENDAR', 'CALENDAR', 'DELETE', '0'), -('configuration', 'CREATE_CALENDAR_CHECKER', 'CALENDAR', 'CREATE', '0'), -('configuration', 'UPDATE_CALENDAR_CHECKER', 'CALENDAR', 'UPDATE', '0'), -('configuration', 'DELETE_CALENDAR_CHECKER', 'CALENDAR', 'DELETE', '0'), -('organisation', 'READ_MAKERCHECKER', 'MAKERCHECKER', 'READ', '0'), -('organisation', 'READ_CHARGE', 'CHARGE', 'READ', '0'), -('organisation', 'CREATE_CHARGE', 'CHARGE', 'CREATE', '1'), -('organisation', 'CREATE_CHARGE_CHECKER', 'CHARGE', 'CREATE', '0'), -('organisation', 'UPDATE_CHARGE', 'CHARGE', 'UPDATE', '1'), -('organisation', 'UPDATE_CHARGE_CHECKER', 'CHARGE', 'UPDATE', '0'), -('organisation', 'DELETE_CHARGE', 'CHARGE', 'DELETE', '1'), -('organisation', 'DELETE_CHARGE_CHECKER', 'CHARGE', 'DELETE', '0'), -('organisation', 'READ_FUND', 'FUND', 'READ', '0'), -('organisation', 'CREATE_FUND', 'FUND', 'CREATE', '1'), -('organisation', 'CREATE_FUND_CHECKER', 'FUND', 'CREATE', '0'), -('organisation', 'UPDATE_FUND', 'FUND', 'UPDATE', '1'), -('organisation', 'UPDATE_FUND_CHECKER', 'FUND', 'UPDATE', '0'), -('organisation', 'DELETE_FUND', 'FUND', 'DELETE', '1'), -('organisation', 'DELETE_FUND_CHECKER', 'FUND', 'DELETE', '0'), -('organisation', 'READ_LOANPRODUCT', 'LOANPRODUCT', 'READ', '0'), -('organisation', 'CREATE_LOANPRODUCT', 'LOANPRODUCT', 'CREATE', '1'), -('organisation', 'CREATE_LOANPRODUCT_CHECKER', 'LOANPRODUCT', 'CREATE', '0'), -('organisation', 'UPDATE_LOANPRODUCT', 'LOANPRODUCT', 'UPDATE', '1'), -('organisation', 'UPDATE_LOANPRODUCT_CHECKER', 'LOANPRODUCT', 'UPDATE', '0'), -('organisation', 'DELETE_LOANPRODUCT', 'LOANPRODUCT', 'DELETE', '1'), -('organisation', 'DELETE_LOANPRODUCT_CHECKER', 'LOANPRODUCT', 'DELETE', '0'), -('organisation', 'READ_OFFICE', 'OFFICE', 'READ', '0'), -('organisation', 'CREATE_OFFICE', 'OFFICE', 'CREATE', '1'), -('organisation', 'CREATE_OFFICE_CHECKER', 'OFFICE', 'CREATE', '0'), -('organisation', 'UPDATE_OFFICE', 'OFFICE', 'UPDATE', '1'), -('organisation', 'UPDATE_OFFICE_CHECKER', 'OFFICE', 'UPDATE', '0'), -('organisation', 'READ_OFFICETRANSACTION', 'OFFICETRANSACTION', 'READ', '0'), -('organisation', 'DELETE_OFFICE_CHECKER', 'OFFICE', 'DELETE', '0'), -('organisation', 'CREATE_OFFICETRANSACTION', 'OFFICETRANSACTION', 'CREATE', '1'), -('organisation', 'CREATE_OFFICETRANSACTION_CHECKER', 'OFFICETRANSACTION', 'CREATE', '0'), -('organisation', 'DELETE_OFFICETRANSACTION', 'OFFICETRANSACTION', 'DELETE', 1), -('organisation', 'DELETE_OFFICETRANSACTION_CHECKER', 'OFFICETRANSACTION', 'DELETE', 0), -('organisation', 'READ_STAFF', 'STAFF', 'READ', '0'), -('organisation', 'CREATE_STAFF', 'STAFF', 'CREATE', '1'), -('organisation', 'CREATE_STAFF_CHECKER', 'STAFF', 'CREATE', '0'), -('organisation', 'UPDATE_STAFF', 'STAFF', 'UPDATE', '1'), -('organisation', 'UPDATE_STAFF_CHECKER', 'STAFF', 'UPDATE', '0'), -('organisation', 'DELETE_STAFF', 'STAFF', 'DELETE', '1'), -('organisation', 'DELETE_STAFF_CHECKER', 'STAFF', 'DELETE', '0'), -('organisation', 'READ_SAVINGSPRODUCT', 'SAVINGSPRODUCT', 'READ', '0'), -('organisation', 'CREATE_SAVINGSPRODUCT', 'SAVINGSPRODUCT', 'CREATE', '1'), -('organisation', 'CREATE_SAVINGSPRODUCT_CHECKER', 'SAVINGSPRODUCT', 'CREATE', '0'), -('organisation', 'UPDATE_SAVINGSPRODUCT', 'SAVINGSPRODUCT', 'UPDATE', '1'), -('organisation', 'UPDATE_SAVINGSPRODUCT_CHECKER', 'SAVINGSPRODUCT', 'UPDATE', '0'), -('organisation', 'DELETE_SAVINGSPRODUCT', 'SAVINGSPRODUCT', 'DELETE', '1'), -('organisation', 'DELETE_SAVINGSPRODUCT_CHECKER', 'SAVINGSPRODUCT', 'DELETE', '0'), -('portfolio', 'READ_LOAN', 'LOAN', 'READ', '0'), -('portfolio', 'CREATE_LOAN', 'LOAN', 'CREATE', '1'), -('portfolio', 'CREATE_LOAN_CHECKER', 'LOAN', 'CREATE', '0'), -('portfolio', 'UPDATE_LOAN', 'LOAN', 'UPDATE', '1'), -('portfolio', 'UPDATE_LOAN_CHECKER', 'LOAN', 'UPDATE', '0'), -('portfolio', 'DELETE_LOAN', 'LOAN', 'DELETE', '1'), -('portfolio', 'DELETE_LOAN_CHECKER', 'LOAN', 'DELETE', '0'), --- ('portfolio', 'CREATEHISTORIC_LOAN', 'LOAN', 'CREATEHISTORIC', '1'), --- ('portfolio', 'CREATEHISTORIC_LOAN_CHECKER', 'LOAN', 'CREATEHISTORIC', '0'), --- ('portfolio', 'UPDATEHISTORIC_LOAN', 'LOAN', 'UPDATEHISTORIC', '1'), --- ('portfolio', 'UPDATEHISTORIC_LOAN_CHECKER', 'LOAN', 'UPDATEHISTORIC', '0'), -('portfolio', 'READ_CLIENT', 'CLIENT', 'READ', '0'), -('portfolio', 'CREATE_CLIENT', 'CLIENT', 'CREATE', '1'), -('portfolio', 'CREATE_CLIENT_CHECKER', 'CLIENT', 'CREATE', '0'), -('portfolio', 'UPDATE_CLIENT', 'CLIENT', 'UPDATE', '1'), -('portfolio', 'UPDATE_CLIENT_CHECKER', 'CLIENT', 'UPDATE', '0'), -('portfolio', 'DELETE_CLIENT', 'CLIENT', 'DELETE', '1'), -('portfolio', 'DELETE_CLIENT_CHECKER', 'CLIENT', 'DELETE', '0'), -('portfolio', 'READ_CLIENTIMAGE', 'CLIENTIMAGE', 'READ', '0'), -('portfolio', 'CREATE_CLIENTIMAGE', 'CLIENTIMAGE', 'CREATE', '1'), -('portfolio', 'CREATE_CLIENTIMAGE_CHECKER', 'CLIENTIMAGE', 'CREATE', '0'), -('portfolio', 'DELETE_CLIENTIMAGE', 'CLIENTIMAGE', 'DELETE', '1'), -('portfolio', 'DELETE_CLIENTIMAGE_CHECKER', 'CLIENTIMAGE', 'DELETE', '0'), -('portfolio', 'READ_CLIENTNOTE', 'CLIENTNOTE', 'READ', '0'), -('portfolio', 'CREATE_CLIENTNOTE', 'CLIENTNOTE', 'CREATE', '1'), -('portfolio', 'CREATE_CLIENTNOTE_CHECKER', 'CLIENTNOTE', 'CREATE', '0'), -('portfolio', 'UPDATE_CLIENTNOTE', 'CLIENTNOTE', 'UPDATE', '1'), -('portfolio', 'UPDATE_CLIENTNOTE_CHECKER', 'CLIENTNOTE', 'UPDATE', '0'), -('portfolio', 'DELETE_CLIENTNOTE', 'CLIENTNOTE', 'DELETE', '1'), -('portfolio', 'DELETE_CLIENTNOTE_CHECKER', 'CLIENTNOTE', 'DELETE', '0'), -('portfolio', 'READ_GROUPNOTE', 'GROUPNOTE', 'READ', '0'), -('portfolio', 'CREATE_GROUPNOTE', 'GROUPNOTE', 'CREATE', '1'), -('portfolio', 'UPDATE_GROUPNOTE', 'GROUPNOTE', 'UPDATE', '1'), -('portfolio', 'DELETE_GROUPNOTE', 'GROUPNOTE', 'DELETE', '1'), -('portfolio', 'CREATE_GROUPNOTE_CHECKER', 'GROUPNOTE', 'CREATE', '0'), -('portfolio', 'UPDATE_GROUPNOTE_CHECKER', 'GROUPNOTE', 'UPDATE', '0'), -('portfolio', 'DELETE_GROUPNOTE_CHECKER', 'GROUPNOTE', 'DELETE', '0'), -('portfolio', 'READ_LOANNOTE', 'LOANNOTE', 'READ', '0'), -('portfolio', 'CREATE_LOANNOTE', 'LOANNOTE', 'CREATE', '1'), -('portfolio', 'UPDATE_LOANNOTE', 'LOANNOTE', 'UPDATE', '1'), -('portfolio', 'DELETE_LOANNOTE', 'LOANNOTE', 'DELETE', '1'), -('portfolio', 'CREATE_LOANNOTE_CHECKER', 'LOANNOTE', 'CREATE', '0'), -('portfolio', 'UPDATE_LOANNOTE_CHECKER', 'LOANNOTE', 'UPDATE', '0'), -('portfolio', 'DELETE_LOANNOTE_CHECKER', 'LOANNOTE', 'DELETE', '0'), -('portfolio', 'READ_LOANTRANSACTIONNOTE', 'LOANTRANSACTIONNOTE', 'READ', '0'), -('portfolio', 'CREATE_LOANTRANSACTIONNOTE', 'LOANTRANSACTIONNOTE', 'CREATE', '1'), -('portfolio', 'UPDATE_LOANTRANSACTIONNOTE', 'LOANTRANSACTIONNOTE', 'UPDATE', '1'), -('portfolio', 'DELETE_LOANTRANSACTIONNOTE', 'LOANTRANSACTIONNOTE', 'DELETE', '1'), -('portfolio', 'CREATE_LOANTRANSACTIONNOTE_CHECKER', 'LOANTRANSACTIONNOTE', 'CREATE', '0'), -('portfolio', 'UPDATE_LOANTRANSACTIONNOTE_CHECKER', 'LOANTRANSACTIONNOTE', 'UPDATE', '0'), -('portfolio', 'DELETE_LOANTRANSACTIONNOTE_CHECKER', 'LOANTRANSACTIONNOTE', 'DELETE', '0'), -('portfolio', 'READ_SAVINGNOTE', 'SAVINGNOTE', 'READ', '0'), -('portfolio', 'CREATE_SAVINGNOTE', 'SAVINGNOTE', 'CREATE', '1'), -('portfolio', 'UPDATE_SAVINGNOTE', 'SAVINGNOTE', 'UPDATE', '1'), -('portfolio', 'DELETE_SAVINGNOTE', 'SAVINGNOTE', 'DELETE', '1'), -('portfolio', 'CREATE_SAVINGNOTE_CHECKER', 'SAVINGNOTE', 'CREATE', '0'), -('portfolio', 'UPDATE_SAVINGNOTE_CHECKER', 'SAVINGNOTE', 'UPDATE', '0'), -('portfolio', 'DELETE_SAVINGNOTE_CHECKER', 'SAVINGNOTE', 'DELETE', '0'), -('portfolio', 'READ_CLIENTIDENTIFIER', 'CLIENTIDENTIFIER', 'READ', '0'), -('portfolio', 'CREATE_CLIENTIDENTIFIER', 'CLIENTIDENTIFIER', 'CREATE', '1'), -('portfolio', 'CREATE_CLIENTIDENTIFIER_CHECKER', 'CLIENTIDENTIFIER', 'CREATE', '0'), -('portfolio', 'UPDATE_CLIENTIDENTIFIER', 'CLIENTIDENTIFIER', 'UPDATE', '1'), -('portfolio', 'UPDATE_CLIENTIDENTIFIER_CHECKER', 'CLIENTIDENTIFIER', 'UPDATE', '0'), -('portfolio', 'DELETE_CLIENTIDENTIFIER', 'CLIENTIDENTIFIER', 'DELETE', '1'), -('portfolio', 'DELETE_CLIENTIDENTIFIER_CHECKER', 'CLIENTIDENTIFIER', 'DELETE', '0'), -('portfolio', 'READ_DOCUMENT', 'DOCUMENT', 'READ', '0'), -('portfolio', 'CREATE_DOCUMENT', 'DOCUMENT', 'CREATE', '1'), -('portfolio', 'CREATE_DOCUMENT_CHECKER', 'DOCUMENT', 'CREATE', '0'), -('portfolio', 'UPDATE_DOCUMENT', 'DOCUMENT', 'UPDATE', '1'), -('portfolio', 'UPDATE_DOCUMENT_CHECKER', 'DOCUMENT', 'UPDATE', '0'), -('portfolio', 'DELETE_DOCUMENT', 'DOCUMENT', 'DELETE', '1'), -('portfolio', 'DELETE_DOCUMENT_CHECKER', 'DOCUMENT', 'DELETE', '0'), -('portfolio', 'READ_GROUP', 'GROUP', 'READ', '0'), -('portfolio', 'CREATE_GROUP', 'GROUP', 'CREATE', '1'), -('portfolio', 'CREATE_GROUP_CHECKER', 'GROUP', 'CREATE', '0'), -('portfolio', 'UPDATE_GROUP', 'GROUP', 'UPDATE', '1'), -('portfolio', 'UPDATE_GROUP_CHECKER', 'GROUP', 'UPDATE', '0'), -('portfolio', 'DELETE_GROUP', 'GROUP', 'DELETE', '1'), -('portfolio', 'DELETE_GROUP_CHECKER', 'GROUP', 'DELETE', '0'), -('portfolio', 'UNASSIGNSTAFF_GROUP', 'GROUP', 'UNASSIGNSTAFF', 1), -('portfolio', 'UNASSIGNSTAFF_GROUP_CHECKER', 'GROUP', 'UNASSIGNSTAFF', 0), -('portfolio', 'CREATE_LOANCHARGE', 'LOANCHARGE', 'CREATE', '1'), -('portfolio', 'CREATE_LOANCHARGE_CHECKER', 'LOANCHARGE', 'CREATE', '0'), -('portfolio', 'UPDATE_LOANCHARGE', 'LOANCHARGE', 'UPDATE', '1'), -('portfolio', 'UPDATE_LOANCHARGE_CHECKER', 'LOANCHARGE', 'UPDATE', '0'), -('portfolio', 'DELETE_LOANCHARGE', 'LOANCHARGE', 'DELETE', '1'), -('portfolio', 'DELETE_LOANCHARGE_CHECKER', 'LOANCHARGE', 'DELETE', '0'), -('portfolio', 'WAIVE_LOANCHARGE', 'LOANCHARGE', 'WAIVE', '1'), -('portfolio', 'WAIVE_LOANCHARGE_CHECKER', 'LOANCHARGE', 'WAIVE', '0'), -('portfolio', 'READ_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'READ', '0'), -('portfolio', 'CREATE_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'CREATE', '1'), -('portfolio', 'CREATE_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'CREATE', '0'), -('portfolio', 'UPDATE_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'UPDATE', '1'), -('portfolio', 'UPDATE_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'UPDATE', '0'), -('portfolio', 'DELETE_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'DELETE', '1'), -('portfolio', 'DELETE_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'DELETE', '0'), -('portfolio', 'READ_GUARANTOR', 'GUARANTOR', 'READ', 0), -('portfolio', 'CREATE_GUARANTOR', 'GUARANTOR', 'CREATE', 1), -('portfolio', 'CREATE_GUARANTOR_CHECKER', 'GUARANTOR', 'CREATE', 0), -('portfolio', 'UPDATE_GUARANTOR', 'GUARANTOR', 'UPDATE', 1), -('portfolio', 'UPDATE_GUARANTOR_CHECKER', 'GUARANTOR', 'UPDATE', 0), -('portfolio', 'DELETE_GUARANTOR', 'GUARANTOR', 'DELETE', 1), -('portfolio', 'DELETE_GUARANTOR_CHECKER', 'GUARANTOR', 'DELETE', 0), -('portfolio', 'READ_COLLATERAL', 'COLLATERAL', 'READ', '0'), -('portfolio', 'CREATE_COLLATERAL', 'COLLATERAL', 'CREATE', '1'), -('portfolio', 'UPDATE_COLLATERAL', 'COLLATERAL', 'UPDATE', '1'), -('portfolio', 'DELETE_COLLATERAL', 'COLLATERAL', 'DELETE', '1'), -('portfolio', 'CREATE_COLLATERAL_CHECKER', 'COLLATERAL', 'CREATE', '0'), -('portfolio', 'UPDATE_COLLATERAL_CHECKER', 'COLLATERAL', 'UPDATE', '0'), -('portfolio', 'DELETE_COLLATERAL_CHECKER', 'COLLATERAL', 'DELETE', '0'), -('transaction_loan', 'APPROVE_LOAN', 'LOAN', 'APPROVE', '1'), -('transaction_loan', 'APPROVEINPAST_LOAN', 'LOAN', 'APPROVEINPAST', '1'), -('transaction_loan', 'REJECT_LOAN', 'LOAN', 'REJECT', '1'), -('transaction_loan', 'REJECTINPAST_LOAN', 'LOAN', 'REJECTINPAST', '1'), -('transaction_loan', 'WITHDRAW_LOAN', 'LOAN', 'WITHDRAW', '1'), -('transaction_loan', 'WITHDRAWINPAST_LOAN', 'LOAN', 'WITHDRAWINPAST', '1'), -('transaction_loan', 'APPROVALUNDO_LOAN', 'LOAN', 'APPROVALUNDO', '1'), -('transaction_loan', 'DISBURSE_LOAN', 'LOAN', 'DISBURSE', '1'), -('transaction_loan', 'DISBURSEINPAST_LOAN', 'LOAN', 'DISBURSEINPAST', '1'), -('transaction_loan', 'DISBURSALUNDO_LOAN', 'LOAN', 'DISBURSALUNDO', '1'), -('transaction_loan', 'REPAYMENT_LOAN', 'LOAN', 'REPAYMENT', '1'), -('transaction_loan', 'REPAYMENTINPAST_LOAN', 'LOAN', 'REPAYMENTINPAST', '1'), -('transaction_loan', 'ADJUST_LOAN', 'LOAN', 'ADJUST', '1'), -('transaction_loan', 'WAIVEINTERESTPORTION_LOAN', 'LOAN', 'WAIVEINTERESTPORTION', '1'), -('transaction_loan', 'WRITEOFF_LOAN', 'LOAN', 'WRITEOFF', '1'), -('transaction_loan', 'CLOSE_LOAN', 'LOAN', 'CLOSE', '1'), -('transaction_loan', 'CLOSEASRESCHEDULED_LOAN', 'LOAN', 'CLOSEASRESCHEDULED', '1'), -('transaction_loan', 'UPDATELOANOFFICER_LOAN', 'LOAN', 'UPDATELOANOFFICER', 1), -('transaction_loan', 'UPDATELOANOFFICER_LOAN_CHECKER', 'LOAN', 'UPDATELOANOFFICER', 0), -('transaction_loan', 'REMOVELOANOFFICER_LOAN', 'LOAN', 'REMOVELOANOFFICER', 1), -('transaction_loan', 'REMOVELOANOFFICER_LOAN_CHECKER', 'LOAN', 'REMOVELOANOFFICER', 0), -('transaction_loan', 'BULKREASSIGN_LOAN', 'LOAN', 'BULKREASSIGN', '1'), -('transaction_loan', 'BULKREASSIGN_LOAN_CHECKER', 'LOAN', 'BULKREASSIGN', '0'), -('transaction_loan', 'APPROVE_LOAN_CHECKER', 'LOAN', 'APPROVE', '0'), -('transaction_loan', 'APPROVEINPAST_LOAN_CHECKER', 'LOAN', 'APPROVEINPAST', '0'), -('transaction_loan', 'REJECT_LOAN_CHECKER', 'LOAN', 'REJECT', '0'), -('transaction_loan', 'REJECTINPAST_LOAN_CHECKER', 'LOAN', 'REJECTINPAST', '0'), -('transaction_loan', 'WITHDRAW_LOAN_CHECKER', 'LOAN', 'WITHDRAW', '0'), -('transaction_loan', 'WITHDRAWINPAST_LOAN_CHECKER', 'LOAN', 'WITHDRAWINPAST', '0'), -('transaction_loan', 'APPROVALUNDO_LOAN_CHECKER', 'LOAN', 'APPROVALUNDO', '0'), -('transaction_loan', 'DISBURSE_LOAN_CHECKER', 'LOAN', 'DISBURSE', '0'), -('transaction_loan', 'DISBURSEINPAST_LOAN_CHECKER', 'LOAN', 'DISBURSEINPAST', '0'), -('transaction_loan', 'DISBURSALUNDO_LOAN_CHECKER', 'LOAN', 'DISBURSALUNDO', '0'), -('transaction_loan', 'REPAYMENT_LOAN_CHECKER', 'LOAN', 'REPAYMENT', '0'), -('transaction_loan', 'REPAYMENTINPAST_LOAN_CHECKER', 'LOAN', 'REPAYMENTINPAST', '0'), -('transaction_loan', 'ADJUST_LOAN_CHECKER', 'LOAN', 'ADJUST', '0'), -('transaction_loan', 'WAIVEINTERESTPORTION_LOAN_CHECKER', 'LOAN', 'WAIVEINTERESTPORTION', '0'), -('transaction_loan', 'WRITEOFF_LOAN_CHECKER', 'LOAN', 'WRITEOFF', '0'), -('transaction_loan', 'CLOSE_LOAN_CHECKER', 'LOAN', 'CLOSE', '0'), -('transaction_loan', 'CLOSEASRESCHEDULED_LOAN_CHECKER', 'LOAN', 'CLOSEASRESCHEDULED', '0'), -('transaction_loan', 'UNDO_WAIVECHARGE', 'WAIVECHARGE', 'UNDO', '0'), -('transaction_savings', 'DEPOSIT_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'DEPOSIT', '1'), -('transaction_savings', 'DEPOSIT_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'DEPOSIT', '0'), -('transaction_savings', 'WITHDRAWAL_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'WITHDRAWAL', '1'), -('transaction_savings', 'WITHDRAWAL_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'WITHDRAWAL', '0'), -('transaction_savings', 'ACTIVATE_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'ACTIVATE', '1'), -('transaction_savings', 'ACTIVATE_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'ACTIVATE', '0'), -('transaction_savings', 'CALCULATEINTEREST_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'CALCULATEINTEREST', '1'), -('transaction_savings', 'CALCULATEINTEREST_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'CALCULATEINTEREST', '0'); - --- == accounting related permissions -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES -('accounting', 'CREATE_GLACCOUNT', 'GLACCOUNT', 'CREATE', 1), -('accounting', 'UPDATE_GLACCOUNT', 'GLACCOUNT', 'UPDATE', 1), -('accounting', 'DELETE_GLACCOUNT', 'GLACCOUNT', 'DELETE', 1), -('accounting', 'CREATE_GLCLOSURE', 'GLCLOSURE', 'CREATE', 1), -('accounting', 'UPDATE_GLCLOSURE', 'GLCLOSURE', 'UPDATE', 1), -('accounting', 'DELETE_GLCLOSURE', 'GLCLOSURE', 'DELETE', 1), -('accounting', 'CREATE_JOURNALENTRY', 'JOURNALENTRY', 'CREATE', 1), -('accounting', 'REVERSE_JOURNALENTRY', 'JOURNALENTRY', 'REVERSE', 1); - - -INSERT INTO `m_role` (`id`, `name`, `description`) -VALUES -(1,'Super user','This role provides all application permissions.'); - -/* role 1 is super user, give it ALL_FUNCTIONS */ -INSERT INTO m_role_permission(role_id, permission_id) -select 1, id -from m_permission -where code = 'ALL_FUNCTIONS'; - -INSERT INTO `m_appuser` (`id`, `office_id`, `username`, `firstname`, `lastname`, `password`, `email`, -`firsttime_login_remaining`, `nonexpired`, `nonlocked`, `nonexpired_credentials`, `enabled`) -VALUES -(1,1,'mifos','App','Administrator','5787039480429368bf94732aacc771cd0a3ea02bcf504ffe1185ab94213bc63a','demomfi@mifos.org','\0','','','',''); - - -INSERT INTO `m_appuser_role` (`appuser_id`, `role_id`) VALUES (1,1); - - --- Add in permissions for any special datatables added in base reference data --- This needs to always happen at end of the script - -/* add a create, read, update and delete permission for each registered datatable */ -insert into m_permission(`grouping`, `code`, entity_name, action_name) -select 'datatable', concat('CREATE_', r.registered_table_name), r.registered_table_name, 'CREATE' -from x_registered_table r; - -insert into m_permission(`grouping`, `code`, entity_name, action_name) -select 'datatable', concat('READ_', r.registered_table_name), r.registered_table_name, 'READ' -from x_registered_table r; - -insert into m_permission(`grouping`, `code`, entity_name, action_name) -select 'datatable', concat('UPDATE_', r.registered_table_name), r.registered_table_name, 'UPDATE' -from x_registered_table r; - -insert into m_permission(`grouping`, `code`, entity_name, action_name) -select 'datatable', concat('DELETE_', r.registered_table_name), r.registered_table_name, 'DELETE' -from x_registered_table r; - - -/* regardless of inserted permission settings above, no permissions (transactions) are preselected as being part of the maker-checker process -so, just set the flag to false... the end-user can decide which permissions should be maker-checkerable -*/ -update m_permission set can_maker_checker = false; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V40__add_permissions_for_accounting_rule.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V40__add_permissions_for_accounting_rule.sql deleted file mode 100644 index 2230d6920..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V40__add_permissions_for_accounting_rule.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('organistion', 'DELETE_ACCOUNTINGRULE', 'ACCOUNTINGRULE', 'DELETE', 0),('organistion', 'CREATE_ACCOUNTINGRULE', 'ACCOUNTINGRULE', 'CREATE', 0),('organistion', 'UPDATE_ACCOUNTINGRULE', 'ACCOUNTINGRULE', 'UPDATE', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V41__group-summary-reports.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V41__group-summary-reports.sql deleted file mode 100644 index 06997da1b..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V41__group-summary-reports.sql +++ /dev/null @@ -1,108 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -DELETE FROM `stretchy_report` where report_name = 'GroupSummaryDetails'; -DELETE FROM `m_permission` where entity_name = 'GroupSummaryDetails'; - - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `core_report`, `use_report`, `description`, `report_sql`) -VALUES ('GroupSummaryCounts', 'Table', true, false, 'Utility query for getting group summary count details for a group_id', - -" -/* -Active Client is a client linked to the 'group' via m_group_client -and with an active 'status_enum'.) -Active Borrowers - Borrower may be a client or a 'group' -*/ -select x.* -from m_office o, -m_group g, - -(select a.activeClients, -(b.activeClientLoans + c.activeGroupLoans) as activeLoans, -b.activeClientLoans, c.activeGroupLoans, -(b.activeClientBorrowers + c.activeGroupBorrowers) as activeBorrowers, -b.activeClientBorrowers, c.activeGroupBorrowers, -(b.overdueClientLoans + c.overdueGroupLoans) as overdueLoans, -b.overdueClientLoans, c.overdueGroupLoans -from -(select count(*) as activeClients -from m_group topgroup -join m_group g on g.hierarchy like concat(topgroup.hierarchy, '%') -join m_group_client gc on gc.group_id = g.id -join m_client c on c.id = gc.client_id -where topgroup.id = ${groupId} -and c.status_enum = 300) a, - -(select count(*) as activeClientLoans, -count(distinct(l.client_id)) as activeClientBorrowers, -ifnull(sum(if(laa.loan_id is not null, 1, 0)), 0) as overdueClientLoans -from m_group topgroup -join m_group g on g.hierarchy like concat(topgroup.hierarchy, '%') -join m_loan l on l.group_id = g.id and l.client_id is not null -left join m_loan_arrears_aging laa on laa.loan_id = l.id -where topgroup.id = ${groupId} -and l.loan_status_id = 300) b, - -(select count(*) as activeGroupLoans, -count(distinct(l.group_id)) as activeGroupBorrowers, -ifnull(sum(if(laa.loan_id is not null, 1, 0)), 0) as overdueGroupLoans -from m_group topgroup -join m_group g on g.hierarchy like concat(topgroup.hierarchy, '%') -join m_loan l on l.group_id = g.id and l.client_id is null -left join m_loan_arrears_aging laa on laa.loan_id = l.id -where topgroup.id = ${groupId} -and l.loan_status_id = 300) c -) x - -where g.id = ${groupId} -and o.id = g.office_id -and o.hierarchy like concat('${currentUserHierarchy}', '%') -"); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'READ_GroupSummaryCounts', 'GroupSummaryCounts', 'READ', 0); - - - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `core_report`, `use_report`, `description`, `report_sql`) -VALUES ('GroupSummaryAmounts', 'Table', true, false, 'Utility query for getting group summary currency amount details for a group_id', - -" -select ifnull(cur.display_symbol, l.currency_code) as currency, -ifnull(sum(l.principal_disbursed_derived),0) as totalDisbursedAmount, -ifnull(sum(l.principal_outstanding_derived),0) as totalLoanOutstandingAmount, -count(laa.loan_id) as overdueLoans, ifnull(sum(laa.total_overdue_derived), 0) as totalLoanOverdueAmount -from m_group topgroup -join m_office o on o.id = topgroup.office_id and o.hierarchy like concat('${currentUserHierarchy}', '%') -join m_group g on g.hierarchy like concat(topgroup.hierarchy, '%') -join m_loan l on l.group_id = g.id -left join m_loan_arrears_aging laa on laa.loan_id = l.id -left join m_currency cur on cur.code = l.currency_code -where topgroup.id = ${groupId} -and l.disbursedon_date is not null -group by l.currency_code -"); - - - - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'READ_GroupSummaryAmounts', 'GroupSummaryAmounts', 'READ', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V42__Add_default_value_for_id_for_acc_accounting_rule.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V42__Add_default_value_for_id_for_acc_accounting_rule.sql deleted file mode 100644 index 04d4dc26b..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V42__Add_default_value_for_id_for_acc_accounting_rule.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `acc_accounting_rule` - CHANGE COLUMN `id` `id` BIGINT NOT NULL AUTO_INCREMENT FIRST; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V43__accounting-for-savings.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V43__accounting-for-savings.sql deleted file mode 100644 index e49eccd08..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V43__accounting-for-savings.sql +++ /dev/null @@ -1,30 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -/*add accounting type field to savings product*/ -ALTER TABLE `m_savings_product` - ADD COLUMN `accounting_type` SMALLINT NOT NULL AFTER `lockin_period_frequency_enum`; - -/*update existing savings products to have "No" accounting*/ -update m_savings_product set accounting_type=1; - -/*track payment details for savings transactions*/ -ALTER TABLE `m_savings_account_transaction` -ADD COLUMN `payment_detail_id` BIGINT NULL DEFAULT NULL AFTER `savings_account_id`, -ADD CONSTRAINT `FK_m_savings_account_transaction_m_payment_detail` FOREIGN KEY (`payment_detail_id`) REFERENCES `m_payment_detail` (`id`); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V44__document-increase-size-of-column-type.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V44__document-increase-size-of-column-type.sql deleted file mode 100644 index 4e4305aa3..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V44__document-increase-size-of-column-type.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_document` - CHANGE COLUMN `type` `type` VARCHAR(500) NULL DEFAULT NULL AFTER `size`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V45__create_acc_rule_tags_table.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V45__create_acc_rule_tags_table.sql deleted file mode 100644 index f8bf490b3..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V45__create_acc_rule_tags_table.sql +++ /dev/null @@ -1,30 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -create table `acc_rule_tags` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `acc_rule_id` BIGINT NOT NULL, - `tag_id` INT NOT NULL, - `acc_type_enum` SMALLINT NOT NULL, - primary key(`id`), - INDEX `FK_acc_accounting_rule_id` (`acc_rule_id`), - INDEX `FK_m_code_value_id` (`tag_id`), - CONSTRAINT `FK_acc_accounting_rule_id` FOREIGN KEY (`acc_rule_id`) REFERENCES `acc_accounting_rule` (`id`), - CONSTRAINT `FK_m_code_value_id` FOREIGN KEY (`tag_id`) REFERENCES `m_code_value` (`id`) -); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V46__extend_datatables_api.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V46__extend_datatables_api.sql deleted file mode 100644 index 2cf862341..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V46__extend_datatables_api.sql +++ /dev/null @@ -1,28 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) - VALUES - ('configuration', 'CREATE_DATATABLE', 'DATATABLE', 'CREATE', 0), - ('configuration', 'CREATE_DATATABLE_CHECKER', 'DATATABLE', 'CREATE', 0), - ('configuration', 'UPDATE_DATATABLE', 'DATATABLE', 'UPDATE', 0), - ('configuration', 'UPDATE_DATATABLE_CHECKER', 'DATATABLE', 'UPDATE', 0), - ('configuration', 'DELETE_DATATABLE', 'DATATABLE', 'DELETE', 0), - ('configuration', 'DELETE_DATATABLE_CHECKER', 'DATATABLE', 'DELETE', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V47__staff-hierarchy-link-to-users.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V47__staff-hierarchy-link-to-users.sql deleted file mode 100644 index 2b4188ee5..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V47__staff-hierarchy-link-to-users.sql +++ /dev/null @@ -1,33 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_appuser` -ADD COLUMN `staff_id` BIGINT NULL DEFAULT NULL AFTER `office_id` ; - -ALTER TABLE m_appuser -ADD CONSTRAINT `fk_m_appuser_002` -FOREIGN KEY (`staff_id`) -REFERENCES m_staff (`id`) -ON DELETE NO ACTION -ON UPDATE NO ACTION -,ADD INDEX `fk_m_appuser_002x` (`staff_id` ASC); - -ALTER TABLE `m_staff` -ADD COLUMN `organisational_role_enum` SMALLINT NULL DEFAULT NULL AFTER `external_id`, -ADD COLUMN `organisational_role_parent_staff_id` BIGINT NULL DEFAULT NULL AFTER `organisational_role_enum`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V48__adding-S3-Support.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V48__adding-S3-Support.sql deleted file mode 100644 index 69bde028d..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V48__adding-S3-Support.sql +++ /dev/null @@ -1,97 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO c_configuration (name,enabled) VALUES ('amazon-S3',0); - -/*New table for storing details of external services used*/ -CREATE TABLE `c_external_service` ( - `name` VARCHAR(150) NOT NULL, - `value` VARCHAR(250) NULL DEFAULT NULL, - UNIQUE INDEX `name` (`name`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; - -INSERT INTO c_external_service (name) VALUES ('s3_bucket_name'); -INSERT INTO c_external_service (name) VALUES ('s3_access_key'); -INSERT INTO c_external_service (name) VALUES ('s3_secret_key'); - - - -/*Image tables stores details of all images*/ -CREATE TABLE IF NOT EXISTS `m_image`( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `location` varchar(500), - `storage_type_enum` SMALLINT, - PRIMARY KEY (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; - -/*Client points to image table*/ -ALTER TABLE `m_client` - ADD COLUMN `image_id` BIGINT NULL DEFAULT NULL AFTER `display_name`, - ADD CONSTRAINT `FK_m_client_m_image` FOREIGN KEY (`image_id`) REFERENCES `m_image` (`id`); - -/*Move existing image locations to new table*/ -/*drop procedure if exists migrate_customer_image_data; - -delimiter # -create procedure migrate_customer_image_data() -begin -DECLARE v_counter INT DEFAULT 0; -DECLARE num_of_clients INT DEFAULT 0; -DECLARE curr_image INT DEFAULT 0; -DECLARE prev_image INT DEFAULT 0; -SELECT COUNT(*) FROM m_client INTO num_of_clients; -SET @curr_client := 0; -while v_counter < num_of_clients do - SET @s = CONCAT('INSERT INTO m_image(`location`,`storage_type_enum`) select image_key, 1 FROM m_client where image_key is not null LIMIT ', v_counter , ', ', 1); - PREPARE stmt1 FROM @s; - EXECUTE stmt1; - DEALLOCATE PREPARE stmt1; - - select ifnull(max(`id`),0) from m_image INTO curr_image; - SET @z = CONCAT('select id FROM m_client where image_key is not null limit INTO @curr_client ', v_counter , ', ', 1); - PREPARE stmt2 FROM @z; - EXECUTE stmt2; - - IF (prev_image != curr_image) THEN UPDATE m_client set image_id = curr_image where id=@curr_client; - END IF; - - set prev_image=curr_image; - set v_counter=v_counter+1; -end while; -delete from m_image where `location` is null; -end# - -delimiter ; -call migrate_customer_image_data(); -*/ - -/*Now drop the procedure*/ -/*drop procedure if exists migrate_customer_image_data; */ - -/*Delete image key from client*/ -ALTER TABLE `m_client` DROP COLUMN `image_key`; - - -/*Add storage type for m_document table and update existing documents to file storage*/ -ALTER TABLE m_document ADD COLUMN storage_type_enum SMALLINT; -UPDATE m_document set storage_type_enum=1; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V49__track-loan-charge-payment-transactions.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V49__track-loan-charge-payment-transactions.sql deleted file mode 100644 index 74212a878..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V49__track-loan-charge-payment-transactions.sql +++ /dev/null @@ -1,32 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_loan_charge_paid_by` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `loan_transaction_id` BIGINT NOT NULL, - `loan_charge_id` BIGINT NOT NULL, - `amount` DECIMAL(19,6) NOT NULL, - PRIMARY KEY (`id`), - INDEX `FK__m_loan_transaction` (`loan_transaction_id`), - INDEX `FK__m_loan_charge` (`loan_charge_id`), - CONSTRAINT `FK__m_loan_charge` FOREIGN KEY (`loan_charge_id`) REFERENCES `m_loan_charge` (`id`), - CONSTRAINT `FK__m_loan_transaction` FOREIGN KEY (`loan_transaction_id`) REFERENCES `m_loan_transaction` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V4__mifosx-core-reports-utf8.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V4__mifosx-core-reports-utf8.sql deleted file mode 100644 index 5920335c5..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V4__mifosx-core-reports-utf8.sql +++ /dev/null @@ -1,30 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -truncate table stretchy_report; -truncate table stretchy_parameter; -truncate table stretchy_report_parameter; - -INSERT INTO `stretchy_report` VALUES (1,'Client Listing','Table',NULL,'Client','select \r\nconcat(repeat(\"..\", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as \"Office/Branch\",\r\n c.account_no as \"Client Account No.\", \r\nc.display_name as \"Name\", \n\nc.joined_date as \"Joined\", c.external_id as \"External Id\"\r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand \n\nounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on c.office_id = ounder.id\r\nwhere o.id = ${officeId}\r\nand c.is_deleted=0\r\n\n\norder by ounder.hierarchy, c.account_no','Individual Client Report\r\n\r\nLists the small number of defined fields on the client table. Would expect to copy this \n\nreport and add any \'one to one\' additional data for specific tenant needs.\r\n\r\nCan be run for any size MFI but you\'d expect it only to be run within a branch for \n\nlarger ones. Depending on how many columns are displayed, there is probably is a limit of about 20/50k clients returned for html display (export to excel doesn\'t \n\nhave that client browser/memory impact).',1,1),(2,'Client Loans Listing','Table',NULL,'Client','select \r\nconcat(repeat(\"..\", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as \"Office/Branch\",\r\nc.account_no as \"Client \n\nAccount No.\", \r\nc.display_name as \"Name\", \r\nlo.display_name as \"Loan Officer\", l.account_no as \"Loan Account No.\", l.external_id as \"External Id\", \r\n\n\np.name as Loan, st.enum_message_property as \"Status\", \r\nf.`name` as Fund, purp.code_value as \"Loan Purpose\",\r\nifnull(cur.display_symbol, l.currency_code) as Currency, \r\nl.principal_amount,\n\n\r\nl.arrearstolerance_amount as \"Arrears Tolerance Amount\",\r\nl.number_of_repayments as \"Expected No. Repayments\",\r\nl.annual_nominal_interest_rate as \" Annual \n\nNominal Interest Rate\", \r\nl.nominal_interest_rate_per_period as \"Nominal Interest Rate Per Period\",\r\n\r\nipf.enum_message_property as \"Interest Rate Frequency\n\n\",\r\nim.enum_message_property as \"Interest Method\",\r\nicp.enum_message_property as \"Interest Calculated in Period\",\r\nl.term_frequency as \"Term Frequency\",\n\n\r\ntf.enum_message_property as \"Term Frequency Period\",\r\nl.repay_every as \"Repayment Frequency\",\r\nrf.enum_message_property as \"Repayment Frequency Period\",\n\n\r\nam.enum_message_property as \"Amortization\",\r\n\r\nl.total_charges_due_at_disbursement_derived as \"Total Charges Due At Disbursement\",\r\n\r\ndate( \n\nl.submittedon_date) as Submitted, date(l.approvedon_date) Approved, l.expected_disbursedon_date As \"Expected Disbursal\",\r\ndate(l.expected_firstrepaymenton_date) as \n\n\"Expected First Repayment\", date(l.interest_calculated_from_date) as \"Interest Calculated From\" ,\r\ndate(l.disbursedon_date) as Disbursed, date\n\n(l.expected_maturedon_date) \"Expected Maturity\",\r\ndate(l.maturedon_date) as \"Matured On\", date(l.closedon_date) as Closed,\r\ndate(l.rejectedon_date) as \n\nRejected, date(l.rescheduledon_date) as Rescheduled, \r\ndate(l.withdrawnon_date) as Withdrawn, date(l.writtenoffon_date) \"Written Off\"\r\nfrom m_office o \r\njoin \n\nm_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on \n\nc.office_id = ounder.id\r\nleft join m_loan l on l.client_id = c.id\r\nleft join m_staff lo on lo.id = l.loan_officer_id\r\nleft join m_product_loan p on p.id = \n\nl.product_id\r\nleft join m_fund f on f.id = l.fund_id\r\nleft join r_enum_value st on st.enum_name = \"loan_status_id\" and st.enum_id = l.loan_status_id\r\nleft join \n\nr_enum_value ipf on ipf.enum_name = \"interest_period_frequency_enum\" and ipf.enum_id = l.interest_period_frequency_enum\r\nleft join r_enum_value im on im.enum_name \n\n= \"interest_method_enum\" and im.enum_id = l.interest_method_enum\r\nleft join r_enum_value tf on tf.enum_name = \"term_period_frequency_enum\" and tf.enum_id = \n\nl.term_period_frequency_enum\r\nleft join r_enum_value icp on icp.enum_name = \"interest_calculated_in_period_enum\" and icp.enum_id = \n\nl.interest_calculated_in_period_enum\r\nleft join r_enum_value rf on rf.enum_name = \"repayment_period_frequency_enum\" and rf.enum_id = \n\nl.repayment_period_frequency_enum\r\nleft join r_enum_value am on am.enum_name = \"amortization_method_enum\" and am.enum_id = l.amortization_method_enum\r\nleft join m_code_value purp on purp.id = l.loanpurpose_cv_id\r\n\r\nleft \n\njoin m_currency cur on cur.code = l.currency_code\r\nwhere o.id = ${officeId}\r\nand (l.currency_code = \"$\{currencyId}\" or \"-1\" = \"$\{currencyId}\")\r\nand \n\n(l.product_id = \"${loanProductId}\" or \"-1\" = \"${loanProductId}\")\r\nand (ifnull(l.loan_officer_id, -10) = \"${loanOfficerId}\" or \"-1\" = \n\n\"${loanOfficerId}\")\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId})\r\nand (ifnull(l.loanpurpose_cv_id, -10) = ${loanPurposeId} or -1 = ${loanPurposeId})\r\norder by ounder.hierarchy, 2 , l.id','Individual Client Report\r\n\r\nPretty \n\nwide report that lists the basic details of client loans. \r\n\r\nCan be run for any size MFI but you\'d expect it only to be run within a branch for larger ones. \n\nThere is probably is a limit of about 20/50k clients returned for html display (export to excel doesn\'t have that client browser/memory impact).',1,1),(5,'Loans Awaiting Disbursal','Table',NULL,'Loan','SELECT \r\nconcat(repeat(\"..\", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as \"Office/Branch\",\r\nc.account_no as \"Client Account No\", c.display_name as \"Name\", l.account_no as \"Loan Account No.\", pl.`name` as \"Product\", \r\nf.`name` as Fund, ifnull(cur.display_symbol, l.currency_code) as Currency, \r\nl.principal_amount as Principal, \r\nl.term_frequency as \"Term Frequency\",\n\n\r\ntf.enum_message_property as \"Term Frequency Period\",\r\nl.annual_nominal_interest_rate as \" Annual Nominal Interest Rate\",\r\ndate(l.approvedon_date) \"Approved\",\r\ndatediff(l.expected_disbursedon_date, curdate()) as \"Days to Disbursal\",\r\ndate(l.expected_disbursedon_date) \"Expected Disbursal\",\r\npurp.code_value as \"Loan Purpose\",\r\n lo.display_name as \"Loan Officer\"\r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on c.office_id = ounder.id\r\njoin m_loan l on l.client_id = c.id\r\njoin m_product_loan pl on pl.id = l.product_id\r\nleft join m_staff lo on lo.id = l.loan_officer_id\r\nleft join m_currency cur on cur.code = l.currency_code\r\nleft join m_fund f on f.id = l.fund_id\r\nleft join m_code_value purp on purp.id = l.loanpurpose_cv_id\r\nleft join r_enum_value tf on tf.enum_name = \"term_period_frequency_enum\" and tf.enum_id = l.term_period_frequency_enum\r\nwhere o.id = ${officeId}\r\nand (l.currency_code = \"$\{currencyId}\" or \"-1\" = \"$\{currencyId}\")\r\nand (l.product_id = \"${loanProductId}\" or \"-1\" = \"${loanProductId}\")\r\nand (ifnull(l.loan_officer_id, -10) = \"${loanOfficerId}\" or \"-1\" = \"${loanOfficerId}\")\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId})\r\nand (ifnull(l.loanpurpose_cv_id, -10) = ${loanPurposeId} or -1 = ${loanPurposeId})\r\nand l.loan_status_id = 200\r\norder by ounder.hierarchy, datediff(l.expected_disbursedon_date, curdate()), c.account_no','Individual Client Report',1,1),(6,'Loans Awaiting Disbursal Summary','Table',NULL,'Loan','SELECT \r\nconcat(repeat(\"..\", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as \"Office/Branch\",\r\npl.`name` as \"Product\", \r\nifnull(cur.display_symbol, l.currency_code) as Currency, f.`name` as Fund,\r\nsum(l.principal_amount) as Principal\r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on c.office_id = ounder.id\r\njoin m_loan l on l.client_id = c.id\r\njoin m_product_loan pl on pl.id = l.product_id\r\nleft join m_staff lo on lo.id = l.loan_officer_id\r\nleft join m_currency cur on cur.code = l.currency_code\r\nleft join m_fund f on f.id = l.fund_id\r\nleft join m_code_value purp on purp.id = l.loanpurpose_cv_id\r\nwhere o.id = ${officeId}\r\nand (l.currency_code = \"$\{currencyId}\" or \"-1\" = \"$\{currencyId}\")\r\nand (l.product_id = \"${loanProductId}\" or \"-1\" = \"${loanProductId}\")\r\nand (ifnull(l.loan_officer_id, -10) = \"${loanOfficerId}\" or \"-1\" = \"${loanOfficerId}\")\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId})\r\nand (ifnull(l.loanpurpose_cv_id, -10) = ${loanPurposeId} or -1 = ${loanPurposeId})\r\nand l.loan_status_id = 200\r\ngroup by ounder.hierarchy, pl.`name`, l.currency_code, f.`name`\r\norder by ounder.hierarchy, pl.`name`, l.currency_code, f.`name`','Individual Client Report',1,1),(7,'Loans Awaiting Disbursal Summary by Month','Table',NULL,'Loan','SELECT \r\nconcat(repeat(\"..\", ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as \"Office/Branch\",\r\npl.`name` as \"Product\", \r\nifnull(cur.display_symbol, l.currency_code) as Currency, \r\nyear(l.expected_disbursedon_date) as \"Year\", \r\nmonthname(l.expected_disbursedon_date) as \"Month\",\r\nsum(l.principal_amount) as Principal\r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on c.office_id = ounder.id\r\njoin m_loan l on l.client_id = c.id\r\njoin m_product_loan pl on pl.id = l.product_id\r\nleft join m_staff lo on lo.id = l.loan_officer_id\r\nleft join m_currency cur on cur.code = l.currency_code\r\nleft join m_fund f on f.id = l.fund_id\r\nleft join m_code_value purp on purp.id = l.loanpurpose_cv_id\r\nwhere o.id = ${officeId}\r\nand (l.currency_code = \"$\{currencyId}\" or \"-1\" = \"$\{currencyId}\")\r\nand (l.product_id = \"${loanProductId}\" or \"-1\" = \"${loanProductId}\")\r\nand (ifnull(l.loan_officer_id, -10) = \"${loanOfficerId}\" or \"-1\" = \"${loanOfficerId}\")\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId})\r\nand (ifnull(l.loanpurpose_cv_id, -10) = ${loanPurposeId} or -1 = ${loanPurposeId})\r\nand l.loan_status_id = 200\r\ngroup by ounder.hierarchy, pl.`name`, l.currency_code, year(l.expected_disbursedon_date), month(l.expected_disbursedon_date)\r\norder by ounder.hierarchy, pl.`name`, l.currency_code, year(l.expected_disbursedon_date), month(l.expected_disbursedon_date)','Individual Client Report',1,1),(8,'Loans Pending Approval','Table',NULL,'Loan','SELECT \r\nconcat(repeat(\"..\", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as \"Office/Branch\",\r\nc.account_no as \"Client Account No.\", c.display_name as \"Client Name\", \r\nifnull(cur.display_symbol, l.currency_code) as Currency, pl.`name` as \"Product\", \r\nl.account_no as \"Loan Account No.\", \r\nl.principal_amount as \"Loan Amount\", \r\nl.term_frequency as \"Term Frequency\",\n\n\r\ntf.enum_message_property as \"Term Frequency Period\",\r\nl.annual_nominal_interest_rate as \" Annual \n\nNominal Interest Rate\", \r\ndatediff(curdate(), l.submittedon_date) \"Days Pending Approval\", \r\npurp.code_value as \"Loan Purpose\",\r\nlo.display_name as \"Loan Officer\"\r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on c.office_id = ounder.id\r\njoin m_loan l on l.client_id = c.id\r\njoin m_product_loan pl on pl.id = l.product_id\r\nleft join m_staff lo on lo.id = l.loan_officer_id\r\nleft join m_currency cur on cur.code = l.currency_code\r\nleft join m_code_value purp on purp.id = l.loanpurpose_cv_id\r\nleft join r_enum_value tf on tf.enum_name = \"term_period_frequency_enum\" and tf.enum_id = l.term_period_frequency_enum\r\nwhere o.id = ${officeId}\r\nand (l.currency_code = \"$\{currencyId}\" or \"-1\" = \"$\{currencyId}\")\r\nand (l.product_id = \"${loanProductId}\" or \"-1\" = \"${loanProductId}\")\r\nand (ifnull(l.loan_officer_id, -10) = \"${loanOfficerId}\" or \"-1\" = \"${loanOfficerId}\")\r\nand (ifnull(l.loanpurpose_cv_id, -10) = ${loanPurposeId} or -1 = ${loanPurposeId})\r\nand l.loan_status_id = 100 /*Submitted and awaiting approval */\r\norder by ounder.hierarchy, l.submittedon_date, l.account_no','Individual Client Report',1,1),(11,'Active Loans - Summary','Table',NULL,'Loan','select concat(repeat(\"..\", \r\n ((LENGTH(mo.`hierarchy`) - LENGTH(REPLACE(mo.`hierarchy`, \'.\', \'\')) - 1))), mo.`name`) as \"Office/Branch\", x.currency as Currency,\r\n x.client_count as \"No. of Clients\", x.active_loan_count as \"No. Active Loans\", x. loans_in_arrears_count as \"No. of Loans in Arrears\",\r\nx.principal as \"Total Loans Disbursed\", x.principal_repaid as \"Principal Repaid\", x.principal_outstanding as \"Principal Outstanding\", x.principal_overdue as \"Principal Overdue\",\r\nx.interest as \"Total Interest\", x.interest_repaid as \"Interest Repaid\", x.interest_outstanding as \"Interest Outstanding\", x.interest_overdue as \"Interest Overdue\",\r\nx.fees as \"Total Fees\", x.fees_repaid as \"Fees Repaid\", x.fees_outstanding as \"Fees Outstanding\", x.fees_overdue as \"Fees Overdue\",\r\nx.penalties as \"Total Penalties\", x.penalties_repaid as \"Penalties Repaid\", x.penalties_outstanding as \"Penalties Outstanding\", x.penalties_overdue as \"Penalties Overdue\",\r\n\r\n (case\r\n when ${parType} = 1 then\r\n cast(round((x.principal_overdue * 100) / x.principal_outstanding, 2) as char)\r\n when ${parType} = 2 then\r\n cast(round(((x.principal_overdue + x.interest_overdue) * 100) / (x.principal_outstanding + x.interest_outstanding), 2) as char)\r\n when ${parType} = 3 then\r\n cast(round(((x.principal_overdue + x.interest_overdue + x.fees_overdue) * 100) / (x.principal_outstanding + x.interest_outstanding + x.fees_outstanding), 2) as char)\r\n when ${parType} = 4 then\r\n cast(round(((x.principal_overdue + x.interest_overdue + x.fees_overdue + x.penalties_overdue) * 100) / (x.principal_outstanding + x.interest_outstanding + x.fees_outstanding + x.penalties_overdue), 2) as char)\r\n else \"invalid PAR Type\"\r\n end) as \"Portfolio at Risk %\"\r\n from m_office mo\r\njoin \r\n(select ounder.id as branch,\r\nifnull(cur.display_symbol, l.currency_code) as currency,\r\ncount(distinct(c.id)) as client_count, \r\ncount(distinct(l.id)) as active_loan_count,\r\ncount(distinct(if(laa.loan_id is not null, l.id, null) )) as loans_in_arrears_count,\r\n\r\nsum(l.principal_disbursed_derived) as principal,\r\nsum(l.principal_repaid_derived) as principal_repaid,\r\nsum(l.principal_outstanding_derived) as principal_outstanding,\r\nsum(laa.principal_overdue_derived) as principal_overdue,\r\n\r\nsum(l.interest_charged_derived) as interest,\r\nsum(l.interest_repaid_derived) as interest_repaid,\r\nsum(l.interest_outstanding_derived) as interest_outstanding,\r\nsum(laa.interest_overdue_derived) as interest_overdue,\r\n\r\nsum(l.fee_charges_charged_derived) as fees,\r\nsum(l.fee_charges_repaid_derived) as fees_repaid,\r\nsum(l.fee_charges_outstanding_derived) as fees_outstanding,\r\nsum(laa.fee_charges_overdue_derived) as fees_overdue,\r\n\r\nsum(l.penalty_charges_charged_derived) as penalties,\r\nsum(l.penalty_charges_repaid_derived) as penalties_repaid,\r\nsum(l.penalty_charges_outstanding_derived) as penalties_outstanding,\r\nsum(laa.penalty_charges_overdue_derived) as penalties_overdue\r\n\r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on c.office_id = ounder.id\r\njoin m_loan l on l.client_id = c.id\r\nleft join m_loan_arrears_aging laa on laa.loan_id = l.id\r\nleft join m_currency cur on cur.code = l.currency_code\r\n\r\nwhere o.id = ${officeId}\r\nand (l.currency_code = \"$\{currencyId}\" or \"-1\" = \"$\{currencyId}\")\r\nand (l.product_id = \"${loanProductId}\" or \"-1\" = \"${loanProductId}\")\r\nand (ifnull(l.loan_officer_id, -10) = \"${loanOfficerId}\" or \"-1\" = \"${loanOfficerId}\")\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId})\r\nand (ifnull(l.loanpurpose_cv_id, -10) = ${loanPurposeId} or -1 = ${loanPurposeId})\r\nand l.loan_status_id = 300\r\ngroup by ounder.id, l.currency_code) x on x.branch = mo.id\r\norder by mo.hierarchy, x.Currency',NULL,1,1),(12,'Active Loans - Details','Table',NULL,'Loan','select concat(repeat(\"..\", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as \"Office/Branch\",\r\nifnull(cur.display_symbol, l.currency_code) as Currency,\r\nlo.display_name as \"Loan Officer\", \r\nc.display_name as \"Client\", l.account_no as \"Loan Account No.\", pl.`name` as \"Product\", \r\nf.`name` as Fund, \r\nl.principal_amount as \"Loan Amount\", \r\nl.annual_nominal_interest_rate as \" Annual Nominal Interest Rate\", \r\ndate(l.disbursedon_date) as \"Disbursed Date\", \r\ndate(l.expected_maturedon_date) as \"Expected Matured On\",\r\n\r\nl.principal_repaid_derived as \"Principal Repaid\",\r\nl.principal_outstanding_derived as \"Principal Outstanding\",\r\nlaa.principal_overdue_derived as \"Principal Overdue\",\r\n\r\nl.interest_repaid_derived as \"Interest Repaid\",\r\nl.interest_outstanding_derived as \"Interest Outstanding\",\r\nlaa.interest_overdue_derived as \"Interest Overdue\",\r\n\r\nl.fee_charges_repaid_derived as \"Fees Repaid\",\r\nl.fee_charges_outstanding_derived as \"Fees Outstanding\",\r\nlaa.fee_charges_overdue_derived as \"Fees Overdue\",\r\n\r\nl.penalty_charges_repaid_derived as \"Penalties Repaid\",\r\nl.penalty_charges_outstanding_derived as \"Penalties Outstanding\",\r\npenalty_charges_overdue_derived as \"Penalties Overdue\"\r\n\r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on c.office_id = ounder.id\r\njoin m_loan l on l.client_id = c.id\r\njoin m_product_loan pl on pl.id = l.product_id\r\nleft join m_staff lo on lo.id = l.loan_officer_id\r\nleft join m_currency cur on cur.code = l.currency_code\r\nleft join m_fund f on f.id = l.fund_id\r\nleft join m_loan_arrears_aging laa on laa.loan_id = l.id\r\nwhere o.id = ${officeId}\r\nand (l.currency_code = \"$\{currencyId}\" or \"-1\" = \"$\{currencyId}\")\r\nand (l.product_id = \"${loanProductId}\" or \"-1\" = \"${loanProductId}\")\r\nand (ifnull(l.loan_officer_id, -10) = \"${loanOfficerId}\" or \"-1\" = \"${loanOfficerId}\")\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId})\r\nand (ifnull(l.loanpurpose_cv_id, -10) = ${loanPurposeId} or -1 = ${loanPurposeId})\r\nand l.loan_status_id = 300\r\ngroup by l.id\r\norder by ounder.hierarchy, l.currency_code, c.account_no, l.account_no','Individual Client \n\nReport',1,1),(13,'Obligation Met Loans Details','Table',NULL,'Loan','select concat(repeat(\"..\", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as \"Office/Branch\",\r\nifnull(cur.display_symbol, l.currency_code) as Currency,\r\nc.account_no as \"Client Account No.\", c.display_name as \"Client\",\r\nl.account_no as \"Loan Account No.\", pl.`name` as \"Product\", \r\nf.`name` as Fund, \r\nl.principal_amount as \"Loan Amount\", \r\nl.total_repayment_derived as \"Total Repaid\", \r\nl.annual_nominal_interest_rate as \" Annual Nominal Interest Rate\", \r\ndate(l.disbursedon_date) as \"Disbursed\", \r\ndate(l.closedon_date) as \"Closed\",\r\n\r\nl.principal_repaid_derived as \"Principal Repaid\",\r\nl.interest_repaid_derived as \"Interest Repaid\",\r\nl.fee_charges_repaid_derived as \"Fees Repaid\",\r\nl.penalty_charges_repaid_derived as \"Penalties Repaid\",\r\nlo.display_name as \"Loan Officer\"\r\n\r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on c.office_id = ounder.id\r\njoin m_loan l on l.client_id = c.id\r\njoin m_product_loan pl on pl.id = l.product_id\r\nleft join m_staff lo on lo.id = l.loan_officer_id\r\nleft join m_currency cur on cur.code = l.currency_code\r\nleft join m_fund f on f.id = l.fund_id\r\nwhere o.id = ${officeId}\r\nand (l.currency_code = \"$\{currencyId}\" or \"-1\" = \"$\{currencyId}\")\r\nand (l.product_id = \"${loanProductId}\" or \"-1\" = \"${loanProductId}\")\r\nand (ifnull(l.loan_officer_id, -10) = \"${loanOfficerId}\" or \"-1\" = \"${loanOfficerId}\")\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId})\r\nand (ifnull(l.loanpurpose_cv_id, -10) = ${loanPurposeId} or -1 = ${loanPurposeId})\r\nand (case\r\n when ${obligDateType} = 1 then\r\n l.closedon_date between \'${startDate}\' and \'${endDate}\'\r\n when ${obligDateType} = 2 then\r\n l.disbursedon_date between \'${startDate}\' and \'${endDate}\'\r\n else 1 = 1\r\n end)\r\nand l.loan_status_id = 600\r\ngroup by l.id\r\norder by ounder.hierarchy, l.currency_code, c.account_no, l.account_no','Individual Client \n\nReport',1,1),(14,'Obligation Met Loans Summary','Table',NULL,'Loan','select concat(repeat(\"..\", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as \"Office/Branch\",\r\nifnull(cur.display_symbol, l.currency_code) as Currency,\r\ncount(distinct(c.id)) as \"No. of Clients\",\r\ncount(distinct(l.id)) as \"No. of Loans\",\r\nsum(l.principal_amount) as \"Total Loan Amount\", \r\nsum(l.principal_repaid_derived) as \"Total Principal Repaid\",\r\nsum(l.interest_repaid_derived) as \"Total Interest Repaid\",\r\nsum(l.fee_charges_repaid_derived) as \"Total Fees Repaid\",\r\nsum(l.penalty_charges_repaid_derived) as \"Total Penalties Repaid\",\r\nsum(l.interest_waived_derived) as \"Total Interest Waived\",\r\nsum(l.fee_charges_waived_derived) as \"Total Fees Waived\",\r\nsum(l.penalty_charges_waived_derived) as \"Total Penalties Waived\"\r\n\r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on c.office_id = ounder.id\r\njoin m_loan l on l.client_id = c.id\r\njoin m_product_loan pl on pl.id = l.product_id\r\nleft join m_staff lo on lo.id = l.loan_officer_id\r\nleft join m_currency cur on cur.code = l.currency_code\r\nleft join m_fund f on f.id = l.fund_id\r\nwhere o.id = ${officeId}\r\nand (l.currency_code = \"$\{currencyId}\" or \"-1\" = \"$\{currencyId}\")\r\nand (l.product_id = \"${loanProductId}\" or \"-1\" = \"${loanProductId}\")\r\nand (ifnull(l.loan_officer_id, -10) = \"${loanOfficerId}\" or \"-1\" = \"${loanOfficerId}\")\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId})\r\nand (ifnull(l.loanpurpose_cv_id, -10) = ${loanPurposeId} or -1 = ${loanPurposeId})\r\nand (case\r\n when ${obligDateType} = 1 then\r\n l.closedon_date between \'${startDate}\' and \'${endDate}\'\r\n when ${obligDateType} = 2 then\r\n l.disbursedon_date between \'${startDate}\' and \'${endDate}\'\r\n else 1 = 1\r\n end)\r\nand l.loan_status_id = 600\r\ngroup by ounder.hierarchy, l.currency_code\r\norder by ounder.hierarchy, l.currency_code','Individual Client \n\nReport',1,1),(15,'Portfolio at Risk','Table',NULL,'Loan','select x.Currency, x.`Principal Outstanding`, x.`Principal Overdue`, x.`Interest Outstanding`, x.`Interest Overdue`, \r\nx.`Fees Outstanding`, x.`Fees Overdue`, x.`Penalties Outstanding`, x.`Penalties Overdue`,\r\n\r\n (case\r\n when ${parType} = 1 then\r\n cast(round((x.`Principal Overdue` * 100) / x.`Principal Outstanding`, 2) as char)\r\n when ${parType} = 2 then\r\n cast(round(((x.`Principal Overdue` + x.`Interest Overdue`) * 100) / (x.`Principal Outstanding` + x.`Interest Outstanding`), 2) as char)\r\n when ${parType} = 3 then\r\n cast(round(((x.`Principal Overdue` + x.`Interest Overdue` + x.`Fees Overdue`) * 100) / (x.`Principal Outstanding` + x.`Interest Outstanding` + x.`Fees Outstanding`), 2) as char)\r\n when ${parType} = 4 then\r\n cast(round(((x.`Principal Overdue` + x.`Interest Overdue` + x.`Fees Overdue` + x.`Penalties Overdue`) * 100) / (x.`Principal Outstanding` + x.`Interest Outstanding` + x.`Fees Outstanding` + x.`Penalties Overdue`), 2) as char)\r\n else \"invalid PAR Type\"\r\n end) as \"Portfolio at Risk %\"\r\n from \r\n(select ifnull(cur.display_symbol, l.currency_code) as Currency, \r\nsum(l.principal_outstanding_derived) as \"Principal Outstanding\",\r\nsum(laa.principal_overdue_derived) as \"Principal Overdue\",\r\n\r\nsum(l.interest_outstanding_derived) as \"Interest Outstanding\",\r\nsum(laa.interest_overdue_derived) as \"Interest Overdue\",\r\n\r\nsum(l.fee_charges_outstanding_derived) as \"Fees Outstanding\",\r\nsum(laa.fee_charges_overdue_derived) as \"Fees Overdue\",\r\n\r\nsum(penalty_charges_outstanding_derived) as \"Penalties Outstanding\",\r\nsum(laa.penalty_charges_overdue_derived) as \"Penalties Overdue\"\r\n\r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on c.office_id = ounder.id\r\njoin m_loan l on l.client_id = c.id\r\nleft join m_staff lo on lo.id = l.loan_officer_id\r\nleft join m_currency cur on cur.code = l.currency_code\r\nleft join m_fund f on f.id = l.fund_id\r\nleft join m_code_value purp on purp.id = l.loanpurpose_cv_id\r\nleft join m_product_loan p on p.id = l.product_id\r\nleft join m_loan_arrears_aging laa on laa.loan_id = l.id\r\nwhere o.id = ${officeId}\r\nand (l.currency_code = \"$\{currencyId}\" or \"-1\" = \"$\{currencyId}\")\r\nand (l.product_id = \"${loanProductId}\" or \"-1\" = \"${loanProductId}\")\r\nand (ifnull(l.loan_officer_id, -10) = \"${loanOfficerId}\" or \"-1\" = \"${loanOfficerId}\")\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId})\r\nand (ifnull(l.loanpurpose_cv_id, -10) = ${loanPurposeId} or -1 = ${loanPurposeId})\r\nand l.loan_status_id = 300\r\ngroup by l.currency_code\r\norder by l.currency_code) x','Covers all loans.\r\n\r\nFor larger MFIs … we should add some derived fields on loan (or a 1:1 loan related table like mifos 2.x does)\r\nPrinciple, Interest, Fees, Penalties Outstanding and Overdue (possibly waived and written off too)',1,1),(16,'Portfolio at Risk by Branch','Table',NULL,'Loan','select concat(repeat(\"..\", \r\n ((LENGTH(mo.`hierarchy`) - LENGTH(REPLACE(mo.`hierarchy`, \'.\', \'\')) - 1))), mo.`name`) as \"Office/Branch\",\r\nx.Currency, x.`Principal Outstanding`, x.`Principal Overdue`, x.`Interest Outstanding`, x.`Interest Overdue`, \r\nx.`Fees Outstanding`, x.`Fees Overdue`, x.`Penalties Outstanding`, x.`Penalties Overdue`,\r\n\r\n (case\r\n when ${parType} = 1 then\r\n cast(round((x.`Principal Overdue` * 100) / x.`Principal Outstanding`, 2) as char)\r\n when ${parType} = 2 then\r\n cast(round(((x.`Principal Overdue` + x.`Interest Overdue`) * 100) / (x.`Principal Outstanding` + x.`Interest Outstanding`), 2) as char)\r\n when ${parType} = 3 then\r\n cast(round(((x.`Principal Overdue` + x.`Interest Overdue` + x.`Fees Overdue`) * 100) / (x.`Principal Outstanding` + x.`Interest Outstanding` + x.`Fees Outstanding`), 2) as char)\r\n when ${parType} = 4 then\r\n cast(round(((x.`Principal Overdue` + x.`Interest Overdue` + x.`Fees Overdue` + x.`Penalties Overdue`) * 100) / (x.`Principal Outstanding` + x.`Interest Outstanding` + x.`Fees Outstanding` + x.`Penalties Overdue`), 2) as char)\r\n else \"invalid PAR Type\"\r\n end) as \"Portfolio at Risk %\"\r\n from m_office mo\r\njoin \r\n(select ounder.id as \"branch\", ifnull(cur.display_symbol, l.currency_code) as Currency, \r\n\r\nsum(l.principal_outstanding_derived) as \"Principal Outstanding\",\r\nsum(laa.principal_overdue_derived) as \"Principal Overdue\",\r\n\r\nsum(l.interest_outstanding_derived) as \"Interest Outstanding\",\r\nsum(laa.interest_overdue_derived) as \"Interest Overdue\",\r\n\r\nsum(l.fee_charges_outstanding_derived) as \"Fees Outstanding\",\r\nsum(laa.fee_charges_overdue_derived) as \"Fees Overdue\",\r\n\r\nsum(penalty_charges_outstanding_derived) as \"Penalties Outstanding\",\r\nsum(laa.penalty_charges_overdue_derived) as \"Penalties Overdue\"\r\n\r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on c.office_id = ounder.id\r\njoin m_loan l on l.client_id = c.id\r\nleft join m_staff lo on lo.id = l.loan_officer_id\r\nleft join m_currency cur on cur.code = l.currency_code\r\nleft join m_fund f on f.id = l.fund_id\r\nleft join m_code_value purp on purp.id = l.loanpurpose_cv_id\r\nleft join m_product_loan p on p.id = l.product_id\r\nleft join m_loan_arrears_aging laa on laa.loan_id = l.id\r\nwhere o.id = ${officeId}\r\nand (l.currency_code = \"$\{currencyId}\" or \"-1\" = \"$\{currencyId}\")\r\nand (l.product_id = \"${loanProductId}\" or \"-1\" = \"${loanProductId}\")\r\nand (ifnull(l.loan_officer_id, -10) = \"${loanOfficerId}\" or \"-1\" = \"${loanOfficerId}\")\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId})\r\nand (ifnull(l.loanpurpose_cv_id, -10) = ${loanPurposeId} or -1 = ${loanPurposeId})\r\nand l.loan_status_id = 300\r\ngroup by ounder.id, l.currency_code) x on x.branch = mo.id\r\norder by mo.hierarchy, x.Currency','Covers all loans.\r\n\r\nFor larger MFIs … we should add some derived fields on loan (or a 1:1 loan related table like mifos 2.x does)\r\nPrinciple, Interest, Fees, Penalties Outstanding and Overdue (possibly waived and written off too)',1,1),(20,'Funds Disbursed Between Dates Summary','Table',NULL,'Fund','select ifnull(f.`name`, \'-\') as Fund, ifnull(cur.display_symbol, l.currency_code) as Currency, \r\nround(sum(l.principal_amount), 4) as disbursed_amount\r\nfrom m_office ounder \r\njoin m_client c on c.office_id = ounder.id\r\njoin m_loan l on l.client_id = c.id\r\njoin m_currency cur on cur.`code` = l.currency_code\r\nleft join m_fund f on f.id = l.fund_id\r\nwhere disbursedon_date between \'${startDate}\' and \'${endDate}\'\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId})\r\nand (l.currency_code = \'$\{currencyId}\' or \'-1\' = \'$\{currencyId}\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\ngroup by ifnull(f.`name`, \'-\') , ifnull(cur.display_symbol, l.currency_code)\r\norder by ifnull(f.`name`, \'-\') , ifnull(cur.display_symbol, l.currency_code)',NULL,1,1),(21,'Funds Disbursed Between Dates Summary by Office','Table',NULL,'Fund','select \r\nconcat(repeat(\"..\", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as \"Office/Branch\",\r\n \n\nifnull(f.`name`, \'-\') as Fund, ifnull(cur.display_symbol, l.currency_code) as Currency, round(sum(l.principal_amount), 4) as disbursed_amount\r\nfrom m_office o\r\n\n\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c \n\non c.office_id = ounder.id\r\njoin m_loan l on l.client_id = c.id\r\njoin m_currency cur on cur.`code` = l.currency_code\r\nleft join m_fund f on f.id = l.fund_id\r\n\n\nwhere disbursedon_date between \'${startDate}\' and \'${endDate}\'\r\nand o.id = ${officeId}\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId})\r\nand \n\n(l.currency_code = \'$\{currencyId}\' or \'-1\' = \'$\{currencyId}\')\r\ngroup by ounder.`name`, ifnull(f.`name`, \'-\') , ifnull(cur.display_symbol, \n\nl.currency_code)\r\norder by ounder.`name`, ifnull(f.`name`, \'-\') , ifnull(cur.display_symbol, l.currency_code)',NULL,1,1),(48,'Balance Sheet','Pentaho',NULL,'Accounting',NULL,'Balance Sheet',1,1),(49,'Income Statement','Pentaho',NULL,'Accounting',NULL,'Profit and Loss Statement',1,1),(50,'Trial Balance','Pentaho',NULL,'Accounting',NULL,'Trial Balance Report',1,1),(51,'Written-Off Loans','Table',NULL,'Loan','SELECT \r\nconcat(repeat(\"..\", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as \"Office/Branch\",\r\nifnull(cur.display_symbol, ml.currency_code) as Currency, \r\nc.account_no as \"Client Account No.\",\r\nc.display_name AS \'Client Name\',\r\nml.account_no AS \'Loan Account No.\',\r\nmpl.name AS \'Product Name\',\r\nml.disbursedon_date AS \'Disbursed Date\',\r\nlt.transaction_date AS \'Written Off date\',\r\nml.principal_amount as \"Loan Amount\",\r\nifnull(lt.principal_portion_derived, 0) AS \'Written-Off Principal\',\r\nifnull(lt.interest_portion_derived, 0) AS \'Written-Off Interest\',\r\nifnull(lt.fee_charges_portion_derived,0) AS \'Written-Off Fees\',\r\nifnull(lt.penalty_charges_portion_derived,0) AS \'Written-Off Penalties\',\r\nn.note AS \'Reason For Write-Off\',\r\nIFNULL(ms.display_name,\'-\') AS \'Loan Officer Name\'\r\nFROM m_office o\r\nJOIN m_office ounder ON ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nAND ounder.hierarchy like CONCAT(\'${currentUserHierarchy}\', \'%\')\r\nJOIN m_client c ON c.office_id = ounder.id\r\nJOIN m_loan ml ON ml.client_id = c.id\r\nJOIN m_product_loan mpl ON mpl.id=ml.product_id\r\nLEFT JOIN m_staff ms ON ms.id=ml.loan_officer_id\r\nJOIN m_loan_transaction lt ON lt.loan_id = ml.id\r\nLEFT JOIN m_note n ON n.loan_transaction_id = lt.id\r\nLEFT JOIN m_currency cur on cur.code = ml.currency_code\r\nWHERE lt.transaction_type_enum = 6 /*write-off */\r\nAND lt.is_reversed is false \r\nAND ml.loan_status_id=601\r\nAND o.id=${officeId}\r\nAND (mpl.id=${loanProductId} OR ${loanProductId}=-1)\r\nAND lt.transaction_date BETWEEN \'${startDate}\' AND \'${endDate}\'\r\nAND (ml.currency_code = \"$\{currencyId}\" or \"-1\" = \"$\{currencyId}\") \r\nORDER BY ounder.hierarchy, ifnull(cur.display_symbol, ml.currency_code), ml.account_no','Individual Lending Report. Written Off Loans',1,1),(52,'Aging Detail','Table',NULL,'Loan','SELECT \r\nconcat(repeat(\"..\", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as \"Office/Branch\",\r\nifnull(cur.display_symbol, ml.currency_code) as Currency, \r\nmc.account_no as \"Client Account No.\",\r\n mc.display_name AS \"Client Name\",\r\n ml.account_no AS \"Account Number\",\r\n ml.principal_amount AS \"Loan Amount\",\r\n ml.principal_disbursed_derived AS \"Original Principal\",\r\n ml.interest_charged_derived AS \"Original Interest\",\r\n ml.principal_repaid_derived AS \"Principal Paid\",\r\n ml.interest_repaid_derived AS \"Interest Paid\",\r\n laa.principal_overdue_derived AS \"Principal Overdue\",\r\n laa.interest_overdue_derived AS \"Interest Overdue\",\r\nDATEDIFF(CURDATE(), laa.overdue_since_date_derived) as \"Days in Arrears\",\r\n\r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<7, \'<1\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<8, \' 1\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<15, \'2\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<22, \' 3\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<29, \' 4\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<36, \' 5\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<43, \' 6\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<50, \' 7\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<57, \' 8\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<64, \' 9\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<71, \'10\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<78, \'11\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<85, \'12\', \'12+\')))))))))))) )AS \"Weeks In Arrears Band\",\r\n\r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<31, \'0 - 30\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<61, \'30 - 60\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<91, \'60 - 90\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<181, \'90 - 180\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<361, \'180 - 360\', \r\n \'> 360\'))))) AS \"Days in Arrears Band\"\r\n\r\n FROM m_office mo \r\n JOIN m_office ounder ON ounder.hierarchy like concat(mo.hierarchy, \'%\')\r\n AND ounder.hierarchy like CONCAT(\'${currentUserHierarchy}\', \'%\')\r\n INNER JOIN m_client mc ON mc.office_id=ounder.id\r\n INNER JOIN m_loan ml ON ml.client_id = mc.id\r\n INNER JOIN r_enum_value rev ON rev.enum_id=ml.loan_status_id\r\n INNER JOIN m_loan_arrears_aging laa ON laa.loan_id=ml.id\r\n left join m_currency cur on cur.code = ml.currency_code\r\n WHERE ml.loan_status_id=300\r\n AND mo.id=${officeId}\r\nORDER BY ounder.hierarchy, ifnull(cur.display_symbol, ml.currency_code), ml.account_no','Loan arrears aging (Weeks)',1,1),(53,'Aging Summary (Arrears in Weeks)','Table',NULL,'Loan','SELECT \r\n IFNULL(periods.currencyName, periods.currency) as currency, \r\n periods.period_no \'Weeks In Arrears (Up To)\', \r\n IFNULL(ars.loanId, 0) \'No Of Loans\', \r\n IFNULL(ars.principal,0.0) \'Original Principal\', \r\n IFNULL(ars.interest,0.0) \'Original Interest\', \r\n IFNULL(ars.prinPaid,0.0) \'Principal Paid\', \r\n IFNULL(ars.intPaid,0.0) \'Interest Paid\', \r\n IFNULL(ars.prinOverdue,0.0) \'Principal Overdue\', \r\n IFNULL(ars.intOverdue,0.0)\'Interest Overdue\'\r\nFROM \r\n /* full table of aging periods/currencies used combo to ensure each line represented */\r\n (SELECT curs.code as currency, curs.name as currencyName, pers.* from\r\n (SELECT \'On Schedule\' period_no,1 pid UNION\r\n SELECT \'1\',2 UNION\r\n SELECT \'2\',3 UNION\r\n SELECT \'3\',4 UNION\r\n SELECT \'4\',5 UNION\r\n SELECT \'5\',6 UNION\r\n SELECT \'6\',7 UNION\r\n SELECT \'7\',8 UNION\r\n SELECT \'8\',9 UNION\r\n SELECT \'9\',10 UNION\r\n SELECT \'10\',11 UNION\r\n SELECT \'11\',12 UNION\r\n SELECT \'12\',13 UNION\r\n SELECT \'12+\',14) pers,\r\n (SELECT distinctrow moc.code, moc.name\r\n FROM m_office mo2\r\n INNER JOIN m_office ounder2 ON ounder2.hierarchy \r\n LIKE CONCAT(mo2.hierarchy, \'%\')\r\nAND ounder2.hierarchy like CONCAT(\'${currentUserHierarchy}\', \'%\')\r\n INNER JOIN m_client mc2 ON mc2.office_id=ounder2.id\r\n INNER JOIN m_loan ml2 ON ml2.client_id = mc2.id\r\n INNER JOIN m_organisation_currency moc ON moc.code = ml2.currency_code\r\n WHERE ml2.loan_status_id=300 /* active */\r\n AND mo2.id=${officeId}\r\nAND (ml2.currency_code = \"$\{currencyId}\" or \"-1\" = \"$\{currencyId}\")) curs) periods\r\n\r\n\r\nLEFT JOIN /* table of aging periods per currency with gaps if no applicable loans */\r\n(SELECT \r\n z.currency, z.arrPeriod, \r\n COUNT(z.loanId) as loanId, SUM(z.principal) as principal, SUM(z.interest) as interest, \r\n SUM(z.prinPaid) as prinPaid, SUM(z.intPaid) as intPaid, \r\n SUM(z.prinOverdue) as prinOverdue, SUM(z.intOverdue) as intOverdue\r\nFROM\r\n /*derived table just used to get arrPeriod value (was much slower to\r\n duplicate calc of minOverdueDate in inner query)\r\nmight not be now with derived fields but didn’t check */\r\n (SELECT x.loanId, x.currency, x.principal, x.interest, x.prinPaid, x.intPaid, x.prinOverdue, x.intOverdue,\r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<1, \'On Schedule\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<8, \'1\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<15, \'2\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<22, \'3\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<29, \'4\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<36, \'5\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<43, \'6\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<50, \'7\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<57, \'8\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<64, \'9\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<71, \'10\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<78, \'11\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<85, \'12\',\r\n \'12+\'))))))))))))) AS arrPeriod\r\n\r\n FROM /* get the individual loan details */\r\n (SELECT ml.id AS loanId, ml.currency_code as currency,\r\n ml.principal_disbursed_derived as principal, \r\n ml.interest_charged_derived as interest, \r\n ml.principal_repaid_derived as prinPaid, \r\n ml.interest_repaid_derived intPaid,\r\n\r\n laa.principal_overdue_derived as prinOverdue,\r\n laa.interest_overdue_derived as intOverdue,\r\n\r\n IFNULL(laa.overdue_since_date_derived, curdate()) as minOverdueDate\r\n \r\n FROM m_office mo\r\n INNER JOIN m_office ounder ON ounder.hierarchy \r\n LIKE CONCAT(mo.hierarchy, \'%\')\r\nAND ounder.hierarchy like CONCAT(\'${currentUserHierarchy}\', \'%\')\r\n INNER JOIN m_client mc ON mc.office_id=ounder.id\r\n INNER JOIN m_loan ml ON ml.client_id = mc.id\r\n LEFT JOIN m_loan_arrears_aging laa on laa.loan_id = ml.id\r\n WHERE ml.loan_status_id=300 /* active */\r\n AND mo.id=${officeId}\r\n AND (ml.currency_code = \"$\{currencyId}\" or \"-1\" = \"$\{currencyId}\")\r\n GROUP BY ml.id) x\r\n ) z \r\nGROUP BY z.currency, z.arrPeriod ) ars ON ars.arrPeriod=periods.period_no and ars.currency = periods.currency\r\nORDER BY periods.currency, periods.pid','Loan amount in arrears by branch',1,1),(54,'Rescheduled Loans','Table',NULL,'Loan','SELECT \r\nconcat(repeat(\"..\", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as \"Office/Branch\",\r\nifnull(cur.display_symbol, ml.currency_code) as Currency, \r\nc.account_no as \"Client Account No.\",\r\nc.display_name AS \'Client Name\',\r\nml.account_no AS \'Loan Account No.\',\r\nmpl.name AS \'Product Name\',\r\nml.disbursedon_date AS \'Disbursed Date\',\r\nlt.transaction_date AS \'Written Off date\',\r\nml.principal_amount as \"Loan Amount\",\r\nifnull(lt.principal_portion_derived, 0) AS \'Rescheduled Principal\',\r\nifnull(lt.interest_portion_derived, 0) AS \'Rescheduled Interest\',\r\nifnull(lt.fee_charges_portion_derived,0) AS \'Rescheduled Fees\',\r\nifnull(lt.penalty_charges_portion_derived,0) AS \'Rescheduled Penalties\',\r\nn.note AS \'Reason For Rescheduling\',\r\nIFNULL(ms.display_name,\'-\') AS \'Loan Officer Name\'\r\nFROM m_office o\r\nJOIN m_office ounder ON ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nAND ounder.hierarchy like CONCAT(\'${currentUserHierarchy}\', \'%\')\r\nJOIN m_client c ON c.office_id = ounder.id\r\nJOIN m_loan ml ON ml.client_id = c.id\r\nJOIN m_product_loan mpl ON mpl.id=ml.product_id\r\nLEFT JOIN m_staff ms ON ms.id=ml.loan_officer_id\r\nJOIN m_loan_transaction lt ON lt.loan_id = ml.id\r\nLEFT JOIN m_note n ON n.loan_transaction_id = lt.id\r\nLEFT JOIN m_currency cur on cur.code = ml.currency_code\r\nWHERE lt.transaction_type_enum = 7 /*marked for rescheduling */\r\nAND lt.is_reversed is false \r\nAND ml.loan_status_id=602\r\nAND o.id=${officeId}\r\nAND (mpl.id=${loanProductId} OR ${loanProductId}=-1)\r\nAND lt.transaction_date BETWEEN \'${startDate}\' AND \'${endDate}\'\r\nAND (ml.currency_code = \"$\{currencyId}\" or \"-1\" = \"$\{currencyId}\")\r\nORDER BY ounder.hierarchy, ifnull(cur.display_symbol, ml.currency_code), ml.account_no','Individual Lending Report. Rescheduled Loans. The ability to reschedule (or mark that you have rescheduled the loan elsewhere) is a legacy of the older Mifos product. Needed for migration.',1,1),(55,'Active Loans Passed Final Maturity','Table',NULL,'Loan','select concat(repeat(\"..\", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as \"Office/Branch\",\r\nifnull(cur.display_symbol, l.currency_code) as Currency,\r\nlo.display_name as \"Loan Officer\", \r\nc.display_name as \"Client\", l.account_no as \"Loan Account No.\", pl.`name` as \"Product\", \r\nf.`name` as Fund, \r\nl.principal_amount as \"Loan Amount\", \r\nl.annual_nominal_interest_rate as \" Annual Nominal Interest Rate\", \r\ndate(l.disbursedon_date) as \"Disbursed Date\", \r\ndate(l.expected_maturedon_date) as \"Expected Matured On\",\r\n\r\nl.principal_repaid_derived as \"Principal Repaid\",\r\nl.principal_outstanding_derived as \"Principal Outstanding\",\r\nlaa.principal_overdue_derived as \"Principal Overdue\",\r\n\r\nl.interest_repaid_derived as \"Interest Repaid\",\r\nl.interest_outstanding_derived as \"Interest Outstanding\",\r\nlaa.interest_overdue_derived as \"Interest Overdue\",\r\n\r\nl.fee_charges_repaid_derived as \"Fees Repaid\",\r\nl.fee_charges_outstanding_derived as \"Fees Outstanding\",\r\nlaa.fee_charges_overdue_derived as \"Fees Overdue\",\r\n\r\nl.penalty_charges_repaid_derived as \"Penalties Repaid\",\r\nl.penalty_charges_outstanding_derived as \"Penalties Outstanding\",\r\nlaa.penalty_charges_overdue_derived as \"Penalties Overdue\"\r\n\r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on c.office_id = ounder.id\r\njoin m_loan l on l.client_id = c.id\r\njoin m_product_loan pl on pl.id = l.product_id\r\nleft join m_staff lo on lo.id = l.loan_officer_id\r\nleft join m_currency cur on cur.code = l.currency_code\r\nleft join m_fund f on f.id = l.fund_id\r\nleft join m_loan_arrears_aging laa on laa.loan_id = l.id\r\nwhere o.id = ${officeId}\r\nand (l.currency_code = \"$\{currencyId}\" or \"-1\" = \"$\{currencyId}\")\r\nand (l.product_id = \"${loanProductId}\" or \"-1\" = \"${loanProductId}\")\r\nand (ifnull(l.loan_officer_id, -10) = \"${loanOfficerId}\" or \"-1\" = \"${loanOfficerId}\")\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId})\r\nand (ifnull(l.loanpurpose_cv_id, -10) = ${loanPurposeId} or -1 = ${loanPurposeId})\r\nand l.loan_status_id = 300\r\nand l.expected_maturedon_date < curdate()\r\ngroup by l.id\r\norder by ounder.hierarchy, l.currency_code, c.account_no, l.account_no','Individual Client \n\nReport',1,1),(56,'Active Loans Passed Final Maturity Summary','Table',NULL,'Loan','select concat(repeat(\"..\", \r\n ((LENGTH(mo.`hierarchy`) - LENGTH(REPLACE(mo.`hierarchy`, \'.\', \'\')) - 1))), mo.`name`) as \"Office/Branch\", x.currency as Currency,\r\n x.client_count as \"No. of Clients\", x.active_loan_count as \"No. Active Loans\", x. arrears_loan_count as \"No. of Loans in Arrears\",\r\nx.principal as \"Total Loans Disbursed\", x.principal_repaid as \"Principal Repaid\", x.principal_outstanding as \"Principal Outstanding\", x.principal_overdue as \"Principal Overdue\",\r\nx.interest as \"Total Interest\", x.interest_repaid as \"Interest Repaid\", x.interest_outstanding as \"Interest Outstanding\", x.interest_overdue as \"Interest Overdue\",\r\nx.fees as \"Total Fees\", x.fees_repaid as \"Fees Repaid\", x.fees_outstanding as \"Fees Outstanding\", x.fees_overdue as \"Fees Overdue\",\r\nx.penalties as \"Total Penalties\", x.penalties_repaid as \"Penalties Repaid\", x.penalties_outstanding as \"Penalties Outstanding\", x.penalties_overdue as \"Penalties Overdue\",\r\n\r\n (case\r\n when ${parType} = 1 then\r\n cast(round((x.principal_overdue * 100) / x.principal_outstanding, 2) as char)\r\n when ${parType} = 2 then\r\n cast(round(((x.principal_overdue + x.interest_overdue) * 100) / (x.principal_outstanding + x.interest_outstanding), 2) as char)\r\n when ${parType} = 3 then\r\n cast(round(((x.principal_overdue + x.interest_overdue + x.fees_overdue) * 100) / (x.principal_outstanding + x.interest_outstanding + x.fees_outstanding), 2) as char)\r\n when ${parType} = 4 then\r\n cast(round(((x.principal_overdue + x.interest_overdue + x.fees_overdue + x.penalties_overdue) * 100) / (x.principal_outstanding + x.interest_outstanding + x.fees_outstanding + x.penalties_overdue), 2) as char)\r\n else \"invalid PAR Type\"\r\n end) as \"Portfolio at Risk %\"\r\n from m_office mo\r\njoin \r\n(select ounder.id as branch,\r\nifnull(cur.display_symbol, l.currency_code) as currency,\r\ncount(distinct(c.id)) as client_count, \r\ncount(distinct(l.id)) as active_loan_count,\r\ncount(distinct(laa.loan_id) ) as arrears_loan_count,\r\n\r\nsum(l.principal_disbursed_derived) as principal,\r\nsum(l.principal_repaid_derived) as principal_repaid,\r\nsum(l.principal_outstanding_derived) as principal_outstanding,\r\nsum(ifnull(laa.principal_overdue_derived,0)) as principal_overdue,\r\n\r\nsum(l.interest_charged_derived) as interest,\r\nsum(l.interest_repaid_derived) as interest_repaid,\r\nsum(l.interest_outstanding_derived) as interest_outstanding,\r\nsum(ifnull(laa.interest_overdue_derived,0)) as interest_overdue,\r\n\r\nsum(l.fee_charges_charged_derived) as fees,\r\nsum(l.fee_charges_repaid_derived) as fees_repaid,\r\nsum(l.fee_charges_outstanding_derived) as fees_outstanding,\r\nsum(ifnull(laa.fee_charges_overdue_derived,0)) as fees_overdue,\r\n\r\nsum(l.penalty_charges_charged_derived) as penalties,\r\nsum(l.penalty_charges_repaid_derived) as penalties_repaid,\r\nsum(l.penalty_charges_outstanding_derived) as penalties_outstanding,\r\nsum(ifnull(laa.penalty_charges_overdue_derived,0)) as penalties_overdue\r\n\r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on c.office_id = ounder.id\r\njoin m_loan l on l.client_id = c.id\r\nleft join m_currency cur on cur.code = l.currency_code\r\nleft join m_loan_arrears_aging laa on laa.loan_id = l.id\r\n\r\nwhere o.id = ${officeId}\r\nand (l.currency_code = \"$\{currencyId}\" or \"-1\" = \"$\{currencyId}\")\r\nand (l.product_id = \"${loanProductId}\" or \"-1\" = \"${loanProductId}\")\r\nand (ifnull(l.loan_officer_id, -10) = \"${loanOfficerId}\" or \"-1\" = \"${loanOfficerId}\")\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId})\r\nand (ifnull(l.loanpurpose_cv_id, -10) = ${loanPurposeId} or -1 = ${loanPurposeId})\r\nand l.loan_status_id = 300\r\nand l.expected_maturedon_date < curdate()\r\ngroup by ounder.id, l.currency_code) x on x.branch = mo.id\r\norder by mo.hierarchy, x.Currency',NULL,1,1),(57,'Active Loans in last installment','Table',NULL,'Loan','select concat(repeat(\"..\", \r\n ((LENGTH(lastInstallment.`hierarchy`) - LENGTH(REPLACE(lastInstallment.`hierarchy`, \'.\', \'\')) - 1))), lastInstallment.branch) as \"Office/Branch\",\r\nlastInstallment.Currency,\r\nlastInstallment.`Loan Officer`, \r\nlastInstallment.`Client Account No`, lastInstallment.`Client`, \r\nlastInstallment.`Loan Account No`, lastInstallment.`Product`, \r\nlastInstallment.`Fund`, lastInstallment.`Loan Amount`, \r\nlastInstallment.`Annual Nominal Interest Rate`, \r\nlastInstallment.`Disbursed`, lastInstallment.`Expected Matured On` ,\r\n\r\nl.principal_repaid_derived as \"Principal Repaid\",\r\nl.principal_outstanding_derived as \"Principal Outstanding\",\r\nlaa.principal_overdue_derived as \"Principal Overdue\",\r\n\r\nl.interest_repaid_derived as \"Interest Repaid\",\r\nl.interest_outstanding_derived as \"Interest Outstanding\",\r\nlaa.interest_overdue_derived as \"Interest Overdue\",\r\n\r\nl.fee_charges_repaid_derived as \"Fees Repaid\",\r\nl.fee_charges_outstanding_derived as \"Fees Outstanding\",\r\nlaa.fee_charges_overdue_derived as \"Fees Overdue\",\r\n\r\nl.penalty_charges_repaid_derived as \"Penalties Repaid\",\r\nl.penalty_charges_outstanding_derived as \"Penalties Outstanding\",\r\nlaa.penalty_charges_overdue_derived as \"Penalties Overdue\"\r\n\r\nfrom \r\n(select l.id as loanId, l.number_of_repayments, min(r.installment), \r\nounder.id, ounder.hierarchy, ounder.`name` as branch, \r\nifnull(cur.display_symbol, l.currency_code) as Currency,\r\nlo.display_name as \"Loan Officer\", c.account_no as \"Client Account No\",\r\nc.display_name as \"Client\", l.account_no as \"Loan Account No\", pl.`name` as \"Product\", \r\nf.`name` as Fund, l.principal_amount as \"Loan Amount\", \r\nl.annual_nominal_interest_rate as \"Annual Nominal Interest Rate\", \r\ndate(l.disbursedon_date) as \"Disbursed\", date(l.expected_maturedon_date) as \"Expected Matured On\"\r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on c.office_id = ounder.id\r\njoin m_loan l on l.client_id = c.id\r\njoin m_product_loan pl on pl.id = l.product_id\r\nleft join m_staff lo on lo.id = l.loan_officer_id\r\nleft join m_currency cur on cur.code = l.currency_code\r\nleft join m_fund f on f.id = l.fund_id\r\nleft join m_loan_repayment_schedule r on r.loan_id = l.id\r\nwhere o.id = ${officeId}\r\nand (l.currency_code = \"$\{currencyId}\" or \"-1\" = \"$\{currencyId}\")\r\nand (l.product_id = \"${loanProductId}\" or \"-1\" = \"${loanProductId}\")\r\nand (ifnull(l.loan_officer_id, -10) = \"${loanOfficerId}\" or \"-1\" = \"${loanOfficerId}\")\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId})\r\nand (ifnull(l.loanpurpose_cv_id, -10) = ${loanPurposeId} or -1 = ${loanPurposeId})\r\nand l.loan_status_id = 300\r\nand r.completed_derived is false\r\nand r.duedate >= curdate()\r\ngroup by l.id\r\nhaving l.number_of_repayments = min(r.installment)) lastInstallment\r\njoin m_loan l on l.id = lastInstallment.loanId\r\nleft join m_loan_arrears_aging laa on laa.loan_id = l.id\r\norder by lastInstallment.hierarchy, lastInstallment.Currency, lastInstallment.`Client Account No`, lastInstallment.`Loan Account No`','Individual Client \n\nReport',1,1),(58,'Active Loans in last installment Summary','Table',NULL,'Loan','select concat(repeat(\"..\", \r\n ((LENGTH(mo.`hierarchy`) - LENGTH(REPLACE(mo.`hierarchy`, \'.\', \'\')) - 1))), mo.`name`) as \"Office/Branch\", x.currency as Currency,\r\n x.client_count as \"No. of Clients\", x.active_loan_count as \"No. Active Loans\", x. arrears_loan_count as \"No. of Loans in Arrears\",\r\nx.principal as \"Total Loans Disbursed\", x.principal_repaid as \"Principal Repaid\", x.principal_outstanding as \"Principal Outstanding\", x.principal_overdue as \"Principal Overdue\",\r\nx.interest as \"Total Interest\", x.interest_repaid as \"Interest Repaid\", x.interest_outstanding as \"Interest Outstanding\", x.interest_overdue as \"Interest Overdue\",\r\nx.fees as \"Total Fees\", x.fees_repaid as \"Fees Repaid\", x.fees_outstanding as \"Fees Outstanding\", x.fees_overdue as \"Fees Overdue\",\r\nx.penalties as \"Total Penalties\", x.penalties_repaid as \"Penalties Repaid\", x.penalties_outstanding as \"Penalties Outstanding\", x.penalties_overdue as \"Penalties Overdue\",\r\n\r\n (case\r\n when ${parType} = 1 then\r\n cast(round((x.principal_overdue * 100) / x.principal_outstanding, 2) as char)\r\n when ${parType} = 2 then\r\n cast(round(((x.principal_overdue + x.interest_overdue) * 100) / (x.principal_outstanding + x.interest_outstanding), 2) as char)\r\n when ${parType} = 3 then\r\n cast(round(((x.principal_overdue + x.interest_overdue + x.fees_overdue) * 100) / (x.principal_outstanding + x.interest_outstanding + x.fees_outstanding), 2) as char)\r\n when ${parType} = 4 then\r\n cast(round(((x.principal_overdue + x.interest_overdue + x.fees_overdue + x.penalties_overdue) * 100) / (x.principal_outstanding + x.interest_outstanding + x.fees_outstanding + x.penalties_overdue), 2) as char)\r\n else \"invalid PAR Type\"\r\n end) as \"Portfolio at Risk %\"\r\n from m_office mo\r\njoin \r\n(select lastInstallment.branchId as branchId,\r\nlastInstallment.Currency,\r\ncount(distinct(lastInstallment.clientId)) as client_count, \r\ncount(distinct(lastInstallment.loanId)) as active_loan_count,\r\ncount(distinct(laa.loan_id) ) as arrears_loan_count,\r\n\r\nsum(l.principal_disbursed_derived) as principal,\r\nsum(l.principal_repaid_derived) as principal_repaid,\r\nsum(l.principal_outstanding_derived) as principal_outstanding,\r\nsum(ifnull(laa.principal_overdue_derived,0)) as principal_overdue,\r\n\r\nsum(l.interest_charged_derived) as interest,\r\nsum(l.interest_repaid_derived) as interest_repaid,\r\nsum(l.interest_outstanding_derived) as interest_outstanding,\r\nsum(ifnull(laa.interest_overdue_derived,0)) as interest_overdue,\r\n\r\nsum(l.fee_charges_charged_derived) as fees,\r\nsum(l.fee_charges_repaid_derived) as fees_repaid,\r\nsum(l.fee_charges_outstanding_derived) as fees_outstanding,\r\nsum(ifnull(laa.fee_charges_overdue_derived,0)) as fees_overdue,\r\n\r\nsum(l.penalty_charges_charged_derived) as penalties,\r\nsum(l.penalty_charges_repaid_derived) as penalties_repaid,\r\nsum(l.penalty_charges_outstanding_derived) as penalties_outstanding,\r\nsum(ifnull(laa.penalty_charges_overdue_derived,0)) as penalties_overdue\r\n\r\nfrom \r\n(select l.id as loanId, l.number_of_repayments, min(r.installment), \r\nounder.id as branchId, ounder.hierarchy, ounder.`name` as branch, \r\nifnull(cur.display_symbol, l.currency_code) as Currency,\r\nlo.display_name as \"Loan Officer\", c.id as clientId, c.account_no as \"Client Account No\",\r\nc.display_name as \"Client\", l.account_no as \"Loan Account No\", pl.`name` as \"Product\", \r\nf.`name` as Fund, l.principal_amount as \"Loan Amount\", \r\nl.annual_nominal_interest_rate as \"Annual Nominal Interest Rate\", \r\ndate(l.disbursedon_date) as \"Disbursed\", date(l.expected_maturedon_date) as \"Expected Matured On\"\r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on c.office_id = ounder.id\r\njoin m_loan l on l.client_id = c.id\r\njoin m_product_loan pl on pl.id = l.product_id\r\nleft join m_staff lo on lo.id = l.loan_officer_id\r\nleft join m_currency cur on cur.code = l.currency_code\r\nleft join m_fund f on f.id = l.fund_id\r\nleft join m_loan_repayment_schedule r on r.loan_id = l.id\r\nwhere o.id = ${officeId}\r\nand (l.currency_code = \"$\{currencyId}\" or \"-1\" = \"$\{currencyId}\")\r\nand (l.product_id = \"${loanProductId}\" or \"-1\" = \"${loanProductId}\")\r\nand (ifnull(l.loan_officer_id, -10) = \"${loanOfficerId}\" or \"-1\" = \"${loanOfficerId}\")\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId})\r\nand (ifnull(l.loanpurpose_cv_id, -10) = ${loanPurposeId} or -1 = ${loanPurposeId})\r\nand l.loan_status_id = 300\r\nand r.completed_derived is false\r\nand r.duedate >= curdate()\r\ngroup by l.id\r\nhaving l.number_of_repayments = min(r.installment)) lastInstallment\r\njoin m_loan l on l.id = lastInstallment.loanId\r\nleft join m_loan_arrears_aging laa on laa.loan_id = l.id\r\ngroup by lastInstallment.branchId) x on x.branchId = mo.id\r\norder by mo.hierarchy, x.Currency','Individual Client \n\nReport',1,1),(59,'Active Loans by Disbursal Period','Table',NULL,'Loan','select concat(repeat(\"..\", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as \"Office/Branch\",\r\nifnull(cur.display_symbol, l.currency_code) as Currency,\r\nc.account_no as \"Client Account No\", c.display_name as \"Client\", l.account_no as \"Loan Account No\", pl.`name` as \"Product\", \r\nf.`name` as Fund, \r\nl.principal_amount as \"Loan Principal Amount\", \r\nl.annual_nominal_interest_rate as \" Annual Nominal Interest Rate\", \r\ndate(l.disbursedon_date) as \"Disbursed Date\", \r\n\r\nl.total_expected_repayment_derived as \"Total Loan (P+I+F+Pen)\",\r\nl.total_repayment_derived as \"Total Repaid (P+I+F+Pen)\",\r\nlo.display_name as \"Loan Officer\"\r\n\r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on c.office_id = ounder.id\r\njoin m_loan l on l.client_id = c.id\r\njoin m_product_loan pl on pl.id = l.product_id\r\nleft join m_staff lo on lo.id = l.loan_officer_id\r\nleft join m_currency cur on cur.code = l.currency_code\r\nleft join m_fund f on f.id = l.fund_id\r\nleft join m_loan_arrears_aging laa on laa.loan_id = l.id\r\nwhere o.id = ${officeId}\r\nand (l.currency_code = \"$\{currencyId}\" or \"-1\" = \"$\{currencyId}\")\r\nand (l.product_id = \"${loanProductId}\" or \"-1\" = \"${loanProductId}\")\r\nand (ifnull(l.loan_officer_id, -10) = \"${loanOfficerId}\" or \"-1\" = \"${loanOfficerId}\")\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId})\r\nand (ifnull(l.loanpurpose_cv_id, -10) = ${loanPurposeId} or -1 = ${loanPurposeId})\r\nand l.disbursedon_date between \'${startDate}\' and \'${endDate}\'\r\nand l.loan_status_id = 300\r\ngroup by l.id\r\norder by ounder.hierarchy, l.currency_code, c.account_no, l.account_no','Individual Client \n\nReport',1,1),(61,'Aging Summary (Arrears in Months)','Table',NULL,'Loan','SELECT \r\n IFNULL(periods.currencyName, periods.currency) as currency, \r\n periods.period_no \'Days In Arrears\', \r\n IFNULL(ars.loanId, 0) \'No Of Loans\', \r\n IFNULL(ars.principal,0.0) \'Original Principal\', \r\n IFNULL(ars.interest,0.0) \'Original Interest\', \r\n IFNULL(ars.prinPaid,0.0) \'Principal Paid\', \r\n IFNULL(ars.intPaid,0.0) \'Interest Paid\', \r\n IFNULL(ars.prinOverdue,0.0) \'Principal Overdue\', \r\n IFNULL(ars.intOverdue,0.0)\'Interest Overdue\'\r\nFROM \r\n /* full table of aging periods/currencies used combo to ensure each line represented */\r\n (SELECT curs.code as currency, curs.name as currencyName, pers.* from\r\n (SELECT \'On Schedule\' period_no,1 pid UNION\r\n SELECT \'0 - 30\',2 UNION\r\n SELECT \'30 - 60\',3 UNION\r\n SELECT \'60 - 90\',4 UNION\r\n SELECT \'90 - 180\',5 UNION\r\n SELECT \'180 - 360\',6 UNION\r\n SELECT \'> 360\',7 ) pers,\r\n (SELECT distinctrow moc.code, moc.name\r\n FROM m_office mo2\r\n INNER JOIN m_office ounder2 ON ounder2.hierarchy \r\n LIKE CONCAT(mo2.hierarchy, \'%\')\r\nAND ounder2.hierarchy like CONCAT(\'${currentUserHierarchy}\', \'%\')\r\n INNER JOIN m_client mc2 ON mc2.office_id=ounder2.id\r\n INNER JOIN m_loan ml2 ON ml2.client_id = mc2.id\r\n INNER JOIN m_organisation_currency moc ON moc.code = ml2.currency_code\r\n WHERE ml2.loan_status_id=300 /* active */\r\n AND mo2.id=${officeId}\r\nAND (ml2.currency_code = \"$\{currencyId}\" or \"-1\" = \"$\{currencyId}\")) curs) periods\r\n\r\n\r\nLEFT JOIN /* table of aging periods per currency with gaps if no applicable loans */\r\n(SELECT \r\n z.currency, z.arrPeriod, \r\n COUNT(z.loanId) as loanId, SUM(z.principal) as principal, SUM(z.interest) as interest, \r\n SUM(z.prinPaid) as prinPaid, SUM(z.intPaid) as intPaid, \r\n SUM(z.prinOverdue) as prinOverdue, SUM(z.intOverdue) as intOverdue\r\nFROM\r\n /*derived table just used to get arrPeriod value (was much slower to\r\n duplicate calc of minOverdueDate in inner query)\r\nmight not be now with derived fields but didn’t check */\r\n (SELECT x.loanId, x.currency, x.principal, x.interest, x.prinPaid, x.intPaid, x.prinOverdue, x.intOverdue,\r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<1, \'On Schedule\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<31, \'0 - 30\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<61, \'30 - 60\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<91, \'60 - 90\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<181, \'90 - 180\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<361, \'180 - 360\', \r\n \'> 360\')))))) AS arrPeriod\r\n\r\n FROM /* get the individual loan details */\r\n (SELECT ml.id AS loanId, ml.currency_code as currency,\r\n ml.principal_disbursed_derived as principal, \r\n ml.interest_charged_derived as interest, \r\n ml.principal_repaid_derived as prinPaid, \r\n ml.interest_repaid_derived intPaid,\r\n\r\n laa.principal_overdue_derived as prinOverdue,\r\n laa.interest_overdue_derived as intOverdue,\r\n\r\n IFNULL(laa.overdue_since_date_derived, curdate()) as minOverdueDate\r\n \r\n FROM m_office mo\r\n INNER JOIN m_office ounder ON ounder.hierarchy \r\n LIKE CONCAT(mo.hierarchy, \'%\')\r\nAND ounder.hierarchy like CONCAT(\'${currentUserHierarchy}\', \'%\')\r\n INNER JOIN m_client mc ON mc.office_id=ounder.id\r\n INNER JOIN m_loan ml ON ml.client_id = mc.id\r\n LEFT JOIN m_loan_arrears_aging laa on laa.loan_id = ml.id\r\n WHERE ml.loan_status_id=300 /* active */\r\n AND mo.id=${officeId}\r\n AND (ml.currency_code = \"$\{currencyId}\" or \"-1\" = \"$\{currencyId}\")\r\n GROUP BY ml.id) x\r\n ) z \r\nGROUP BY z.currency, z.arrPeriod ) ars ON ars.arrPeriod=periods.period_no and ars.currency = periods.currency\r\nORDER BY periods.currency, periods.pid','Loan amount in arrears by branch',1,1),(91,'Loan Account Schedule','Pentaho',NULL,'Loan',NULL,NULL,1,0),(92,'Branch Expected Cash Flow','Pentaho',NULL,'Loan',NULL,NULL,1,1),(93,'Expected Payments By Date - Basic','Table',NULL,'Loan','SELECT \r\n ounder.name \'Office\', \r\n IFNULL(ms.display_name,\'-\') \'Loan Officer\',\r\n mc.account_no \'Client Account Number\',\r\n mc.display_name \'Name\',\r\n mp.name \'Product\',\r\n ml.account_no \'Loan Account Number\',\r\n mr.duedate \'Due Date\',\r\n mr.installment \'Installment\',\r\n cu.display_symbol \'Currency\',\r\n mr.principal_amount- IFNULL(mr.principal_completed_derived,0) \'Principal Due\',\r\n mr.interest_amount- IFNULL(IFNULL(mr.interest_completed_derived,mr.interest_waived_derived),0) \'Interest Due\', \r\n IFNULL(mr.fee_charges_amount,0)- IFNULL(IFNULL(mr.fee_charges_completed_derived,mr.fee_charges_waived_derived),0) \'Fees Due\', \r\n IFNULL(mr.penalty_charges_amount,0)- IFNULL(IFNULL(mr.penalty_charges_completed_derived,mr.penalty_charges_waived_derived),0) \'Penalty Due\',\r\n (mr.principal_amount- IFNULL(mr.principal_completed_derived,0)) +\r\n (mr.interest_amount- IFNULL(IFNULL(mr.interest_completed_derived,mr.interest_waived_derived),0)) + \r\n (IFNULL(mr.fee_charges_amount,0)- IFNULL(IFNULL(mr.fee_charges_completed_derived,mr.fee_charges_waived_derived),0)) + \r\n (IFNULL(mr.penalty_charges_amount,0)- IFNULL(IFNULL(mr.penalty_charges_completed_derived,mr.penalty_charges_waived_derived),0)) \'Total Due\', \r\n mlaa.total_overdue_derived \'Total Overdue\'\r\n \r\n FROM m_office mo\r\n JOIN m_office ounder ON ounder.hierarchy LIKE CONCAT(mo.hierarchy, \'%\')\r\n \r\n AND ounder.hierarchy like CONCAT(\'${currentUserHierarchy}\', \'%\')\r\n \r\n LEFT JOIN m_client mc ON mc.office_id=ounder.id\r\n LEFT JOIN m_loan ml ON ml.client_id=mc.id AND ml.loan_status_id=300\r\n LEFT JOIN m_loan_arrears_aging mlaa ON mlaa.loan_id=ml.id\r\n LEFT JOIN m_loan_repayment_schedule mr ON mr.loan_id=ml.id AND mr.completed_derived=0\r\n LEFT JOIN m_product_loan mp ON mp.id=ml.product_id\r\n LEFT JOIN m_staff ms ON ms.id=ml.loan_officer_id\r\n LEFT JOIN m_currency cu ON cu.code=ml.currency_code\r\n WHERE mo.id=${officeId}\r\n AND (IFNULL(ml.loan_officer_id, -10) = \"${loanOfficerId}\" OR \"-1\" = \"${loanOfficerId}\")\r\n AND mr.duedate BETWEEN \'${startDate}\' AND \'${endDate}\'\r\n ORDER BY ounder.id,mr.duedate,ml.account_no','Test',1,1),(94,'Expected Payments By Date - Formatted','Pentaho',NULL,'Loan',NULL,NULL,1,1); -INSERT INTO `stretchy_parameter` VALUES (1,'startDateSelect','startDate','startDate','date','date','today',NULL,NULL,NULL,NULL,NULL),(2,'endDateSelect','endDate','endDate','date','date','today',NULL,NULL,NULL,NULL,NULL),(3,'obligDateTypeSelect','obligDateType','obligDateType','select','number','0',NULL,NULL,NULL,'select * from\r\n(select 1 as id, \"Closed\" as `name` union all\r\nselect 2, \"Disbursal\" ) x\r\norder by x.`id`',NULL),(5,'OfficeIdSelectOne','officeId','Office','select','number','0',NULL,'Y',NULL,'select id, \r\nconcat(substring(\"........................................\", 1, \r\n \n\n((LENGTH(`hierarchy`) - LENGTH(REPLACE(`hierarchy`, \'.\', \'\')) - 1) * 4)), \r\n `name`) as tc\r\nfrom m_office\r\nwhere hierarchy like concat\n\n(\'${currentUserHierarchy}\', \'%\')\r\norder by hierarchy',NULL),(6,'loanOfficerIdSelectAll','loanOfficerId','Loan Officer','select','number','0',NULL,NULL,'Y','(select lo.id, lo.display_name as `Name` \r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\njoin m_staff lo on lo.office_id = ounder.id\r\nwhere lo.is_loan_officer = true\r\nand o.id = ${officeId})\r\nunion all\r\n(select -10, \'-\')\r\norder by 2',5),(10,'currencyIdSelectAll','currencyId','Currency','select','number','0',NULL,NULL,'Y','select `code`, `name`\r\nfrom m_organisation_currency\r\norder by `code`',NULL),(20,'fundIdSelectAll','fundId','Fund','select','number','0',NULL,NULL,'Y','(select id, `name`\r\nfrom m_fund)\r\nunion all\r\n(select -10, \'-\')\r\norder by 2',NULL),(25,'loanProductIdSelectAll','loanProductId','Product','select','number','0',NULL,NULL,'Y','select p.id, p.`name`\r\nfrom m_product_loan p\r\nwhere p.currency_code = \'$\{currencyId}\'\r\norder by 2',10),(26,'loanPurposeIdSelectAll','loanPurposeId','Loan Purpose','select','number','0',NULL,NULL,'Y','select -10 as id, \'-\' as code_value\r\nunion all\r\nselect * from (select v.id, v.code_value\r\nfrom m_code c\r\njoin m_code_value v on v.code_id = c.id\r\nwhere c.code_name = \"loanPurpose\"\r\norder by v.order_position) x',NULL),(100,'parTypeSelect','parType','parType','select','number','0',NULL,NULL,NULL,'select * from\r\n(select 1 as id, \"Principal Only\" as `name` union all\r\nselect 2, \"Principal + Interest\" union all\r\nselect 3, \"Principal + Interest + Fees\" union all\r\nselect 4, \"Principal + Interest + Fees + Penalties\") x\r\norder by x.`id`',NULL),(1001,'FullReportList',NULL,'n/a','n/a','n/a','n/a','Y',NULL,NULL,'select r.report_id, r.report_name, r.report_type, r.report_subtype, r.report_category,\r\n \n\nrp.parameter_id, rp.report_parameter_name, p.parameter_name\r\n from stretchy_report r\r\n left join stretchy_report_parameter rp on rp.report_id = r.report_id\r\n \n\nleft join stretchy_parameter p on p.parameter_id = rp.parameter_id\r\n where r.use_report is true\r\n and exists\r\n (\r\n select \'f\'\r\n from m_appuser_role ur \n\n\r\n join m_role r on r.id = ur.role_id\r\n join m_role_permission rp on rp.role_id = r.id\r\n join m_permission p on p.id = rp.permission_id\r\n where \n\nur.appuser_id = ${currentUserId}\r\n and (p.code in (\'ALL_FUNCTIONS_READ\', \'ALL_FUNCTIONS\') or p.code = concat(\"READ_\", r.report_name))\r\n )\r\n order by \n\nr.report_category, r.report_name, rp.parameter_id',NULL),(1002,'FullParameterList',NULL,'n/a','n/a','n/a','n/a','Y',NULL,NULL,'select sp.parameter_name, sp.parameter_variable, sp.parameter_label, sp.parameter_displayType, \r\nsp.parameter_FormatType, sp.parameter_default, sp.selectOne, sp.selectAll, spp.parameter_name as parentParameterName\r\nfrom stretchy_parameter sp\r\nleft join stretchy_parameter spp on spp.parameter_id = sp.parent_parameter_id\r\nwhere sp.special is null\r\nand exists \r\n (select \'f\' \r\n from stretchy_report sr\r\n join stretchy_report_parameter srp on srp.report_id = sr.report_id\r\n where sr.report_name in(${reportListing})\r\n and srp.parameter_id = sp.parameter_id\r\n )\r\norder by sp.parameter_id',NULL),(1003,'reportCategoryList',NULL,'n/a','n/a','n/a','n/a','Y',NULL,NULL,'select r.report_id, r.report_name, r.report_type, r.report_subtype, \n\nr.report_category,\r\n rp.parameter_id, rp.report_parameter_name, p.parameter_name\r\n from stretchy_report r\r\n left join stretchy_report_parameter rp on \n\nrp.report_id = r.report_id\r\n left join stretchy_parameter p on p.parameter_id = rp.parameter_id\r\n where r.report_category = \'${reportCategory}\'\r\n and \n\nr.use_report is true\r\n and exists\r\n (\r\n select \'f\'\r\n from m_appuser_role ur \r\n join m_role r on r.id = ur.role_id\r\n join m_role_permission rp on \n\nrp.role_id = r.id\r\n join m_permission p on p.id = rp.permission_id\r\n where ur.appuser_id = ${currentUserId}\r\n and (p.code in (\'ALL_FUNCTIONS_READ\', \n\n\'ALL_FUNCTIONS\') or p.code = concat(\"READ_\", r.report_name))\r\n )\r\n order by r.report_category, r.report_name, rp.parameter_id',NULL); -INSERT INTO `stretchy_report_parameter` VALUES (1,5,NULL),(2,5,NULL),(2,6,NULL),(2,10,NULL),(2,20,NULL),(2,25,NULL),(2,26,NULL),(5,5,NULL),(5,6,NULL),(5,10,NULL),(5,20,NULL),(5,25,NULL),(5,26,NULL),(6,5,NULL),(6,6,NULL),(6,10,NULL),(6,20,NULL),(6,25,NULL),(6,26,NULL),(7,5,NULL),(7,6,NULL),(7,10,NULL),(7,20,NULL),(7,25,NULL),(7,26,NULL),(8,5,NULL),(8,6,NULL),(8,10,NULL),(8,25,NULL),(8,26,NULL),(11,5,NULL),(11,6,NULL),(11,10,NULL),(11,20,NULL),(11,25,NULL),(11,26,NULL),(11,100,NULL),(12,5,NULL),(12,6,NULL),(12,10,NULL),(12,20,NULL),(12,25,NULL),(12,26,NULL),(13,1,NULL),(13,2,NULL),(13,3,NULL),(13,5,NULL),(13,6,NULL),(13,10,NULL),(13,20,NULL),(13,25,NULL),(13,26,NULL),(14,1,NULL),(14,2,NULL),(14,3,NULL),(14,5,NULL),(14,6,NULL),(14,10,NULL),(14,20,NULL),(14,25,NULL),(14,26,NULL),(15,5,NULL),(15,6,NULL),(15,10,NULL),(15,20,NULL),(15,25,NULL),(15,26,NULL),(15,100,NULL),(16,5,NULL),(16,6,NULL),(16,10,NULL),(16,20,NULL),(16,25,NULL),(16,26,NULL),(16,100,NULL),(20,1,NULL),(20,2,NULL),(20,10,NULL),(20,20,NULL),(21,1,NULL),(21,2,NULL),(21,5,NULL),(21,10,NULL),(21,20,NULL),(48,5,'branch'),(48,2,'date'),(49,5,'branch'),(49,1,'fromDate'),(49,2,'toDate'),(50,5,'branch'),(50,1,'fromDate'),(50,2,'toDate'),(51,1,NULL),(51,2,NULL),(51,5,NULL),(51,10,NULL),(51,25,NULL),(52,5,NULL),(53,5,NULL),(53,10,NULL),(54,1,NULL),(54,2,NULL),(54,5,NULL),(54,10,NULL),(54,25,NULL),(55,5,NULL),(55,6,NULL),(55,10,NULL),(55,20,NULL),(55,25,NULL),(55,26,NULL),(56,5,NULL),(56,6,NULL),(56,10,NULL),(56,20,NULL),(56,25,NULL),(56,26,NULL),(56,100,NULL),(57,5,NULL),(57,6,NULL),(57,10,NULL),(57,20,NULL),(57,25,NULL),(57,26,NULL),(58,5,NULL),(58,6,NULL),(58,10,NULL),(58,20,NULL),(58,25,NULL),(58,26,NULL),(58,100,NULL),(59,1,NULL),(59,2,NULL),(59,5,NULL),(59,6,NULL),(59,10,NULL),(59,20,NULL),(59,25,NULL),(59,26,NULL),(61,5,NULL),(61,10,NULL),(92,1,'fromDate'),(92,5,'selectOffice'),(92,2,'toDate'),(93,1,NULL),(93,2,NULL),(93,5,NULL),(93,6,NULL),(94,2,'endDate'),(94,6,'loanOfficerId'),(94,5,'officeId'),(94,1,'startDate'); - -insert into m_permission(`grouping`, `code`, entity_name, action_name, can_maker_checker) -select 'report', concat('READ_', r.report_name), r.report_name, 'READ', false -from stretchy_report r; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V50__add-grace-settings-to-loan-product.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V50__add-grace-settings-to-loan-product.sql deleted file mode 100644 index 6534844c6..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V50__add-grace-settings-to-loan-product.sql +++ /dev/null @@ -1,28 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_product_loan` -ADD COLUMN `grace_on_principal_periods` SMALLINT NULL DEFAULT NULL AFTER `max_number_of_repayments`, -ADD COLUMN `grace_on_interest_periods` SMALLINT NULL DEFAULT NULL AFTER `grace_on_principal_periods`, -ADD COLUMN `grace_interest_free_periods` SMALLINT NULL DEFAULT NULL AFTER `grace_on_interest_periods`; - -ALTER TABLE `m_loan` -ADD COLUMN `grace_on_principal_periods` SMALLINT NULL DEFAULT NULL AFTER `number_of_repayments`, -ADD COLUMN `grace_on_interest_periods` SMALLINT NULL DEFAULT NULL AFTER `grace_on_principal_periods`, -ADD COLUMN `grace_interest_free_periods` SMALLINT NULL DEFAULT NULL AFTER `grace_on_interest_periods`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V51__track-additional-details-related-to-installment-performance.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V51__track-additional-details-related-to-installment-performance.sql deleted file mode 100644 index 358475e50..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V51__track-additional-details-related-to-installment-performance.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_loan_repayment_schedule` -ADD COLUMN `obligations_met_on_date` DATE NULL DEFAULT NULL AFTER `completed_derived`; - -ALTER TABLE `m_loan_repayment_schedule` -CHANGE COLUMN `interest_waived_derived` `interest_waived_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `interest_writtenoff_derived` ; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V52__add_boolean_support_cols_to_acc_accounting_rule.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V52__add_boolean_support_cols_to_acc_accounting_rule.sql deleted file mode 100644 index f64a11df4..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V52__add_boolean_support_cols_to_acc_accounting_rule.sql +++ /dev/null @@ -1,25 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `acc_accounting_rule` - ADD COLUMN `allow_multiple_debits` tinyint NOT NULL DEFAULT '0' AFTER `debit_account_id`, - ADD COLUMN `allow_multiple_credits` tinyint NOT NULL DEFAULT '0' AFTER `credit_account_id`; - -ALTER TABLE acc_rule_tags - ADD UNIQUE KEY `UNIQUE_ACCOUNT_RULE_TAGS` (`acc_rule_id`,`tag_id`,`acc_type_enum`); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V53__track-advance-and-late-payments-on-installment.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V53__track-advance-and-late-payments-on-installment.sql deleted file mode 100644 index 897a7d762..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V53__track-advance-and-late-payments-on-installment.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_loan_repayment_schedule` -ADD COLUMN `total_paid_in_advance_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `penalty_charges_waived_derived`, -ADD COLUMN `total_paid_late_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `total_paid_in_advance_derived`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V54__charge-to-income-account-mappings.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V54__charge-to-income-account-mappings.sql deleted file mode 100644 index 4dd360f9a..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V54__charge-to-income-account-mappings.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `acc_product_mapping` - ADD COLUMN `charge_id` BIGINT NULL DEFAULT NULL AFTER `payment_type`, - ADD CONSTRAINT `FK_acc_product_mapping_m_charge` FOREIGN KEY (`charge_id`) REFERENCES `m_charge` (`id`); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V55__add-additional-transaction-processing-strategies.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V55__add-additional-transaction-processing-strategies.sql deleted file mode 100644 index 45c0be23c..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V55__add-additional-transaction-processing-strategies.sql +++ /dev/null @@ -1,31 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `ref_loan_transaction_processing_strategy` -DROP COLUMN `lastmodified_date` , -DROP COLUMN `lastmodifiedby_id` , -DROP COLUMN `created_date` , -DROP COLUMN `createdby_id` ; - - -INSERT INTO `ref_loan_transaction_processing_strategy` (`id`, `code`, `name`) VALUES -(5,'principal-interest-penalties-fees-order-strategy', 'Principal Interest Penalties Fees Order'); - -INSERT INTO `ref_loan_transaction_processing_strategy` (`id`,`code`, `name`) -VALUES (6,'interest-principal-penalties-fees-order-strategy', 'Interest Principal Penalties Fees Order'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V56__track-overpaid-amount-on-loans.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V56__track-overpaid-amount-on-loans.sql deleted file mode 100644 index a5117c4ee..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V56__track-overpaid-amount-on-loans.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_loan` -ADD COLUMN `total_overpaid_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `total_outstanding_derived`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V57__add_default_values_to_debit_and_credit_accounts_acc_accounting_rule.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V57__add_default_values_to_debit_and_credit_accounts_acc_accounting_rule.sql deleted file mode 100644 index 360950bf8..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V57__add_default_values_to_debit_and_credit_accounts_acc_accounting_rule.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `acc_accounting_rule` - CHANGE COLUMN `debit_account_id` `debit_account_id` BIGINT NULL DEFAULT NULL AFTER `office_id`, - CHANGE COLUMN `credit_account_id` `credit_account_id` BIGINT NULL DEFAULT NULL AFTER `allow_multiple_debits`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V58__create-holiday-tables_changed.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V58__create-holiday-tables_changed.sql deleted file mode 100644 index efaaa5038..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V58__create-holiday-tables_changed.sql +++ /dev/null @@ -1,41 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -create table `m_holiday`( -`id` BIGINT NOT NULL AUTO_INCREMENT, -`name` varchar(100) NOT NULL, -`from_date` DATETIME NOT NULL, -`to_date` DATETIME NOT NULL, -`description` varchar(100) NULL DEFAULT NULL, -PRIMARY KEY (`id`), -UNIQUE INDEX `holiday_name` (`name`) -); - -CREATE TABLE `m_holiday_office` ( - `holiday_id` BIGINT NOT NULL, - `office_id` BIGINT NOT NULL, - PRIMARY KEY (`holiday_id`, `office_id`), - INDEX `m_holiday_id_ibfk_1` (`holiday_id`), - INDEX `m_office_id_ibfk_2` (`office_id`), - CONSTRAINT `m_holiday_id_ibfk_1` FOREIGN KEY (`holiday_id`) REFERENCES `m_holiday` (`id`), - CONSTRAINT `m_office_id_ibfk_2` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`) -); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('organisation', 'CREATE_HOLIDAY', 'HOLIDAY', 'CREATE', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V59__add_group_roles_schema_and_permissions.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V59__add_group_roles_schema_and_permissions.sql deleted file mode 100644 index 5f1e6a891..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V59__add_group_roles_schema_and_permissions.sql +++ /dev/null @@ -1,41 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_code` (`code_name`, `is_system_defined`) VALUES ('GROUPROLE', 1); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'ASSIGNROLE_GROUP', 'GROUP', 'ASSIGNROLE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UNASSIGNROLE_GROUP', 'GROUP', 'UNASSIGNROLE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATEROLE_GROUP', 'GROUP', 'UPDATEROLE', 0); - -CREATE TABLE `m_group_roles` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `client_id` BIGINT NULL DEFAULT NULL, - `group_id` BIGINT NULL DEFAULT NULL, - `role_cv_id` INT NULL DEFAULT NULL, - PRIMARY KEY (`id`), - INDEX `FKGroupRoleClientId` (`client_id`), - INDEX `FKGroupRoleGroupId` (`group_id`), - INDEX `FK_grouprole_m_codevalue` (`role_cv_id`), - UNIQUE INDEX `UNIQUE_GROUP_ROLES` (`client_id`, `group_id`, `role_cv_id`), - CONSTRAINT `FKGroupRoleClientId` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`), - CONSTRAINT `FKGroupRoleGroupId` FOREIGN KEY (`group_id`) REFERENCES `m_group` (`id`), - CONSTRAINT `FK_grouprole_m_codevalue` FOREIGN KEY (`role_cv_id`) REFERENCES `m_code_value` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V5__update-savings-product-and-account-tables.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V5__update-savings-product-and-account-tables.sql deleted file mode 100644 index 509aff41c..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V5__update-savings-product-and-account-tables.sql +++ /dev/null @@ -1,30 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_savings_product` -DROP COLUMN `nominal_interest_rate_period_frequency_enum`, -CHANGE COLUMN `nominal_interest_rate_per_period` `nominal_annual_interest_rate` DECIMAL(19,6) NOT NULL, -CHANGE COLUMN `interest_period_enum` `interest_compounding_period_enum` SMALLINT NOT NULL; - - -ALTER TABLE `m_savings_account` -DROP COLUMN `annual_nominal_interest_rate`, -DROP COLUMN `nominal_interest_rate_period_frequency_enum`, -CHANGE COLUMN `nominal_interest_rate_per_period` `nominal_annual_interest_rate` DECIMAL(19,6) NOT NULL, -CHANGE COLUMN `interest_period_enum` `interest_compounding_period_enum` SMALLINT NOT NULL; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V60__quipo_dashboard_reports.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V60__quipo_dashboard_reports.sql deleted file mode 100644 index 429ac40c0..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V60__quipo_dashboard_reports.sql +++ /dev/null @@ -1,337 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -/* Leaving as out-of-box (but non-core reports) for now -could be removed later if people think too many non-generic -reports are being added -used in quipo TEVI dashboard (landing pages) */ - -DELETE FROM `stretchy_report` where report_name = 'FieldAgentStats'; -DELETE FROM `stretchy_report` where report_name = 'FieldAgentPrograms'; -DELETE FROM `stretchy_report` where report_name = 'ProgramDetails'; -DELETE FROM `stretchy_report` where report_name = 'ChildrenStaffList'; -DELETE FROM `stretchy_report` where report_name = 'CoordinatorStats'; -DELETE FROM `stretchy_report` where report_name = 'BranchManagerStats'; -DELETE FROM `stretchy_report` where report_name = 'ProgramDirectorStats'; -DELETE FROM `stretchy_report` where report_name = 'ProgramStats'; - -DELETE FROM `m_permission` where entity_name = 'FieldAgentStats'; -DELETE FROM `m_permission` where entity_name = 'FieldAgentPrograms'; -DELETE FROM `m_permission` where entity_name = 'ProgramDetails'; -DELETE FROM `m_permission` where entity_name = 'ChildrenStaffList'; -DELETE FROM `m_permission` where entity_name = 'CoordinatorStats'; -DELETE FROM `m_permission` where entity_name = 'BranchManagerStats'; -DELETE FROM `m_permission` where entity_name = 'ProgramDirectorStats'; -DELETE FROM `m_permission` where entity_name = 'ProgramStats'; - - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_category`, `core_report`, `use_report`, `description`, `report_sql`) -VALUES ('FieldAgentStats', 'Table', 'Quipo', false, false, 'Field Agent Statistics', - -" -select ifnull(cur.display_symbol, l.currency_code) as Currency, -/*This query will return more than one entry if more than one currency is used */ -count(distinct(c.id)) as activeClients, count(*) as activeLoans, -sum(l.principal_disbursed_derived) as disbursedAmount, -sum(l.principal_outstanding_derived) as loanOutstandingAmount, -round((sum(l.principal_outstanding_derived) * 100) / sum(l.principal_disbursed_derived),2) as loanOutstandingPC, -'???' as loanOverPaymentAmount, -sum( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - l.principal_outstanding_derived,0)) as portfolioAtRisk, - -round((sum( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - l.principal_outstanding_derived,0)) * 100) / sum(l.principal_outstanding_derived), 2) as portfolioAtRiskPC, - -count(distinct( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - c.id,null))) as clientsInDefault, -round((count(distinct( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - c.id,null))) * 100) / count(distinct(c.id)),2) as clientsInDefaultPC, -(sum(l.principal_disbursed_derived) / count(*)) as averageLoanAmount -from m_staff fa -join m_office o on o.id = fa.office_id - and o.hierarchy like concat('${currentUserHierarchy}', '%') -join m_group pgm on pgm.staff_id = fa.id -join m_loan l on l.group_id = pgm.id and l.client_id is not null -left join m_currency cur on cur.code = l.currency_code -left join m_loan_arrears_aging laa on laa.loan_id = l.id -join m_client c on c.id = l.client_id -where fa.id = ${staffId} -and l.loan_status_id = 300 -group by l.currency_code -"); - - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_category`, `core_report`, `use_report`, `description`, `report_sql`) -VALUES ('FieldAgentPrograms', 'Table', 'Quipo', false, false, 'List of Field Agent Programs', - -" -select pgm.id, pgm.display_name as `name`, sts.enum_message_property as status - from m_group pgm - join m_office o on o.id = pgm.office_id - and o.hierarchy like concat('${currentUserHierarchy}', '%') - left join r_enum_value sts on sts.enum_name = 'status_enum' and sts.enum_id = pgm.status_enum - where pgm.staff_id = ${staffId} -"); - - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_category`, `core_report`, `use_report`, `description`, `report_sql`) -VALUES ('ProgramDetails', 'Table', 'Quipo', false, false, 'List of Loans in a Program', - -" - select l.id as loanId, l.account_no as loanAccountNo, c.id as clientId, c.account_no as clientAccountNo, - pgm.display_name as programName, - -(select count(*) -from m_loan cy -where cy.group_id = pgm.id and cy.client_id =c.id -and cy.disbursedon_date <= l.disbursedon_date) as loanCycleNo, - -c.display_name as clientDisplayName, - ifnull(cur.display_symbol, l.currency_code) as Currency, -ifnull(l.principal_repaid_derived,0.0) as loanRepaidAmount, -ifnull(l.principal_outstanding_derived, 0.0) as loanOutstandingAmount, - '???' as loanInAdvanceAmount, - -ifnull(laa.principal_overdue_derived, 0.0) as loanInArrearsAmount, -if(ifnull(laa.principal_overdue_derived, 0.00) > 0, 'Yes', 'No') as inDefault, - -if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - l.principal_outstanding_derived,0) as portfolioAtRisk - - from m_group pgm - join m_office o on o.id = pgm.office_id - and o.hierarchy like concat('${currentUserHierarchy}', '%') - join m_loan l on l.group_id = pgm.id and l.client_id is not null - left join m_currency cur on cur.code = l.currency_code - join m_client c on c.id = l.client_id - left join m_loan_arrears_aging laa on laa.loan_id = l.id - where pgm.id = ${programId} - and l.loan_status_id = 300 -order by c.display_name, l.account_no - -"); - - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_category`, `core_report`, `use_report`, `description`, `report_sql`) -VALUES ('ChildrenStaffList', 'Table', 'Quipo', false, false, 'Get Next Level Down Staff', - -" - select s.id, s.display_name, -s.firstname, s.lastname, s.organisational_role_enum, -s.organisational_role_parent_staff_id, -sp.display_name as `organisational_role_parent_staff_display_name` -from m_staff s -join m_staff sp on s.organisational_role_parent_staff_id = sp.id -where s.organisational_role_parent_staff_id = ${staffId} -"); - - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_category`, `core_report`, `use_report`, `description`, `report_sql`) -VALUES ('CoordinatorStats', 'Table', 'Quipo', false, false, 'Coordinator Statistics', - -" -select ifnull(cur.display_symbol, l.currency_code) as Currency, -/*This query will return more than one entry if more than one currency is used */ -count(distinct(c.id)) as activeClients, count(*) as activeLoans, -sum(l.principal_disbursed_derived) as disbursedAmount, -sum(l.principal_outstanding_derived) as loanOutstandingAmount, -round((sum(l.principal_outstanding_derived) * 100) / sum(l.principal_disbursed_derived),2) as loanOutstandingPC, -'???' as loanOverPaymentAmount, -sum( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - l.principal_outstanding_derived,0)) as portfolioAtRisk, - -round((sum( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - l.principal_outstanding_derived,0)) * 100) / sum(l.principal_outstanding_derived), 2) as portfolioAtRiskPC, - -count(distinct( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - c.id,null))) as clientsInDefault, -round((count(distinct( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - c.id,null))) * 100) / count(distinct(c.id)),2) as clientsInDefaultPC, -(sum(l.principal_disbursed_derived) / count(*)) as averageLoanAmount -from m_staff coord -join m_staff fa on fa.organisational_role_parent_staff_id = coord.id -join m_office o on o.id = fa.office_id - and o.hierarchy like concat('${currentUserHierarchy}', '%') -join m_group pgm on pgm.staff_id = fa.id -join m_loan l on l.group_id = pgm.id and l.client_id is not null -left join m_currency cur on cur.code = l.currency_code -left join m_loan_arrears_aging laa on laa.loan_id = l.id -join m_client c on c.id = l.client_id -where coord.id = ${staffId} -and l.loan_status_id = 300 -group by l.currency_code -"); - - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_category`, `core_report`, `use_report`, `description`, `report_sql`) -VALUES ('BranchManagerStats', 'Table', 'Quipo', false, false, 'Branch Manager Statistics', - -" -select ifnull(cur.display_symbol, l.currency_code) as Currency, -/*This query will return more than one entry if more than one currency is used */ -count(distinct(c.id)) as activeClients, count(*) as activeLoans, -sum(l.principal_disbursed_derived) as disbursedAmount, -sum(l.principal_outstanding_derived) as loanOutstandingAmount, -round((sum(l.principal_outstanding_derived) * 100) / sum(l.principal_disbursed_derived),2) as loanOutstandingPC, -'???' as loanOverPaymentAmount, -sum( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - l.principal_outstanding_derived,0)) as portfolioAtRisk, - -round((sum( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - l.principal_outstanding_derived,0)) * 100) / sum(l.principal_outstanding_derived), 2) as portfolioAtRiskPC, - -count(distinct( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - c.id,null))) as clientsInDefault, -round((count(distinct( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - c.id,null))) * 100) / count(distinct(c.id)),2) as clientsInDefaultPC, -(sum(l.principal_disbursed_derived) / count(*)) as averageLoanAmount -from m_staff bm -join m_staff coord on coord.organisational_role_parent_staff_id = bm.id -join m_staff fa on fa.organisational_role_parent_staff_id = coord.id -join m_office o on o.id = fa.office_id - and o.hierarchy like concat('${currentUserHierarchy}', '%') -join m_group pgm on pgm.staff_id = fa.id -join m_loan l on l.group_id = pgm.id and l.client_id is not null -left join m_currency cur on cur.code = l.currency_code -left join m_loan_arrears_aging laa on laa.loan_id = l.id -join m_client c on c.id = l.client_id -where bm.id = ${staffId} -and l.loan_status_id = 300 -group by l.currency_code -"); - - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_category`, `core_report`, `use_report`, `description`, `report_sql`) -VALUES ('ProgramDirectorStats', 'Table', 'Quipo', false, false, 'Program DirectorStatistics', - -" -select ifnull(cur.display_symbol, l.currency_code) as Currency, -/*This query will return more than one entry if more than one currency is used */ -count(distinct(c.id)) as activeClients, count(*) as activeLoans, -sum(l.principal_disbursed_derived) as disbursedAmount, -sum(l.principal_outstanding_derived) as loanOutstandingAmount, -round((sum(l.principal_outstanding_derived) * 100) / sum(l.principal_disbursed_derived),2) as loanOutstandingPC, -'???' as loanOverPaymentAmount, -sum( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - l.principal_outstanding_derived,0)) as portfolioAtRisk, - -round((sum( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - l.principal_outstanding_derived,0)) * 100) / sum(l.principal_outstanding_derived), 2) as portfolioAtRiskPC, - -count(distinct( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - c.id,null))) as clientsInDefault, -round((count(distinct( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - c.id,null))) * 100) / count(distinct(c.id)),2) as clientsInDefaultPC, -(sum(l.principal_disbursed_derived) / count(*)) as averageLoanAmount -from m_staff pd -join m_staff bm on bm.organisational_role_parent_staff_id = pd.id -join m_staff coord on coord.organisational_role_parent_staff_id = bm.id -join m_staff fa on fa.organisational_role_parent_staff_id = coord.id -join m_office o on o.id = fa.office_id - and o.hierarchy like concat('${currentUserHierarchy}', '%') -join m_group pgm on pgm.staff_id = fa.id -join m_loan l on l.group_id = pgm.id and l.client_id is not null -left join m_currency cur on cur.code = l.currency_code -left join m_loan_arrears_aging laa on laa.loan_id = l.id -join m_client c on c.id = l.client_id -where pd.id = ${staffId} -and l.loan_status_id = 300 -group by l.currency_code -"); - - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_category`, `core_report`, `use_report`, `description`, `report_sql`) -VALUES ('ProgramStats', 'Table', 'Quipo', false, false, 'Program Statistics', - -" -select ifnull(cur.display_symbol, l.currency_code) as Currency, -/*This query will return more than one entry if more than one currency is used */ -count(distinct(c.id)) as activeClients, count(*) as activeLoans, -sum(l.principal_disbursed_derived) as disbursedAmount, -sum(l.principal_outstanding_derived) as loanOutstandingAmount, -round((sum(l.principal_outstanding_derived) * 100) / sum(l.principal_disbursed_derived),2) as loanOutstandingPC, -'???' as loanOverPaymentAmount, -sum( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - l.principal_outstanding_derived,0)) as portfolioAtRisk, - -round((sum( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - l.principal_outstanding_derived,0)) * 100) / sum(l.principal_outstanding_derived), 2) as portfolioAtRiskPC, - -count(distinct( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - c.id,null))) as clientsInDefault, -round((count(distinct( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - c.id,null))) * 100) / count(distinct(c.id)),2) as clientsInDefaultPC, -(sum(l.principal_disbursed_derived) / count(*)) as averageLoanAmount -from m_group pgm -join m_office o on o.id = pgm.office_id - and o.hierarchy like concat('${currentUserHierarchy}', '%') -join m_loan l on l.group_id = pgm.id and l.client_id is not null -left join m_currency cur on cur.code = l.currency_code -left join m_loan_arrears_aging laa on laa.loan_id = l.id -join m_client c on c.id = l.client_id -where pgm.id = ${programId} -and l.loan_status_id = 300 -group by l.currency_code -"); - - - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'READ_FieldAgentStats', 'FieldAgentStats', 'READ', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'READ_FieldAgentPrograms', 'FieldAgentPrograms', 'READ', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'READ_ProgramDetails', 'ProgramDetails', 'READ', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'READ_ChildrenStaffList', 'ChildrenStaffList', 'READ', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'READ_CoordinatorStats', 'CoordinatorStats', 'READ', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'READ_BranchManagerStats', 'BranchManagerStats', 'READ', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'READ_ProgramDirectorStats', 'ProgramDirectorStats', 'READ', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'READ_ProgramStats', 'ProgramStats', 'READ', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V61__txn_running_balance_example.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V61__txn_running_balance_example.sql deleted file mode 100644 index 008f93491..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V61__txn_running_balance_example.sql +++ /dev/null @@ -1,143 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -/* Leaving as out-of-box (but non-core report) for now -could be removed later if people think too many non-generic -reports are being added -similar example used in small MFI Elevate Africa */ - - -delete from stretchy_report_parameter -where report_id = (select r.id from stretchy_report r where r.report_name = 'TxnRunningBalances'); - -DELETE FROM `stretchy_report` where report_name = 'TxnRunningBalances'; - -DELETE FROM `m_permission` where entity_name = 'TxnRunningBalances'; - - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_category`, `core_report`, `use_report`, `description`, `report_sql`) -VALUES ('TxnRunningBalances', 'Table', 'Transaction', false, false, -"Running Balance Txn report for Individual Lending. -Suitable for small MFI's. Larger could use it using the branch or other parameters. -Basically, suck it and see if its quick enough for you out-of-te box or whether it needs performance work in your situation. -", - -" -select date('${startDate}') as 'Transaction Date', 'Opening Balance' as `Transaction Type`, null as Office, - null as 'Loan Officer', null as `Loan Account No`, null as `Loan Product`, null as `Currency`, - null as `Client Account No`, null as Client, - null as Amount, null as Principal, null as Interest, -@totalOutstandingPrincipal := -ifnull(round(sum( - if (txn.transaction_type_enum = 1 /* disbursement */, - ifnull(txn.amount,0.00), - ifnull(txn.principal_portion_derived,0.00) * -1)) - ,2),0.00) as 'Outstanding Principal', - -@totalInterestIncome := -ifnull(round(sum( - if (txn.transaction_type_enum in (2,5,8) /* repayment, repayment at disbursal, recovery repayment */, - ifnull(txn.interest_portion_derived,0.00), - 0)) - ,2),0.00) as 'Interest Income', - -@totalWriteOff := -ifnull(round(sum( - if (txn.transaction_type_enum = 6 /* write-off */, - ifnull(txn.principal_portion_derived,0.00), - 0)) - ,2),0.00) as 'Principal Write Off' -from m_office o -join m_office ounder on ounder.hierarchy like concat(o.hierarchy, '%') - and ounder.hierarchy like concat('${currentUserHierarchy}', '%') -join m_client c on c.office_id = ounder.id -join m_loan l on l.client_id = c.id -join m_product_loan lp on lp.id = l.product_id -join m_loan_transaction txn on txn.loan_id = l.id -left join m_currency cur on cur.code = l.currency_code -where txn.is_reversed = false -and txn.transaction_type_enum not in (10,11) -and o.id = ${officeId} -and txn.transaction_date < date('${startDate}') - -union all - -select x.`Transaction Date`, x.`Transaction Type`, x.Office, x.`Loan Officer`, x.`Loan Account No`, x.`Loan Product`, x.`Currency`, - x.`Client Account No`, x.Client, x.Amount, x.Principal, x.Interest, -cast(round( - if (x.transaction_type_enum = 1 /* disbursement */, - @totalOutstandingPrincipal := @totalOutstandingPrincipal + x.`Amount`, - @totalOutstandingPrincipal := @totalOutstandingPrincipal - x.`Principal`) - ,2) as decimal(19,2)) as 'Outstanding Principal', -cast(round( - if (x.transaction_type_enum in (2,5,8) /* repayment, repayment at disbursal, recovery repayment */, - @totalInterestIncome := @totalInterestIncome + x.`Interest`, - @totalInterestIncome) - ,2) as decimal(19,2)) as 'Interest Income', -cast(round( - if (x.transaction_type_enum = 6 /* write-off */, - @totalWriteOff := @totalWriteOff + x.`Principal`, - @totalWriteOff) - ,2) as decimal(19,2)) as 'Principal Write Off' -from -(select txn.transaction_type_enum, txn.id as txn_id, txn.transaction_date as 'Transaction Date', -cast( - ifnull(re.enum_message_property, concat('Unknown Transaction Type Value: ' , txn.transaction_type_enum)) - as char) as 'Transaction Type', -ounder.`name` as Office, lo.display_name as 'Loan Officer', -l.account_no as 'Loan Account No', lp.`name` as 'Loan Product', -ifnull(cur.display_symbol, l.currency_code) as Currency, -c.account_no as 'Client Account No', c.display_name as 'Client', -ifnull(txn.amount,0.00) as Amount, -ifnull(txn.principal_portion_derived,0.00) as Principal, -ifnull(txn.interest_portion_derived,0.00) as Interest -from m_office o -join m_office ounder on ounder.hierarchy like concat(o.hierarchy, '%') - and ounder.hierarchy like concat('${currentUserHierarchy}', '%') -join m_client c on c.office_id = ounder.id -join m_loan l on l.client_id = c.id -left join m_staff lo on lo.id = l.loan_officer_id -join m_product_loan lp on lp.id = l.product_id -join m_loan_transaction txn on txn.loan_id = l.id -left join m_currency cur on cur.code = l.currency_code -left join r_enum_value re on re.enum_name = 'transaction_type_enum' - and re.enum_id = txn.transaction_type_enum -where txn.is_reversed = false -and txn.transaction_type_enum not in (10,11) -and (ifnull(l.loan_officer_id, -10) = '${loanOfficerId}' or '-1' = '${loanOfficerId}') -and o.id = ${officeId} -and txn.transaction_date >= date('${startDate}') -and txn.transaction_date <= date('${endDate}') -order by txn.transaction_date, txn.id) x -"); - - - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'READ_TxnRunningBalances', 'TxnRunningBalances', 'READ', 0); - - -insert into stretchy_report_parameter (report_id, parameter_id) -select r.id, p.id -from stretchy_report r, -stretchy_parameter p -where r.report_name = 'TxnRunningBalances' -and p.parameter_name in ('startDateSelect', 'endDateSelect', 'OfficeIdSelectOne', - 'loanOfficerIdSelectAll'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V62__add_staff_id_to_m_client_changed.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V62__add_staff_id_to_m_client_changed.sql deleted file mode 100644 index b38b43f40..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V62__add_staff_id_to_m_client_changed.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UNASSIGNSTAFF_CLIENT', 'CLIENT', 'UNASSIGNSTAFF', 0); -ALTER TABLE m_client - ADD COLUMN `staff_id` BIGINT NULL DEFAULT NULL AFTER `office_id`, - ADD INDEX `client_staff_id` (`staff_id`), - ADD CONSTRAINT `FK_m_client_m_staff` FOREIGN KEY (`staff_id`) REFERENCES `m_staff` (`id`); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V63__add_sync_disbursement_with_meeting_column_to_loan.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V63__add_sync_disbursement_with_meeting_column_to_loan.sql deleted file mode 100644 index b79b0675f..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V63__add_sync_disbursement_with_meeting_column_to_loan.sql +++ /dev/null @@ -1,23 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - - -ALTER TABLE `m_loan` - ADD COLUMN `sync_disbursement_with_meeting` tinyint NULL AFTER `loan_transaction_strategy_id`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V64__add_permission_for_assign_staff.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V64__add_permission_for_assign_staff.sql deleted file mode 100644 index 5c68cbd85..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V64__add_permission_for_assign_staff.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'ASSIGNSTAFF_CLIENT', 'CLIENT', 'ASSIGNSTAFF', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V65__fix_rupee_symbol_issues.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V65__fix_rupee_symbol_issues.sql deleted file mode 100644 index 075dbf069..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V65__fix_rupee_symbol_issues.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -/***Work around for issues on non Unicode safe connections**/ -UPDATE `m_currency` SET `display_symbol`=CHAR(226, 130, 185) WHERE `id`=64; - -/***Update organization currencies if applicable***/ -update m_organisation_currency set display_symbol =CHAR(226, 130, 185) where code = "INR"; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V66__client_close_functionality.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V66__client_close_functionality.sql deleted file mode 100644 index fe7bcd1cb..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V66__client_close_functionality.sql +++ /dev/null @@ -1,26 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_code` (`code_name`, `is_system_defined`) VALUES ('ClientClosureReason', 1); - -ALTER TABLE `m_client` ADD COLUMN `closure_reason_cv_id` INT NULL DEFAULT NULL, -ADD COLUMN `closedon_date` DATE NULL DEFAULT NULL, -ADD CONSTRAINT `FK_m_client_m_code` FOREIGN KEY (`closure_reason_cv_id`) REFERENCES `m_code_value` (`id`); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`) VALUES ('portfolio', 'CLOSE_CLIENT', 'CLIENT', 'CLOSE'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V67__loans_in_advance_table.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V67__loans_in_advance_table.sql deleted file mode 100644 index 7bccdc82f..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V67__loans_in_advance_table.sql +++ /dev/null @@ -1,31 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -/* table contains details of loans that have had overpayments aka payments in advance */ - -CREATE TABLE `m_loan_paid_in_advance` ( - `loan_id` BIGINT NOT NULL, - `principal_in_advance_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `interest_in_advance_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `fee_charges_in_advance_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `penalty_charges_in_advance_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - `total_in_advance_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', - PRIMARY KEY (`loan_id`), - CONSTRAINT `m_loan_paid_in_advance_ibfk_1` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V68__quipo_dashboard_reports_updated.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V68__quipo_dashboard_reports_updated.sql deleted file mode 100644 index abed820cc..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V68__quipo_dashboard_reports_updated.sql +++ /dev/null @@ -1,343 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -/* Leaving as out-of-box (but non-core reports) for now -could be removed later if people think too many non-generic -reports are being added -used in quipo TEVI dashboard (landing pages) */ - -DELETE FROM `stretchy_report` where report_name = 'FieldAgentStats'; -DELETE FROM `stretchy_report` where report_name = 'FieldAgentPrograms'; -DELETE FROM `stretchy_report` where report_name = 'ProgramDetails'; -DELETE FROM `stretchy_report` where report_name = 'ChildrenStaffList'; -DELETE FROM `stretchy_report` where report_name = 'CoordinatorStats'; -DELETE FROM `stretchy_report` where report_name = 'BranchManagerStats'; -DELETE FROM `stretchy_report` where report_name = 'ProgramDirectorStats'; -DELETE FROM `stretchy_report` where report_name = 'ProgramStats'; - -DELETE FROM `m_permission` where entity_name = 'FieldAgentStats'; -DELETE FROM `m_permission` where entity_name = 'FieldAgentPrograms'; -DELETE FROM `m_permission` where entity_name = 'ProgramDetails'; -DELETE FROM `m_permission` where entity_name = 'ChildrenStaffList'; -DELETE FROM `m_permission` where entity_name = 'CoordinatorStats'; -DELETE FROM `m_permission` where entity_name = 'BranchManagerStats'; -DELETE FROM `m_permission` where entity_name = 'ProgramDirectorStats'; -DELETE FROM `m_permission` where entity_name = 'ProgramStats'; - - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_category`, `core_report`, `use_report`, `description`, `report_sql`) -VALUES ('FieldAgentStats', 'Table', 'Quipo', false, false, 'Field Agent Statistics', - -" -select ifnull(cur.display_symbol, l.currency_code) as Currency, -/*This query will return more than one entry if more than one currency is used */ -count(distinct(c.id)) as activeClients, count(*) as activeLoans, -sum(l.principal_disbursed_derived) as disbursedAmount, -sum(l.principal_outstanding_derived) as loanOutstandingAmount, -round((sum(l.principal_outstanding_derived) * 100) / sum(l.principal_disbursed_derived),2) as loanOutstandingPC, -sum(ifnull(lpa.principal_in_advance_derived,0.0)) as LoanPaidInAdvance, -sum( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - l.principal_outstanding_derived,0)) as portfolioAtRisk, - -round((sum( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - l.principal_outstanding_derived,0)) * 100) / sum(l.principal_outstanding_derived), 2) as portfolioAtRiskPC, - -count(distinct( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - c.id,null))) as clientsInDefault, -round((count(distinct( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - c.id,null))) * 100) / count(distinct(c.id)),2) as clientsInDefaultPC, -(sum(l.principal_disbursed_derived) / count(*)) as averageLoanAmount -from m_staff fa -join m_office o on o.id = fa.office_id - and o.hierarchy like concat('${currentUserHierarchy}', '%') -join m_group pgm on pgm.staff_id = fa.id -join m_loan l on l.group_id = pgm.id and l.client_id is not null -left join m_currency cur on cur.code = l.currency_code -left join m_loan_arrears_aging laa on laa.loan_id = l.id -left join m_loan_paid_in_advance lpa on lpa.loan_id = l.id -join m_client c on c.id = l.client_id -where fa.id = ${staffId} -and l.loan_status_id = 300 -group by l.currency_code -"); - - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_category`, `core_report`, `use_report`, `description`, `report_sql`) -VALUES ('FieldAgentPrograms', 'Table', 'Quipo', false, false, 'List of Field Agent Programs', - -" -select pgm.id, pgm.display_name as `name`, sts.enum_message_property as status - from m_group pgm - join m_office o on o.id = pgm.office_id - and o.hierarchy like concat('${currentUserHierarchy}', '%') - left join r_enum_value sts on sts.enum_name = 'status_enum' and sts.enum_id = pgm.status_enum - where pgm.staff_id = ${staffId} -"); - - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_category`, `core_report`, `use_report`, `description`, `report_sql`) -VALUES ('ProgramDetails', 'Table', 'Quipo', false, false, 'List of Loans in a Program', - -" - select l.id as loanId, l.account_no as loanAccountNo, c.id as clientId, c.account_no as clientAccountNo, - pgm.display_name as programName, - -(select count(*) -from m_loan cy -where cy.group_id = pgm.id and cy.client_id =c.id -and cy.disbursedon_date <= l.disbursedon_date) as loanCycleNo, - -c.display_name as clientDisplayName, - ifnull(cur.display_symbol, l.currency_code) as Currency, -ifnull(l.principal_repaid_derived,0.0) as loanRepaidAmount, -ifnull(l.principal_outstanding_derived, 0.0) as loanOutstandingAmount, -sum(ifnull(lpa.principal_in_advance_derived,0.0)) as LoanPaidInAdvance, - -ifnull(laa.principal_overdue_derived, 0.0) as loanInArrearsAmount, -if(ifnull(laa.principal_overdue_derived, 0.00) > 0, 'Yes', 'No') as inDefault, - -if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - l.principal_outstanding_derived,0) as portfolioAtRisk - - from m_group pgm - join m_office o on o.id = pgm.office_id - and o.hierarchy like concat('${currentUserHierarchy}', '%') - join m_loan l on l.group_id = pgm.id and l.client_id is not null - left join m_currency cur on cur.code = l.currency_code - join m_client c on c.id = l.client_id - left join m_loan_arrears_aging laa on laa.loan_id = l.id - left join m_loan_paid_in_advance lpa on lpa.loan_id = l.id - where pgm.id = ${programId} - and l.loan_status_id = 300 -order by c.display_name, l.account_no - -"); - - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_category`, `core_report`, `use_report`, `description`, `report_sql`) -VALUES ('ChildrenStaffList', 'Table', 'Quipo', false, false, 'Get Next Level Down Staff', - -" - select s.id, s.display_name, -s.firstname, s.lastname, s.organisational_role_enum, -s.organisational_role_parent_staff_id, -sp.display_name as `organisational_role_parent_staff_display_name` -from m_staff s -join m_staff sp on s.organisational_role_parent_staff_id = sp.id -where s.organisational_role_parent_staff_id = ${staffId} -"); - - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_category`, `core_report`, `use_report`, `description`, `report_sql`) -VALUES ('CoordinatorStats', 'Table', 'Quipo', false, false, 'Coordinator Statistics', - -" -select ifnull(cur.display_symbol, l.currency_code) as Currency, -/*This query will return more than one entry if more than one currency is used */ -count(distinct(c.id)) as activeClients, count(*) as activeLoans, -sum(l.principal_disbursed_derived) as disbursedAmount, -sum(l.principal_outstanding_derived) as loanOutstandingAmount, -round((sum(l.principal_outstanding_derived) * 100) / sum(l.principal_disbursed_derived),2) as loanOutstandingPC, -sum(ifnull(lpa.principal_in_advance_derived,0.0)) as LoanPaidInAdvance, -sum( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - l.principal_outstanding_derived,0)) as portfolioAtRisk, - -round((sum( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - l.principal_outstanding_derived,0)) * 100) / sum(l.principal_outstanding_derived), 2) as portfolioAtRiskPC, - -count(distinct( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - c.id,null))) as clientsInDefault, -round((count(distinct( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - c.id,null))) * 100) / count(distinct(c.id)),2) as clientsInDefaultPC, -(sum(l.principal_disbursed_derived) / count(*)) as averageLoanAmount -from m_staff coord -join m_staff fa on fa.organisational_role_parent_staff_id = coord.id -join m_office o on o.id = fa.office_id - and o.hierarchy like concat('${currentUserHierarchy}', '%') -join m_group pgm on pgm.staff_id = fa.id -join m_loan l on l.group_id = pgm.id and l.client_id is not null -left join m_currency cur on cur.code = l.currency_code -left join m_loan_arrears_aging laa on laa.loan_id = l.id -left join m_loan_paid_in_advance lpa on lpa.loan_id = l.id -join m_client c on c.id = l.client_id -where coord.id = ${staffId} -and l.loan_status_id = 300 -group by l.currency_code -"); - - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_category`, `core_report`, `use_report`, `description`, `report_sql`) -VALUES ('BranchManagerStats', 'Table', 'Quipo', false, false, 'Branch Manager Statistics', - -" -select ifnull(cur.display_symbol, l.currency_code) as Currency, -/*This query will return more than one entry if more than one currency is used */ -count(distinct(c.id)) as activeClients, count(*) as activeLoans, -sum(l.principal_disbursed_derived) as disbursedAmount, -sum(l.principal_outstanding_derived) as loanOutstandingAmount, -round((sum(l.principal_outstanding_derived) * 100) / sum(l.principal_disbursed_derived),2) as loanOutstandingPC, -sum(ifnull(lpa.principal_in_advance_derived,0.0)) as LoanPaidInAdvance, -sum( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - l.principal_outstanding_derived,0)) as portfolioAtRisk, - -round((sum( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - l.principal_outstanding_derived,0)) * 100) / sum(l.principal_outstanding_derived), 2) as portfolioAtRiskPC, - -count(distinct( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - c.id,null))) as clientsInDefault, -round((count(distinct( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - c.id,null))) * 100) / count(distinct(c.id)),2) as clientsInDefaultPC, -(sum(l.principal_disbursed_derived) / count(*)) as averageLoanAmount -from m_staff bm -join m_staff coord on coord.organisational_role_parent_staff_id = bm.id -join m_staff fa on fa.organisational_role_parent_staff_id = coord.id -join m_office o on o.id = fa.office_id - and o.hierarchy like concat('${currentUserHierarchy}', '%') -join m_group pgm on pgm.staff_id = fa.id -join m_loan l on l.group_id = pgm.id and l.client_id is not null -left join m_currency cur on cur.code = l.currency_code -left join m_loan_arrears_aging laa on laa.loan_id = l.id -left join m_loan_paid_in_advance lpa on lpa.loan_id = l.id -join m_client c on c.id = l.client_id -where bm.id = ${staffId} -and l.loan_status_id = 300 -group by l.currency_code -"); - - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_category`, `core_report`, `use_report`, `description`, `report_sql`) -VALUES ('ProgramDirectorStats', 'Table', 'Quipo', false, false, 'Program DirectorStatistics', - -" -select ifnull(cur.display_symbol, l.currency_code) as Currency, -/*This query will return more than one entry if more than one currency is used */ -count(distinct(c.id)) as activeClients, count(*) as activeLoans, -sum(l.principal_disbursed_derived) as disbursedAmount, -sum(l.principal_outstanding_derived) as loanOutstandingAmount, -round((sum(l.principal_outstanding_derived) * 100) / sum(l.principal_disbursed_derived),2) as loanOutstandingPC, -sum(ifnull(lpa.principal_in_advance_derived,0.0)) as LoanPaidInAdvance, -sum( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - l.principal_outstanding_derived,0)) as portfolioAtRisk, - -round((sum( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - l.principal_outstanding_derived,0)) * 100) / sum(l.principal_outstanding_derived), 2) as portfolioAtRiskPC, - -count(distinct( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - c.id,null))) as clientsInDefault, -round((count(distinct( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - c.id,null))) * 100) / count(distinct(c.id)),2) as clientsInDefaultPC, -(sum(l.principal_disbursed_derived) / count(*)) as averageLoanAmount -from m_staff pd -join m_staff bm on bm.organisational_role_parent_staff_id = pd.id -join m_staff coord on coord.organisational_role_parent_staff_id = bm.id -join m_staff fa on fa.organisational_role_parent_staff_id = coord.id -join m_office o on o.id = fa.office_id - and o.hierarchy like concat('${currentUserHierarchy}', '%') -join m_group pgm on pgm.staff_id = fa.id -join m_loan l on l.group_id = pgm.id and l.client_id is not null -left join m_currency cur on cur.code = l.currency_code -left join m_loan_arrears_aging laa on laa.loan_id = l.id -left join m_loan_paid_in_advance lpa on lpa.loan_id = l.id -join m_client c on c.id = l.client_id -where pd.id = ${staffId} -and l.loan_status_id = 300 -group by l.currency_code -"); - - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_category`, `core_report`, `use_report`, `description`, `report_sql`) -VALUES ('ProgramStats', 'Table', 'Quipo', false, false, 'Program Statistics', - -" -select ifnull(cur.display_symbol, l.currency_code) as Currency, -/*This query will return more than one entry if more than one currency is used */ -count(distinct(c.id)) as activeClients, count(*) as activeLoans, -sum(l.principal_disbursed_derived) as disbursedAmount, -sum(l.principal_outstanding_derived) as loanOutstandingAmount, -round((sum(l.principal_outstanding_derived) * 100) / sum(l.principal_disbursed_derived),2) as loanOutstandingPC, -sum(ifnull(lpa.principal_in_advance_derived,0.0)) as LoanPaidInAdvance, -sum( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - l.principal_outstanding_derived,0)) as portfolioAtRisk, - -round((sum( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - l.principal_outstanding_derived,0)) * 100) / sum(l.principal_outstanding_derived), 2) as portfolioAtRiskPC, - -count(distinct( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - c.id,null))) as clientsInDefault, -round((count(distinct( - if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - c.id,null))) * 100) / count(distinct(c.id)),2) as clientsInDefaultPC, -(sum(l.principal_disbursed_derived) / count(*)) as averageLoanAmount -from m_group pgm -join m_office o on o.id = pgm.office_id - and o.hierarchy like concat('${currentUserHierarchy}', '%') -join m_loan l on l.group_id = pgm.id and l.client_id is not null -left join m_currency cur on cur.code = l.currency_code -left join m_loan_arrears_aging laa on laa.loan_id = l.id -left join m_loan_paid_in_advance lpa on lpa.loan_id = l.id -join m_client c on c.id = l.client_id -where pgm.id = ${programId} -and l.loan_status_id = 300 -group by l.currency_code -"); - - - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'READ_FieldAgentStats', 'FieldAgentStats', 'READ', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'READ_FieldAgentPrograms', 'FieldAgentPrograms', 'READ', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'READ_ProgramDetails', 'ProgramDetails', 'READ', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'READ_ChildrenStaffList', 'ChildrenStaffList', 'READ', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'READ_CoordinatorStats', 'CoordinatorStats', 'READ', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'READ_BranchManagerStats', 'BranchManagerStats', 'READ', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'READ_ProgramDirectorStats', 'ProgramDirectorStats', 'READ', 0); - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) -VALUES ('report', 'READ_ProgramStats', 'ProgramStats', 'READ', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V69__loans_in_advance_initialise.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V69__loans_in_advance_initialise.sql deleted file mode 100644 index 7d8b5889a..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V69__loans_in_advance_initialise.sql +++ /dev/null @@ -1,38 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -/* initialises m_loan_paid_in_advance table... same sql is run in daily batch job */ - -truncate m_loan_paid_in_advance; - -INSERT INTO m_loan_paid_in_advance(loan_id, principal_in_advance_derived, interest_in_advance_derived, -fee_charges_in_advance_derived, penalty_charges_in_advance_derived, total_in_advance_derived) -select ml.id as loanId,SUM(ifnull(mr.principal_completed_derived, 0)) as principal_in_advance_derived, -SUM(ifnull(mr.interest_completed_derived, 0)) as interest_in_advance_derived, -SUM(ifnull(mr.fee_charges_completed_derived, 0)) as fee_charges_in_advance_derived, -SUM(ifnull(mr.penalty_charges_completed_derived, 0)) as penalty_charges_in_advance_derived, - -(SUM(ifnull(mr.principal_completed_derived, 0)) + SUM(ifnull(mr.interest_completed_derived, 0)) + -SUM(ifnull(mr.fee_charges_completed_derived, 0)) + SUM(ifnull(mr.penalty_charges_completed_derived, 0))) as total_in_advance_derived -FROM m_loan ml -INNER JOIN m_loan_repayment_schedule mr on mr.loan_id = ml.id -WHERE ml.loan_status_id = 300 and mr.duedate >= CURDATE() -GROUP BY ml.id -HAVING (SUM(ifnull(mr.principal_completed_derived, 0)) + SUM(ifnull(mr.interest_completed_derived, 0)) + -SUM(ifnull(mr.fee_charges_completed_derived, 0)) + SUM(ifnull(mr.penalty_charges_completed_derived, 0))) > 0.0 diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V6__add_min_max_principal_column_to_loan.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V6__add_min_max_principal_column_to_loan.sql deleted file mode 100644 index 339c601b7..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V6__add_min_max_principal_column_to_loan.sql +++ /dev/null @@ -1,26 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_product_loan` - ADD COLUMN `min_principal_amount` DECIMAL(19,6) NOT NULL AFTER `principal_amount`, - ADD COLUMN `max_principal_amount` DECIMAL(19,6) NOT NULL AFTER `min_principal_amount`; - -ALTER TABLE `m_loan` - ADD COLUMN `min_principal_amount` DECIMAL(19,6) NOT NULL AFTER `principal_amount`, - ADD COLUMN `max_principal_amount` DECIMAL(19,6) NOT NULL AFTER `min_principal_amount`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V70__quipo_program_detail_query_fix.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V70__quipo_program_detail_query_fix.sql deleted file mode 100644 index e2b507d4c..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V70__quipo_program_detail_query_fix.sql +++ /dev/null @@ -1,57 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -update stretchy_report -set report_sql = -" - select l.id as loanId, l.account_no as loanAccountNo, c.id as clientId, c.account_no as clientAccountNo, - pgm.display_name as programName, - -(select count(*) -from m_loan cy -where cy.group_id = pgm.id and cy.client_id =c.id -and cy.disbursedon_date <= l.disbursedon_date) as loanCycleNo, - -c.display_name as clientDisplayName, - ifnull(cur.display_symbol, l.currency_code) as Currency, -ifnull(l.principal_repaid_derived,0.0) as loanRepaidAmount, -ifnull(l.principal_outstanding_derived, 0.0) as loanOutstandingAmount, -ifnull(lpa.principal_in_advance_derived,0.0) as LoanPaidInAdvance, - -ifnull(laa.principal_overdue_derived, 0.0) as loanInArrearsAmount, -if(ifnull(laa.principal_overdue_derived, 0.00) > 0, 'Yes', 'No') as inDefault, - -if(date_sub(curdate(), interval 28 day) > ifnull(laa.overdue_since_date_derived, curdate()), - l.principal_outstanding_derived,0) as portfolioAtRisk - - from m_group pgm - join m_office o on o.id = pgm.office_id - and o.hierarchy like concat('${currentUserHierarchy}', '%') - join m_loan l on l.group_id = pgm.id and l.client_id is not null - left join m_currency cur on cur.code = l.currency_code - join m_client c on c.id = l.client_id - left join m_loan_arrears_aging laa on laa.loan_id = l.id - left join m_loan_paid_in_advance lpa on lpa.loan_id = l.id - where pgm.id = ${programId} - and l.loan_status_id = 300 -order by c.display_name, l.account_no - -" -where report_name = 'ProgramDetails'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V71__insert_reschedule_repayment_to_configuration.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V71__insert_reschedule_repayment_to_configuration.sql deleted file mode 100644 index 7256a03c9..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V71__insert_reschedule_repayment_to_configuration.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `c_configuration` (`name`, `enabled`) VALUES ('reschedule-future-repayments', 1); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V72__add_m_loan_counter_changes.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V72__add_m_loan_counter_changes.sql deleted file mode 100644 index 79d2d5e65..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V72__add_m_loan_counter_changes.sql +++ /dev/null @@ -1,38 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE m_product_loan - ADD COLUMN `include_in_borrower_cycle` tinyint NOT NULL DEFAULT '0'; - -CREATE TABLE `m_client_loan_counter` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `client_id` BIGINT NOT NULL, - `loan_product_id` BIGINT NOT NULL, - `loan_id` BIGINT NOT NULL, - `running_count` SMALLINT NOT NULL, - PRIMARY KEY (`id`), - INDEX `FK_m_client_id_loan_counter` (`client_id`), - INDEX `FK_m_loan_product_loan_counter` (`loan_product_id`), - INDEX `FK_m_client_loan_counter` (`loan_id`), - CONSTRAINT `FK_m_client_id_loan_counter` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`), - CONSTRAINT `FK_m_loan_product_loan_counter` FOREIGN KEY (`loan_product_id`) REFERENCES `m_product_loan` (`id`), - CONSTRAINT `FK_m_client_loan_counter` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V73__add_repayments_rescheduled_to_and_processed_column_to_holiday.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V73__add_repayments_rescheduled_to_and_processed_column_to_holiday.sql deleted file mode 100644 index 726aeaf43..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V73__add_repayments_rescheduled_to_and_processed_column_to_holiday.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_holiday` - ADD COLUMN `repayments_rescheduled_to` DATETIME NOT NULL AFTER `to_date`, - ADD COLUMN `processed` tinyint NOT NULL DEFAULT '0' AFTER `repayments_rescheduled_to`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V74__alter_m_loan_counter_table_add_group.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V74__alter_m_loan_counter_table_add_group.sql deleted file mode 100644 index b3b73c05d..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V74__alter_m_loan_counter_table_add_group.sql +++ /dev/null @@ -1,23 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -DROP TABLE `m_client_loan_counter`; -ALTER TABLE `m_loan` - ADD COLUMN `loan_counter` SMALLINT NULL DEFAULT NULL AFTER `sync_disbursement_with_meeting`, - ADD COLUMN `loan_product_counter` SMALLINT NULL DEFAULT NULL AFTER `loan_counter`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V75__add_reschedule-repayments-on-holidays_to_configuration.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V75__add_reschedule-repayments-on-holidays_to_configuration.sql deleted file mode 100644 index 20bc9e94a..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V75__add_reschedule-repayments-on-holidays_to_configuration.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `c_configuration` (`name`) VALUES ('reschedule-repayments-on-holidays'); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V76__rename_permission_grouping.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V76__rename_permission_grouping.sql deleted file mode 100644 index 06565dc48..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V76__rename_permission_grouping.sql +++ /dev/null @@ -1,31 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -/* break-out center and group permissions from porfolio grouping */ - -update m_permission -set `grouping` = "portfolio_center" -where code like '%center%' -and `grouping` like 'portfolio'; - - -update m_permission -set `grouping` = "portfolio_group" -where code like '%group%' -and `grouping` like 'portfolio'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V77__alter_m_product_loan_changes.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V77__alter_m_product_loan_changes.sql deleted file mode 100644 index 560130b4b..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V77__alter_m_product_loan_changes.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -alter table `m_product_loan` add column `start_date` DATE NULL DEFAULT NULL , -add column `close_date` DATE NULL DEFAULT NULL ; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V78__breakdown_portfolio_grouping.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V78__breakdown_portfolio_grouping.sql deleted file mode 100644 index 50f28d34f..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V78__breakdown_portfolio_grouping.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -/* grouping is misspelt but also should be under accounting */ - -update m_permission -set `grouping` = 'accounting' -where `grouping` = 'organistion'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V79__schedule_jobs_tables.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V79__schedule_jobs_tables.sql deleted file mode 100644 index c1196e071..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V79__schedule_jobs_tables.sql +++ /dev/null @@ -1,60 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `scheduled_jobs` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `job_name` VARCHAR(50) NOT NULL COLLATE 'latin1_swedish_ci', - `job_display_name` VARCHAR(50) NOT NULL COLLATE 'latin1_swedish_ci', - `cron_expression` VARCHAR(20) NOT NULL COLLATE 'latin1_swedish_ci', - `create_time` DATETIME NOT NULL, - `task_priority` SMALLINT NOT NULL DEFAULT '5', - `group_name` VARCHAR(50) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci', - `previous_run_start_time` DATETIME NULL DEFAULT NULL, - `next_run_time` DATETIME NULL DEFAULT NULL, - `trigger_key` VARCHAR(500) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci', - `job_initializing_errorlog` TEXT NULL COLLATE 'latin1_swedish_ci', - `is_active` tinyint NOT NULL DEFAULT '1', - PRIMARY KEY (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; - -CREATE TABLE `scheduled_job_runhistory` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `job_id` BIGINT NOT NULL, - `version` BIGINT NOT NULL, - `start_time` DATETIME NOT NULL, - `end_time` DATETIME NOT NULL, - `status` VARCHAR(10) NOT NULL COLLATE 'latin1_swedish_ci', - `errormessage` VARCHAR(500) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci', - `triggertype` VARCHAR(25) NOT NULL COLLATE 'latin1_swedish_ci', - `errorlog` TEXT NULL COLLATE 'latin1_swedish_ci', - PRIMARY KEY (`id`), - INDEX `scheduledjobsFK` (`job_id`), - CONSTRAINT `scheduledjobsFK` FOREIGN KEY (`job_id`) REFERENCES `scheduled_jobs` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; - - -INSERT INTO `scheduled_jobs` (`job_name`, `job_display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `trigger_key`, `job_initializing_errorlog`, `is_active`) VALUES ('Update loan Summary', 'Update loan Summary', '0 0 22 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1); -INSERT INTO `scheduled_jobs` (`job_name`, `job_display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `trigger_key`, `job_initializing_errorlog`, `is_active`) VALUES ('Update Loan Arrears Ageing', 'Update Loan Arrears Ageing', '0 1 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1); -INSERT INTO `scheduled_jobs` (`job_name`, `job_display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `trigger_key`, `job_initializing_errorlog`, `is_active`) VALUES ('Update Loan Paid In Advance', 'Update Loan Paid In Advance', '0 5 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1); -INSERT INTO `scheduled_jobs` (`job_name`, `job_display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `trigger_key`, `job_initializing_errorlog`, `is_active`) VALUES ('Apply Annual Fee For Savings', 'Apply Annual Fee For Savings', '0 20 22 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1); -INSERT INTO `scheduled_jobs` (`job_name`, `job_display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `trigger_key`, `job_initializing_errorlog`, `is_active`) VALUES ('Apply Holidays To Loans', 'Apply Holidays To Loans', '0 0 12 * * ?', now(), 5, NULL, NULL, NULL, NULL, NULL, 1); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V7__remove_read_makerchecker_permission.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V7__remove_read_makerchecker_permission.sql deleted file mode 100644 index a2456be20..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V7__remove_read_makerchecker_permission.sql +++ /dev/null @@ -1,32 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - - -/* -Remove READ_MAKERCHECKER permission as no longer used. -*/ - -delete from m_role_permission -where exists -(select 'f' from m_permission p -where p.id = m_role_permission.permission_id and p.code = 'READ_MAKERCHECKER'); - - -delete from m_permission -where code = 'READ_MAKERCHECKER'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V80__schedule_jobs_tables_updates.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V80__schedule_jobs_tables_updates.sql deleted file mode 100644 index e79993a70..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V80__schedule_jobs_tables_updates.sql +++ /dev/null @@ -1,39 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -RENAME TABLE `scheduled_jobs` TO `job`; -RENAME TABLE `scheduled_job_runhistory` TO `job_run_history`; - -ALTER TABLE `job` - ALTER `job_name` DROP DEFAULT, - ALTER `job_display_name` DROP DEFAULT; -ALTER TABLE `job` - CHANGE COLUMN `job_name` `name` VARCHAR(50) NOT NULL, - CHANGE COLUMN `job_display_name` `display_name` VARCHAR(50) NOT NULL; - -ALTER TABLE `job` - CHANGE COLUMN `job_initializing_errorlog` `initializing_errorlog` TEXT NULL; - - -ALTER TABLE `job_run_history` - ALTER `triggertype` DROP DEFAULT; -ALTER TABLE `job_run_history` - CHANGE COLUMN `errormessage` `error_message` VARCHAR(500) NULL DEFAULT NULL, - CHANGE COLUMN `triggertype` `trigger_type` VARCHAR(25) NOT NULL, - CHANGE COLUMN `errorlog` `error_log` TEXT NULL; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V81__savings_related_changes.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V81__savings_related_changes.sql deleted file mode 100644 index f1fca225c..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V81__savings_related_changes.sql +++ /dev/null @@ -1,88 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_note` -ADD COLUMN `savings_account_id` BIGINT NULL DEFAULT NULL AFTER `loan_transaction_id`, -ADD COLUMN `savings_account_transaction_id` BIGINT NULL DEFAULT NULL AFTER `savings_account_id`; - -ALTER TABLE `m_note` ADD CONSTRAINT `FK_savings_account_id` FOREIGN KEY (`savings_account_id` ) REFERENCES `m_savings_account` (`id` ) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD INDEX `FK_savings_account_id` (`savings_account_id` ASC) ; - - -ALTER TABLE `m_savings_account_transaction` -CHANGE COLUMN `is_reversed` `is_reversed` tinyint NOT NULL AFTER `transaction_type_enum`, -CHANGE COLUMN `balance_end_date_derived` `balance_end_date_derived` DATE NULL DEFAULT NULL AFTER `amount`, -CHANGE COLUMN `balance_number_of_days_derived` `balance_number_of_days_derived` INT NULL DEFAULT NULL AFTER `balance_end_date_derived`; - -ALTER TABLE `m_savings_account` -ADD COLUMN `field_officer_id` BIGINT DEFAULT NULL AFTER `product_id`, -ADD COLUMN `submittedon_date` DATE NOT NULL AFTER `status_enum`, -ADD COLUMN `submittedon_userid` BIGINT DEFAULT NULL AFTER `submittedon_date`, -ADD COLUMN `approvedon_date` DATE DEFAULT NULL AFTER `submittedon_userid`, -ADD COLUMN `approvedon_userid` BIGINT DEFAULT NULL AFTER `approvedon_date`, -ADD COLUMN `rejectedon_date` DATE DEFAULT NULL AFTER `approvedon_userid`, -ADD COLUMN `rejectedon_userid` BIGINT DEFAULT NULL AFTER `rejectedon_date`, -ADD COLUMN `withdrawnon_date` DATE DEFAULT NULL AFTER `rejectedon_userid`, -ADD COLUMN `withdrawnon_userid` BIGINT DEFAULT NULL AFTER `withdrawnon_date`; - -ALTER TABLE `m_savings_account` -CHANGE COLUMN `activation_date` `activatedon_date` DATE NULL DEFAULT NULL AFTER `withdrawnon_userid`; - -ALTER TABLE `m_savings_account` -ADD COLUMN `activatedon_userid` BIGINT DEFAULT NULL AFTER `activatedon_date`, -ADD COLUMN `closedon_date` DATE DEFAULT NULL AFTER `activatedon_userid`, -ADD COLUMN `closedon_userid` BIGINT DEFAULT NULL AFTER `closedon_date`; - -UPDATE `m_savings_account` -SET -`submittedon_date`=`activatedon_date`, -`approvedon_date`=`activatedon_date`; - - -INSERT INTO `m_permission` -(`grouping`,`code`,`entity_name`,`action_name`,`can_maker_checker`) -VALUES -('transaction_savings', 'APPROVE_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'APPROVE', 1), -('transaction_savings', 'REJECT_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'REJECT', 1), -('transaction_savings', 'WITHDRAW_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'WITHDRAW', 1), -('transaction_savings', 'APPROVALUNDO_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'APPROVALUNDO', 1), -('transaction_savings', 'CLOSE_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'CLOSE', 1); - -INSERT INTO `m_permission` -(`grouping`,`code`,`entity_name`,`action_name`,`can_maker_checker`) -VALUES -('transaction_savings', 'APPROVE_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'APPROVE', 0), -('transaction_savings', 'REJECT_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'REJECT', 0), -('transaction_savings', 'WITHDRAW_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'WITHDRAW', 0), -('transaction_savings', 'APPROVALUNDO_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'APPROVALUNDO', 0), -('transaction_savings', 'CLOSE_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'CLOSE', 0); - - --- Remove permissions with 'in the past' permissions - -DELETE FROM `m_permission` WHERE `id`='210'; - -DELETE FROM `m_permission` WHERE `id`='212'; -DELETE FROM `m_permission` WHERE `id`='214'; -DELETE FROM `m_permission` WHERE `id`='217'; -DELETE FROM `m_permission` WHERE `id`='220'; -DELETE FROM `m_permission` WHERE `id`='233'; -DELETE FROM `m_permission` WHERE `id`='235'; -DELETE FROM `m_permission` WHERE `id`='237'; -DELETE FROM `m_permission` WHERE `id`='240'; -DELETE FROM `m_permission` WHERE `id`='243'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V82__schedule_jobs_tables_updates_for_running_status.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V82__schedule_jobs_tables_updates_for_running_status.sql deleted file mode 100644 index da1bfa71a..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V82__schedule_jobs_tables_updates_for_running_status.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `job` - ADD COLUMN `currently_running` tinyint NOT NULL DEFAULT '0' AFTER `is_active`; - -ALTER TABLE `job` - CHANGE COLUMN `trigger_key` `job_key` VARCHAR(500) NULL DEFAULT NULL; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V83__non-working-days-table.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V83__non-working-days-table.sql deleted file mode 100644 index 1d346c41a..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V83__non-working-days-table.sql +++ /dev/null @@ -1,30 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -CREATE TABLE `m_working_days` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `recurrence` VARCHAR(100) NULL DEFAULT NULL, - `repayment_rescheduling_enum` SMALLINT NULL DEFAULT NULL, - PRIMARY KEY (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB -AUTO_INCREMENT=1; - -INSERT INTO `m_working_days` (`recurrence`, `repayment_rescheduling_enum`) VALUES ('FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA', 2); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V84__undo_savings_transaction_permission.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V84__undo_savings_transaction_permission.sql deleted file mode 100644 index b463457c4..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V84__undo_savings_transaction_permission.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` -(`grouping`,`code`,`entity_name`,`action_name`,`can_maker_checker`) -VALUES -('transaction_savings', 'UNDOTRANSACTION_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'UNDOTRANSACTION', 1), -('transaction_savings', 'UNDOTRANSACTION_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'UNDOTRANSACTION', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V85__product_mix_related_changes.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V85__product_mix_related_changes.sql deleted file mode 100644 index 6028480e8..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V85__product_mix_related_changes.sql +++ /dev/null @@ -1,38 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_portfolio_command_source` - ADD COLUMN `product_id` BIGINT NULL DEFAULT NULL AFTER `processing_result_enum`; - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'CREATE_PRODUCTMIX', 'PRODUCTMIX', 'CREATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATE_PRODUCTMIX', 'PRODUCTMIX', 'UPDATE', 0); -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'DELETE_PRODUCTMIX', 'PRODUCTMIX', 'DELETE', 0); - -CREATE TABLE `m_product_mix` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `product_id` BIGINT NOT NULL, - `restricted_product_id` BIGINT NOT NULL, - PRIMARY KEY (`id`), - INDEX `FK_m_product_mix_product_id_to_m_product_loan` (`product_id`), - INDEX `FK_m_product_mix_restricted_product_id_to_m_product_loan` (`restricted_product_id`), - CONSTRAINT `FK_m_product_mix_restricted_product_id_to_m_product_loan` FOREIGN KEY (`restricted_product_id`) REFERENCES `m_product_loan` (`id`), - CONSTRAINT `FK_m_product_mix_product_id_to_m_product_loan` FOREIGN KEY (`product_id`) REFERENCES `m_product_loan` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V86__update-working-days.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V86__update-working-days.sql deleted file mode 100644 index 87006a35c..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V86__update-working-days.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -TRUNCATE `m_working_days`; -INSERT INTO `m_working_days` (`recurrence`, `repayment_rescheduling_enum`) VALUES ('FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA,SU', 2); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V87__add_permission_for_scheduler.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V87__add_permission_for_scheduler.sql deleted file mode 100644 index d704d8830..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V87__add_permission_for_scheduler.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('jobs', 'UPDATE_SCHEDULER', 'SCHEDULER', 'UPDATE', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V88__added_update_constrain_for_scheduler_jobs.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V88__added_update_constrain_for_scheduler_jobs.sql deleted file mode 100644 index 599224db5..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V88__added_update_constrain_for_scheduler_jobs.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `job` - ADD COLUMN `updates_allowed` tinyint NOT NULL DEFAULT '1' AFTER `currently_running`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V89__added_scheduler_group.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V89__added_scheduler_group.sql deleted file mode 100644 index 5f5dbb448..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V89__added_scheduler_group.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `job` - ADD COLUMN `scheduler_group` SMALLINT NOT NULL DEFAULT '0' AFTER `updates_allowed`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V8__deposit-transaction-permissions-if-they-exist.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V8__deposit-transaction-permissions-if-they-exist.sql deleted file mode 100644 index 3a1576a69..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V8__deposit-transaction-permissions-if-they-exist.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -delete from m_permission where `grouping` = 'transaction_deposit'; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V90__client_performance_history_reports.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V90__client_performance_history_reports.sql deleted file mode 100644 index 989420068..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V90__client_performance_history_reports.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('ClientSummary ', 'Table', NULL, NULL, 'SELECT x.* FROM m_client c, m_office o, \n(\n SELECT a.loanCycle, a.activeLoans, b.lastLoanAmount, d.activeSavings, d.totalSavings FROM \n (SELECT IFNULL(MAX(l.loan_counter),0) AS loanCycle, COUNT(l.id) AS activeLoans FROM m_loan l WHERE l.loan_status_id=300 AND l.client_id=${clientId}) a, \n (SELECT count(l.id), IFNULL(l.principal_amount,0) AS \'lastLoanAmount\' FROM m_loan l WHERE l.client_id=${clientId} AND l.disbursedon_date = (SELECT IFNULL(MAX(disbursedon_date),NOW()) FROM m_loan where client_id=${clientId} and loan_status_id=300) group by l.principal_amount) b, \n (SELECT COUNT(s.id) AS \'activeSavings\', IFNULL(SUM(s.account_balance_derived),0) AS \'totalSavings\' FROM m_savings_account s WHERE s.status_enum=300 AND s.client_id=${clientId}) d\n) x\nWHERE c.id=${clientId} AND o.id = c.office_id AND o.hierarchy LIKE CONCAT(\'${currentUserHierarchy}\', \'%\')', 'Utility query for getting the client summary details', 1, 0); -INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('LoanCyclePerProduct', 'Table', NULL, NULL, 'SELECT lp.name AS \'productName\', MAX(l.loan_product_counter) AS \'loanProductCycle\' FROM m_loan l JOIN m_product_loan lp ON l.product_id=lp.id WHERE lp.include_in_borrower_cycle=1 AND l.loan_product_counter IS NOT NULL AND l.client_id=${clientId} GROUP BY l.product_id', 'Utility query for getting the client loan cycle details', 1, 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V91_1__configuration_settings_for_holiday_and_non_workingday.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V91_1__configuration_settings_for_holiday_and_non_workingday.sql deleted file mode 100644 index c5104db5b..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V91_1__configuration_settings_for_holiday_and_non_workingday.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `c_configuration` (`name`, `enabled`) VALUES ('allow-transactions-on-holiday', 0); -INSERT INTO `c_configuration` (`name`, `enabled`) VALUES ('allow-transactions-on-non_workingday', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V91__apply_annual_fees_permission.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V91__apply_annual_fees_permission.sql deleted file mode 100644 index 73aa40f85..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V91__apply_annual_fees_permission.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` -(`grouping`,`code`,`entity_name`,`action_name`,`can_maker_checker`) -VALUES -('transaction_savings', 'APPLYANNUALFEE_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'APPLYANNUALFEE', 1), -('transaction_savings', 'APPLYANNUALFEE_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'APPLYANNUALFEE', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V92__group_center_assign_staff_permission.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V92__group_center_assign_staff_permission.sql deleted file mode 100644 index c8c00c188..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V92__group_center_assign_staff_permission.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`,code,`entity_name`,`action_name`,`can_maker_checker`) -values('portfolio_group','ASSIGNSTAFF_GROUP','GROUP','ASSIGNSTAFF',0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V93__loan_transaction_external_id.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V93__loan_transaction_external_id.sql deleted file mode 100644 index c0f8c4d76..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V93__loan_transaction_external_id.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE m_loan_transaction -ADD COLUMN `external_id` VARCHAR(100) NULL DEFAULT NULL AFTER `is_reversed` , -ADD UNIQUE INDEX `external_id_UNIQUE` (`external_id` ASC) ; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V94__added_savings_accont type.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V94__added_savings_accont type.sql deleted file mode 100644 index ae45675fb..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V94__added_savings_accont type.sql +++ /dev/null @@ -1,21 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_savings_account` - ADD COLUMN `account_type_enum` SMALLINT NOT NULL DEFAULT '1' AFTER `status_enum`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V95__batch_job_postInterest.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V95__batch_job_postInterest.sql deleted file mode 100644 index 33f2c0bc0..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V95__batch_job_postInterest.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`) VALUES ('Post Interest For Savings', 'Post Interest For Savings', '0 0 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V96__savings_accounts_transfers_table.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V96__savings_accounts_transfers_table.sql deleted file mode 100644 index 637c59512..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V96__savings_accounts_transfers_table.sql +++ /dev/null @@ -1,75 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` -(`grouping`,`code`,`entity_name`,`action_name`,`can_maker_checker`) -VALUES -('transaction_savings', 'READ_ACCOUNTTRANSFER', 'ACCOUNTTRANSFER', 'READ', 0), -('transaction_savings', 'CREATE_ACCOUNTTRANSFER', 'ACCOUNTTRANSFER', 'CREATE', 1), -('transaction_savings', 'CREATE_ACCOUNTTRANSFER_CHECKER', 'ACCOUNTTRANSFER', 'CREATE', 0); - - -DROP TABLE IF EXISTS `m_savings_account_transfer`; - -CREATE TABLE `m_savings_account_transfer` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `from_office_id` BIGINT NOT NULL, - `to_office_id` BIGINT NOT NULL, - `from_client_id` BIGINT NOT NULL, - `to_client_id` BIGINT NOT NULL, - `from_savings_account_id` BIGINT DEFAULT NULL, - `to_savings_account_id` BIGINT DEFAULT NULL, - `from_loan_account_id` BIGINT DEFAULT NULL, - `to_loan_account_id` BIGINT DEFAULT NULL, - `from_savings_transaction_id` BIGINT DEFAULT NULL, - `from_loan_transaction_id` BIGINT DEFAULT NULL, - `to_savings_transaction_id` BIGINT DEFAULT NULL, - `to_loan_transaction_id` BIGINT DEFAULT NULL, - `is_reversed` tinyint NOT NULL, - `transaction_date` date NOT NULL, - `currency_code` varchar(3) NOT NULL, - `currency_digits` SMALLINT NOT NULL, - `amount` decimal(19,6) NOT NULL, - `description` varchar(200) NOT NULL, - PRIMARY KEY (`id`), - KEY `FKTRAN000000001` (`from_office_id`), - KEY `FKTRAN000000002` (`from_client_id`), - KEY `FKTRAN000000003` (`from_savings_account_id`), - KEY `FKTRAN000000004` (`to_office_id`), - KEY `FKTRAN000000005` (`to_client_id`), - KEY `FKTRAN000000006` (`to_savings_account_id`), - KEY `FKTRAN000000007` (`to_loan_account_id`), - KEY `FKTRAN000000008` (`from_savings_transaction_id`), - KEY `FKTRAN000000009` (`to_savings_transaction_id`), - KEY `FKTRAN000000010` (`to_loan_transaction_id`), - KEY `FKTRAN000000011` (`from_loan_account_id`), - KEY `FKTRAN000000012` (`from_loan_transaction_id`), - CONSTRAINT `FKTRAN000000001` FOREIGN KEY (`from_office_id`) REFERENCES `m_office` (`id`), - CONSTRAINT `FKTRAN000000002` FOREIGN KEY (`from_client_id`) REFERENCES `m_client` (`id`), - CONSTRAINT `FKTRAN000000003` FOREIGN KEY (`from_savings_account_id`) REFERENCES `m_savings_account` (`id`), - CONSTRAINT `FKTRAN000000004` FOREIGN KEY (`to_office_id`) REFERENCES `m_office` (`id`), - CONSTRAINT `FKTRAN000000005` FOREIGN KEY (`to_client_id`) REFERENCES `m_client` (`id`), - CONSTRAINT `FKTRAN000000006` FOREIGN KEY (`to_savings_account_id`) REFERENCES `m_savings_account` (`id`), - CONSTRAINT `FKTRAN000000007` FOREIGN KEY (`to_loan_account_id`) REFERENCES `m_loan` (`id`), - CONSTRAINT `FKTRAN000000008` FOREIGN KEY (`from_savings_transaction_id`) REFERENCES `m_savings_account_transaction` (`id`), - CONSTRAINT `FKTRAN000000009` FOREIGN KEY (`to_savings_transaction_id`) REFERENCES `m_savings_account_transaction` (`id`), - CONSTRAINT `FKTRAN000000010` FOREIGN KEY (`to_loan_transaction_id`) REFERENCES `m_loan_transaction` (`id`), - CONSTRAINT `FKTRAN000000011` FOREIGN KEY (`from_loan_account_id`) REFERENCES `m_loan` (`id`), - CONSTRAINT `FKTRAN000000012` FOREIGN KEY (`from_loan_transaction_id`) REFERENCES `m_loan_transaction` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V97__add_permission_for_adjust_savings_transaction.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V97__add_permission_for_adjust_savings_transaction.sql deleted file mode 100644 index 5093d4bf3..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V97__add_permission_for_adjust_savings_transaction.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('transaction_savings', 'ADJUSTTRANSACTION_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'ADJUSTTRANSACTION', 0); diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V98__added_currency_roundof_for_multipleof.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V98__added_currency_roundof_for_multipleof.sql deleted file mode 100644 index db023b4d1..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V98__added_currency_roundof_for_multipleof.sql +++ /dev/null @@ -1,31 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_savings_account` - ADD COLUMN `currency_multiplesof` SMALLINT NULL AFTER `currency_digits`; -ALTER TABLE `m_savings_product` - ADD COLUMN `currency_multiplesof` SMALLINT NULL AFTER `currency_digits`; -ALTER TABLE `m_loan` - ADD COLUMN `currency_multiplesof` SMALLINT NULL AFTER `currency_digits`; -ALTER TABLE `m_product_loan` - ADD COLUMN `currency_multiplesof` SMALLINT NULL AFTER `currency_digits`; -ALTER TABLE `m_currency` - ADD COLUMN `currency_multiplesof` SMALLINT NULL AFTER `decimal_places`; -ALTER TABLE `m_organisation_currency` - ADD COLUMN `currency_multiplesof` SMALLINT NULL AFTER `decimal_places`; diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V9__add_min_max_constraint_column_to_loan_loanproduct.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V9__add_min_max_constraint_column_to_loan_loanproduct.sql deleted file mode 100644 index 3ebaf3cb0..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V9__add_min_max_constraint_column_to_loan_loanproduct.sql +++ /dev/null @@ -1,56 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `m_product_loan` - ADD COLUMN `min_nominal_interest_rate_per_period` DECIMAL(19,6) NOT NULL AFTER `nominal_interest_rate_per_period`, - ADD COLUMN `max_nominal_interest_rate_per_period` DECIMAL(19,6) NOT NULL AFTER `min_nominal_interest_rate_per_period`, - ADD COLUMN `min_number_of_repayments` SMALLINT NOT NULL AFTER `number_of_repayments`, - ADD COLUMN `max_number_of_repayments` SMALLINT NOT NULL AFTER `min_number_of_repayments`; - -ALTER TABLE `m_loan` - ADD COLUMN `min_nominal_interest_rate_per_period` DECIMAL(19,6) NOT NULL AFTER `nominal_interest_rate_per_period`, - ADD COLUMN `max_nominal_interest_rate_per_period` DECIMAL(19,6) NOT NULL AFTER `min_nominal_interest_rate_per_period`, - ADD COLUMN `min_number_of_repayments` SMALLINT NOT NULL AFTER `number_of_repayments`, - ADD COLUMN `max_number_of_repayments` SMALLINT NOT NULL AFTER `min_number_of_repayments`; - -ALTER TABLE `m_loan` - ALTER `min_principal_amount` DROP DEFAULT, - ALTER `max_principal_amount` DROP DEFAULT; -ALTER TABLE `m_loan` - CHANGE COLUMN `min_principal_amount` `min_principal_amount` DECIMAL(19,6) NULL AFTER `principal_amount`, - CHANGE COLUMN `max_principal_amount` `max_principal_amount` DECIMAL(19,6) NULL AFTER `min_principal_amount`, - CHANGE COLUMN `min_nominal_interest_rate_per_period` `min_nominal_interest_rate_per_period` DECIMAL(19,6) NULL AFTER `nominal_interest_rate_per_period`, - CHANGE COLUMN `max_nominal_interest_rate_per_period` `max_nominal_interest_rate_per_period` DECIMAL(19,6) NULL AFTER `min_nominal_interest_rate_per_period`, - CHANGE COLUMN `min_number_of_repayments` `min_number_of_repayments` SMALLINT NULL AFTER `number_of_repayments`, - CHANGE COLUMN `max_number_of_repayments` `max_number_of_repayments` SMALLINT NULL AFTER `min_number_of_repayments`; - -ALTER TABLE `m_product_loan` - ALTER `min_principal_amount` DROP DEFAULT, - ALTER `max_principal_amount` DROP DEFAULT, - ALTER `min_nominal_interest_rate_per_period` DROP DEFAULT, - ALTER `max_nominal_interest_rate_per_period` DROP DEFAULT, - ALTER `min_number_of_repayments` DROP DEFAULT, - ALTER `max_number_of_repayments` DROP DEFAULT; -ALTER TABLE `m_product_loan` - CHANGE COLUMN `min_principal_amount` `min_principal_amount` DECIMAL(19,6) NULL AFTER `principal_amount`, - CHANGE COLUMN `max_principal_amount` `max_principal_amount` DECIMAL(19,6) NULL AFTER `min_principal_amount`, - CHANGE COLUMN `min_nominal_interest_rate_per_period` `min_nominal_interest_rate_per_period` DECIMAL(19,6) NULL AFTER `nominal_interest_rate_per_period`, - CHANGE COLUMN `max_nominal_interest_rate_per_period` `max_nominal_interest_rate_per_period` DECIMAL(19,6) NULL AFTER `min_nominal_interest_rate_per_period`, - CHANGE COLUMN `min_number_of_repayments` `min_number_of_repayments` SMALLINT NULL AFTER `number_of_repayments`, - CHANGE COLUMN `max_number_of_repayments` `max_number_of_repayments` SMALLINT NULL AFTER `min_number_of_repayments`; diff --git a/fineract-provider/src/main/resources/sql/migrations/list_db/V1__mifos-platform-shared-tenants.sql b/fineract-provider/src/main/resources/sql/migrations/list_db/V1__mifos-platform-shared-tenants.sql deleted file mode 100644 index 447092451..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/list_db/V1__mifos-platform-shared-tenants.sql +++ /dev/null @@ -1,113 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - --- MySQL dump 10.13 Distrib 5.1.60, for Win32 (ia32) --- --- Host: localhost Database: fineract_tenants --- ------------------------------------------------------ --- Server version 5.1.60-community - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES UTF8MB4 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - --- --- Table structure for table `tenants` --- - -DROP TABLE IF EXISTS `tenants`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = UTF8MB4 */; -CREATE TABLE `tenants` ( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `identifier` varchar(100) NOT NULL, - `name` varchar(100) NOT NULL, - `schema_name` varchar(100) NOT NULL, - `timezone_id` varchar(100) NOT NULL, - `country_id` INT DEFAULT NULL, - `joined_date` date DEFAULT NULL, - `created_date` datetime DEFAULT NULL, - `lastmodified_date` datetime DEFAULT NULL, - `schema_server` varchar(100) NOT NULL DEFAULT 'localhost', - `schema_server_port` varchar(10) NOT NULL DEFAULT '3306', - `schema_username` varchar(100) NOT NULL DEFAULT 'root', - `schema_password` varchar(100) NOT NULL DEFAULT 'mysql', - `auto_update` tinyint NOT NULL DEFAULT '1', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=UTF8MB4; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `tenants` --- - -LOCK TABLES `tenants` WRITE; -/*!40000 ALTER TABLE `tenants` DISABLE KEYS */; -INSERT INTO `tenants` VALUES (1,'${fineract.tenant.identifier}','${fineract.tenant.description}','${fineract.tenant.name}','${fineract.tenant.timezone}',NULL,NULL,NULL,NULL,'${fineract.tenant.host}','${fineract.tenant.port}','${fineract.tenant.username}','${fineract.tenant.password}',1); --- Add tenants to support interoperation multi-tenancy --- INSERT INTO `tenants` VALUES (2,'tn01','Buffalo','tn01','Africa/Bujumbura',NULL,NULL,NULL,NULL,'localhost','3306','root','mysql',1); --- INSERT INTO `tenants` VALUES (3,'tn02','Lion','tn02','Africa/Bujumbura',NULL,NULL,NULL,NULL,'localhost','3306','root','mysql',1); --- INSERT INTO `tenants` VALUES (4,'tn03','Rhino','tn03','Africa/Bujumbura',NULL,NULL,NULL,NULL,'localhost','3306','root','mysql',1); --- INSERT INTO `tenants` VALUES (5,'tn04','Elephant','tn04','Africa/Bujumbura',NULL,NULL,NULL,NULL,'localhost','3306','root','mysql',1); -/*!40000 ALTER TABLE `tenants` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `timezones` --- - -DROP TABLE IF EXISTS `timezones`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = UTF8MB4 */; -CREATE TABLE `timezones` ( - `id` INT NOT NULL AUTO_INCREMENT, - `country_code` varchar(2) NOT NULL, - `timezonename` varchar(100) NOT NULL, - `comments` varchar(150) DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=416 DEFAULT CHARSET=UTF8MB4; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `timezones` --- - -LOCK TABLES `timezones` WRITE; -/*!40000 ALTER TABLE `timezones` DISABLE KEYS */; -INSERT INTO `timezones` VALUES (1,'AD','Europe/Andorra',NULL),(2,'AE','Asia/Dubai',''),(3,'AF','Asia/Kabul',''),(4,'AG','America/Antigua',''),(5,'AI','America/Anguilla',''),(6,'AL','Europe/Tirane',''),(7,'AM','Asia/Yerevan',''),(8,'AO','Africa/Luanda',''),(9,'AQ','Antarctica/McMurdo','McMurdo Station, Ross Island'),(10,'AQ','Antarctica/South_Pole','Amundsen-Scott Station, South Pole'),(11,'AQ','Antarctica/Rothera','Rothera Station, Adelaide Island'),(12,'AQ','Antarctica/Palmer','Palmer Station, Anvers Island'),(13,'AQ','Antarctica/Mawson','Mawson Station, Holme Bay'),(14,'AQ','Antarctica/Davis','Davis Station, Vestfold Hills'),(15,'AQ','Antarctica/Casey','Casey Station, Bailey Peninsula'),(16,'AQ','Antarctica/Vostok','Vostok Station, Lake Vostok'),(17,'AQ','Antarctica/DumontDUrville','Dumont-dUrville Station, Terre Adelie'),(18,'AQ','Antarctica/Syowa','Syowa Station, E Ongul I'),(19,'AQ','Antarctica/Macquarie','Macquarie Island Station, Macquarie Island'),(20,'AR','America/Argentina/Buenos_Aires','Buenos Aires (BA, CF)'),(21,'AR','America/Argentina/Cordoba','most locations (CB, CC, CN, ER, FM, MN, SE, SF)'),(22,'AR','America/Argentina/Salta','(SA, LP, NQ, RN)'),(23,'AR','America/Argentina/Jujuy','Jujuy (JY)'),(24,'AR','America/Argentina/Tucuman','Tucuman (TM)'),(25,'AR','America/Argentina/Catamarca','Catamarca (CT), Chubut (CH)'),(26,'AR','America/Argentina/La_Rioja','La Rioja (LR)'),(27,'AR','America/Argentina/San_Juan','San Juan (SJ)'),(28,'AR','America/Argentina/Mendoza','Mendoza (MZ)'),(29,'AR','America/Argentina/San_Luis','San Luis (SL)'),(30,'AR','America/Argentina/Rio_Gallegos','Santa Cruz (SC)'),(31,'AR','America/Argentina/Ushuaia','Tierra del Fuego (TF)'),(32,'AS','Pacific/Pago_Pago',''),(33,'AT','Europe/Vienna',''),(34,'AU','Australia/Lord_Howe','Lord Howe Island'),(35,'AU','Australia/Hobart','Tasmania - most locations'),(36,'AU','Australia/Currie','Tasmania - King Island'),(37,'AU','Australia/Melbourne','Victoria'),(38,'AU','Australia/Sydney','New South Wales - most locations'),(39,'AU','Australia/Broken_Hill','New South Wales - Yancowinna'),(40,'AU','Australia/Brisbane','Queensland - most locations'),(41,'AU','Australia/Lindeman','Queensland - Holiday Islands'),(42,'AU','Australia/Adelaide','South Australia'),(43,'AU','Australia/Darwin','Northern Territory'),(44,'AU','Australia/Perth','Western Australia - most locations'),(45,'AU','Australia/Eucla','Western Australia - Eucla area'),(46,'AW','America/Aruba',''),(47,'AX','Europe/Mariehamn',''),(48,'AZ','Asia/Baku',''),(49,'BA','Europe/Sarajevo',''),(50,'BB','America/Barbados',''),(51,'BD','Asia/Dhaka',''),(52,'BE','Europe/Brussels',''),(53,'BF','Africa/Ouagadougou',''),(54,'BG','Europe/Sofia',''),(55,'BH','Asia/Bahrain',''),(56,'BI','Africa/Bujumbura',''),(57,'BJ','Africa/Porto-Novo',''),(58,'BL','America/St_Barthelemy',''),(59,'BM','Atlantic/Bermuda',''),(60,'BN','Asia/Brunei',''),(61,'BO','America/La_Paz',''),(62,'BQ','America/Kralendijk',''),(63,'BR','America/Noronha','Atlantic islands'),(64,'BR','America/Belem','Amapa, E Para'),(65,'BR','America/Fortaleza','NE Brazil (MA, PI, CE, RN, PB)'),(66,'BR','America/Recife','Pernambuco'),(67,'BR','America/Araguaina','Tocantins'),(68,'BR','America/Maceio','Alagoas, Sergipe'),(69,'BR','America/Bahia','Bahia'),(70,'BR','America/Sao_Paulo','S & SE Brazil (GO, DF, MG, ES, RJ, SP, PR, SC, RS)'),(71,'BR','America/Campo_Grande','Mato Grosso do Sul'),(72,'BR','America/Cuiaba','Mato Grosso'),(73,'BR','America/Santarem','W Para'),(74,'BR','America/Porto_Velho','Rondonia'),(75,'BR','America/Boa_Vista','Roraima'),(76,'BR','America/Manaus','E Amazonas'),(77,'BR','America/Eirunepe','W Amazonas'),(78,'BR','America/Rio_Branco','Acre'),(79,'BS','America/Nassau',''),(80,'BT','Asia/Thimphu',''),(81,'BW','Africa/Gaborone',''),(82,'BY','Europe/Minsk',''),(83,'BZ','America/Belize',''),(84,'CA','America/St_Johns','Newfoundland Time, including SE Labrador'),(85,'CA','America/Halifax','Atlantic Time - Nova Scotia (most places), PEI'),(86,'CA','America/Glace_Bay','Atlantic Time - Nova Scotia - places that did not observe DST 1966-1971'),(87,'CA','America/Moncton','Atlantic Time - New Brunswick'),(88,'CA','America/Goose_Bay','Atlantic Time - Labrador - most locations'),(89,'CA','America/Blanc-Sablon','Atlantic Standard Time - Quebec - Lower North Shore'),(90,'CA','America/Montreal','Eastern Time - Quebec - most locations'),(91,'CA','America/Toronto','Eastern Time - Ontario - most locations'),(92,'CA','America/Nipigon','Eastern Time - Ontario & Quebec - places that did not observe DST 1967-1973'),(93,'CA','America/Thunder_Bay','Eastern Time - Thunder Bay, Ontario'),(94,'CA','America/Iqaluit','Eastern Time - east Nunavut - most locations'),(95,'CA','America/Pangnirtung','Eastern Time - Pangnirtung, Nunavut'),(96,'CA','America/Resolute','Central Standard Time - Resolute, Nunavut'),(97,'CA','America/Atikokan','Eastern Standard Time - Atikokan, Ontario and Southampton I, Nunavut'),(98,'CA','America/Rankin_Inlet','Central Time - central Nunavut'),(99,'CA','America/Winnipeg','Central Time - Manitoba & west Ontario'),(100,'CA','America/Rainy_River','Central Time - Rainy River & Fort Frances, Ontario'),(101,'CA','America/Regina','Central Standard Time - Saskatchewan - most locations'),(102,'CA','America/Swift_Current','Central Standard Time - Saskatchewan - midwest'),(103,'CA','America/Edmonton','Mountain Time - Alberta, east British Columbia & west Saskatchewan'),(104,'CA','America/Cambridge_Bay','Mountain Time - west Nunavut'),(105,'CA','America/Yellowknife','Mountain Time - central Northwest Territories'),(106,'CA','America/Inuvik','Mountain Time - west Northwest Territories'),(107,'CA','America/Creston','Mountain Standard Time - Creston, British Columbia'),(108,'CA','America/Dawson_Creek','Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia'),(109,'CA','America/Vancouver','Pacific Time - west British Columbia'),(110,'CA','America/Whitehorse','Pacific Time - south Yukon'),(111,'CA','America/Dawson','Pacific Time - north Yukon'),(112,'CC','Indian/Cocos',''),(113,'CD','Africa/Kinshasa','west Dem. Rep. of Congo'),(114,'CD','Africa/Lubumbashi','east Dem. Rep. of Congo'),(115,'CF','Africa/Bangui',''),(116,'CG','Africa/Brazzaville',''),(117,'CH','Europe/Zurich',''),(118,'CI','Africa/Abidjan',''),(119,'CK','Pacific/Rarotonga',''),(120,'CL','America/Santiago','most locations'),(121,'CL','Pacific/Easter','Easter Island & Sala y Gomez'),(122,'CM','Africa/Douala',''),(123,'CN','Asia/Shanghai','east China - Beijing, Guangdong, Shanghai, etc.'),(124,'CN','Asia/Harbin','Heilongjiang (except Mohe), Jilin'),(125,'CN','Asia/Chongqing','central China - Sichuan, Yunnan, Guangxi, Shaanxi, Guizhou, etc.'),(126,'CN','Asia/Urumqi','most of Tibet & Xinjiang'),(127,'CN','Asia/Kashgar','west Tibet & Xinjiang'),(128,'CO','America/Bogota',''),(129,'CR','America/Costa_Rica',''),(130,'CU','America/Havana',''),(131,'CV','Atlantic/Cape_Verde',''),(132,'CW','America/Curacao',''),(133,'CX','Indian/Christmas',''),(134,'CY','Asia/Nicosia',''),(135,'CZ','Europe/Prague',''),(136,'DE','Europe/Berlin',''),(137,'DJ','Africa/Djibouti',''),(138,'DK','Europe/Copenhagen',''),(139,'DM','America/Dominica',''),(140,'DO','America/Santo_Domingo',''),(141,'DZ','Africa/Algiers',''),(142,'EC','America/Guayaquil','mainland'),(143,'EC','Pacific/Galapagos','Galapagos Islands'),(144,'EE','Europe/Tallinn',''),(145,'EG','Africa/Cairo',''),(146,'EH','Africa/El_Aaiun',''),(147,'ER','Africa/Asmara',''),(148,'ES','Europe/Madrid','mainland'),(149,'ES','Africa/Ceuta','Ceuta & Melilla'),(150,'ES','Atlantic/Canary','Canary Islands'),(151,'ET','Africa/Addis_Ababa',''),(152,'FI','Europe/Helsinki',''),(153,'FJ','Pacific/Fiji',''),(154,'FK','Atlantic/Stanley',''),(155,'FM','Pacific/Chuuk','Chuuk (Truk) and Yap'),(156,'FM','Pacific/Pohnpei','Pohnpei (Ponape)'),(157,'FM','Pacific/Kosrae','Kosrae'),(158,'FO','Atlantic/Faroe',''),(159,'FR','Europe/Paris',''),(160,'GA','Africa/Libreville',''),(161,'GB','Europe/London',''),(162,'GD','America/Grenada',''),(163,'GE','Asia/Tbilisi',''),(164,'GF','America/Cayenne',''),(165,'GG','Europe/Guernsey',''),(166,'GH','Africa/Accra',''),(167,'GI','Europe/Gibraltar',''),(168,'GL','America/Godthab','most locations'),(169,'GL','America/Danmarkshavn','east coast, north of Scoresbysund'),(170,'GL','America/Scoresbysund','Scoresbysund / Ittoqqortoormiit'),(171,'GL','America/Thule','Thule / Pituffik'),(172,'GM','Africa/Banjul',''),(173,'GN','Africa/Conakry',''),(174,'GP','America/Guadeloupe',''),(175,'GQ','Africa/Malabo',''),(176,'GR','Europe/Athens',''),(177,'GS','Atlantic/South_Georgia',''),(178,'GT','America/Guatemala',''),(179,'GU','Pacific/Guam',''),(180,'GW','Africa/Bissau',''),(181,'GY','America/Guyana',''),(182,'HK','Asia/Hong_Kong',''),(183,'HN','America/Tegucigalpa',''),(184,'HR','Europe/Zagreb',''),(185,'HT','America/Port-au-Prince',''),(186,'HU','Europe/Budapest',''),(187,'ID','Asia/Jakarta','Java & Sumatra'),(188,'ID','Asia/Pontianak','west & central Borneo'),(189,'ID','Asia/Makassar','east & south Borneo, Sulawesi (Celebes), Bali, Nusa Tengarra, west Timor'),(190,'ID','Asia/Jayapura','west New Guinea (Irian Jaya) & Malukus (Moluccas)'),(191,'IE','Europe/Dublin',''),(192,'IL','Asia/Jerusalem',''),(193,'IM','Europe/Isle_of_Man',''),(194,'IN','Asia/Kolkata',''),(195,'IO','Indian/Chagos',''),(196,'IQ','Asia/Baghdad',''),(197,'IR','Asia/Tehran',''),(198,'IS','Atlantic/Reykjavik',''),(199,'IT','Europe/Rome',''),(200,'JE','Europe/Jersey',''),(201,'JM','America/Jamaica',''),(202,'JO','Asia/Amman',''),(203,'JP','Asia/Tokyo',''),(204,'KE','Africa/Nairobi',''),(205,'KG','Asia/Bishkek',''),(206,'KH','Asia/Phnom_Penh',''),(207,'KI','Pacific/Tarawa','Gilbert Islands'),(208,'KI','Pacific/Enderbury','Phoenix Islands'),(209,'KI','Pacific/Kiritimati','Line Islands'),(210,'KM','Indian/Comoro',''),(211,'KN','America/St_Kitts',''),(212,'KP','Asia/Pyongyang',''),(213,'KR','Asia/Seoul',''),(214,'KW','Asia/Kuwait',''),(215,'KY','America/Cayman',''),(216,'KZ','Asia/Almaty','most locations'),(217,'KZ','Asia/Qyzylorda','Qyzylorda (Kyzylorda, Kzyl-Orda)'),(218,'KZ','Asia/Aqtobe','Aqtobe (Aktobe)'),(219,'KZ','Asia/Aqtau','Atyrau (Atirau, Guryev), Mangghystau (Mankistau)'),(220,'KZ','Asia/Oral','West Kazakhstan'),(221,'LA','Asia/Vientiane',''),(222,'LB','Asia/Beirut',''),(223,'LC','America/St_Lucia',''),(224,'LI','Europe/Vaduz',''),(225,'LK','Asia/Colombo',''),(226,'LR','Africa/Monrovia',''),(227,'LS','Africa/Maseru',''),(228,'LT','Europe/Vilnius',''),(229,'LU','Europe/Luxembourg',''),(230,'LV','Europe/Riga',''),(231,'LY','Africa/Tripoli',''),(232,'MA','Africa/Casablanca',''),(233,'MC','Europe/Monaco',''),(234,'MD','Europe/Chisinau',''),(235,'ME','Europe/Podgorica',''),(236,'MF','America/Marigot',''),(237,'MG','Indian/Antananarivo',''),(238,'MH','Pacific/Majuro','most locations'),(239,'MH','Pacific/Kwajalein','Kwajalein'),(240,'MK','Europe/Skopje',''),(241,'ML','Africa/Bamako',''),(242,'MM','Asia/Rangoon',''),(243,'MN','Asia/Ulaanbaatar','most locations'),(244,'MN','Asia/Hovd','Bayan-Olgiy, Govi-Altai, Hovd, Uvs, Zavkhan'),(245,'MN','Asia/Choibalsan','Dornod, Sukhbaatar'),(246,'MO','Asia/Macau',''),(247,'MP','Pacific/Saipan',''),(248,'MQ','America/Martinique',''),(249,'MR','Africa/Nouakchott',''),(250,'MS','America/Montserrat',''),(251,'MT','Europe/Malta',''),(252,'MU','Indian/Mauritius',''),(253,'MV','Indian/Maldives',''),(254,'MW','Africa/Blantyre',''),(255,'MX','America/Mexico_City','Central Time - most locations'),(256,'MX','America/Cancun','Central Time - Quintana Roo'),(257,'MX','America/Merida','Central Time - Campeche, Yucatan'),(258,'MX','America/Monterrey','Mexican Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas away from US border'),(259,'MX','America/Matamoros','US Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas near US border'),(260,'MX','America/Mazatlan','Mountain Time - S Baja, Nayarit, Sinaloa'),(261,'MX','America/Chihuahua','Mexican Mountain Time - Chihuahua away from US border'),(262,'MX','America/Ojinaga','US Mountain Time - Chihuahua near US border'),(263,'MX','America/Hermosillo','Mountain Standard Time - Sonora'),(264,'MX','America/Tijuana','US Pacific Time - Baja California near US border'),(265,'MX','America/Santa_Isabel','Mexican Pacific Time - Baja California away from US border'),(266,'MX','America/Bahia_Banderas','Mexican Central Time - Bahia de Banderas'),(267,'MY','Asia/Kuala_Lumpur','peninsular Malaysia'),(268,'MY','Asia/Kuching','Sabah & Sarawak'),(269,'MZ','Africa/Maputo',''),(270,'NA','Africa/Windhoek',''),(271,'NC','Pacific/Noumea',''),(272,'NE','Africa/Niamey',''),(273,'NF','Pacific/Norfolk',''),(274,'NG','Africa/Lagos',''),(275,'NI','America/Managua',''),(276,'NL','Europe/Amsterdam',''),(277,'NO','Europe/Oslo',''),(278,'NP','Asia/Kathmandu',''),(279,'NR','Pacific/Nauru',''),(280,'NU','Pacific/Niue',''),(281,'NZ','Pacific/Auckland','most locations'),(282,'NZ','Pacific/Chatham','Chatham Islands'),(283,'OM','Asia/Muscat',''),(284,'PA','America/Panama',''),(285,'PE','America/Lima',''),(286,'PF','Pacific/Tahiti','Society Islands'),(287,'PF','Pacific/Marquesas','Marquesas Islands'),(288,'PF','Pacific/Gambier','Gambier Islands'),(289,'PG','Pacific/Port_Moresby',''),(290,'PH','Asia/Manila',''),(291,'PK','Asia/Karachi',''),(292,'PL','Europe/Warsaw',''),(293,'PM','America/Miquelon',''),(294,'PN','Pacific/Pitcairn',''),(295,'PR','America/Puerto_Rico',''),(296,'PS','Asia/Gaza','Gaza Strip'),(297,'PS','Asia/Hebron','West Bank'),(298,'PT','Europe/Lisbon','mainland'),(299,'PT','Atlantic/Madeira','Madeira Islands'),(300,'PT','Atlantic/Azores','Azores'),(301,'PW','Pacific/Palau',''),(302,'PY','America/Asuncion',''),(303,'QA','Asia/Qatar',''),(304,'RE','Indian/Reunion',''),(305,'RO','Europe/Bucharest',''),(306,'RS','Europe/Belgrade',''),(307,'RU','Europe/Kaliningrad','Moscow-01 - Kaliningrad'),(308,'RU','Europe/Moscow','Moscow+00 - west Russia'),(309,'RU','Europe/Volgograd','Moscow+00 - Caspian Sea'),(310,'RU','Europe/Samara','Moscow+00 - Samara, Udmurtia'),(311,'RU','Asia/Yekaterinburg','Moscow+02 - Urals'),(312,'RU','Asia/Omsk','Moscow+03 - west Siberia'),(313,'RU','Asia/Novosibirsk','Moscow+03 - Novosibirsk'),(314,'RU','Asia/Novokuznetsk','Moscow+03 - Novokuznetsk'),(315,'RU','Asia/Krasnoyarsk','Moscow+04 - Yenisei River'),(316,'RU','Asia/Irkutsk','Moscow+05 - Lake Baikal'),(317,'RU','Asia/Yakutsk','Moscow+06 - Lena River'),(318,'RU','Asia/Vladivostok','Moscow+07 - Amur River'),(319,'RU','Asia/Sakhalin','Moscow+07 - Sakhalin Island'),(320,'RU','Asia/Magadan','Moscow+08 - Magadan'),(321,'RU','Asia/Kamchatka','Moscow+08 - Kamchatka'),(322,'RU','Asia/Anadyr','Moscow+08 - Bering Sea'),(323,'RW','Africa/Kigali',''),(324,'SA','Asia/Riyadh',''),(325,'SB','Pacific/Guadalcanal',''),(326,'SC','Indian/Mahe',''),(327,'SD','Africa/Khartoum',''),(328,'SE','Europe/Stockholm',''),(329,'SG','Asia/Singapore',''),(330,'SH','Atlantic/St_Helena',''),(331,'SI','Europe/Ljubljana',''),(332,'SJ','Arctic/Longyearbyen',''),(333,'SK','Europe/Bratislava',''),(334,'SL','Africa/Freetown',''),(335,'SM','Europe/San_Marino',''),(336,'SN','Africa/Dakar',''),(337,'SO','Africa/Mogadishu',''),(338,'SR','America/Paramaribo',''),(339,'SS','Africa/Juba',''),(340,'ST','Africa/Sao_Tome',''),(341,'SV','America/El_Salvador',''),(342,'SX','America/Lower_Princes',''),(343,'SY','Asia/Damascus',''),(344,'SZ','Africa/Mbabane',''),(345,'TC','America/Grand_Turk',''),(346,'TD','Africa/Ndjamena',''),(347,'TF','Indian/Kerguelen',''),(348,'TG','Africa/Lome',''),(349,'TH','Asia/Bangkok',''),(350,'TJ','Asia/Dushanbe',''),(351,'TK','Pacific/Fakaofo',''),(352,'TL','Asia/Dili',''),(353,'TM','Asia/Ashgabat',''),(354,'TN','Africa/Tunis',''),(355,'TO','Pacific/Tongatapu',''),(356,'TR','Europe/Istanbul',''),(357,'TT','America/Port_of_Spain',''),(358,'TV','Pacific/Funafuti',''),(359,'TW','Asia/Taipei',''),(360,'TZ','Africa/Dar_es_Salaam',''),(361,'UA','Europe/Kiev','most locations'),(362,'UA','Europe/Uzhgorod','Ruthenia'),(363,'UA','Europe/Zaporozhye','Zaporozhye, E Lugansk / Zaporizhia, E Luhansk'),(364,'UA','Europe/Simferopol','central Crimea'),(365,'UG','Africa/Kampala',''),(366,'UM','Pacific/Johnston','Johnston Atoll'),(367,'UM','Pacific/Midway','Midway Islands'),(368,'UM','Pacific/Wake','Wake Island'),(369,'US','America/New_York','Eastern Time'),(370,'US','America/Detroit','Eastern Time - Michigan - most locations'),(371,'US','America/Kentucky/Louisville','Eastern Time - Kentucky - Louisville area'),(372,'US','America/Kentucky/Monticello','Eastern Time - Kentucky - Wayne County'),(373,'US','America/Indiana/Indianapolis','Eastern Time - Indiana - most locations'),(374,'US','America/Indiana/Vincennes','Eastern Time - Indiana - Daviess, Dubois, Knox & Martin Counties'),(375,'US','America/Indiana/Winamac','Eastern Time - Indiana - Pulaski County'),(376,'US','America/Indiana/Marengo','Eastern Time - Indiana - Crawford County'),(377,'US','America/Indiana/Petersburg','Eastern Time - Indiana - Pike County'),(378,'US','America/Indiana/Vevay','Eastern Time - Indiana - Switzerland County'),(379,'US','America/Chicago','Central Time'),(380,'US','America/Indiana/Tell_City','Central Time - Indiana - Perry County'),(381,'US','America/Indiana/Knox','Central Time - Indiana - Starke County'),(382,'US','America/Menominee','Central Time - Michigan - Dickinson, Gogebic, Iron & Menominee Counties'),(383,'US','America/North_Dakota/Center','Central Time - North Dakota - Oliver County'),(384,'US','America/North_Dakota/New_Salem','Central Time - North Dakota - Morton County (except Mandan area)'),(385,'US','America/North_Dakota/Beulah','Central Time - North Dakota - Mercer County'),(386,'US','America/Denver','Mountain Time'),(387,'US','America/Boise','Mountain Time - south Idaho & east Oregon'),(388,'US','America/Shiprock','Mountain Time - Navajo'),(389,'US','America/Phoenix','Mountain Standard Time - Arizona'),(390,'US','America/Los_Angeles','Pacific Time'),(391,'US','America/Anchorage','Alaska Time'),(392,'US','America/Juneau','Alaska Time - Alaska panhandle'),(393,'US','America/Sitka','Alaska Time - southeast Alaska panhandle'),(394,'US','America/Yakutat','Alaska Time - Alaska panhandle neck'),(395,'US','America/Nome','Alaska Time - west Alaska'),(396,'US','America/Adak','Aleutian Islands'),(397,'US','America/Metlakatla','Metlakatla Time - Annette Island'),(398,'US','Pacific/Honolulu','Hawaii'),(399,'UY','America/Montevideo',''),(400,'UZ','Asia/Samarkand','west Uzbekistan'),(401,'UZ','Asia/Tashkent','east Uzbekistan'),(402,'VA','Europe/Vatican',''),(403,'VC','America/St_Vincent',''),(404,'VE','America/Caracas',''),(405,'VG','America/Tortola',''),(406,'VI','America/St_Thomas',''),(407,'VN','Asia/Ho_Chi_Minh',''),(408,'VU','Pacific/Efate',''),(409,'WF','Pacific/Wallis',''),(410,'WS','Pacific/Apia',''),(411,'YE','Asia/Aden',''),(412,'YT','Indian/Mayotte',''),(413,'ZA','Africa/Johannesburg',''),(414,'ZM','Africa/Lusaka',''),(415,'ZW','Africa/Harare',''); -/*!40000 ALTER TABLE `timezones` ENABLE KEYS */; -UNLOCK TABLES; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - --- Dump completed on 2013-04-03 18:11:34 diff --git a/fineract-provider/src/main/resources/sql/migrations/list_db/V2__externalize-connection-properties.sql b/fineract-provider/src/main/resources/sql/migrations/list_db/V2__externalize-connection-properties.sql deleted file mode 100644 index ec13e9c0c..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/list_db/V2__externalize-connection-properties.sql +++ /dev/null @@ -1,33 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `tenants` - ADD COLUMN `pool_initial_size` INT DEFAULT 5 AFTER `auto_update`, - ADD COLUMN `pool_validation_interval` INT DEFAULT 30000, - ADD COLUMN `pool_remove_abandoned` tinyint DEFAULT 1, - ADD COLUMN `pool_remove_abandoned_timeout` INT DEFAULT 60, - ADD COLUMN `pool_log_abandoned` tinyint DEFAULT 1, - ADD COLUMN `pool_abandon_when_percentage_full` INT DEFAULT 50, - ADD COLUMN `pool_test_on_borrow` tinyint DEFAULT 1, - ADD COLUMN `pool_max_active` INT DEFAULT 40, - ADD COLUMN `pool_min_idle` INT DEFAULT 20, - ADD COLUMN `pool_max_idle` INT DEFAULT 10, - ADD COLUMN `pool_suspect_timeout` INT DEFAULT 60, - ADD COLUMN `pool_time_between_eviction_runs_millis` INT DEFAULT 34000, - ADD COLUMN `pool_min_evictable_idle_time_millis` INT DEFAULT 60000; diff --git a/fineract-provider/src/main/resources/sql/migrations/list_db/V3__deadlock-retry-properties.sql b/fineract-provider/src/main/resources/sql/migrations/list_db/V3__deadlock-retry-properties.sql deleted file mode 100644 index 8a335359a..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/list_db/V3__deadlock-retry-properties.sql +++ /dev/null @@ -1,22 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `tenants` - ADD COLUMN `deadlock_max_retries` INT DEFAULT 0, - ADD COLUMN `deadlock_max_retry_interval` INT DEFAULT 1; diff --git a/fineract-provider/src/main/resources/sql/migrations/list_db/V4__introduced_oltpId_reportId_columns_and_tenants_server_connection_table.sql b/fineract-provider/src/main/resources/sql/migrations/list_db/V4__introduced_oltpId_reportId_columns_and_tenants_server_connection_table.sql deleted file mode 100644 index 9ddcefe4e..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/list_db/V4__introduced_oltpId_reportId_columns_and_tenants_server_connection_table.sql +++ /dev/null @@ -1,80 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -RENAME TABLE tenants to temp_tenants; - -create table tenant_server_connections(`id` BIGINT NOT NULL AUTO_INCREMENT, - `schema_server` VARCHAR(100) NOT NULL DEFAULT 'localhost', - `schema_name` VARCHAR(100) NOT NULL, - `schema_server_port` VARCHAR(10) NOT NULL DEFAULT '3306', - `schema_username` VARCHAR(100) NOT NULL DEFAULT 'root', - `schema_password` VARCHAR(100) NOT NULL DEFAULT 'mysql', - `auto_update` tinyint NOT NULL DEFAULT '1', - `pool_initial_size` INT NULL DEFAULT '5', - `pool_validation_interval` INT NULL DEFAULT '30000', - `pool_remove_abandoned` tinyint NULL DEFAULT '1', - `pool_remove_abandoned_timeout` INT NULL DEFAULT '60', - `pool_log_abandoned` tinyint NULL DEFAULT '1', - `pool_abandon_when_percentage_full` INT NULL DEFAULT '50', - `pool_test_on_borrow` tinyint NULL DEFAULT '1', - `pool_max_active` INT NULL DEFAULT '40', - `pool_min_idle` INT NULL DEFAULT '20', - `pool_max_idle` INT NULL DEFAULT '10', - `pool_suspect_timeout` INT NULL DEFAULT '60', - `pool_time_between_eviction_runs_millis` INT NULL DEFAULT '34000', - `pool_min_evictable_idle_time_millis` INT NULL DEFAULT '60000', - `deadlock_max_retries` INT NULL DEFAULT '0', - `deadlock_max_retry_interval` INT NULL DEFAULT '1', - PRIMARY KEY (`id`) - ) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB -AUTO_INCREMENT=1; - - -INSERT INTO `tenant_server_connections` (`id`,`schema_name`,`schema_server`, `schema_server_port`, `schema_username`, `schema_password`, `auto_update`, `pool_initial_size`, `pool_validation_interval`, `pool_remove_abandoned`, `pool_remove_abandoned_timeout`, `pool_log_abandoned`, `pool_abandon_when_percentage_full`, `pool_test_on_borrow`, `pool_max_active`, `pool_min_idle`, `pool_max_idle`, `pool_suspect_timeout`, `pool_time_between_eviction_runs_millis`, `pool_min_evictable_idle_time_millis`, `deadlock_max_retries`, `deadlock_max_retry_interval`) -SELECT `id`,`schema_name`,`schema_server`, `schema_server_port`, `schema_username`, `schema_password`, `auto_update`, `pool_initial_size`, `pool_validation_interval`, `pool_remove_abandoned`, `pool_remove_abandoned_timeout`, `pool_log_abandoned`, `pool_abandon_when_percentage_full`, `pool_test_on_borrow`, `pool_max_active`, `pool_min_idle`, `pool_max_idle`, `pool_suspect_timeout`, `pool_time_between_eviction_runs_millis`, `pool_min_evictable_idle_time_millis`, `deadlock_max_retries`, `deadlock_max_retry_interval` from temp_tenants; - - -CREATE TABLE tenants( - `id` BIGINT NOT NULL AUTO_INCREMENT, - `identifier` VARCHAR(100) NOT NULL, - `name` VARCHAR(100) NOT NULL, - `timezone_id` VARCHAR(100) NOT NULL, - `country_id` INT NULL DEFAULT NULL, - `joined_date` DATE NULL DEFAULT NULL, - `created_date` DATETIME NULL DEFAULT NULL, - `lastmodified_date` DATETIME NULL DEFAULT NULL, - `oltp_id` BIGINT NOT NULL, - `report_id` BIGINT NOT NULL, - PRIMARY KEY (`id`), - INDEX `fk_oltp_id` (`oltp_id`), - INDEX `fk_report_id` (`report_id`), - CONSTRAINT `fk_oltp_id` FOREIGN KEY (`oltp_id`) REFERENCES `tenant_server_connections` (`id`), - CONSTRAINT `fk_report_id` FOREIGN KEY (`report_id`) REFERENCES `tenant_server_connections` (`id`) -) -COLLATE='utf8mb4_general_ci' -ENGINE=InnoDB -AUTO_INCREMENT=1; - -INSERT INTO tenants(`id`,`identifier`,`name`,`timezone_id`,`country_id`,`joined_date`,`created_date`,`lastmodified_date`,`oltp_id`, `report_id`) -SELECT `id`,`identifier`,`name`,`timezone_id`,`country_id`,`joined_date`,`created_date`,`lastmodified_date`,`id`, `id` from temp_tenants ; - - -DROP TABLE temp_tenants; diff --git a/fineract-provider/src/main/resources/sql/migrations/list_db/V5__add_schema_connection_parameters.sql b/fineract-provider/src/main/resources/sql/migrations/list_db/V5__add_schema_connection_parameters.sql deleted file mode 100644 index 89d90f445..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/list_db/V5__add_schema_connection_parameters.sql +++ /dev/null @@ -1,24 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE `tenant_server_connections` - ADD COLUMN `schema_connection_parameters` TEXT NULL DEFAULT NULL; -UPDATE `tenant_server_connections` - SET `schema_connection_parameters`='${fineract.tenant.parameters}' - WHERE `id`=1; diff --git a/fineract-provider/src/main/resources/sql/migrations/list_db/V6__add_unique_tenant_identifier.sql b/fineract-provider/src/main/resources/sql/migrations/list_db/V6__add_unique_tenant_identifier.sql deleted file mode 100644 index f94da8fa3..000000000 --- a/fineract-provider/src/main/resources/sql/migrations/list_db/V6__add_unique_tenant_identifier.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. --- - -ALTER TABLE tenants ADD UNIQUE (identifier);