2011-06-10 13:53:51 +02:00
|
|
|
= simple_form_for @order do |f|
|
2012-10-30 00:20:47 +01:00
|
|
|
= f.hidden_field :supplier_id
|
2014-02-20 12:37:51 +01:00
|
|
|
.fold-line
|
|
|
|
= f.input :starts, as: :date_picker_time
|
2015-09-23 22:38:20 +02:00
|
|
|
= f.input :boxfill, as: :date_picker_time if @order.is_boxfill_useful?
|
2014-02-20 12:37:51 +01:00
|
|
|
= f.input :ends, as: :date_picker_time
|
2016-04-29 15:28:05 +02:00
|
|
|
= f.input :pickup, as: :date_picker, input_html: {class: 'input-small'}
|
2017-10-12 00:20:30 +02:00
|
|
|
= f.input :end_action, collection: Order.end_actions,include_blank: false,
|
|
|
|
input_html: {class: 'input-xxlarge'}, value_method: ->(k){ k.first },
|
|
|
|
label_method: ->(k){ t("activerecord.attributes.order.end_actions.#{k.first}") }
|
2014-02-20 12:37:51 +01:00
|
|
|
= f.input :note, input_html: {rows: 2, class: 'input-xxlarge'}
|
2009-01-06 11:49:19 +01:00
|
|
|
|
2013-02-08 01:52:20 +01:00
|
|
|
%h2= t '.title'
|
2012-10-30 00:20:47 +01:00
|
|
|
- if @order.errors.has_key?(:articles)
|
|
|
|
.alert.alert-error
|
2020-09-04 12:57:19 +02:00
|
|
|
= @order.errors.messages[:articles].join(" ")
|
2012-10-30 00:20:47 +01:00
|
|
|
%table.table.table-hover#articleList
|
|
|
|
%tr
|
|
|
|
%th= check_box_tag 'checkall', "1", false, { 'data-check-all' => '#articleList' }
|
2013-11-23 12:05:29 +01:00
|
|
|
%th= heading_helper Article, :name
|
|
|
|
%th= heading_helper Article, :note
|
2012-10-30 00:20:47 +01:00
|
|
|
- if @order.stockit?
|
2013-02-08 01:52:20 +01:00
|
|
|
%th= t '.stockit'
|
2012-10-30 00:20:47 +01:00
|
|
|
- else
|
2013-11-23 12:05:29 +01:00
|
|
|
%th= heading_helper Article, :origin
|
|
|
|
%th= heading_helper Article, :manufacturer
|
2014-02-20 12:37:51 +01:00
|
|
|
%th= heading_helper Article, :units
|
2013-02-08 01:52:20 +01:00
|
|
|
%th= t '.prices'
|
2012-10-30 00:20:47 +01:00
|
|
|
- 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
|
2013-09-03 12:09:33 +02:00
|
|
|
/ check if the article is selected or has an error
|
|
|
|
- included = @order.article_ids.include?(article.id.to_s)
|
2013-09-03 17:37:49 +02:00
|
|
|
- row_class = ''
|
2013-09-03 12:09:33 +02:00
|
|
|
- if included
|
2013-09-03 17:37:49 +02:00
|
|
|
- row_class = 'selected'
|
|
|
|
- elsif @order.erroneous_article_ids.include?(article.id)
|
|
|
|
- row_class = 'error'
|
|
|
|
%tr{class: row_class, id: article.id}
|
2012-10-30 00:20:47 +01:00
|
|
|
%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
|
2014-02-20 12:37:51 +01:00
|
|
|
%td= truncate article.note, length: 25, tooltip: true
|
2011-06-10 13:53:51 +02:00
|
|
|
- if @order.stockit?
|
2012-10-30 00:20:47 +01:00
|
|
|
%td= "#{article.quantity_available} * #{article.unit}"
|
2011-06-10 13:53:51 +02:00
|
|
|
- else
|
2014-02-20 12:37:51 +01:00
|
|
|
%td= truncate article.origin, length: 15, tooltip: true
|
|
|
|
%td= truncate article.manufacturer, length: 15, tooltip: true
|
|
|
|
%td
|
|
|
|
= article.unit
|
|
|
|
- if article.unit_quantity > 1
|
|
|
|
%span{style: 'color: grey'} × #{article.unit_quantity}#{pkg_helper_icon}
|
2012-10-30 00:20:47 +01:00
|
|
|
%td= "#{number_to_currency(article.price)} / #{number_to_currency(article.fc_price)}"
|
|
|
|
%tr
|
|
|
|
%td
|
|
|
|
= check_box_tag 'checkall', "1", false, { 'data-check-all' => '#articleList' }
|
2014-05-06 11:40:57 +02:00
|
|
|
-# also when all are deselected, make sure this parameter is sent (controller removes empty values again)
|
|
|
|
= hidden_field_tag "order[article_ids][]", nil
|
2013-02-08 01:52:20 +01:00
|
|
|
%td{:colspan => "6"}= t '.select_all'
|
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
|
|
|
|
2012-10-30 00:20:47 +01:00
|
|
|
.form-actions
|
|
|
|
= f.submit class: 'btn'
|
2013-04-04 02:49:52 +02:00
|
|
|
= link_to t('ui.or_cancel'), orders_path
|
2013-09-04 10:52:14 +02:00
|
|
|
- unless @order.erroneous_article_ids.empty?
|
|
|
|
|
|
|
|
= check_box_tag 'order[ignore_warnings]'
|
|
|
|
= t '.ignore_warnings'
|