View: dbo.Finance_Charge_Definition_View
View definition
`CREATE VIEW dbo.Finance_Charge_Definition_View AS ( SELECT finance_charge_definition_KEY = FCD.finance_charge_definition_KEY ,client_KEY = FCD.client_KEY ,finance_charge_definition_id = FCD.finance_charge_definition_id ,finance_charge_definition_id_sortable = FCD.finance_charge_definition_id_sortable ,description = FCD.description ,is_active = FCD.is_active ,annual_rate = FCD.annual_rate ,grace_period_duration = FCD.grace_period_duration ,finance_charge_grace_period_basis_KEY = FCD.finance_charge_grace_period_basis_KEY ,is_compound = FCD.is_compound ,finance_charge_date_basis_KEY = FCD.finance_charge_date_basis_KEY ,minimum_finance_charge = FCD.minimum_finance_charge ,gl_account_KEY = FCD.gl_account_KEY ,is_taxable = FCD.is_taxable ,minimum_past_due_balance = FCD.minimum_past_due_balance -- added a new column to fetch the active status based on 'is_active' ,active_status_KEY = CASE WHEN FCD.is_active = 0 THEN 2 ELSE 1 END FROM Finance_Charge_Definition FCD )`