2009-02-06 16:26:35 +01:00
|
|
|
= render :partial => 'order_head'
|
|
|
|
|
|
|
|
.single_column{:style => 'clear:both'}
|
|
|
|
- form_tag(:action => 'saveOrder', :id => @order) do
|
|
|
|
.box_title
|
|
|
|
%h2 Anderer Bestellungen
|
|
|
|
.column_content
|
|
|
|
%table#order.list
|
|
|
|
%thead
|
|
|
|
%tr
|
|
|
|
%th Name
|
|
|
|
%th
|
|
|
|
%th Lieferantin
|
|
|
|
%th{:style => "width:5em;"} Einheit
|
|
|
|
%th{:style => "width:4.5em;"} Preis
|
2010-02-09 22:34:04 +01:00
|
|
|
%th(style="width:20px") Verfügbar
|
|
|
|
%th#col_required(style="width:110px") Menge
|
2009-02-06 16:26:35 +01:00
|
|
|
%th Summe
|
|
|
|
%tbody
|
|
|
|
- total = 0
|
|
|
|
- i = 0
|
|
|
|
- for category_name, order_articles in @articles_grouped_by_category
|
|
|
|
%tr{:style => "background-color:#EFEFEF"}
|
|
|
|
%td{:style => "text-align:left"}
|
|
|
|
%b=h category_name
|
|
|
|
%td{:colspan => "9"}
|
|
|
|
- for order_article in order_articles
|
|
|
|
- article_total = @price[i] * @quantity[i]
|
|
|
|
- total += article_total
|
2010-02-09 22:34:04 +01:00
|
|
|
%tr{:class => cycle('even', 'odd', :name => 'articles')+' order-article', :valign => "top"}
|
|
|
|
%td.name= order_article.article.name
|
2009-02-06 16:26:35 +01:00
|
|
|
%td=h order_article.article.origin
|
|
|
|
%td=h truncate order_article.article.supplier.name, :length => 11
|
|
|
|
%td=h order_article.article.unit
|
|
|
|
%td= number_to_currency @price[i]
|
|
|
|
%td= @quantity_available[i]
|
|
|
|
%td{:style => "text-align:right;"}
|
|
|
|
= hidden_field_tag "ordered[#{order_article.id}][quantity]", @quantity[i], :id => "q_#{i}", :size => "2"
|
|
|
|
%span.used{:id => "q_used_#{i}"}= @used_quantity[i]
|
|
|
|
= button_to_function('+', "increaseStockQuantity(#{i})")
|
|
|
|
= button_to_function('-', "decreaseStockQuantity(#{i})")
|
|
|
|
|
|
|
|
%td{:id => "td_price_#{i}", :style => "text-align:right; padding-right:10px; width:4em"}
|
|
|
|
%span{:id => "price_#{i}_display"}= number_to_currency(article_total, :unit => "")
|
|
|
|
€
|
2010-02-09 22:34:04 +01:00
|
|
|
.article-info
|
|
|
|
%h3= order_article.article.name
|
|
|
|
.right
|
|
|
|
Gesamt-Einheiten:
|
|
|
|
%span{:id => "q_total_#{i}"}= @quantity[i] + @others_quantity[i]
|
|
|
|
%br/
|
|
|
|
.left
|
|
|
|
Hersteller:
|
|
|
|
= order_article.article.manufacturer
|
|
|
|
%br/
|
|
|
|
Gebinde:
|
|
|
|
= order_article.article.quantity_available
|
|
|
|
*
|
|
|
|
= order_article.article.unit
|
|
|
|
%br/
|
|
|
|
Notiz:
|
|
|
|
= order_article.article.note
|
|
|
|
%br/
|
2009-02-06 16:26:35 +01:00
|
|
|
- i = i + 1
|
2010-02-09 22:34:04 +01:00
|
|
|
= render "order_footer", :total => total
|
2009-02-06 16:26:35 +01:00
|
|
|
|
|
|
|
%script{:type => "text/" + "javascript"}
|
|
|
|
// preset data
|
|
|
|
- for i in 0...@price.size
|
|
|
|
= "addData(#{@price[i]}, 1, #{@price[i] * @quantity[i]}, #{@others_quantity[i]}, 0, #{@used_quantity[i]}, #{@quantity_available[i]});"
|
|
|
|
= "setGroupBalance(#{@availableFunds});"
|
|
|
|
// localization
|
|
|
|
setDecimalSeparator(",");
|
|
|
|
// initialize javascript
|
|
|
|
updateBalance();
|