Conversation
ewaterman
commented
Sep 22, 2025
|
|
||
| Date previousTransactionDate = null | ||
| transactions.each { Transaction it -> | ||
| for (Transaction it in transactions) { |
Member
Author
There was a problem hiding this comment.
Debugging was really difficult when this was in an "each" closure because intellij debug fields get all messed up. More importantly, stack traces get really garbled inside closures so I generally prefer to use regular loops unless it's a really simple operation
awalkowiak
approved these changes
Sep 26, 2025
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.
…ailability
✨ Description of Change
Link to GitHub issue or Jira ticket: https://pihemr.atlassian.net/browse/OBPIH-7512
Description:
When calculating QoH, we construct a map of available items that is keyed on a string value that is constructed from product code, bin location name, and lot number:
https://github.com/openboxes/openboxes/blob/release/0.9.5-hotfix2/grails-app/services/org/pih/warehouse/inventory/ProductAvailabilityService.groovy
This is problematic however because it results in both the null lot and a lot with string "null" resolving to the same key:
I changed this logic to use an actual object as the key:
AvailableItemKey. AvailableItemKey still uses bin location name and lot, but it keeps them as separate String fields, which should resolve the issue of null vs 'null'. Using a proper key class also means we don't need to pass around magic strings and unlabelled keys. I also introduced theAvailableItemMapas a convenience wrapper on the map so that it'd be easier to work with.