feat: panorama facturador completamente funcional
- 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:
@@ -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'
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user