dadecasdev

TicketBAI e-invoicing

TicketBAI integration and diagnosis of invoices rejected by the tax authority.

PythonTrytonXMLXSDFirma electrónica

The problem

A batch of invoices started being rejected by the tax authority with no obvious cause. The error pointed at the XML operation key, but the code generating it looked correct.

The solution

Investigation working backwards from the rejection message: validating the XML against the schema, reviewing operation keys and the applied VAT regime, and comparing against recent module changes. The cause was an internal variable used to build the keys whose meaning had changed in an earlier modification.

What it includes

  • XML generation and validation against the official schema
  • Electronic signature and submission
  • Status handling and invoice resubmission
  • Regeneration of TicketBAI data for already-issued invoices
  • Analysis of tax authority responses
  • Handling ERP restrictions on posted or paid invoices

Outcome

Root cause located and logic corrected. Affected invoices were regenerated and resubmitted successfully, with no need to void them or redo the accounting.

Working on a similar challenge?

Tell me about your project ↗