diff --git a/lib/reporting/report_row_builder.rb b/lib/reporting/report_row_builder.rb index 96683138e1..4ece1ec5db 100644 --- a/lib/reporting/report_row_builder.rb +++ b/lib/reporting/report_row_builder.rb @@ -75,7 +75,7 @@ module Reporting return "" if value.nil? # Currency - if report.columns_format[column] == :currency || column.to_s.include?("price") + if report.columns_format[column] == :currency format_currency(value) # Quantity elsif report.columns_format[column] == :quantity && report.html_render? diff --git a/spec/system/admin/reports_spec.rb b/spec/system/admin/reports_spec.rb index 0c2676f64c..aa9400fa35 100644 --- a/spec/system/admin/reports_spec.rb +++ b/spec/system/admin/reports_spec.rb @@ -310,17 +310,17 @@ describe ' expect(page).to have_table_row [product1.supplier.name, product1.supplier.address.city, "Product Name", product1.properties.map(&:presentation).join(", "), - product1.primary_taxon.name, "Test", "$100.00", + product1.primary_taxon.name, "Test", "100.0", product1.group_buy_unit_size.to_s, "", "sku1"] expect(page).to have_table_row [product1.supplier.name, product1.supplier.address.city, "Product Name", product1.properties.map(&:presentation).join(", "), - product1.primary_taxon.name, "Something", "$80.00", + product1.primary_taxon.name, "Something", "80.0", product1.group_buy_unit_size.to_s, "", "sku2"] expect(page).to have_table_row [product2.supplier.name, product1.supplier.address.city, "Product 2", product1.properties.map(&:presentation).join(", "), - product2.primary_taxon.name, "100g", "$99.00", + product2.primary_taxon.name, "100g", "99.0", product1.group_buy_unit_size.to_s, "", "product_sku"] end @@ -332,7 +332,7 @@ describe ' expect(page).to have_table_row ['PRODUCT', 'Description', 'Qty', 'Pack Size', 'Unit', 'Unit Price', 'Total', 'GST incl.', 'Grower and growing method', 'Taxon'].map(&:upcase) - expect(page).to have_table_row ['Product 2', '100g', '', '100', 'g', '$99.00', '', '0', + expect(page).to have_table_row ['Product 2', '100g', '', '100', 'g', '99.0', '', '0', 'Supplier Name (Organic - NASAA 12345)', 'Taxon Name'] end end