> 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/order-processing/sale-order/so-configuration/sale-order-quantity-limit.md).

# Sale Order Quantity Limit

**YouTube:** [How to Configure Quantity Limit Validation in Sales Orders?](https://youtu.be/hmeot9pnfyE)

## How to Configure Quantity Limit Validation in Sales Orders?

In this tutorial, we will learn how to configure **"SO Quantity Limit"** in Logic ERP to control the maximum quantity that can be entered for an item in a Sale Order. We will explore each available quantity validation method and understand how the system restricts entries based on the configured limit.

***

### Objective of This Feature

* Control the maximum quantity allowed in Sale Orders
* Prevent orders beyond available or permissible stock
* Consider pending Purchase Orders and Sale Orders
* Factor in maximum order levels and goods in transit
* Create customized quantity validation using expressions
* Improve inventory and order management

***

### Access to the Sale Order Configuration

* Open the **Sale Order Configuration** window.
* Navigate to the **Other Options** section.
* Locate the option labeled as:

> **"SO Quantity Limit"**

<figure><img src="https://4031188996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXMVkjt8zqHBQX1c9QvFS%2Fuploads%2Fi0B0B9B7zwGLBYq75WSd%2FCNF.png?alt=media&amp;token=3fcd9631-5242-4dc1-af6d-cefbd3cc10aa" alt=""><figcaption></figcaption></figure>

This option provides multiple quantity validation methods.

* Closing Stock
* C.Stock+Pend PO
* Max Order Level -(C.Stock + Pend SO + GIT)
* C.Stock-Pend SO
* Use Expression

***

### Option 1: Closing Stock

* Select **Closing Stock** as the Sale Order Quantity Limit.
* Save the configuration.
* Initiate a **New Sale Order**.
* Transact the required item.

**Example**

* Suppose the available closing stock is **5 units**.
* The system will allow a maximum of **5 units** to be entered in the Sale Order.

<figure><img src="https://4031188996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXMVkjt8zqHBQX1c9QvFS%2Fuploads%2F69p2fo0jlWUWJn7o7nBK%2FOption%201.png?alt=media&amp;token=17056f62-5f0a-4862-a690-3bbc16ffaa04" alt=""><figcaption></figcaption></figure>

**Result**

* If you enter a quantity greater than 5, the software restricts the transaction and displays an error message indicating that the entered quantity exceeds the available stock.
* If you enter **5 units or less**, the system allows you to continue.

***

### Option 2: Closing Stock + Pending Purchase Order Quantity

* Return to **Sale Order Configuration**.
* Set **SO Quantity Limit** to **Closing Stock + Pending Purchase Order Quantity**.
* Save the configuration.

**Example**

Before creating the Sale Order:

* Closing Stock: **5 units**
* Pending Purchase Order: **10 units**
* Total Permissible Quantity: **15 units**

You can verify the pending Purchase Order quantity through the **Pending Purchase Order Report**.

<figure><img src="https://4031188996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXMVkjt8zqHBQX1c9QvFS%2Fuploads%2FQqvCxWJNgRZSnwc86d4d%2FPending%20Qty.png?alt=media&amp;token=017fff5b-2666-4088-86c7-6e3b4333caf3" alt=""><figcaption></figcaption></figure>

#### Let’s review the implementation and evaluate the results.

* Return to the Sales Order screen.
* Enter **18** in the **Quantity** field to check the reflection.
  * If you try to enter more than **15 Units**, the software restricts the transaction and displays an error message.

> "Cannot allow Quantity more than available (Stock In Hand + Pending Purchase Order Quantity)....."

<figure><img src="https://4031188996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXMVkjt8zqHBQX1c9QvFS%2Fuploads%2FeWvfmyofqJzCSkNzpyyi%2FError%20-%20Pd%20PO.png?alt=media&amp;token=8fcf0689-5be7-4d12-96d6-0a3a5657646a" alt=""><figcaption></figcaption></figure>

* If you enter **15 units or less**, the system allows you to continue.

***

### Option 3: Max Order Level -(C.Stock + Pend SO + GIT)

* Return to **Sale Order Configuration**.
* Set **SO Quantity Limit** to **(Max Order Level -(C.Stock + Pend SO + GIT).**
* Save the configuration.
* Initiate a new Sale Order.
* Select the required item.

<figure><img src="https://4031188996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXMVkjt8zqHBQX1c9QvFS%2Fuploads%2FpuyPX374uVm1GuPMCIAt%2FNew%20SO.png?alt=media&amp;token=639431b2-7a0c-4df9-aa71-1ac692f0cdea" alt=""><figcaption></figcaption></figure>

**Verify Maximum Order Level**

* Open the **Item Setup** window.
* Navigate to **Pack Details**.
* Open the **Order Levels** tab.
* Review the **Max Order Level** defined for the item.

<figure><img src="https://4031188996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXMVkjt8zqHBQX1c9QvFS%2Fuploads%2FWHl1ceFlurlhVvx1qTLE%2FOrder%20Level.png?alt=media&amp;token=05e63522-6ec7-4df2-be0a-24c8730c500e" alt=""><figcaption></figcaption></figure>

**The system considers:**

* Maximum Order Level: **50**
* Closing Stock: **5**
* Pending Sale Order Quantity: **10**
* Goods in Transit Quantity: **0**

**Note:**

* **Goods in Transit** refers to stock transferred to another branch that has not yet been received and verified by the destination branch.

**Result**

* The software calculates the permissible quantity based on these values. If the entered quantity exceeds the calculated limit, the system restricts the transaction and displays an appropriate error message.

<figure><img src="https://4031188996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXMVkjt8zqHBQX1c9QvFS%2Fuploads%2FawoUjRaxEUndHRvmWXEs%2FError%20Alert.png?alt=media&amp;token=8207d0e4-3f8b-4e9c-b1bb-5c073a4db4be" alt=""><figcaption></figcaption></figure>

***

### Option 4: Closing Stock − Pending Sale Order Quantity

* Return to the configuration window.
* Set **SO Quantity Limit** to (Closing Stock − Pending Sale Order Quantity).
* Save the configuration.
* Initiate a new Sale Order.
* Transact the required item.

**Result**

The system displays both:

* **Stock in Hand: 5**
* **Pending Sale Order Quantity: 10**
* The permissible quantity is calculated using the configured formula.
* If you enter more than **5 units**, the software will display an **error prompt**.

<figure><img src="https://4031188996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXMVkjt8zqHBQX1c9QvFS%2Fuploads%2F811o6rYU3geRevKYBadz%2FError%201.png?alt=media&amp;token=31c4c8b7-eb4f-419f-a896-ecf8d07e841a" alt=""><figcaption></figcaption></figure>

**Result**

* A quantity of **5 units or less** can be entered successfully.

***

### Option 5: Use Expression

* Select **Use Expression** from the **SO Quantity Limit** dropdown.
* Click **Define Expression**.
* Create a customized quantity validation formula using the available parameters.

<figure><img src="https://4031188996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXMVkjt8zqHBQX1c9QvFS%2Fuploads%2Fl6ZLOtbAxLehOqSzfY7t%2FeXPRESSION.png?alt=media&amp;token=46f1e1ae-9242-45ad-9164-55a63378d0ba" alt=""><figcaption></figcaption></figure>

* Save the expression.
* Save the configuration.

**Result**

* During Sale Order entry, the software evaluates the entered quantity according to the defined expression.

**Example**

If the expression calculates the maximum permissible quantity as **100 units**:

* Quantity **≤ 5** → Entry allowed
* Quantity **> 5** → Entry restricted

<figure><img src="https://4031188996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXMVkjt8zqHBQX1c9QvFS%2Fuploads%2FcGHk9BlbNNJtMCBz4LC8%2FEror%201.png?alt=media&amp;token=e5c353bc-98a7-48bb-913a-3c4aaa2369ef" alt=""><figcaption></figcaption></figure>

The software displays an error message when the entered quantity exceeds the calculated limit.

***

### Key Benefits

* **Inventory Control:** Prevents Sale Orders from exceeding permissible quantities.
* **Automated Validation:** Automatically calculates the allowable quantity.
* **Better Stock Planning:** Considers current stock, pending orders, and incoming inventory.
* **Flexible Configuration:** Provides multiple predefined validation methods.
* **Custom Validation:** Allows users to create their own quantity limit through expressions.
* **Error Prevention:** Helps avoid excessive or unrealistic Sale Order quantities.

***

### Important Note

The permissible Sale Order quantity depends on the **SO Quantity Limit** option selected in the configuration. When **Use Expression** is selected, the limit is determined according to the customized expression defined by the user.

***

### Final Outcome

After configuring **SO Quantity Limit**, Logic ERP automatically validates the quantity entered during Sale Order creation. Whether the limit is based on **Closing Stock, Pending Purchase Orders, Maximum Order Level, Pending Sale Orders, Goods in Transit, or a Custom Expression**, the software restricts quantities that exceed the configured permissible limit.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/order-processing/sale-order/so-configuration/sale-order-quantity-limit.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
