2009-01-29 01:57:51 +01:00
|
|
|
= form.error_messages
|
2009-01-06 11:49:19 +01:00
|
|
|
|
|
|
|
.single_column
|
|
|
|
.box_title
|
2009-01-29 01:57:51 +01:00
|
|
|
%h2 Bestellung
|
2009-01-06 11:49:19 +01:00
|
|
|
.column_content
|
2009-01-29 01:57:51 +01:00
|
|
|
= form.hidden_field :supplier_id
|
2009-01-06 11:49:19 +01:00
|
|
|
%p
|
2009-03-22 13:56:54 +01:00
|
|
|
Lieferantin:
|
2009-02-05 16:40:02 +01:00
|
|
|
= @order.name
|
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
|
|
|
%br/
|
2009-01-29 01:57:51 +01:00
|
|
|
= form.text_area :note, :cols => 50, :rows => 5
|
2009-01-06 11:49:19 +01:00
|
|
|
%p
|
2009-01-29 01:57:51 +01:00
|
|
|
Start
|
2009-01-06 11:49:19 +01:00
|
|
|
%br/
|
2009-01-29 01:57:51 +01:00
|
|
|
= form.datetime_select :starts, :start_year => Time.now.year - 1
|
2009-01-06 11:49:19 +01:00
|
|
|
%p
|
2009-01-29 01:57:51 +01:00
|
|
|
Ende
|
2009-01-06 11:49:19 +01:00
|
|
|
%br/
|
2009-01-29 01:57:51 +01:00
|
|
|
= form.datetime_select :ends, :start_year => Time.now.year - 1, :include_blank => true
|
2009-01-06 11:49:19 +01:00
|
|
|
|
|
|
|
.box_title
|
2009-01-29 01:57:51 +01:00
|
|
|
%h2 Artikel
|
2009-01-06 11:49:19 +01:00
|
|
|
.column_content
|
|
|
|
- if (@template_orders && !@template_orders.empty?)
|
|
|
|
%p
|
2009-02-10 20:06:08 +01:00
|
|
|
%label{:for => 'template'} Benutze Artikelauswahl von
|
2009-01-06 11:49:19 +01:00
|
|
|
%select{:name => "template_id", :onchange => "useTemplate(this[this.selectedIndex].value)"}
|
2009-02-10 20:06:08 +01:00
|
|
|
%option{:value => "-1", :selected => "selected"} Bestellung auswählen...
|
2009-01-06 11:49:19 +01:00
|
|
|
- i = -1
|
|
|
|
- for order in @template_orders
|
2009-02-05 16:40:02 +01:00
|
|
|
%option{:value => (i += 1)}= "#{h(order.name)} bis #{order.ends.strftime('%d. %b')}"
|
2009-01-06 11:49:19 +01:00
|
|
|
%table.list
|
|
|
|
%tr
|
|
|
|
%th= check_box_tag 'checkall', "1", false, { :onclick => "checkUncheckAll(this)" }
|
2009-02-10 20:06:08 +01:00
|
|
|
%th Name
|
|
|
|
%th Notiz
|
|
|
|
- if @order.stockit?
|
|
|
|
%th Verfügbar
|
|
|
|
- else
|
|
|
|
%th Herkunft
|
|
|
|
%th Hersteller
|
|
|
|
%th Gebinde
|
|
|
|
%th Preis (netto/FC)
|
2009-02-05 16:40:02 +01:00
|
|
|
- for category_name, articles in @order.articles_for_ordering
|
2009-01-06 11:49:19 +01:00
|
|
|
%tr{:style => "background-color:#EFEFEF"}
|
|
|
|
%td
|
|
|
|
%td{:colspan => "6", :style => "text-align:left"}
|
2009-02-04 16:41:01 +01:00
|
|
|
%b=h category_name
|
2009-01-06 11:49:19 +01:00
|
|
|
- for article in articles
|
|
|
|
/ check if the article is selected
|
|
|
|
- included = @order.order_articles.detect { |order_article| order_article.article_id == article.id }
|
2009-01-29 01:57:51 +01:00
|
|
|
- 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}')" }
|
2009-01-06 11:49:19 +01:00
|
|
|
%td=h article.name
|
2009-01-29 01:57:51 +01:00
|
|
|
%td=h truncate article.note, :length => 25
|
2009-02-10 20:06:08 +01:00
|
|
|
- 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}"
|
2009-01-29 01:57:51 +01:00
|
|
|
%td= "#{number_to_currency(article.price)} / #{number_to_currency(article.fc_price)}"
|
2009-01-06 11:49:19 +01:00
|
|
|
%tr
|
|
|
|
%td{:colspan => "6"}
|
|
|
|
= check_box_tag 'checkall', "1", false, { :onclick => "checkUncheckAll(this)" }
|
2009-03-01 18:45:34 +01:00
|
|
|
Alle auswählen
|
2009-01-06 11:49:19 +01:00
|
|
|
|
|
|
|
- if (@template_orders && !@template_orders.empty?)
|
2009-02-05 16:40:02 +01:00
|
|
|
= render :partial => 'template_orders_script'
|