feat: panorama facturador completamente funcional
All checks were successful
build-and-deploy / build (push) Successful in 43s
build-and-deploy / deploy (push) Successful in 3s

- Remover badge de mantenimiento del sidebar
- Eliminar endpoints de debug temporales
- Panorama funcionando con todas las secciones:
  * Totales Financieros
  * Café Seco - Inventario y Proyecciones
  * Totales de Ingreso y Compra
  * Totales Monetarios
  * Café Verde
  * Rechazos y Subproductos
- Todas las 9 queries de Metabase ejecutándose correctamente
- Datos reales mostrados en tiempo real
This commit is contained in:
2025-10-14 10:57:26 -06:00
parent 7ba274a291
commit 93668d9b6f
3 changed files with 1 additions and 78 deletions

View File

@@ -237,8 +237,7 @@ const navigationPrimary = computed<NavigationMenuItem[]>(() => [
label: 'Panorama Facturador',
icon: 'i-lucide-bar-chart-3',
to: '/panorama',
active: route.path === '/panorama',
badge: { label: 'Mantenimiento', color: 'amber' }
active: route.path === '/panorama'
},
{
label: 'Informe Ingresos',

View File

@@ -1,26 +0,0 @@
/**
* List all Metabase queries/cards (for debugging)
*/
export default defineEventHandler(async (event) => {
try {
const allCards = await getMetabaseCards('all')
// Filter to show only relevant info
const cards = allCards.map((card: any) => ({
id: card.id,
name: card.name,
description: card.description
}))
return {
total: cards.length,
cards: cards.filter((c: any) => c.name.includes('panorama'))
}
} catch (error: any) {
console.error('[API] Failed to list queries:', error)
throw createError({
statusCode: error.statusCode || 500,
statusMessage: error.statusMessage || 'Failed to list queries'
})
}
})

View File

@@ -1,50 +0,0 @@
/**
* Test a single query to debug (temporary endpoint)
*/
export default defineEventHandler(async (event) => {
const query = getQuery(event)
const cardId = query.cardId ? parseInt(query.cardId as string) : 39 // Default to ingreso_compra
try {
console.log(`[Test] Executing card ${cardId}`)
const parameters = [
{
type: 'date/single',
target: ['variable', ['template-tag', 'fecha_desde']],
value: null
},
{
type: 'date/single',
target: ['variable', ['template-tag', 'fecha_hasta']],
value: null
},
{
type: 'category',
target: ['variable', ['template-tag', 'incluir_anulados']],
value: false
}
]
const result = await executeCardQuery(cardId, parameters)
return {
cardId,
success: true,
hasData: !!result.data,
rowCount: result.data?.rows?.length || 0,
colCount: result.data?.cols?.length || 0,
cols: result.data?.cols?.map((c: any) => c.name) || [],
firstRow: result.data?.rows?.[0] || null,
fullResult: result
}
} catch (error: any) {
console.error('[Test] Error:', error)
return {
cardId,
success: false,
error: error.message,
stack: error.stack
}
}
})