# \_getPredictedSales

Returns sql for sales chance

### Parameters

#### daysFrom

Number of days previous to retrieve details from

#### daysTo

Number of days ahead to retrieve details from

#### customer\_id

The customer id

#### notes

Notes for the Quote you wish to retrieve sales chance for.

#### status

Status of the Quote you wish to retrieve sales chance for.

#### user\_id

User Id assigned to the Quote you wish to retrieve sales chance for.

### Example

```
FM_api('Quotes_getPredictedSales', ['daysFrom' => '-353', 'daysTo' => '7', 'customer_id' => '6', 'notes' => '', 'status' => '', 'user_id' => ''])
```

#### On Success

```
""select sum(total_net) as total_net, sum(profit) as profit, sale_chance from user82878_quotes where cdate>=date_add(date(now()), interval 0 day) and date(cdate)<=date_add(date(now()), interval 0 day) and customer_id=6 and status=0 group by sale_chance""
```


---

# 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://docs.fieldmotion.com/fieldmotion-api-docs/quotes/_getpredictedsales.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.
