> 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/setups/configurations/purchase-voucher-configurations/other-settings-1/calculate-s.r.-through-formula.md).

# Calculate S.R. Through Formula

**YouTube:** [How to Calculate Sale Rate Using a Formula in Purchase ?](https://www.youtube.com/watch?v=y5pJxFb7CIE)

## How to Calculate Sale Rate Using a Formula in Purchase?

In this tutorial, we will demonstrate how Logic ERP can automatically calculate the sale rate based on a predefined formula within the **purchase voucher**.

***

### **Step-by-Step Guide:**

* Navigate to **Purchase Configuration**.
* Locate and enable the option: **“Calculate S.R. Through Formula.”**

<figure><img src="https://4031188996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXMVkjt8zqHBQX1c9QvFS%2Fuploads%2F7RsF0eprEewYBAv0RGgk%2FConfiguration.png?alt=media&amp;token=55457929-fe7c-4248-9b3d-1530cfccb609" alt=""><figcaption><p>Let's keep this feature enabled to observe its Impact on Billing.</p></figcaption></figure>

* **Define the Sale Rate Formula**:
  * Navigate to the **Define Rate Formulas** Other Settings - 1.
  * Specify the **Expense Name** relevant to the calculation.
  * Set the **Base Rate**, usually the **Purchase Rate**.
  * Optionally, define a **default value** for any expense that needs to be **added or subtracted** from the base rate.

<figure><img src="https://4031188996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXMVkjt8zqHBQX1c9QvFS%2Fuploads%2FjZM3wW2o9ktFo88LbPm1%2FDefine%20Rate%20Formula.png?alt=media&amp;token=657a154f-376e-4e4c-abcb-a576adbe0d43" alt=""><figcaption></figcaption></figure>

* **Use Related Fields in Formula**:
  * You can include variables such as margin percentage, additional costs, or discounts.
  * **Example**: If the Purchase Rate is ₹100 and a 20% margin is added, the **Sale Rate will be ₹120**.

***

### **Create a Purchase Voucher:**

* Enter the **transaction details** and input the **basic purchase rate** for each item.
* The **Sale Rate** will now be **automatically calculated** based on your defined formula.

<figure><img src="https://4031188996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXMVkjt8zqHBQX1c9QvFS%2Fuploads%2FcULOjo5FNtR6ISH7ZYPC%2FSale%20Rate.png?alt=media&amp;token=f9be59a5-7a05-49b8-be8d-52b895a738f3" alt=""><figcaption></figcaption></figure>

***

### **Conclusion**:

This feature helps **automate pricing**, eliminate manual errors, and ensures consistency in sale rates across transactions in Logic ERP.


---

# 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/setups/configurations/purchase-voucher-configurations/other-settings-1/calculate-s.r.-through-formula.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.
