@hed-hog/finance 0.0.300 → 0.0.301
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/dist/finance.contract-activated.subscriber.d.ts +24 -0
- package/dist/finance.contract-activated.subscriber.d.ts.map +1 -0
- package/dist/finance.contract-activated.subscriber.js +519 -0
- package/dist/finance.contract-activated.subscriber.js.map +1 -0
- package/dist/finance.contract-activated.subscriber.spec.d.ts +2 -0
- package/dist/finance.contract-activated.subscriber.spec.d.ts.map +1 -0
- package/dist/finance.contract-activated.subscriber.spec.js +302 -0
- package/dist/finance.contract-activated.subscriber.spec.js.map +1 -0
- package/dist/finance.module.d.ts.map +1 -1
- package/dist/finance.module.js +6 -1
- package/dist/finance.module.js.map +1 -1
- package/hedhog/frontend/app/_components/finance-layout.tsx.ejs +108 -0
- package/hedhog/frontend/app/accounts-payable/approvals/page.tsx.ejs +91 -106
- package/hedhog/frontend/app/accounts-payable/installments/page.tsx.ejs +1306 -1145
- package/hedhog/frontend/app/accounts-receivable/collections-default/page.tsx.ejs +288 -268
- package/hedhog/frontend/app/accounts-receivable/installments/page.tsx.ejs +491 -351
- package/hedhog/frontend/app/administration/audit-logs/page.tsx.ejs +157 -173
- package/hedhog/frontend/app/administration/categories/page.tsx.ejs +44 -62
- package/hedhog/frontend/app/administration/cost-centers/page.tsx.ejs +62 -80
- package/hedhog/frontend/app/administration/period-close/page.tsx.ejs +151 -170
- package/hedhog/frontend/app/cash-and-banks/bank-accounts/page.tsx.ejs +332 -286
- package/hedhog/frontend/app/cash-and-banks/bank-reconciliation/page.tsx.ejs +204 -226
- package/hedhog/frontend/app/cash-and-banks/statements/page.tsx.ejs +122 -140
- package/hedhog/frontend/app/cash-and-banks/transfers/page.tsx.ejs +32 -49
- package/hedhog/frontend/app/planning/cash-flow-forecast/page.tsx.ejs +84 -108
- package/hedhog/frontend/app/planning/receivables-calendar/page.tsx.ejs +53 -70
- package/hedhog/frontend/app/planning/scenarios/page.tsx.ejs +98 -95
- package/hedhog/frontend/app/reports/actual-vs-forecast/page.tsx.ejs +100 -125
- package/hedhog/frontend/app/reports/aging-default/page.tsx.ejs +77 -105
- package/hedhog/frontend/app/reports/cash-position/page.tsx.ejs +99 -134
- package/hedhog/frontend/app/reports/overview-results/page.tsx.ejs +147 -182
- package/hedhog/frontend/app/reports/top-customers/page.tsx.ejs +49 -61
- package/hedhog/frontend/app/reports/top-operational-expenses/page.tsx.ejs +49 -67
- package/hedhog/frontend/messages/en.json +176 -68
- package/hedhog/frontend/messages/pt.json +176 -68
- package/package.json +7 -6
- package/src/finance.contract-activated.subscriber.spec.ts +392 -0
- package/src/finance.contract-activated.subscriber.ts +780 -0
- package/src/finance.module.ts +6 -1
|
@@ -1,30 +1,26 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
Dialog,
|
|
14
|
-
DialogContent,
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import { FinancePageSection } from '@/app/(app)/(libraries)/finance/_components/finance-layout';
|
|
6
|
+
import { Badge } from '@/components/ui/badge';
|
|
7
|
+
import { Button } from '@/components/ui/button';
|
|
8
|
+
import { EmptyState, Page, PageHeader } from '@/components/entity-list';
|
|
9
|
+
import {
|
|
10
|
+
Dialog,
|
|
11
|
+
DialogContent,
|
|
15
12
|
DialogDescription,
|
|
16
13
|
DialogFooter,
|
|
17
14
|
DialogHeader,
|
|
18
15
|
DialogTitle,
|
|
19
16
|
DialogTrigger,
|
|
20
|
-
} from '@/components/ui/dialog';
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
import {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
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,
|
|
28
24
|
TableCell,
|
|
29
25
|
TableHead,
|
|
30
26
|
TableHeader,
|
|
@@ -211,10 +207,38 @@ export default function AprovacoesPage() {
|
|
|
211
207
|
},
|
|
212
208
|
};
|
|
213
209
|
|
|
214
|
-
const totalPendente = aprovacoes.reduce((acc, a) => acc + a.valor, 0);
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
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>
|
|
218
242
|
<PageHeader
|
|
219
243
|
title={t('header.title')}
|
|
220
244
|
description={t('header.description')}
|
|
@@ -222,63 +246,20 @@ export default function AprovacoesPage() {
|
|
|
222
246
|
{ label: t('breadcrumbs.home'), href: '/' },
|
|
223
247
|
{ label: t('breadcrumbs.finance'), href: '/finance' },
|
|
224
248
|
{ label: t('breadcrumbs.current') },
|
|
225
|
-
]}
|
|
226
|
-
/>
|
|
227
|
-
|
|
228
|
-
<
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
</Card>
|
|
240
|
-
<Card>
|
|
241
|
-
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
|
242
|
-
<CardTitle className="text-sm font-medium">
|
|
243
|
-
{t('cards.totalValue')}
|
|
244
|
-
</CardTitle>
|
|
245
|
-
<AlertTriangle className="h-4 w-4 text-muted-foreground" />
|
|
246
|
-
</CardHeader>
|
|
247
|
-
<CardContent>
|
|
248
|
-
<div className="text-2xl font-bold">
|
|
249
|
-
<Money value={totalPendente} />
|
|
250
|
-
</div>
|
|
251
|
-
</CardContent>
|
|
252
|
-
</Card>
|
|
253
|
-
<Card>
|
|
254
|
-
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
|
255
|
-
<CardTitle className="text-sm font-medium">
|
|
256
|
-
{t('cards.urgent')}
|
|
257
|
-
</CardTitle>
|
|
258
|
-
<AlertTriangle className="h-4 w-4 text-orange-500" />
|
|
259
|
-
</CardHeader>
|
|
260
|
-
<CardContent>
|
|
261
|
-
<div className="text-2xl font-bold">
|
|
262
|
-
{
|
|
263
|
-
aprovacoes.filter(
|
|
264
|
-
(a) => a.urgencia === 'alta' || a.urgencia === 'critica'
|
|
265
|
-
).length
|
|
266
|
-
}
|
|
267
|
-
</div>
|
|
268
|
-
</CardContent>
|
|
269
|
-
</Card>
|
|
270
|
-
</div>
|
|
271
|
-
|
|
272
|
-
<Card>
|
|
273
|
-
<CardHeader>
|
|
274
|
-
<CardTitle>{t('table.title')}</CardTitle>
|
|
275
|
-
<CardDescription>{t('table.description')}</CardDescription>
|
|
276
|
-
</CardHeader>
|
|
277
|
-
<CardContent>
|
|
278
|
-
{aprovacoes.length > 0 ? (
|
|
279
|
-
<Table>
|
|
280
|
-
<TableHeader>
|
|
281
|
-
<TableRow>
|
|
249
|
+
]}
|
|
250
|
+
/>
|
|
251
|
+
|
|
252
|
+
<KpiCardsGrid items={summaryCards} columns={3} />
|
|
253
|
+
|
|
254
|
+
<FinancePageSection
|
|
255
|
+
title={t('table.title')}
|
|
256
|
+
description={t('table.description')}
|
|
257
|
+
>
|
|
258
|
+
{aprovacoes.length > 0 ? (
|
|
259
|
+
<div className="overflow-x-auto">
|
|
260
|
+
<Table>
|
|
261
|
+
<TableHeader>
|
|
262
|
+
<TableRow>
|
|
282
263
|
<TableHead>{t('table.headers.document')}</TableHead>
|
|
283
264
|
<TableHead>{t('table.headers.supplier')}</TableHead>
|
|
284
265
|
<TableHead>{t('table.headers.requester')}</TableHead>
|
|
@@ -301,16 +282,16 @@ export default function AprovacoesPage() {
|
|
|
301
282
|
const fornecedor = titulo
|
|
302
283
|
? getPessoaById(titulo.fornecedorId)
|
|
303
284
|
: null;
|
|
304
|
-
const urgencia =
|
|
305
|
-
urgenciaConfig[
|
|
306
|
-
aprovacao.urgencia as keyof typeof urgenciaConfig
|
|
307
|
-
] || urgenciaConfig.media;
|
|
308
|
-
|
|
309
|
-
return (
|
|
310
|
-
<TableRow key={aprovacao.id}>
|
|
311
|
-
<TableCell className="font-medium">
|
|
312
|
-
{titulo?.documento}
|
|
313
|
-
</TableCell>
|
|
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>
|
|
314
295
|
<TableCell>{fornecedor?.nome}</TableCell>
|
|
315
296
|
<TableCell>{aprovacao.solicitante}</TableCell>
|
|
316
297
|
<TableCell className="text-right">
|
|
@@ -356,18 +337,22 @@ export default function AprovacoesPage() {
|
|
|
356
337
|
</TableCell>
|
|
357
338
|
</TableRow>
|
|
358
339
|
);
|
|
359
|
-
})}
|
|
360
|
-
</TableBody>
|
|
361
|
-
</Table>
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
<
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
}
|
|
340
|
+
})}
|
|
341
|
+
</TableBody>
|
|
342
|
+
</Table>
|
|
343
|
+
</div>
|
|
344
|
+
) : (
|
|
345
|
+
<div className="px-4 py-8 sm:px-6">
|
|
346
|
+
<EmptyState
|
|
347
|
+
icon={<CheckCircle className="h-12 w-12" />}
|
|
348
|
+
title={t('empty.title')}
|
|
349
|
+
description={t('empty.description')}
|
|
350
|
+
actionLabel={t('empty.refresh')}
|
|
351
|
+
onAction={() => void refetch()}
|
|
352
|
+
/>
|
|
353
|
+
</div>
|
|
354
|
+
)}
|
|
355
|
+
</FinancePageSection>
|
|
356
|
+
</Page>
|
|
357
|
+
);
|
|
358
|
+
}
|