From 26ae28f51a2d834f9765c468f7ce67a699fe6323 Mon Sep 17 00:00:00 2001 From: Florian Lentsch Date: Mon, 20 May 2024 16:27:04 +0200 Subject: [PATCH] Fixes #68 --- app/helpers/orders_helper.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/helpers/orders_helper.rb b/app/helpers/orders_helper.rb index 3900054a..c4c41214 100644 --- a/app/helpers/orders_helper.rb +++ b/app/helpers/orders_helper.rb @@ -33,11 +33,10 @@ def units_history_line(order_article, options = {}) %i[units_to_order units_billed units_received].map do |unit| next unless n = order_article.send(unit) - converted_quantity = price.convert_quantity(n, price.supplier_order_unit, - price.billing_unit.presence || price.supplier_order_unit) + converted_quantity = price.convert_quantity(n, price.supplier_order_unit, options[:unit].presence || price.supplier_order_unit) line = converted_quantity.round(3).to_s + ' ' line += pkg_helper(price, options) + ' ' unless n == 0 - line += OrderArticle.human_attribute_name("#{unit}_short", count: n) + line += OrderArticle.human_attribute_name("#{unit}_short", count: converted_quantity) units_info << line end units_info.join(', ').html_safe