# 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="/files/40i1oJ2KcCIpujIpTDTI" 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="/files/medRpMnVkLOEd64CbKae" 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="/files/PdZTriCaIO68bbWh4QTg" 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: 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/setups/configurations/purchase-voucher-configurations/other-settings-1/calculate-s.r.-through-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.
