2013-02-08 01:52:20 +01:00
|
|
|
- title t('.title', name: @order.name)
|
2009-01-06 11:49:19 +01:00
|
|
|
|
2012-10-15 21:19:17 +02:00
|
|
|
- if @order.finished? and !@order.closed?
|
2013-02-08 01:52:20 +01:00
|
|
|
.alert.alert-warning
|
|
|
|
= t '.warn_not_closed'
|
2012-10-15 21:19:17 +02:00
|
|
|
|
2009-01-06 11:49:19 +01:00
|
|
|
// Order summary
|
2012-10-15 21:19:17 +02:00
|
|
|
.well
|
|
|
|
%dl.dl-horizontal
|
2013-02-08 01:52:20 +01:00
|
|
|
%dt= t '.supplier'
|
2012-10-15 21:19:17 +02:00
|
|
|
%dd= @order.name
|
2012-12-14 18:10:46 +01:00
|
|
|
- if @note.present?
|
2013-02-08 01:52:20 +01:00
|
|
|
%dt= t '.note'
|
2012-12-14 18:10:46 +01:00
|
|
|
%dd= @order.note
|
2013-02-08 01:52:20 +01:00
|
|
|
%dt= t '.created_by'
|
2012-12-14 18:10:46 +01:00
|
|
|
%dd= link_to_user_message_if_valid(@order.created_by)
|
2013-02-08 01:52:20 +01:00
|
|
|
%dt= t '.begin'
|
2012-10-15 21:19:17 +02:00
|
|
|
%dd= format_time(@order.starts)
|
2013-02-08 01:52:20 +01:00
|
|
|
%dt= t '.ending'
|
2012-10-15 21:19:17 +02:00
|
|
|
%dd= format_time(@order.ends)
|
2013-02-08 01:52:20 +01:00
|
|
|
%dt= t '.group_orders'
|
2012-12-14 18:10:46 +01:00
|
|
|
%dd #{@order.group_orders.count} (#{@order.group_orders.includes(:ordergroup).all.map {|g| g.ordergroup.name}.join(', ')})
|
2013-02-08 01:52:20 +01:00
|
|
|
%dt= t '.amounts'
|
2012-10-15 21:19:17 +02:00
|
|
|
%dd= "#{number_to_currency(@order.sum(:net))} / #{number_to_currency(@order.sum(:gross))}"
|
2013-02-08 01:52:20 +01:00
|
|
|
%dt= t '.articles_ordered'
|
2012-10-15 21:19:17 +02:00
|
|
|
%dd= @order.order_articles.ordered.count
|
2009-01-29 01:57:51 +01:00
|
|
|
|
2009-02-03 21:14:48 +01:00
|
|
|
|
2012-10-15 21:19:17 +02:00
|
|
|
.form-actions
|
2009-02-03 21:14:48 +01:00
|
|
|
- if @order.open?
|
2013-02-08 01:52:20 +01:00
|
|
|
= link_to t('ui.edit'), edit_order_path(@order), class: 'btn'
|
|
|
|
= link_to t('.action_end'), finish_order_path(@order), method: :post, class: 'btn btn-success',
|
2013-02-09 12:18:07 +01:00
|
|
|
confirm: t('.confirm_end', order: @order.name)
|
2009-02-03 21:14:48 +01:00
|
|
|
- unless @order.closed?
|
2013-02-08 01:52:20 +01:00
|
|
|
= link_to t('ui.delete'), @order, confirm: t('.confirm_delete'), method: :delete,
|
2012-10-15 21:19:17 +02:00
|
|
|
class: 'btn btn-danger'
|
|
|
|
|
|
|
|
- unless @order.open?
|
|
|
|
%ul.nav.nav-pills
|
2013-02-08 01:52:20 +01:00
|
|
|
%li= update_articles_link(@order, t('.articles'), :default)
|
|
|
|
%li= update_articles_link(@order, t('.sort_group'), :groups)
|
|
|
|
%li= update_articles_link(@order, t('.sort_article'), :articles)
|
|
|
|
%li= link_to t('.comments_link'), '#comments'
|
2012-10-15 21:19:17 +02:00
|
|
|
%li.dropdown
|
|
|
|
= link_to '#', class: 'dropdown-toggle', data: {toggle: 'dropdown'} do
|
2013-02-08 01:52:20 +01:00
|
|
|
= t '.download.title'
|
2012-10-15 21:19:17 +02:00
|
|
|
%b.caret
|
|
|
|
%ul.dropdown-menu
|
2013-02-08 01:52:20 +01:00
|
|
|
%li= order_pdf(@order, :groups, t('.group_pdf'))
|
|
|
|
%li= order_pdf(@order, :articles, t('.article_pdf'))
|
|
|
|
%li= order_pdf(@order, :matrix, t('.matrix_pdf'))
|
|
|
|
%li= order_pdf(@order, :fax, t('.fax_pdf'))
|
|
|
|
%li= link_to t('.fax_txt'), {action: 'text_fax_template', id: @order }, {title: t('.download_file')}
|
2012-10-15 21:19:17 +02:00
|
|
|
|
|
|
|
%section#articles_table
|
|
|
|
= render 'articles', order: @order
|
2009-01-06 11:49:19 +01:00
|
|
|
|
2013-02-08 01:52:20 +01:00
|
|
|
%h2= t '.comments.title'
|
2012-10-15 21:19:17 +02:00
|
|
|
#comments
|
|
|
|
= render partial: 'shared/comments', locals: { comments: @order.comments }
|
|
|
|
#new_comment= render partial: 'order_comments/form', locals: { order_comment: @order.comments.build(user: current_user)}
|
2013-02-08 01:52:20 +01:00
|
|
|
= link_to_top
|