OBPIH-6688 Check if adjusment was invoiced as canceled#4854
Conversation
|
|
||
| // check if by any chance it was invoiced as cancelled | ||
| if (totalAdjustments == 0) { | ||
| return order.placed && !hasRegularInvoice |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
|
@drodzewicz there are some minor conflicts in OrderAdjustments domain. Could you take a look at them? |
e5cf8b9 to
fd65625
Compare
✨ Description of Change
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)