Browse Source

stock: Show the available number of units in the parenthesis

master
Holger Hans Peter Freyther 9 years ago
parent
commit
99c7ff1b4b
  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

@ -45,7 +45,7 @@ module Spree
days = var.count_on_hand / mean
{'weighted_mean' => mean, 'days' => days, 'variant' => var,
'product' => var.product, 'name' => name}
'product' => var.product, 'name' => name, 'available' => var.count_on_hand}
end
def generate_forecast()

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['days'].round(2) %> days until sold out.
<%= dict['name'] %> (<%= dict['available'] %>) => <%= dict['days'].round(2) %> days until sold out.
<% end %>

Loading…
Cancel
Save