mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Working version of Customers reports without filters
This commit is contained in:
@@ -18,6 +18,8 @@ Spree::Admin::ReportsController.class_eval do
|
||||
render_to_string(partial: 'orders_and_fulfillment_description', layout: false, locals: {report_types: REPORT_TYPES[:orders_and_fulfillment]}).html_safe
|
||||
@reports[:products_and_inventory][:description] =
|
||||
render_to_string(partial: 'products_and_inventory_description', layout: false, locals: {report_types: REPORT_TYPES[:products_and_inventory]}).html_safe
|
||||
@reports[:customers][:description] =
|
||||
render_to_string(partial: 'customers_description', layout: false, locals: {report_types: REPORT_TYPES[:customers]}).html_safe
|
||||
} } }
|
||||
|
||||
# OVERRIDING THIS so we use a method not a constant for available reports
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
%ul{style: "margin-left: 12pt"}
|
||||
- report_types.each do |report_type|
|
||||
%li
|
||||
= link_to report_type[0], "#{customers_admin_reports_url}?report_type=#{report_type[1]}"
|
||||
@@ -6,3 +6,16 @@
|
||||
%br
|
||||
%br
|
||||
%table#listing_customers.index
|
||||
%thead
|
||||
%tr{'data-hook' => "orders_header"}
|
||||
- @report.header.each do |heading|
|
||||
%th=heading
|
||||
%tbody
|
||||
- @report.table.each do |row|
|
||||
%tr
|
||||
- row.each do |column|
|
||||
%td= column
|
||||
- if @report.table.empty?
|
||||
%tr
|
||||
%td{:colspan => "2"}= t(:none)
|
||||
|
||||
|
||||
@@ -23,15 +23,15 @@ module OpenFoodNetwork
|
||||
order.billing_address.city]
|
||||
else
|
||||
ba = order.billing_address
|
||||
da = order.distributor.address
|
||||
da = order.distributor.andand.address
|
||||
[ba.firstname,
|
||||
ba.lastname,
|
||||
[ba.address1, ba.address2, ba.city].join(" "),
|
||||
order.email,
|
||||
ba.phone,
|
||||
order.distributor.name,
|
||||
[da.address1, da.address2, da.city].join(" "),
|
||||
order.shipping_method.name
|
||||
order.distributor.andand.name,
|
||||
[da.andand.address1, da.andand.address2, da.andand.city].join(" "),
|
||||
order.shipping_method.andand.name
|
||||
]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -29,12 +29,18 @@ feature %q{
|
||||
end
|
||||
end
|
||||
|
||||
scenario "customers report" do
|
||||
login_to_admin_section
|
||||
click_link "Reports"
|
||||
click_link "Customers"
|
||||
page.should have_content "Customers"
|
||||
page.should have_content "Mailing List"
|
||||
describe "Customers report" do
|
||||
before do
|
||||
login_to_admin_section
|
||||
click_link "Reports"
|
||||
end
|
||||
scenario "customers report" do
|
||||
click_link "Mailing List"
|
||||
end
|
||||
|
||||
scenario "customers report" do
|
||||
click_link "Addresses"
|
||||
end
|
||||
end
|
||||
|
||||
scenario "orders and distributors report" do
|
||||
|
||||
Reference in New Issue
Block a user