Skip to content

OBPIH-6225 Add PO UoM in the PO shipment workflow#4891

Merged
awalkowiak merged 6 commits intodevelopfrom
feature/OBPIH-6225-add-po-uo-m-in-the-po-shipment-workflow
Oct 18, 2024
Merged

OBPIH-6225 Add PO UoM in the PO shipment workflow#4891
awalkowiak merged 6 commits intodevelopfrom
feature/OBPIH-6225-add-po-uo-m-in-the-po-shipment-workflow

Conversation

@drodzewicz
Copy link
Collaborator

@drodzewicz drodzewicz commented Oct 10, 2024

✨ Description of Change

A concise summary of what is being changed. Please provide enough context for reviewers to be able to understand the change and why it is necessary. If the issue/ticket already provides enough information, you can put "See ticket" as the description.

Link to GitHub issue or Jira ticket: OBPIH-6225

Description:
On add items step:

  • Added column with information about Uom (PO UoM)
  • replaced previous quantity input (each) with quantity input (per UOM)
  • Added Quantity (each) column that is dynamically calculated based on provided pack size and input of quantity per UOM

On Send page

  • Added quantity picked per Uom that displays amount of packs and uom picked
  • renamed quantity picked column header to Quantity Picked (each)

📷 Screenshots & Recordings (optional)

If this PR contains a UI change, consider adding one or more screenshots here or link to a screen recording to help reviewers visualize the change. Otherwise, you can remove this section.

image

image

@drodzewicz drodzewicz self-assigned this Oct 10, 2024
@github-actions github-actions bot added type: feature A new piece of functionality for the app 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
}

String getUnitOfMeasure() {
OrderItem orderItem = OrderItem.get(this.orderItemId)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looking at how the orderItemId transient is implemented, I don't see a point in fetching the order item here. I'd rather just go with orderItems[0]

Copy link
Member

Choose a reason for hiding this comment

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

I'm assuming he did this because that's what we do in all the previous lines but yes, doing it this way looks up all order items to get the first id, then we re-fetch that order item here to get the unit of measure. Seems like a lot of redundant work.

I agree with Kacper that we could do this more efficiently by just getting the first item (since we're already assuming there is only one).

Side note, I think it's worth looking into the performance effect of having shipmentItem <-> orderItem being a many-to-many relationship. I know it was implemented that way to be more flexible, but I would think that a shipmentItem can only reference a single order item. Anyways, something for us to look into at another point

quantityRevised : quantityRevised,
quantityPicked : quantityPicked,
unitOfMeasure : unitOfMeasure,
packsRequested : quantityRequested / packSize,
Copy link
Collaborator

@kchelstowski kchelstowski Oct 10, 2024

Choose a reason for hiding this comment

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

are you sure we don't have to do any additional checks in terms of dividing those two values, like checking if packSize is always > 0?

@drodzewicz drodzewicz force-pushed the feature/OBPIH-6225-add-po-uo-m-in-the-po-shipment-workflow branch from d0eebd2 to f7a934c Compare October 16, 2024 10:08
label: 'react.stockMovement.quantity.label',
defaultMessage: 'Qty',
label: 'react.stockMovement.quantityPerUom.label',
defaultMessage: 'Quantity (per 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 think this should be something different. "Packs requested" is something different than "quantity per uom" ("quantity per uom" is "pack size")

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this name was suggested to me by Manon, I don't have any opinion about it so this needs further confirmation

quantityRevised : quantityRevised,
quantityPicked : quantityPicked,
unitOfMeasure : unitOfMeasure,
packsRequested : packsRequest,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you call it packsRequested as well instead of packsRequest?

@drodzewicz drodzewicz requested a review from awalkowiak October 17, 2024 11:15
Comment on lines 195 to 201
const packsRequested = _.toInteger(
_.get(values, `lineItems[${rowIndex}].packsRequested`),
);
const packSize = _.toInteger(
_.get(values, `lineItems[${rowIndex}].packSize`),
);
return packsRequested * packSize;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you just use values.lineItems[rowIndex].packsRequested with nullsafes instead of this lodash function?

},
getDynamicAttr: ({ rowIndex, tableItems }) => ({
formatValue: () => {
const row = _.get(tableItems, `[${rowIndex}]`, {});
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 here

}

BigDecimal getPacksRequested () {
if (packSize == null || packSize == 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

so when we are checking if packSize is null or 0, we can use !packSize

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I made other changes but I'd prefer to leave this as it is now, I feel like this way is more explicit to show what are we checking instead of !packSize

@awalkowiak awalkowiak merged commit 17cd19c into develop Oct 18, 2024
@awalkowiak awalkowiak deleted the feature/OBPIH-6225-add-po-uo-m-in-the-po-shipment-workflow branch October 18, 2024 13:37
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 type: feature A new piece of functionality for the app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants