diff --git a/app/documents/order_by_articles.rb b/app/documents/order_by_articles.rb index 1dab03cc..07a15fe3 100644 --- a/app/documents/order_by_articles.rb +++ b/app/documents/order_by_articles.rb @@ -17,7 +17,7 @@ class OrderByArticles < OrderPdf rows = [] dimrows = [] for goa in order_article.group_order_articles.ordered - rows << [goa.group_order.ordergroup.name, + rows << [goa.group_order.ordergroup_name, "#{goa.quantity} + #{goa.tolerance}", goa.result, number_to_currency(goa.total_price(order_article))] diff --git a/app/documents/order_matrix.rb b/app/documents/order_matrix.rb index f721d04a..bd9e35cc 100644 --- a/app/documents/order_matrix.rb +++ b/app/documents/order_matrix.rb @@ -2,7 +2,7 @@ class OrderMatrix < OrderPdf MAX_ARTICLES_PER_PAGE = 16 # How many order_articles shoud written on a page - + def filename I18n.t('documents.order_matrix.filename', :name => @order.name, :date => @order.ends.to_date) + '.pdf' end @@ -62,7 +62,7 @@ class OrderMatrix < OrderPdf @order.group_orders.includes(:ordergroup).each do |group_order| - group_result = [group_order.ordergroup.name.truncate(20)] + group_result = [group_order.ordergroup_name.truncate(20)] for order_article in current_order_articles # get the Ordergroup result for this order_article diff --git a/app/helpers/orders_helper.rb b/app/helpers/orders_helper.rb index 22dc1f7d..3c37e8fe 100644 --- a/app/helpers/orders_helper.rb +++ b/app/helpers/orders_helper.rb @@ -111,7 +111,7 @@ module OrdersHelper if group_orders.count == 0 return txt else - desc = group_orders.includes(:ordergroup).map {|g| g.ordergroup.name}.join(', ') + desc = group_orders.includes(:ordergroup).map {|g| g.ordergroup_name}.join(', ') content_tag(:abbr, txt, title: desc).html_safe end end diff --git a/app/views/finance/balancing/_group_order_articles.html.haml b/app/views/finance/balancing/_group_order_articles.html.haml index a0fb3134..5ab4a4d5 100644 --- a/app/views/finance/balancing/_group_order_articles.html.haml +++ b/app/views/finance/balancing/_group_order_articles.html.haml @@ -17,7 +17,7 @@ %tr[group_order_article] %td %td{:style=>"width:50%"} - = group_order_article.group_order.ordergroup.name + = group_order_article.group_order.ordergroup_name %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) %td.actions{:style=>"width:1em"} diff --git a/app/views/finance/balancing/confirm.html.haml b/app/views/finance/balancing/confirm.html.haml index ac37a8e1..58f5ae1f 100644 --- a/app/views/finance/balancing/confirm.html.haml +++ b/app/views/finance/balancing/confirm.html.haml @@ -3,7 +3,7 @@ %table.table.table-striped{:style => "width:35em"} - for group_order in @order.group_orders %tr{:class => cycle('even', 'odd')} - %td= group_order.ordergroup.name + %td= group_order.ordergroup_name %td.numeric= number_to_currency(group_order.price) .form-actions = link_to t('.clear'), close_finance_order_path(@order), method: :patch, class: 'btn btn-primary' diff --git a/app/views/shared/articles_by/_group_single.html.haml b/app/views/shared/articles_by/_group_single.html.haml index 9422288d..23feb625 100644 --- a/app/views/shared/articles_by/_group_single.html.haml +++ b/app/views/shared/articles_by/_group_single.html.haml @@ -2,7 +2,7 @@ - if not defined?(heading) or heading %tr.list-heading %th{colspan: 9} - %h4.name= group_order.ordergroup.name + %h4.name= group_order.ordergroup_name - total = 0 - for goa in group_order.group_order_articles.ordered.includes(:order_article) - total += goa.total_price diff --git a/spec/integration/balancing_spec.rb b/spec/integration/balancing_spec.rb index c65e1491..f728ddc7 100644 --- a/spec/integration/balancing_spec.rb +++ b/spec/integration/balancing_spec.rb @@ -40,8 +40,8 @@ feature 'settling an order', js: true do expect(page).to have_selector("#group_order_articles_#{oa.id}") within("#group_order_articles_#{oa.id}") do # make sure these ordergroup names are in the list for this product - expect(page).to have_content(go1.ordergroup.name) - expect(page).to have_content(go2.ordergroup.name) + expect(page).to have_content(go1.ordergroup_name) + expect(page).to have_content(go2.ordergroup_name) # and that their order results match what we expect expect(page).to have_selector("#r_#{goa1.id}") expect(find("#r_#{goa1.id}").value.to_f).to eq(3)