Update enterprise fee report tax_category fetching

This commit is contained in:
Matt-Yorkley
2023-07-04 10:00:20 +01:00
committed by Maikel Linke
parent 07774c4572
commit e2094665c5
2 changed files with 5 additions and 4 deletions

View File

@@ -236,7 +236,7 @@ module Reporting
LEFT OUTER JOIN spree_tax_categories AS product_tax_categories
ON (
enterprise_fees.inherits_tax_category IS TRUE
AND product_tax_categories.id = spree_products.tax_category_id
AND product_tax_categories.id = spree_variants.tax_category_id
)
JOIN_STRING
)

View File

@@ -31,9 +31,9 @@ describe Reporting::Reports::EnterpriseFeeSummary::FeeSummary do
# Set up other requirements for ordering.
let!(:order_cycle) { create(:simple_order_cycle, coordinator: coordinator) }
let!(:product) { create(:product, tax_category: product_tax_category) }
let!(:product) { create(:product) }
let!(:product_tax_category) { create(:tax_category, name: "Sample Product Tax") }
let!(:variant) { prepare_variant }
let!(:variant) { prepare_variant(tax_category: product_tax_category) }
# Create customers.
let!(:customer) { create(:customer, first_name: "Sample", last_name: "Customer") }
@@ -54,7 +54,8 @@ describe Reporting::Reports::EnterpriseFeeSummary::FeeSummary do
end
let!(:variant) do
prepare_variant(incoming_exchange_fees: variant_incoming_exchange_fees,
prepare_variant(tax_category: product_tax_category,
incoming_exchange_fees: variant_incoming_exchange_fees,
outgoing_exchange_fees: variant_outgoing_exchange_fees)
end