Skip to content

Commit

Permalink
Adding shortcuts for both sales tax reports to the reports index
Browse files Browse the repository at this point in the history
  • Loading branch information
oeoeaio committed Mar 15, 2017
1 parent 18472ea commit 7ef0964
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/controllers/spree/admin/reports_controller_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
["Payment Methods Report", :payment_methods],
["Delivery Report", :delivery]
],
sales_tax: [
["Tax Types", :tax_types],
["Tax Rates", :tax_rates]
],
packing: [
["Pack By Customer", :pack_by_customer],
["Pack By Supplier", :pack_by_supplier]
Expand All @@ -59,6 +63,8 @@
render_to_string(partial: 'order_cycle_management_description', layout: false, locals: {report_types: REPORT_TYPES[:order_cycle_management]}).html_safe
@reports[:packing][:description] =
render_to_string(partial: 'packing_description', layout: false, locals: {report_types: REPORT_TYPES[:packing]}).html_safe
@reports[:sales_tax][:description] =
render_to_string(partial: 'sales_tax_description', layout: false, locals: {report_types: REPORT_TYPES[:sales_tax]}).html_safe
} } }


Expand Down Expand Up @@ -321,8 +327,7 @@ def authorized_reports
:order_cycle_management => {:name => "Order Cycle Management", :description => ''},
:sales_tax => { :name => "Sales Tax", :description => "Sales Tax For Orders" },
:xero_invoices => { :name => "Xero Invoices", :description => 'Invoices for import into Xero' },
:packing => { :name => "Packing Reports", :description => '' },
:sales_tax => { :name => "Sales Tax", :description => "Sales Tax For Orders" }
:packing => { :name => "Packing Reports", :description => '' }
}
# Return only reports the user is authorized to view.
reports.select { |action| can? action, :report }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
%ul{style: "margin-left: 12pt"}
- report_types.each do |report_type|
%li
= link_to report_type[0], "#{sales_tax_admin_reports_url}?report_type=#{report_type[1]}"

0 comments on commit 7ef0964

Please sign in to comment.