@hed-hog/finance 0.0.318 → 0.0.319
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/dto/create-bank-account.dto.d.ts +1 -0
- package/dist/dto/create-bank-account.dto.d.ts.map +1 -1
- package/dist/dto/create-bank-account.dto.js +7 -0
- package/dist/dto/create-bank-account.dto.js.map +1 -1
- package/dist/dto/create-bank-statement-entry.dto.d.ts +8 -0
- package/dist/dto/create-bank-statement-entry.dto.d.ts.map +1 -0
- package/dist/dto/create-bank-statement-entry.dto.js +54 -0
- package/dist/dto/create-bank-statement-entry.dto.js.map +1 -0
- package/dist/dto/update-bank-account.dto.d.ts +1 -0
- package/dist/dto/update-bank-account.dto.d.ts.map +1 -1
- package/dist/dto/update-bank-account.dto.js +7 -0
- package/dist/dto/update-bank-account.dto.js.map +1 -1
- package/dist/dto/update-bank-statement-entry.dto.d.ts +6 -0
- package/dist/dto/update-bank-statement-entry.dto.d.ts.map +1 -0
- package/dist/dto/update-bank-statement-entry.dto.js +42 -0
- package/dist/dto/update-bank-statement-entry.dto.js.map +1 -0
- package/dist/finance-bank-accounts.controller.d.ts +25 -13
- package/dist/finance-bank-accounts.controller.d.ts.map +1 -1
- package/dist/finance-bank-accounts.controller.js +5 -3
- package/dist/finance-bank-accounts.controller.js.map +1 -1
- package/dist/finance-data.controller.d.ts +4 -0
- package/dist/finance-data.controller.d.ts.map +1 -1
- package/dist/finance-installments.controller.d.ts +3 -2
- package/dist/finance-installments.controller.d.ts.map +1 -1
- package/dist/finance-installments.controller.js +10 -6
- package/dist/finance-installments.controller.js.map +1 -1
- package/dist/finance-statements.controller.d.ts +61 -12
- package/dist/finance-statements.controller.d.ts.map +1 -1
- package/dist/finance-statements.controller.js +50 -8
- package/dist/finance-statements.controller.js.map +1 -1
- package/dist/finance-transfers.controller.d.ts +13 -8
- package/dist/finance-transfers.controller.d.ts.map +1 -1
- package/dist/finance-transfers.controller.js +11 -5
- package/dist/finance-transfers.controller.js.map +1 -1
- package/dist/finance.service.d.ts +124 -35
- package/dist/finance.service.d.ts.map +1 -1
- package/dist/finance.service.js +389 -55
- package/dist/finance.service.js.map +1 -1
- package/hedhog/data/role.yaml +9 -1
- package/hedhog/data/route.yaml +42 -0
- package/hedhog/frontend/app/accounts-payable/approvals/page.tsx.ejs +87 -72
- package/hedhog/frontend/app/accounts-payable/installments/page.tsx.ejs +53 -25
- package/hedhog/frontend/app/accounts-receivable/installments/[id]/page.tsx.ejs +8 -0
- package/hedhog/frontend/app/accounts-receivable/installments/page.tsx.ejs +60 -24
- package/hedhog/frontend/app/cash-and-banks/bank-accounts/page.tsx.ejs +114 -31
- package/hedhog/frontend/app/cash-and-banks/bank-reconciliation/page.tsx.ejs +25 -3
- package/hedhog/frontend/app/cash-and-banks/statements/page.tsx.ejs +732 -61
- package/hedhog/frontend/app/cash-and-banks/transfers/page.tsx.ejs +101 -15
- package/hedhog/table/bank_statement_line.yaml +1 -1
- package/hedhog/table/cashflow_projection.yaml +1 -1
- package/hedhog/table/financial_installment.yaml +2 -2
- package/hedhog/table/financial_title.yaml +1 -1
- package/hedhog/table/installment_allocation.yaml +1 -1
- package/hedhog/table/receivable_schedule.yaml +1 -1
- package/hedhog/table/settlement.yaml +1 -1
- package/hedhog/table/settlement_allocation.yaml +5 -5
- package/package.json +7 -7
- package/src/dto/create-bank-account.dto.ts +18 -1
- package/src/dto/create-bank-statement-entry.dto.ts +50 -0
- package/src/dto/update-bank-account.dto.ts +11 -1
- package/src/dto/update-bank-statement-entry.dto.ts +31 -0
- package/src/finance-bank-accounts.controller.ts +3 -2
- package/src/finance-installments.controller.ts +9 -3
- package/src/finance-statements.controller.ts +40 -0
- package/src/finance-transfers.controller.ts +7 -1
- package/src/finance.service.ts +543 -61
package/hedhog/data/role.yaml
CHANGED
|
@@ -4,4 +4,12 @@
|
|
|
4
4
|
pt: Administrador de Finanças
|
|
5
5
|
description:
|
|
6
6
|
en: Administrator with full access to finance management.
|
|
7
|
-
pt: Administrador com acesso total à gestão financeira.
|
|
7
|
+
pt: Administrador com acesso total à gestão financeira.
|
|
8
|
+
|
|
9
|
+
- slug: finance-statements-editor
|
|
10
|
+
name:
|
|
11
|
+
en: Finance Statements Editor
|
|
12
|
+
pt: Editor de Extratos Bancários
|
|
13
|
+
description:
|
|
14
|
+
en: Can add, edit, and delete bank statement entries.
|
|
15
|
+
pt: Pode adicionar, editar e excluir registros de extrato bancário.
|
package/hedhog/data/route.yaml
CHANGED
|
@@ -493,6 +493,48 @@
|
|
|
493
493
|
- where:
|
|
494
494
|
slug: admin-finance
|
|
495
495
|
|
|
496
|
+
- url: /finance/statements
|
|
497
|
+
method: POST
|
|
498
|
+
relations:
|
|
499
|
+
role:
|
|
500
|
+
- where:
|
|
501
|
+
slug: admin
|
|
502
|
+
- where:
|
|
503
|
+
slug: admin-finance
|
|
504
|
+
- where:
|
|
505
|
+
slug: finance-statements-editor
|
|
506
|
+
|
|
507
|
+
- url: /finance/statements/:id
|
|
508
|
+
method: PATCH
|
|
509
|
+
relations:
|
|
510
|
+
role:
|
|
511
|
+
- where:
|
|
512
|
+
slug: admin
|
|
513
|
+
- where:
|
|
514
|
+
slug: admin-finance
|
|
515
|
+
- where:
|
|
516
|
+
slug: finance-statements-editor
|
|
517
|
+
|
|
518
|
+
- url: /finance/statements/:id
|
|
519
|
+
method: DELETE
|
|
520
|
+
relations:
|
|
521
|
+
role:
|
|
522
|
+
- where:
|
|
523
|
+
slug: admin
|
|
524
|
+
- where:
|
|
525
|
+
slug: admin-finance
|
|
526
|
+
- where:
|
|
527
|
+
slug: finance-statements-editor
|
|
528
|
+
|
|
529
|
+
- url: /finance/bank-reconciliations/:id
|
|
530
|
+
method: DELETE
|
|
531
|
+
relations:
|
|
532
|
+
role:
|
|
533
|
+
- where:
|
|
534
|
+
slug: admin
|
|
535
|
+
- where:
|
|
536
|
+
slug: admin-finance
|
|
537
|
+
|
|
496
538
|
- url: /finance/transfers
|
|
497
539
|
method: GET
|
|
498
540
|
relations:
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
'use client';
|
|
4
|
-
|
|
5
3
|
import { FinancePageSection } from '@/app/(app)/(libraries)/finance/_components/finance-layout';
|
|
6
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
EmptyState,
|
|
6
|
+
Page,
|
|
7
|
+
PageHeader,
|
|
8
|
+
PaginationFooter,
|
|
9
|
+
} from '@/components/entity-list';
|
|
7
10
|
import { Badge } from '@/components/ui/badge';
|
|
8
11
|
import { Button } from '@/components/ui/button';
|
|
9
12
|
import {
|
|
@@ -27,12 +30,29 @@ import {
|
|
|
27
30
|
TableRow,
|
|
28
31
|
} from '@/components/ui/table';
|
|
29
32
|
import { Textarea } from '@/components/ui/textarea';
|
|
30
|
-
import { useApp } from '@hed-hog/next-app-provider';
|
|
33
|
+
import { useApp, useQuery } from '@hed-hog/next-app-provider';
|
|
31
34
|
import { AlertTriangle, CheckCircle, Clock, XCircle } from 'lucide-react';
|
|
32
35
|
import { useTranslations } from 'next-intl';
|
|
33
|
-
import {
|
|
36
|
+
import { useState } from 'react';
|
|
34
37
|
import { formatarData } from '../../_lib/formatters';
|
|
35
|
-
|
|
38
|
+
|
|
39
|
+
type ApprovalTitle = {
|
|
40
|
+
id: string;
|
|
41
|
+
documento: string;
|
|
42
|
+
fornecedor?: string;
|
|
43
|
+
valorTotal: number;
|
|
44
|
+
criadoEm: string;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
type PaginatedResponse<T> = {
|
|
48
|
+
data: T[];
|
|
49
|
+
total: number;
|
|
50
|
+
page: number;
|
|
51
|
+
pageSize: number;
|
|
52
|
+
prev: number | null;
|
|
53
|
+
next: number | null;
|
|
54
|
+
lastPage: number;
|
|
55
|
+
};
|
|
36
56
|
|
|
37
57
|
function AprovacaoDialog({
|
|
38
58
|
tipo,
|
|
@@ -63,7 +83,7 @@ function AprovacaoDialog({
|
|
|
63
83
|
)}
|
|
64
84
|
</Button>
|
|
65
85
|
</DialogTrigger>
|
|
66
|
-
<DialogContent>
|
|
86
|
+
<DialogContent className="sm:max-w-lg">
|
|
67
87
|
<DialogHeader>
|
|
68
88
|
<DialogTitle>
|
|
69
89
|
{isAprovar ? t('dialog.approveTitle') : t('dialog.rejectTitle')}
|
|
@@ -109,39 +129,39 @@ function AprovacaoDialog({
|
|
|
109
129
|
export default function AprovacoesPage() {
|
|
110
130
|
const t = useTranslations('finance.PayableApprovalsPage');
|
|
111
131
|
const { request, showToastHandler } = useApp();
|
|
112
|
-
const
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
id: String(titulo.id),
|
|
130
|
-
tituloId: String(titulo.id),
|
|
131
|
-
solicitante: '-',
|
|
132
|
-
valor: Number(titulo.valorTotal || 0),
|
|
133
|
-
politica: 'Aprovação financeira',
|
|
134
|
-
urgencia: 'media',
|
|
135
|
-
dataSolicitacao: titulo.criadoEm,
|
|
136
|
-
}));
|
|
132
|
+
const [page, setPage] = useState(1);
|
|
133
|
+
const pageSize = 10;
|
|
134
|
+
const {
|
|
135
|
+
data: approvalsResponse,
|
|
136
|
+
refetch,
|
|
137
|
+
} = useQuery<PaginatedResponse<ApprovalTitle>>({
|
|
138
|
+
queryKey: ['finance-payable-approvals', page, pageSize],
|
|
139
|
+
queryFn: async () => {
|
|
140
|
+
const response = await request({
|
|
141
|
+
url: '/finance/accounts-payable/installments',
|
|
142
|
+
method: 'GET',
|
|
143
|
+
params: {
|
|
144
|
+
status: 'rascunho',
|
|
145
|
+
page,
|
|
146
|
+
pageSize,
|
|
147
|
+
},
|
|
148
|
+
});
|
|
137
149
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
150
|
+
return (response?.data || {
|
|
151
|
+
data: [],
|
|
152
|
+
total: 0,
|
|
153
|
+
page,
|
|
154
|
+
pageSize,
|
|
155
|
+
prev: null,
|
|
156
|
+
next: null,
|
|
157
|
+
lastPage: 1,
|
|
158
|
+
}) as PaginatedResponse<ApprovalTitle>;
|
|
159
|
+
},
|
|
160
|
+
placeholderData: (old) => old,
|
|
161
|
+
});
|
|
142
162
|
|
|
143
|
-
|
|
144
|
-
|
|
163
|
+
const aprovacoes = approvalsResponse?.data ?? [];
|
|
164
|
+
const totalAprovacoes = approvalsResponse?.total ?? 0;
|
|
145
165
|
|
|
146
166
|
const handleAprovacao = async (_id: string, tituloId?: string) => {
|
|
147
167
|
if (!tituloId) {
|
|
@@ -207,15 +227,17 @@ export default function AprovacoesPage() {
|
|
|
207
227
|
},
|
|
208
228
|
};
|
|
209
229
|
|
|
210
|
-
const totalPendente = aprovacoes.reduce(
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
)
|
|
230
|
+
const totalPendente = aprovacoes.reduce(
|
|
231
|
+
(acc, aprovacao) => acc + Number(aprovacao.valorTotal || 0),
|
|
232
|
+
0
|
|
233
|
+
);
|
|
234
|
+
const urgentCount = 0;
|
|
235
|
+
|
|
214
236
|
const summaryCards = [
|
|
215
237
|
{
|
|
216
238
|
key: 'pending',
|
|
217
239
|
title: t('cards.pending'),
|
|
218
|
-
value:
|
|
240
|
+
value: totalAprovacoes,
|
|
219
241
|
icon: Clock,
|
|
220
242
|
layout: 'compact' as const,
|
|
221
243
|
},
|
|
@@ -252,7 +274,7 @@ export default function AprovacoesPage() {
|
|
|
252
274
|
<KpiCardsGrid items={summaryCards} columns={3} />
|
|
253
275
|
|
|
254
276
|
<FinancePageSection variant="flat">
|
|
255
|
-
{
|
|
277
|
+
{totalAprovacoes > 0 ? (
|
|
256
278
|
<div className="overflow-x-auto">
|
|
257
279
|
<Table>
|
|
258
280
|
<TableHeader>
|
|
@@ -273,30 +295,20 @@ export default function AprovacoesPage() {
|
|
|
273
295
|
</TableHeader>
|
|
274
296
|
<TableBody>
|
|
275
297
|
{aprovacoes.map((aprovacao) => {
|
|
276
|
-
const
|
|
277
|
-
(t) => t.id === aprovacao.tituloId
|
|
278
|
-
);
|
|
279
|
-
const fornecedor = titulo
|
|
280
|
-
? getPessoaById(titulo.fornecedorId)
|
|
281
|
-
: null;
|
|
282
|
-
const urgencia =
|
|
283
|
-
urgenciaConfig[
|
|
284
|
-
aprovacao.urgencia as keyof typeof urgenciaConfig
|
|
285
|
-
] || urgenciaConfig.media;
|
|
286
|
-
|
|
298
|
+
const urgencia = urgenciaConfig.media;
|
|
287
299
|
return (
|
|
288
300
|
<TableRow key={aprovacao.id} className="hover:bg-muted/30">
|
|
289
301
|
<TableCell className="font-medium">
|
|
290
|
-
{
|
|
302
|
+
{aprovacao.documento}
|
|
291
303
|
</TableCell>
|
|
292
|
-
<TableCell>{fornecedor
|
|
293
|
-
<TableCell
|
|
304
|
+
<TableCell>{aprovacao.fornecedor || '-'}</TableCell>
|
|
305
|
+
<TableCell>-</TableCell>
|
|
294
306
|
<TableCell className="text-right">
|
|
295
|
-
<Money value={aprovacao.
|
|
307
|
+
<Money value={aprovacao.valorTotal} />
|
|
296
308
|
</TableCell>
|
|
297
309
|
<TableCell>
|
|
298
310
|
<span className="text-sm text-muted-foreground">
|
|
299
|
-
|
|
311
|
+
Aprovação financeira
|
|
300
312
|
</span>
|
|
301
313
|
</TableCell>
|
|
302
314
|
<TableCell>
|
|
@@ -305,29 +317,20 @@ export default function AprovacoesPage() {
|
|
|
305
317
|
</Badge>
|
|
306
318
|
</TableCell>
|
|
307
319
|
<TableCell>
|
|
308
|
-
{formatarData(aprovacao.
|
|
320
|
+
{formatarData(aprovacao.criadoEm)}
|
|
309
321
|
</TableCell>
|
|
310
322
|
<TableCell>
|
|
311
323
|
<div className="flex justify-end gap-2">
|
|
312
324
|
<AprovacaoDialog
|
|
313
325
|
tipo="aprovar"
|
|
314
326
|
t={t}
|
|
315
|
-
onConfirm={() =>
|
|
316
|
-
void handleAprovacao(
|
|
317
|
-
aprovacao.id,
|
|
318
|
-
aprovacao.tituloId
|
|
319
|
-
)
|
|
320
|
-
}
|
|
327
|
+
onConfirm={() => void handleAprovacao(aprovacao.id, aprovacao.id)}
|
|
321
328
|
/>
|
|
322
329
|
<AprovacaoDialog
|
|
323
330
|
tipo="reprovar"
|
|
324
331
|
t={t}
|
|
325
332
|
onConfirm={(comment) =>
|
|
326
|
-
void handleReprovacao(
|
|
327
|
-
aprovacao.id,
|
|
328
|
-
aprovacao.tituloId,
|
|
329
|
-
comment
|
|
330
|
-
)
|
|
333
|
+
void handleReprovacao(aprovacao.id, aprovacao.id, comment)
|
|
331
334
|
}
|
|
332
335
|
/>
|
|
333
336
|
</div>
|
|
@@ -347,6 +350,18 @@ export default function AprovacoesPage() {
|
|
|
347
350
|
onAction={() => void refetch()}
|
|
348
351
|
/>
|
|
349
352
|
)}
|
|
353
|
+
{totalAprovacoes > 0 ? (
|
|
354
|
+
<div className="border-t border-border/50 px-4 py-4 sm:px-6">
|
|
355
|
+
<PaginationFooter
|
|
356
|
+
currentPage={page}
|
|
357
|
+
pageSize={pageSize}
|
|
358
|
+
totalItems={totalAprovacoes}
|
|
359
|
+
onPageChange={setPage}
|
|
360
|
+
onPageSizeChange={() => undefined}
|
|
361
|
+
pageSizeOptions={[10]}
|
|
362
|
+
/>
|
|
363
|
+
</div>
|
|
364
|
+
) : null}
|
|
350
365
|
</FinancePageSection>
|
|
351
366
|
</Page>
|
|
352
367
|
);
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
} from '@/components/entity-list';
|
|
21
21
|
import { Button } from '@/components/ui/button';
|
|
22
22
|
import { Checkbox } from '@/components/ui/checkbox';
|
|
23
|
+
import { DateRangePicker } from '@/components/ui/date-range-picker';
|
|
23
24
|
import {
|
|
24
25
|
Form,
|
|
25
26
|
FormControl,
|
|
@@ -1260,6 +1261,12 @@ function NovoTituloSheet({
|
|
|
1260
1261
|
<SelectItem value="cartao">
|
|
1261
1262
|
{t('paymentMethods.card')}
|
|
1262
1263
|
</SelectItem>
|
|
1264
|
+
<SelectItem value="debito_automatico">
|
|
1265
|
+
Débito automático
|
|
1266
|
+
</SelectItem>
|
|
1267
|
+
<SelectItem value="debito_em_conta">
|
|
1268
|
+
Débito em conta
|
|
1269
|
+
</SelectItem>
|
|
1263
1270
|
<SelectItem value="dinheiro">
|
|
1264
1271
|
{t('paymentMethods.cash')}
|
|
1265
1272
|
</SelectItem>
|
|
@@ -2371,6 +2378,12 @@ function EditarTituloSheet({
|
|
|
2371
2378
|
<SelectItem value="cartao">
|
|
2372
2379
|
{t('paymentMethods.card')}
|
|
2373
2380
|
</SelectItem>
|
|
2381
|
+
<SelectItem value="debito_automatico">
|
|
2382
|
+
Débito automático
|
|
2383
|
+
</SelectItem>
|
|
2384
|
+
<SelectItem value="debito_em_conta">
|
|
2385
|
+
Débito em conta
|
|
2386
|
+
</SelectItem>
|
|
2374
2387
|
<SelectItem value="dinheiro">
|
|
2375
2388
|
{t('paymentMethods.cash')}
|
|
2376
2389
|
</SelectItem>
|
|
@@ -2491,6 +2504,8 @@ export default function TitulosPagarPage() {
|
|
|
2491
2504
|
|
|
2492
2505
|
const [search, setSearch] = useState('');
|
|
2493
2506
|
const [statusFilter, setStatusFilter] = useState<string>('all');
|
|
2507
|
+
const [fromDate, setFromDate] = useState('');
|
|
2508
|
+
const [toDate, setToDate] = useState('');
|
|
2494
2509
|
const [page, setPage] = useState(1);
|
|
2495
2510
|
const pageSize = 10;
|
|
2496
2511
|
const [isNewTitleSheetOpen, setIsNewTitleSheetOpen] = useState(false);
|
|
@@ -2540,6 +2555,8 @@ export default function TitulosPagarPage() {
|
|
|
2540
2555
|
'finance-payable-installments-list',
|
|
2541
2556
|
search,
|
|
2542
2557
|
normalizedStatusFilter,
|
|
2558
|
+
fromDate,
|
|
2559
|
+
toDate,
|
|
2543
2560
|
page,
|
|
2544
2561
|
pageSize,
|
|
2545
2562
|
],
|
|
@@ -2552,6 +2569,8 @@ export default function TitulosPagarPage() {
|
|
|
2552
2569
|
pageSize,
|
|
2553
2570
|
search: search.trim() || undefined,
|
|
2554
2571
|
status: normalizedStatusFilter,
|
|
2572
|
+
from: fromDate || undefined,
|
|
2573
|
+
to: toDate || undefined,
|
|
2555
2574
|
},
|
|
2556
2575
|
});
|
|
2557
2576
|
|
|
@@ -2649,7 +2668,7 @@ export default function TitulosPagarPage() {
|
|
|
2649
2668
|
|
|
2650
2669
|
useEffect(() => {
|
|
2651
2670
|
setPage(1);
|
|
2652
|
-
}, [search, normalizedStatusFilter]);
|
|
2671
|
+
}, [search, normalizedStatusFilter, fromDate, toDate]);
|
|
2653
2672
|
|
|
2654
2673
|
const editingTitle = useMemo(
|
|
2655
2674
|
() =>
|
|
@@ -2922,30 +2941,39 @@ export default function TitulosPagarPage() {
|
|
|
2922
2941
|
|
|
2923
2942
|
<KpiCardsGrid items={summaryCards} columns={3} />
|
|
2924
2943
|
|
|
2925
|
-
<div className="min-w-0">
|
|
2926
|
-
<
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
{
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2944
|
+
<div className="flex min-w-0 flex-wrap items-center gap-2">
|
|
2945
|
+
<div className="min-w-0 flex-1">
|
|
2946
|
+
<SearchBar
|
|
2947
|
+
searchQuery={search}
|
|
2948
|
+
onSearchChange={setSearch}
|
|
2949
|
+
onSearch={() => undefined}
|
|
2950
|
+
placeholder={t('filters.searchPlaceholder')}
|
|
2951
|
+
controls={[
|
|
2952
|
+
{
|
|
2953
|
+
id: 'status',
|
|
2954
|
+
type: 'select',
|
|
2955
|
+
value: statusFilter,
|
|
2956
|
+
onChange: setStatusFilter,
|
|
2957
|
+
placeholder: t('filters.status'),
|
|
2958
|
+
options: [
|
|
2959
|
+
{ value: 'all', label: t('statuses.all') },
|
|
2960
|
+
{ value: 'rascunho', label: t('statuses.rascunho') },
|
|
2961
|
+
{ value: 'aberto', label: t('statuses.aberto') },
|
|
2962
|
+
{ value: 'parcial', label: t('statuses.parcial') },
|
|
2963
|
+
{ value: 'liquidado', label: t('statuses.liquidado') },
|
|
2964
|
+
{ value: 'vencido', label: t('statuses.vencido') },
|
|
2965
|
+
{ value: 'cancelado', label: t('statuses.cancelado') },
|
|
2966
|
+
],
|
|
2967
|
+
},
|
|
2968
|
+
]}
|
|
2969
|
+
/>
|
|
2970
|
+
</div>
|
|
2971
|
+
<DateRangePicker
|
|
2972
|
+
fromDate={fromDate}
|
|
2973
|
+
toDate={toDate}
|
|
2974
|
+
onFromDateChange={setFromDate}
|
|
2975
|
+
onToDateChange={setToDate}
|
|
2976
|
+
defaultPreset="thisMonth"
|
|
2949
2977
|
/>
|
|
2950
2978
|
</div>
|
|
2951
2979
|
|
|
@@ -185,6 +185,14 @@ export default function TituloReceberDetalhePage() {
|
|
|
185
185
|
label: t('channels.transfer'),
|
|
186
186
|
className: 'bg-orange-100 text-orange-700',
|
|
187
187
|
},
|
|
188
|
+
debito_automatico: {
|
|
189
|
+
label: 'D\u00e9bito autom\u00e1tico',
|
|
190
|
+
className: 'bg-emerald-100 text-emerald-700',
|
|
191
|
+
},
|
|
192
|
+
debito_em_conta: {
|
|
193
|
+
label: 'D\u00e9bito em conta',
|
|
194
|
+
className: 'bg-cyan-100 text-cyan-700',
|
|
195
|
+
},
|
|
188
196
|
};
|
|
189
197
|
|
|
190
198
|
if (!titulo) {
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
import { Badge } from '@/components/ui/badge';
|
|
21
21
|
import { Button } from '@/components/ui/button';
|
|
22
22
|
import { Checkbox } from '@/components/ui/checkbox';
|
|
23
|
+
import { DateRangePicker } from '@/components/ui/date-range-picker';
|
|
23
24
|
import {
|
|
24
25
|
DropdownMenu,
|
|
25
26
|
DropdownMenuContent,
|
|
@@ -1238,6 +1239,12 @@ function NovoTituloSheet({
|
|
|
1238
1239
|
<SelectItem value="transferencia">
|
|
1239
1240
|
{t('channels.transfer')}
|
|
1240
1241
|
</SelectItem>
|
|
1242
|
+
<SelectItem value="debito_automatico">
|
|
1243
|
+
Débito automático
|
|
1244
|
+
</SelectItem>
|
|
1245
|
+
<SelectItem value="debito_em_conta">
|
|
1246
|
+
Débito em conta
|
|
1247
|
+
</SelectItem>
|
|
1241
1248
|
</SelectContent>
|
|
1242
1249
|
</Select>
|
|
1243
1250
|
<FormMessage />
|
|
@@ -2340,6 +2347,12 @@ function EditarTituloSheet({
|
|
|
2340
2347
|
<SelectItem value="transferencia">
|
|
2341
2348
|
{t('channels.transfer')}
|
|
2342
2349
|
</SelectItem>
|
|
2350
|
+
<SelectItem value="debito_automatico">
|
|
2351
|
+
Débito automático
|
|
2352
|
+
</SelectItem>
|
|
2353
|
+
<SelectItem value="debito_em_conta">
|
|
2354
|
+
Débito em conta
|
|
2355
|
+
</SelectItem>
|
|
2343
2356
|
</SelectContent>
|
|
2344
2357
|
</Select>
|
|
2345
2358
|
<FormMessage />
|
|
@@ -2427,6 +2440,8 @@ export default function TitulosReceberPage() {
|
|
|
2427
2440
|
|
|
2428
2441
|
const [search, setSearch] = useState('');
|
|
2429
2442
|
const [statusFilter, setStatusFilter] = useState<string>('all');
|
|
2443
|
+
const [fromDate, setFromDate] = useState('');
|
|
2444
|
+
const [toDate, setToDate] = useState('');
|
|
2430
2445
|
const [page, setPage] = useState(1);
|
|
2431
2446
|
const pageSize = 10;
|
|
2432
2447
|
|
|
@@ -2446,6 +2461,8 @@ export default function TitulosReceberPage() {
|
|
|
2446
2461
|
'finance-receivable-installments-list',
|
|
2447
2462
|
search,
|
|
2448
2463
|
normalizedStatusFilter,
|
|
2464
|
+
fromDate,
|
|
2465
|
+
toDate,
|
|
2449
2466
|
page,
|
|
2450
2467
|
pageSize,
|
|
2451
2468
|
],
|
|
@@ -2458,6 +2475,8 @@ export default function TitulosReceberPage() {
|
|
|
2458
2475
|
pageSize,
|
|
2459
2476
|
search: search.trim() || undefined,
|
|
2460
2477
|
status: normalizedStatusFilter,
|
|
2478
|
+
from: fromDate || undefined,
|
|
2479
|
+
to: toDate || undefined,
|
|
2461
2480
|
},
|
|
2462
2481
|
});
|
|
2463
2482
|
|
|
@@ -2595,7 +2614,7 @@ export default function TitulosReceberPage() {
|
|
|
2595
2614
|
|
|
2596
2615
|
useEffect(() => {
|
|
2597
2616
|
setPage(1);
|
|
2598
|
-
}, [search, normalizedStatusFilter]);
|
|
2617
|
+
}, [search, normalizedStatusFilter, fromDate, toDate]);
|
|
2599
2618
|
|
|
2600
2619
|
const canalBadge = {
|
|
2601
2620
|
boleto: {
|
|
@@ -2611,6 +2630,14 @@ export default function TitulosReceberPage() {
|
|
|
2611
2630
|
label: t('channels.transfer'),
|
|
2612
2631
|
className: 'bg-orange-100 text-orange-700',
|
|
2613
2632
|
},
|
|
2633
|
+
debito_automatico: {
|
|
2634
|
+
label: 'D\u00e9bito autom\u00e1tico',
|
|
2635
|
+
className: 'bg-emerald-100 text-emerald-700',
|
|
2636
|
+
},
|
|
2637
|
+
debito_em_conta: {
|
|
2638
|
+
label: 'D\u00e9bito em conta',
|
|
2639
|
+
className: 'bg-cyan-100 text-cyan-700',
|
|
2640
|
+
},
|
|
2614
2641
|
};
|
|
2615
2642
|
|
|
2616
2643
|
const handleOpenAttachment = async (fileId?: string) => {
|
|
@@ -2675,29 +2702,38 @@ export default function TitulosReceberPage() {
|
|
|
2675
2702
|
|
|
2676
2703
|
<KpiCardsGrid items={summaryCards} columns={3} />
|
|
2677
2704
|
|
|
2678
|
-
<div className="min-w-0">
|
|
2679
|
-
<
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
{
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2705
|
+
<div className="flex min-w-0 flex-wrap items-center gap-2">
|
|
2706
|
+
<div className="min-w-0 flex-1">
|
|
2707
|
+
<SearchBar
|
|
2708
|
+
searchQuery={search}
|
|
2709
|
+
onSearchChange={setSearch}
|
|
2710
|
+
onSearch={() => undefined}
|
|
2711
|
+
placeholder={t('filters.searchPlaceholder')}
|
|
2712
|
+
controls={[
|
|
2713
|
+
{
|
|
2714
|
+
id: 'status',
|
|
2715
|
+
type: 'select',
|
|
2716
|
+
value: statusFilter,
|
|
2717
|
+
onChange: setStatusFilter,
|
|
2718
|
+
placeholder: t('filters.status'),
|
|
2719
|
+
options: [
|
|
2720
|
+
{ value: 'all', label: t('statuses.all') },
|
|
2721
|
+
{ value: 'aberto', label: t('statuses.aberto') },
|
|
2722
|
+
{ value: 'parcial', label: t('statuses.parcial') },
|
|
2723
|
+
{ value: 'liquidado', label: t('statuses.liquidado') },
|
|
2724
|
+
{ value: 'vencido', label: t('statuses.vencido') },
|
|
2725
|
+
{ value: 'cancelado', label: t('statuses.cancelado') },
|
|
2726
|
+
],
|
|
2727
|
+
},
|
|
2728
|
+
]}
|
|
2729
|
+
/>
|
|
2730
|
+
</div>
|
|
2731
|
+
<DateRangePicker
|
|
2732
|
+
fromDate={fromDate}
|
|
2733
|
+
toDate={toDate}
|
|
2734
|
+
onFromDateChange={setFromDate}
|
|
2735
|
+
onToDateChange={setToDate}
|
|
2736
|
+
defaultPreset="thisMonth"
|
|
2701
2737
|
/>
|
|
2702
2738
|
</div>
|
|
2703
2739
|
|