OBPIH-6226 Add PO UoM in the PO receipt workflow#4889
Conversation
| import org.pih.warehouse.core.ActivityCode | ||
| import org.pih.warehouse.core.Location | ||
| import org.pih.warehouse.core.Person | ||
| import org.pih.warehouse.core.UnitOfMeasure |
There was a problem hiding this comment.
it seems not be used
| } | ||
|
|
||
| OrderItem getOrderItem() { | ||
| return orderItems[0] |
There was a problem hiding this comment.
I'm wondering why this relationship is many-to-many
There was a problem hiding this comment.
I just made this same comment on the other pr 🤔
grails-app/i18n/messages.properties
Outdated
| react.partialReceiving.check.label=Check | ||
| react.partialReceiving.toReceive.label=To receive | ||
| react.partialReceiving.receivingNow.label=Receiving now | ||
| react.partialReceiving.receivingNowEach.label=Receiving now (each) |
There was a problem hiding this comment.
I think for this case, the key could stay receivingNow.
| getDynamicAttr: (props) => ({ | ||
| hide: !props.values?.isShipmentOrderBased, | ||
| }), | ||
| }, |
There was a problem hiding this comment.
shouldn't this field be disabled?
There was a problem hiding this comment.
I think LabelField is "disabled" by default
| } | ||
|
|
||
| Boolean isShipmentOrderBased() { | ||
| return shipment.orders.size() > 0 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Could you just use shipment.isFromPurchaseOrder instead, if it is only for POs?
| "paymentTerm", | ||
| "quantityInvoiced", | ||
| "orderItem", | ||
| "uom", |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
the same comment as in the transients
| getDynamicAttr: (props) => ({ | ||
| hide: !props.values?.isShipmentOrderBased, | ||
| }), | ||
| }, |
There was a problem hiding this comment.
I think LabelField is "disabled" by default
| } | ||
|
|
||
| Boolean isShipmentOrderBased() { | ||
| return shipment.orders.size() > 0 |
There was a problem hiding this comment.
Could you just use shipment.isFromPurchaseOrder instead, if it is only for POs?
| return orderItems[0] | ||
| } | ||
|
|
||
| String getUom() { |
There was a problem hiding this comment.
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)
895dae3 to
1fb81c2
Compare
1fb81c2 to
915a268
Compare
| quantityOnHand : quantityOnHand, | ||
| comment : comment | ||
| comment : comment, | ||
| unitOfMeasure : displayUnitOfMeasure, |
There was a problem hiding this comment.
@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, |
There was a problem hiding this comment.
I don't think that isShipmentOrderBased fits here, because returns are also order based. Let's call it as shipment's method, so isShipmentFromPurchaseOrder
✨ Description of Change
Link to GitHub issue or Jira ticket: https://pihemr.atlassian.net/browse/OBPIH-6226