Save the timestamp of the last mail to supplier and confirm resending it

This commit is contained in:
Patrick Gansterer 2017-10-11 15:53:58 +02:00
parent 9a3ab1458e
commit f509f85327
6 changed files with 13 additions and 2 deletions

View file

@ -118,6 +118,7 @@ class OrdersController < ApplicationController
def send_result_to_supplier
order = Order.find(params[:id])
Mailer.order_result_supplier(@current_user, order).deliver_now
order.update!(last_sent_mail: Time.now)
redirect_to order, notice: I18n.t('orders.send_to_supplier.notice')
rescue => error
redirect_to order, alert: I18n.t('errors.general_msg', :msg => error.message)