OBPIH-6671 Fix amount outstanding on orders report calculation#4832
Merged
awalkowiak merged 1 commit intorelease/0.9.2-hotfix1from Sep 10, 2024
Merged
OBPIH-6671 Fix amount outstanding on orders report calculation#4832awalkowiak merged 1 commit intorelease/0.9.2-hotfix1from
awalkowiak merged 1 commit intorelease/0.9.2-hotfix1from
Conversation
ewaterman
reviewed
Sep 9, 2024
| AND (invoice_item.inverse IS NULL OR invoice_item.inverse = FALSE) | ||
| ${additionalFilter} | ||
| GROUP BY o.id, order_item.id, shipment_item.id, invoice_item.id | ||
| GROUP BY o.id, order_item.id, shipment_item.id |
Member
There was a problem hiding this comment.
why were we grouping by invoice item before? It seems like doing that would only ever result in one line per grouping and so make the SUM in line 902 pointless. What you've done here looks correct. I suppose the only reason it was working before was that an order item only ever had one invoice item so it just happened to work?
Collaborator
Author
There was a problem hiding this comment.
Yeah I am not sure. IMHO it should not have been done since the beginning, and I am not sure why it was done. I think the regular invoices (not prepaid) were broken because of this before, but this bug was hard to spot.
ewaterman
approved these changes
Sep 9, 2024
kchelstowski
approved these changes
Sep 10, 2024
alannadolny
approved these changes
Sep 10, 2024
jwalbers
pushed a commit
to jwalbers/openboxes
that referenced
this pull request
Oct 29, 2024
jwalbers
pushed a commit
to jwalbers/openboxes
that referenced
this pull request
Oct 31, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✨ Description of Change
Link to GitHub issue or Jira ticket:
https://pihemr.atlassian.net/browse/OBPIH-6671
Description:
There was an issue with calculating the report when there were multiple (partial) invoice items per shipment item (the quantity shipped was unnecessarily duplicated). Fixed it by grouping rows by shipment item and summing the quantity invoiced.