2009-02-05 16:40:02 +01:00
|
|
|
- title "Bestellung: #{@order.name}"
|
2009-01-06 11:49:19 +01:00
|
|
|
|
2012-10-15 21:19:17 +02:00
|
|
|
- if @order.finished? and !@order.closed?
|
|
|
|
.alert.alert-warning Achtung, Bestellung wurde noch nicht abgerechnet.
|
|
|
|
|
2009-01-06 11:49:19 +01:00
|
|
|
// Order summary
|
2012-10-15 21:19:17 +02:00
|
|
|
.well
|
|
|
|
%dl.dl-horizontal
|
|
|
|
%dt Lieferantin
|
|
|
|
%dd= @order.name
|
2012-12-14 18:10:46 +01:00
|
|
|
- if @note.present?
|
|
|
|
%dt Notiz
|
|
|
|
%dd= @order.note
|
|
|
|
%dt Erstellt von
|
|
|
|
%dd= link_to_user_message_if_valid(@order.created_by)
|
2012-10-15 21:19:17 +02:00
|
|
|
%dt Beginn
|
|
|
|
%dd= format_time(@order.starts)
|
|
|
|
%dt Ende
|
|
|
|
%dd= format_time(@order.ends)
|
|
|
|
%dt Gruppenbestellungen:
|
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(', ')})
|
2012-10-15 21:19:17 +02:00
|
|
|
%dt Netto/Bruttosumme aller Artikel:
|
|
|
|
%dd= "#{number_to_currency(@order.sum(:net))} / #{number_to_currency(@order.sum(:gross))}"
|
|
|
|
%dt Bestellte Artikel:
|
|
|
|
%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?
|
2012-10-15 21:19:17 +02:00
|
|
|
= link_to "Bearbeiten", edit_order_path(@order), class: 'btn'
|
|
|
|
= link_to 'Beenden!', finish_order_path(@order), method: :post,
|
|
|
|
confirm: "Willst Du wirklich die Bestellung beenden?\nEs gibt kein zurück..", class: 'btn'
|
2009-02-03 21:14:48 +01:00
|
|
|
- unless @order.closed?
|
2012-10-15 21:19:17 +02:00
|
|
|
= link_to "Löschen", @order, confirm: "Willst du wirklich die Bestellung löschen?", method: :delete,
|
|
|
|
class: 'btn btn-danger'
|
|
|
|
|
|
|
|
- unless @order.open?
|
|
|
|
%ul.nav.nav-pills
|
|
|
|
%li.active= update_articles_link(@order, "Artikelübersicht", :default)
|
|
|
|
%li= update_articles_link(@order, "Sortiert nach Gruppen", :groups)
|
|
|
|
%li= update_articles_link(@order, "Sortiert nach Artikeln", :articles)
|
|
|
|
%li= link_to 'Kommentare', '#comments'
|
|
|
|
%li.dropdown
|
|
|
|
= link_to '#', class: 'dropdown-toggle', data: {toggle: 'dropdown'} do
|
|
|
|
Download
|
|
|
|
%b.caret
|
|
|
|
%ul.dropdown-menu
|
|
|
|
%li= order_pdf(@order, :groups, "Gruppenpdf")
|
|
|
|
%li= order_pdf(@order, :articles, "Artikelpdf")
|
|
|
|
%li= order_pdf(@order, :matrix, "Matrix")
|
|
|
|
%li= order_pdf(@order, :fax, "Fax PDF")
|
|
|
|
%li= link_to "Fax Text", {action: 'text_fax_template', id: @order }, {title: "Download file"}
|
|
|
|
|
|
|
|
%section#articles_table
|
|
|
|
= render 'articles', order: @order
|
2009-01-06 11:49:19 +01:00
|
|
|
|
2012-10-15 21:19:17 +02:00
|
|
|
%h2 Kommentare
|
|
|
|
#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)}
|
|
|
|
= link_to_top
|