Skip to content

Serial numbers not Updating after invoice submission - requires page refresh to see updated serial list #166

@maniamartial

Description

@maniamartial

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:

  1. User selects a batch with available quantity

  2. User selects serial numbers from the available list

  3. User submits the order

  4. User starts a new order

  5. ✅ Batch list is updated - shows remaining quantities correctly

  6. ✅ Quantity field reflects the updated available stock

  7. Serial number list is NOT updated - still shows previously selected serials as available, even though they were consumed in the previous order

Image

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:

  1. Open a new order

  2. Select a product that has batch tracking and serial numbers

  3. Select a batch with available quantity > 0

  4. Select one or more serial numbers from the list

  5. Submit the order

  6. Start a new order

  7. Select the same product and batch

  8. Observe that the previously selected serial numbers still appear in the list as available

  9. Refresh the page

  10. 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:

  1. Adding serial list to the dependency array that triggers refetch after order submission

  2. Implementing a cache invalidation strategy for serial numbers when a new order is created

  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions