Files
odoo_source/addons/l10n_ro_edi
Yosua Nicolaus 95a9cd2a46 [FIX] l10n_ro_edi: country code prefix on VAT / company_registry
This commit makes the CIUS-RO e-invoice emitted by a Romanian company
without VAT number compliant with the CIUS-RO requirements.

The validator for CIUS-RO (which extends the validations from the BIS3
Schematron) asserts a rule `[BR-CO-09]` where:

if the PartyTaxScheme/TaxScheme/ID == 'VAT',
  CompanyID must start with a country code prefix.

In Romania however, there are multiple types of "Tax IDs", and it is perfectly
valid in Romania to have a Tax ID without RO (country code prefix) in front of
them. They are not a subject to paying VAT, and it should still be possible to
generate CIUS-RO XML with their tax identifications.

We have to handle their cases by changing the TaxScheme/ID to 'something other
than VAT', preventing the trigger of the rule and allow Romanian companies
without prefixed VAT to use CIUS-RO.

```xml
<rule context="//cac:PartyTaxScheme[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']">
  <assert id="BR-CO-09" flag="fatal" test="( contains( ' 1A AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH EL ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS XI YE YT ZA ZM ZW ',substring(cbc:CompanyID,1,2) ) )">[BR-CO-09]-The Seller VAT identifier (BT-31), the Seller tax representative VAT identifier (BT-63) and the Buyer VAT identifier (BT-48) shall have a prefix in accordance with ISO code ISO 3166-1 alpha-2 by which the country of issue may be identified. Nevertheless, Greece may use the prefix ‘EL’.</assert>
</rule>
```

This commit also fixes and clean some of the irrelevant constraints and tests
previously written in `l10n_ro_edi`.

closes odoo/odoo#155252

Task-id: 3649426
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2024-02-28 19:49:05 +00:00
..
…