OBPIH-7542 Fix do not subtract expired stock filter causing 500 error#5605
OBPIH-7542 Fix do not subtract expired stock filter causing 500 error#5605kchelstowski merged 1 commit intodevelopfrom
Conversation
| boolean removeExpiredStock = expirationFilter == ExpirationFilter.SUBTRACT_EXPIRED_STOCK | ||
| Date today = new Date() | ||
| Date maxDate = removeExpiredStock ? today : today + expirationFilter.days | ||
| Date maxDate = removeExpiredStock ? today : today + (expirationFilter.days ?: 0) |
There was a problem hiding this comment.
@ewaterman I take it back, as you caught it in the previous PR. I forgot I moved this part of the code outside the .sum closures, and I tested it probably when having it yet inside, hence it was breaking for DO_NOT_SUBTRACT_EXPIRED_STOCK.
There was a problem hiding this comment.
👍 I'll approve this as is, but an alternative solution would be to set a days value of 0 in the ExpirationFilter for INCLUDE_EXPIRED_STOCK and REMOVE_EXPIRED_STOCK. I haven't thought through the implications of doing that, so I leave it to you to decide which approach you prefer.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5605 +/- ##
============================================
- Coverage 9.12% 8.49% -0.64%
+ Complexity 1170 1116 -54
============================================
Files 701 712 +11
Lines 45281 45598 +317
Branches 10851 10913 +62
============================================
- Hits 4131 3872 -259
- Misses 40497 41152 +655
+ Partials 653 574 -79 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
✨ Description of Change
Link to GitHub issue or Jira ticket:
Description:
📷 Screenshots & Recordings (optional)