foodsoft/app/views/orders/show.html.haml
benni 0dff5ea784 Fixed some bugs in tasks, apple feature:
* Update ordergroup stats when task is destroyed.
* Removed assigned caching attribute in task object.
* A lot of eager loading for tasks controller.
2012-12-16 19:07:45 +01:00

61 lines
No EOL
2.3 KiB
Text

- title "Bestellung: #{@order.name}"
- if @order.finished? and !@order.closed?
.alert.alert-warning Achtung, Bestellung wurde noch nicht abgerechnet.
// Order summary
.well
%dl.dl-horizontal
%dt Lieferantin
%dd= @order.name
- if @note.present?
%dt Notiz
%dd= @order.note
%dt Erstellt von
%dd= link_to_user_message_if_valid(@order.created_by)
%dt Beginn
%dd= format_time(@order.starts)
%dt Ende
%dd= format_time(@order.ends)
%dt Gruppenbestellungen:
%dd #{@order.group_orders.count} (#{@order.group_orders.includes(:ordergroup).all.map {|g| g.ordergroup.name}.join(', ')})
%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
.form-actions
- if @order.open?
= link_to "Bearbeiten", edit_order_path(@order), class: 'btn'
= link_to 'Beenden!', finish_order_path(@order), method: :post, class: 'btn btn-success',
confirm: "Willst Du wirklich die Bestellung beenden?\nEs gibt kein zurück.."
- unless @order.closed?
= 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= 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
%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