2014-01-23 16:17:16 +01:00
|
|
|
module GroupOrderArticlesHelper
|
|
|
|
# return an edit field for a GroupOrderArticle result
|
|
|
|
def group_order_article_edit_result(goa)
|
2020-03-23 12:53:21 +01:00
|
|
|
result = number_with_precision goa.result, strip_insignificant_zeros: true
|
2023-05-12 13:01:12 +02:00
|
|
|
if goa.group_order.order.finished? && current_user.role_finance?
|
2021-03-01 15:27:26 +01:00
|
|
|
simple_form_for goa, remote: true, html: { 'data-submit-onchange' => 'changed', class: 'delta-input' } do |f|
|
|
|
|
f.input_field :result, as: :delta, class: 'input-nano', data: { min: 0 }, id: "r_#{goa.id}", value: result
|
2014-01-23 16:17:16 +01:00
|
|
|
end
|
2023-05-12 13:01:12 +02:00
|
|
|
else
|
|
|
|
result
|
2014-01-23 16:17:16 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|