fix: correção postgress

This commit is contained in:
Alessandro Gonçaalves 2025-10-20 23:04:42 -03:00
parent d2c468dddb
commit bda93d2705
7 changed files with 1401 additions and 945 deletions

2083
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -28,16 +28,17 @@
},
"devDependencies": {
"@eslint/eslintrc": "^3",
"@tailwindcss/postcss": "^4",
"@types/node": "^20",
"@types/pg": "^8.15.5",
"@types/react": "^19",
"@types/react-dom": "^19",
"@types/xlsx": "^0.0.35",
"autoprefixer": "^10.4.21",
"drizzle-kit": "^0.31.5",
"eslint": "^9",
"eslint-config-next": "15.5.4",
"tailwindcss": "^4",
"postcss": "^8.5.6",
"tailwindcss": "^3.4.18",
"tsx": "^4.20.6",
"tw-animate-css": "^1.4.0",
"typescript": "^5"

6
postcss.config.js Normal file
View File

@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}

View File

@ -1,5 +0,0 @@
const config = {
plugins: ["@tailwindcss/postcss"],
};
export default config;

View File

@ -335,10 +335,10 @@ export default function AnaliticoComponent({ filtros }: AnaliticoProps) {
// Usar dados filtrados da tabela em vez dos dados originais - MESMA LÓGICA DO totalValor
const filteredData = table.getRowModel().rows.map((row) => row.original);
const valorRealizado = filteredData.reduce((sum, item) => {
const valor =
const valor =
typeof item.valor === "string" ? parseFloat(item.valor) : item.valor;
return sum + (isNaN(valor) ? 0 : valor);
}, 0);
return sum + (isNaN(valor) ? 0 : valor);
}, 0);
return {
valorRealizado,
@ -475,17 +475,17 @@ export default function AnaliticoComponent({ filtros }: AnaliticoProps) {
Limpar Filtros
</Button>
)}
{data.length > 0 && (
<Button
onClick={exportToExcel}
variant="outline"
size="sm"
{data.length > 0 && (
<Button
onClick={exportToExcel}
variant="outline"
size="sm"
className="flex items-center gap-2 bg-white border-gray-300 hover:bg-green-50 hover:border-green-300 text-gray-700"
>
<Download className="h-4 w-4" />
Exportar XLSX
</Button>
)}
>
<Download className="h-4 w-4" />
Exportar XLSX
</Button>
)}
</div>
</div>
@ -526,8 +526,8 @@ export default function AnaliticoComponent({ filtros }: AnaliticoProps) {
<div className="w-[50px] whitespace-nowrap">
Número do Lançamento
</div>
</div>
</div>
</div>
{/* Table Body */}
<div
@ -583,36 +583,36 @@ export default function AnaliticoComponent({ filtros }: AnaliticoProps) {
{new Date(
row.original.data_vencimento
).toLocaleDateString("pt-BR")}
</div>
</div>
<div className="w-[120px] text-gray-600 whitespace-nowrap">
{new Date(row.original.data_caixa).toLocaleDateString(
"pt-BR"
)}
</div>
</div>
<div className="w-[100px] text-gray-500 whitespace-nowrap">
-
</div>
</div>
<div className="w-[160px] font-medium text-gray-900 whitespace-nowrap">
{row.original.codigo_fornecedor}
</div>
</div>
<div
className="w-[220px] text-gray-700 truncate"
title={row.original.nome_fornecedor}
>
{row.original.nome_fornecedor}
</div>
</div>
<div className="w-[140px] text-gray-600 whitespace-nowrap">
{row.original.codigo_centrocusto}
</div>
</div>
<div className="w-[130px] text-gray-600 whitespace-nowrap">
{row.original.codigo_conta}
</div>
</div>
<div
className="w-[160px] text-gray-700 truncate"
title={row.original.conta}
>
{row.original.conta}
</div>
</div>
<div
className={`w-[130px] text-right font-semibold whitespace-nowrap ${
row.original.valor < 0
@ -624,37 +624,37 @@ export default function AnaliticoComponent({ filtros }: AnaliticoProps) {
style: "currency",
currency: "BRL",
}).format(row.original.valor)}
</div>
</div>
<div className="w-[120px] text-gray-500 text-right whitespace-nowrap">
-
</div>
</div>
<div className="w-[130px] text-gray-500 text-right whitespace-nowrap">
-
</div>
</div>
<div className="w-[110px] text-gray-500 text-right whitespace-nowrap">
-
</div>
</div>
<div
className="w-[200px] text-gray-700 truncate"
title={row.original.historico}
>
{row.original.historico}
</div>
</div>
<div
className="w-[200px] text-gray-700 truncate"
title={row.original.historico2}
>
{row.original.historico2}
</div>
</div>
<div className="w-[50px] text-gray-500 whitespace-nowrap">
-
</div>
</div>
</div>
</div>
);
})}
</div>
</div>
)}
</div>
</div>
{/* Footer com Totalizador das Colunas */}
{data.length > 0 && (
@ -694,8 +694,8 @@ export default function AnaliticoComponent({ filtros }: AnaliticoProps) {
<div className="w-[200px] whitespace-nowrap"></div>
<div className="w-[200px] whitespace-nowrap"></div>
<div className="w-[50px] whitespace-nowrap"></div>
</div>
</div>
</div>
)}
{/* Summary Footer - Integrado */}
@ -782,7 +782,7 @@ export default function AnaliticoComponent({ filtros }: AnaliticoProps) {
))}
</SelectContent>
</Select>
</div>
</div>
<div className="flex-1">
<label className="block text-sm font-medium text-gray-700 mb-1">
@ -810,7 +810,7 @@ export default function AnaliticoComponent({ filtros }: AnaliticoProps) {
<SelectItem value="notEmpty">não está vazio</SelectItem>
</SelectContent>
</Select>
</div>
</div>
{!(
cond.operator === "empty" || cond.operator === "notEmpty"
@ -829,7 +829,7 @@ export default function AnaliticoComponent({ filtros }: AnaliticoProps) {
placeholder="Digite o valor"
className="w-full bg-white border-gray-300"
/>
</div>
</div>
)}
{conditions.length > 1 && (
@ -845,8 +845,8 @@ export default function AnaliticoComponent({ filtros }: AnaliticoProps) {
>
</Button>
</div>
)}
</div>
)}
</div>
))}

View File

@ -1,71 +1,58 @@
@import 'tailwindcss';
@tailwind base;
@tailwind components;
@tailwind utilities;
:root {
--radius: 0.65rem;
--background: oklch(1 0 0);
--foreground: oklch(0.145 0 0);
--card: oklch(1 0 0);
--card-foreground: oklch(0.145 0 0);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.145 0 0);
--primary: oklch(0.205 0 0);
--primary-foreground: oklch(0.985 0 0);
--secondary: oklch(0.97 0 0);
--secondary-foreground: oklch(0.205 0 0);
--muted: oklch(0.97 0 0);
--muted-foreground: oklch(0.556 0 0);
--accent: oklch(0.97 0 0);
--accent-foreground: oklch(0.205 0 0);
--destructive: oklch(0.577 0.245 27.325);
--border: oklch(0.922 0 0);
--input: oklch(0.922 0 0);
--ring: oklch(0.708 0 0);
--chart-1: oklch(0.646 0.222 41.116);
--chart-2: oklch(0.6 0.118 184.704);
--chart-3: oklch(0.398 0.07 227.392);
--chart-4: oklch(0.828 0.189 84.429);
--chart-5: oklch(0.769 0.188 70.08);
--radius: 0.625rem;
--sidebar: oklch(0.985 0 0);
--sidebar-foreground: oklch(0.145 0 0);
--sidebar-primary: oklch(0.205 0 0);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.97 0 0);
--sidebar-accent-foreground: oklch(0.205 0 0);
--sidebar-border: oklch(0.922 0 0);
--sidebar-ring: oklch(0.708 0 0);
--radius: 0.5rem;
--background: 0 0% 100%;
--foreground: 222.2 84% 4.9%;
--card: 0 0% 100%;
--card-foreground: 222.2 84% 4.9%;
--popover: 0 0% 100%;
--popover-foreground: 222.2 84% 4.9%;
--primary: 222.2 47.4% 11.2%;
--primary-foreground: 210 40% 98%;
--secondary: 210 40% 96%;
--secondary-foreground: 222.2 47.4% 11.2%;
--muted: 210 40% 96%;
--muted-foreground: 215.4 16.3% 46.9%;
--accent: 210 40% 96%;
--accent-foreground: 222.2 47.4% 11.2%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 210 40% 98%;
--border: 214.3 31.8% 91.4%;
--input: 214.3 31.8% 91.4%;
--ring: 222.2 84% 4.9%;
--chart-1: 12 76% 61%;
--chart-2: 173 58% 39%;
--chart-3: 197 37% 24%;
--chart-4: 43 74% 66%;
--chart-5: 27 87% 67%;
}
.dark {
--background: oklch(0.145 0 0);
--foreground: oklch(0.985 0 0);
--card: oklch(0.205 0 0);
--card-foreground: oklch(0.985 0 0);
--popover: oklch(0.205 0 0);
--popover-foreground: oklch(0.985 0 0);
--primary: oklch(0.922 0 0);
--primary-foreground: oklch(0.205 0 0);
--secondary: oklch(0.269 0 0);
--secondary-foreground: oklch(0.985 0 0);
--muted: oklch(0.269 0 0);
--muted-foreground: oklch(0.708 0 0);
--accent: oklch(0.269 0 0);
--accent-foreground: oklch(0.985 0 0);
--destructive: oklch(0.704 0.191 22.216);
--border: oklch(1 0 0 / 10%);
--input: oklch(1 0 0 / 15%);
--ring: oklch(0.556 0 0);
--chart-1: oklch(0.488 0.243 264.376);
--chart-2: oklch(0.696 0.17 162.48);
--chart-3: oklch(0.769 0.188 70.08);
--chart-4: oklch(0.627 0.265 303.9);
--chart-5: oklch(0.645 0.246 16.439);
--sidebar: oklch(0.205 0 0);
--sidebar-foreground: oklch(0.985 0 0);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.269 0 0);
--sidebar-accent-foreground: oklch(0.985 0 0);
--sidebar-border: oklch(1 0 0 / 10%);
--sidebar-ring: oklch(0.556 0 0);
--background: 222.2 84% 4.9%;
--foreground: 210 40% 98%;
--card: 222.2 84% 4.9%;
--card-foreground: 210 40% 98%;
--popover: 222.2 84% 4.9%;
--popover-foreground: 210 40% 98%;
--primary: 210 40% 98%;
--primary-foreground: 222.2 47.4% 11.2%;
--secondary: 217.2 32.6% 17.5%;
--secondary-foreground: 210 40% 98%;
--muted: 217.2 32.6% 17.5%;
--muted-foreground: 215 20.2% 65.1%;
--accent: 217.2 32.6% 17.5%;
--accent-foreground: 210 40% 98%;
--destructive: 0 62.8% 30.6%;
--destructive-foreground: 210 40% 98%;
--border: 217.2 32.6% 17.5%;
--input: 217.2 32.6% 17.5%;
--ring: 212.7 26.8% 83.9%;
--chart-1: 220 70% 50%;
--chart-2: 160 60% 45%;
--chart-3: 30 80% 55%;
--chart-4: 280 65% 60%;
--chart-5: 340 75% 55%;
}

54
tailwind.config.js Normal file
View File

@ -0,0 +1,54 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./src/pages/**/*.{js,ts,jsx,tsx,mdx}',
'./src/components/**/*.{js,ts,jsx,tsx,mdx}',
'./src/app/**/*.{js,ts,jsx,tsx,mdx}',
],
theme: {
extend: {
colors: {
border: "hsl(var(--border))",
input: "hsl(var(--input))",
ring: "hsl(var(--ring))",
background: "hsl(var(--background))",
foreground: "hsl(var(--foreground))",
primary: {
DEFAULT: "hsl(var(--primary))",
foreground: "hsl(var(--primary-foreground))",
},
secondary: {
DEFAULT: "hsl(var(--secondary))",
foreground: "hsl(var(--secondary-foreground))",
},
destructive: {
DEFAULT: "hsl(var(--destructive))",
foreground: "hsl(var(--destructive-foreground))",
},
muted: {
DEFAULT: "hsl(var(--muted))",
foreground: "hsl(var(--muted-foreground))",
},
accent: {
DEFAULT: "hsl(var(--accent))",
foreground: "hsl(var(--accent-foreground))",
},
popover: {
DEFAULT: "hsl(var(--popover))",
foreground: "hsl(var(--popover-foreground))",
},
card: {
DEFAULT: "hsl(var(--card))",
foreground: "hsl(var(--card-foreground))",
},
},
borderRadius: {
lg: "var(--radius)",
md: "calc(var(--radius) - 2px)",
sm: "calc(var(--radius) - 4px)",
},
},
},
plugins: [],
}