Browse Source

Use tabs and try to sort the view by days until sold out

master
Holger Hans Peter Freyther 8 years ago
parent
commit
ed89932440
  1. 2
      app/mailers/spree/stock_mailer.rb
  2. 2
      app/views/spree/stock_mailer/stock_report_email.text.erb

2
app/mailers/spree/stock_mailer.rb

@ -62,7 +62,7 @@ module Spree
forecast.push(generate_estimate(var))
}
forecast
forecast.sort { |x,y| x['days'] <=> y['days'] }
end
def stock_report_email()

2
app/views/spree/stock_mailer/stock_report_email.text.erb

@ -5,7 +5,7 @@ will run low.
Estimates:
<% @forecast.each do |dict| %>
<%= dict['name'] %> (<%= dict['available'] %>) => <%= dict['days'].round(2) %> days until sold out.
<%= dict['name'] %> (<%= dict['available'] %>) => <%= dict['days'].round(2) %> days until sold out.
<% end %>

Loading…
Cancel
Save