i18n finance + controller
This commit is contained in:
parent
2d58054d1c
commit
8be93c33f8
13 changed files with 186 additions and 91 deletions
|
|
@ -7,7 +7,7 @@ class Finance::BalancingController < Finance::BaseController
|
|||
|
||||
def new
|
||||
@order = Order.find(params[:order_id])
|
||||
flash.now.alert = "Achtung, Bestellung wurde schon abgerechnet" if @order.closed?
|
||||
flash.now.alert = t('finance.balancing.new.alert') if @order.closed?
|
||||
@comments = @order.comments
|
||||
|
||||
if params['sort']
|
||||
|
|
@ -55,19 +55,19 @@ class Finance::BalancingController < Finance::BaseController
|
|||
def close
|
||||
@order = Order.find(params[:id])
|
||||
@order.close!(@current_user)
|
||||
redirect_to finance_root_url, notice: "Bestellung wurde erfolgreich abgerechnet, die Kontostände aktualisiert."
|
||||
redirect_to finance_root_url, notice: t('finance.balancing.close.notice')
|
||||
|
||||
rescue => error
|
||||
redirect_to new_finance_order_url(order_id: @order.id), alert: "Ein Fehler ist beim Abrechnen aufgetreten: #{error.message}"
|
||||
redirect_to new_finance_order_url(order_id: @order.id), alert: t('finance.balancing.close.alert', message: error.message)
|
||||
end
|
||||
|
||||
# Close the order directly, without automaticly updating ordergroups account balances
|
||||
def close_direct
|
||||
@order = Order.find(params[:id])
|
||||
@order.close_direct!(@current_user)
|
||||
redirect_to finance_balancing_url, notice: "Bestellung wurde geschlossen."
|
||||
redirect_to finance_balancing_url, notice: t('finance.balancing.close_direct.notice')
|
||||
rescue => error
|
||||
redirect_to finance_balancing_url, alert: "Bestellung kann nicht geschlossen werden: #{error.message}"
|
||||
redirect_to finance_balancing_url, alert: t('finance.balancing.close_direct.alert', message: error.message)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue