Skip to content

[Feature]:Auto-Select Batch Numbers with FIFO (First to Expire, First Out) Logic #108

@kionero

Description

@kionero

Search Confirmation

  • I have searched existing issues and this feature has not been requested before

Problem Statement

Currently, when adding batch-tracked items to the POS cart, users must manually select a batch from a dialog every time. This creates several issues:

  1. Workflow Inefficiency: Cashiers need to click through an additional dialog for every batch item, slowing down checkout
  2. Manual Error Risk: Cashiers may accidentally select batches with later expiry dates, leaving soon-to-expire stock unsold
  3. Inventory Management: No automatic enforcement of FIFO (First In, First Out) principles for perishable goods
  4. User Experience: Extra clicks and decisions required during high-pressure checkout scenarios

This is particularly problematic for businesses dealing with:

  • Medicines and pharmaceuticals (expiry dates critical)
  • Food and beverages (perishables)
  • Cosmetics and personal care (shelf life concerns)
  • Any inventory with time-sensitive stock rotation

Proposed Solution

Implement automatic batch selection with FIFO/FEFO logic that:

  1. Automatically selects the batch with the earliest expiry date when adding batch-tracked items to cart
  2. Bypasses the batch selection dialog for faster checkout
  3. Maintains manual override option via a prop for scenarios requiring manual batch selection - This can be implemented in the POSNext Settings as a toggle
  4. Sorts batches by expiry date both in API responses and offline cache

This has been successfully implemented in the native ERPnext Point of Sale as seen in the attached screenshot

UI Mockups / Screenshots

Image

Alternatives Considered

No response

Feature Area

Cart / Item Management

Business Priority

High - Significant impact on daily operations

Current POS Next Version

1.13.0

Additional Context

No response

Contribution

  • I would be willing to submit a PR to implement this feature
  • I would be willing to test/review a PR for this feature
  • I can provide detailed requirements or domain expertise

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions