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

# Italy AdE ticket v1.x

Key: `it-ticket-v1`

## Sources

* [Italian AdE Cassetto Fiscale](https://www.agenziaentrate.gov.it/portale/schede/comunicazioni/fatture-e-corrispettivi)
* [Italian AdE Fattura e Corrispettivi](https://www.agenziaentrate.gov.it/portale/schede/comunicazioni/fatture-e-corrispettivi)

## Correction Definitions

Auto-generation of corrective invoices or credit and debit notes is
supported.

### Invoice Types

The types of invoices that can be created with a preceding definition:

* `corrective`

### Stamp Keys

Stamp keys from the previous invoice that need to be referenced:

* `ade-ref`

## Extensions

### Exemption Code

<Accordion title="it-ticket-exempt">
  | Code | Name                                     |
  | ---- | ---------------------------------------- |
  | `N1` | Excluded pursuant to Art. 15, DPR 633/72 |
  | `N2` | Not subject                              |
  | `N3` | Not taxable                              |
  | `N4` | Exempt                                   |
  | `N5` | Margin regime / VAT not exposed          |
  | `N6` | Reverse charge                           |
</Accordion>

### AdE CF Product Key

Product keys are used by AdE CF to differentiate between goods
and services.

<Accordion title="it-ticket-product">
  | Code       | Name                  |
  | ---------- | --------------------- |
  | `goods`    | Delivery of goods     |
  | `services` | Provision of services |
</Accordion>

### AdE Lottery Code

Lottery key is used to identify the lottery number (Codice lotteria).
This lottery code is provided by the customer at the time of purchase.
It is used to identify the customer in the lottery system provided by the Agenzia delle Entrate.

<Accordion title="it-ticket-lottery">
  Pattern: `^[A-Z0-9]{8}$`
</Accordion>

### AdE Line Reference

Reference code provided by the AdE to be able to identify the specific line in credit notes.

<Accordion title="it-ticket-line-ref" />

## Validation Rules

<AccordionGroup>
  <Accordion title="bill.Invoice">
    | Field                  | Test                                                                                                        | Validation Code / Message                                                                             |
    | ---------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
    | <small>Invoice</small> | <ul class="gobl-test"><li>Can convert to \[EUR]</li></ul>                                                   | `GOBL-IT-TICKET-BILL-INVOICE-08`<br />Invoice must be in EUR or provide exchange rate for conversion  |
    | `tax`                  | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                                       | `GOBL-IT-TICKET-BILL-INVOICE-01`<br />Tax is required                                                 |
    | `tax.prices_include`   | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                                       | `GOBL-IT-TICKET-BILL-INVOICE-02`<br />Prices\_include is required                                     |
    | `tax.prices_include`   | <ul class="gobl-test"><li>One of \[VAT]</li></ul>                                                           | `GOBL-IT-TICKET-BILL-INVOICE-03`<br />Prices\_include must be VAT                                     |
    | `supplier.tax_id`      | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                                       | `GOBL-IT-TICKET-BILL-INVOICE-04`<br />Supplier tax ID is required                                     |
    | `preceding`            | <ul class="gobl-test"><li>Invoice type in \[corrective]</li><li class="gobl-test-present">Present</li></ul> | `GOBL-IT-TICKET-BILL-INVOICE-05`<br />Preceding documents are required for corrective invoices        |
    | `lines[*]`             | <ul class="gobl-test"><li>Line has tax category VAT</li></ul>                                               | `GOBL-IT-TICKET-BILL-INVOICE-06`<br />Line taxes must include VAT category                            |
    | `lines[*].ext`         | <ul class="gobl-test"><li>Invoice type in \[corrective]</li><li>Ext require \[it-ticket-line-ref]</li></ul> | `GOBL-IT-TICKET-BILL-INVOICE-07`<br />Corrective invoice lines require 'it-ticket-line-ref' extension |
  </Accordion>

  <Accordion title="tax.Combo">
    | Field                                                                  | Test                                                                                            | Validation Code / Message                                                                 |
    | ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
    | `ext`                                                                  | <ul class="gobl-test"><li>VAT without percent</li><li>Ext require \[it-ticket-exempt]</li></ul> | `GOBL-IT-TICKET-TAX-COMBO-01`<br />Exempt VAT combo requires 'it-ticket-exempt' extension |
    | `percent`<br /><small class="gobl-field-calculated">Calculated</small> | <ul class="gobl-test"><li>Is VAT</li><li>Valid percentage</li></ul>                             | `GOBL-IT-TICKET-TAX-COMBO-02`<br />Must be a valid value                                  |
  </Accordion>
</AccordionGroup>
