[IMP] accounting/l10n_pe: delivery guide 2.0 peru

closes odoo/documentation#7853

X-original-commit: 81de2a5bbe
Signed-off-by: Jonathan Castillo (jcs) <jcs@odoo.com>
This commit is contained in:
Sam Lieber (sali) 2024-02-05 12:34:22 -05:00
parent de33f53535
commit 98cb1ebac3
10 changed files with 282 additions and 0 deletions

View File

@ -2,6 +2,11 @@
Peru
====
.. |SUNAT| replace:: :abbr:`SUNAT (Superintendencia Nacional de Aduanas y de Administración Tributaria)`
.. |GRE| replace:: :abbr:`GRE (Guía de Remisión Electrónica)`
.. |RUS| replace:: :abbr:`RUS (Régimen Único Simplificado)`
.. |EDI| replace:: :abbr:`EDI (Electronic Data Interchange)`
Introduction
============
@ -78,6 +83,8 @@ The chart of accounts for Peru is based on the most updated version of the :abbr
Contable General Empresarial)`, which is grouped in several categories and is compatible with NIIF
accounting.
.. _peru/accounting-settings:
Accounting Settings
-------------------
@ -239,6 +246,8 @@ directly to its services and get the currency rate either automatically or manua
Please refer to the next section in our documentation for more information about
:doc:`multicurrencies <../accounting/get_started/multi_currency>`.
.. _peru/master_data:
Configure Master data
---------------------
@ -588,3 +597,276 @@ As part of the Peruvian localization, besides creating credit notes from an exis
you can also create debit Notes. For this just use the button “Add Debit Note”.
By default the Debit Note is set in the document type.
.. _peru/edg:
Electronic delivery guide 2.0
-----------------------------
The *Guía de Remisión Electrónica* (GRE) is an electronic document generated by the shipper to
support the transportation or transfer of goods from one place to another, such as a warehouse or
establishment. In Odoo, there are several configuration steps needed before you can successfully use
this feature.
The use of the *guía de remisión electrónica* electronic document is mandatory and required by
|SUNAT| for taxpayers who need to transfer their products, except those under the *Single Simplified
Regime* (régimen único simplificado or RUS).
Delivery guide types
~~~~~~~~~~~~~~~~~~~~
Sender
******
The *Sender* delivery guide type is issued when a sale is made, a service is rendered (including
processing), goods are assigned for use, or goods are transferred between premises of the same
company and others.
This delivery guide is issued by the owner of the goods (i.e., the sender) at the beginning of the
shipment. The sender delivery guide is supported in Odoo.
.. seealso::
`SUNAT guía de remisión <https://www.gob.pe/7899-guia-de-remision>`_
Carrier
*******
The *Carrier* delivery guide type justifies the transportation service the driver (or carrier)
performs.
This delivery guide is issued by the carrier and must be issued to each shipper when the shipment
goes through public transport.
.. important::
The carrier delivery guide is **not** supported in Odoo.
.. seealso::
`SUNAT guía de remisión transportista
<https://tefacturo.pe/blog/sunat/guia-de-remision-electronica/guia-de-remision-transportista/>`_
Transportation types
~~~~~~~~~~~~~~~~~~~~
Private
*******
The *Private* transportation type option is used when the owner transfers goods using their own
vehicles. In this case, a sender's delivery guide must be issued.
Public
******
The *Public* transportation type option is used when an external carrier moves the goods. In
this case, two delivery guides must be issued: the sender's delivery guide and the carrier's
delivery guide.
Direct submission to SUNAT
~~~~~~~~~~~~~~~~~~~~~~~~~~
The creation of the |GRE| delivery guide in Odoo **must** be sent directly to the |SUNAT|,
regardless of the electronic document provider: IAP, Digiflow, or |SUNAT|.
Required information
~~~~~~~~~~~~~~~~~~~~
Version 2.0 of the electronic delivery guide requires additional information on the general
configuration, vehicles, contacts, and products. In the general configuration, it is necessary to
add new credentials that you can retrieve from the |SUNAT| portal.
Cancellations
~~~~~~~~~~~~~
**Both** the sender and the carrier can cancel the electronic waybill as long as the following
conditions are met:
- The shipment has not been initiated.
- If the shipment has been initiated, the receiver **must** be changed before reaching the final
destination.
.. important::
The |SUNAT| no longer uses the term "Anula", but now uses the term "Dar de baja" for
cancellations.
Testing
~~~~~~~
The |SUNAT| does not support a test environment. This means that any delivery guides that were
generated by mistake **will** be sent to the |SUNAT|.
If, by mistake, the waybill was created in this environment, it is necessary to delete it from the
|SUNAT| portal.
Configuration
~~~~~~~~~~~~~
.. important::
- Electronic sender's |GRE| is currently the only supported type of waybill in Odoo.
- The delivery guide is dependent on the Odoo *Inventory* app, the :guilabel:`l10n_pe_edi` and
:guilabel:`l10n_pe` modules.
- A second user **must** be added for the creation of electronic documents.
After following the steps to configure the :ref:`electronic invoicing <peru/accounting-settings>`
and the :ref:`master data <peru/master_data>`, :ref:`install <general/install>` the
:guilabel:`Peruvian - Electronic Delivery Note 2.0` module (`l10n_pe_edi_stock_20`).
Next, you need to retrieve the *client ID* and *client secret* from |SUNAT|. To do so, follow the
`manual de servicios web plataforma nueva GRE
<https://cpe.sunat.gob.pe/sites/default/files/inline-files/Manual_Servicios_GRE.pdf>`_.
.. note::
In the |SUNAT| portal, it is important to have the correct access rights enabled, as they may
differ from the user set for electronic invoicing.
These credentials should be used to configure the delivery guide general settings from
:menuselection:`Accounting --> Configuration --> Settings --> Peruvian Electronic Invoicing`.
.. image:: peru/gre-fields-example.png
:alt: Example for the SUNAT Delivery Guide API section configuration.
.. note::
It is required to follow the format `RUC + UsuarioSol` (e.g., `20557912879SOLUSER`) for the
:guilabel:`Guide SOL User` field, depending on the user selected when generating the |GRE| API
credentials in the |SUNAT| portal.
Operator
********
The *operator* is the vehicle's driver in cases where the delivery guide is through *private*
transport.
To create a new operator, navigate to :menuselection:`Contacts --> Create` and fill out the contact
information.
First, select :guilabel:`Individual` as the :guilabel:`Company Type`. Then, add the
:guilabel:`Operator License` in the :guilabel:`Accounting` tab of the contact form.
For the customer address, make sure the following fields are complete:
- :guilabel:`District`
- :guilabel:`Tax ID` (:guilabel:`DNI`/:guilabel:`RUC`)
- :guilabel:`Tax ID Number`
.. image:: peru/operator-configuration.png
:alt: Individual type operator configurations in the Contact form.
Carrier
*******
The *carrier* is used when the delivery guide is through *public* transport.
To create a new carrier, navigate to :menuselection:`Contacts --> Create` and fill out the contact
information.
First, select :guilabel:`Company` as the :guilabel:`Company Type`. Then, add the :guilabel:`MTC
Registration Number`, :guilabel:`Authorization Issuing Entity`, and the :guilabel:`Authorization
Number`.
For the company address, make sure the following fields are complete:
- :guilabel:`District`
- :guilabel:`Tax ID` (:guilabel:`DNI`/:guilabel:`RUC`)
- :guilabel:`Tax ID Number`
.. image:: peru/company-operator-configuration.png
:alt: Company type operator configurations in the Contact form.
Vehicles
********
To configure the available vehicles, navigate to :menuselection:`Inventory --> Configuration -->
Vehicles` and fill in the vehicle form with the information needed for the vehicle:
- :guilabel:`Vehicle Name`
- :guilabel:`License Plate`
- :guilabel:`Is M1 or L?`
- :guilabel:`Special Authorization Issuing Entity`
- :guilabel:`Authorization Number`
- :guilabel:`Default Operator`
- :guilabel:`Company`
.. important::
It is important to check the :guilabel:`Is M1 or L?` checkbox if the vehicle has fewer than four
wheels or fewer than eight seats.
.. image:: peru/vehicle-not-m1-or-l-pe.png
:alt: Vehicle not selected as an M1 or L type with extra fields shown.
Products
********
To configure the available products, navigate to :menuselection:`Inventory --> Products` and open
the product to be configured.
Make sure that the applicable information in the product form is fully configured. The
:guilabel:`Partida Arancelaria` (Tariff Item) field needs to be completed.
Generating a GRE
~~~~~~~~~~~~~~~~
Once the delivery from inventory is created during the sales workflow, make sure you complete the
|GRE| fields on the top-right section of the transfer form for the fields:
- :guilabel:`Transport Type`
- :guilabel:`Reason for Transfer`
- :guilabel:`Departure start date`
It is also required to complete the :guilabel:`Vehicle` and :guilabel:`Operator` fields under the
:guilabel:`Guia de Remision PE` tab.
The delivery transfer has to be marked as *Done* for the :guilabel:`Generar Guia de Remision` button
to appear on the left menu of the transfer form.
.. image:: peru/generate-gre-transferview.png
:alt: Generar Guia de Remision button on a transfer form in the Done stage.
Once the transfer form is correctly validated by |SUNAT|, the generated XML file becomes available
in the chatter. You can now print the delivery slip that shows the transfer details and the QR
code validated by |SUNAT|.
.. image:: peru/gre-delivery-slip.png
:alt: Transfer details and QR code on generated delivery slip.
Common errors
~~~~~~~~~~~~~
- `Diferente prefijo para productos (T001 en algunos, T002 en otros)`
At the moment, Odoo does not support the automation of prefixes for products. This can be done
manually for each product output. This can also be done for non-storable products. However, keep
in mind that there will be no traceability.
- `2325 - GrossWeightMeasure - El dato no cumple con el formato establecido "Hace falta el campo"
"Peso"" en el producto`
This error occurs when the weight on the product is set as `0.00`. To fix this, you need to cancel
the waybill and recreate it. Make sure that you fix the weight on the product before creating the
new waybill, or it will result in the same error.
- `JSONDecodeError: Expecting value: line 1 column 1 (char 0) when creating a Delivery Guide`
This error is typically generated due to SOL user issues. Verify the user's connection with the
|SUNAT|; the SOL user must be established with the company RUT + user ID. For example
`2012188549JOHNSMITH`.
- `El número de documento relacionado al traslado de mercancía no cumple con el formato establecido:
error: documento relacionado`
The *Related Document Type* and *Related Document Number* fields only apply to invoices and
receipts.
- `400 Client error: Bad Request for URL`
This error is not solvable from Odoo; it is advised you reach out to the |SUNAT| and verify the
user. It may be necessary to create a new user.
- `Invalid content was found starting with element 'cac:BuyerCustomerParty'`
This error occurs when the transfer reason is set as *other*. Please select another option.
Following to the official documentation of the |SUNAT|'s waybill guide, the transfer reasons *03
(sale with shipment to third party)* or *12 (others)* does not work in Odoo, since you should not
have an empty or blank customer.
- `Duda cliente: consumo de créditos IAP al usar GRE 2.0`
For live clients using IAP, no credit is consumed (in theory) because it does not go through the
OSE, i.e., these documents are directly sent to the |SUNAT|.
- `Errores con formato credenciales GRE 2.0 (traceback error)`
Odoo currently throws an error with a traceback instead of a message that the credentials are not
correctly configured in the database. If this occurs on your database, please verify your
credentials.

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB