> ## 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_entry table

> This table contain all invoices, connected to a message

## invoice\_entry Table (360)

This table contain all invoices, connected to a message

## Fields

| Name            | Description                                                                                                                             | Type                                   | Nullable |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | :------: |
| id              | Primary key                                                                                                                             | PK                                     |    No    |
| message\_id     | The message.id this invoice entry is connected to.                                                                                      | FK [ej\_message](./ej-message.mdx)     |    No    |
| description     | A description of the invoice entry                                                                                                      | String(255)                            |    Yes   |
| type            | The type of this invoice entry                                                                                                          | FK [invoice\_type](./invoice-type.mdx) |    No    |
| quantity        | Number of units                                                                                                                         | Double                                 |    No    |
| price\_pr\_unit | Price per unit. This is copied from the invoice\_type when created so that changes to the price in the future does not affect this one. | Int                                    |    No    |
| discount        | Discount for this invoice entry                                                                                                         | Int                                    |    No    |
| date\_invoiced  | The date for the invoice entry                                                                                                          | DateTime                               |    No    |
| discount\_money | Discount for this invoice entry in money                                                                                                | Int                                    |    No    |
| ie\_sum         | The sum of the invoice entry                                                                                                            | Int                                    |    No    |

<img src="https://mintcdn.com/superofficeas/6OcOTPa_ISkjXJg4/media/loc/en/database/tables/invoice_entry.png?fit=max&auto=format&n=6OcOTPa_ISkjXJg4&q=85&s=3c05a91464e0d03bd0e68a8bf384b012" alt="invoice_entry table relationship diagram" width="714" height="59" data-path="media/loc/en/database/tables/invoice_entry.png" />

## Indexes

| Fields         | Types    | Description |
| -------------- | -------- | ----------- |
| message\_id    | FK       | Index       |
| type           | FK       | Index       |
| date\_invoiced | DateTime | Index       |

## Relationships

| Table                           | Description                                                                                  |
| ------------------------------- | -------------------------------------------------------------------------------------------- |
| [ej\_message](./ej-message)     | This table contains the messages listed under tickets.                                       |
| [invoice\_type](./invoice-type) | A invoiceable item category (a product or service) that provides default invoice line values |

## Replication Flags

* None

## Security Flags

* No access control via user's Role.


## Related topics

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