Skip to content

OBPIH-6688 Check if adjusment was invoiced as canceled#4854

Merged
awalkowiak merged 2 commits intorelease/0.9.2-hotfix1from
OBPIH-6688-fix-issue-with-adjustment-amount-zero
Sep 25, 2024
Merged

OBPIH-6688 Check if adjusment was invoiced as canceled#4854
awalkowiak merged 2 commits intorelease/0.9.2-hotfix1from
OBPIH-6688-fix-issue-with-adjustment-amount-zero

Conversation

@drodzewicz
Copy link
Collaborator

@drodzewicz drodzewicz commented Sep 20, 2024

✨ Description of Change

A concise summary of what is being changed. Please provide enough context for reviewers to be able to understand the change and why it is necessary. If the issue/ticket already provides enough information, you can put "See ticket" as the description.

Link to GitHub issue or Jira ticket: OBPIH-6688

Description:
In the previous PR for this ticket #4843 I have removed the condition checking if the adjustment is invoiceable if it was canceled with 0 amount, I assumed it is going to be covered by the newly implemented logic.
After QA it appears that this case was not handled too well and we need to check for it in the method.


📷 Screenshots & Recordings (optional)

If this PR contains a UI change, consider adding one or more screenshots here or link to a screen recording to help reviewers visualize the change. Otherwise, you can remove this section.

@drodzewicz drodzewicz self-assigned this Sep 20, 2024
@github-actions github-actions bot added the domain: backend Changes or discussions relating to the backend server label Sep 20, 2024

// check if by any chance it was invoiced as cancelled
if (totalAdjustments == 0) {
return order.placed && !hasRegularInvoice
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a case where we do have a regular invoice but it doesn't invoice for the zero adjustment? Wouldn't in that case the adjustment still be invoiceable?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there is such a case.
I was not aware of the case for invoicing adjustments with amount 0 and this check should handle it.

So in my understanding, if an adjustment already has a regular incoice it was probably already invoiced in some way and since totalAdjusmten amount specified is zero we can assume it was invoiced as 0

return hasPrepaymentInvoice && !hasRegularInvoice && order.placed && !invoicedFullAmount
}

// check if by any chance it was invoiced as cancelled
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the if check below makes sense, but I am not sure if the comment here makes sense. If it was invoiced as canceled then it will have a regular invoice. Plus looking at Katarzyna's comment in the ticket, there was a case about the total adjustments being 0, this does not mean it was canceled. Am I missing something here?

@awalkowiak
Copy link
Collaborator

@drodzewicz there are some minor conflicts in OrderAdjustments domain. Could you take a look at them?

@drodzewicz drodzewicz force-pushed the OBPIH-6688-fix-issue-with-adjustment-amount-zero branch from e5cf8b9 to fd65625 Compare September 23, 2024 11:52
@awalkowiak awalkowiak merged commit 4594e6c into release/0.9.2-hotfix1 Sep 25, 2024
@awalkowiak awalkowiak deleted the OBPIH-6688-fix-issue-with-adjustment-amount-zero branch September 25, 2024 09:43
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: backend Changes or discussions relating to the backend server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants