Readonly receive input if GroupOrderArticle result has manually been changed

Conflicts:
	app/helpers/orders_helper.rb
	app/views/orders/_edit_amount.html.haml
This commit is contained in:
wvengen 2014-01-03 10:33:09 +01:00
parent 7aae7f4d55
commit 98f59a3de3
7 changed files with 43 additions and 9 deletions

View file

@ -34,4 +34,14 @@ module OrdersHelper
"<span class='package'> &times; #{article.unit_quantity}</span>".html_safe
end
end
def receive_input_field(form)
order_article = form.object
units_expected = (order_article.units_billed or order_article.units_to_order)
form.text_field :units_received, class: 'input-nano package units_received',
data: {'units-expected' => units_expected},
readonly: order_article.result_manually_changed? ? "readonly" : nil,
title: order_article.result_manually_changed? ? t('.locked_to_protect_manual_update') : nil,
autocomplete: 'off'
end
end