From abe4c5e0da223916104f49cb6e15cc9b963107ba Mon Sep 17 00:00:00 2001 From: Abdul Aziz Ali Date: Fri, 28 Mar 2025 18:21:23 +0800 Subject: [PATCH] Filter fees by metadata.enterprise_role 'supplier' #11529 --- .../enterprise_fees_with_tax_report_by_producer.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_producer.rb b/lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_producer.rb index da4aaf8683..2145e040d7 100644 --- a/lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_producer.rb +++ b/lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_producer.rb @@ -85,6 +85,8 @@ module Reporting query = order .all_adjustments .enterprise_fee + .joins(:metadata) + .where(adjustment_metadata: { enterprise_role: 'supplier' }) if enterprise_fee_filters? query = query.where(originator_id: enterprise_fee_filtered_ids)