Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LocationReports linking to accessions incorrectly #949

Closed
sdm7g opened this issue Aug 28, 2017 · 0 comments
Closed

LocationReports linking to accessions incorrectly #949

sdm7g opened this issue Aug 28, 2017 · 0 comments

Comments

@sdm7g
Copy link
Contributor

sdm7g commented Aug 28, 2017

We're getting incorrect results out of Location Report from the locations accessions sub report.
I believe the join is over the wrong id.
Instead of :top_container_housed_at_rlshp__id => :location__id it should be :top_container_housed_at_rlshp__location_id => :location__id

Will submit a pull as soon as I have tested further.

--- a/reports/locations/location_accessions_subreport/location_accessions_subreport.rb
+++ b/reports/locations/location_accessions_subreport/location_accessions_subreport.rb
@@ -6,7 +6,7 @@ class LocationAccessionsSubreport < AbstractReport
 

   def query
     db[:location]
-      .inner_join(:top_container_housed_at_rlshp, :top_container_housed_at_rlshp__id => :location__id)
+      .inner_join(:top_container_housed_at_rlshp, :top_container_housed_at_rlshp__location_id => :location__id)
       .inner_join(:top_container, :top_container__id => :top_container_housed_at_rlshp__top_container_id)
       .inner_join(:top_container_link_rlshp, :top_container_link_rlshp__top_container_id => :top_container__id)
       .inner_join(:sub_container, :sub_container__id => :top_container_link_rlshp__sub_container_id)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants