2009-10-17 12:22:13 +02:00
|
|
|
- content_for :head do
|
|
|
|
:javascript
|
2011-06-19 15:30:33 +02:00
|
|
|
$(function() {
|
|
|
|
$('tr.ignored').hide();
|
2009-10-17 12:22:13 +02:00
|
|
|
});
|
|
|
|
|
2009-02-05 16:40:02 +01:00
|
|
|
- title "Dein Bestellergebnis für #{@order.name}"
|
2009-01-06 11:49:19 +01:00
|
|
|
|
|
|
|
// Order summary
|
|
|
|
.left_column{:style => "width:45em"}
|
|
|
|
.box_title
|
2009-01-29 01:57:51 +01:00
|
|
|
%h2 Zusammenfassung
|
2009-01-06 11:49:19 +01:00
|
|
|
.column_content
|
|
|
|
%table
|
|
|
|
%tr{:valign => "top"}
|
|
|
|
%td{:style => "width:50%"}
|
|
|
|
%p
|
2009-03-22 13:56:54 +01:00
|
|
|
Lieferantin:
|
2009-02-05 16:40:02 +01:00
|
|
|
%b=h @order.name
|
2009-02-03 21:14:48 +01:00
|
|
|
- unless @order.note.blank?
|
2009-01-06 11:49:19 +01:00
|
|
|
%p
|
2009-01-29 01:57:51 +01:00
|
|
|
Notiz:
|
2009-01-06 11:49:19 +01:00
|
|
|
=h @order.note
|
|
|
|
%p
|
2009-01-29 01:57:51 +01:00
|
|
|
Ende:
|
2009-01-06 11:49:19 +01:00
|
|
|
%b=h format_time(@order.ends)
|
|
|
|
%p
|
2009-01-29 01:57:51 +01:00
|
|
|
Bestellsumme:
|
|
|
|
- if @group_order
|
|
|
|
%b=h number_to_currency(@group_order.price)
|
2009-01-06 11:49:19 +01:00
|
|
|
- else
|
2009-01-29 01:57:51 +01:00
|
|
|
%b Du hast nicht bestellt.
|
2009-03-01 18:45:34 +01:00
|
|
|
- if @order.closed?
|
|
|
|
%p
|
|
|
|
= "Abgerechnet von #{@order.updated_by.nick}"
|
2009-01-29 01:57:51 +01:00
|
|
|
= link_to "Kommentare lesen/schreiben", "#comments"
|
2009-01-06 11:49:19 +01:00
|
|
|
|
2011-06-19 19:56:04 +02:00
|
|
|
= render :partial => "switch_order", :locals => {:current_order => @order}
|
2009-01-06 11:49:19 +01:00
|
|
|
|
2009-01-29 01:57:51 +01:00
|
|
|
// Article box
|
2009-01-06 11:49:19 +01:00
|
|
|
.single_column{:style => "clear:both; width:70em;"}
|
|
|
|
.box_title
|
2009-01-29 01:57:51 +01:00
|
|
|
%h2 Artikelübersicht
|
2009-01-06 11:49:19 +01:00
|
|
|
.column_content#result
|
2009-01-29 01:57:51 +01:00
|
|
|
- if @group_order
|
2011-06-19 15:30:33 +02:00
|
|
|
%p(style="float:right")= link_to "Zeige/Verstecke nicht bestellte Artikel", '#', 'data-toggle-this' => 'tr.ignored'
|
|
|
|
%p= link_to("Bestellung ändern", edit_group_order_path(@group_order, :order_id => @order.id)) if @order.open?
|
2009-01-29 01:57:51 +01:00
|
|
|
%table.list
|
|
|
|
%thead
|
|
|
|
%tr
|
|
|
|
%th{:style => "width:40%"} Name
|
|
|
|
%th Gebinde
|
|
|
|
%th Einzelpreis
|
|
|
|
%th
|
|
|
|
%abbr{:title => "Menge + Toleranz"} Bestellt
|
|
|
|
%th
|
2009-11-15 12:43:13 +01:00
|
|
|
%abbr{:title => "Unter Berücksichtigung der derzeitigen Bestellungen aller Gruppen"}
|
|
|
|
- if @order.open?
|
|
|
|
Zu
|
|
|
|
Erhalten
|
2009-01-29 01:57:51 +01:00
|
|
|
%th Gesamtpreis
|
|
|
|
%tbody
|
|
|
|
- total = 0 #set counter for order-sum
|
2009-02-04 16:41:01 +01:00
|
|
|
- for category_name, order_articles in @order.articles_grouped_by_category
|
2009-01-29 01:57:51 +01:00
|
|
|
%tr{:style => "background-color:#EFEFEF"}
|
|
|
|
%td{:style => "text-align:left;"}=h category_name
|
|
|
|
%td{:colspan => "9"}
|
|
|
|
- for oa in order_articles
|
|
|
|
- # get the order-results for the ordergroup
|
2011-06-19 15:30:33 +02:00
|
|
|
- goa = oa.group_order_articles.find_by_group_order_id(@group_order.id)
|
|
|
|
- quantity = goa.quantity
|
|
|
|
- tolerance = goa.tolerance
|
|
|
|
- result = goa.result
|
|
|
|
- sub_total = goa.total_price
|
2009-01-29 01:57:51 +01:00
|
|
|
- total += sub_total
|
2011-06-19 15:30:33 +02:00
|
|
|
%tr{:class => cycle('even', 'odd', :name => 'articles') + " " + order_article_class_name(quantity, tolerance, result)}
|
2009-01-29 01:57:51 +01:00
|
|
|
%td{:style => "width:40%"}
|
|
|
|
=h oa.article.name
|
2009-02-03 21:14:48 +01:00
|
|
|
- unless oa.article.note.blank?
|
2009-01-29 01:57:51 +01:00
|
|
|
= image_tag("lamp_grey.png", {:alt => "Notiz anzeigen", :size => "15x16", :border => "0", :onmouseover => "$('note_#{oa.id}').show();", :onmouseout => "$('note_#{oa.id}').hide();"})
|
|
|
|
%td= "#{oa.price.unit_quantity} x #{oa.article.unit}"
|
|
|
|
%td= number_to_currency(oa.price.fc_price)
|
|
|
|
%td
|
|
|
|
= quantity
|
|
|
|
= "+ #{tolerance}" if oa.price.unit_quantity > 1
|
|
|
|
%td= result > 0 ? result : "0"
|
|
|
|
%td= number_to_currency(sub_total)
|
2009-02-03 21:14:48 +01:00
|
|
|
- unless oa.article.note.blank?
|
2009-01-29 01:57:51 +01: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')}
|
|
|
|
%th{:colspan => "5"} Summe
|
|
|
|
%th= number_to_currency(total)
|
|
|
|
%br/
|
|
|
|
= link_to_top
|
2009-01-06 11:49:19 +01:00
|
|
|
- else
|
2009-10-17 18:24:08 +02:00
|
|
|
- if @order.open?
|
|
|
|
Du hast noch nicht bestellt.
|
|
|
|
= link_to "Das ist Deine Chance!", :action => "order", :id => @order
|
|
|
|
- else
|
|
|
|
Die Bestellung is leider schon zu Ende. Beim nächsten mal früher aufstehen...
|
2009-01-06 11:49:19 +01:00
|
|
|
|
|
|
|
// Comments box
|
2009-01-29 01:57:51 +01:00
|
|
|
.single_column{:style => "width:70em;"}
|
|
|
|
.box_title
|
2009-10-17 18:24:08 +02:00
|
|
|
%h2 Kommentare
|
2009-01-29 01:57:51 +01:00
|
|
|
.column_content#comments
|
|
|
|
= render :partial => 'shared/comments', :locals => { :comments => @order.comments }
|
|
|
|
%p
|
|
|
|
- form_for :comment, :url => { :action => :add_comment, :id => @order } do |form|
|
2009-01-06 11:49:19 +01:00
|
|
|
%p
|
2009-01-29 01:57:51 +01:00
|
|
|
%b Neuen Kommentar hinzufügen:
|
|
|
|
%br/
|
|
|
|
= form.text_area :text, :cols => 50, :rows => 6
|
|
|
|
%br/
|
|
|
|
= submit_tag "Kommentar hinzufügen"
|
2009-10-17 12:22:13 +02:00
|
|
|
= link_to_top
|