diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb
index 9004803f9f..45454f4ba9 100644
--- a/app/controllers/dashboard_controller.rb
+++ b/app/controllers/dashboard_controller.rb
@@ -7,6 +7,8 @@ def index
@donations = current_organization.donations.during(helpers.selected_range)
@recent_donations = @donations.recent
+ @purchases = current_organization.purchases.during(helpers.selected_range)
+ @recent_purchases = @purchases.recent.includes(:vendor)
distributions = current_organization.distributions.includes(:partner).during(helpers.selected_range)
@recent_distributions = distributions.recent
diff --git a/app/controllers/purchases_summary_controller.rb b/app/controllers/purchases_summary_controller.rb
deleted file mode 100644
index 3f81e0d5a3..0000000000
--- a/app/controllers/purchases_summary_controller.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-class PurchasesSummaryController < ApplicationController
- def index
- setup_date_range_picker
- @purchases = current_organization.purchases.during(helpers.selected_range)
- @recent_purchases = @purchases.recent.includes(:vendor)
- end
-end
diff --git a/app/views/purchases_summary/_purchase.html.erb b/app/views/dashboard/_purchase.html.erb
similarity index 98%
rename from app/views/purchases_summary/_purchase.html.erb
rename to app/views/dashboard/_purchase.html.erb
index 86344a45a1..bb13b180f7 100644
--- a/app/views/purchases_summary/_purchase.html.erb
+++ b/app/views/dashboard/_purchase.html.erb
@@ -1,4 +1,4 @@
-
+
<%= link_to purchase do %>
<%= number_with_delimiter purchase.line_items.total %> items from <%= purchase.purchased_from_view %>
@@ -7,4 +7,3 @@
<%= distance_of_time_in_words_to_now purchase.created_at %> ago
-
diff --git a/app/views/dashboard/index.html.erb b/app/views/dashboard/index.html.erb
index d8ae90765c..185404290a 100644
--- a/app/views/dashboard/index.html.erb
+++ b/app/views/dashboard/index.html.erb
@@ -286,6 +286,26 @@
<% end %>
+ <%= render(
+ "card",
+ id: "purchases",
+ gradient: "secondary",
+ title: "Purchases",
+ subtitle: @selected_date_range,
+ footer_options: { class: "text-center" },
+ footer: link_to("See more...", purchases_path),
+ ) do %>
+ <%= new_button_to new_purchase_path, {text: "New Purchase"} %>
+ <%= dollar_presentation(@purchases.sum(&:amount_spent_in_cents)) %>
+ spent
+ <%= @selected_date_range_label %>
+
+
+
Recent purchases
+ <%= render partial: "purchase", collection: @recent_purchases, as: :purchase %>
+
+ <% end %>
+
<%= render(
"card",
gradient: "warning",
diff --git a/app/views/layouts/_lte_sidebar.html.erb b/app/views/layouts/_lte_sidebar.html.erb
index 60018a8449..0175496b56 100644
--- a/app/views/layouts/_lte_sidebar.html.erb
+++ b/app/views/layouts/_lte_sidebar.html.erb
@@ -62,11 +62,6 @@
New Purchase
<% end %>
-
- <%= link_to(purchases_summary_path(organization_id: current_user.organization), class: "nav-link #{"active" if current_page?(purchases_summary_path)}") do %>
- Purchases Summary
- <% end %>
-
diff --git a/app/views/purchases_summary/_card.html.erb b/app/views/purchases_summary/_card.html.erb
deleted file mode 100644
index 2772f635fd..0000000000
--- a/app/views/purchases_summary/_card.html.erb
+++ /dev/null
@@ -1,76 +0,0 @@
-<%
- # Allows locals to be optional
- footer ||= nil
- footer_div ||= nil
- header_div ||= nil
- id ||= nil
- subtitle ||= nil
- title ||= nil
- type ||= :box # or :table or :plain
-
- options ||= {}
- options.symbolize_keys!
- options[:class] ||= ""
- options[:class] += " card"
- options[:id] = id if id
-%>
-<%= content_tag(:div, **options) do %>
- <%=
- header_div ||
- begin
- gradient ||= "primary"
-
- header_options ||= {}
- header_options.symbolize_keys!
- header_options[:class] ||= ""
- header_options[:class] += " card-header border-0 bg-gradient-#{gradient}"
-
- header ||=
- begin
- title = h title
- title += " ".html_safe + content_tag(:small, subtitle) if subtitle
- content_tag :h3, title, class: "card-title"
- end
-
- content_tag(:div, **header_options) do %>
- <%= header %>
-
-
-
-
-
- <% end
- end
- %>
- <% case type.to_sym
- when :box %>
-
- <% when :plain %>
-
- <%= yield %>
-
- <% when :table %>
-
- <%= yield %>
-
- <% else
- raise "Unknown card type: #{type}"
- end %>
-
- <%=
- footer_div ||
- if footer
- footer_options ||= {}
- footer_options.symbolize_keys!
- footer_options[:class] ||= ""
- footer_options[:class] += " card-footer"
- content_tag(:div, footer, **footer_options)
- end
- %>
-<% end %>
diff --git a/app/views/purchases_summary/index.html.erb b/app/views/purchases_summary/index.html.erb
deleted file mode 100644
index 8ce5e3cf74..0000000000
--- a/app/views/purchases_summary/index.html.erb
+++ /dev/null
@@ -1,20 +0,0 @@
- <%= render(
- "shared/filtered_card",
- id: "purchases",
- gradient: "secondary",
- title: "Purchases",
- subtitle: @selected_date_range,
- footer_options: { class: "text-center" },
- footer: link_to("See more...", purchases_path),
- filter_url: purchases_summary_path
- ) do %>
- <%= new_button_to new_purchase_path, {text: "New Purchase"} %>
- <%= dollar_presentation(@purchases.sum(&:amount_spent_in_cents)) %>
- spent
- <%= @selected_date_range_label %>
-
-
-
Recent purchases
- <%= render partial: "purchase", collection: @recent_purchases, as: :purchase %>
-
- <% end %>
diff --git a/app/views/purchases_summary/index.html.orginal.erb b/app/views/purchases_summary/index.html.orginal.erb
deleted file mode 100644
index 1dc3fe2387..0000000000
--- a/app/views/purchases_summary/index.html.orginal.erb
+++ /dev/null
@@ -1,19 +0,0 @@
- <%= render(
- "shared/card",
- id: "purchases",
- gradient: "secondary",
- title: "Purchases",
- subtitle: @selected_date_range,
- footer_options: { class: "text-center" },
- footer: link_to("See more...", purchases_path),
- ) do %>
- <%= new_button_to new_purchase_path, {text: "New Purchase"} %>
- <%= dollar_presentation(@purchases.sum(&:amount_spent_in_cents)) %>
- spent
- <%= @selected_date_range_label %>
-
-
-
Recent purchases
- <%= render partial: "purchase", collection: @recent_purchases, as: :purchase %>
-
- <% end %>
diff --git a/app/views/shared/_card.html.erb b/app/views/shared/_card.html.erb
deleted file mode 100644
index 2772f635fd..0000000000
--- a/app/views/shared/_card.html.erb
+++ /dev/null
@@ -1,76 +0,0 @@
-<%
- # Allows locals to be optional
- footer ||= nil
- footer_div ||= nil
- header_div ||= nil
- id ||= nil
- subtitle ||= nil
- title ||= nil
- type ||= :box # or :table or :plain
-
- options ||= {}
- options.symbolize_keys!
- options[:class] ||= ""
- options[:class] += " card"
- options[:id] = id if id
-%>
-<%= content_tag(:div, **options) do %>
- <%=
- header_div ||
- begin
- gradient ||= "primary"
-
- header_options ||= {}
- header_options.symbolize_keys!
- header_options[:class] ||= ""
- header_options[:class] += " card-header border-0 bg-gradient-#{gradient}"
-
- header ||=
- begin
- title = h title
- title += " ".html_safe + content_tag(:small, subtitle) if subtitle
- content_tag :h3, title, class: "card-title"
- end
-
- content_tag(:div, **header_options) do %>
- <%= header %>
-
-
-
-
-
- <% end
- end
- %>
- <% case type.to_sym
- when :box %>
-
- <% when :plain %>
-
- <%= yield %>
-
- <% when :table %>
-
- <%= yield %>
-
- <% else
- raise "Unknown card type: #{type}"
- end %>
-
- <%=
- footer_div ||
- if footer
- footer_options ||= {}
- footer_options.symbolize_keys!
- footer_options[:class] ||= ""
- footer_options[:class] += " card-footer"
- content_tag(:div, footer, **footer_options)
- end
- %>
-<% end %>
diff --git a/app/views/shared/_filtered_card.html.erb b/app/views/shared/_filtered_card.html.erb
deleted file mode 100644
index 48d681c912..0000000000
--- a/app/views/shared/_filtered_card.html.erb
+++ /dev/null
@@ -1,37 +0,0 @@
-<%
- id ||= nil
- title ||= nil
- subtitle ||= nil
- footer ||= nil
-%>
-
-
-
-
-
-
- <%= simple_form_for :filters, url: filter_url, method: :get do |f| %>
- <%= render partial: "shared/date_range_picker", locals: {css_class: "form-control"} %>
- <%= filter_button %>
- <% end %>
-
-
-
-
-
- <%= render("card",
- id: id,
- gradient: "secondary",
- title: title,
- subtitle: subtitle,
- footer_options: { class: "text-center" },
- footer: footer
- ) do
-
- yield
-
- end %>
-
-
-
-
diff --git a/config/routes.rb b/config/routes.rb
index b673b05f0f..05e5b017f4 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -216,7 +216,6 @@ def set_up_flipper
get "historical_trends/distributions", to: "historical_trends/distributions#index"
get "historical_trends/purchases", to: "historical_trends/purchases#index"
get "historical_trends/donations", to: "historical_trends/donations#index"
- get "purchases_summary", to: "purchases_summary#index"
end
resources :attachments, only: %i(destroy)