-
-
Notifications
You must be signed in to change notification settings - Fork 403
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
@@ -259,6 +260,10 @@ class Order implements Serializable { | |||
return activeOrderItems?.every { OrderItem orderItem -> orderItem.isCompletelyFulfilled() } | |||
} | |||
|
|||
Boolean isPartiallyShipped() { | |||
return activeOrderItems?.any { OrderItem orderItem -> orderItem.isCompletelyFulfilled() } |
There was a problem hiding this comment.
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:
return activeOrderItems?.any { OrderItem orderItem -> orderItem.isCompletelyFulfilled() } | |
return activeOrderItems?.any { it.isCompletelyFulfilled() } |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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() } |
There was a problem hiding this comment.
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)
There was a problem hiding this 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() } |
There was a problem hiding this comment.
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.
both cases when shipped item quantity is partially and completely fulfiled
22ce6da
to
bf8372e
Compare
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. |
No description provided.