Skip to content

OBPIH-6693 order adjustment invoice status on order view page improvements#4856

Merged
awalkowiak merged 4 commits intorelease/0.9.2-hotfix1from
feature/OBPIH-6693-order-adjustment-invoice-status-on-order-view-page-improvements
Sep 25, 2024
Merged

OBPIH-6693 order adjustment invoice status on order view page improvements#4856
awalkowiak merged 4 commits intorelease/0.9.2-hotfix1from
feature/OBPIH-6693-order-adjustment-invoice-status-on-order-view-page-improvements

Conversation

@drodzewicz
Copy link
Collaborator

@drodzewicz drodzewicz commented Sep 23, 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-6693

Description:
Implemented additional logic that returns a possible partially invoiced status for order adjustment


📷 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 23, 2024
@drodzewicz drodzewicz changed the title Feature/obpih 6693 order adjustment invoice status on order view page improvements OBPIH-6693 order adjustment invoice status on order view page improvements Sep 23, 2024
@github-actions github-actions bot added type: feature A new piece of functionality for the app domain: frontend Changes or discussions relating to the frontend UI domain: backend Changes or discussions relating to the backend server domain: l10n Changes or discussions relating to localization & Internationalization labels Sep 23, 2024

import org.pih.warehouse.core.StatusType

enum InvoiceAdjustmentStatus {
Copy link
Collaborator

Choose a reason for hiding this comment

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

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),
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's nitpicky, but I would swap the ordering here (not invoiced -> partially invoiced -> invoiced)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

what about sortOrder value, I put 10 on each but wasn't sure about it, do you have an idea?

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 added 0, 10 and 20 for the sortOrder I hope it is right

return !postedPurchaseInvoiceItems.empty
}

InvoiceAdjustmentStatus getDerivedStatus() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

One more thing I missed - I would call it getDerivedPaymentStatus

Comment on lines 107 to 121
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
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't it be cleaner to check:

if (!isInvoiced) {
return OrderAdjustmentInvoiceStatus.NOT_INVOICED
}

at the beginning, and then the the rest of your conditions?

@awalkowiak awalkowiak merged commit f9657b8 into release/0.9.2-hotfix1 Sep 25, 2024
@awalkowiak awalkowiak deleted the feature/OBPIH-6693-order-adjustment-invoice-status-on-order-view-page-improvements branch September 25, 2024 09:44
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 domain: frontend Changes or discussions relating to the frontend UI domain: l10n Changes or discussions relating to localization & Internationalization type: feature A new piece of functionality for the app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants