---
title: "Batch and Serial Number Allocation"
space: "VunaPOS"
url: "https://docs.navari.co.ke/vunapos/selling/batch-and-serial-allocation"
updated: "2026-08-05"
---

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:

1. Enable batch or serial number tracking on the ERPNext Item.
2. Create the required Batch or Serial No records.
3. Ensure stock is available in the warehouse configured in the POS Profile.
4. Confirm that the batch is not expired.
5. Confirm that the serial number is available for delivery.
6. 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:

1. Non-expired batches
2. Batches with the earliest expiry date
3. 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:

```text
Requested Quantity: 5

Batch A: 2
Batch B: 3

```

VunaPOS allocates:

```text
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:

1. Add the batch-tracked item to the cart.
2. Open the batch allocation control on the cart item.
3. Review the available batches and quantities.
4. Select one or more batches.
5. Enter the quantity to take from each batch.
6. Confirm the allocation.

The total quantity allocated across the selected batches must equal the quantity being sold.

For example:

```text
Cart Quantity: 6

Batch A: 4
Batch B: 2

```

The allocation is valid because:

```text
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:

```text
Requested Quantity: 3

```

VunaPOS may allocate:

```text
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:

1. Add the serialised item to the cart.
2. Open the serial number allocation control.
3. Search, scan, or select the required Serial Numbers.
4. Confirm the selection.

The number of selected Serial Numbers must match the cart quantity.

For example:

```text
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:

```text
Batches:
BATCH-A × 2
BATCH-B × 3

```

A serialised item may display:

```text
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

![](/files/2026-08-05 07-37-07.mp4)

## Example: Manual Serial Allocation

![](/files/2026-08-05 07-39-39.mp4)

## 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**

1. Reduce the cart quantity.
2. Review stock in the POS Profile warehouse.
3. Transfer or receive additional stock.
4. Retry the allocation.

### Allocated Batch Quantity Does Not Match

**Cause**

The manually allocated batch quantities do not equal the cart quantity.

**Resolution**

1. Review each selected batch.
2. Adjust the allocated quantities.
3. Ensure their total equals the item quantity.
4. Confirm the allocation again.

### Expired Batch Cannot Be Selected

**Cause**

The selected batch has passed its expiry date.

**Resolution**

1. Choose another valid batch.
2. Review the Batch record in ERPNext.
3. 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**

1. Reduce the cart quantity.
2. Check Serial Number availability in the selected warehouse.
3. Transfer the required serialised stock.
4. Retry the sale.

### Serial Number Is Unavailable

**Cause**

The Serial Number may already have been delivered, reserved, or stored in another warehouse.

**Resolution**

1. Search for the Serial Number in ERPNext.
2. Confirm its current warehouse and status.
3. 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**

1. Review the allocation error.
2. Refresh or reopen the allocation selector.
3. Allow VunaPOS to allocate again or choose another stock record.
4. Retry checkout.