fix: subistituição da tabela analitica
This commit is contained in:
parent
7e2f66bdba
commit
0d7d3986f4
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,36 +72,47 @@ 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) => ({
|
||||
codigo_grupo: item.CODGRUPO || "",
|
||||
codigo_subgrupo: "", // Não existe na tabela Oracle
|
||||
codigo_fornecedor: item.CODFORNEC || "",
|
||||
nome_fornecedor: item.FORNECEDOR || "",
|
||||
id: item.NUMLANC || 0,
|
||||
codfilial: "001", // Valor padrão
|
||||
recnum: item.NUMLANC || 0,
|
||||
data_competencia: item.ANOMESCOMP || "",
|
||||
data_vencimento: item.DTVENC ? new Date(item.DTVENC).toISOString().split('T')[0] : "",
|
||||
data_pagamento: "", // Não existe na tabela Oracle
|
||||
data_caixa: item.DTCAIXA ? new Date(item.DTCAIXA).toISOString().split('T')[0] : "",
|
||||
codigo_conta: item.CODCONTA || "",
|
||||
conta: item.CONTA || "",
|
||||
codigo_centrocusto: item.CODIGOCENTROCUSTO || "",
|
||||
valor: item.VLREALIZADO || 0,
|
||||
historico: item.HISTORICO || "",
|
||||
historico2: item.HISTORICO2 || "",
|
||||
created_at: new Date().toISOString(),
|
||||
updated_at: new Date().toISOString(),
|
||||
// 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,
|
||||
numero_lancamento: item.NUMLANC || 0,
|
||||
ano_mes_comp: item.ANOMESCOMP || "",
|
||||
codgrupo: item.CODGRUPO || ""
|
||||
}));
|
||||
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 || "",
|
||||
nome_fornecedor: item.FORNECEDOR || "",
|
||||
id: item.NUMLANC || 0,
|
||||
codfilial: "001", // Valor padrão
|
||||
recnum: item.NUMLANC || 0,
|
||||
data_competencia: item.ANOMESCOMP || "",
|
||||
data_vencimento: item.DTVENC ? new Date(item.DTVENC).toISOString().split('T')[0] : "",
|
||||
data_pagamento: "", // Não existe na tabela Oracle
|
||||
data_caixa: item.DTCAIXA ? new Date(item.DTCAIXA).toISOString().split('T')[0] : "",
|
||||
codigo_conta: item.CODCONTA || "",
|
||||
conta: item.CONTA || "",
|
||||
codigo_centrocusto: item.CODIGOCENTROCUSTO || "",
|
||||
valor: item.VLREALIZADO !== null && item.VLREALIZADO !== undefined ? Number(item.VLREALIZADO) : 0,
|
||||
historico: item.HISTORICO || "",
|
||||
historico2: item.HISTORICO2 || "",
|
||||
created_at: new Date().toISOString(),
|
||||
updated_at: new Date().toISOString(),
|
||||
// Campos adicionais do Oracle
|
||||
entidade: item.ENTIDADE || "",
|
||||
tipo_parceiro: item.TIPOPARCEIRO || "",
|
||||
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