@hed-hog/finance 0.0.301 → 0.0.303
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/hedhog/data/menu.yaml +0 -17
- package/hedhog/frontend/app/_components/finance-layout.tsx.ejs +23 -0
- package/hedhog/frontend/app/accounts-payable/approvals/page.tsx.ejs +86 -91
- package/hedhog/frontend/app/accounts-payable/installments/page.tsx.ejs +1457 -1446
- package/hedhog/frontend/app/accounts-receivable/collections-default/page.tsx.ejs +323 -324
- package/hedhog/frontend/app/accounts-receivable/installments/page.tsx.ejs +1252 -1235
- package/hedhog/frontend/app/administration/audit-logs/page.tsx.ejs +12 -7
- package/hedhog/frontend/app/administration/categories/page.tsx.ejs +32 -14
- package/hedhog/frontend/app/administration/cost-centers/page.tsx.ejs +13 -5
- package/hedhog/frontend/app/administration/period-close/page.tsx.ejs +148 -147
- package/hedhog/frontend/app/cash-and-banks/bank-accounts/page.tsx.ejs +400 -404
- package/hedhog/frontend/app/cash-and-banks/statements/page.tsx.ejs +9 -10
- package/hedhog/frontend/app/cash-and-banks/transfers/page.tsx.ejs +2 -6
- package/hedhog/frontend/app/page.tsx.ejs +3 -370
- package/hedhog/frontend/app/planning/cash-flow-forecast/page.tsx.ejs +66 -74
- package/hedhog/frontend/app/planning/receivables-calendar/page.tsx.ejs +1 -5
- package/hedhog/frontend/app/planning/scenarios/page.tsx.ejs +1 -1
- package/package.json +5 -5
package/hedhog/data/menu.yaml
CHANGED
|
@@ -11,23 +11,6 @@
|
|
|
11
11
|
- where:
|
|
12
12
|
slug: admin-finance
|
|
13
13
|
|
|
14
|
-
- menu_id:
|
|
15
|
-
where:
|
|
16
|
-
slug: /finance
|
|
17
|
-
icon: chart-no-axes-combined
|
|
18
|
-
url: /finance
|
|
19
|
-
name:
|
|
20
|
-
en: Overview
|
|
21
|
-
pt: Visão geral
|
|
22
|
-
slug: /finance/overview
|
|
23
|
-
order: 101
|
|
24
|
-
relations:
|
|
25
|
-
role:
|
|
26
|
-
- where:
|
|
27
|
-
slug: admin
|
|
28
|
-
- where:
|
|
29
|
-
slug: admin-finance
|
|
30
|
-
|
|
31
14
|
- menu_id:
|
|
32
15
|
where:
|
|
33
16
|
slug: /finance
|
|
@@ -17,6 +17,7 @@ type FinancePageSectionProps = {
|
|
|
17
17
|
children: ReactNode;
|
|
18
18
|
className?: string;
|
|
19
19
|
contentClassName?: string;
|
|
20
|
+
variant?: 'card' | 'flat';
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
export function FinancePageSection({
|
|
@@ -26,9 +27,31 @@ export function FinancePageSection({
|
|
|
26
27
|
children,
|
|
27
28
|
className,
|
|
28
29
|
contentClassName,
|
|
30
|
+
variant = 'card',
|
|
29
31
|
}: FinancePageSectionProps) {
|
|
30
32
|
const hasHeader = title || description || actions;
|
|
31
33
|
|
|
34
|
+
if (variant === 'flat') {
|
|
35
|
+
return (
|
|
36
|
+
<section className={cn('space-y-4', className)}>
|
|
37
|
+
{hasHeader ? (
|
|
38
|
+
<div className="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
|
|
39
|
+
<div className="space-y-1">
|
|
40
|
+
{title ? (
|
|
41
|
+
<h2 className="text-base font-semibold">{title}</h2>
|
|
42
|
+
) : null}
|
|
43
|
+
{description ? (
|
|
44
|
+
<p className="text-sm text-muted-foreground">{description}</p>
|
|
45
|
+
) : null}
|
|
46
|
+
</div>
|
|
47
|
+
{actions ? <div className="shrink-0">{actions}</div> : null}
|
|
48
|
+
</div>
|
|
49
|
+
) : null}
|
|
50
|
+
<div className={cn(contentClassName)}>{children}</div>
|
|
51
|
+
</section>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
32
55
|
return (
|
|
33
56
|
<Card
|
|
34
57
|
className={cn(
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
'use client';
|
|
4
|
-
|
|
5
|
-
import { FinancePageSection } from '@/app/(app)/(libraries)/finance/_components/finance-layout';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
Dialog,
|
|
11
|
-
DialogContent,
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import { FinancePageSection } from '@/app/(app)/(libraries)/finance/_components/finance-layout';
|
|
6
|
+
import { EmptyState, Page, PageHeader } from '@/components/entity-list';
|
|
7
|
+
import { Badge } from '@/components/ui/badge';
|
|
8
|
+
import { Button } from '@/components/ui/button';
|
|
9
|
+
import {
|
|
10
|
+
Dialog,
|
|
11
|
+
DialogContent,
|
|
12
12
|
DialogDescription,
|
|
13
13
|
DialogFooter,
|
|
14
14
|
DialogHeader,
|
|
15
15
|
DialogTitle,
|
|
16
16
|
DialogTrigger,
|
|
17
|
-
} from '@/components/ui/dialog';
|
|
18
|
-
import { KpiCardsGrid } from '@/components/ui/kpi-cards-grid';
|
|
19
|
-
import { Label } from '@/components/ui/label';
|
|
20
|
-
import { Money } from '@/components/ui/money';
|
|
21
|
-
import {
|
|
22
|
-
Table,
|
|
23
|
-
TableBody,
|
|
17
|
+
} from '@/components/ui/dialog';
|
|
18
|
+
import { KpiCardsGrid } from '@/components/ui/kpi-cards-grid';
|
|
19
|
+
import { Label } from '@/components/ui/label';
|
|
20
|
+
import { Money } from '@/components/ui/money';
|
|
21
|
+
import {
|
|
22
|
+
Table,
|
|
23
|
+
TableBody,
|
|
24
24
|
TableCell,
|
|
25
25
|
TableHead,
|
|
26
26
|
TableHeader,
|
|
@@ -207,38 +207,38 @@ export default function AprovacoesPage() {
|
|
|
207
207
|
},
|
|
208
208
|
};
|
|
209
209
|
|
|
210
|
-
const totalPendente = aprovacoes.reduce((acc, a) => acc + a.valor, 0);
|
|
211
|
-
const urgentCount = aprovacoes.filter(
|
|
212
|
-
(a) => a.urgencia === 'alta' || a.urgencia === 'critica'
|
|
213
|
-
).length;
|
|
214
|
-
const summaryCards = [
|
|
215
|
-
{
|
|
216
|
-
key: 'pending',
|
|
217
|
-
title: t('cards.pending'),
|
|
218
|
-
value: aprovacoes.length,
|
|
219
|
-
icon: Clock,
|
|
220
|
-
layout: 'compact' as const,
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
key: 'value',
|
|
224
|
-
title: t('cards.totalValue'),
|
|
225
|
-
value: <Money value={totalPendente} />,
|
|
226
|
-
icon: AlertTriangle,
|
|
227
|
-
layout: 'compact' as const,
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
key: 'urgent',
|
|
231
|
-
title: t('cards.urgent'),
|
|
232
|
-
value: urgentCount,
|
|
233
|
-
icon: AlertTriangle,
|
|
234
|
-
layout: 'compact' as const,
|
|
235
|
-
iconContainerClassName: 'bg-orange-500/10 text-orange-700',
|
|
236
|
-
accentClassName: 'from-orange-500/20 via-amber-500/10 to-transparent',
|
|
237
|
-
},
|
|
238
|
-
];
|
|
239
|
-
|
|
240
|
-
return (
|
|
241
|
-
<Page>
|
|
210
|
+
const totalPendente = aprovacoes.reduce((acc, a) => acc + a.valor, 0);
|
|
211
|
+
const urgentCount = aprovacoes.filter(
|
|
212
|
+
(a) => a.urgencia === 'alta' || a.urgencia === 'critica'
|
|
213
|
+
).length;
|
|
214
|
+
const summaryCards = [
|
|
215
|
+
{
|
|
216
|
+
key: 'pending',
|
|
217
|
+
title: t('cards.pending'),
|
|
218
|
+
value: aprovacoes.length,
|
|
219
|
+
icon: Clock,
|
|
220
|
+
layout: 'compact' as const,
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
key: 'value',
|
|
224
|
+
title: t('cards.totalValue'),
|
|
225
|
+
value: <Money value={totalPendente} />,
|
|
226
|
+
icon: AlertTriangle,
|
|
227
|
+
layout: 'compact' as const,
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
key: 'urgent',
|
|
231
|
+
title: t('cards.urgent'),
|
|
232
|
+
value: urgentCount,
|
|
233
|
+
icon: AlertTriangle,
|
|
234
|
+
layout: 'compact' as const,
|
|
235
|
+
iconContainerClassName: 'bg-orange-500/10 text-orange-700',
|
|
236
|
+
accentClassName: 'from-orange-500/20 via-amber-500/10 to-transparent',
|
|
237
|
+
},
|
|
238
|
+
];
|
|
239
|
+
|
|
240
|
+
return (
|
|
241
|
+
<Page>
|
|
242
242
|
<PageHeader
|
|
243
243
|
title={t('header.title')}
|
|
244
244
|
description={t('header.description')}
|
|
@@ -246,20 +246,17 @@ export default function AprovacoesPage() {
|
|
|
246
246
|
{ label: t('breadcrumbs.home'), href: '/' },
|
|
247
247
|
{ label: t('breadcrumbs.finance'), href: '/finance' },
|
|
248
248
|
{ label: t('breadcrumbs.current') },
|
|
249
|
-
]}
|
|
250
|
-
/>
|
|
251
|
-
|
|
252
|
-
<KpiCardsGrid items={summaryCards} columns={3} />
|
|
253
|
-
|
|
254
|
-
<FinancePageSection
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
<Table>
|
|
261
|
-
<TableHeader>
|
|
262
|
-
<TableRow>
|
|
249
|
+
]}
|
|
250
|
+
/>
|
|
251
|
+
|
|
252
|
+
<KpiCardsGrid items={summaryCards} columns={3} />
|
|
253
|
+
|
|
254
|
+
<FinancePageSection variant="flat">
|
|
255
|
+
{aprovacoes.length > 0 ? (
|
|
256
|
+
<div className="overflow-x-auto">
|
|
257
|
+
<Table>
|
|
258
|
+
<TableHeader>
|
|
259
|
+
<TableRow>
|
|
263
260
|
<TableHead>{t('table.headers.document')}</TableHead>
|
|
264
261
|
<TableHead>{t('table.headers.supplier')}</TableHead>
|
|
265
262
|
<TableHead>{t('table.headers.requester')}</TableHead>
|
|
@@ -282,16 +279,16 @@ export default function AprovacoesPage() {
|
|
|
282
279
|
const fornecedor = titulo
|
|
283
280
|
? getPessoaById(titulo.fornecedorId)
|
|
284
281
|
: null;
|
|
285
|
-
const urgencia =
|
|
286
|
-
urgenciaConfig[
|
|
287
|
-
aprovacao.urgencia as keyof typeof urgenciaConfig
|
|
288
|
-
] || urgenciaConfig.media;
|
|
289
|
-
|
|
290
|
-
return (
|
|
291
|
-
<TableRow key={aprovacao.id} className="hover:bg-muted/30">
|
|
292
|
-
<TableCell className="font-medium">
|
|
293
|
-
{titulo?.documento}
|
|
294
|
-
</TableCell>
|
|
282
|
+
const urgencia =
|
|
283
|
+
urgenciaConfig[
|
|
284
|
+
aprovacao.urgencia as keyof typeof urgenciaConfig
|
|
285
|
+
] || urgenciaConfig.media;
|
|
286
|
+
|
|
287
|
+
return (
|
|
288
|
+
<TableRow key={aprovacao.id} className="hover:bg-muted/30">
|
|
289
|
+
<TableCell className="font-medium">
|
|
290
|
+
{titulo?.documento}
|
|
291
|
+
</TableCell>
|
|
295
292
|
<TableCell>{fornecedor?.nome}</TableCell>
|
|
296
293
|
<TableCell>{aprovacao.solicitante}</TableCell>
|
|
297
294
|
<TableCell className="text-right">
|
|
@@ -337,22 +334,20 @@ export default function AprovacoesPage() {
|
|
|
337
334
|
</TableCell>
|
|
338
335
|
</TableRow>
|
|
339
336
|
);
|
|
340
|
-
})}
|
|
341
|
-
</TableBody>
|
|
342
|
-
</Table>
|
|
343
|
-
</div>
|
|
344
|
-
) : (
|
|
345
|
-
<
|
|
346
|
-
<
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
);
|
|
358
|
-
}
|
|
337
|
+
})}
|
|
338
|
+
</TableBody>
|
|
339
|
+
</Table>
|
|
340
|
+
</div>
|
|
341
|
+
) : (
|
|
342
|
+
<EmptyState
|
|
343
|
+
icon={<CheckCircle className="h-12 w-12" />}
|
|
344
|
+
title={t('empty.title')}
|
|
345
|
+
description={t('empty.description')}
|
|
346
|
+
actionLabel={t('empty.refresh')}
|
|
347
|
+
onAction={() => void refetch()}
|
|
348
|
+
/>
|
|
349
|
+
)}
|
|
350
|
+
</FinancePageSection>
|
|
351
|
+
</Page>
|
|
352
|
+
);
|
|
353
|
+
}
|