> ## 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.

# Romania RO e-Factura v1.x

Key: `ro-efactura-v1`

Module: [github.com/invopop/gobl.ro.anaf](https://github.com/invopop/gobl.ro.anaf)

Support for the Romanian national e-invoicing system,
RO e-Factura, operated by ANAF. The addon applies the
national rules (BR-RO) RO\_CIUS adds to the EN 16931
semantic model: the document types ANAF files, the
ISO 3166-2:RO subdivisions and Bucharest sector codes
addresses have to carry, the VAT accounting currency,
the identifiers of the seller and the buyer, and the
length and count limits of every element.

Built on the EU EN 16931 CIUS profile, declared as a
dependency.

## Sources

* [Order MF 1366/2021 approving RO\_CIUS and the national operational rules](https://static.anaf.ro/static/10/Anaf/legislatie/OMF_1366_2021.pdf)
* [Order MF 4092/2022 amending RO\_CIUS (version 1.0.1, BR-RO table)](https://static.anaf.ro/static/10/Anaf/legislatie/OMF_4092_2022.pdf)
* [RO e-Factura technical information and schematron](https://mfinante.gov.ro/ro/web/efactura/informatii-tehnice)

## Scenarios

Scenarios attach notes and extensions to a document when its filters match.
[Read more about scenarios](https://docs.gobl.org/overview/scenarios.md).

> [accordion] bill/invoice
>
> | Tags | Type | Output |
> | - | - | - |
> | - | `standard` | `{  "ext": {    "untdid-document-type": "380"  }}` |
> | - | `credit-note` | `{  "ext": {    "untdid-document-type": "381"  }}` |
> | - | `corrective` | `{  "ext": {    "untdid-document-type": "384"  }}` |
> | `accounting` | `standard` | `{  "ext": {    "untdid-document-type": "751"  }}` |
> | `self-billed` | `standard` | `{  "ext": {    "untdid-document-type": "389"  }}` |
> | `self-billed` [custom](https://github.com/invopop/gobl.ro.anaf/blob/v0.7.0/addon/scenarios.go#L143) | - | `{  "note": {    "key": "self-billed",    "text": "Autofactură"  }}` |

## Validation Rules

Validation rules check each struct against a set of assertions and report any
failures with a unique code and message.
[Read more about validation](https://docs.gobl.org/overview/validation.md).

> [accordion] bill.Invoice
>
> | Field | Test | Validation Code / Message |
> | - | - | - |
> | Invoice | <ul><li>Invoice number has a digit</li></ul> | `GOBL-RO-EFACTURA-BILL-INVOICE-01` Invoice number (with series when set) must include at least one digit (BR-RO-010) |
> | Invoice | <ul><li>Invoice number within length</li></ul> | `GOBL-RO-EFACTURA-BILL-INVOICE-02` Invoice number (with series when set) must be no more than 200 characters long (BR-RO-L200) |
> | Invoice | <ul><li>Can convert to \[RON]</li></ul> | `GOBL-RO-EFACTURA-BILL-INVOICE-03` Invoice in a currency other than RON must provide an exchange rate to RON, so VAT can be stated in RON (BR-RO-030, BR-53) |
> | Invoice | <ul><li>Currency within two subunits</li></ul> | `GOBL-RO-EFACTURA-BILL-INVOICE-04` Invoice currency must state its amounts on no more than two decimals (BR-RO-Z2) |
> | Invoice | <ul><li>Notes within count</li></ul> | `GOBL-RO-EFACTURA-BILL-INVOICE-05` Invoice notes, with the autofactura mention the converter adds, must contain no more than 20 entries (BR-RO-A020) |
> | Invoice | <ul><li>Seller is identified</li></ul> | `GOBL-RO-EFACTURA-BILL-INVOICE-10` Invoice supplier must have a VAT identifier or a tax registration identifier, or its tax representative a VAT identifier (BR-RO-065) |
> | Invoice | <ul><li>Outside scope stands alone</li></ul> | `GOBL-RO-EFACTURA-BILL-INVOICE-36` An invoice not subject to VAT (category O) cannot carry other VAT categories (BR-O-11) |
> | `preceding` | <ul><li>Length at most 500</li></ul> | `GOBL-RO-EFACTURA-BILL-INVOICE-06` Invoice preceding must contain no more than 500 entries (BR-RO-A500) |
> | `preceding` | <ul><li>Preceding numbers within length</li></ul> | `GOBL-RO-EFACTURA-BILL-INVOICE-07` Preceding invoice number must be no more than 200 characters long (BR-RO-L200) |
> | `attachments` | <ul><li>Length at most 50</li></ul> | `GOBL-RO-EFACTURA-BILL-INVOICE-08` Invoice attachments must contain no more than 50 entries (BR-RO-A050) |
> | `ordering.cost` | <ul><li>Rune length at most 100</li></ul> | `GOBL-RO-EFACTURA-BILL-INVOICE-09` Buyer accounting reference must be no more than 100 characters long (BR-RO-L100) |
> | `ordering.seller` | <ul><li>Tax representative address has a street</li></ul> | `GOBL-RO-EFACTURA-BILL-INVOICE-16` Tax representative address line 1 is required (BR-RO-140) |
> | `ordering.seller` | <ul><li>Tax representative address has a city</li></ul> | `GOBL-RO-EFACTURA-BILL-INVOICE-17` Tax representative city is required (BR-RO-150) |
> | `supplier` | <ul><li>Supplier address has a street</li></ul> | `GOBL-RO-EFACTURA-BILL-INVOICE-11` Invoice supplier address line 1 is required (BR-RO-080) |
> | `supplier` | <ul><li>Supplier address has a city</li></ul> | `GOBL-RO-EFACTURA-BILL-INVOICE-12` Invoice supplier city is required (BR-RO-090) |
> | `customer` | <ul><li>Customer is identified</li></ul> | `GOBL-RO-EFACTURA-BILL-INVOICE-13` Invoice customer must have a legal registration identifier or a VAT identifier (BR-RO-120) |
> | `customer` | <ul><li>Customer address has a street</li></ul> | `GOBL-RO-EFACTURA-BILL-INVOICE-14` Invoice customer address line 1 is required (BR-RO-080) |
> | `customer` | <ul><li>Customer address has a city</li></ul> | `GOBL-RO-EFACTURA-BILL-INVOICE-15` Invoice customer city is required (BR-RO-090) |
> | `tax.notes` | <ul><li>Exemption reasons within length</li></ul> | `GOBL-RO-EFACTURA-BILL-INVOICE-20` VAT exemption reason must be no more than 100 characters long (BR-RO-L100) |
> | `tax.ext` | <ul><li>Invoice type in \[credit-note]</li><li>Ext 'untdid-document-type' in \[381]</li></ul> | `GOBL-RO-EFACTURA-BILL-INVOICE-21` Invoice tax ext untdid-document-type must be 381 for a credit note (BR-RO-020) |
> | `tax.ext` | <ul><li>Invoice is not a credit note</li><li>Ext 'untdid-document-type' in \[380, 384, 389, 751]</li></ul> | `GOBL-RO-EFACTURA-BILL-INVOICE-22` Invoice tax ext untdid-document-type must be one of 380, 384, 389 or 751 (BR-RO-020) |
> | Invoice | <ul><li>Invoice is issued in an enforcement procedure</li><li>Enforcement body identified</li></ul> | `GOBL-RO-EFACTURA-BILL-INVOICE-35` An enforcement invoice must name the enforcement body as payee, with its name and its legal registration identifier (BR-RO-130) |

> [accordion] bill.DeliveryDetails
>
> | Field | Test | Validation Code / Message |
> | - | - | - |
> | DeliveryDetails | <ul><li>Delivery has an address</li><li>Delivery address has a street</li></ul> | `GOBL-RO-EFACTURA-BILL-DELIVERYDETAILS-01` Invoice delivery address line 1 is required when a delivery address is provided (BR-RO-180) |
> | DeliveryDetails | <ul><li>Delivery has an address</li><li>Delivery address has a city</li></ul> | `GOBL-RO-EFACTURA-BILL-DELIVERYDETAILS-02` Invoice delivery city is required when a delivery address is provided (BR-RO-200) |
> | DeliveryDetails | <ul><li>Delivery has an address</li><li>Delivery address has a region</li></ul> | `GOBL-RO-EFACTURA-BILL-DELIVERYDETAILS-03` Invoice delivery country subdivision is required when a delivery address is provided (BR-RO-210) |

> [accordion] bill.Discount
>
> | Field | Test | Validation Code / Message |
> | - | - | - |
> | `reason` | <ul><li>Rune length at most 100</li></ul> | `GOBL-RO-EFACTURA-BILL-DISCOUNT-01` Document level allowance reason must be no more than 100 characters long (BR-RO-L100) |

> [accordion] bill.Charge
>
> | Field | Test | Validation Code / Message |
> | - | - | - |
> | `reason` | <ul><li>Rune length at most 100</li></ul> | `GOBL-RO-EFACTURA-BILL-CHARGE-01` Document level charge reason must be no more than 100 characters long (BR-RO-L100) |

> [accordion] bill.LineDiscount
>
> | Field | Test | Validation Code / Message |
> | - | - | - |
> | `reason` | <ul><li>Rune length at most 100</li></ul> | `GOBL-RO-EFACTURA-BILL-LINEDISCOUNT-01` Invoice line allowance reason must be no more than 100 characters long (BR-RO-L100) |

> [accordion] bill.LineCharge
>
> | Field | Test | Validation Code / Message |
> | - | - | - |
> | `reason` | <ul><li>Rune length at most 100</li></ul> | `GOBL-RO-EFACTURA-BILL-LINECHARGE-01` Invoice line charge reason must be no more than 100 characters long (BR-RO-L100) |

> [accordion] org.Party
>
> | Field | Test | Validation Code / Message |
> | - | - | - |
> | `name` | <ul><li>Rune length at most 200</li></ul> | `GOBL-RO-EFACTURA-ORG-PARTY-01` Party name must be no more than 200 characters long (BR-RO-L200) |
> | `alias` | <ul><li>Rune length at most 200</li></ul> | `GOBL-RO-EFACTURA-ORG-PARTY-02` Party trading name must be no more than 200 characters long (BR-RO-L200) |
> | `people` | <ul><li>Contact name within length</li></ul> | `GOBL-RO-EFACTURA-ORG-PARTY-03` Contact point must be no more than 100 characters long (BR-RO-L100) |
> | `telephones` | <ul><li>Telephone within length</li></ul> | `GOBL-RO-EFACTURA-ORG-PARTY-04` Contact telephone number must be no more than 100 characters long (BR-RO-L100) |
> | `emails` | <ul><li>Email within length</li></ul> | `GOBL-RO-EFACTURA-ORG-PARTY-05` Contact email address must be no more than 100 characters long (BR-RO-L100) |
> | `addresses` | <ul><li>Line one within length</li></ul> | `GOBL-RO-EFACTURA-ORG-PARTY-06` Address line 1 must be no more than 150 characters long (BR-RO-L150) |
> | `addresses` | <ul><li>Line two within length</li></ul> | `GOBL-RO-EFACTURA-ORG-PARTY-07` Address line 2 must be no more than 100 characters long (BR-RO-L100) |
> | `addresses` | <ul><li>Locality within length</li></ul> | `GOBL-RO-EFACTURA-ORG-PARTY-08` City must be no more than 50 characters long (BR-RO-L050) |
> | `addresses` | <ul><li>Post code within length</li></ul> | `GOBL-RO-EFACTURA-ORG-PARTY-09` Post code must be no more than 20 characters long (BR-RO-L020) |
> | `addresses` | <ul><li>ISO 3166-2:RO subdivision</li></ul> | `GOBL-RO-EFACTURA-ORG-PARTY-10` Country subdivision must be an ISO 3166-2:RO code, such as RO-B or RO-AB (BR-RO-110, BR-RO-170, BR-RO-210) |
> | `addresses` | <ul><li>SECTOR-RO code</li></ul> | `GOBL-RO-EFACTURA-ORG-PARTY-11` City must be a Bucharest sector, such as SECTOR1, when the country subdivision is RO-B (BR-RO-100, BR-RO-160, BR-RO-200) |

> [accordion] org.Item
>
> | Field | Test | Validation Code / Message |
> | - | - | - |
> | `name` | <ul><li>Rune length at most 100</li></ul> | `GOBL-RO-EFACTURA-ORG-ITEM-01` Item name must be no more than 100 characters long (BR-RO-L100) |
> | `description` | <ul><li>Rune length at most 200</li></ul> | `GOBL-RO-EFACTURA-ORG-ITEM-02` Item description must be no more than 200 characters long (BR-RO-L200) |
> | `attributes` | <ul><li>Length at most 50</li></ul> | `GOBL-RO-EFACTURA-ORG-ITEM-03` Item attributes must contain no more than 50 entries (BR-RO-A050) |

> [accordion] org.Attribute
>
> | Field | Test | Validation Code / Message |
> | - | - | - |
> | Attribute | <ul><li>Attribute value within length</li></ul> | `GOBL-RO-EFACTURA-ORG-ATTRIBUTE-02` Item attribute value must be no more than 100 characters long (BR-RO-L100) |
> | `label` | <ul><li>Rune length at most 50</li></ul> | `GOBL-RO-EFACTURA-ORG-ATTRIBUTE-01` Item attribute name must be no more than 50 characters long (BR-RO-L050) |

> [accordion] org.Note
>
> | Field | Test | Validation Code / Message |
> | - | - | - |
> | Note | <ul><li>Note within length</li></ul> | `GOBL-RO-EFACTURA-ORG-NOTE-01` Note, with its subject qualifier when set, must be no more than 300 characters long (BR-RO-L300) |
> | Note | <ul><li>Accounting reference within length</li></ul> | `GOBL-RO-EFACTURA-ORG-NOTE-02` Invoice line buyer accounting reference must be no more than 100 characters long (BR-RO-L100) |

> [accordion] org.Attachment
>
> | Field | Test | Validation Code / Message |
> | - | - | - |
> | `description` | <ul><li>Rune length at most 100</li></ul> | `GOBL-RO-EFACTURA-ORG-ATTACHMENT-01` Supporting document description must be no more than 100 characters long (BR-RO-L100) |
> | `url` | <ul><li>Rune length at most 200</li></ul> | `GOBL-RO-EFACTURA-ORG-ATTACHMENT-02` External document location must be no more than 200 characters long (BR-RO-L200) |
> | `name` | <ul><li>Rune length at most 200</li></ul> | `GOBL-RO-EFACTURA-ORG-ATTACHMENT-03` Attached document filename must be no more than 200 characters long (BR-RO-L200) |

> [accordion] pay.Terms
>
> | Field | Test | Validation Code / Message |
> | - | - | - |
> | `notes` | <ul><li>Rune length at most 300</li></ul> | `GOBL-RO-EFACTURA-PAY-TERMS-01` Payment terms must be no more than 300 characters long (BR-RO-L300) |

> [accordion] pay.Instructions
>
> | Field | Test | Validation Code / Message |
> | - | - | - |
> | `detail` | <ul><li>Rune length at most 100</li></ul> | `GOBL-RO-EFACTURA-PAY-INSTRUCTIONS-01` Payment means text must be no more than 100 characters long (BR-RO-L100) |
> | `credit_transfer` | <ul><li>Account name within length</li></ul> | `GOBL-RO-EFACTURA-PAY-INSTRUCTIONS-02` Payment account name must be no more than 200 characters long (BR-RO-L200) |
> | `card.holder` | <ul><li>Rune length at most 200</li></ul> | `GOBL-RO-EFACTURA-PAY-INSTRUCTIONS-03` Payment card holder name must be no more than 200 characters long (BR-RO-L200) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.