Merge pull request #7 from JurunenseDevInterno/fix-tabela-analitica-customizar-filtro
Fix tabela analitica customizar filtro
This commit is contained in:
commit
d7b54cc5c4
File diff suppressed because it is too large
Load Diff
|
|
@ -9,6 +9,11 @@
|
|||
"lint": "eslint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.14.0",
|
||||
"@emotion/styled": "^11.14.1",
|
||||
"@mui/material": "^7.3.4",
|
||||
"@mui/x-data-grid": "^8.14.1",
|
||||
"@mui/x-data-grid-pro": "^8.14.1",
|
||||
"@radix-ui/react-checkbox": "^1.3.3",
|
||||
"@radix-ui/react-dialog": "^1.1.15",
|
||||
"@radix-ui/react-label": "^2.1.7",
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -72,7 +72,17 @@ export async function GET(request: NextRequest) {
|
|||
console.log('📝 Primeiros 3 registros:', data.slice(0, 3));
|
||||
|
||||
// Transformar os dados do Oracle para o formato esperado pelo componente
|
||||
const transformedData = data.map((item: any) => ({
|
||||
const transformedData = data.map((item: any) => {
|
||||
// Debug dos valores monetários
|
||||
console.log('🔍 Item original:', {
|
||||
VLREALIZADO: item.VLREALIZADO,
|
||||
VLPREVISTO: item.VLPREVISTO,
|
||||
VLCONFIRMADO: item.VLCONFIRMADO,
|
||||
VLPAGO: item.VLPAGO,
|
||||
tipo_VLREALIZADO: typeof item.VLREALIZADO
|
||||
});
|
||||
|
||||
return {
|
||||
codigo_grupo: item.CODGRUPO || "",
|
||||
codigo_subgrupo: "", // Não existe na tabela Oracle
|
||||
codigo_fornecedor: item.CODFORNEC || "",
|
||||
|
|
@ -87,7 +97,7 @@ export async function GET(request: NextRequest) {
|
|||
codigo_conta: item.CODCONTA || "",
|
||||
conta: item.CONTA || "",
|
||||
codigo_centrocusto: item.CODIGOCENTROCUSTO || "",
|
||||
valor: item.VLREALIZADO || 0,
|
||||
valor: item.VLREALIZADO !== null && item.VLREALIZADO !== undefined ? Number(item.VLREALIZADO) : 0,
|
||||
historico: item.HISTORICO || "",
|
||||
historico2: item.HISTORICO2 || "",
|
||||
created_at: new Date().toISOString(),
|
||||
|
|
@ -95,13 +105,14 @@ export async function GET(request: NextRequest) {
|
|||
// Campos adicionais do Oracle
|
||||
entidade: item.ENTIDADE || "",
|
||||
tipo_parceiro: item.TIPOPARCEIRO || "",
|
||||
valor_previsto: item.VLPREVISTO || 0,
|
||||
valor_confirmado: item.VLCONFIRMADO || 0,
|
||||
valor_pago: item.VLPAGO || 0,
|
||||
valor_previsto: item.VLPREVISTO !== null && item.VLPREVISTO !== undefined ? Number(item.VLPREVISTO) : 0,
|
||||
valor_confirmado: item.VLCONFIRMADO !== null && item.VLCONFIRMADO !== undefined ? Number(item.VLCONFIRMADO) : 0,
|
||||
valor_pago: item.VLPAGO !== null && item.VLPAGO !== undefined ? Number(item.VLPAGO) : 0,
|
||||
numero_lancamento: item.NUMLANC || 0,
|
||||
ano_mes_comp: item.ANOMESCOMP || "",
|
||||
codgrupo: item.CODGRUPO || ""
|
||||
}));
|
||||
};
|
||||
});
|
||||
|
||||
console.log('🔄 Dados transformados:', transformedData.length, 'registros');
|
||||
console.log('📝 Primeiros 3 transformados:', transformedData.slice(0, 3));
|
||||
|
|
|
|||
Loading…
Reference in New Issue