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

(feat): Sort inventory items by expiration date #139

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

FelixKiprotich350
Copy link
Contributor

Requirements

  • This PR has a title that briefly describes the work done, including the ticket number if there is a ticket.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

Summary

sorted the batches expiry date from the most nearing expiring to the furthest expiring ind dipensing module

Screenshots

Screenshot from 2024-12-12 17-06-00

Related Issue

Other

@donaldkibet
Copy link
Member

You should have pushed this change to the branch containing the PR.
Please include a ticket and close the previous associated PR

@donaldkibet donaldkibet changed the title sorted batches in dispensing module (fix): Sort inventory items by expiration date Dec 17, 2024
@donaldkibet donaldkibet changed the title (fix): Sort inventory items by expiration date (feat): Sort inventory items by expiration date Dec 17, 2024
Copy link
Member

@donaldkibet donaldkibet left a comment

Choose a reason for hiding this comment

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

@donaldkibet donaldkibet merged commit 8bacf9a into openmrs:main Dec 17, 2024
4 checks passed
@@ -16,6 +16,14 @@ const StockDispense: React.FC<StockDispenseProps> = ({ medicationDispense, updat
const drugUuid = medicationDispense?.medicationReference?.reference?.split('/')[1];
const { inventoryItems, error, isLoading } = useDispenseStock(drugUuid);
const validInventoryItems = inventoryItems.filter((item) => isValidBatch(medicationDispense, item));
const validInventoryItemss = inventoryItems
Copy link
Member

@denniskigen denniskigen Dec 17, 2024

Choose a reason for hiding this comment

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

Why the need for a new variable variableInventoryItemss instead of tacking on the new logic to line 18?

Copy link
Member

Choose a reason for hiding this comment

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

Indeed. This kind of thing is the type of thing that causes us to need to revert PRs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Am working on it

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.

4 participants