@@ -50,7 +50,7 @@ def index
5050 @items = current_organization . items . alphabetized . select ( :id , :name )
5151 @item_categories = current_organization . item_categories . select ( :id , :name )
5252 @storage_locations = current_organization . storage_locations . active_locations . alphabetized . select ( :id , :name )
53- @partners = Partner . joins ( :distributions ) . where ( distributions : @distributions ) . distinct . order ( :name ) . select ( :id , :name )
53+ @partners = current_organization . partners . active . alphabetized . select ( :id , :name )
5454 @selected_item = filter_params [ :by_item_id ] . presence
5555 @distribution_totals = DistributionTotalsService . new ( current_organization . distributions , scope_filters )
5656 @total_value_all_distributions = @distribution_totals . total_value
@@ -117,7 +117,7 @@ def create
117117 elsif request_id
118118 @distribution . initialize_request_items
119119 end
120- @items = current_organization . items . alphabetized
120+ @items = current_organization . items . active . alphabetized
121121 @partner_list = current_organization . partners . where . not ( status : 'deactivated' ) . alphabetized
122122
123123 inventory = View ::Inventory . new ( @distribution . organization_id )
@@ -147,7 +147,7 @@ def new
147147 @distribution . line_items . build
148148 @distribution . copy_from_donation ( params [ :donation_id ] , params [ :storage_location_id ] )
149149 end
150- @items = current_organization . items . alphabetized
150+ @items = current_organization . items . active . alphabetized
151151 @partner_list = current_organization . partners . where . not ( status : 'deactivated' ) . alphabetized
152152
153153 inventory = View ::Inventory . new ( current_organization . id )
@@ -173,7 +173,7 @@ def edit
173173 if ( !@distribution . complete? && @distribution . future? ) ||
174174 current_user . has_role? ( Role ::ORG_ADMIN , current_organization )
175175 @distribution . line_items . build if @distribution . line_items . size . zero?
176- @items = current_organization . items . alphabetized
176+ @items = current_organization . items . active . alphabetized
177177 @partner_list = current_organization . partners . alphabetized
178178 @audit_warning = current_organization . audits
179179 . where ( storage_location_id : @distribution . storage_location_id )
@@ -204,7 +204,7 @@ def update
204204 flash [ :error ] = insufficient_error_message ( result . error . message )
205205 @distribution . line_items . build if @distribution . line_items . size . zero?
206206 @distribution . initialize_request_items
207- @items = current_organization . items . alphabetized
207+ @items = current_organization . items . active . alphabetized
208208 @storage_locations = current_organization . storage_locations . active_locations . alphabetized
209209 render :edit
210210 end
0 commit comments