# Prompt in Billing if Lot Expiry is below

**YouTube:** [How to Restrict Sale of Lots / Batches Expiring Within a Specified Number of Days ?](https://www.youtube.com/watch?v=4azqApFTl0A)

## How to Restrict Sale of Lots / Batches Expiring Within a Specified Number of Days?

This tutorial explains how to configure a setting that prompts a warning message if an item's lot expiry falls within a specified number of days during billing.

***

### Steps to Enable Prompt in Billing:

* Navigate to the **Logic** folder on your system.
* Run **Logic Admin** to access settings.
* In the Logic Admin interface, open **Global Settings**.
* Go to the **Sales Settings 3** tab under the Sale.
* Locate and enable the option: **"Prompt in Billing if Lot Expiry is below"**
* Enter the desired number of days as the expiry threshold (e.g., 90 days).

<figure><img src="/files/xccq2QJ6pX7XLisLODcN" alt=""><figcaption><p>Let's keep this feature enable to observe its impact in Billing.</p></figcaption></figure>

* Click **Save** to apply the changes.
* After saving the settings, **restart the application** to activate the new configuration.

***

### **Implement the Functionality:**

* Open the "Billing" module and create a **New Sale Bill**.
* Add an item with an expiry date **within the defined threshold**.
* The software will:
  * Prevent the bill from being saved.
  * Display a **prompt or error message** warning about the lot's expiry.

<figure><img src="/files/9B3rRGMMyaUxviIDJvmM" alt=""><figcaption><p>A prompt or error message is displayed, warning that the item's lot expiry date falls within the defined threshold.</p></figcaption></figure>

***

This setting helps ensure that items nearing expiry are flagged before billing, reducing the risk of selling expired or soon-to-expire stock.


---

# 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/user-access/logic-global-admin/sale/sale-settings-3/prompt-in-billing-if-lot-expiry-is-below.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.
