fix(conciliacion): incluir CFDIs tipo P en filtro de emitidos
La condicion SQL NOT (metodo_pago = 'PPD' AND ...) producia NULL
cuando metodo_pago era NULL (como en complementos de pago tipo P),
lo que excluia silenciosamente todos los tipo P del listado de
emitidos en conciliacion.
Cambiada a: metodo_pago IS NULL OR metodo_pago != 'PPD' OR
regimen_fiscal_emisor IN ('605','616')
Esto mantiene la intencion original (excluir PPD de regimenes
que no son 605/616) sin afectar a tipo P ni otros sin metodo de pago.
Refs: docs/CAMBIOS-2026-05-09.md seccion 8
This commit is contained in:
@@ -62,8 +62,9 @@ export async function getCfdisConConciliacion(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Excluir PPD en emitidos para todos los regimenes excepto 605 y 616
|
// Excluir PPD en emitidos para todos los regimenes excepto 605 y 616
|
||||||
|
// (metodo_pago IS NULL cubre tipo P y otros casos sin metodo de pago)
|
||||||
if (filters.tipo === 'EMITIDO') {
|
if (filters.tipo === 'EMITIDO') {
|
||||||
where += ` AND NOT (c.metodo_pago = 'PPD' AND (c.regimen_fiscal_emisor IS NULL OR c.regimen_fiscal_emisor NOT IN ('605','616')))`;
|
where += ` AND (c.metodo_pago IS NULL OR c.metodo_pago != 'PPD' OR c.regimen_fiscal_emisor IN ('605','616'))`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filters.fechaInicio) {
|
if (filters.fechaInicio) {
|
||||||
|
|||||||
Reference in New Issue
Block a user