/* Rollback seguro v7: cierra el catálogo productivo. No elimina trazabilidad. */
START TRANSACTION;
UPDATE billing_document_types
SET enabled_production=0, updated_at=CURRENT_TIMESTAMP
WHERE direction='issued'
  AND document_key IN (
    'invoice_electronic','invoice_exempt_electronic',
    'receipt_electronic','receipt_exempt_electronic',
    'invoice_export_electronic','dispatch_guide_electronic',
    'credit_note_electronic','debit_note_electronic',
    'credit_note_export_electronic','debit_note_export_electronic'
  );
COMMIT;
