feat(pos): add invoicing blueprint — CFDI generation, queue, cancel

Six endpoints: POST invoice, GET queue, GET queue/<id>, POST queue/process,
POST cancel/<id>, GET <sale_id>/pdf. Also adds cfdi_builder stub (Task 2).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-31 04:10:48 +00:00
parent fe8eff5ea0
commit e0773cdc1e
2 changed files with 420 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
# /home/Autopartes/pos/services/cfdi_builder.py
"""CFDI 4.0 XML builder — stub for future implementation (Plan 4, Task 2).
Full implementation will build CFDI 4.0 compliant XML for ingreso, egreso,
and pago voucher types using lxml.
"""
def build_ingreso_xml(sale, tenant_config, customer):
"""Build unsigned CFDI 4.0 XML for an ingreso (income) voucher."""
raise NotImplementedError("cfdi_builder.build_ingreso_xml not yet implemented (Plan 4, Task 2)")
def build_egreso_xml(sale, tenant_config, customer, original_uuid):
"""Build unsigned CFDI 4.0 XML for an egreso (credit note) voucher."""
raise NotImplementedError("cfdi_builder.build_egreso_xml not yet implemented (Plan 4, Task 2)")
def build_pago_xml(sale, tenant_config, customer, payments):
"""Build unsigned CFDI 4.0 XML for a pago (payment) complement."""
raise NotImplementedError("cfdi_builder.build_pago_xml not yet implemented (Plan 4, Task 2)")