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-6813 shipped in po column when edits to shipped quantities in receiving #4941

Conversation

drodzewicz
Copy link
Collaborator

@drodzewicz drodzewicz commented Nov 14, 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-6813

Description:
Main goal of this ticket was to display a propper Shipped (In PO UoM) quantity when splitting items.

Before if we had an item with shipped quantity 12 that was labeled with UoM 3 PK/4 and we split the item in two items by 8 and 4 we still got the same label but instead we want it to be 2 PK/4 and 1 PK/4


📷 Screenshots & Recordings (optional)

image

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.

@drodzewicz drodzewicz self-assigned this Nov 14, 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 Nov 14, 2024
Copy link

codecov bot commented Nov 14, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 7.58%. Comparing base (47cc0e5) to head (359b405).
Report is 9 commits behind head on develop.

Files with missing lines Patch % Lines
...ain/org/pih/warehouse/shipping/ShipmentItem.groovy 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             develop   #4941   +/-   ##
=========================================
  Coverage       7.57%   7.58%           
- Complexity       803     805    +2     
=========================================
  Files            596     596           
  Lines          42170   42170           
  Branches       10258   10257    -1     
=========================================
+ Hits            3195    3199    +4     
+ Misses         38512   38506    -6     
- Partials         463     465    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

`containers[${parentIndex}].shipmentItems[${rowIndex}]`,
{},
);
const packsRequested = _.round(shipmentItem?.packsRequested, 1);
Copy link
Collaborator

@awalkowiak awalkowiak Nov 14, 2024

Choose a reason for hiding this comment

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

Is this rounding correct? Have you confirmed that behavior? This would give the same result for PK/6 and shipped 1 in each, and for PK/5 and shipped 1 in each, as 0.2. Feels like rounding to two decimal places would be more accurate.

Copy link
Collaborator

@awalkowiak awalkowiak Nov 14, 2024

Choose a reason for hiding this comment

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

Yeah on second thought I think this should be 2 decimal places, feels like quarters (.25) might be a potential common case. In the current version this would be rounded up to 0.3.

Comment on lines +272 to +276
const shipmentItem = _.get(
values,
`containers[${parentIndex}].shipmentItems[${rowIndex}]`,
{},
);
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 use nullsafe here?

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 had some issues when using

 const shipmentItem = values?.containers[parentIndex]?.shipmentItems[rowIndex] ?? {};

I guess the values are very deeply nested and nulish operator does not handle it very well

@awalkowiak awalkowiak merged commit 9f1f439 into develop Nov 18, 2024
7 of 9 checks passed
@awalkowiak awalkowiak deleted the feature/OBPIH-6813-shipped-in-po-column-when-edits-to-shipped-quantities-in-receiving branch November 18, 2024 09:48
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.

4 participants