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

29 lines
1.8 KiB
Text
Raw Normal View History

2013-12-31 09:58:58 +01:00
-# NOTE: if you modify tiny details here you must also change them in `receive_on_order_article_update.js.erb`
= fields_for 'order_articles', order_article, index: order_article.id do |form|
%tr{id: "order_article_#{order_article.id}", class: "#{cycle('even', 'odd', name: 'articles')} order-article", valign: "top"}
- order_title = []
2013-11-25 15:24:20 +01:00
- order_title.append Article.human_attribute_name(:manufacturer)+': ' + order_article.article.manufacturer unless order_article.article.manufacturer.to_s.empty?
- order_title.append Article.human_attribute_name(:note)+': ' + order_article.article.note unless order_article.article.note.to_s.empty?
- units_expected = (order_article.units_billed or order_article.units_to_order)
%td= order_article.article.order_number
%td.name{title: order_title.join("\n")}= order_article.article.name
%td.unit= order_article.article.unit
%td #{order_article.quantity} + #{order_article.tolerance}
2013-12-19 00:45:14 +01:00
%td
= order_article.units_to_order
%i.package pkg
%span.article_unit_quantity (× #{order_article.article.unit_quantity})
%td.article_price= number_to_currency order_article.article.price
2013-12-19 00:45:14 +01:00
-#%td # TODO implement invoice screen
- unless order_article.units_billed.nil?
= order_article.units_billed
%i.package pkg
%td
= form.text_field :units_received, class: 'input-nano package', data: {'units-expected' => units_expected}
%span.article_price_unit_quantity (× #{order_article.article_price.unit_quantity})
/ TODO add almost invisible text_field for entering single units
%td.article_price_price= number_to_currency order_article.article_price.price
%td.units_delta
%td
= link_to t('ui.edit'), edit_finance_order_order_article_path(order_article.order, order_article), remote: true, class: 'btn btn-mini'