Odoo 19 app

El Salvador DTE Electronic Invoicing

El Salvador DTE Electronic Invoicing for Odoo 19

Ministerio de HaciendaDTE JSONFactura 01CCF 03Notas 05 / 06Exportacion 11Sujeto excluido 14Invalidacion

What it does

Factura, Comprobante de Credito Fiscal, notes, export and sujeto excluido invoices as signed DTE JSON, sent to the Ministerio de Hacienda with sello de recepcion, invalidation and contingency.

When an invoice is validated the module builds the DTE JSON exactly as the official Ministerio de Hacienda schemas define it, signs it (JWS RS512) with the certificate file the MH issued to you - inside Odoo, no firmador server needed - and sends it to the recepciondte service. The sello de recepcion, the processing date and any MH observations are stored on the invoice.

Each type gets its numero de control (DTE-01-M001P001-000000000000001) per establishment and point of sale, and a codigo de generacion. The Archivo DTE (JSON with firmaElectronica and selloRecibido) goes to your customer with the PDF, and the printed invoice carries the QR of the public MH query.

Wrong documents are invalidated with the Evento de invalidacion; when the MH or your connection is down, contingency mode keeps signing and later reports everything with the Evento de contingencia.

Who it is for

  • Companies in El Salvador issuing electronic tax documents. Issuers that the Ministerio de Hacienda (MH) has brought into electronic invoicing can produce the DTE straight from Odoo invoices. The module builds the JSON, signs it and sends it, then stores the sello de recepcion on the invoice.
  • Businesses selling to registered taxpayers. When the customer has an NRC, a customer invoice becomes a Comprobante de credito fiscal (type 03) by itself. Credit notes and debit notes created from it are sent as types 05 and 06 with the related document filled in.
  • Exporters. A customer invoice for a partner outside El Salvador becomes a Factura de exportacion (type 11), with the country, person type and an incoterm field on the invoice's DTE tab.
  • Companies buying from unregistered suppliers. Tick Sujeto Excluido on the supplier and its vendor bills are issued as type 14, with income tax withheld reported when a tax is marked as such.

Setting it up

  1. Install the module. Departments, 44 municipalities, 262 districts and the CAT-019 economic activities are loaded with it, and the company's fiscal country must be El Salvador.
  2. Go to Accounting > Configuration > Settings and find the El Salvador DTE - Ministerio de Hacienda block. Leave MH environment on Demo (offline simulation) to try it, or choose MH test and enter the MH API User and MH API Password.
  3. Under Signature, choose Inside Odoo and upload the MH Certificate File (.crt) with its Private Key Password, or choose the MH firmador service and enter its Firmador URL.
  4. Under Issuer, set the company NRC, Economic Activity, Municipality and District. Fill the Establishment and point of sale numbers and MH codes, the Default Payment Method and the DTE Responsible Person.
  5. On customers in El Salvador, set the NIT or DUI, Identity Document Type, NRC, Economic Activity, Municipality and District. Foreign customers need a country and a Person Type.
  6. On your taxes, set El Salvador DTE Kind (IVA 13%, exempt, not subject, export 0%, or a withholding or perception).
  7. Validate an invoice. With Send to MH on Validate ticked, it's signed and sent at once. Otherwise use Send DTE to MH on the invoice or from the list's Action menu, and check results under Accounting > Customers > El Salvador DTE > DTE Log.

El Salvador DTE Electronic Invoicing: questions

Is this an officially certified MH solution?

No. It follows the JSON schemas and services published by the Ministerio de Hacienda, but you still go through the MH's own authorization process as an issuer before using production. Rules on which documents you must issue and when can change, so check them with your accountant or the MH.

Can I test without MH credentials?

Yes. Demo mode builds and signs each document and simulates the MH answers inside Odoo, so nothing leaves your server. The MH test environment (ambiente 00) needs your API user and password.

What happens when a document is rejected or sending fails?

The invoice keeps a rejected or error status with the MH message, and the call is written to the DTE log. Fix the data and press Send DTE to MH again. A rejected document gets a new codigo de generacion on resend. A scheduled action for sending pending documents is included but switched off by default.

How do I cancel a DTE the MH already received?

Use Invalidate DTE on the invoice. The wizard asks for the invalidation type, a replacement document when the original had an error, the reason and the requester. The invoice is cancelled only after the MH accepts the event, and transmitted documents can't simply be reset to draft.

What if the MH or my connection is down?

Switch on Contingency mode in the settings with its type and reason. Documents are then signed and kept. Afterwards use El Salvador DTE > Close Contingency to send the contingency event, and once the MH accepts it, press Transmit Documents.

Are there limits?

Documents must be in USD, and each sale line can carry only one sale tax kind. A credito fiscal document needs a customer with NIT, NRC, activity and a full address, and Facturas of USD 25,000 or more must identify the customer. It needs only Invoicing (account) plus debit notes, so Community works.