OBPIH-6693 order adjustment invoice status on order view page improvements#4856
Conversation
|
|
||
| import org.pih.warehouse.core.StatusType | ||
|
|
||
| enum InvoiceAdjustmentStatus { |
There was a problem hiding this comment.
I am not sure if InvoiceAdjustmentStatus naming is a safe bet here. I think it would be better as a OrderAdjustmentPaymentStatus or OrderAdjustmentInvoiceStatus to match what it is displaying. InvoiceAdjustment might be something completely different
| enum InvoiceAdjustmentStatus { | ||
|
|
||
| NOT_INVOICED(10, StatusType.WARNING), | ||
| INVOICED(10, StatusType.SUCCESS), |
There was a problem hiding this comment.
It's nitpicky, but I would swap the ordering here (not invoiced -> partially invoiced -> invoiced)
There was a problem hiding this comment.
what about sortOrder value, I put 10 on each but wasn't sure about it, do you have an idea?
There was a problem hiding this comment.
I added 0, 10 and 20 for the sortOrder I hope it is right
| return !postedPurchaseInvoiceItems.empty | ||
| } | ||
|
|
||
| InvoiceAdjustmentStatus getDerivedStatus() { |
There was a problem hiding this comment.
One more thing I missed - I would call it getDerivedPaymentStatus
| OrderAdjustmentInvoiceStatus getDerivedPaymentStatus() { | ||
| Boolean fullyInvoiced = invoicedUnitPrice == totalAdjustments | ||
|
|
||
| if (isInvoiced) { | ||
| if (canceled || totalAdjustments == 0) { | ||
| return OrderAdjustmentInvoiceStatus.INVOICED | ||
| } | ||
| if (fullyInvoiced) { | ||
| return OrderAdjustmentInvoiceStatus.INVOICED | ||
| } | ||
| return OrderAdjustmentInvoiceStatus.PARTIALLY_INVOICED | ||
| } else { | ||
| return OrderAdjustmentInvoiceStatus.NOT_INVOICED | ||
| } | ||
| } |
There was a problem hiding this comment.
Wouldn't it be cleaner to check:
if (!isInvoiced) {
return OrderAdjustmentInvoiceStatus.NOT_INVOICED
}
at the beginning, and then the the rest of your conditions?
✨ Description of Change
Link to GitHub issue or Jira ticket: OBPIH-6693
Description:
Implemented additional logic that returns a possible partially invoiced status for order adjustment
📷 Screenshots & Recordings (optional)