2009-01-29 21:28:22 +01:00
|
|
|
%td{:colspan => "7"}
|
2012-11-10 16:44:05 +01:00
|
|
|
%table.table.table-striped
|
2009-01-29 21:28:22 +01:00
|
|
|
%thead
|
|
|
|
%tr
|
|
|
|
%td
|
2013-12-12 00:13:19 +01:00
|
|
|
%td{:style => "width:8em"}= Ordergroup.model_name.human
|
2014-01-23 16:17:16 +01:00
|
|
|
-#%td.center= t('.units')
|
|
|
|
%td.center
|
|
|
|
%acronym{:title => t('shared.articles.received_desc')}= t 'shared.articles.received'
|
2013-02-10 09:05:20 +01:00
|
|
|
%td= t('.total')
|
2009-01-29 21:28:22 +01:00
|
|
|
%td{:colspan => "3",:style => "width:14em"}
|
2019-03-26 20:14:39 +01:00
|
|
|
- unless order_article.order.closed?
|
|
|
|
= link_to t('.add_group'), new_group_order_article_path(order_article_id: order_article.id),
|
2020-03-23 12:53:21 +01:00
|
|
|
remote: true, class: 'btn btn-mini'
|
2009-01-29 21:28:22 +01:00
|
|
|
%tbody
|
2014-01-23 16:17:16 +01:00
|
|
|
- totals = {result: 0}
|
2013-03-12 12:34:05 +01:00
|
|
|
- for group_order_article in order_article.group_order_articles.select { |goa| goa.result > 0 }
|
2012-11-10 16:44:05 +01:00
|
|
|
%tr[group_order_article]
|
2009-01-29 21:28:22 +01:00
|
|
|
%td
|
|
|
|
%td{:style=>"width:50%"}
|
2016-02-25 02:08:04 +01:00
|
|
|
= group_order_article.group_order.ordergroup_name
|
2014-01-23 16:17:16 +01:00
|
|
|
%td.center= group_order_article_edit_result(group_order_article)
|
|
|
|
%td.numeric= number_to_currency(group_order_article.order_article.price.fc_price * group_order_article.result)
|
2009-01-29 21:28:22 +01:00
|
|
|
%td.actions{:style=>"width:1em"}
|
2019-03-26 20:14:39 +01:00
|
|
|
- unless order_article.order.closed?
|
2020-03-23 12:53:21 +01:00
|
|
|
= link_to t('ui.delete'), group_order_article_path(group_order_article),
|
2019-03-26 20:14:39 +01:00
|
|
|
method: :delete, remote: true, class: 'btn btn-mini btn-danger'
|
2009-01-29 21:28:22 +01:00
|
|
|
%td
|
2014-01-23 16:17:16 +01:00
|
|
|
- totals[:result] += group_order_article.result
|
2009-01-29 21:28:22 +01:00
|
|
|
%tfoot
|
2012-11-10 16:44:05 +01:00
|
|
|
%tr
|
2009-01-29 21:28:22 +01:00
|
|
|
%td
|
2013-06-21 13:49:34 +02:00
|
|
|
%td{:style => "width:8em"}= t('.total_fc')
|
2020-03-23 12:53:21 +01:00
|
|
|
%td.center= number_with_precision totals[:result], strip_insignificant_zeros: true
|
2014-01-23 16:17:16 +01:00
|
|
|
%td.numeric= number_to_currency(order_article.group_orders_sum[:price])
|
2013-06-21 13:49:34 +02:00
|
|
|
%td{:colspan => "3"}
|