Metadata-Version: 2.1
Name: odoo-addon-l10n_ro_partner_create_by_vat
Version: 19.0.0.8.0
Requires-Dist: odoo-addon-l10n_ro_config==19.0.*
Requires-Dist: odoo==19.0.*
Summary: Romania - Partner Create by VAT
Home-page: https://github.com/OCA/l10n-romania
License: AGPL-3
Author: NextERP Romania,Forest and Biomass Romania,Odoo Community Association (OCA)
Author-email: support@odoo-community.org
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 19.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Development Status :: 6 - Mature
Description-Content-Type: text/x-rst

.. image:: https://odoo-community.org/readme-banner-image
   :target: https://odoo-community.org/get-involved?utm_source=readme
   :alt: Odoo Community Association

===============================
Romania - Partner Create by VAT
===============================

.. 
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! This file is generated by oca-gen-addon-readme !!
   !! changes will be overwritten.                   !!
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! source digest: sha256:31ef2c5784d9f0c23b06cb87c0a512106c52682adc90a9420b08bffc24fee5d2
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png
    :target: https://odoo-community.org/page/development-status
    :alt: Mature
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
    :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
    :alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github
    :target: https://github.com/OCA/l10n-romania/tree/19.0/l10n_ro_partner_create_by_vat
    :alt: OCA/l10n-romania
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
    :target: https://translation.odoo-community.org/projects/l10n-romania-19-0/l10n-romania-19-0-l10n_ro_partner_create_by_vat
    :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
    :target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-romania&target_branch=19.0
    :alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows you to create the partners (companies) based on their
VAT number. It will complete the name, address of the partner from ANAF
webservice.

ANAF https://webservicesp.anaf.ro/PlatitorTvaRest/api/v8/ws/tva

--------------

1. CUI (Codul Unic de Înregistrare)
-----------------------------------

**CUI-ul** este "CNP-ul" unei firme. Este numărul atribuit de Registrul
Comerțului (sau de Ministerul Finanțelor, după caz) în momentul în care
o entitate juridică este înființată.

- **Format:** Este alcătuit dintr-un șir de cifre (între 2 și 10 cifre).
- **Cine îl are:** Toate entitățile juridice (SRL, PFA, ONG, etc.).
- **Rol:** Identifică în mod unic firma în fața autorităților și a
  partenerilor de afaceri.

2. CIF (Codul de Identificare Fiscală)
--------------------------------------

**CIF-ul** este, în esență, denumirea generică pentru codul de
identificare al unui plătitor de taxe.

- **Confuzia frecventă:** Pentru o firmă (SRL), **CUI și CIF sunt de
  cele mai multe ori același număr**. Termenul "CIF" este folosit mai
  des de ANAF, în timp ce "CUI" este folosit de Registrul Comerțului.
- **Cazuri speciale:** Alte entități care nu sunt firme (de exemplu,
  asociațiile de proprietari sau instituțiile publice) primesc un CIF
  pentru a putea plăti taxe și impozite.

3. VAT ID (Codul de TVA)
------------------------

**VAT ID** (sau codul de înregistrare în scopuri de TVA) reprezintă
CUI-ul/CIF-ul firmei tale, dar cu prefixul de țară (pentru România,
acesta este **RO**) atașat în față.

- **Exemplu:** Dacă CUI-ul firmei tale este ``12345678``, VAT ID-ul va
  fi ``RO12345678``.
- **Importanță:** Nu toate firmele au un VAT ID automat. O firmă are un
  cod de TVA doar dacă:

  1. A depășit plafonul de scutire de TVA (300.000 lei cifră de
     afaceri).
  2. A ales să devină plătitoare de TVA prin opțiune.
  3. S-a înregistrat pentru operațiuni intracomunitare
     (achiziții/vânzări de servicii sau bunuri în UE).

--------------

Rezumat comparativ
~~~~~~~~~~~~~~~~~~

