Merge pull request #8 from JurunenseDevInterno/dev

Dev
This commit is contained in:
Alessandro Gonçalves 2025-10-22 19:56:44 -03:00 committed by GitHub
commit e32473710d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 1927 additions and 737 deletions

1154
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -9,6 +9,11 @@
"lint": "eslint" "lint": "eslint"
}, },
"dependencies": { "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-checkbox": "^1.3.3",
"@radix-ui/react-dialog": "^1.1.15", "@radix-ui/react-dialog": "^1.1.15",
"@radix-ui/react-label": "^2.1.7", "@radix-ui/react-label": "^2.1.7",

File diff suppressed because it is too large Load Diff

View File

@ -72,36 +72,47 @@ export async function GET(request: NextRequest) {
console.log('📝 Primeiros 3 registros:', data.slice(0, 3)); console.log('📝 Primeiros 3 registros:', data.slice(0, 3));
// Transformar os dados do Oracle para o formato esperado pelo componente // Transformar os dados do Oracle para o formato esperado pelo componente
const transformedData = data.map((item: any) => ({ const transformedData = data.map((item: any) => {
codigo_grupo: item.CODGRUPO || "", // Debug dos valores monetários
codigo_subgrupo: "", // Não existe na tabela Oracle console.log('🔍 Item original:', {
codigo_fornecedor: item.CODFORNEC || "", VLREALIZADO: item.VLREALIZADO,
nome_fornecedor: item.FORNECEDOR || "", VLPREVISTO: item.VLPREVISTO,
id: item.NUMLANC || 0, VLCONFIRMADO: item.VLCONFIRMADO,
codfilial: "001", // Valor padrão VLPAGO: item.VLPAGO,
recnum: item.NUMLANC || 0, tipo_VLREALIZADO: typeof item.VLREALIZADO
data_competencia: item.ANOMESCOMP || "", });
data_vencimento: item.DTVENC ? new Date(item.DTVENC).toISOString().split('T')[0] : "",
data_pagamento: "", // Não existe na tabela Oracle return {
data_caixa: item.DTCAIXA ? new Date(item.DTCAIXA).toISOString().split('T')[0] : "", codigo_grupo: item.CODGRUPO || "",
codigo_conta: item.CODCONTA || "", codigo_subgrupo: "", // Não existe na tabela Oracle
conta: item.CONTA || "", codigo_fornecedor: item.CODFORNEC || "",
codigo_centrocusto: item.CODIGOCENTROCUSTO || "", nome_fornecedor: item.FORNECEDOR || "",
valor: item.VLREALIZADO || 0, id: item.NUMLANC || 0,
historico: item.HISTORICO || "", codfilial: "001", // Valor padrão
historico2: item.HISTORICO2 || "", recnum: item.NUMLANC || 0,
created_at: new Date().toISOString(), data_competencia: item.ANOMESCOMP || "",
updated_at: new Date().toISOString(), data_vencimento: item.DTVENC ? new Date(item.DTVENC).toISOString().split('T')[0] : "",
// Campos adicionais do Oracle data_pagamento: "", // Não existe na tabela Oracle
entidade: item.ENTIDADE || "", data_caixa: item.DTCAIXA ? new Date(item.DTCAIXA).toISOString().split('T')[0] : "",
tipo_parceiro: item.TIPOPARCEIRO || "", codigo_conta: item.CODCONTA || "",
valor_previsto: item.VLPREVISTO || 0, conta: item.CONTA || "",
valor_confirmado: item.VLCONFIRMADO || 0, codigo_centrocusto: item.CODIGOCENTROCUSTO || "",
valor_pago: item.VLPAGO || 0, valor: item.VLREALIZADO !== null && item.VLREALIZADO !== undefined ? Number(item.VLREALIZADO) : 0,
numero_lancamento: item.NUMLANC || 0, historico: item.HISTORICO || "",
ano_mes_comp: item.ANOMESCOMP || "", historico2: item.HISTORICO2 || "",
codgrupo: item.CODGRUPO || "" 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('🔄 Dados transformados:', transformedData.length, 'registros');
console.log('📝 Primeiros 3 transformados:', transformedData.slice(0, 3)); console.log('📝 Primeiros 3 transformados:', transformedData.slice(0, 3));