54 lines
2.1 KiB
Text
54 lines
2.1 KiB
Text
= simple_form_for @order do |f|
|
|
= f.hidden_field :supplier_id
|
|
= f.input :note, input_html: {rows: 8}
|
|
= f.input :starts, input_html: {class: 'input-small'}
|
|
= f.input :ends, input_html: {class: 'input-small'}
|
|
|
|
%h2= t '.title'
|
|
- if @order.errors.has_key?(:articles)
|
|
.alert.alert-error
|
|
= @order.errors.get(:articles).join(" ")
|
|
%table.table.table-hover#articleList
|
|
%tr
|
|
%th= check_box_tag 'checkall', "1", false, { 'data-check-all' => '#articleList' }
|
|
%th= t '.name'
|
|
%th= t '.note'
|
|
- if @order.stockit?
|
|
%th= t '.stockit'
|
|
- else
|
|
%th= t '.origin'
|
|
%th= t '.supplier'
|
|
%th= t '.unit_quantity'
|
|
%th= t '.prices'
|
|
- for category_name, articles in @order.articles_for_ordering
|
|
%tr.article-category
|
|
%td
|
|
%td{:colspan => "6", :style => "text-align:left"}
|
|
= category_name
|
|
%i.icon-tag
|
|
- for article in articles
|
|
/ check if the article is selected
|
|
- included = @order.article_ids.include?(article.id)
|
|
- included_class = included ? ' selected' : ''
|
|
%tr{:class => included_class, :id => article.id.to_s }
|
|
%td= check_box_tag "order[article_ids][]", article.id, included, :id => "checkbox_#{article.id}"
|
|
%td.click-me{'data-check-this' => "#checkbox_#{article.id}"}= 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
|
|
= check_box_tag 'checkall', "1", false, { 'data-check-all' => '#articleList' }
|
|
%td{:colspan => "6"}= t '.select_all'
|
|
|
|
- if (@template_orders && !@template_orders.empty?)
|
|
= render :partial => 'template_orders_script'
|
|
|
|
.form-actions
|
|
= f.submit class: 'btn'
|
|
= link_to t('.cancel'), orders_path
|