OBPIH-6499 Do not create inverse items for order item and adjustment …#4795
Merged
awalkowiak merged 1 commit intofeature/OBPIH-6398-partial-invoices-for-prepaid-pofrom Aug 21, 2024
Merged
Conversation
…if there is no prepayment
ewaterman
reviewed
Aug 20, 2024
| OrderItem orderItem = shipmentItem.orderItems?.find { it } | ||
| BigDecimal prepaymentPercent = (orderItem.order.paymentTerm?.prepaymentPercent ?: Constants.DEFAULT_PAYMENT_PERCENT) / 100 | ||
| InvoiceItem prepaymentItem = orderItem.invoiceItems.find { it.isPrepaymentInvoice } | ||
| if (!prepaymentItem) { |
Member
There was a problem hiding this comment.
is it even possible to get to this point and there not be a prepaymentItem? Anyways, even if it's impossible, there's nothing wrong with having this additional check.
Collaborator
Author
There was a problem hiding this comment.
Yes, the case is when you cancel item or adjustment before generating prepayment invoice and the uncanel them. This item is then available to invoice on final invoice but it was not prepaid so we can try to create an inverse
ewaterman
approved these changes
Aug 20, 2024
28345aa
into
feature/OBPIH-6398-partial-invoices-for-prepaid-po
awalkowiak
added a commit
that referenced
this pull request
Sep 6, 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.
…if there is no prepayment
✨ Description of Change
Link to GitHub issue or Jira ticket:
https://pihemr.atlassian.net/browse/OBPIH-6499
Description:
Improvement in generating inverse items (I already skipped generating inverse items for shipment items if there is not prepayment, but I forgot about order items and adjustment)
📈 Test Plan
Description of test plan (if applicable):
✅ Quality Checks
[OBS-123]for Jira,[#0000]for GitHub, or[OBS-123, OBPIH-123]if there are multiple), or with[N/A]if not applicable