foodsoft/app/views/orders/_form.html.haml

63 lines
2.7 KiB
Text
Raw Normal View History

2011-06-10 13:53:51 +02:00
= simple_form_for @order do |f|
.single_column
.box_title
%h2 Bestellung für #{@order.supplier.name}
.column_content
= f.hidden_field :supplier_id
= f.input :note
= f.input :starts
= f.input :ends
2009-01-06 11:49:19 +01:00
2011-06-10 13:53:51 +02:00
.box_title
%h2 Artikel
.column_content
- if (@template_orders && !@template_orders.empty?)
%p
%label{:for => 'template'} Benutze Artikelauswahl von
%select{:name => "template_id", :onchange => "useTemplate(this[this.selectedIndex].value)"}
%option{:value => "-1", :selected => "selected"} Bestellung auswählen...
- i = -1
- for order in @template_orders
%option{:value => (i += 1)}= "#{h(order.name)} bis #{order.ends.strftime('%d. %b')}"
%table.list
%tr
%th= check_box_tag 'checkall', "1", false, { 'data-check-all' => 'form.order' }
%th Name
%th Notiz
- if @order.stockit?
%th Verfügbar
- else
%th Herkunft
%th Hersteller
%th Gebinde
%th Preis (netto/FC)
- for category_name, articles in @order.articles_for_ordering
%tr{:style => "background-color:#EFEFEF"}
%td
%td{:colspan => "6", :style => "text-align:left"}
%b=h category_name
- for article in articles
/ check if the article is selected
- included = @order.order_articles.detect { |order_article| order_article.article_id == article.id }
- included_class = included ? ' selected' : ''
%tr{:class => cycle('even', 'odd') + ' click-me' + included_class, :id => article.id.to_s, :onclick => "checkRow('#{article.id}')"}
%td= check_box_tag "order[article_ids][]", article.id, included, { :id => "checkbox_#{article.id}", :onclick => "checkRow('#{article.id}')" }
%td=h article.name
%td=h truncate article.note, :length => 25
- if @order.stockit?
%td= "#{article.quantity_available} * #{article.unit}"
- else
%td=h truncate article.origin, :length => 15
%td=h truncate article.manufacturer, :length => 15
%td= "#{article.unit_quantity} x #{article.unit}"
%td= "#{number_to_currency(article.price)} / #{number_to_currency(article.fc_price)}"
%tr
%td{:colspan => "6"}
= check_box_tag 'checkall', "1", false, { 'data-check-all' => 'form.order' }
Alle auswählen
2009-01-06 11:49:19 +01:00
2011-06-10 13:53:51 +02:00
- if (@template_orders && !@template_orders.empty?)
= render :partial => 'template_orders_script'
2009-01-06 11:49:19 +01:00
2011-06-10 13:53:51 +02:00
= f.submit
= link_to "oder abbrechen", orders_path