From 99c7ff1b4b6f80122759fc398b10b7649724d291 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 10 Jul 2013 17:07:18 +0200 Subject: [PATCH] stock: Show the available number of units in the parenthesis --- app/mailers/spree/stock_mailer.rb | 2 +- app/views/spree/stock_mailer/stock_report_email.text.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/mailers/spree/stock_mailer.rb b/app/mailers/spree/stock_mailer.rb index f59b8d5..55286aa 100644 --- a/app/mailers/spree/stock_mailer.rb +++ b/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() diff --git a/app/views/spree/stock_mailer/stock_report_email.text.erb b/app/views/spree/stock_mailer/stock_report_email.text.erb index 0e144e0..a34fbde 100644 --- a/app/views/spree/stock_mailer/stock_report_email.text.erb +++ b/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 %>