Skip to content

Commit

Permalink
Display unfulfilled count in button
Browse files Browse the repository at this point in the history
  • Loading branch information
norrismei committed Sep 12, 2024
1 parent b262ff2 commit 7ec63c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/requests_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def index
.undiscarded
.during(helpers.selected_range)
.class_filter(filter_params)

@unfulfilled_requests_count = current_organization.requests.where(status: [:pending, :started]).size
@paginated_requests = @requests.page(params[:page])
@calculate_product_totals = RequestsTotalItemsService.new(requests: @requests).calculate
@items = current_organization.items.alphabetized
Expand Down
2 changes: 1 addition & 1 deletion app/views/requests/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<% if @requests.any? { |request| request.status == "pending" || request.status == "started" } %>
<%= print_button_to(
print_unfulfilled_requests_path(format: :pdf),
text: "Print Unfulfilled Picklists",
text: "Print Unfulfilled Picklists (#{@unfulfilled_requests_count})",
size: "md") %>
<% end %>
<%= download_button_to(requests_path(format: :csv, filters: filter_params.merge(date_range: date_range_params)), {text: "Export Requests", size: "md"}) if @requests.any? %>
Expand Down

0 comments on commit 7ec63c3

Please sign in to comment.