app/controllers/application_controller.rb
# helper for actions in the 'Billing' manager tab
#
# Purpose:
#   used to get facilities normally used to scope down
#   which order_details / journals are shown within the tables
#
# Returns
#   returns an ActiveRecord::Relation of facilities
#   which order_details / journals should be limited to
#   when running a transaction search or working in the billing tab
#
# depends heavily on value of current_facility
helper for actions in the 'Billing' manager tab
Purpose:
used to get facilities normally used to scope down
which order_details / journals are shown within the tables

Returns
returns an ActiveRecord::Relation of facilities
which order_details / journals should be limited to
when running a transaction search or working in the billing tab

depends heavily on value of current_facility
helper for actions in the ' Billing ' manager tab Purpose : used to get facilities normally used to scope down which order_details / journals are shown within the tables Returns returns an ActiveRecord :: Relation of facilities which order_details / journals should be limited to when running a transaction search or working in the billing tab depends heavily on value of current_facility
def manageable_facilities
    @manageable_facilities =
      case
      when current_facility.blank?
        session_user.manageable_facilities
      when current_facility.cross_facility?
        Facility.alphabetized
      else
        Facility.where(id: current_facility.id)
      end
  end
def manageable_facilities @manageable_facilities = case when current_facility . blank? session_user . manageable_facilities when current_facility . cross_facility? Facility . alphabetized else Facility . where ( id : current_facility . id ) end end
helper for actions in the 'Billing' manager tab
Purpose:
used to get facilities normally used to scope down
which order_details / journals are shown within the tables
helper for actions in the ' Billing ' manager tab Purpose : used to get facilities normally used to scope down which order_details / journals are shown within the tables