+------------+----------------------------------------+----------------+
| Termen     | Ce înseamnă                            | Exemplu        |
+============+========================================+================+
| **CUI**    | Identificatorul oficial al firmei.     | ``12345678``   |
+------------+----------------------------------------+----------------+
| **CIF**    | Termenul fiscal pentru CUI.            | ``12345678``   |
+------------+----------------------------------------+----------------+
| **VAT ID** | CUI-ul cu prefixul de țară (doar       | ``RO12345678`` |
|            | pentru firmele plătitoare de TVA).     |                |
+------------+----------------------------------------+----------------+

..

   **Notă:** Dacă o firmă **nu** este plătitoare de TVA, pe facturile
   emise de ea va apărea doar numărul simplu (CUI), fără prefixul "RO".

**Table of contents**

.. contents::
   :local:

Installation
============

To install this module, you need to:

- clone the branch 16.0 of the repository
  https://github.com/OCA/l10n-romania
- add the path to this repository in your configuration (addons-path)
- update the module list
- search for "Romania - Partner Create by VAT" in your addons
- install the module

Usage
=====

Put the VAT number in the partner's form and if it's a romanian company,
it will fetch data available on ANAF website.

Configuration parameters
========================

The ANAF lookup (``res.partner._get_Anaf``) reads the following keys
from ``ir.config_parameter``. All keys are optional — sensible defaults
are used when they are not set.

+-----------------------------------------------------------+-------------------------------------------------------------+------------------------------------------------+
| Key                                                       | Default                                                     | Purpose                                        |
+===========================================================+=============================================================+================================================+
| ``l10n_ro_partner_create_by_vat.anaf_url``                | ``https://webservicesp.anaf.ro/api/PlatitorTvaRest/v9/tva`` | Endpoint queried for a single VAT number (or a |
|                                                           |                                                             | small list). Override only if ANAF publishes a |
|                                                           |                                                             | new URL or you want to route the call through  |
|                                                           |                                                             | a proxy.                                       |
+-----------------------------------------------------------+-------------------------------------------------------------+------------------------------------------------+
| ``l10n_ro_partner_create_by_vat.anaf_api_key``            | *(empty)*                                                   | API key for ANAF endpoints that require        |
|                                                           |                                                             | authentication. When empty, the request is     |
|                                                           |                                                             | sent unauthenticated. The same key is reused   |
|                                                           |                                                             | by the bulk sync in                            |
|                                                           |                                                             | ``l10n_ro_fiscal_validation``, so set it once  |
|                                                           |                                                             | and both flows use it.                         |
+-----------------------------------------------------------+-------------------------------------------------------------+------------------------------------------------+
| ``l10n_ro_partner_create_by_vat.anaf_api_key_header_tag`` | ``x-api-key``                                               | Name of the HTTP header that carries the API   |
|                                                           |                                                             | key. Only meaningful when                      |
|                                                           |                                                             | ``l10n_ro_partner_create_by_vat.anaf_api_key`` |
|                                                           |                                                             | is set; change it if ANAF requires a different |
|                                                           |                                                             | header name (e.g. ``Authorization``).          |
+-----------------------------------------------------------+-------------------------------------------------------------+------------------------------------------------+

Set these from **Settings → Technical → Parameters → System Parameters**
or via a data file / shell, e.g.:

.. code:: python

   self.env["ir.config_parameter"].sudo().set_param(
       "l10n_ro_partner_create_by_vat.anaf_api_key", "your-key-here",
   )

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-romania/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_partner_create_by_vat%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* NextERP Romania
* Forest and Biomass Romania

Contributors
------------

- `NextERP Romania <https://www.nexterp.ro>`__:

  - Fekete Mihai <feketemihai@nexterp.ro>

- Dorin Hongu <dhongu@gmail.com>
- Adrian Vasile <adrian.vasile@gmail.com>

Do not contact contributors directly about support or help with
technical issues.

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
   :alt: Odoo Community Association
   :target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-feketemihai| image:: https://github.com/feketemihai.png?size=40px
    :target: https://github.com/feketemihai
    :alt: feketemihai

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-feketemihai| 

This module is part of the `OCA/l10n-romania <https://github.com/OCA/l10n-romania/tree/19.0/l10n_ro_partner_create_by_vat>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
