2011-06-19 15:30:33 +02:00
|
|
|
- content_for :head do
|
2011-06-19 19:56:04 +02:00
|
|
|
:javascript
|
|
|
|
$(function() {
|
|
|
|
#{data_to_js(@ordering_data)}
|
|
|
|
setGroupBalance(#{@ordering_data[:available_funds]});
|
|
|
|
setDecimalSeparator(",");
|
|
|
|
setToleranceBehaviour(#{Foodsoft.config[:tolerance_is_costly]});
|
|
|
|
setStockit(#{@order.stockit?});
|
|
|
|
});
|
2011-06-19 15:30:33 +02:00
|
|
|
|
2011-06-19 19:56:04 +02:00
|
|
|
- title "Bestellen"
|
2011-06-19 15:30:33 +02:00
|
|
|
|
2011-06-19 19:56:04 +02:00
|
|
|
.left_column{:style => "width:49em"}
|
|
|
|
.box_title
|
|
|
|
%h2=h @order.name
|
|
|
|
.column_content
|
|
|
|
%table
|
|
|
|
%tr{:valign => "top"}
|
|
|
|
%td{:width => "60%"}
|
|
|
|
%p
|
|
|
|
%b Lieferantin:
|
|
|
|
=h @order.name
|
|
|
|
%p
|
|
|
|
%b Ende:
|
|
|
|
=h format_time(@order.ends)
|
|
|
|
- if @group_order && @group_order.updated_by
|
|
|
|
%p
|
|
|
|
%b Zuletzt bestellt:
|
|
|
|
=h @group_order.updated_by.nick if @group_order.updated_by
|
|
|
|
= "(#{format_time(@group_order.updated_on)})"
|
|
|
|
%p
|
|
|
|
%b Verfügbares Guthaben:
|
|
|
|
= number_to_currency(@ordering_data[:available_funds])
|
|
|
|
%td
|
|
|
|
- unless @order.note.empty?
|
|
|
|
%p
|
|
|
|
%b Notiz:
|
|
|
|
= simple_format(@order.note)
|
|
|
|
- unless @order.stockit? || @order.supplier.min_order_quantity.blank?
|
|
|
|
%p
|
|
|
|
%b Mindestellmenge:
|
|
|
|
=h @order.supplier.min_order_quantity
|
|
|
|
%p
|
|
|
|
%b Gesamtbestellmenge bisher:
|
|
|
|
= number_to_currency @order.sum
|
|
|
|
|
|
|
|
= render :partial => 'switch_order', :locals => {:current_order => @order}
|
|
|
|
|
|
|
|
= form_for @group_order do |f|
|
2011-06-19 15:30:33 +02:00
|
|
|
= f.hidden_field :lock_version
|
|
|
|
= f.hidden_field :order_id
|
|
|
|
= f.hidden_field :updated_by_user_id
|
|
|
|
= f.hidden_field :ordergroup_id
|
|
|
|
.single_column{:style => "clear:both;margin-bottom:7em;"}
|
|
|
|
.box_title
|
|
|
|
%h2 Artikel
|
|
|
|
.column_content
|
|
|
|
%table#order.list
|
|
|
|
%thead
|
|
|
|
%tr
|
|
|
|
%th Name
|
|
|
|
%th{:style => "width:13px;"}
|
|
|
|
%th{:style => "width:4.5em;"} Preis
|
|
|
|
%th{:style => "width:4.5em;"} Einheit
|
2011-06-19 19:56:04 +02:00
|
|
|
- unless @order.stockit?
|
|
|
|
%th{:style => "width:70px;"} Fehlende Einheiten
|
|
|
|
%th#col_required Menge
|
2011-06-19 15:30:33 +02:00
|
|
|
%th#col_tolerance Toleranz
|
2011-06-19 19:56:04 +02:00
|
|
|
- else
|
|
|
|
%th(style="width:20px") Verfügbar
|
|
|
|
%th#col_required Menge
|
2011-06-19 15:30:33 +02:00
|
|
|
%th{:style => "width:15px;"} Summe
|
|
|
|
%tbody
|
|
|
|
- @order.articles_grouped_by_category.each do |category, order_articles|
|
|
|
|
%tr{:style => "background-color:#EFEFEF"}
|
|
|
|
%td{:style => "text-align:left"}
|
|
|
|
%b= h category
|
|
|
|
%td{:colspan => "9"}
|
|
|
|
- order_articles.each do |order_article|
|
|
|
|
%tr{:class => "#{cycle('even', 'odd', :name => 'articles')} order-article", :valign => "top"}
|
|
|
|
%td.name= order_article.article.name
|
|
|
|
%td= h order_article.article.origin
|
|
|
|
%td= number_to_currency(@ordering_data[:order_articles][order_article.id][:price])
|
|
|
|
%td= order_article.article.unit
|
|
|
|
%td
|
2011-06-19 19:56:04 +02:00
|
|
|
- if @order.stockit?
|
|
|
|
= @ordering_data[:order_articles][order_article.id][:quantity_available]
|
|
|
|
- else
|
|
|
|
%span{:id => "missing_units_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:missing_units]
|
|
|
|
|
2011-06-19 15:30:33 +02:00
|
|
|
%td.quantity
|
|
|
|
%input{:id => "q_#{order_article.id}", :name => "group_order[group_order_articles_attributes][#{order_article.id}][quantity]", :size => "2", :type => "hidden", :value => @ordering_data[:order_articles][order_article.id][:quantity]}/
|
|
|
|
%span.used{:id => "q_used_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:used_quantity]
|
|
|
|
+
|
|
|
|
%span.unused{:id => "q_unused_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:quantity] - @ordering_data[:order_articles][order_article.id][:used_quantity]
|
|
|
|
%input{:type => 'button', :value => '+', 'data-increase_quantity' => order_article.id}
|
|
|
|
%input{:type => 'button', :value => '-', 'data-decrease_quantity' => order_article.id}
|
2011-06-19 19:56:04 +02:00
|
|
|
|
|
|
|
%td.tolerance{:style => ('display:none' if @order.stockit?)}
|
|
|
|
%input{:id => "t_#{order_article.id}", :name => "group_order[group_order_articles_attributes][#{order_article.id}][tolerance]", :size => "2", :type => "hidden", :value => @ordering_data[:order_articles][order_article.id][:tolerance]}/
|
|
|
|
- if (@ordering_data[:order_articles][order_article.id][:unit] > 1)
|
|
|
|
%span.used{:id => "t_used_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:used_tolerance]
|
|
|
|
+
|
|
|
|
%span.unused{:id => "t_unused_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:tolerance] - @ordering_data[:order_articles][order_article.id][:used_tolerance]
|
|
|
|
%input{:type => 'button', :value => '+', 'data-increase_tolerance' => order_article.id}
|
|
|
|
%input{:type => 'button', :value => '-', 'data-decrease_tolerance' => order_article.id}
|
|
|
|
|
2011-06-19 15:30:33 +02:00
|
|
|
%td{:id => "td_price_#{order_article.id}", :style => "text-align:right; padding-right:10px; width:4em"}
|
2011-06-19 19:56:04 +02:00
|
|
|
%span{:id => "price_#{order_article.id}_display"}= number_to_currency(@ordering_data[:order_articles][order_article.id][:total_price], :unit => "")
|
2011-06-19 15:30:33 +02:00
|
|
|
€
|
|
|
|
.article-info
|
|
|
|
%h3= order_article.article.name
|
|
|
|
.right
|
|
|
|
Volle Gebinde:
|
|
|
|
%span{:id => "units_#{order_article.id}"}= order_article.units_to_order
|
|
|
|
%br/
|
|
|
|
Gesamt-Einheiten:
|
|
|
|
%span{:id => "q_total_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:quantity] + @ordering_data[:order_articles][order_article.id][:others_quantity]
|
|
|
|
%br/
|
|
|
|
Gesamt-Toleranz:
|
|
|
|
%span{:id => "t_total_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:tolerance] + @ordering_data[:order_articles][order_article.id][:others_tolerance]
|
|
|
|
%br/
|
|
|
|
.left
|
|
|
|
Hersteller: #{order_article.article.manufacturer}
|
|
|
|
%br/
|
|
|
|
Gebinde: #{@order.stockit? ? order_article.article.quantity_available : @ordering_data[:order_articles][order_article.id][:unit]} * #{h order_article.article.unit}
|
|
|
|
%br/
|
|
|
|
Notiz: #{order_article.article.note}
|
|
|
|
%br/
|
2011-06-19 19:56:04 +02:00
|
|
|
#order-footer
|
|
|
|
#info-box
|
|
|
|
#total-sum
|
|
|
|
%table
|
|
|
|
%tr
|
|
|
|
%td Gesamtbetrag:
|
|
|
|
%td.currency
|
|
|
|
%span#total_price= @group_order.price
|
|
|
|
€
|
|
|
|
%tr
|
|
|
|
%td Verfügbares Guthaben:
|
|
|
|
%td.currency= number_to_currency(@ordering_data[:available_funds])
|
|
|
|
%tr
|
|
|
|
%td Neuer Kontostand:
|
|
|
|
%td.currency
|
|
|
|
%strong
|
|
|
|
%span#new_balance= @ordergroup.account_balance - @group_order.price
|
|
|
|
€
|
|
|
|
#order-button
|
|
|
|
= submit_tag( "Bestellung speichern", :id => 'submit_button' )
|
2012-08-24 11:11:40 +02:00
|
|
|
oder #{link_to "abbrechen", group_orders_path}
|
2011-06-19 19:56:04 +02:00
|
|
|
%input#total_balance{:name => "total_balance", :type => "hidden", :value => @ordergroup.account_balance - @group_order.price}/
|
|
|
|
%input{:name => "version", :type => "hidden", :value => @version}/
|