diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/scope.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/scope.rb index cf343063a9..b3f3168518 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/scope.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/scope.rb @@ -282,7 +282,7 @@ module OrderManagement join_scope( <<-JOIN_STRING.strip_heredoc LEFT OUTER JOIN enterprises AS outgoing_exchange_enterprises - ON (outgoing_exchange_enterprises.id = outgoing_exchanges.sender_id) + ON (outgoing_exchange_enterprises.id = outgoing_exchanges.receiver_id) JOIN_STRING ) end diff --git a/engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb b/engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb index ccf03553f1..83a3f77576 100644 --- a/engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb +++ b/engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb @@ -116,9 +116,9 @@ describe OrderManagement::Reports::EnterpriseFeeSummary::ReportService do ["Admin", "Sample Coordinator", "Coordinator Fee 1", "Sample Customer", "Coordinator", "All", "Sample Coordinator Tax", "1024.00"], ["Admin", "Sample Distributor", "Distributor Fee 1", "Another Customer", - "Outgoing", "Sample Coordinator", "Sample Distributor Tax", "4.00"], + "Outgoing", "Sample Distributor", "Sample Distributor Tax", "4.00"], ["Admin", "Sample Distributor", "Distributor Fee 1", "Sample Customer", - "Outgoing", "Sample Coordinator", "Sample Distributor Tax", "8.00"], + "Outgoing", "Sample Distributor", "Sample Distributor Tax", "8.00"], ["Payment Transaction", "Sample Distributor", "Sample Payment Method", "Another Customer", nil, nil, nil, "2.00"], ["Payment Transaction", "Sample Distributor", "Sample Payment Method", "Sample Customer", @@ -128,9 +128,9 @@ describe OrderManagement::Reports::EnterpriseFeeSummary::ReportService do ["Sales", "Sample Coordinator", "Coordinator Fee 2", "Sample Customer", "Coordinator", "All", "Sample Product Tax", "2048.00"], ["Sales", "Sample Distributor", "Distributor Fee 2", "Another Customer", - "Outgoing", "Sample Coordinator", "Sample Product Tax", "8.00"], + "Outgoing", "Sample Distributor", "Sample Product Tax", "8.00"], ["Sales", "Sample Distributor", "Distributor Fee 2", "Sample Customer", - "Outgoing", "Sample Coordinator", "Sample Product Tax", "16.00"], + "Outgoing", "Sample Distributor", "Sample Product Tax", "16.00"], ["Sales", "Sample Producer", "Producer Fee 1", "Another Customer", "Incoming", "Sample Producer", "Sample Producer Tax", "64.00"], ["Sales", "Sample Producer", "Producer Fee 1", "Sample Customer", @@ -190,13 +190,13 @@ describe OrderManagement::Reports::EnterpriseFeeSummary::ReportService do ["Admin", "Sample Coordinator", "Sample Coordinator Fee", "Sample Customer", "Incoming", "Sample Producer", "Sample Coordinator Tax", "512.00"], ["Admin", "Sample Coordinator", "Sample Coordinator Fee", "Sample Customer", - "Outgoing", "Sample Coordinator", "Sample Coordinator Tax", "512.00"], + "Outgoing", "Sample Distributor", "Sample Coordinator Tax", "512.00"], ["Admin", "Sample Distributor", "Sample Distributor Fee", "Sample Customer", "Incoming", "Sample Producer", "Sample Distributor Tax", "4.00"], ["Payment Transaction", "Sample Distributor", "Sample Payment Method", "Sample Customer", nil, nil, nil, "2.00"], ["Sales", "Sample Producer", "Sample Producer Fee", "Sample Customer", - "Outgoing", "Sample Coordinator", "Sample Producer Tax", "64.00"], + "Outgoing", "Sample Distributor", "Sample Producer Tax", "64.00"], ["Shipment", "Sample Distributor", "Sample Shipping Method", "Sample Customer", nil, nil, "Platform Rate", "1.00"] ]