# Templates (viewing, creating, editing, and applying)

#### Viewing available templates

To view the available service templates for working with invoices, you need to go from the main menu to "Invoice" ➡️ "Templates". This will open a page with the following content:

<figure><img src="/files/d4MitmaP4d2cRMHtlPWa" alt=""><figcaption></figcaption></figure>

On the left side, there is a list of templates with a search function; on the right side, there is an area to view the selected template.

Example of a selected template:

<figure><img src="/files/bD9bsdS58f0EQIklT1jD" alt=""><figcaption></figcaption></figure>

In the image:

1 — Template name.

2 — Button to rename the template.

3 — Button to delete the template.

4 — List of services in table format.

#### Creating a template

To create a new template, you need to open the invoice creation page or the invoice editing page. Then, select the services as shown in the section "Creating a new invoice" and click the "Create New Template" button. This will bring up a window to enter the template name:

<figure><img src="/files/MAcgFcmPlpUvP0dUJm4b" alt=""><figcaption></figcaption></figure>

By entering the template name and clicking the "Create Template" button, a new template will be created.

#### Editing templates

To edit the template name, you need to go to the page displaying all templates and click the "Edit" button (Viewing available templates).

At this stage of application development, it is not possible to modify the list of services in the template.

#### Applying templates

To apply a template, you need to open the invoice creation or editing page and click the "Load Template" button:

<figure><img src="/files/FiCXso7JDuBA4gVb3KMY" alt=""><figcaption></figcaption></figure>

Then, a window with a list of available templates will appear. Select the desired template and click the "Load Template" button:

<figure><img src="/files/JauiShOUzrto3pw88Red" alt=""><figcaption></figcaption></figure>

After that, the window with the list will close, and on the invoice management page, the selected services will be added to the list of chosen services as specified in the template. Each time a template is loaded, it is added to the already selected services, and if a service is already selected, the quantities of that service are summed.


---

# 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://maxbasev.gitbook.io/santa-maria-dashboard/en/menu/invoices-section/templates.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.
