Report Wrong SOH on first Receive into Stock Card

Description

The bug is encountered when a user attempts to receive new stock into a facility for the first time (Make Receive). If the user provides two receive line items with different dates, the system saves the calculated stock on hand from only one of the line items, which is the later one.

Steps to Reproduce:

  1. Navigate to the Stock management and select “Make Receive” for RI program.

  2. Select a product and lot not already in the facility and add it to the list.

  3. Fill in the other details of receive as necessary.

  4. Select the same product and lot and add it to the list.

  5. Set the date of the new line item to an earlier date and fill in all other details.

  6. Click the Submit button.

  7. After redirecting to the Stock on Hand, check bin cards to confirm if SOH of the bin card is updated.

Actual Result:

The bin card shows an incorrect SOH, which is the value of the second line item quantity.

Expected Result:

The correct SOH value should be an aggregate of the two line items.

Cause: Edge case not covered during development and testing. The function to recalculate stock on hand for a stock card does not cover the described scenario, where multiple line items come in at once for a new stock card. Depending on the ordering of the event line items in the request payload (which one comes first in the table on the user interface), the function may pick the wrong line item to use (the function picks the last line item added to the stock card, as a parameter) when recalculating SOH for the stock card. If it picks the line item with the latest occurred date, the error occurs. It only works fine when the line item with the earliest occurred date is picked.

Resolution: Since the issue has been identified to be a problem with the sorting or ordering of the event line items by the occurred date, a sorting function is called to reorder the event line items by their occurred date before the stock event is processed. This way we can ensure that the function recalculates stock on hand and picks the right line item to use as its parameter, which is the earliest occurring line item.

Attachments

1

QAlity Plus - Test Management

Checklists

Activity

Maciej Grochalski 
April 19, 2024 at 2:25 PM

Since this ticket has been released I’m moving it to Done status

Aleksandra Hinc 
April 11, 2024 at 7:33 AM

Tested this on core UAT instance. This issue is no valid anymore.

Aleksandra Hinc 
April 10, 2024 at 7:31 AM

Started testing this on UAT

Unresolved
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Original estimate

Time tracking

2h logged

Components

Affects versions

Priority

Time Assistant

Created March 19, 2024 at 9:55 AM
Updated July 9, 2024 at 12:55 PM