2012-10-15 21:19:17 +02:00
|
|
|
- content_for :javascript do
|
2009-10-17 12:22:13 +02:00
|
|
|
:javascript
|
2011-06-19 15:30:33 +02:00
|
|
|
$(function() {
|
|
|
|
$('tr.ignored').hide();
|
2009-10-17 12:22:13 +02:00
|
|
|
});
|
|
|
|
|
2013-02-09 02:01:31 +01:00
|
|
|
- title t('.title', order: @order.name)
|
2009-01-06 11:49:19 +01:00
|
|
|
|
2012-10-15 21:19:17 +02:00
|
|
|
.well
|
|
|
|
// Order summary
|
|
|
|
%dl.dl-horizontal
|
2013-02-09 02:01:31 +01:00
|
|
|
%dt= t '.supplier'
|
2012-10-15 21:19:17 +02:00
|
|
|
%dd= @order.name
|
2013-02-09 02:01:31 +01:00
|
|
|
%dt= t '.note'
|
2012-10-15 21:19:17 +02:00
|
|
|
%dd= @order.note
|
2013-02-09 02:01:31 +01:00
|
|
|
%dt= t '.ending'
|
2012-10-15 21:19:17 +02:00
|
|
|
%dd= format_time(@order.ends)
|
2013-02-09 02:01:31 +01:00
|
|
|
%dt= t '.order_sum'
|
2012-10-15 21:19:17 +02:00
|
|
|
%dd
|
|
|
|
- if @group_order
|
|
|
|
= number_to_currency(@group_order.price)
|
|
|
|
- else
|
2013-02-09 02:01:31 +01:00
|
|
|
= t '.not_ordered'
|
2012-10-15 21:19:17 +02:00
|
|
|
- if @order.closed?
|
2013-09-20 22:40:13 +02:00
|
|
|
%p= t '.closed_by', user: show_user(@order.updated_by)
|
2013-02-09 02:01:31 +01:00
|
|
|
= link_to t('.comment'), "#comments"
|
2009-01-06 11:49:19 +01:00
|
|
|
|
2009-01-29 01:57:51 +01:00
|
|
|
// Article box
|
2012-10-15 21:19:17 +02:00
|
|
|
%section
|
2013-02-09 02:01:31 +01:00
|
|
|
%h2= t '.articles.title'
|
2009-01-06 11:49:19 +01:00
|
|
|
.column_content#result
|
2009-01-29 01:57:51 +01:00
|
|
|
- if @group_order
|
2013-02-09 02:01:31 +01:00
|
|
|
%p.pull-right= link_to t('.articles.show_hide'), '#', 'data-toggle-this' => 'tr.ignored'
|
|
|
|
%p= link_to(t('.articles.edit_order'), edit_group_order_path(@group_order, order_id: @order.id), class: 'btn btn-primary') if @order.open?
|
2012-10-15 21:19:17 +02:00
|
|
|
%table.table.table-hover
|
2009-01-29 01:57:51 +01:00
|
|
|
%thead
|
|
|
|
%tr
|
2013-02-09 02:01:31 +01:00
|
|
|
%th{style: "width:40%"}= t '.articles.name'
|
|
|
|
%th= t '.articles.units'
|
|
|
|
%th= t '.articles.unit_price'
|
2009-01-29 01:57:51 +01:00
|
|
|
%th
|
2013-02-09 02:01:31 +01:00
|
|
|
%abbr{title: t('.articles.ordered_title')}= t '.articles.ordered'
|
2009-01-29 01:57:51 +01:00
|
|
|
%th
|
2013-02-09 02:01:31 +01:00
|
|
|
%abbr{title: t('.articles.order_nopen_title')}
|
2009-11-15 12:43:13 +01:00
|
|
|
- if @order.open?
|
2013-02-09 02:01:31 +01:00
|
|
|
= t '.articles.order_open'
|
|
|
|
- else
|
|
|
|
= t '.articles.order_not_open'
|
|
|
|
%th= t '.articles.total_price'
|
2009-01-29 01:57:51 +01:00
|
|
|
%tbody
|
2009-02-04 16:41:01 +01:00
|
|
|
- for category_name, order_articles in @order.articles_grouped_by_category
|
2012-10-15 21:19:17 +02:00
|
|
|
%tr.article-category
|
|
|
|
%td
|
|
|
|
= category_name
|
|
|
|
%i.icon-tag
|
|
|
|
%td{colspan: "9"}
|
2012-12-16 16:50:09 +01:00
|
|
|
- order_articles.each do |oa|
|
2009-01-29 01:57:51 +01:00
|
|
|
- # get the order-results for the ordergroup
|
2012-12-16 16:50:09 +01:00
|
|
|
- r = get_order_results(oa, @group_order.id)
|
|
|
|
%tr{class: cycle('even', 'odd', name: 'articles') + " " + order_article_class_name(r[:quantity], r[:tolerance], r[:result])}
|
2012-10-15 21:19:17 +02:00
|
|
|
%td{style: "width:40%"}
|
2012-12-16 16:50:09 +01:00
|
|
|
= oa.article.name
|
2009-02-03 21:14:48 +01:00
|
|
|
- unless oa.article.note.blank?
|
2012-10-15 21:19:17 +02:00
|
|
|
= image_tag("lamp_grey.png", {alt: "Notiz anzeigen", size: "15x16", border: "0", onmouseover: "$('note_#{oa.id}').show();", onmouseout: "$('note_#{oa.id}').hide();"})
|
2009-01-29 01:57:51 +01:00
|
|
|
%td= "#{oa.price.unit_quantity} x #{oa.article.unit}"
|
|
|
|
%td= number_to_currency(oa.price.fc_price)
|
|
|
|
%td
|
2012-12-16 16:50:09 +01:00
|
|
|
= r[:quantity]
|
|
|
|
= "+ #{r[:tolerance]}" if oa.price.unit_quantity > 1
|
|
|
|
%td= r[:result] > 0 ? r[:result] : "0"
|
|
|
|
%td= number_to_currency(r[:sub_total])
|
2009-02-03 21:14:48 +01:00
|
|
|
- unless oa.article.note.blank?
|
2012-10-15 21:19:17 +02:00
|
|
|
%tr{id: "note_#{oa.id}", class: "note even", style: "display:none"}
|
|
|
|
%td{colspan: "6"}=h oa.article.note
|
|
|
|
%tr{class: cycle('even', 'odd', name: 'articles')}
|
2013-02-09 02:01:31 +01:00
|
|
|
%th{colspan: "5"}= t '.articles.sum'
|
2013-04-08 13:39:02 +02:00
|
|
|
%th= number_to_currency(@group_order.price)
|
2009-01-29 01:57:51 +01:00
|
|
|
%br/
|
|
|
|
= link_to_top
|
2009-01-06 11:49:19 +01:00
|
|
|
- else
|
2009-10-17 18:24:08 +02:00
|
|
|
- if @order.open?
|
2013-02-09 02:01:31 +01:00
|
|
|
= t '.articles.not_ordered_msg'
|
|
|
|
= link_to t('.articles.order_now'), action: "order", id: @order
|
2009-10-17 18:24:08 +02:00
|
|
|
- else
|
2013-02-09 02:01:31 +01:00
|
|
|
= t '.articles.order_closed_msg'
|
2009-01-06 11:49:19 +01:00
|
|
|
|
|
|
|
// Comments box
|
2012-10-15 21:19:17 +02:00
|
|
|
%section
|
2013-02-09 02:01:31 +01:00
|
|
|
%h2= t '.comments.title'
|
2012-10-15 21:19:17 +02:00
|
|
|
#comments
|
|
|
|
= render 'shared/comments', comments: @order.comments
|
|
|
|
#new_comment= render 'order_comments/form', order_comment: @order.comments.build(user: current_user)
|
|
|
|
= link_to_top
|