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

# Invoice

> Invoice

This element is used for listing and adding invoice lines.

It has a grid for the lines and some input fields for adding a new line.

## Configuration

| Setting      | Description                          |
| :----------- | :----------------------------------- |
| label        | UI label                             |
| rows.length  | Number of lines                      |
| rows.i.id    | The ID of the invoice type to change |
| rows.i.price | The new price for the invoice type   |

<Note>
  The price must be multiplied by 100.
</Note>

## Functions

### getFieldValue(String field)

| Field                | Description                              |
| :------------------- | :--------------------------------------- |
| rows                 | The number of rows in the grid           |
| row\.n.type          | The invoice type for row n               |
| row\.n.description   | The description for row n                |
| row\.n.price         | The price for row n                      |
| row\.n.quantity      | The quantity for row n                   |
| row\.n.discount      | The discount in percent for row n        |
| row\.n.discountMoney | The discount in monetary units for row n |
| row\.n.date          | The date for row n                       |

### setFieldValue(String action, Map values)

| Action     | Map keys                                                                                          | Description                                 |
| :--------- | :------------------------------------------------------------------------------------------------ | :------------------------------------------ |
| add        | id<br />type<br />description<br />price<br />quantity<br />discount<br />discountMoney<br />date | Adds a line of values to the grid           |
| addCurrent |                                                                                                   | Adds the current line to the grid           |
| default    | default                                                                                           | Sets the default invoice type to show by ID |


## Related topics

- [invoice table](/en/database/tables/invoice.md)
- [InvoiceEntry](/en/automation/crmscript/reference/CRMScript.Native.InvoiceEntry.md)
- [invoice_entry table](/en/database/tables/invoice-entry.md)
- [invoice_sum table](/en/database/tables/invoice-sum.md)
- [invoice_type table](/en/database/tables/invoice-type.md)
- [Void](/en/automation/crmscript/reference/CRMScript.Global.Void.md)
- [Namespace CRMScript.Native](/en/automation/crmscript/reference/CRMScript.Native.md)
