Batch and Serial Number Allocation
VunaPOS supports both manual and automatic allocation of batches and serial numbers for stock-tracked items.
This ensures that invoices are submitted using valid inventory records from the warehouse configured in the active POS Profile.
Batch and serial allocation is handled before checkout so that the cashier can identify stock problems early rather than discovering them after payment has already been collected.
Requirements
Before using batch or serial allocation in VunaPOS:
- Enable batch or serial number tracking on the ERPNext Item.
- Create the required Batch or Serial No records.
- Ensure stock is available in the warehouse configured in the POS Profile.
- Confirm that the batch is not expired.
- Confirm that the serial number is available for delivery.
- Configure the POS Profile to allow automatic allocation where required.
VunaPOS uses ERPNext stock records as the source of truth.
Batch-Tracked Items
A batch-tracked item represents stock grouped under a Batch number.
This is commonly used for:
- food products
- medicines
- cosmetics
- chemicals
- manufactured goods
- items with expiry dates
When a batch-tracked item is added to the cart, VunaPOS must identify which batch quantities will be delivered.
Automatic Batch Allocation
VunaPOS by default selects valid batches without requiring the cashier to choose them manually.
The allocation follows a First Expiry, First Out approach where applicable.
This means VunaPOS prioritises:
- Non-expired batches
- Batches with the earliest expiry date
- Older batches when expiry dates are equal
Expired batches and batches with no available quantity are ignored.
Multi-Batch Allocation
VunaPOS can distribute the requested quantity across several batches.
For example:
Requested Quantity: 5
Batch A: 2
Batch B: 3
VunaPOS allocates:
Batch A × 2
Batch B × 3
The sale can continue because the total valid batch stock satisfies the requested quantity.
This is useful where no single batch has enough stock but the combined available quantity is sufficient.
Manual Batch Allocation
Manual allocation allows the cashier to select the exact batch or batches that should be used.
Use manual allocation when:
- the customer requests stock from a specific batch
- staff need to prioritise a particular batch
- the automatically suggested allocation should be changed
- physical stock at the counter differs from the suggested selection
To allocate batches manually:
- Add the batch-tracked item to the cart.
- Open the batch allocation control on the cart item.
- Review the available batches and quantities.
- Select one or more batches.
- Enter the quantity to take from each batch.
- Confirm the allocation.
The total quantity allocated across the selected batches must equal the quantity being sold.
For example:
Cart Quantity: 6
Batch A: 4
Batch B: 2
The allocation is valid because:
4 + 2 = 6
VunaPOS prevents checkout when the manually allocated quantity does not match the cart quantity.
Serialised Items
A serialised item is tracked using a unique Serial Number for each physical unit.
This is commonly used for:
- phones
- laptops
- appliances
- machinery
- electronics
- equipment requiring warranty tracking
Each unit sold must have a valid and available Serial Number.
If the cart quantity is three, exactly three Serial Numbers must be allocated.
Automatic Serial Number Allocation
When automatic serial allocation is enabled, VunaPOS selects available Serial Numbers from the configured warehouse.
For example:
Requested Quantity: 3
VunaPOS may allocate:
SN-00041
SN-00042
SN-00043
The allocated Serial Numbers are attached to the invoice item before submission.
VunaPOS only selects Serial Numbers that are available for delivery from the active warehouse.
Manual Serial Number Allocation
Manual allocation allows the cashier to select the exact units being sold.
This is useful where the cashier is scanning or physically handling a specific device or product.
To allocate Serial Numbers manually:
- Add the serialised item to the cart.
- Open the serial number allocation control.
- Search, scan, or select the required Serial Numbers.
- Confirm the selection.
The number of selected Serial Numbers must match the cart quantity.
For example:
Cart Quantity: 2
Selected Serial Numbers:
SN-00051
SN-00052
This is valid because two Serial Numbers have been selected for a quantity of two.
Barcode Scanning
Where batch or serial identifiers are represented by barcodes, the cashier can scan them during manual allocation.
The scanned value may identify:
- an Item
- a Batch
- a Serial Number
VunaPOS uses the scanned identifier to locate the matching stock record and apply it to the cart item where valid.
Unknown, unavailable, or invalid identifiers are rejected.
Cart Display
After allocation, the cart shows the selected batch or serial details.
A batch-tracked item may display:
Batches:
BATCH-A × 2
BATCH-B × 3
A serialised item may display:
Serial Numbers:
SN-00041
SN-00042
This allows the cashier to review the allocation before proceeding to checkout.
Changing Item Quantity
If the cart quantity changes, VunaPOS revalidates the current allocation.
For batch items:
- increasing quantity may require additional batch stock
- reducing quantity may reduce or rebuild the allocation
For serialised items:
- increasing quantity requires additional Serial Numbers
- reducing quantity removes unnecessary Serial Numbers from the allocation
The cashier should review the resulting allocation before checkout.
Checkout Validation
Before submitting the invoice, VunaPOS checks that:
- every batch-tracked item has a valid allocation
- allocated batch quantities match the invoice quantity
- allocated batches are not expired
- sufficient batch stock is still available
- every serialised item has the required number of Serial Numbers
- selected Serial Numbers are available in the correct warehouse
Checkout is blocked when any allocation is missing or invalid.
This final validation protects against stock changes that may occur between adding the item and completing the sale.
What Happens on the Invoice
When the sale is completed, VunaPOS attaches the selected batch and serial information to the relevant invoice rows.
Depending on the installed ERPNext version and stock configuration, this may use an ERPNext Serial and Batch Bundle.
The submitted Sales Invoice or POS Invoice remains the source of truth for:
- delivered batches
- delivered Serial Numbers
- warehouse deductions
- Stock Ledger entries
- item traceability
VunaPOS does not maintain a separate batch or serial inventory ledger.
Example: Automatic Batch Allocation
Example: Manual Serial Allocation
Important Notes
Note: Automatic allocation is intended to reduce cashier effort, but the resulting allocation should still be visible before checkout.
Note: Manual selection is useful when the physical item being handed to the customer must match a specific batch or Serial Number.
Warning: Batch and serial availability can change when another user submits a transaction. VunaPOS validates the allocation again during checkout.
Warning: Expired batches cannot be selected for a normal sale.
Common Problems
Insufficient Batch Stock
Cause
The total quantity available across valid batches is lower than the quantity being sold.
Resolution
- Reduce the cart quantity.
- Review stock in the POS Profile warehouse.
- Transfer or receive additional stock.
- Retry the allocation.
Allocated Batch Quantity Does Not Match
Cause
The manually allocated batch quantities do not equal the cart quantity.
Resolution
- Review each selected batch.
- Adjust the allocated quantities.
- Ensure their total equals the item quantity.
- Confirm the allocation again.
Expired Batch Cannot Be Selected
Cause
The selected batch has passed its expiry date.
Resolution
- Choose another valid batch.
- Review the Batch record in ERPNext.
- Correct the expiry date only if the record itself is incorrect.
Not Enough Serial Numbers
Cause
There are fewer available Serial Numbers than the requested item quantity.
Resolution
- Reduce the cart quantity.
- Check Serial Number availability in the selected warehouse.
- Transfer the required serialised stock.
- Retry the sale.
Serial Number Is Unavailable
Cause
The Serial Number may already have been delivered, reserved, or stored in another warehouse.
Resolution
- Search for the Serial Number in ERPNext.
- Confirm its current warehouse and status.
- Select another available Serial Number.
Allocation Changed Before Checkout
Cause
Another stock transaction may have used the selected batch or Serial Number before the sale was submitted.
Resolution
- Review the allocation error.
- Refresh or reopen the allocation selector.
- Allow VunaPOS to allocate again or choose another stock record.
- Retry checkout.