Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OBPIH-6004 Add ability to create a final invoice for partially shipped orders #4422

Conversation

drodzewicz
Copy link
Collaborator

No description provided.

@drodzewicz drodzewicz added the warn: do not merge Marks a pull request that is not yet ready to be merged label Dec 14, 2023
@drodzewicz drodzewicz added this to the 0.9.1 milestone Dec 14, 2023
@drodzewicz drodzewicz self-assigned this Dec 14, 2023
@@ -259,6 +260,10 @@ class Order implements Serializable {
return activeOrderItems?.every { OrderItem orderItem -> orderItem.isCompletelyFulfilled() }
}

Boolean isPartiallyShipped() {
return activeOrderItems?.any { OrderItem orderItem -> orderItem.isCompletelyFulfilled() }
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 it can be shortened to:

Suggested change
return activeOrderItems?.any { OrderItem orderItem -> orderItem.isCompletelyFulfilled() }
return activeOrderItems?.any { it.isCompletelyFulfilled() }

Copy link
Collaborator

Choose a reason for hiding this comment

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

@drodzewicz what if every item is completely fulfilled? Then this will be both shipped and partiallyShipped. I think you should either check if it is && !shipped or check if activeOrderItems?.any { it.isPartiallyFulfilled() } (I think I prefer the later version)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good point, I'll fix that

Copy link
Member

Choose a reason for hiding this comment

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

I prefer using a static type with closures but we can discuss if this is preferred.

@@ -259,6 +260,10 @@ class Order implements Serializable {
return activeOrderItems?.every { OrderItem orderItem -> orderItem.isCompletelyFulfilled() }
}

Boolean isPartiallyShipped() {
return activeOrderItems?.any { OrderItem orderItem -> orderItem.isCompletelyFulfilled() }
Copy link
Collaborator

Choose a reason for hiding this comment

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

@drodzewicz what if every item is completely fulfilled? Then this will be both shipped and partiallyShipped. I think you should either check if it is && !shipped or check if activeOrderItems?.any { it.isPartiallyFulfilled() } (I think I prefer the later version)

Copy link
Member

@jmiranda jmiranda left a comment

Choose a reason for hiding this comment

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

Other than the changes requested already, this looks good to me.

@@ -259,6 +260,10 @@ class Order implements Serializable {
return activeOrderItems?.every { OrderItem orderItem -> orderItem.isCompletelyFulfilled() }
}

Boolean isPartiallyShipped() {
return activeOrderItems?.any { OrderItem orderItem -> orderItem.isCompletelyFulfilled() }
Copy link
Member

Choose a reason for hiding this comment

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

I prefer using a static type with closures but we can discuss if this is preferred.

@drodzewicz drodzewicz marked this pull request as draft December 22, 2023 15:04
@drodzewicz drodzewicz force-pushed the OBPIH-6004-generate-invoice-for-prepayment-po-before-all-items-are-shipped branch from 22ce6da to bf8372e Compare January 9, 2024 16:19
@drodzewicz drodzewicz changed the base branch from feature/upgrade-to-grails-3.3.10 to release/0.9.0-hotfix1 January 9, 2024 16:19
@drodzewicz drodzewicz added needs attention status: needs discussion An issue that needs further discussion before it can proceed. and removed warn: do not merge Marks a pull request that is not yet ready to be merged labels Jan 9, 2024
@drodzewicz drodzewicz marked this pull request as ready for review January 9, 2024 16:20
@drodzewicz drodzewicz added the warn: do not merge Marks a pull request that is not yet ready to be merged label Jan 10, 2024
@awalkowiak
Copy link
Collaborator

I am closing this one, because either the scope will change, or this won't be finalized at all in the state it was requested by a user.

@awalkowiak awalkowiak closed this Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs discussion An issue that needs further discussion before it can proceed. warn: do not merge Marks a pull request that is not yet ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants