> ## Documentation Index
> Fetch the complete documentation index at: https://zenskar.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Percent discount

## Configuration fields

| Field   | Description                                      | Required | Default |
| ------- | ------------------------------------------------ | -------- | ------- |
| `value` | Percentage to discount (e.g., 20 = 20%)          | Yes      | N/A     |
| `label` | Display label on invoice                         | No       | N/A     |
| `order` | Execution order when stacking multiple discounts | No       | N/A     |

## Validation rules

| Rule                      | Valid | Invalid |
| ------------------------- | ----- | ------- |
| `value` between 0 and 100 | 20    | −5, 150 |

## Core calculation

1. Start from the gross bill amount (after quantity discounts, the pricing model, and commitments), then subtract any fixed discount that runs ahead of it in the stack, per the default order.
2. Apply the percentage: discount = value% × amount.
3. Subtract: invoice\_amount = amount − discount, floored at \$0.

## Order of operations (full calculation stack)

```
1. Raw usage
2. Quantity discount: adjusted quantity
3. Minimum quantity: effective quantity
4. Pricing model: gross amount
5. Minimum spend: max(gross, min spend)
6. Fixed discount: amount minus fixed (floored at $0)
7. Percent discount: amount × (1 − value%)
8. Final total
```

## Natural ordering when stacking discount types

| Step | Discount type     | Reduces        |
| ---- | ----------------- | -------------- |
| 1    | Quantity discount | Units          |
| 2    | Fixed discount    | Dollars (flat) |
| 3    | Percent discount  | Remainder (%)  |

Multiple percent discounts compound rather than add: 20% + 10% = 1 − (0.8 × 0.9) = 28%, not 30%. The order between multiple percent discounts never changes the result, since compounding is commutative.

## Invoice presentation

The discount appears as a line item on the invoice using the configured label. Each period produces a breakdown record tracking: amounts before and after, discount applied, and percentage.

## Risks and edge cases

| Scenario      | Handling                                                    |
| ------------- | ----------------------------------------------------------- |
| 100% discount | Customer pays \$0 indefinitely; confirm this is intentional |

## Glossary

| Term             | Definition                                                                                                |
| ---------------- | --------------------------------------------------------------------------------------------------------- |
| Percent discount | Percentage deduction from gross bill amount; stateless                                                    |
| Gross amount     | Bill total after quantity discount, pricing model, and commitments, and before percent or fixed discounts |
| Compounding      | Two sequential percent discounts multiply: 20% + 10% = 28%, not 30%                                       |

## Out of scope / deferred

| Feature                    | Description                                            |
| -------------------------- | ------------------------------------------------------ |
| Cross-product discounts    | A shared percent discount across multiple products     |
| Discount validity / expiry | Independent start and end dates on the discount itself |
