> For the complete documentation index, see [llms.txt](https://kb.theloops.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kb.theloops.io/agentstudio/skills-library/sales-and-customer-orders/detect-quotation-margin-risk.md). Agents can also search and read this documentation through its [MCP server](https://kb.theloops.io/~gitbook/mcp).

# Detect Quotation Margin Risk

Reads one sales quotation line and quotation totals to flag margin risk from price and discounts. Read-only.

| Business area             | Action type |
| ------------------------- | ----------- |
| Sales and Customer Orders | Read-only   |

## Overview

Sales quotations in IFS Cloud carry a net price, several discount layers (line discount, group/quotation discount, additional header discount) and an estimated unit cost per line. A line can be quoted below cost or with a thin margin without anyone noticing until the order is invoiced.

IFS Cloud reads quotation lines and amounts for margin risk analysis.

## How it works

{% stepper %}
{% step %}
Get Quotation Line Pricing.
{% endstep %}

{% step %}
Get Quotation Header Context.
{% endstep %}

{% step %}
Compute contribution = TotalBase - Cost \* RevisedQtyDue (label computed).
{% endstep %}

{% step %}
Get Quotation Margin Totals.
{% endstep %}

{% step %}
Optionally List Quotation Lines For Comparison.
{% endstep %}
{% endstepper %}

## Key capabilities

* Read one quotation line's price, discount stack, cost and net amounts from OrderQuotationLineSet.
* Recompute line contribution and margin % using the IFS formula (net base amount minus Cost x RevisedQtyDue).
* Read quotation-level totals (TotalContributionAmount, TotalCostAmount, TotalContributionPercent) via the QuatationAmountRef navigation.
* Compare the line with the other lines of the same quotation to spot outliers.
* Detect special pricing conditions: free of charge, frozen price, price source, missing cost.
* Classify risk (Critical / High / Medium / Low / Unknown) with configurable thresholds.
* Return evidence, verdict, blockers and the next permissible business action.
* Respect the caller's IFS permissions, never write.

## Requirements

The following IFS Cloud components and projections must be available, with permission sets that grant access to each projection.

| Component | Projection                  |
| --------- | --------------------------- |
| ORDER     | SalesQuotationLinesHandling |
| ORDER     | SalesQuotationHandling      |

## Version compatibility

| Projection                  | Supported IFS Cloud releases |
| --------------------------- | ---------------------------- |
| SalesQuotationLinesHandling | 24R2, 25R1, 25R2, 26R1, 26R2 |
| SalesQuotationHandling      | 24R2, 25R1, 25R2, 26R1, 26R2 |

## Known limitations

* Read-only: does not create, update, or delete IFS Cloud data.
