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-5672 Show quantity issued only for approved items #4076

Merged
merged 2 commits into from
Jun 1, 2023

Conversation

awalkowiak
Copy link
Collaborator

No description provided.

@awalkowiak awalkowiak added the warn: do not merge Marks a pull request that is not yet ready to be merged label May 31, 2023
@@ -328,6 +328,10 @@ class Location implements Comparable<Location>, java.io.Serializable {
return !onHold
}

Boolean hasNoManagedInventoryAndSupportsSubmittingRequests() {
Copy link
Member

Choose a reason for hiding this comment

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

My only comment is that this method name does not roll off the tongue. I'll try to think of a way to simplify it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed to isDownstreamConsumer

// if request FROM Ward then pull demand from origin to ward and use quantity counted as quantity on hand
if (requisitionInstance?.destination?.hasNoManagedInventoryAndSupportsSubmittingRequests()) {
// if request FROM "Ward" (location without managed inventory but supporting submitting requests),
// then pull demand from origin to that location
Copy link
Member

Choose a reason for hiding this comment

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

Let's no use "ward" because it could be all sorts of location types. Let's call it a downstream consumer. In fact, I think that's what I want the method to be called as well. Either of these sounds good to me.

Boolean isDownstreamConsumer() 
Boolean isDownstreamEndpoint()

@@ -243,7 +244,7 @@ class DocumentTemplateService {
requestorMonthlyDemand : demand?.monthlyDemand ?: 0,
requestorQuantityOnHand : quantityOnHand,
quantityRequested : requisitionItem?.quantity,
quantityIssued : requisitionInstance?.isPending() ? "" : requisitionItem?.quantityIssued
quantityIssued : requisitionItem.isApproved() && !requisitionInstance?.isPending() ? requisitionItem?.quantityIssued : ""
Copy link
Member

Choose a reason for hiding this comment

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

this could be encapsulated in a method like this ...

RequisitionItem.isQuantityAllocated()

or

RequisitionItem.isQuantityIssued()

depending on which one is more accurate.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@awalkowiak awalkowiak removed the warn: do not merge Marks a pull request that is not yet ready to be merged label Jun 1, 2023
@awalkowiak awalkowiak merged commit 1b699f8 into develop Jun 1, 2023
3 checks passed
@awalkowiak awalkowiak deleted the OBPIH-5672 branch June 1, 2023 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants