@hed-hog/finance 0.0.299 → 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/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/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/finance-bank-accounts.controller.d.ts +3 -0
- package/dist/finance-bank-accounts.controller.d.ts.map +1 -1
- package/dist/finance-data.controller.d.ts +1 -0
- package/dist/finance-data.controller.d.ts.map +1 -1
- 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/dist/finance.service.d.ts +4 -0
- package/dist/finance.service.d.ts.map +1 -1
- package/dist/finance.service.js +5 -0
- package/dist/finance.service.js.map +1 -1
- package/hedhog/data/dashboard.yaml +6 -0
- package/hedhog/data/dashboard_component.yaml +72 -17
- package/hedhog/data/dashboard_component_role.yaml +30 -0
- package/hedhog/data/dashboard_item.yaml +155 -0
- package/hedhog/data/dashboard_role.yaml +6 -0
- package/hedhog/data/role_menu.yaml +6 -0
- package/hedhog/data/role_route.yaml +127 -0
- 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 +586 -224
- 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 +224 -70
- package/hedhog/frontend/messages/pt.json +224 -70
- package/hedhog/frontend/widgets/alerts.tsx.ejs +1 -1
- package/hedhog/frontend/widgets/bank-reconciliation-status.tsx.ejs +142 -0
- package/hedhog/frontend/widgets/cash-balance-kpi.tsx.ejs +9 -9
- package/hedhog/frontend/widgets/cash-flow-chart.tsx.ejs +1 -1
- package/hedhog/frontend/widgets/default-kpi.tsx.ejs +9 -9
- package/hedhog/frontend/widgets/payable-30d-kpi.tsx.ejs +9 -9
- package/hedhog/frontend/widgets/pending-approvals-kpi.tsx.ejs +78 -0
- package/hedhog/frontend/widgets/pending-approvals-list.tsx.ejs +147 -0
- package/hedhog/frontend/widgets/pending-reconciliation-kpi.tsx.ejs +84 -0
- package/hedhog/frontend/widgets/receivable-30d-kpi.tsx.ejs +9 -9
- package/hedhog/frontend/widgets/receivable-aging-analysis.tsx.ejs +163 -0
- package/hedhog/frontend/widgets/upcoming-payable.tsx.ejs +1 -1
- package/hedhog/frontend/widgets/upcoming-receivable.tsx.ejs +1 -1
- package/hedhog/table/bank_account.yaml +8 -0
- package/package.json +7 -6
- package/src/dto/create-bank-account.dto.ts +7 -1
- package/src/dto/update-bank-account.dto.ts +7 -1
- 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
- package/src/finance.service.ts +4 -0
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Form,
|
|
15
|
-
FormControl,
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
FinancePageSection,
|
|
5
|
+
FinanceSheetBody,
|
|
6
|
+
FinanceSheetSection,
|
|
7
|
+
} from '@/app/(app)/(libraries)/finance/_components/finance-layout';
|
|
8
|
+
import { EmptyState, Page, PageHeader } from '@/components/entity-list';
|
|
9
|
+
import { RichTextEditor } from '@/components/rich-text-editor';
|
|
10
|
+
import { Button } from '@/components/ui/button';
|
|
11
|
+
import {
|
|
12
|
+
Form,
|
|
13
|
+
FormControl,
|
|
16
14
|
FormField,
|
|
17
15
|
FormItem,
|
|
18
16
|
FormLabel,
|
|
19
17
|
FormMessage,
|
|
20
|
-
} from '@/components/ui/form';
|
|
21
|
-
import { Input } from '@/components/ui/input';
|
|
22
|
-
import { InputMoney } from '@/components/ui/input-money';
|
|
23
|
-
import {
|
|
18
|
+
} from '@/components/ui/form';
|
|
19
|
+
import { Input } from '@/components/ui/input';
|
|
20
|
+
import { InputMoney } from '@/components/ui/input-money';
|
|
21
|
+
import { KpiCardsGrid } from '@/components/ui/kpi-cards-grid';
|
|
22
|
+
import { Money } from '@/components/ui/money';
|
|
24
23
|
import {
|
|
25
24
|
Sheet,
|
|
26
25
|
SheetContent,
|
|
@@ -106,21 +105,22 @@ function HistoricoContatosSheet({
|
|
|
106
105
|
}) {
|
|
107
106
|
return (
|
|
108
107
|
<Sheet>
|
|
109
|
-
<SheetTrigger asChild>
|
|
110
|
-
<Button variant="outline" size="sm">
|
|
111
|
-
<FileText className="mr-2 h-4 w-4" />
|
|
112
|
-
{t('actions.history')}
|
|
113
|
-
</Button>
|
|
114
|
-
</SheetTrigger>
|
|
115
|
-
<SheetContent>
|
|
116
|
-
<SheetHeader>
|
|
117
|
-
<SheetTitle>{t('history.title')}</SheetTitle>
|
|
118
|
-
<SheetDescription>{cliente}</SheetDescription>
|
|
119
|
-
</SheetHeader>
|
|
120
|
-
<
|
|
121
|
-
{
|
|
122
|
-
|
|
123
|
-
|
|
108
|
+
<SheetTrigger asChild>
|
|
109
|
+
<Button variant="outline" size="sm">
|
|
110
|
+
<FileText className="mr-2 h-4 w-4" />
|
|
111
|
+
{t('actions.history')}
|
|
112
|
+
</Button>
|
|
113
|
+
</SheetTrigger>
|
|
114
|
+
<SheetContent className="flex h-full w-full flex-col overflow-hidden p-0 sm:max-w-xl">
|
|
115
|
+
<SheetHeader className="border-b border-border/50 px-4 py-4 sm:px-6">
|
|
116
|
+
<SheetTitle>{t('history.title')}</SheetTitle>
|
|
117
|
+
<SheetDescription>{cliente}</SheetDescription>
|
|
118
|
+
</SheetHeader>
|
|
119
|
+
<FinanceSheetBody>
|
|
120
|
+
<FinanceSheetSection title={t('history.title')}>
|
|
121
|
+
{historicoContatos.length === 0 ? (
|
|
122
|
+
<div className="rounded-lg border p-4 text-sm text-muted-foreground">
|
|
123
|
+
-
|
|
124
124
|
</div>
|
|
125
125
|
) : (
|
|
126
126
|
historicoContatos.map((contato, i) => (
|
|
@@ -138,13 +138,14 @@ function HistoricoContatosSheet({
|
|
|
138
138
|
<p className="mt-1 text-xs text-muted-foreground">
|
|
139
139
|
{t('history.by')} {contato.responsavel}
|
|
140
140
|
</p>
|
|
141
|
-
</div>
|
|
142
|
-
))
|
|
143
|
-
)}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
141
|
+
</div>
|
|
142
|
+
))
|
|
143
|
+
)}
|
|
144
|
+
</FinanceSheetSection>
|
|
145
|
+
</FinanceSheetBody>
|
|
146
|
+
</SheetContent>
|
|
147
|
+
</Sheet>
|
|
148
|
+
);
|
|
148
149
|
}
|
|
149
150
|
|
|
150
151
|
function EnviarCobrancaDialog({
|
|
@@ -197,48 +198,62 @@ function EnviarCobrancaDialog({
|
|
|
197
198
|
{t('actions.collect')}
|
|
198
199
|
</Button>
|
|
199
200
|
</SheetTrigger>
|
|
200
|
-
<SheetContent
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
201
|
+
<SheetContent
|
|
202
|
+
side="right"
|
|
203
|
+
className="flex h-full w-[90vw] flex-col overflow-hidden p-0 sm:max-w-xl"
|
|
204
|
+
>
|
|
205
|
+
<SheetHeader className="border-b border-border/50 px-4 py-4 sm:px-6">
|
|
206
|
+
<SheetTitle>{t('send.title')}</SheetTitle>
|
|
207
|
+
<SheetDescription>
|
|
208
|
+
{t('send.description', { cliente })}
|
|
205
209
|
</SheetDescription>
|
|
206
210
|
</SheetHeader>
|
|
207
|
-
|
|
208
|
-
<Form {...form}>
|
|
209
|
-
<form
|
|
210
|
-
className="
|
|
211
|
-
onSubmit={form.handleSubmit(onSubmit)}
|
|
212
|
-
>
|
|
213
|
-
<
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
211
|
+
|
|
212
|
+
<Form {...form}>
|
|
213
|
+
<form
|
|
214
|
+
className="flex h-full flex-col overflow-hidden"
|
|
215
|
+
onSubmit={form.handleSubmit(onSubmit)}
|
|
216
|
+
>
|
|
217
|
+
<FinanceSheetBody>
|
|
218
|
+
<FinanceSheetSection
|
|
219
|
+
title={t('send.title')}
|
|
220
|
+
description={t('send.description', { cliente })}
|
|
221
|
+
>
|
|
222
|
+
<FormField
|
|
223
|
+
control={form.control}
|
|
224
|
+
name="message"
|
|
225
|
+
render={({ field }) => (
|
|
226
|
+
<FormItem className="space-y-2">
|
|
227
|
+
<FormLabel>{t('send.message')}</FormLabel>
|
|
228
|
+
<FormControl>
|
|
229
|
+
<RichTextEditor
|
|
230
|
+
className="w-full max-w-full min-w-0 overflow-hidden [&_.ProseMirror]:max-w-full [&_.ProseMirror]:mx-0"
|
|
231
|
+
value={field.value ?? ''}
|
|
232
|
+
onChange={field.onChange}
|
|
233
|
+
/>
|
|
234
|
+
</FormControl>
|
|
235
|
+
<FormMessage />
|
|
236
|
+
</FormItem>
|
|
237
|
+
)}
|
|
238
|
+
/>
|
|
239
|
+
</FinanceSheetSection>
|
|
240
|
+
</FinanceSheetBody>
|
|
241
|
+
|
|
242
|
+
<div className="border-t border-border/50 px-4 py-4 sm:px-6">
|
|
243
|
+
<div className="flex flex-col-reverse gap-2 sm:flex-row sm:justify-end">
|
|
244
|
+
<Button type="button" variant="outline" onClick={() => setOpen(false)}>
|
|
245
|
+
{t('common.cancel')}
|
|
246
|
+
</Button>
|
|
247
|
+
<Button
|
|
248
|
+
type="submit"
|
|
249
|
+
disabled={form.formState.isSubmitting}
|
|
250
|
+
>
|
|
251
|
+
{t('send.submit')}
|
|
252
|
+
</Button>
|
|
253
|
+
</div>
|
|
254
|
+
</div>
|
|
255
|
+
</form>
|
|
256
|
+
</Form>
|
|
242
257
|
</SheetContent>
|
|
243
258
|
</Sheet>
|
|
244
259
|
);
|
|
@@ -297,101 +312,115 @@ function RegistrarAcordoDialog({
|
|
|
297
312
|
{t('actions.registerAgreement')}
|
|
298
313
|
</Button>
|
|
299
314
|
</SheetTrigger>
|
|
300
|
-
<SheetContent
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
315
|
+
<SheetContent
|
|
316
|
+
side="right"
|
|
317
|
+
className="flex h-full w-[90vw] flex-col overflow-hidden p-0 sm:max-w-xl"
|
|
318
|
+
>
|
|
319
|
+
<SheetHeader className="border-b border-border/50 px-4 py-4 sm:px-6">
|
|
320
|
+
<SheetTitle>{t('agreement.title')}</SheetTitle>
|
|
321
|
+
<SheetDescription>
|
|
322
|
+
{t('agreement.description', { cliente })}
|
|
305
323
|
</SheetDescription>
|
|
306
324
|
</SheetHeader>
|
|
307
|
-
|
|
308
|
-
<Form {...form}>
|
|
309
|
-
<form
|
|
310
|
-
className="
|
|
311
|
-
onSubmit={form.handleSubmit(onSubmit)}
|
|
312
|
-
>
|
|
313
|
-
<
|
|
314
|
-
<
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
325
|
+
|
|
326
|
+
<Form {...form}>
|
|
327
|
+
<form
|
|
328
|
+
className="flex h-full flex-col overflow-hidden"
|
|
329
|
+
onSubmit={form.handleSubmit(onSubmit)}
|
|
330
|
+
>
|
|
331
|
+
<FinanceSheetBody>
|
|
332
|
+
<FinanceSheetSection
|
|
333
|
+
title={t('agreement.title')}
|
|
334
|
+
description={t('agreement.description', { cliente })}
|
|
335
|
+
>
|
|
336
|
+
<div className="grid grid-cols-2 gap-4">
|
|
337
|
+
<FormField
|
|
338
|
+
control={form.control}
|
|
339
|
+
name="amount"
|
|
340
|
+
render={({ field }) => (
|
|
341
|
+
<FormItem className="space-y-2">
|
|
342
|
+
<FormLabel>{t('agreement.value')}</FormLabel>
|
|
343
|
+
<FormControl>
|
|
344
|
+
<InputMoney
|
|
345
|
+
placeholder="0,00"
|
|
346
|
+
value={field.value ?? 0}
|
|
347
|
+
onValueChange={(value) => field.onChange(value ?? 0)}
|
|
348
|
+
/>
|
|
349
|
+
</FormControl>
|
|
350
|
+
<FormMessage />
|
|
351
|
+
</FormItem>
|
|
352
|
+
)}
|
|
353
|
+
/>
|
|
354
|
+
|
|
355
|
+
<FormField
|
|
356
|
+
control={form.control}
|
|
357
|
+
name="installments"
|
|
358
|
+
render={({ field }) => (
|
|
359
|
+
<FormItem className="space-y-2">
|
|
360
|
+
<FormLabel>{t('agreement.installments')}</FormLabel>
|
|
361
|
+
<FormControl>
|
|
362
|
+
<Input
|
|
363
|
+
type="number"
|
|
364
|
+
min={1}
|
|
365
|
+
max={120}
|
|
366
|
+
value={field.value}
|
|
367
|
+
onChange={field.onChange}
|
|
368
|
+
/>
|
|
369
|
+
</FormControl>
|
|
370
|
+
<FormMessage />
|
|
371
|
+
</FormItem>
|
|
372
|
+
)}
|
|
373
|
+
/>
|
|
374
|
+
</div>
|
|
375
|
+
|
|
376
|
+
<FormField
|
|
377
|
+
control={form.control}
|
|
378
|
+
name="first_due_date"
|
|
379
|
+
render={({ field }) => (
|
|
380
|
+
<FormItem className="space-y-2">
|
|
381
|
+
<FormLabel>{t('agreement.firstDueDate')}</FormLabel>
|
|
382
|
+
<FormControl>
|
|
383
|
+
<Input type="date" {...field} />
|
|
384
|
+
</FormControl>
|
|
385
|
+
<FormMessage />
|
|
386
|
+
</FormItem>
|
|
387
|
+
)}
|
|
388
|
+
/>
|
|
389
|
+
|
|
390
|
+
<FormField
|
|
391
|
+
control={form.control}
|
|
392
|
+
name="notes"
|
|
393
|
+
render={({ field }) => (
|
|
394
|
+
<FormItem className="space-y-2">
|
|
395
|
+
<FormLabel>{t('agreement.notes')}</FormLabel>
|
|
396
|
+
<FormControl>
|
|
397
|
+
<Textarea
|
|
398
|
+
placeholder={t('agreement.notesPlaceholder')}
|
|
399
|
+
{...field}
|
|
400
|
+
/>
|
|
401
|
+
</FormControl>
|
|
402
|
+
<FormMessage />
|
|
403
|
+
</FormItem>
|
|
404
|
+
)}
|
|
405
|
+
/>
|
|
406
|
+
</FinanceSheetSection>
|
|
407
|
+
</FinanceSheetBody>
|
|
408
|
+
|
|
409
|
+
<div className="border-t border-border/50 px-4 py-4 sm:px-6">
|
|
410
|
+
<div className="flex flex-col-reverse gap-2 sm:flex-row sm:justify-end">
|
|
411
|
+
<Button type="button" variant="outline" onClick={() => setOpen(false)}>
|
|
412
|
+
{t('common.cancel')}
|
|
413
|
+
</Button>
|
|
414
|
+
<Button
|
|
415
|
+
type="submit"
|
|
416
|
+
disabled={form.formState.isSubmitting}
|
|
417
|
+
>
|
|
418
|
+
{t('agreement.submit')}
|
|
419
|
+
</Button>
|
|
420
|
+
</div>
|
|
421
|
+
</div>
|
|
422
|
+
</form>
|
|
423
|
+
</Form>
|
|
395
424
|
</SheetContent>
|
|
396
425
|
</Sheet>
|
|
397
426
|
);
|
|
@@ -451,11 +480,39 @@ export default function CobrancaPage() {
|
|
|
451
480
|
},
|
|
452
481
|
];
|
|
453
482
|
|
|
454
|
-
const totalInadimplencia = agingInadimplencia.reduce(
|
|
455
|
-
(acc, c) => acc + c.total,
|
|
456
|
-
0
|
|
457
|
-
);
|
|
458
|
-
const totalClientes = agingInadimplencia.length;
|
|
483
|
+
const totalInadimplencia = agingInadimplencia.reduce(
|
|
484
|
+
(acc, c) => acc + c.total,
|
|
485
|
+
0
|
|
486
|
+
);
|
|
487
|
+
const totalClientes = agingInadimplencia.length;
|
|
488
|
+
const summaryCards = [
|
|
489
|
+
{
|
|
490
|
+
key: 'default',
|
|
491
|
+
title: t('cards.totalDefault'),
|
|
492
|
+
value: <Money value={totalInadimplencia} />,
|
|
493
|
+
icon: AlertTriangle,
|
|
494
|
+
layout: 'compact' as const,
|
|
495
|
+
iconContainerClassName: 'bg-red-500/10 text-red-700',
|
|
496
|
+
accentClassName: 'from-red-500/20 via-orange-500/10 to-transparent',
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
key: 'clients',
|
|
500
|
+
title: t('cards.lateClients'),
|
|
501
|
+
value: totalClientes,
|
|
502
|
+
icon: FileText,
|
|
503
|
+
layout: 'compact' as const,
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
key: 'delay',
|
|
507
|
+
title: t('cards.maxDelay'),
|
|
508
|
+
value: t('cards.maxDelayValue'),
|
|
509
|
+
icon: AlertTriangle,
|
|
510
|
+
layout: 'compact' as const,
|
|
511
|
+
valueClassName: 'text-destructive',
|
|
512
|
+
iconContainerClassName: 'bg-orange-500/10 text-orange-700',
|
|
513
|
+
accentClassName: 'from-orange-500/20 via-amber-500/10 to-transparent',
|
|
514
|
+
},
|
|
515
|
+
];
|
|
459
516
|
|
|
460
517
|
return (
|
|
461
518
|
<Page>
|
|
@@ -469,53 +526,16 @@ export default function CobrancaPage() {
|
|
|
469
526
|
]}
|
|
470
527
|
/>
|
|
471
528
|
|
|
472
|
-
<
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
<Money value={totalInadimplencia} />
|
|
483
|
-
</div>
|
|
484
|
-
</CardContent>
|
|
485
|
-
</Card>
|
|
486
|
-
<Card>
|
|
487
|
-
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
|
488
|
-
<CardTitle className="text-sm font-medium">
|
|
489
|
-
{t('cards.lateClients')}
|
|
490
|
-
</CardTitle>
|
|
491
|
-
</CardHeader>
|
|
492
|
-
<CardContent>
|
|
493
|
-
<div className="text-2xl font-bold">{totalClientes}</div>
|
|
494
|
-
</CardContent>
|
|
495
|
-
</Card>
|
|
496
|
-
<Card>
|
|
497
|
-
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
|
498
|
-
<CardTitle className="text-sm font-medium">
|
|
499
|
-
{t('cards.maxDelay')}
|
|
500
|
-
</CardTitle>
|
|
501
|
-
</CardHeader>
|
|
502
|
-
<CardContent>
|
|
503
|
-
<div className="text-2xl font-bold text-destructive">
|
|
504
|
-
{t('cards.maxDelayValue')}
|
|
505
|
-
</div>
|
|
506
|
-
</CardContent>
|
|
507
|
-
</Card>
|
|
508
|
-
</div>
|
|
509
|
-
|
|
510
|
-
<Card>
|
|
511
|
-
<CardHeader>
|
|
512
|
-
<CardTitle>{t('aging.title')}</CardTitle>
|
|
513
|
-
<CardDescription>{t('aging.description')}</CardDescription>
|
|
514
|
-
</CardHeader>
|
|
515
|
-
<CardContent>
|
|
516
|
-
<ResponsiveContainer width="100%" height={250}>
|
|
517
|
-
<BarChart data={chartData}>
|
|
518
|
-
<CartesianGrid strokeDasharray="3 3" className="stroke-muted" />
|
|
529
|
+
<KpiCardsGrid items={summaryCards} columns={3} />
|
|
530
|
+
|
|
531
|
+
<FinancePageSection
|
|
532
|
+
title={t('aging.title')}
|
|
533
|
+
description={t('aging.description')}
|
|
534
|
+
contentClassName="p-4 sm:p-6"
|
|
535
|
+
>
|
|
536
|
+
<ResponsiveContainer width="100%" height={250}>
|
|
537
|
+
<BarChart data={chartData}>
|
|
538
|
+
<CartesianGrid strokeDasharray="3 3" className="stroke-muted" />
|
|
519
539
|
<XAxis dataKey="name" tick={{ fontSize: 12 }} />
|
|
520
540
|
<YAxis
|
|
521
541
|
tick={{ fontSize: 12 }}
|
|
@@ -536,22 +556,20 @@ export default function CobrancaPage() {
|
|
|
536
556
|
dataKey="valor"
|
|
537
557
|
radius={[4, 4, 0, 0]}
|
|
538
558
|
fill="var(--primary)"
|
|
539
|
-
/>
|
|
540
|
-
</BarChart>
|
|
541
|
-
</ResponsiveContainer>
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
<TableHeader>
|
|
554
|
-
<TableRow>
|
|
559
|
+
/>
|
|
560
|
+
</BarChart>
|
|
561
|
+
</ResponsiveContainer>
|
|
562
|
+
</FinancePageSection>
|
|
563
|
+
|
|
564
|
+
<FinancePageSection
|
|
565
|
+
title={t('table.title')}
|
|
566
|
+
description={t('table.description')}
|
|
567
|
+
>
|
|
568
|
+
{agingInadimplencia.length > 0 ? (
|
|
569
|
+
<div className="overflow-x-auto">
|
|
570
|
+
<Table className="min-w-[980px]">
|
|
571
|
+
<TableHeader>
|
|
572
|
+
<TableRow>
|
|
555
573
|
<TableHead>{t('table.headers.client')}</TableHead>
|
|
556
574
|
<TableHead className="text-right">
|
|
557
575
|
{t('table.headers.range0to30')}
|
|
@@ -572,13 +590,13 @@ export default function CobrancaPage() {
|
|
|
572
590
|
{t('table.headers.actions')}
|
|
573
591
|
</TableHead>
|
|
574
592
|
</TableRow>
|
|
575
|
-
</TableHeader>
|
|
576
|
-
<TableBody>
|
|
577
|
-
{agingInadimplencia.map((item) => (
|
|
578
|
-
<TableRow key={item.clienteId}>
|
|
579
|
-
<TableCell className="font-medium">
|
|
580
|
-
{item.cliente}
|
|
581
|
-
</TableCell>
|
|
593
|
+
</TableHeader>
|
|
594
|
+
<TableBody>
|
|
595
|
+
{agingInadimplencia.map((item) => (
|
|
596
|
+
<TableRow key={item.clienteId} className="hover:bg-muted/30">
|
|
597
|
+
<TableCell className="font-medium">
|
|
598
|
+
{item.cliente}
|
|
599
|
+
</TableCell>
|
|
582
600
|
<TableCell className="text-right">
|
|
583
601
|
{item.bucket0_30 > 0 ? (
|
|
584
602
|
<Money value={item.bucket0_30} />
|
|
@@ -636,22 +654,24 @@ export default function CobrancaPage() {
|
|
|
636
654
|
</div>
|
|
637
655
|
</TableCell>
|
|
638
656
|
</TableRow>
|
|
639
|
-
))}
|
|
640
|
-
</TableBody>
|
|
641
|
-
</Table>
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
657
|
+
))}
|
|
658
|
+
</TableBody>
|
|
659
|
+
</Table>
|
|
660
|
+
</div>
|
|
661
|
+
) : (
|
|
662
|
+
<div className="px-4 py-8 sm:px-6">
|
|
663
|
+
<EmptyState
|
|
664
|
+
icon={<FileText className="h-12 w-12" />}
|
|
665
|
+
title={t('empty.title')}
|
|
666
|
+
description={t('empty.description')}
|
|
667
|
+
actionLabel={t('empty.action')}
|
|
668
|
+
onAction={() => {
|
|
669
|
+
void refetch();
|
|
670
|
+
}}
|
|
671
|
+
/>
|
|
672
|
+
</div>
|
|
673
|
+
)}
|
|
674
|
+
</FinancePageSection>
|
|
675
|
+
</Page>
|
|
676
|
+
);
|
|
677
|
+
}
|