# Order Quantity Formula

**YouTube:** [How to Set Up Formula- Based Order Quantity in Purchase Orders](https://www.youtube.com/watch?v=2orO56B-vbk)?

## How to Set Up Formula- Based Order Quantity in Purchase Orders?

This tutorial explains how to **automatically calculate and add item quantities in a Purchase Order using an Order Quantity Formula** in Logic ERP. This feature helps in making smarter purchasing decisions based on **sales and stock data**.

***

### **Objective of This Feature**

* Automate **purchase quantity calculation**
* Base ordering on **sales performance and stock levels**
* Reduce manual calculations and errors
* Improve **inventory planning and control**

***

### **Define Order Quantity Formula**

* Open **Configuration Window**
* Go to **Other Settings**
* Click on **Order Quantity Formula**

<figure><img src="/files/8gU5xF6LnEZ0DjWRDAjQ" alt=""><figcaption></figcaption></figure>

**Create Formula**

* Use **Field List Option** to view available fields

<figure><img src="/files/8l0bHbYIRGFoKvy4cDXo" alt=""><figcaption></figcaption></figure>

* Define formula based on:
  * Sales Quantity
  * Closing Stock
  * Other relevant parameters

<figure><img src="/files/0JvH096aPrLCvlNN0udp" alt=""><figcaption></figcaption></figure>

* Click **OK** after defining the formula

***

### **Review Stock & Sales Data**

* Generate **Stock Query Report**

**Analyze Key Data**

* Review:
  * **Sales Quantity**
  * **Closing Stock**

<figure><img src="/files/BNYX9b5wLh6Px6751Cp2" alt=""><figcaption></figcaption></figure>

**Purpose**

* Whether ordering is required
* Approximate quantity needed

***

### **Create Purchase Order**

* Open **Purchase Order Window**
* Enter **Supplier Name**

**Go to Item Details**

* Navigate to **Item Details Section**

**Add Items Using Formula**

* Click on **Add Items on Formula**
* Search and choose the item to be ordered

<figure><img src="/files/JUzDFy0VT1WWDMIvkQP1" alt=""><figcaption></figcaption></figure>

**Define Parameters**

* Enter:
  * **Date Range** (for sales calculation)
  * **Godowns** (for stock consideration)

<figure><img src="/files/Dt5213wfBrypfpXPRm7r" alt=""><figcaption></figcaption></figure>

***

### **Automatic Quantity Calculation**

* Based on the defined formula:
  * System calculates **required order quantity**

<figure><img src="/files/SAAZn64EVmdavA2IxsWY" alt=""><figcaption></figcaption></figure>

**Result**

* Displays:
  * **Auto-calculated Order Quantity**

***

### **Key Benefits**

* Eliminates manual quantity calculation
* Ensures **accurate and data-driven ordering**
* Prevents overstocking and stock shortages
* Enhances inventory efficiency

***

### **Best Practice Tips**

* Define formula carefully based on business logic
* Always review stock reports before ordering
* Use appropriate date ranges for accurate results

***

### **Final Outcome**

* Purchase quantities are **automatically calculated**
* Orders are based on **actual sales and stock data**
* Inventory management becomes **smarter and more efficient**
* Decision-making becomes **data-driven and reliable**


---

# Agent Instructions: 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:

```
GET https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/order-processing/purchase-order/po-configuration/order-quantity-formula.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
