2013-02-08 01:52:20 +01:00
|
|
|
- title t('.title', name: @order.name)
|
2009-01-06 11:49:19 +01:00
|
|
|
|
2014-01-17 13:14:49 +01:00
|
|
|
.well
|
2015-04-10 18:58:51 +02:00
|
|
|
= close_button :alert
|
2014-01-17 13:14:49 +01:00
|
|
|
%p
|
2014-01-17 14:25:06 +01:00
|
|
|
= raw t '.description1',
|
|
|
|
state: t("orders.state.#{@order.state}").capitalize,
|
|
|
|
supplier: supplier_link(@order),
|
|
|
|
who: show_user_link(@order.created_by),
|
|
|
|
starts: format_time(@order.starts),
|
|
|
|
ends: format_time(@order.ends)
|
2014-01-17 13:14:49 +01:00
|
|
|
%br
|
2014-01-17 14:25:06 +01:00
|
|
|
= raw t '.description2',
|
|
|
|
ordergroups: ordergroup_count(@order),
|
|
|
|
article_count: @order.order_articles.ordered.count,
|
|
|
|
net_sum: number_to_currency(@order.sum(:net)),
|
|
|
|
gross_sum: number_to_currency(@order.sum(:gross))
|
2014-01-17 13:14:49 +01:00
|
|
|
|
2014-01-17 14:32:00 +01:00
|
|
|
- unless @order.comments.blank?
|
|
|
|
= link_to t('.comments_link'), '#comments'
|
|
|
|
|
2014-01-17 13:14:49 +01:00
|
|
|
- if @note.present?
|
|
|
|
%p
|
|
|
|
= heading_helper(Order, :note) + ': '
|
|
|
|
= @order.note
|
|
|
|
|
|
|
|
-# Proposing to remove this warning, since there is a valid period when the order is not settled yet.
|
|
|
|
-# Perhaps when the pickup day has been, or when the order isn't settled a week after it has been
|
|
|
|
-# closed, this message could be shown.
|
|
|
|
-#- if @order.finished? and !@order.closed?
|
2013-02-08 01:52:20 +01:00
|
|
|
.alert.alert-warning
|
2013-12-18 16:04:30 +01:00
|
|
|
= t '.warn_not_closed'
|
2012-10-15 21:19:17 +02:00
|
|
|
|
2014-01-17 13:14:49 +01:00
|
|
|
.well.well-small
|
|
|
|
.btn-toolbar
|
|
|
|
.form-search.pull-right
|
|
|
|
.input-append
|
|
|
|
= text_field_tag :query, params[:query], class: 'search-query delayed-search resettable'
|
|
|
|
%button.add-on.btn.reset-search{:type => :button, :title => t('.search_reset')}
|
|
|
|
%i.icon.icon-remove
|
|
|
|
|
|
|
|
.btn-toolbar
|
|
|
|
.btn-group.view_buttons
|
2014-01-17 15:03:46 +01:00
|
|
|
= update_articles_link @order, t('.articles'), :default, class: 'btn'
|
2014-01-17 13:14:49 +01:00
|
|
|
= update_articles_link @order, t('.sort_group'), :groups, class: 'btn'
|
|
|
|
= update_articles_link @order, t('.sort_article'), :articles, class: 'btn'
|
|
|
|
|
|
|
|
- unless @order.open?
|
|
|
|
.btn-group
|
|
|
|
= link_to '#', class: 'btn dropdown-toggle', data: {toggle: 'dropdown'} do
|
|
|
|
= t '.download.title'
|
|
|
|
%span.caret
|
|
|
|
%ul.dropdown-menu
|
|
|
|
%li= order_pdf(@order, :groups, t('.download.group_pdf'))
|
|
|
|
%li= order_pdf(@order, :articles, t('.download.article_pdf'))
|
|
|
|
%li= order_pdf(@order, :matrix, t('.download.matrix_pdf'))
|
|
|
|
%li= order_pdf(@order, :fax, t('.download.fax_pdf'))
|
2014-09-02 15:47:01 +02:00
|
|
|
- unless @order.stockit?
|
|
|
|
%li= link_to t('.download.fax_txt'), order_path(@order, format: :txt), {title: t('.download.download_file')}
|
2014-03-06 16:26:16 +01:00
|
|
|
%li= link_to t('.download.fax_csv'), order_path(@order, format: :csv), {title: t('.download.download_file')}
|
2014-01-17 13:14:49 +01:00
|
|
|
|
|
|
|
- if @order.open?
|
|
|
|
= link_to t('.action_end'), finish_order_path(@order), method: :post, class: 'btn btn-success',
|
2014-02-20 15:04:53 +01:00
|
|
|
data: {confirm: t('.confirm_end', order: @order.name)}
|
2014-01-17 13:14:49 +01:00
|
|
|
= link_to t('ui.edit'), edit_order_path(@order), class: 'btn'
|
|
|
|
- elsif not @order.closed? and not @order.stockit?
|
|
|
|
-# TODO btn-success class only if not received before
|
|
|
|
= link_to t('orders.index.action_receive'), receive_order_path(@order), class: 'btn btn-success'
|
|
|
|
- unless @order.closed?
|
2014-06-04 13:12:19 +02:00
|
|
|
= link_to t('ui.delete'), @order, data: {confirm: t('.confirm_delete')}, method: :delete,
|
2014-01-17 13:14:49 +01:00
|
|
|
class: 'btn btn-danger'
|
2009-01-29 01:57:51 +01:00
|
|
|
|
2012-10-15 21:19:17 +02:00
|
|
|
%section#articles_table
|
2014-01-17 15:03:46 +01:00
|
|
|
= render @partial, 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
|
2014-01-17 14:25:06 +01:00
|
|
|
|
2015-02-19 00:53:57 +01:00
|
|
|
= render 'show_js'
|
2014-01-23 16:17:16 +01:00
|
|
|
= render 'shared/articles_by/common', order: @order
|