Skip to content

OBPIH-6226 Add PO UoM in the PO receipt workflow#4889

Merged
awalkowiak merged 5 commits intodevelopfrom
OBPIH-6226
Oct 15, 2024
Merged

OBPIH-6226 Add PO UoM in the PO receipt workflow#4889
awalkowiak merged 5 commits intodevelopfrom
OBPIH-6226

Conversation

@alannadolny
Copy link
Collaborator

@alannadolny alannadolny self-assigned this Oct 10, 2024
@github-actions github-actions bot added 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 Oct 10, 2024
import org.pih.warehouse.core.ActivityCode
import org.pih.warehouse.core.Location
import org.pih.warehouse.core.Person
import org.pih.warehouse.core.UnitOfMeasure
Copy link
Collaborator

Choose a reason for hiding this comment

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

it seems not be used

}

OrderItem getOrderItem() {
return orderItems[0]
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm wondering why this relationship is many-to-many

Copy link
Member

@ewaterman ewaterman Oct 11, 2024

Choose a reason for hiding this comment

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

I just made this same comment on the other pr 🤔

react.partialReceiving.check.label=Check
react.partialReceiving.toReceive.label=To receive
react.partialReceiving.receivingNow.label=Receiving now
react.partialReceiving.receivingNowEach.label=Receiving now (each)
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 for this case, the key could stay receivingNow.

getDynamicAttr: (props) => ({
hide: !props.values?.isShipmentOrderBased,
}),
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't this field be disabled?

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 LabelField is "disabled" by default

}

Boolean isShipmentOrderBased() {
return shipment.orders.size() > 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

wasn't it supposed to be only applied to the shipment from PO?
if so, this should be changed, because currently it would return true also for returns and putaways.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you just use shipment.isFromPurchaseOrder instead, if it is only for POs?

"paymentTerm",
"quantityInvoiced",
"orderItem",
"uom",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't have a strong opinion on that, but I can see that in some places we use uom and in some places we use unitOfMeasure - I think it would be good to align on one version, as more PRs related to that will come.

Copy link
Collaborator

Choose a reason for hiding this comment

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

For now, I'd say that unitOfMeasure is more relevant, because it's currently used in OrderItem and Product domain.

quantityOnHand : quantityOnHand,
comment : comment
comment : comment,
uom : displayUom,
Copy link
Collaborator

Choose a reason for hiding this comment

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

the same comment as in the transients

getDynamicAttr: (props) => ({
hide: !props.values?.isShipmentOrderBased,
}),
},
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 LabelField is "disabled" by default

}

Boolean isShipmentOrderBased() {
return shipment.orders.size() > 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you just use shipment.isFromPurchaseOrder instead, if it is only for POs?

return orderItems[0]
}

String getUom() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like your and @drodzewicz are adding the same thing, So it would be to align on the same version (plus naming-wise I would say it should be getUnitOfMeasure)

@alannadolny alannadolny force-pushed the OBPIH-6226 branch 2 times, most recently from 895dae3 to 1fb81c2 Compare October 11, 2024 12:43
quantityOnHand : quantityOnHand,
comment : comment
comment : comment,
unitOfMeasure : displayUnitOfMeasure,
Copy link
Member

Choose a reason for hiding this comment

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

@drodzewicz is doing something very similar in StockMovementItem https://github.com/openboxes/openboxes/pull/4891/files

In Darek's pr he has "unitOfMeasure" being just the shipmentItem.unitOfMeasure and there's also a "packSize" field that has shipmentItem.quantityPerUom. Then in the frontend it renders those separately.

Is there a way we can unify our approach for both of these APIs?

requisition : shipment?.requisition?.id,
description : shipment?.description,
recipient : recipient,
isShipmentOrderBased : shipment.isFromPurchaseOrder,
Copy link
Collaborator

@kchelstowski kchelstowski Oct 14, 2024

Choose a reason for hiding this comment

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

I don't think that isShipmentOrderBased fits here, because returns are also order based. Let's call it as shipment's method, so isShipmentFromPurchaseOrder

@awalkowiak awalkowiak merged commit bda3654 into develop Oct 15, 2024
@awalkowiak awalkowiak deleted the OBPIH-6226 branch October 15, 2024 08:45
@alannadolny alannadolny restored the OBPIH-6226 branch October 17, 2024 12:25
@alannadolny alannadolny deleted the OBPIH-6226 branch October 17, 2024 12:27
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants