fix(pos): resolve integration test failures for CFDI + accounting
- Fix sat_accounts.sql: split multi-row INSERT into individual statements so parent_id subqueries resolve correctly (was producing all NULLs) - Add tenant_config table to v1.0 schema (required by CFDI invoicing) - Seed tenant_config with RFC/regimen during tenant provisioning - Fix cancel_sale to pass complete sale data for accounting reversal - Fix CFDI XML builder: use `or` instead of dict.get() defaults to handle explicit None values from DB (clave_prod_serv, clave_unidad) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -85,8 +85,8 @@ def _get_sale_with_items(cur, sale_id):
|
||||
'tax_rate': float(r[9]) if r[9] else 0.16,
|
||||
'tax_amount': float(r[10]) if r[10] else 0,
|
||||
'subtotal': float(r[11]) if r[11] else 0,
|
||||
'clave_prod_serv': r[12],
|
||||
'clave_unidad': r[13],
|
||||
'clave_prod_serv': r[12] or '25174800',
|
||||
'clave_unidad': r[13] or 'H87',
|
||||
})
|
||||
|
||||
return sale
|
||||
|
||||
Reference in New Issue
Block a user