fix(conciliacion): headers visibles aun sin resultados en filtros
This commit is contained in:
@@ -376,11 +376,6 @@ export default function ConciliacionPage() {
|
|||||||
<Card>
|
<Card>
|
||||||
<CardContent className="pt-6">
|
<CardContent className="pt-6">
|
||||||
<h3 className="font-medium mb-4">Por conciliar ({pendientesOrdenados.length})</h3>
|
<h3 className="font-medium mb-4">Por conciliar ({pendientesOrdenados.length})</h3>
|
||||||
{pendientesOrdenados.length === 0 ? (
|
|
||||||
<p className="text-sm text-muted-foreground">
|
|
||||||
No hay CFDIs pendientes de conciliar
|
|
||||||
</p>
|
|
||||||
) : (
|
|
||||||
<div className="overflow-x-auto">
|
<div className="overflow-x-auto">
|
||||||
<table className="w-full text-sm">
|
<table className="w-full text-sm">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -412,51 +407,58 @@ export default function ConciliacionPage() {
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{pendientesOrdenados.map((cfdi) => (
|
{pendientesOrdenados.length === 0 ? (
|
||||||
<tr key={cfdi.id} className="border-b hover:bg-muted/50">
|
<tr>
|
||||||
{!isVisor && (
|
<td colSpan={isVisor ? 9 : 10} className="py-4 text-sm text-muted-foreground text-center">
|
||||||
<td className="py-2">
|
No hay CFDIs pendientes de conciliar
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
checked={selected.has(cfdi.id)}
|
|
||||||
onChange={() => toggleSelect(cfdi.id)}
|
|
||||||
/>
|
|
||||||
</td>
|
|
||||||
)}
|
|
||||||
<td className="py-2 font-mono text-xs text-center" title={cfdi.uuid}>
|
|
||||||
{cfdi.uuid?.substring(0, 8)}
|
|
||||||
</td>
|
|
||||||
<td className="py-2 text-xs text-center">
|
|
||||||
{toCfdiDate(cfdi.fechaPagoP || cfdi.fechaEmision).toLocaleDateString('es-MX')}
|
|
||||||
</td>
|
|
||||||
<td className="py-2 font-mono text-xs text-center">{cfdi.rfcEmisor}</td>
|
|
||||||
<td className="py-2 text-xs truncate max-w-[120px] text-center">
|
|
||||||
{cfdi.nombreEmisor}
|
|
||||||
</td>
|
|
||||||
<td className="py-2 font-mono text-xs text-center">{cfdi.rfcReceptor}</td>
|
|
||||||
<td className="py-2 text-xs truncate max-w-[120px] text-center">
|
|
||||||
{cfdi.nombreReceptor}
|
|
||||||
</td>
|
|
||||||
<td className="py-2 text-xs font-medium text-center">
|
|
||||||
{formatCurrencyConciliacion(getMonto(cfdi))}
|
|
||||||
</td>
|
|
||||||
<td className="py-2 text-xs text-center">{cfdi.metodoPago || '-'}</td>
|
|
||||||
<td className="py-2 text-center">
|
|
||||||
<Button
|
|
||||||
variant="ghost"
|
|
||||||
size="sm"
|
|
||||||
onClick={() => setSelectedCfdi(cfdi)}
|
|
||||||
title="Ver factura"
|
|
||||||
>
|
|
||||||
<Eye className="h-4 w-4" />
|
|
||||||
</Button>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
) : (
|
||||||
|
pendientesOrdenados.map((cfdi) => (
|
||||||
|
<tr key={cfdi.id} className="border-b hover:bg-muted/50">
|
||||||
|
{!isVisor && (
|
||||||
|
<td className="py-2">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
checked={selected.has(cfdi.id)}
|
||||||
|
onChange={() => toggleSelect(cfdi.id)}
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
|
)}
|
||||||
|
<td className="py-2 font-mono text-xs text-center" title={cfdi.uuid}>
|
||||||
|
{cfdi.uuid?.substring(0, 8)}
|
||||||
|
</td>
|
||||||
|
<td className="py-2 text-xs text-center">
|
||||||
|
{toCfdiDate(cfdi.fechaPagoP || cfdi.fechaEmision).toLocaleDateString('es-MX')}
|
||||||
|
</td>
|
||||||
|
<td className="py-2 font-mono text-xs text-center">{cfdi.rfcEmisor}</td>
|
||||||
|
<td className="py-2 text-xs truncate max-w-[120px] text-center">
|
||||||
|
{cfdi.nombreEmisor}
|
||||||
|
</td>
|
||||||
|
<td className="py-2 font-mono text-xs text-center">{cfdi.rfcReceptor}</td>
|
||||||
|
<td className="py-2 text-xs truncate max-w-[120px] text-center">
|
||||||
|
{cfdi.nombreReceptor}
|
||||||
|
</td>
|
||||||
|
<td className="py-2 text-xs font-medium text-center">
|
||||||
|
{formatCurrencyConciliacion(getMonto(cfdi))}
|
||||||
|
</td>
|
||||||
|
<td className="py-2 text-xs text-center">{cfdi.metodoPago || '-'}</td>
|
||||||
|
<td className="py-2 text-center">
|
||||||
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
size="sm"
|
||||||
|
onClick={() => setSelectedCfdi(cfdi)}
|
||||||
|
title="Ver factura"
|
||||||
|
>
|
||||||
|
<Eye className="h-4 w-4" />
|
||||||
|
</Button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
))
|
||||||
|
)}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
@@ -508,9 +510,6 @@ export default function ConciliacionPage() {
|
|||||||
<Card>
|
<Card>
|
||||||
<CardContent className="pt-6">
|
<CardContent className="pt-6">
|
||||||
<h3 className="font-medium mb-4">Conciliadas ({conciliadasOrdenadas.length})</h3>
|
<h3 className="font-medium mb-4">Conciliadas ({conciliadasOrdenadas.length})</h3>
|
||||||
{conciliadasOrdenadas.length === 0 ? (
|
|
||||||
<p className="text-sm text-muted-foreground">No hay CFDIs conciliados</p>
|
|
||||||
) : (
|
|
||||||
<div className="overflow-x-auto">
|
<div className="overflow-x-auto">
|
||||||
<table className="w-full text-sm">
|
<table className="w-full text-sm">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -530,60 +529,67 @@ export default function ConciliacionPage() {
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{conciliadasOrdenadas.map((cfdi) => (
|
{conciliadasOrdenadas.length === 0 ? (
|
||||||
<tr key={cfdi.id} className="border-b hover:bg-muted/50">
|
<tr>
|
||||||
<td className="py-2 font-mono text-xs text-center" title={cfdi.uuid}>
|
<td colSpan={8} className="py-4 text-sm text-muted-foreground text-center">
|
||||||
{cfdi.uuid?.substring(0, 8)}
|
No hay CFDIs conciliados
|
||||||
</td>
|
</td>
|
||||||
<td className="py-2 text-xs text-center">
|
</tr>
|
||||||
{toCfdiDate(cfdi.fechaPagoP || cfdi.fechaEmision).toLocaleDateString('es-MX')}
|
) : (
|
||||||
</td>
|
conciliadasOrdenadas.map((cfdi) => (
|
||||||
<td className="py-2 font-mono text-xs text-center">{activeTab === 'EMITIDO' ? cfdi.rfcReceptor : cfdi.rfcEmisor}</td>
|
<tr key={cfdi.id} className="border-b hover:bg-muted/50">
|
||||||
<td className="py-2 text-xs truncate max-w-[120px] text-center">
|
<td className="py-2 font-mono text-xs text-center" title={cfdi.uuid}>
|
||||||
{activeTab === 'EMITIDO' ? cfdi.nombreReceptor : cfdi.nombreEmisor}
|
{cfdi.uuid?.substring(0, 8)}
|
||||||
</td>
|
</td>
|
||||||
<td className="py-2 text-xs font-medium text-center">
|
<td className="py-2 text-xs text-center">
|
||||||
{formatCurrencyConciliacion(getMonto(cfdi))}
|
{toCfdiDate(cfdi.fechaPagoP || cfdi.fechaEmision).toLocaleDateString('es-MX')}
|
||||||
</td>
|
</td>
|
||||||
<td className="py-2 text-xs text-center">
|
<td className="py-2 font-mono text-xs text-center">{activeTab === 'EMITIDO' ? cfdi.rfcReceptor : cfdi.rfcEmisor}</td>
|
||||||
{cfdi.conciliacion?.fechaDePago
|
<td className="py-2 text-xs truncate max-w-[120px] text-center">
|
||||||
? new Date(
|
{activeTab === 'EMITIDO' ? cfdi.nombreReceptor : cfdi.nombreEmisor}
|
||||||
(cfdi.conciliacion.fechaDePago.split('T')[0]) + 'T12:00:00',
|
</td>
|
||||||
).toLocaleDateString('es-MX')
|
<td className="py-2 text-xs font-medium text-center">
|
||||||
: '-'}
|
{formatCurrencyConciliacion(getMonto(cfdi))}
|
||||||
</td>
|
</td>
|
||||||
<td className="py-2 text-xs text-center">
|
<td className="py-2 text-xs text-center">
|
||||||
{cfdi.conciliacion
|
{cfdi.conciliacion?.fechaDePago
|
||||||
? `${cfdi.conciliacion.banco} ****${cfdi.conciliacion.terminacionCuenta}`
|
? new Date(
|
||||||
: '-'}
|
(cfdi.conciliacion.fechaDePago.split('T')[0]) + 'T12:00:00',
|
||||||
</td>
|
).toLocaleDateString('es-MX')
|
||||||
<td className="py-2 flex gap-1 justify-center">
|
: '-'}
|
||||||
<Button
|
</td>
|
||||||
variant="ghost"
|
<td className="py-2 text-xs text-center">
|
||||||
size="sm"
|
{cfdi.conciliacion
|
||||||
onClick={() => setSelectedCfdi(cfdi)}
|
? `${cfdi.conciliacion.banco} ****${cfdi.conciliacion.terminacionCuenta}`
|
||||||
title="Ver factura"
|
: '-'}
|
||||||
>
|
</td>
|
||||||
<Eye className="h-4 w-4" />
|
<td className="py-2 flex gap-1 justify-center">
|
||||||
</Button>
|
|
||||||
{!isVisor && cfdi.conciliacion && (
|
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={() => handleDesconciliar(cfdi.conciliacion!.id)}
|
onClick={() => setSelectedCfdi(cfdi)}
|
||||||
title="Desconciliar"
|
title="Ver factura"
|
||||||
className="text-destructive hover:text-destructive"
|
|
||||||
>
|
>
|
||||||
<X className="h-4 w-4" />
|
<Eye className="h-4 w-4" />
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
{!isVisor && cfdi.conciliacion && (
|
||||||
</td>
|
<Button
|
||||||
</tr>
|
variant="ghost"
|
||||||
))}
|
size="sm"
|
||||||
|
onClick={() => handleDesconciliar(cfdi.conciliacion!.id)}
|
||||||
|
title="Desconciliar"
|
||||||
|
className="text-destructive hover:text-destructive"
|
||||||
|
>
|
||||||
|
<X className="h-4 w-4" />
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
))
|
||||||
|
)}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user