Skip to content

OBPIH-6688 modify method checking if order adjustment is invoiceable#4843

Merged
awalkowiak merged 6 commits intorelease/0.9.2-hotfix1from
bugfix/OBPIH-6688-modify-method-checking-if-order-adjustment-is-invoiceable
Sep 17, 2024
Merged

OBPIH-6688 modify method checking if order adjustment is invoiceable#4843
awalkowiak merged 6 commits intorelease/0.9.2-hotfix1from
bugfix/OBPIH-6688-modify-method-checking-if-order-adjustment-is-invoiceable

Conversation

@drodzewicz
Copy link
Collaborator

@drodzewicz drodzewicz commented Sep 16, 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:
The is invoiced transient value should handle case where we are trying to check if adjusment is invoiceable when there is only partially invoiced amount.


📷 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 16, 2024
@github-actions github-actions bot added type: bug Addresses unintended behaviours of the app domain: backend Changes or discussions relating to the backend server labels Sep 16, 2024
@drodzewicz drodzewicz added the warn: do not merge Marks a pull request that is not yet ready to be merged label Sep 16, 2024
return !postedPurchaseInvoiceItems.empty
}

HashSet<InvoiceItem> getInvoicedItems() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Set should be the type here. We should use interfaces as types instead of a particular implementation of that interface, which is HashSet in this case.

return invoiceItems?.findAll { it.invoice.isRegularInvoice && !it.inverse }
}

HashSet<InvoiceItem> getInverseItems() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

same as above

@awalkowiak awalkowiak changed the title Bugfix/obpih 6688 modify method checking if order adjustment is invoiceable OBPIH-6688 modify method checking if order adjustment is invoiceable Sep 17, 2024
@drodzewicz drodzewicz force-pushed the bugfix/OBPIH-6688-modify-method-checking-if-order-adjustment-is-invoiceable branch from 01c60ea to 3aa006d Compare September 17, 2024 12:05
@drodzewicz drodzewicz removed the warn: do not merge Marks a pull request that is not yet ready to be merged label Sep 17, 2024
"hasPrepaymentInvoice",
"hasRegularInvoice",
"disableRefresh",
"amountInvoiced",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you still have a transient for this? Is this potentially for the same thing as getInvoicedAmount?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

don't need it, removing it now

Comment on lines -159 to +183
return hasPrepaymentInvoice && !hasRegularInvoice && order.placed
}
Boolean invoicedFullAmount = invoicedAmount == totalAdjustments

// If is not canceled and has regular invoice, check if by any chance it was invoiced as cancelled
if (!canceled && hasRegularInvoice) {
return invoicedQuantity == 0 && order.placed
if (canceled) {
return hasPrepaymentInvoice && !hasRegularInvoice && order.placed && !invoicedFullAmount
}

return !hasRegularInvoice && order.placed
return order.placed && !invoicedFullAmount
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't we need to change the comment above about when the order adjustment is invoiceable?

@awalkowiak awalkowiak merged commit a8669b9 into release/0.9.2-hotfix1 Sep 17, 2024
@awalkowiak awalkowiak deleted the bugfix/OBPIH-6688-modify-method-checking-if-order-adjustment-is-invoiceable branch September 17, 2024 16:16
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 type: bug Addresses unintended behaviours of the app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants