Description
Issue Summary:
When selecting batch and serial numbers for a product and submitting an order, the batch list and quantity are properly updated for the next new order, but the serial number list remains stale. The serial numbers do not reflect the updated available quantities until the page is manually refreshed.
Current Behavior:
-
User selects a batch with available quantity
-
User selects serial numbers from the available list
-
User submits the order
-
User starts a new order
-
✅ Batch list is updated - shows remaining quantities correctly
-
✅ Quantity field reflects the updated available stock
-
❌ Serial number list is NOT updated - still shows previously selected serials as available, even though they were consumed in the previous order
Expected Behavior:
The serial number list should be automatically refreshed after order submission, just like the batch list and quantity. When starting a new order, the serial list should only show serial numbers that are still available (not yet used in previous orders).
Steps to Reproduce:
-
Open a new order
-
Select a product that has batch tracking and serial numbers
-
Select a batch with available quantity > 0
-
Select one or more serial numbers from the list
-
Submit the order
-
Start a new order
-
Select the same product and batch
-
Observe that the previously selected serial numbers still appear in the list as available
-
Refresh the page
-
Observe that the serial list now correctly shows only available serials
Technical Details:
-
Issue Type: State management / Cache invalidation
-
Affected Component: Serial number selection in order form
-
Working Components: Batch list and quantity (these refresh correctly)
-
Non-working Component: Serial number list
Suggested Fix:
The serial number list should be invalidated/refetched after order submission, similar to how the batch list is updated. Consider:
-
Adding serial list to the dependency array that triggers refetch after order submission
-
Implementing a cache invalidation strategy for serial numbers when a new order is created
-
Using the same refresh mechanism that successfully updates batches and quantities
Environment:
Additional Context:
This issue causes users to potentially select already-used serial numbers, leading to validation errors or inventory discrepancies. The inconsistency between batch/quantity refresh (working) and serial refresh (not working) suggests the serial list might be using a different data fetching pattern or cache strategy.
Description
Issue Summary:
When selecting batch and serial numbers for a product and submitting an order, the batch list and quantity are properly updated for the next new order, but the serial number list remains stale. The serial numbers do not reflect the updated available quantities until the page is manually refreshed.
Current Behavior:
User selects a batch with available quantity
User selects serial numbers from the available list
User submits the order
User starts a new order
✅ Batch list is updated - shows remaining quantities correctly
✅ Quantity field reflects the updated available stock
❌ Serial number list is NOT updated - still shows previously selected serials as available, even though they were consumed in the previous order
Expected Behavior:
The serial number list should be automatically refreshed after order submission, just like the batch list and quantity. When starting a new order, the serial list should only show serial numbers that are still available (not yet used in previous orders).
Steps to Reproduce:
Open a new order
Select a product that has batch tracking and serial numbers
Select a batch with available quantity > 0
Select one or more serial numbers from the list
Submit the order
Start a new order
Select the same product and batch
Observe that the previously selected serial numbers still appear in the list as available
Refresh the page
Observe that the serial list now correctly shows only available serials
Technical Details:
Issue Type: State management / Cache invalidation
Affected Component: Serial number selection in order form
Working Components: Batch list and quantity (these refresh correctly)
Non-working Component: Serial number list
Suggested Fix:
The serial number list should be invalidated/refetched after order submission, similar to how the batch list is updated. Consider:
Adding serial list to the dependency array that triggers refetch after order submission
Implementing a cache invalidation strategy for serial numbers when a new order is created
Using the same refresh mechanism that successfully updates batches and quantities
Environment:
Browser: [All browsers]
Page: New Order / Order Entry
Affected Version: [Current version]
Additional Context:
This issue causes users to potentially select already-used serial numbers, leading to validation errors or inventory discrepancies. The inconsistency between batch/quantity refresh (working) and serial refresh (not working) suggests the serial list might be using a different data fetching pattern or cache strategy.