# NPV Module

## Overview

**NPV** (Net Present Value) is a tool that lets a salesman build and customize a payment plan for a client before reserving a unit. The salesman adjusts the installment schedule with the client in real time — once they agree and save the plan, it flows directly into the Unit Sales Pipeline and is used as the unit's payment plan from the Hold step onwards.

---

## Why NPV Exists

When a client buys a unit, the nominal total of all payments may equal the unit price — but payments that come in late are worth less in today's money. The NPV tool calculates the **true present value** of a payment plan and enforces company financial rules to ensure every plan is profitable, not just on paper.

> 💡 **Example:** A client buys a 1,000,000 EGP unit on a 10-year plan. Total payments = 1,000,000 EGP. But because payments arrive over many years, their actual value today may be only 850,000 EGP — a hidden loss of 150,000 EGP. The NPV tool surfaces this before the plan is approved.

---

## How It Fits into the Sales Flow

```
Unit View → Open Unit Details → Select Payment Plan → NPV Editor
→ Adjust installments with client → Validate → Save Plan
→ Plan flows into Unit Sales Pipeline (Hold step)

```

The NPV editor is accessed from inside the **Unit Details** screen. The salesman works through the payment plan with the client, and only after saving does the unit enter the pipeline.

---

## The 4 Validation Rules

Every plan is automatically checked against 4 rules before it can be saved:

<table id="bkmrk-%23-rule-requirement-1"><thead><tr><th>\#</th><th>Rule</th><th>Requirement</th></tr></thead><tbody><tr><td>**1**</td><td>Total Check</td><td>All payments must add up exactly to the unit price.</td></tr><tr><td>**2**</td><td>Pre-Delivery Check</td><td>Payments collected before the delivery date must be at least the configured Delivery Percentage Limit %.</td></tr><tr><td>**3**</td><td>Minimum Down Payment Check</td><td>The down payment must be at or above the Minimum Down Payment Percentage % set on the payment plan.</td></tr><tr><td>**4**</td><td>Minimum Installment Check</td><td>Each installment must be at or above the configured minimum installment % of the unit price.</td></tr><tr><td>**5**</td><td>XNPV Check</td><td>The true present value of all payments must be at or above the unit price minus the maximum allowed discount.</td></tr></tbody></table>

If a check fails:

- **Users without override permission** → Plan is rejected and cannot be saved.
- **Users with override permission** → A warning is shown with the exact loss amount. They can save anyway — but this only overrides the **XNPV check**. The other 3 checks (Total, Pre-Delivery, Minimum Installment) must still pass regardless.

---

## Module Pages

<table id="bkmrk-page-description-npv"><thead><tr><th>Page</th><th>Description</th></tr></thead><tbody><tr><td>**NPV Configuration**</td><td>Settings at the project and unit level that control NPV rules.</td></tr><tr><td>**NPV Editor**</td><td>How to build, edit, and validate a payment plan.</td></tr><tr><td>**NPV Comparison**</td><td>How the system compares the original vs. edited plan and shows the verdict.</td></tr><tr><td>**Saved NPV Plans**</td><td>How to view, edit, or delete a saved NPV plan.</td></tr></tbody></table>