> For the complete documentation index, see [llms.txt](https://kb.logicerp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/inventory/physical-vs-actual-stock-doc-wise-entry/physical-vs-actual-stock-doc-wise-entry-configuration/lot-code-prefix.md).

# Lot Code Prefix

**YouTube:** [How to Set the Lot Code Prefix in Physical vs. Actual Stock Entry?](https://youtu.be/m5znlhA6sS8?si=d_vSj_ZxY4PRkLmI)

## How to Set the Lot Code Prefix in Physical vs. Actual Stock Entry?

In this tutorial, we will learn how to define a **Lot Code Prefix** for barcode scanning in the Physical Vs Actual Stock Document Wise Entry module in Logic ERP. We will also verify how the system processes lot codes with and without the defined prefix.

***

### Configure the Lot Code Prefix

* Navigate to the **Physical Vs Actual Stock Document Wise Entry** module.
* Open the **Configuration** window. (The **Configuration** button is available only to the Admin user or a supervisor user.)
* Locate the option labeled as:

> **Lot Code Prefix**

<figure><img src="https://4031188996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXMVkjt8zqHBQX1c9QvFS%2Fuploads%2FsTqF6CtUpj1jbbAiAHvU%2FCNF.png?alt=media&#x26;token=4a719382-24aa-4a21-a5da-2b7611b8067d" alt=""><figcaption></figcaption></figure>

* Enter the required lot code prefix.
* Save the configuration.

***

### Configure the Barcode Field

* In this example, **Barcode As** is set to **Lot Code**.
* Note: once a Lot Code Prefix is defined, the prefix is required for **every** scan, whichever **Barcode As** value is selected (item code, set code, lot number and so on), not only for lot codes.

<figure><img src="https://4031188996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXMVkjt8zqHBQX1c9QvFS%2Fuploads%2FwwX6nmU4LoOLmT9BPKBO%2FBarcode%20As%20Lot%20Code.png?alt=media&#x26;token=3b92fad2-21af-4397-8391-9f5a4455b540" alt=""><figcaption></figcaption></figure>

* This setting makes the system identify the barcode using the lot code.

***

### Scan the Lot Code Without the Prefix

* Return to the Physical Vs Actual Stock Document Wise Entry window.
* Scan or enter the lot code without the defined prefix.
* As you can see, the system displays the error message:

> **"Invalid Item Code"**

<figure><img src="https://4031188996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXMVkjt8zqHBQX1c9QvFS%2Fuploads%2F6kBtA7yoBPYyzQKtBXrs%2FInvalid%20Prompt.png?alt=media&#x26;token=8fccfd85-713c-4f87-862f-888c6481b1d3" alt=""><figcaption></figcaption></figure>

* This happens because the scanned lot code does not include the configured prefix.

***

### Scan the Lot Code With the Prefix

* Now, scan or enter the same lot code along with the defined prefix.

<figure><img src="https://4031188996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXMVkjt8zqHBQX1c9QvFS%2Fuploads%2F63fZih8uID6oofu1Dp1L%2FEnter%20Barcode.png?alt=media&#x26;token=dde8d869-c9e5-42fa-be64-b2d67ae191b8" alt=""><figcaption></figcaption></figure>

* As you can see, the system successfully identifies the item. The system checks the prefix (capital or small letters both work), removes it, and then looks up the rest of the code.
* The item is scanned successfully, and the physical stock is updated.

<figure><img src="https://4031188996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXMVkjt8zqHBQX1c9QvFS%2Fuploads%2FojlcCvROcEQogtqBE5Mb%2FVerified.png?alt=media&#x26;token=626ff108-9639-47b2-8d22-23cce79892c9" alt=""><figcaption></figcaption></figure>

***

### Objective of This Feature

* Define a prefix for the barcodes used during scanning.
* Ensure that every scanned barcode includes the configured prefix.
* Identify items successfully when the lot code is scanned with the correct prefix.
* Update physical stock through successful barcode scanning.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/inventory/physical-vs-actual-stock-doc-wise-entry/physical-vs-actual-stock-doc-wise-entry-configuration/lot-code-prefix.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
