Add a button to send the order to the supplier

This commit is contained in:
Patrick Gansterer 2017-08-11 20:58:51 +02:00
parent b4ce8c31cc
commit f27bbc2ffa
7 changed files with 65 additions and 0 deletions

View file

@ -114,6 +114,15 @@ class OrdersController < ApplicationController
redirect_to orders_url, alert: I18n.t('errors.general_msg', :msg => error.message)
end
# Send a order to the supplier.
def send_result_to_supplier
order = Order.find(params[:id])
Mailer.order_result_supplier(@current_user, order).deliver_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)
end
def receive
@order = Order.find(params[:id])
unless request.post?