[ADD] l10n_ar_edi: add electronic invoice guide for Argentina

Closes #594
This commit is contained in:
ren-odoo 2020-03-16 03:59:26 -07:00 committed by GitHub
parent f19b22e735
commit a399781065
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 324 additions and 16 deletions

View File

@ -15,6 +15,10 @@ modules are available:
- **l10n_ar_reports**: Add VAT Book report which is a legal requirement in Argentine and that holds
the VAT detail info of sales or purchases recorded on the journal entries. This module includes as
well the VAT summary report that is used to analyze the invoice
- **l10n_ar_edi**: This module includes all technical and functional requirements to generate
Electronic Invoice via web service, based on the AFIP regulations.
Configuration
=============
@ -36,6 +40,7 @@ fiscal obligation and structure of the company:
.. image:: media/argentina02.png
:align: center
Chart of Account
~~~~~~~~~~~~~~~~
@ -54,11 +59,57 @@ many accounts as the companies that gave more complex fiscal requirements:
Configure Master data
---------------------
Electronic Invoice Credentials
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Environment
***********
The AFIP infrastructure is replicated in two separate environments, Testing and Production.
Testing is provided so that the Companies can test their developments until they are ready to move
into the Production environment. As these two environments are completely isolated from each other,
the digital certificates of one instance are not valid in the other one.
Go to :menuselection:`Accounting --> Settings --> Argentinian Localization` to select the environment:
.. image:: media/argentina_edi_01.png
:align: center
AFIP Certificates
*****************
The electronic invoice and other afip services work with WebServices (WS) provided by the AFIP.
In order to enable communication with the AFIP, the first step is to request a Digital Certificate
if you dont have one already.
#. Generate certificate Sign Request (Odoo). When this option is selected a file with extension
``.csr`` (certificate signing request) is generated to be used the AFIP portal to request the
certificate.
.. image:: media/argentina_edi_02.png
#. Generate Certificate (AFIP). Access the AFIP portal and follow the instructions described in the
next document in order to get a certificate. `Get AFIP Certificate
<http://www.afip.gob.ar/ws/WSAA/wsaa_obtener_certificado_produccion.pdf>`_.
#. Upload Certificate and Private Key (Odoo). Once the certificate has been generated, it needs to
be uploaded in Odoo, using the pencil next in the field “Certificado” and selecting the
corresponding file.
.. image:: media/argentina_edi_03.png
.. tip::
In case you need to configure the Homologation Certificate, please refer to the AFIP official
documentation: `Homologation Certificate
<http://www.afip.gob.ar/ws/documentacion/certificados.asp>`_.
Partner
~~~~~~~
Identification Type and VAT
^^^^^^^^^^^^^^^^^^^^^^^^^^^
***************************
As part of the Argentinean localization, the document types defined by the AFIP are now available on
the Partner form, this information is essential for most transactions. There are six identification
@ -72,7 +123,7 @@ types available by default:
common ones are active.
AFIP Responsibility Type
^^^^^^^^^^^^^^^^^^^^^^^^^
************************
In Argentina the document type associated with customers and vendors transactions is defined based
on the AFIP Responsibility type, this field should be defined in the partner form:
@ -90,7 +141,7 @@ financial account and configuration.
:align: center
Taxes Types
^^^^^^^^^^^
***********
Argentina has several tax types, the most common ones are:
@ -100,7 +151,7 @@ Argentina has several tax types, the most common ones are:
- Otros.
Special Taxes
^^^^^^^^^^^^^
*************
Some argentine taxes are not commonly used for all companies, these type of taxes are included as
inactive by default, it's important that before creating a new tax you confirm if they are not
@ -133,7 +184,7 @@ fill anything on this view:
There are several document types that are inactive by default but can be activated if needed.
Letters
^^^^^^^
*******
For Argentina, the document types include a letter that helps that indicates the
transaction/operation, example:
@ -149,7 +200,7 @@ to configure anything additional.
:align: center
Use on Invoices
^^^^^^^^^^^^^^^
***************
The document type on each transaction will be determined by:
@ -171,8 +222,8 @@ for more detail of the invoices, please refer to the section 2.3 Document Types.
If the Sales/Purchase journal are used without the option *Use Documents* it because they wont be
used to generate fiscal invoices, but mostly for account moves related to internal control process.
AFIP Information (better known as AFIP Point of Sale)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
AFIP Information (also known as AFIP Point of Sale)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. image:: media/argentina10.png
:align: center
@ -181,9 +232,23 @@ AFIP Information (better known as AFIP Point of Sale)
POS that will be used to manage the transactions for which the journal is created. The AFIP POS
defines as well:
#. The sequences of document types related to the WS.
#. The sequences of document types related to the Web service.
#. The structure and data of the electronic invoice file.
Web Services
************
- ``wsfev1: Electronic Invoice.`` This is the most common service,
is used to generated invoices for document types A, B, C, M with no detail per item.
- ``wsbfev1: Electronic Fiscal Bond.`` For those who invoice capital goods and wish
to access the benefit of the Electronic Tax Bonds granted by the Ministry of Economy. For more
detail you can refer to the next link: `Fiscal Bond
<https://www.argentina.gob.ar/acceder-un-bono-por-fabricar-bienes-de-capital>`_.
- ``wsfexv1: Electronic Exportation Invoice.`` Used to generate invoices for international customers
and transactions that involve exportation process, the document type related is type “E”.
.. image:: media/argentina_edi_04.png
:align: center
**AFIP POS Number**: This is the number configured in the AFIP to identify the operations related to
this AFIP POS.
@ -199,17 +264,32 @@ with the same letter will share the same sequence. For example:
- Credit Note: NC-A 0001-00000003.
- Debit Note: ND-A 0001-00000004.
Sequences
~~~~~~~~~
In case that you want to synchronize the next number in the sequence in Odoo based on the next
number in the AFIP POS, the next button that is visible under :doc:`developer mode
<../../general/developer_mode/activate>` can be used:
.. image:: media/argentina_edi_05.png
:align: center
.. note::
When creating the Purchase journals, it's possible to define if they can be related to document
types or not. In case that the option to use documents is selected, there is no need to manually
associate the document type sequences as the document number is provided by the vendor.
Usage and testing
=================
Invoice
----------
-------
After the partners and journals are created and configured, when the invoices are created the will
have the next behaviour:
Document type assignation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~
Once the partner is selected the document type will filled automatically, based on the AFIP document
type:
@ -235,8 +315,30 @@ given by the document type.
The most common document type will be defined automatically for the different combinations of AFIP
responsibility type but it can be updated manually by the user.
Electronic Invoice elements
~~~~~~~~~~~~~~~~~~~~~~~~~~~
When using electronic invoice, if all the information is correct the Invoice is posted in the
standard way, in case that something needs to be addressed (check the section common errors for more
detail), an error message is raised indicating the issue/proposed solution and the invoice remains
in draft until the related data is corrected.
Once the invoice is posted, the information related to the AFIP validation and status is displayed
in the AFIP Tab, including:
- AFIP Autorisation: CAE number.
- Expiration date: Deadline to deliver the invoice to the customers. Normally 10 days after the
CAE is generated.
- Result:
- Aceptado en AFIP.
- Aceptado con Observaciones.
.. image:: media/argentina_edi_15.png
:align: center
Invoice Taxes
~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~
Based on the AFIP Responsibility type, the VAT tax can have a different behavior on the pdf
report:
@ -244,7 +346,7 @@ report:
**A. Tax excluded:** In this case the taxed amount needs to be clearly identified in the report.
This condition applies when the customer has the following AFIP Responsibility type:
- Responsable Inscripto
- Responsable Inscripto.
.. image:: media/argentina14.png
:align: center
@ -261,12 +363,152 @@ Responsibility types:
.. image:: media/argentina15.png
:align: center
Special Use Cases
~~~~~~~~~~~~~~~~~
Invoices for Services
*********************
For electronic invoices that include Services, the AFIP requires to report the service starting
and ending date, this information can be filled in the tab “Other Info”:
.. image:: media/argentina_edi_06.png
:align: center
If the dates are not selected manually before the invoice is validated, the values will be
filled automatically considering the beginning and day of the invoice month:
.. image:: media/argentina_edi_07.png
:align: center
Exportation Invoices
********************
The invoices related to Exportation transactions required a Journal that used the AFIP POS
System “Expo Voucher - Web Service” so the proper document type be associated:
.. image:: media/argentina_edi_08.png
:align: center
When the customer selected in the Invoice has set the AFIP responsibility type as “Cliente /
Proveedor del Exterior” or “IVA Liberado Ley Nº 19.640”, Odoo automatically assigned:
- Journal related to the exportation Web Service.
- Exportation document type .
- Fiscal position: Compras/Ventas al exterior.
- Concepto AFIP: Products / Definitive export of goods.
- Exempt Taxes.
.. image:: media/argentina_edi_09.png
:align: center
.. note::
The Exportation Documents required the Incoterm in :menuselection:`Other Info --> Accounting`:
.. image:: media/argentina_edi_13.png
:align: center
Fiscal Bond
***********
The Electronic Fiscal bond is used for those who invoice capital goods and wish to access
the benefit of the Electronic Tax Bonds granted by the Ministry of Economy.
For these transactions its important to have into consideration the next requirements:
- Currency (according to parameter table) and invoice quotation.
- Taxes.
- Zone.
- Detail each item.
- Code according to the Common Nomenclator of Mercosur (NCM).
- Complete description.
- Unit Net Price.
- Quantity.
- Unit of measurement.
- Bonus.
- VAT rate.
Electronic Credit Invoice MiPyme (FCE)
**************************************
**Invoices:** There are several document types classified as Mipyme also known as
Electronic Credit Invoice (FCE in spanish), which is used to impulse the SME, its purpose is
to develop a mechanism that improves the financing conditions of these companies and allows
them to increase their productivity, through the early collection of credits and receivables
issued to their clients and / or vendors.
For these transactions its important to have into consideration the next requirements:
- Specific document types (201, 202, 206, etc).
- The emisor should be eligible by the AFIP to MiPyme transactions.
- The amount should be bigger than 100,000 ARS.
- A bank account type CBU must be related to the emisor, otherwise the invoice cant
be validated, having these errors messages for example:
.. image:: media/argentina_edi_10.png
:align: center
**Credit& Debit Notes:** When creating a Credit/Debit note related to a FCE document, it is
important take the next points into consideration:
- Use the Credit and Debit Note buttons, so the correct reference of the originator
document passed to the note.
.. image:: media/argentina_edi_11.png
:align: center
- The document letter should be the same than the originator document (either A or B).
- The same currency as the source document must be used. When using a secondary currency
there is an exchange difference if the currency rate is different between the emission day
and the payment date, its possible to create a credit/debit note to decrease/increase the
amount to pay in ARS.
In the workflow we can have two scenarios:
#. The FCE is rejected so the Credit Note should have the field “FCE, is Cancellation?” as True.
#. The Credit Note, is created with the negative amount to annulate the FCE document,
in this case the field “FCE, is Cancellation?” must be empty (false).
.. image:: media/argentina_edi_12.png
:align: center
Invoice printed report
~~~~~~~~~~~~~~~~~~~~~~
The PDF report related to electronic invoices that have been validated by the AFIP includes
a barcode at the bottom of the format which represent the CAE number, the Expiration Date is
also displayed as its legal requirement:
.. image:: media/argentina_edi_14.png
:align: center
Troubleshooting and Auditing
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For auditing and troubleshooting purposes you can get the detailed information of an
invoice number that has been previously sent to the AFIP,
.. image:: media/argentina_edi_23.png
:align: center
.. image:: media/argentina_edi_24.png
:align: center
You can also get the last number used in AFIP for a specific Document Type and POS Number
as support for any possible issues on the sequence synchronization between Odoo and AFIP.
.. image:: media/argentina_edi_22.png
:align: center
Vendor Bills
------------
Based on the sales journal selected for the invoice, the document type is now a required field. This
value is auto populated based on the AFIP Responsibility type of Issuer and Customer, but the value
can be switched if necessary.
Based on the purchase journal selected for the vendor bill, the document type is now a required field.
This value is auto populated based on the AFIP Responsibility type of Issuer and Customer, but the
value can be switched if necessary.
.. image:: media/argentina16.png
:align: center
@ -278,6 +520,72 @@ expected.
.. image:: media/argentina17.png
:align: center
The vendor bill number is structured in the same way that the invoices with the difference
that the document sequence is input by the user: “Document Prefix - Letter - Document number".
Validate Vendor Bill number in AFIP
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
As most companies have internal controls to verify that the vendor bill is related to an AFIP
valid document, an automatic validation can be set in :menuselection:`Accounting --> Settings -->
Argentinian Localization --> Validate document in the AFIP`, considering the following levels:
- **Not available:** The verification is not done (this is the default value).
- **Available:** The verification is done, in case the number is not valid
it only raises a warning but it allows you to post the vendor bill.
- **Required:** The verification is done and it doesn't allow the user to
post the vendor bill if the document number is not valid.
.. image:: media/argentina_edi_16.png
:align: center
How to use it in Odoo
*********************
This tool incorporates in the vendor bill a new "Verify on AFIP" button located
next to the AFIP Authorization code.
.. image:: media/argentina_edi_17.png
:align: center
In case its not a valid AFIP authorization the value “Rejected” will be
displayed and the details of the validation will be added to the chatter.
.. image:: media/argentina_edi_18.png
:align: center
Special Use cases
~~~~~~~~~~~~~~~~~
Untaxed Concepts
****************
There are some transactions that include items that are not part of the VAT base amount,
this is commonly used in fuel and gasoline invoices.
The vendor bill will be registered using 1 item for each product that is part of the VAT
base amount and an additional item to register the amount of the Exempt concept:
.. image:: media/argentina_edi_19.png
:align: center
Perception Taxes
****************
The vendor bill will be registered using 1 item for each product that is part of the
VAT base amount, the perception tax can be added in any of the product lines, as result
we will have one tax group for the VAT and one for the perception, the perception default
value is always 1.00.
.. image:: media/argentina_edi_20.png
:align: center
You should use the pencil that is the next to the Perception amount to edit it
and set the correct amount.
.. image:: media/argentina_edi_21.png
:align: center
After this is done the invoice can be validated.
Reports
=======

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB