# BR-AE-04 L’onere in inversione contabile richiede gli identificativi fiscali di venditore e acquirente

Una fattura con un onere a livello di documento (BG-21) il cui codice categoria IVA (BT-102) è "Inversione contabile" (AE) deve contenere l’identificativo IVA del venditore (BT-31), l’identificativo di registrazione fiscale del venditore (BT-32) e/o l’identificativo IVA del rappresentante fiscale del venditore (BT-63) e l’identificativo IVA dell’acquirente (BT-48) e/o l’identificativo di registrazione legale dell’acquirente (BT-47).

## Descrizione del problema

> **ERRORE**: Regola EN 16931 sulla categoria IVA

## Contesto e significato

Questa regola è l’equivalente di BR-AE-03 per gli oneri a livello di documento: poiché l’inversione contabile trasferisce l’IVA all’acquirente, entrambe le parti devono essere identificate fiscalmente quando un onere ha la categoria AE. In pratica l’errore si verifica quando un onere di trasporto o imballaggio è codificato AE ma l’identificativo dell’acquirente manca nell’XML.

## Soluzione

Inserisci un identificativo fiscale del venditore (BT-31, BT-32 o BT-63) e un identificativo dell’acquirente (BT-48 o BT-47) sulla fattura che riporta l’onere in inversione contabile.

- [Valida XML](/it/xrechnung-validator?source=resource&rule=BR-AE-04)
- [Converti fattura](/it/pdf-to-xrechnung?source=resource&rule=BR-AE-04)

## Esempi validi

- Onere AE con venditore BT-31 = DE123456789 e acquirente BT-48 = FR32123456789

## Esempi non validi

- Onere AE con identificativo IVA del venditore ma senza identificativo dell’acquirente (BT-48/BT-47)

## Esempi di codice

### XML valido
```
<cac:AllowanceCharge>
  <cbc:ChargeIndicator>true</cbc:ChargeIndicator>
  <cbc:Amount currencyID="EUR">30.00</cbc:Amount>
  <cac:TaxCategory>
    <cbc:ID>AE</cbc:ID>
    <cbc:Percent>0</cbc:Percent>
    <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
  </cac:TaxCategory>
</cac:AllowanceCharge>
<cac:AccountingSupplierParty>
  <cac:Party>
    <cac:PartyTaxScheme>
      <cbc:CompanyID>DE123456789</cbc:CompanyID>
      <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
    </cac:PartyTaxScheme>
  </cac:Party>
</cac:AccountingSupplierParty>
<cac:AccountingCustomerParty>
  <cac:Party>
    <cac:PartyTaxScheme>
      <cbc:CompanyID>NL123456789B01</cbc:CompanyID>
      <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
    </cac:PartyTaxScheme>
  </cac:Party>
</cac:AccountingCustomerParty>
```

### XML non valido
```
<cac:AllowanceCharge>
  <cbc:ChargeIndicator>true</cbc:ChargeIndicator>
  <cbc:Amount currencyID="EUR">30.00</cbc:Amount>
  <cac:TaxCategory>
    <cbc:ID>AE</cbc:ID>
    <cbc:Percent>0</cbc:Percent>
    <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
  </cac:TaxCategory>
</cac:AllowanceCharge>
<cac:AccountingSupplierParty>
  <cac:Party>
    <cac:PartyTaxScheme>
      <cbc:CompanyID>DE123456789</cbc:CompanyID>
      <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
    </cac:PartyTaxScheme>
  </cac:Party>
</cac:AccountingSupplierParty>
<cac:AccountingCustomerParty>
  <cac:Party></cac:Party>
</cac:AccountingCustomerParty>
```

## Campi interessati

- [BT-102 Codice categoria IVA dell’onere a livello di documento](/resources/xrechnung/bt-102-document-level-charge-vat-category-code)
- [BT-31 Identificativo IVA del venditore](/resources/xrechnung/bt-31-seller-vat-identifier)
- [BT-32 Identificativo di registrazione fiscale del venditore](/resources/xrechnung/bt-32-seller-tax-registration-identifier)
- [BT-63 Identificativo IVA del rappresentante fiscale del venditore](/resources/xrechnung/bt-63-seller-tax-representative-vat-identifier)
- [BT-48 Identificativo IVA dell’acquirente](/resources/xrechnung/bt-48-buyer-vat-identifier)
- [BT-47 Identificativo di registrazione legale dell’acquirente](/resources/xrechnung/bt-47-buyer-legal-registration-identifier)

## Regole correlate

- [BR-AE-01](/resources/kosit-validator-errors/br-ae-01-reverse-charge-vat-breakdown-required)
- [BR-AE-03](/resources/kosit-validator-errors/br-ae-03-reverse-charge-allowance-seller-buyer-vat-id)
- [BR-AE-02](/resources/kosit-validator-errors/br-ae-02-reverse-charge-seller-vat-id-required)

## Strumenti di validazione

- [Validatore KoSIT ufficiale](https://github.com/itplr-kosit/validator): Esegui il validatore ufficiale KoSIT con la configurazione XRechnung per controllare le regole EN 16931 e XRechnung.
- [Converti PDF in XRechnung](/pdf-to-xrechnung): Individua gli errori di validazione durante la conversione e verifica ogni correzione.

## Risorse correlate

- [Specifiche ufficiali](https://docs.peppol.eu/poacc/billing/3.0/rules/ubl-tc434/)
- [Test suite](https://github.com/itplr-kosit/xrechnung-testsuite)
- [Tutti gli errori di validazione](/resources/kosit-validator-errors): Panoramica delle regole di validazione EN 16931, XRechnung e Peppol spiegate qui.
