@hed-hog/finance 0.0.224 → 0.0.225
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-financial-title.dto.d.ts +19 -0
- package/dist/dto/create-financial-title.dto.d.ts.map +1 -0
- package/dist/dto/create-financial-title.dto.js +128 -0
- package/dist/dto/create-financial-title.dto.js.map +1 -0
- package/dist/finance.controller.d.ts +276 -0
- package/dist/finance.controller.d.ts.map +1 -0
- package/dist/finance.controller.js +110 -0
- package/dist/finance.controller.js.map +1 -0
- package/dist/finance.module.d.ts.map +1 -1
- package/dist/finance.module.js +8 -3
- package/dist/finance.module.js.map +1 -1
- package/dist/finance.service.d.ts +295 -0
- package/dist/finance.service.d.ts.map +1 -0
- package/dist/finance.service.js +416 -0
- package/dist/finance.service.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/hedhog/data/menu.yaml +72 -25
- package/hedhog/data/route.yaml +55 -1
- package/hedhog/frontend/app/accounts-payable/approvals/page.tsx.ejs +69 -44
- package/hedhog/frontend/app/accounts-payable/installments/[id]/page.tsx.ejs +68 -46
- package/hedhog/frontend/app/accounts-payable/installments/page.tsx.ejs +87 -63
- package/hedhog/frontend/app/accounts-receivable/collections-default/page.tsx.ejs +94 -59
- package/hedhog/frontend/app/accounts-receivable/installments/[id]/page.tsx.ejs +78 -52
- package/hedhog/frontend/app/accounts-receivable/installments/page.tsx.ejs +89 -68
- package/hedhog/frontend/app/cash-and-banks/bank-accounts/page.tsx.ejs +69 -47
- package/hedhog/frontend/app/cash-and-banks/bank-reconciliation/page.tsx.ejs +79 -53
- package/hedhog/frontend/app/cash-and-banks/statements/page.tsx.ejs +43 -36
- package/hedhog/frontend/app/cash-and-banks/transfers/page.tsx.ejs +47 -38
- package/hedhog/frontend/app/page.tsx.ejs +54 -31
- package/hedhog/frontend/app/planning/cash-flow-forecast/page.tsx.ejs +51 -38
- package/hedhog/frontend/app/planning/receivables-calendar/page.tsx.ejs +63 -33
- package/hedhog/frontend/app/planning/scenarios/page.tsx.ejs +50 -33
- package/hedhog/frontend/messages/en.json +776 -0
- package/hedhog/frontend/messages/pt.json +776 -0
- package/package.json +3 -3
- package/src/dto/create-financial-title.dto.ts +142 -0
- package/src/finance.controller.ts +89 -0
- package/src/finance.module.ts +8 -3
- package/src/finance.service.ts +529 -0
- package/src/index.ts +4 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { Page, PageHeader } from '@/components/entity-list';
|
|
3
4
|
import { Button } from '@/components/ui/button';
|
|
4
5
|
import {
|
|
5
6
|
DropdownMenu,
|
|
@@ -12,7 +13,6 @@ import { FilterBar } from '@/components/ui/filter-bar';
|
|
|
12
13
|
import { Input } from '@/components/ui/input';
|
|
13
14
|
import { Label } from '@/components/ui/label';
|
|
14
15
|
import { Money } from '@/components/ui/money';
|
|
15
|
-
import { PageHeader } from '@/components/ui/page-header';
|
|
16
16
|
import {
|
|
17
17
|
Select,
|
|
18
18
|
SelectContent,
|
|
@@ -49,6 +49,7 @@ import {
|
|
|
49
49
|
Undo,
|
|
50
50
|
XCircle,
|
|
51
51
|
} from 'lucide-react';
|
|
52
|
+
import { useTranslations } from 'next-intl';
|
|
52
53
|
import Link from 'next/link';
|
|
53
54
|
import { useState } from 'react';
|
|
54
55
|
import { formatarData } from '../../_lib/formatters';
|
|
@@ -58,37 +59,37 @@ function NovoTituloSheet({
|
|
|
58
59
|
pessoas,
|
|
59
60
|
categorias,
|
|
60
61
|
centrosCusto,
|
|
62
|
+
t,
|
|
61
63
|
}: {
|
|
62
64
|
pessoas: any[];
|
|
63
65
|
categorias: any[];
|
|
64
66
|
centrosCusto: any[];
|
|
67
|
+
t: ReturnType<typeof useTranslations>;
|
|
65
68
|
}) {
|
|
66
69
|
return (
|
|
67
70
|
<Sheet>
|
|
68
71
|
<SheetTrigger asChild>
|
|
69
72
|
<Button>
|
|
70
73
|
<Plus className="mr-2 h-4 w-4" />
|
|
71
|
-
|
|
74
|
+
{t('newTitle.action')}
|
|
72
75
|
</Button>
|
|
73
76
|
</SheetTrigger>
|
|
74
77
|
<SheetContent className="w-full sm:max-w-lg overflow-y-auto">
|
|
75
78
|
<SheetHeader>
|
|
76
|
-
<SheetTitle>
|
|
77
|
-
<SheetDescription>
|
|
78
|
-
Preencha os dados para criar um novo título a pagar.
|
|
79
|
-
</SheetDescription>
|
|
79
|
+
<SheetTitle>{t('newTitle.title')}</SheetTitle>
|
|
80
|
+
<SheetDescription>{t('newTitle.description')}</SheetDescription>
|
|
80
81
|
</SheetHeader>
|
|
81
82
|
<form className="mt-6 space-y-4">
|
|
82
83
|
<div className="grid gap-4">
|
|
83
84
|
<div className="space-y-2">
|
|
84
|
-
<Label htmlFor="documento">
|
|
85
|
+
<Label htmlFor="documento">{t('fields.document')}</Label>
|
|
85
86
|
<Input id="documento" placeholder="NF-00000" />
|
|
86
87
|
</div>
|
|
87
88
|
<div className="space-y-2">
|
|
88
|
-
<Label htmlFor="fornecedor">
|
|
89
|
+
<Label htmlFor="fornecedor">{t('fields.supplier')}</Label>
|
|
89
90
|
<Select>
|
|
90
91
|
<SelectTrigger>
|
|
91
|
-
<SelectValue placeholder=
|
|
92
|
+
<SelectValue placeholder={t('common.select')} />
|
|
92
93
|
</SelectTrigger>
|
|
93
94
|
<SelectContent>
|
|
94
95
|
{pessoas
|
|
@@ -105,23 +106,23 @@ function NovoTituloSheet({
|
|
|
105
106
|
</div>
|
|
106
107
|
<div className="grid grid-cols-2 gap-4">
|
|
107
108
|
<div className="space-y-2">
|
|
108
|
-
<Label htmlFor="competencia">
|
|
109
|
+
<Label htmlFor="competencia">{t('fields.competency')}</Label>
|
|
109
110
|
<Input id="competencia" type="month" />
|
|
110
111
|
</div>
|
|
111
112
|
<div className="space-y-2">
|
|
112
|
-
<Label htmlFor="vencimento">
|
|
113
|
+
<Label htmlFor="vencimento">{t('fields.dueDate')}</Label>
|
|
113
114
|
<Input id="vencimento" type="date" />
|
|
114
115
|
</div>
|
|
115
116
|
</div>
|
|
116
117
|
<div className="space-y-2">
|
|
117
|
-
<Label htmlFor="valor">
|
|
118
|
+
<Label htmlFor="valor">{t('fields.totalValue')}</Label>
|
|
118
119
|
<Input id="valor" type="number" placeholder="0,00" step="0.01" />
|
|
119
120
|
</div>
|
|
120
121
|
<div className="space-y-2">
|
|
121
|
-
<Label htmlFor="categoria">
|
|
122
|
+
<Label htmlFor="categoria">{t('fields.category')}</Label>
|
|
122
123
|
<Select>
|
|
123
124
|
<SelectTrigger>
|
|
124
|
-
<SelectValue placeholder=
|
|
125
|
+
<SelectValue placeholder={t('common.select')} />
|
|
125
126
|
</SelectTrigger>
|
|
126
127
|
<SelectContent>
|
|
127
128
|
{categorias
|
|
@@ -135,10 +136,10 @@ function NovoTituloSheet({
|
|
|
135
136
|
</Select>
|
|
136
137
|
</div>
|
|
137
138
|
<div className="space-y-2">
|
|
138
|
-
<Label htmlFor="centroCusto">
|
|
139
|
+
<Label htmlFor="centroCusto">{t('fields.costCenter')}</Label>
|
|
139
140
|
<Select>
|
|
140
141
|
<SelectTrigger>
|
|
141
|
-
<SelectValue placeholder=
|
|
142
|
+
<SelectValue placeholder={t('common.select')} />
|
|
142
143
|
</SelectTrigger>
|
|
143
144
|
<SelectContent>
|
|
144
145
|
{centrosCusto.map((c) => (
|
|
@@ -150,31 +151,44 @@ function NovoTituloSheet({
|
|
|
150
151
|
</Select>
|
|
151
152
|
</div>
|
|
152
153
|
<div className="space-y-2">
|
|
153
|
-
<Label htmlFor="metodo">
|
|
154
|
+
<Label htmlFor="metodo">{t('fields.paymentMethod')}</Label>
|
|
154
155
|
<Select>
|
|
155
156
|
<SelectTrigger>
|
|
156
|
-
<SelectValue placeholder=
|
|
157
|
+
<SelectValue placeholder={t('common.select')} />
|
|
157
158
|
</SelectTrigger>
|
|
158
159
|
<SelectContent>
|
|
159
|
-
<SelectItem value="boleto">
|
|
160
|
+
<SelectItem value="boleto">
|
|
161
|
+
{t('paymentMethods.boleto')}
|
|
162
|
+
</SelectItem>
|
|
160
163
|
<SelectItem value="pix">PIX</SelectItem>
|
|
161
|
-
<SelectItem value="transferencia">
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
<SelectItem value="
|
|
164
|
+
<SelectItem value="transferencia">
|
|
165
|
+
{t('paymentMethods.transfer')}
|
|
166
|
+
</SelectItem>
|
|
167
|
+
<SelectItem value="cartao">
|
|
168
|
+
{t('paymentMethods.card')}
|
|
169
|
+
</SelectItem>
|
|
170
|
+
<SelectItem value="dinheiro">
|
|
171
|
+
{t('paymentMethods.cash')}
|
|
172
|
+
</SelectItem>
|
|
173
|
+
<SelectItem value="cheque">
|
|
174
|
+
{t('paymentMethods.check')}
|
|
175
|
+
</SelectItem>
|
|
165
176
|
</SelectContent>
|
|
166
177
|
</Select>
|
|
167
178
|
</div>
|
|
168
179
|
<div className="space-y-2">
|
|
169
|
-
<Label htmlFor="descricao">
|
|
170
|
-
<Textarea
|
|
180
|
+
<Label htmlFor="descricao">{t('fields.description')}</Label>
|
|
181
|
+
<Textarea
|
|
182
|
+
id="descricao"
|
|
183
|
+
placeholder={t('newTitle.descriptionPlaceholder')}
|
|
184
|
+
/>
|
|
171
185
|
</div>
|
|
172
186
|
</div>
|
|
173
187
|
<div className="flex justify-end gap-2 pt-4">
|
|
174
188
|
<Button type="button" variant="outline">
|
|
175
|
-
|
|
189
|
+
{t('common.cancel')}
|
|
176
190
|
</Button>
|
|
177
|
-
<Button type="submit">
|
|
191
|
+
<Button type="submit">{t('common.save')}</Button>
|
|
178
192
|
</div>
|
|
179
193
|
</form>
|
|
180
194
|
</SheetContent>
|
|
@@ -183,6 +197,7 @@ function NovoTituloSheet({
|
|
|
183
197
|
}
|
|
184
198
|
|
|
185
199
|
export default function TitulosPagarPage() {
|
|
200
|
+
const t = useTranslations('finance.PayableInstallmentsPage');
|
|
186
201
|
const { data } = useFinanceData();
|
|
187
202
|
const { titulosPagar, pessoas, categorias, centrosCusto } = data;
|
|
188
203
|
|
|
@@ -205,42 +220,44 @@ export default function TitulosPagarPage() {
|
|
|
205
220
|
});
|
|
206
221
|
|
|
207
222
|
return (
|
|
208
|
-
<
|
|
223
|
+
<Page>
|
|
209
224
|
<PageHeader
|
|
210
|
-
title=
|
|
211
|
-
description=
|
|
225
|
+
title={t('header.title')}
|
|
226
|
+
description={t('header.description')}
|
|
212
227
|
breadcrumbs={[
|
|
213
|
-
{ label: '
|
|
214
|
-
{ label: '
|
|
228
|
+
{ label: t('breadcrumbs.home'), href: '/' },
|
|
229
|
+
{ label: t('breadcrumbs.finance'), href: '/finance' },
|
|
230
|
+
{ label: t('breadcrumbs.current') },
|
|
215
231
|
]}
|
|
216
232
|
actions={
|
|
217
233
|
<NovoTituloSheet
|
|
218
234
|
pessoas={pessoas}
|
|
219
235
|
categorias={categorias}
|
|
220
236
|
centrosCusto={centrosCusto}
|
|
237
|
+
t={t}
|
|
221
238
|
/>
|
|
222
239
|
}
|
|
223
240
|
/>
|
|
224
241
|
|
|
225
242
|
<FilterBar
|
|
226
|
-
searchPlaceholder=
|
|
243
|
+
searchPlaceholder={t('filters.searchPlaceholder')}
|
|
227
244
|
searchValue={search}
|
|
228
245
|
onSearchChange={setSearch}
|
|
229
246
|
filters={[
|
|
230
247
|
{
|
|
231
248
|
id: 'status',
|
|
232
|
-
label: '
|
|
249
|
+
label: t('filters.status'),
|
|
233
250
|
value: statusFilter,
|
|
234
251
|
onChange: setStatusFilter,
|
|
235
252
|
options: [
|
|
236
|
-
{ value: 'all', label: '
|
|
237
|
-
{ value: 'rascunho', label: '
|
|
238
|
-
{ value: 'aprovado', label: '
|
|
239
|
-
{ value: 'aberto', label: '
|
|
240
|
-
{ value: 'parcial', label: '
|
|
241
|
-
{ value: 'liquidado', label: '
|
|
242
|
-
{ value: 'vencido', label: '
|
|
243
|
-
{ value: 'cancelado', label: '
|
|
253
|
+
{ value: 'all', label: t('statuses.all') },
|
|
254
|
+
{ value: 'rascunho', label: t('statuses.rascunho') },
|
|
255
|
+
{ value: 'aprovado', label: t('statuses.aprovado') },
|
|
256
|
+
{ value: 'aberto', label: t('statuses.aberto') },
|
|
257
|
+
{ value: 'parcial', label: t('statuses.parcial') },
|
|
258
|
+
{ value: 'liquidado', label: t('statuses.liquidado') },
|
|
259
|
+
{ value: 'vencido', label: t('statuses.vencido') },
|
|
260
|
+
{ value: 'cancelado', label: t('statuses.cancelado') },
|
|
244
261
|
],
|
|
245
262
|
},
|
|
246
263
|
]}
|
|
@@ -252,13 +269,15 @@ export default function TitulosPagarPage() {
|
|
|
252
269
|
<Table>
|
|
253
270
|
<TableHeader>
|
|
254
271
|
<TableRow>
|
|
255
|
-
<TableHead>
|
|
256
|
-
<TableHead>
|
|
257
|
-
<TableHead>
|
|
258
|
-
<TableHead>
|
|
259
|
-
<TableHead className="text-right">
|
|
260
|
-
|
|
261
|
-
|
|
272
|
+
<TableHead>{t('table.headers.document')}</TableHead>
|
|
273
|
+
<TableHead>{t('table.headers.supplier')}</TableHead>
|
|
274
|
+
<TableHead>{t('table.headers.competency')}</TableHead>
|
|
275
|
+
<TableHead>{t('table.headers.dueDate')}</TableHead>
|
|
276
|
+
<TableHead className="text-right">
|
|
277
|
+
{t('table.headers.value')}
|
|
278
|
+
</TableHead>
|
|
279
|
+
<TableHead>{t('table.headers.category')}</TableHead>
|
|
280
|
+
<TableHead>{t('table.headers.status')}</TableHead>
|
|
262
281
|
<TableHead className="w-[50px]" />
|
|
263
282
|
</TableRow>
|
|
264
283
|
</TableHeader>
|
|
@@ -302,37 +321,41 @@ export default function TitulosPagarPage() {
|
|
|
302
321
|
<DropdownMenuTrigger asChild>
|
|
303
322
|
<Button variant="ghost" size="icon">
|
|
304
323
|
<MoreHorizontal className="h-4 w-4" />
|
|
305
|
-
<span className="sr-only">
|
|
324
|
+
<span className="sr-only">
|
|
325
|
+
{t('table.actions.srActions')}
|
|
326
|
+
</span>
|
|
306
327
|
</Button>
|
|
307
328
|
</DropdownMenuTrigger>
|
|
308
329
|
<DropdownMenuContent align="end">
|
|
309
330
|
<DropdownMenuItem asChild>
|
|
310
|
-
<Link
|
|
331
|
+
<Link
|
|
332
|
+
href={`/finance/accounts-payable/installments/${titulo.id}`}
|
|
333
|
+
>
|
|
311
334
|
<Eye className="mr-2 h-4 w-4" />
|
|
312
|
-
|
|
335
|
+
{t('table.actions.viewDetails')}
|
|
313
336
|
</Link>
|
|
314
337
|
</DropdownMenuItem>
|
|
315
338
|
<DropdownMenuItem>
|
|
316
339
|
<Edit className="mr-2 h-4 w-4" />
|
|
317
|
-
|
|
340
|
+
{t('table.actions.edit')}
|
|
318
341
|
</DropdownMenuItem>
|
|
319
342
|
<DropdownMenuSeparator />
|
|
320
343
|
<DropdownMenuItem>
|
|
321
344
|
<CheckCircle className="mr-2 h-4 w-4" />
|
|
322
|
-
|
|
345
|
+
{t('table.actions.approve')}
|
|
323
346
|
</DropdownMenuItem>
|
|
324
347
|
<DropdownMenuItem>
|
|
325
348
|
<Download className="mr-2 h-4 w-4" />
|
|
326
|
-
|
|
349
|
+
{t('table.actions.settle')}
|
|
327
350
|
</DropdownMenuItem>
|
|
328
351
|
<DropdownMenuItem>
|
|
329
352
|
<Undo className="mr-2 h-4 w-4" />
|
|
330
|
-
|
|
353
|
+
{t('table.actions.reverse')}
|
|
331
354
|
</DropdownMenuItem>
|
|
332
355
|
<DropdownMenuSeparator />
|
|
333
356
|
<DropdownMenuItem className="text-destructive">
|
|
334
357
|
<XCircle className="mr-2 h-4 w-4" />
|
|
335
|
-
|
|
358
|
+
{t('table.actions.cancel')}
|
|
336
359
|
</DropdownMenuItem>
|
|
337
360
|
</DropdownMenuContent>
|
|
338
361
|
</DropdownMenu>
|
|
@@ -346,19 +369,20 @@ export default function TitulosPagarPage() {
|
|
|
346
369
|
|
|
347
370
|
<div className="flex items-center justify-between">
|
|
348
371
|
<p className="text-sm text-muted-foreground">
|
|
349
|
-
|
|
372
|
+
{t('footer.showing', {
|
|
373
|
+
filtered: filteredTitulos.length,
|
|
374
|
+
total: titulosPagar.length,
|
|
375
|
+
})}
|
|
350
376
|
</p>
|
|
351
377
|
<div className="flex items-center gap-2">
|
|
352
378
|
<Button variant="outline" size="sm" disabled>
|
|
353
|
-
|
|
379
|
+
{t('footer.previous')}
|
|
354
380
|
</Button>
|
|
355
381
|
<Button variant="outline" size="sm" disabled>
|
|
356
|
-
|
|
382
|
+
{t('footer.next')}
|
|
357
383
|
</Button>
|
|
358
384
|
</div>
|
|
359
385
|
</div>
|
|
360
|
-
</
|
|
386
|
+
</Page>
|
|
361
387
|
);
|
|
362
388
|
}
|
|
363
|
-
|
|
364
|
-
|