fix: correção postgress
This commit is contained in:
parent
d2c468dddb
commit
bda93d2705
File diff suppressed because it is too large
Load Diff
|
|
@ -28,16 +28,17 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/eslintrc": "^3",
|
"@eslint/eslintrc": "^3",
|
||||||
"@tailwindcss/postcss": "^4",
|
|
||||||
"@types/node": "^20",
|
"@types/node": "^20",
|
||||||
"@types/pg": "^8.15.5",
|
"@types/pg": "^8.15.5",
|
||||||
"@types/react": "^19",
|
"@types/react": "^19",
|
||||||
"@types/react-dom": "^19",
|
"@types/react-dom": "^19",
|
||||||
"@types/xlsx": "^0.0.35",
|
"@types/xlsx": "^0.0.35",
|
||||||
|
"autoprefixer": "^10.4.21",
|
||||||
"drizzle-kit": "^0.31.5",
|
"drizzle-kit": "^0.31.5",
|
||||||
"eslint": "^9",
|
"eslint": "^9",
|
||||||
"eslint-config-next": "15.5.4",
|
"eslint-config-next": "15.5.4",
|
||||||
"tailwindcss": "^4",
|
"postcss": "^8.5.6",
|
||||||
|
"tailwindcss": "^3.4.18",
|
||||||
"tsx": "^4.20.6",
|
"tsx": "^4.20.6",
|
||||||
"tw-animate-css": "^1.4.0",
|
"tw-animate-css": "^1.4.0",
|
||||||
"typescript": "^5"
|
"typescript": "^5"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
module.exports = {
|
||||||
|
plugins: {
|
||||||
|
tailwindcss: {},
|
||||||
|
autoprefixer: {},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
const config = {
|
|
||||||
plugins: ["@tailwindcss/postcss"],
|
|
||||||
};
|
|
||||||
|
|
||||||
export default config;
|
|
||||||
|
|
@ -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
|
// 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 filteredData = table.getRowModel().rows.map((row) => row.original);
|
||||||
const valorRealizado = filteredData.reduce((sum, item) => {
|
const valorRealizado = filteredData.reduce((sum, item) => {
|
||||||
const valor =
|
const valor =
|
||||||
typeof item.valor === "string" ? parseFloat(item.valor) : item.valor;
|
typeof item.valor === "string" ? parseFloat(item.valor) : item.valor;
|
||||||
return sum + (isNaN(valor) ? 0 : valor);
|
return sum + (isNaN(valor) ? 0 : valor);
|
||||||
}, 0);
|
}, 0);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
valorRealizado,
|
valorRealizado,
|
||||||
|
|
@ -475,17 +475,17 @@ export default function AnaliticoComponent({ filtros }: AnaliticoProps) {
|
||||||
Limpar Filtros
|
Limpar Filtros
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
{data.length > 0 && (
|
{data.length > 0 && (
|
||||||
<Button
|
<Button
|
||||||
onClick={exportToExcel}
|
onClick={exportToExcel}
|
||||||
variant="outline"
|
variant="outline"
|
||||||
size="sm"
|
size="sm"
|
||||||
className="flex items-center gap-2 bg-white border-gray-300 hover:bg-green-50 hover:border-green-300 text-gray-700"
|
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" />
|
<Download className="h-4 w-4" />
|
||||||
Exportar XLSX
|
Exportar XLSX
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -526,8 +526,8 @@ export default function AnaliticoComponent({ filtros }: AnaliticoProps) {
|
||||||
<div className="w-[50px] whitespace-nowrap">
|
<div className="w-[50px] whitespace-nowrap">
|
||||||
Número do Lançamento
|
Número do Lançamento
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* Table Body */}
|
{/* Table Body */}
|
||||||
<div
|
<div
|
||||||
|
|
@ -583,36 +583,36 @@ export default function AnaliticoComponent({ filtros }: AnaliticoProps) {
|
||||||
{new Date(
|
{new Date(
|
||||||
row.original.data_vencimento
|
row.original.data_vencimento
|
||||||
).toLocaleDateString("pt-BR")}
|
).toLocaleDateString("pt-BR")}
|
||||||
</div>
|
</div>
|
||||||
<div className="w-[120px] text-gray-600 whitespace-nowrap">
|
<div className="w-[120px] text-gray-600 whitespace-nowrap">
|
||||||
{new Date(row.original.data_caixa).toLocaleDateString(
|
{new Date(row.original.data_caixa).toLocaleDateString(
|
||||||
"pt-BR"
|
"pt-BR"
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="w-[100px] text-gray-500 whitespace-nowrap">
|
<div className="w-[100px] text-gray-500 whitespace-nowrap">
|
||||||
-
|
-
|
||||||
</div>
|
</div>
|
||||||
<div className="w-[160px] font-medium text-gray-900 whitespace-nowrap">
|
<div className="w-[160px] font-medium text-gray-900 whitespace-nowrap">
|
||||||
{row.original.codigo_fornecedor}
|
{row.original.codigo_fornecedor}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="w-[220px] text-gray-700 truncate"
|
className="w-[220px] text-gray-700 truncate"
|
||||||
title={row.original.nome_fornecedor}
|
title={row.original.nome_fornecedor}
|
||||||
>
|
>
|
||||||
{row.original.nome_fornecedor}
|
{row.original.nome_fornecedor}
|
||||||
</div>
|
</div>
|
||||||
<div className="w-[140px] text-gray-600 whitespace-nowrap">
|
<div className="w-[140px] text-gray-600 whitespace-nowrap">
|
||||||
{row.original.codigo_centrocusto}
|
{row.original.codigo_centrocusto}
|
||||||
</div>
|
</div>
|
||||||
<div className="w-[130px] text-gray-600 whitespace-nowrap">
|
<div className="w-[130px] text-gray-600 whitespace-nowrap">
|
||||||
{row.original.codigo_conta}
|
{row.original.codigo_conta}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="w-[160px] text-gray-700 truncate"
|
className="w-[160px] text-gray-700 truncate"
|
||||||
title={row.original.conta}
|
title={row.original.conta}
|
||||||
>
|
>
|
||||||
{row.original.conta}
|
{row.original.conta}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className={`w-[130px] text-right font-semibold whitespace-nowrap ${
|
className={`w-[130px] text-right font-semibold whitespace-nowrap ${
|
||||||
row.original.valor < 0
|
row.original.valor < 0
|
||||||
|
|
@ -624,37 +624,37 @@ export default function AnaliticoComponent({ filtros }: AnaliticoProps) {
|
||||||
style: "currency",
|
style: "currency",
|
||||||
currency: "BRL",
|
currency: "BRL",
|
||||||
}).format(row.original.valor)}
|
}).format(row.original.valor)}
|
||||||
</div>
|
</div>
|
||||||
<div className="w-[120px] text-gray-500 text-right whitespace-nowrap">
|
<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 className="w-[130px] text-gray-500 text-right whitespace-nowrap">
|
||||||
-
|
-
|
||||||
</div>
|
</div>
|
||||||
<div className="w-[110px] text-gray-500 text-right whitespace-nowrap">
|
<div className="w-[110px] text-gray-500 text-right whitespace-nowrap">
|
||||||
-
|
-
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="w-[200px] text-gray-700 truncate"
|
className="w-[200px] text-gray-700 truncate"
|
||||||
title={row.original.historico}
|
title={row.original.historico}
|
||||||
>
|
>
|
||||||
{row.original.historico}
|
{row.original.historico}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="w-[200px] text-gray-700 truncate"
|
className="w-[200px] text-gray-700 truncate"
|
||||||
title={row.original.historico2}
|
title={row.original.historico2}
|
||||||
>
|
>
|
||||||
{row.original.historico2}
|
{row.original.historico2}
|
||||||
</div>
|
</div>
|
||||||
<div className="w-[50px] text-gray-500 whitespace-nowrap">
|
<div className="w-[50px] text-gray-500 whitespace-nowrap">
|
||||||
-
|
-
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Footer com Totalizador das Colunas */}
|
{/* Footer com Totalizador das Colunas */}
|
||||||
{data.length > 0 && (
|
{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-[200px] whitespace-nowrap"></div>
|
<div className="w-[200px] whitespace-nowrap"></div>
|
||||||
<div className="w-[50px] whitespace-nowrap"></div>
|
<div className="w-[50px] whitespace-nowrap"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Summary Footer - Integrado */}
|
{/* Summary Footer - Integrado */}
|
||||||
|
|
@ -782,7 +782,7 @@ export default function AnaliticoComponent({ filtros }: AnaliticoProps) {
|
||||||
))}
|
))}
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex-1">
|
<div className="flex-1">
|
||||||
<label className="block text-sm font-medium text-gray-700 mb-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>
|
<SelectItem value="notEmpty">não está vazio</SelectItem>
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{!(
|
{!(
|
||||||
cond.operator === "empty" || cond.operator === "notEmpty"
|
cond.operator === "empty" || cond.operator === "notEmpty"
|
||||||
|
|
@ -829,7 +829,7 @@ export default function AnaliticoComponent({ filtros }: AnaliticoProps) {
|
||||||
placeholder="Digite o valor"
|
placeholder="Digite o valor"
|
||||||
className="w-full bg-white border-gray-300"
|
className="w-full bg-white border-gray-300"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{conditions.length > 1 && (
|
{conditions.length > 1 && (
|
||||||
|
|
@ -845,8 +845,8 @@ export default function AnaliticoComponent({ filtros }: AnaliticoProps) {
|
||||||
>
|
>
|
||||||
✕
|
✕
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,71 +1,58 @@
|
||||||
@import 'tailwindcss';
|
@tailwind base;
|
||||||
|
@tailwind components;
|
||||||
|
@tailwind utilities;
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
--radius: 0.65rem;
|
--radius: 0.5rem;
|
||||||
--background: oklch(1 0 0);
|
--background: 0 0% 100%;
|
||||||
--foreground: oklch(0.145 0 0);
|
--foreground: 222.2 84% 4.9%;
|
||||||
--card: oklch(1 0 0);
|
--card: 0 0% 100%;
|
||||||
--card-foreground: oklch(0.145 0 0);
|
--card-foreground: 222.2 84% 4.9%;
|
||||||
--popover: oklch(1 0 0);
|
--popover: 0 0% 100%;
|
||||||
--popover-foreground: oklch(0.145 0 0);
|
--popover-foreground: 222.2 84% 4.9%;
|
||||||
--primary: oklch(0.205 0 0);
|
--primary: 222.2 47.4% 11.2%;
|
||||||
--primary-foreground: oklch(0.985 0 0);
|
--primary-foreground: 210 40% 98%;
|
||||||
--secondary: oklch(0.97 0 0);
|
--secondary: 210 40% 96%;
|
||||||
--secondary-foreground: oklch(0.205 0 0);
|
--secondary-foreground: 222.2 47.4% 11.2%;
|
||||||
--muted: oklch(0.97 0 0);
|
--muted: 210 40% 96%;
|
||||||
--muted-foreground: oklch(0.556 0 0);
|
--muted-foreground: 215.4 16.3% 46.9%;
|
||||||
--accent: oklch(0.97 0 0);
|
--accent: 210 40% 96%;
|
||||||
--accent-foreground: oklch(0.205 0 0);
|
--accent-foreground: 222.2 47.4% 11.2%;
|
||||||
--destructive: oklch(0.577 0.245 27.325);
|
--destructive: 0 84.2% 60.2%;
|
||||||
--border: oklch(0.922 0 0);
|
--destructive-foreground: 210 40% 98%;
|
||||||
--input: oklch(0.922 0 0);
|
--border: 214.3 31.8% 91.4%;
|
||||||
--ring: oklch(0.708 0 0);
|
--input: 214.3 31.8% 91.4%;
|
||||||
--chart-1: oklch(0.646 0.222 41.116);
|
--ring: 222.2 84% 4.9%;
|
||||||
--chart-2: oklch(0.6 0.118 184.704);
|
--chart-1: 12 76% 61%;
|
||||||
--chart-3: oklch(0.398 0.07 227.392);
|
--chart-2: 173 58% 39%;
|
||||||
--chart-4: oklch(0.828 0.189 84.429);
|
--chart-3: 197 37% 24%;
|
||||||
--chart-5: oklch(0.769 0.188 70.08);
|
--chart-4: 43 74% 66%;
|
||||||
--radius: 0.625rem;
|
--chart-5: 27 87% 67%;
|
||||||
--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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.dark {
|
.dark {
|
||||||
--background: oklch(0.145 0 0);
|
--background: 222.2 84% 4.9%;
|
||||||
--foreground: oklch(0.985 0 0);
|
--foreground: 210 40% 98%;
|
||||||
--card: oklch(0.205 0 0);
|
--card: 222.2 84% 4.9%;
|
||||||
--card-foreground: oklch(0.985 0 0);
|
--card-foreground: 210 40% 98%;
|
||||||
--popover: oklch(0.205 0 0);
|
--popover: 222.2 84% 4.9%;
|
||||||
--popover-foreground: oklch(0.985 0 0);
|
--popover-foreground: 210 40% 98%;
|
||||||
--primary: oklch(0.922 0 0);
|
--primary: 210 40% 98%;
|
||||||
--primary-foreground: oklch(0.205 0 0);
|
--primary-foreground: 222.2 47.4% 11.2%;
|
||||||
--secondary: oklch(0.269 0 0);
|
--secondary: 217.2 32.6% 17.5%;
|
||||||
--secondary-foreground: oklch(0.985 0 0);
|
--secondary-foreground: 210 40% 98%;
|
||||||
--muted: oklch(0.269 0 0);
|
--muted: 217.2 32.6% 17.5%;
|
||||||
--muted-foreground: oklch(0.708 0 0);
|
--muted-foreground: 215 20.2% 65.1%;
|
||||||
--accent: oklch(0.269 0 0);
|
--accent: 217.2 32.6% 17.5%;
|
||||||
--accent-foreground: oklch(0.985 0 0);
|
--accent-foreground: 210 40% 98%;
|
||||||
--destructive: oklch(0.704 0.191 22.216);
|
--destructive: 0 62.8% 30.6%;
|
||||||
--border: oklch(1 0 0 / 10%);
|
--destructive-foreground: 210 40% 98%;
|
||||||
--input: oklch(1 0 0 / 15%);
|
--border: 217.2 32.6% 17.5%;
|
||||||
--ring: oklch(0.556 0 0);
|
--input: 217.2 32.6% 17.5%;
|
||||||
--chart-1: oklch(0.488 0.243 264.376);
|
--ring: 212.7 26.8% 83.9%;
|
||||||
--chart-2: oklch(0.696 0.17 162.48);
|
--chart-1: 220 70% 50%;
|
||||||
--chart-3: oklch(0.769 0.188 70.08);
|
--chart-2: 160 60% 45%;
|
||||||
--chart-4: oklch(0.627 0.265 303.9);
|
--chart-3: 30 80% 55%;
|
||||||
--chart-5: oklch(0.645 0.246 16.439);
|
--chart-4: 280 65% 60%;
|
||||||
--sidebar: oklch(0.205 0 0);
|
--chart-5: 340 75% 55%;
|
||||||
--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);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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: [],
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
Reference in New Issue