@hed-hog/finance 0.0.350 → 0.0.351
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 +6 -0
- package/dist/dto/create-financial-title.dto.d.ts.map +1 -1
- package/dist/dto/create-financial-title.dto.js +27 -1
- package/dist/dto/create-financial-title.dto.js.map +1 -1
- package/dist/finance-data.controller.d.ts +12 -0
- package/dist/finance-data.controller.d.ts.map +1 -1
- package/dist/finance-installments.controller.d.ts +120 -0
- package/dist/finance-installments.controller.d.ts.map +1 -1
- package/dist/finance-realtime.controller.d.ts +7 -0
- package/dist/finance-realtime.controller.d.ts.map +1 -0
- package/dist/finance-realtime.controller.js +34 -0
- package/dist/finance-realtime.controller.js.map +1 -0
- package/dist/finance-realtime.service.d.ts +36 -0
- package/dist/finance-realtime.service.d.ts.map +1 -0
- package/dist/finance-realtime.service.js +59 -0
- package/dist/finance-realtime.service.js.map +1 -0
- package/dist/finance-statements.controller.d.ts +6 -0
- package/dist/finance-statements.controller.d.ts.map +1 -1
- package/dist/finance.module.d.ts.map +1 -1
- package/dist/finance.module.js +28 -0
- package/dist/finance.module.js.map +1 -1
- package/dist/finance.service.d.ts +142 -1
- package/dist/finance.service.d.ts.map +1 -1
- package/dist/finance.service.js +134 -19
- package/dist/finance.service.js.map +1 -1
- package/dist/mcp-tools/finance-audit-logs.mcp-tools.d.ts +8 -0
- package/dist/mcp-tools/finance-audit-logs.mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools/finance-audit-logs.mcp-tools.js +60 -0
- package/dist/mcp-tools/finance-audit-logs.mcp-tools.js.map +1 -0
- package/dist/mcp-tools/finance-bank-accounts.mcp-tools.d.ts +16 -0
- package/dist/mcp-tools/finance-bank-accounts.mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools/finance-bank-accounts.mcp-tools.js +121 -0
- package/dist/mcp-tools/finance-bank-accounts.mcp-tools.js.map +1 -0
- package/dist/mcp-tools/finance-categories.mcp-tools.d.ts +20 -0
- package/dist/mcp-tools/finance-categories.mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools/finance-categories.mcp-tools.js +135 -0
- package/dist/mcp-tools/finance-categories.mcp-tools.js.map +1 -0
- package/dist/mcp-tools/finance-collections.mcp-tools.d.ts +16 -0
- package/dist/mcp-tools/finance-collections.mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools/finance-collections.mcp-tools.js +91 -0
- package/dist/mcp-tools/finance-collections.mcp-tools.js.map +1 -0
- package/dist/mcp-tools/finance-cost-centers.mcp-tools.d.ts +16 -0
- package/dist/mcp-tools/finance-cost-centers.mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools/finance-cost-centers.mcp-tools.js +114 -0
- package/dist/mcp-tools/finance-cost-centers.mcp-tools.js.map +1 -0
- package/dist/mcp-tools/finance-currencies.mcp-tools.d.ts +16 -0
- package/dist/mcp-tools/finance-currencies.mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools/finance-currencies.mcp-tools.js +120 -0
- package/dist/mcp-tools/finance-currencies.mcp-tools.js.map +1 -0
- package/dist/mcp-tools/finance-data.mcp-tools.d.ts +15 -0
- package/dist/mcp-tools/finance-data.mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools/finance-data.mcp-tools.js +80 -0
- package/dist/mcp-tools/finance-data.mcp-tools.js.map +1 -0
- package/dist/mcp-tools/finance-installments.mcp-tools.d.ts +93 -0
- package/dist/mcp-tools/finance-installments.mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools/finance-installments.mcp-tools.js +646 -0
- package/dist/mcp-tools/finance-installments.mcp-tools.js.map +1 -0
- package/dist/mcp-tools/finance-period-close.mcp-tools.d.ts +9 -0
- package/dist/mcp-tools/finance-period-close.mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools/finance-period-close.mcp-tools.js +79 -0
- package/dist/mcp-tools/finance-period-close.mcp-tools.js.map +1 -0
- package/dist/mcp-tools/finance-reports.mcp-tools.d.ts +10 -0
- package/dist/mcp-tools/finance-reports.mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools/finance-reports.mcp-tools.js +89 -0
- package/dist/mcp-tools/finance-reports.mcp-tools.js.map +1 -0
- package/dist/mcp-tools/finance-statements.mcp-tools.d.ts +34 -0
- package/dist/mcp-tools/finance-statements.mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools/finance-statements.mcp-tools.js +253 -0
- package/dist/mcp-tools/finance-statements.mcp-tools.js.map +1 -0
- package/dist/mcp-tools/finance-transfers.mcp-tools.d.ts +9 -0
- package/dist/mcp-tools/finance-transfers.mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools/finance-transfers.mcp-tools.js +79 -0
- package/dist/mcp-tools/finance-transfers.mcp-tools.js.map +1 -0
- package/hedhog/data/route.yaml +659 -1
- package/hedhog/frontend/app/_components/finance-title-actions-menu.tsx.ejs +9 -3
- package/hedhog/frontend/app/_lib/http-error.ts.ejs +105 -0
- package/hedhog/frontend/app/_lib/use-finance-realtime-refresh.ts.ejs +62 -0
- package/hedhog/frontend/app/accounts-payable/approvals/page.tsx.ejs +3 -0
- package/hedhog/frontend/app/accounts-payable/installments/[id]/page.tsx.ejs +5 -5
- package/hedhog/frontend/app/accounts-payable/installments/page.tsx.ejs +776 -344
- package/hedhog/frontend/app/accounts-receivable/collections-default/page.tsx.ejs +7 -13
- package/hedhog/frontend/app/accounts-receivable/installments/[id]/page.tsx.ejs +5 -5
- package/hedhog/frontend/app/accounts-receivable/installments/page.tsx.ejs +802 -355
- package/hedhog/frontend/app/administration/categories/page.tsx.ejs +9 -3
- package/hedhog/frontend/app/administration/cost-centers/page.tsx.ejs +9 -3
- package/hedhog/frontend/app/administration/currencies/page.tsx.ejs +9 -3
- package/hedhog/frontend/app/administration/period-close/page.tsx.ejs +9 -3
- package/hedhog/frontend/app/cash-and-banks/bank-accounts/page.tsx.ejs +7 -3
- package/hedhog/frontend/app/cash-and-banks/bank-reconciliation/page.tsx.ejs +3 -3
- package/hedhog/frontend/app/cash-and-banks/statements/page.tsx.ejs +28 -7
- package/hedhog/frontend/app/cash-and-banks/transfers/page.tsx.ejs +12 -3
- package/hedhog/frontend/messages/en.json +63 -3
- package/hedhog/frontend/messages/pt.json +63 -3
- package/hedhog/table/financial_title.yaml +10 -0
- package/package.json +5 -5
- package/src/dto/create-financial-title.dto.ts +23 -0
- package/src/finance-realtime.controller.ts +12 -0
- package/src/finance-realtime.service.ts +106 -0
- package/src/finance.module.ts +28 -0
- package/src/finance.service.ts +184 -45
- package/src/mcp-tools/finance-audit-logs.mcp-tools.ts +38 -0
- package/src/mcp-tools/finance-bank-accounts.mcp-tools.ts +76 -0
- package/src/mcp-tools/finance-categories.mcp-tools.ts +86 -0
- package/src/mcp-tools/finance-collections.mcp-tools.ts +50 -0
- package/src/mcp-tools/finance-cost-centers.mcp-tools.ts +69 -0
- package/src/mcp-tools/finance-currencies.mcp-tools.ts +75 -0
- package/src/mcp-tools/finance-data.mcp-tools.ts +43 -0
- package/src/mcp-tools/finance-installments.mcp-tools.ts +560 -0
- package/src/mcp-tools/finance-period-close.mcp-tools.ts +53 -0
- package/src/mcp-tools/finance-reports.mcp-tools.ts +59 -0
- package/src/mcp-tools/finance-statements.mcp-tools.ts +202 -0
- package/src/mcp-tools/finance-transfers.mcp-tools.ts +53 -0
|
@@ -31,11 +31,11 @@ import {
|
|
|
31
31
|
} from '@/components/ui/select';
|
|
32
32
|
import {
|
|
33
33
|
Sheet,
|
|
34
|
-
SheetContent,
|
|
35
34
|
SheetDescription,
|
|
36
35
|
SheetHeader,
|
|
37
36
|
SheetTitle,
|
|
38
37
|
} from '@/components/ui/sheet';
|
|
38
|
+
import { ResizableSheetContent } from '@/components/ui/resizable-sheet-content';
|
|
39
39
|
import { useFormDraft } from '@/hooks/use-form-draft';
|
|
40
40
|
import { formatDateTime } from '@/lib/format-date';
|
|
41
41
|
import {
|
|
@@ -298,7 +298,13 @@ function CategoriaSheet({
|
|
|
298
298
|
|
|
299
299
|
return (
|
|
300
300
|
<Sheet open={open} onOpenChange={handleOpenChange}>
|
|
301
|
-
<
|
|
301
|
+
<ResizableSheetContent
|
|
302
|
+
sheetId="finance-categories-sheet"
|
|
303
|
+
defaultWidth={560}
|
|
304
|
+
minWidth={420}
|
|
305
|
+
maxWidth={920}
|
|
306
|
+
className="w-full overflow-y-auto sm:max-w-lg"
|
|
307
|
+
>
|
|
302
308
|
<SheetHeader>
|
|
303
309
|
<SheetTitle>
|
|
304
310
|
{editing ? t('sheet.editTitle') : t('sheet.newTitle')}
|
|
@@ -416,7 +422,7 @@ function CategoriaSheet({
|
|
|
416
422
|
</div>
|
|
417
423
|
</form>
|
|
418
424
|
</Form>
|
|
419
|
-
</
|
|
425
|
+
</ResizableSheetContent>
|
|
420
426
|
</Sheet>
|
|
421
427
|
);
|
|
422
428
|
}
|
|
@@ -24,11 +24,11 @@ import {
|
|
|
24
24
|
import { Input } from '@/components/ui/input';
|
|
25
25
|
import {
|
|
26
26
|
Sheet,
|
|
27
|
-
SheetContent,
|
|
28
27
|
SheetDescription,
|
|
29
28
|
SheetHeader,
|
|
30
29
|
SheetTitle,
|
|
31
30
|
} from '@/components/ui/sheet';
|
|
31
|
+
import { ResizableSheetContent } from '@/components/ui/resizable-sheet-content';
|
|
32
32
|
import { useFormDraft } from '@/hooks/use-form-draft';
|
|
33
33
|
import { formatDateTime } from '@/lib/format-date';
|
|
34
34
|
import { useApp, useQuery } from '@hed-hog/next-app-provider';
|
|
@@ -214,7 +214,13 @@ function CentroCustoSheet({
|
|
|
214
214
|
|
|
215
215
|
return (
|
|
216
216
|
<Sheet open={open} onOpenChange={handleOpenChange}>
|
|
217
|
-
<
|
|
217
|
+
<ResizableSheetContent
|
|
218
|
+
sheetId="finance-cost-centers-sheet"
|
|
219
|
+
defaultWidth={560}
|
|
220
|
+
minWidth={420}
|
|
221
|
+
maxWidth={920}
|
|
222
|
+
className="w-full overflow-y-auto sm:max-w-lg"
|
|
223
|
+
>
|
|
218
224
|
<SheetHeader>
|
|
219
225
|
<SheetTitle>
|
|
220
226
|
{editingCostCenter ? t('sheet.editTitle') : t('sheet.newTitle')}
|
|
@@ -268,7 +274,7 @@ function CentroCustoSheet({
|
|
|
268
274
|
</div>
|
|
269
275
|
</form>
|
|
270
276
|
</Form>
|
|
271
|
-
</
|
|
277
|
+
</ResizableSheetContent>
|
|
272
278
|
</Sheet>
|
|
273
279
|
);
|
|
274
280
|
}
|
|
@@ -24,11 +24,11 @@ import {
|
|
|
24
24
|
import { Input } from '@/components/ui/input';
|
|
25
25
|
import {
|
|
26
26
|
Sheet,
|
|
27
|
-
SheetContent,
|
|
28
27
|
SheetDescription,
|
|
29
28
|
SheetHeader,
|
|
30
29
|
SheetTitle,
|
|
31
30
|
} from '@/components/ui/sheet';
|
|
31
|
+
import { ResizableSheetContent } from '@/components/ui/resizable-sheet-content';
|
|
32
32
|
import { useFormDraft } from '@/hooks/use-form-draft';
|
|
33
33
|
import { formatDateTime } from '@/lib/format-date';
|
|
34
34
|
import { useApp, useQuery } from '@hed-hog/next-app-provider';
|
|
@@ -223,7 +223,13 @@ function CurrencySheet({
|
|
|
223
223
|
|
|
224
224
|
return (
|
|
225
225
|
<Sheet open={open} onOpenChange={handleOpenChange}>
|
|
226
|
-
<
|
|
226
|
+
<ResizableSheetContent
|
|
227
|
+
sheetId="finance-currencies-sheet"
|
|
228
|
+
defaultWidth={560}
|
|
229
|
+
minWidth={420}
|
|
230
|
+
maxWidth={920}
|
|
231
|
+
className="w-full overflow-y-auto sm:max-w-lg"
|
|
232
|
+
>
|
|
227
233
|
<SheetHeader>
|
|
228
234
|
<SheetTitle>
|
|
229
235
|
{editingCurrency ? t('sheet.editTitle') : t('sheet.newTitle')}
|
|
@@ -315,7 +321,7 @@ function CurrencySheet({
|
|
|
315
321
|
</div>
|
|
316
322
|
</form>
|
|
317
323
|
</Form>
|
|
318
|
-
</
|
|
324
|
+
</ResizableSheetContent>
|
|
319
325
|
</Sheet>
|
|
320
326
|
);
|
|
321
327
|
}
|
|
@@ -21,11 +21,11 @@ import {
|
|
|
21
21
|
} from '@/components/ui/select';
|
|
22
22
|
import {
|
|
23
23
|
Sheet,
|
|
24
|
-
SheetContent,
|
|
25
24
|
SheetDescription,
|
|
26
25
|
SheetHeader,
|
|
27
26
|
SheetTitle,
|
|
28
27
|
} from '@/components/ui/sheet';
|
|
28
|
+
import { ResizableSheetContent } from '@/components/ui/resizable-sheet-content';
|
|
29
29
|
import {
|
|
30
30
|
Table,
|
|
31
31
|
TableBody,
|
|
@@ -211,7 +211,13 @@ function ClosePeriodSheet({
|
|
|
211
211
|
onOpenChange(nextOpen);
|
|
212
212
|
}}
|
|
213
213
|
>
|
|
214
|
-
<
|
|
214
|
+
<ResizableSheetContent
|
|
215
|
+
sheetId="finance-period-close-sheet"
|
|
216
|
+
defaultWidth={560}
|
|
217
|
+
minWidth={420}
|
|
218
|
+
maxWidth={920}
|
|
219
|
+
className="w-full overflow-y-auto sm:max-w-lg"
|
|
220
|
+
>
|
|
215
221
|
<SheetHeader>
|
|
216
222
|
<SheetTitle>{t('sheet.title')}</SheetTitle>
|
|
217
223
|
<SheetDescription>{t('sheet.description')}</SheetDescription>
|
|
@@ -314,7 +320,7 @@ function ClosePeriodSheet({
|
|
|
314
320
|
</div>
|
|
315
321
|
</form>
|
|
316
322
|
</Form>
|
|
317
|
-
</
|
|
323
|
+
</ResizableSheetContent>
|
|
318
324
|
</Sheet>
|
|
319
325
|
);
|
|
320
326
|
}
|
|
@@ -46,11 +46,11 @@ import {
|
|
|
46
46
|
} from '@/components/ui/select';
|
|
47
47
|
import {
|
|
48
48
|
Sheet,
|
|
49
|
-
SheetContent,
|
|
50
49
|
SheetDescription,
|
|
51
50
|
SheetHeader,
|
|
52
51
|
SheetTitle,
|
|
53
52
|
} from '@/components/ui/sheet';
|
|
53
|
+
import { ResizableSheetContent } from '@/components/ui/resizable-sheet-content';
|
|
54
54
|
import { useFormDraft } from '@/hooks/use-form-draft';
|
|
55
55
|
import { formatDateTime } from '@/lib/format-date';
|
|
56
56
|
import { useApp, useQuery } from '@hed-hog/next-app-provider';
|
|
@@ -81,6 +81,7 @@ import {
|
|
|
81
81
|
FinanceSheetBody,
|
|
82
82
|
FinanceSheetSection,
|
|
83
83
|
} from '../../_components/finance-layout';
|
|
84
|
+
import { useFinanceRealtimeRefresh } from '../../_lib/use-finance-realtime-refresh';
|
|
84
85
|
|
|
85
86
|
const createBankAccountFormSchema = (t: ReturnType<typeof useTranslations>) =>
|
|
86
87
|
z.object({
|
|
@@ -664,7 +665,7 @@ function NovaContaSheet({
|
|
|
664
665
|
}
|
|
665
666
|
}}
|
|
666
667
|
>
|
|
667
|
-
<
|
|
668
|
+
<ResizableSheetContent sheetId="finance-bank-account-form" defaultWidth={672} className="flex h-full w-full flex-col">
|
|
668
669
|
<SheetHeader>
|
|
669
670
|
<SheetTitle>
|
|
670
671
|
{editingAccount ? t('common.edit') : t('newAccount.title')}
|
|
@@ -981,7 +982,7 @@ function NovaContaSheet({
|
|
|
981
982
|
</div>
|
|
982
983
|
</form>
|
|
983
984
|
</Form>
|
|
984
|
-
</
|
|
985
|
+
</ResizableSheetContent>
|
|
985
986
|
</Sheet>
|
|
986
987
|
);
|
|
987
988
|
}
|
|
@@ -1030,6 +1031,9 @@ export default function ContasBancariasPage() {
|
|
|
1030
1031
|
},
|
|
1031
1032
|
placeholderData: (old) => old,
|
|
1032
1033
|
});
|
|
1034
|
+
|
|
1035
|
+
useFinanceRealtimeRefresh({ request, onRefresh: refetch });
|
|
1036
|
+
|
|
1033
1037
|
const accounts = contasBancarias?.data ?? [];
|
|
1034
1038
|
|
|
1035
1039
|
const tipoConfig = {
|
|
@@ -37,11 +37,11 @@ import {
|
|
|
37
37
|
} from '@/components/ui/select';
|
|
38
38
|
import {
|
|
39
39
|
Sheet,
|
|
40
|
-
SheetContent,
|
|
41
40
|
SheetDescription,
|
|
42
41
|
SheetHeader,
|
|
43
42
|
SheetTitle,
|
|
44
43
|
} from '@/components/ui/sheet';
|
|
44
|
+
import { ResizableSheetContent } from '@/components/ui/resizable-sheet-content';
|
|
45
45
|
import { StatusBadge } from '@/components/ui/status-badge';
|
|
46
46
|
import { useFormDraft } from '@/hooks/use-form-draft';
|
|
47
47
|
import { formatDateTime } from '@/lib/format-date';
|
|
@@ -256,7 +256,7 @@ function CriarAjusteSheet({
|
|
|
256
256
|
{t('adjustment.action')}
|
|
257
257
|
</Button>
|
|
258
258
|
|
|
259
|
-
<
|
|
259
|
+
<ResizableSheetContent sheetId="finance-bank-reconciliation-adjustment" defaultWidth={512} className="overflow-y-auto">
|
|
260
260
|
<SheetHeader>
|
|
261
261
|
<SheetTitle>{t('adjustment.title')}</SheetTitle>
|
|
262
262
|
<SheetDescription>{t('adjustment.description')}</SheetDescription>
|
|
@@ -358,7 +358,7 @@ function CriarAjusteSheet({
|
|
|
358
358
|
</div>
|
|
359
359
|
</form>
|
|
360
360
|
</Form>
|
|
361
|
-
</
|
|
361
|
+
</ResizableSheetContent>
|
|
362
362
|
</Sheet>
|
|
363
363
|
);
|
|
364
364
|
}
|
|
@@ -39,11 +39,11 @@ import {
|
|
|
39
39
|
} from '@/components/ui/select';
|
|
40
40
|
import {
|
|
41
41
|
Sheet,
|
|
42
|
-
SheetContent,
|
|
43
42
|
SheetDescription,
|
|
44
43
|
SheetHeader,
|
|
45
44
|
SheetTitle,
|
|
46
45
|
} from '@/components/ui/sheet';
|
|
46
|
+
import { ResizableSheetContent } from '@/components/ui/resizable-sheet-content';
|
|
47
47
|
import { StatusBadge } from '@/components/ui/status-badge';
|
|
48
48
|
import {
|
|
49
49
|
Table,
|
|
@@ -74,6 +74,7 @@ import { useEffect, useMemo, useState } from 'react';
|
|
|
74
74
|
import { useForm, useWatch } from 'react-hook-form';
|
|
75
75
|
import { z } from 'zod';
|
|
76
76
|
import { formatarData } from '../../_lib/formatters';
|
|
77
|
+
import { useFinanceRealtimeRefresh } from '../../_lib/use-finance-realtime-refresh';
|
|
77
78
|
|
|
78
79
|
type BankAccount = {
|
|
79
80
|
id: string;
|
|
@@ -333,7 +334,13 @@ function NovaContaBancariaSheet({
|
|
|
333
334
|
|
|
334
335
|
return (
|
|
335
336
|
<Sheet open={open} onOpenChange={onOpenChange}>
|
|
336
|
-
<
|
|
337
|
+
<ResizableSheetContent
|
|
338
|
+
sheetId="finance-statements-new-bank-account-sheet"
|
|
339
|
+
defaultWidth={560}
|
|
340
|
+
minWidth={420}
|
|
341
|
+
maxWidth={920}
|
|
342
|
+
className="w-full sm:max-w-lg overflow-y-auto"
|
|
343
|
+
>
|
|
337
344
|
<SheetHeader>
|
|
338
345
|
<SheetTitle>{tBank('newAccount.title')}</SheetTitle>
|
|
339
346
|
<SheetDescription>{tBank('newAccount.description')}</SheetDescription>
|
|
@@ -514,7 +521,7 @@ function NovaContaBancariaSheet({
|
|
|
514
521
|
</div>
|
|
515
522
|
</form>
|
|
516
523
|
</Form>
|
|
517
|
-
</
|
|
524
|
+
</ResizableSheetContent>
|
|
518
525
|
</Sheet>
|
|
519
526
|
);
|
|
520
527
|
}
|
|
@@ -648,7 +655,13 @@ function ImportarExtratoSheet({
|
|
|
648
655
|
{t('importDialog.action')}
|
|
649
656
|
</Button>
|
|
650
657
|
|
|
651
|
-
<
|
|
658
|
+
<ResizableSheetContent
|
|
659
|
+
sheetId="finance-statements-import-sheet"
|
|
660
|
+
defaultWidth={560}
|
|
661
|
+
minWidth={420}
|
|
662
|
+
maxWidth={920}
|
|
663
|
+
className="w-full sm:max-w-lg overflow-y-auto"
|
|
664
|
+
>
|
|
652
665
|
<SheetHeader>
|
|
653
666
|
<SheetTitle>{t('importDialog.title')}</SheetTitle>
|
|
654
667
|
<SheetDescription>{t('importDialog.description')}</SheetDescription>
|
|
@@ -761,7 +774,7 @@ function ImportarExtratoSheet({
|
|
|
761
774
|
</div>
|
|
762
775
|
</form>
|
|
763
776
|
</Form>
|
|
764
|
-
</
|
|
777
|
+
</ResizableSheetContent>
|
|
765
778
|
</Sheet>
|
|
766
779
|
);
|
|
767
780
|
}
|
|
@@ -836,7 +849,13 @@ function NovoLancamentoSheet({
|
|
|
836
849
|
|
|
837
850
|
return (
|
|
838
851
|
<Sheet open={open} onOpenChange={onOpenChange}>
|
|
839
|
-
<
|
|
852
|
+
<ResizableSheetContent
|
|
853
|
+
sheetId="finance-statements-new-entry-sheet"
|
|
854
|
+
defaultWidth={560}
|
|
855
|
+
minWidth={420}
|
|
856
|
+
maxWidth={920}
|
|
857
|
+
className="w-full sm:max-w-lg overflow-y-auto"
|
|
858
|
+
>
|
|
840
859
|
<SheetHeader>
|
|
841
860
|
<SheetTitle>{t('newEntry.title')}</SheetTitle>
|
|
842
861
|
<SheetDescription>{t('newEntry.description')}</SheetDescription>
|
|
@@ -938,7 +957,7 @@ function NovoLancamentoSheet({
|
|
|
938
957
|
</div>
|
|
939
958
|
</form>
|
|
940
959
|
</Form>
|
|
941
|
-
</
|
|
960
|
+
</ResizableSheetContent>
|
|
942
961
|
</Sheet>
|
|
943
962
|
);
|
|
944
963
|
}
|
|
@@ -1133,6 +1152,8 @@ export default function ExtratosPage() {
|
|
|
1133
1152
|
placeholderData: (old) => old,
|
|
1134
1153
|
});
|
|
1135
1154
|
|
|
1155
|
+
useFinanceRealtimeRefresh({ request, onRefresh: refetchExtratos });
|
|
1156
|
+
|
|
1136
1157
|
useEffect(() => {
|
|
1137
1158
|
setPage(1);
|
|
1138
1159
|
}, [activeContaFilter, debouncedSearch, fromDate, toDate]);
|
|
@@ -26,11 +26,11 @@ import {
|
|
|
26
26
|
} from '@/components/ui/select';
|
|
27
27
|
import {
|
|
28
28
|
Sheet,
|
|
29
|
-
SheetContent,
|
|
30
29
|
SheetDescription,
|
|
31
30
|
SheetHeader,
|
|
32
31
|
SheetTitle,
|
|
33
32
|
} from '@/components/ui/sheet';
|
|
33
|
+
import { ResizableSheetContent } from '@/components/ui/resizable-sheet-content';
|
|
34
34
|
import {
|
|
35
35
|
Table,
|
|
36
36
|
TableBody,
|
|
@@ -52,6 +52,7 @@ import { useEffect, useMemo, useState } from 'react';
|
|
|
52
52
|
import { useForm, useWatch } from 'react-hook-form';
|
|
53
53
|
import { z } from 'zod';
|
|
54
54
|
import { formatarData } from '../../_lib/formatters';
|
|
55
|
+
import { useFinanceRealtimeRefresh } from '../../_lib/use-finance-realtime-refresh';
|
|
55
56
|
|
|
56
57
|
type BankAccount = {
|
|
57
58
|
id: string;
|
|
@@ -245,7 +246,13 @@ function NovaTransferenciaSheet({
|
|
|
245
246
|
<Plus className="mr-2 h-4 w-4" />
|
|
246
247
|
{t('newTransfer.action')}
|
|
247
248
|
</Button>
|
|
248
|
-
<
|
|
249
|
+
<ResizableSheetContent
|
|
250
|
+
sheetId="finance-transfers-new-transfer-sheet"
|
|
251
|
+
defaultWidth={560}
|
|
252
|
+
minWidth={420}
|
|
253
|
+
maxWidth={920}
|
|
254
|
+
className="w-full sm:max-w-lg overflow-y-auto"
|
|
255
|
+
>
|
|
249
256
|
<SheetHeader>
|
|
250
257
|
<SheetTitle>{t('newTransfer.title')}</SheetTitle>
|
|
251
258
|
<SheetDescription>{t('newTransfer.description')}</SheetDescription>
|
|
@@ -382,7 +389,7 @@ function NovaTransferenciaSheet({
|
|
|
382
389
|
</div>
|
|
383
390
|
</form>
|
|
384
391
|
</Form>
|
|
385
|
-
</
|
|
392
|
+
</ResizableSheetContent>
|
|
386
393
|
</Sheet>
|
|
387
394
|
);
|
|
388
395
|
}
|
|
@@ -488,6 +495,8 @@ export default function TransferenciasPage() {
|
|
|
488
495
|
placeholderData: (old) => old,
|
|
489
496
|
});
|
|
490
497
|
|
|
498
|
+
useFinanceRealtimeRefresh({ request, onRefresh: refetchTransferencias });
|
|
499
|
+
|
|
491
500
|
useEffect(() => {
|
|
492
501
|
setPage(1);
|
|
493
502
|
}, [debouncedSearch, accountFilter, fromDate, toDate]);
|
|
@@ -199,6 +199,7 @@
|
|
|
199
199
|
"uploadingFile": "Uploading file..."
|
|
200
200
|
}
|
|
201
201
|
},
|
|
202
|
+
"draftStatus": "Draft saved {relativeLabel} • Last saved: {absoluteLabel}",
|
|
202
203
|
"validation": {
|
|
203
204
|
"documentRequired": "Document is required",
|
|
204
205
|
"supplierRequired": "Supplier is required",
|
|
@@ -212,7 +213,30 @@
|
|
|
212
213
|
"installmentsRequired": "Provide at least one installment",
|
|
213
214
|
"installmentsCountMismatch": "Installments count does not match detailed schedule",
|
|
214
215
|
"installmentsSumMismatch": "Installments sum must match total amount",
|
|
215
|
-
"installmentRequired": "Installment is required"
|
|
216
|
+
"installmentRequired": "Installment is required",
|
|
217
|
+
"recurrenceEndOrCount": "Provide an end date or number of repetitions"
|
|
218
|
+
},
|
|
219
|
+
"titleType": {
|
|
220
|
+
"label": "Entry type",
|
|
221
|
+
"installment": "Installments",
|
|
222
|
+
"recurring": "Recurring"
|
|
223
|
+
},
|
|
224
|
+
"recurrenceEditor": {
|
|
225
|
+
"title": "Recurrence",
|
|
226
|
+
"description": "Configure the title recurrence frequency",
|
|
227
|
+
"frequencyLabel": "Frequency",
|
|
228
|
+
"endDateLabel": "End date (optional)",
|
|
229
|
+
"maxOccurrencesLabel": "No. of repetitions",
|
|
230
|
+
"preview": "{count} occurrences of {amount} = total {total}",
|
|
231
|
+
"frequencies": {
|
|
232
|
+
"weekly": "Weekly",
|
|
233
|
+
"biweekly": "Bi-weekly",
|
|
234
|
+
"monthly": "Monthly",
|
|
235
|
+
"bimonthly": "Bi-monthly",
|
|
236
|
+
"quarterly": "Quarterly",
|
|
237
|
+
"semiannual": "Semi-annual",
|
|
238
|
+
"annual": "Annual"
|
|
239
|
+
}
|
|
216
240
|
},
|
|
217
241
|
"newTitle": {
|
|
218
242
|
"action": "New Title",
|
|
@@ -226,6 +250,7 @@
|
|
|
226
250
|
"competency": "Competency",
|
|
227
251
|
"dueDate": "Due Date",
|
|
228
252
|
"totalValue": "Total Value",
|
|
253
|
+
"totalValueRecurring": "Amount per Period",
|
|
229
254
|
"category": "Category",
|
|
230
255
|
"costCenter": "Cost Center",
|
|
231
256
|
"paymentMethod": "Payment Method",
|
|
@@ -290,6 +315,10 @@
|
|
|
290
315
|
"title": "Installments",
|
|
291
316
|
"description": "Review the due schedule and adjust installment amounts before saving."
|
|
292
317
|
},
|
|
318
|
+
"recurrence": {
|
|
319
|
+
"title": "Recurrence",
|
|
320
|
+
"description": "Configure the title repetition frequency."
|
|
321
|
+
},
|
|
293
322
|
"classification": {
|
|
294
323
|
"title": "Financial classification",
|
|
295
324
|
"description": "Assign category, cost center, and payment method to organize the operation."
|
|
@@ -649,6 +678,7 @@
|
|
|
649
678
|
"uploadingFile": "Uploading file..."
|
|
650
679
|
}
|
|
651
680
|
},
|
|
681
|
+
"draftStatus": "Draft saved {relativeLabel} • Last saved: {absoluteLabel}",
|
|
652
682
|
"validation": {
|
|
653
683
|
"documentRequired": "Document is required",
|
|
654
684
|
"clientRequired": "Client is required",
|
|
@@ -661,7 +691,30 @@
|
|
|
661
691
|
"installmentAmountGreaterThanZero": "Installment amount must be greater than zero",
|
|
662
692
|
"installmentsRequired": "Provide at least one installment",
|
|
663
693
|
"installmentsCountMismatch": "Installments count does not match detailed schedule",
|
|
664
|
-
"installmentsSumMismatch": "Installments sum must match total amount"
|
|
694
|
+
"installmentsSumMismatch": "Installments sum must match total amount",
|
|
695
|
+
"recurrenceEndOrCount": "Provide an end date or number of repetitions"
|
|
696
|
+
},
|
|
697
|
+
"titleType": {
|
|
698
|
+
"label": "Entry type",
|
|
699
|
+
"installment": "Installments",
|
|
700
|
+
"recurring": "Recurring"
|
|
701
|
+
},
|
|
702
|
+
"recurrenceEditor": {
|
|
703
|
+
"title": "Recurrence",
|
|
704
|
+
"description": "Configure the title recurrence frequency",
|
|
705
|
+
"frequencyLabel": "Frequency",
|
|
706
|
+
"endDateLabel": "End date (optional)",
|
|
707
|
+
"maxOccurrencesLabel": "No. of repetitions",
|
|
708
|
+
"preview": "{count} occurrences of {amount} = total {total}",
|
|
709
|
+
"frequencies": {
|
|
710
|
+
"weekly": "Weekly",
|
|
711
|
+
"biweekly": "Bi-weekly",
|
|
712
|
+
"monthly": "Monthly",
|
|
713
|
+
"bimonthly": "Bi-monthly",
|
|
714
|
+
"quarterly": "Quarterly",
|
|
715
|
+
"semiannual": "Semi-annual",
|
|
716
|
+
"annual": "Annual"
|
|
717
|
+
}
|
|
665
718
|
},
|
|
666
719
|
"newTitle": {
|
|
667
720
|
"action": "New Title",
|
|
@@ -675,6 +728,7 @@
|
|
|
675
728
|
"competency": "Competency",
|
|
676
729
|
"dueDate": "Due Date",
|
|
677
730
|
"totalValue": "Total Value",
|
|
731
|
+
"totalValueRecurring": "Amount per Period",
|
|
678
732
|
"category": "Category",
|
|
679
733
|
"costCenter": "Cost Center",
|
|
680
734
|
"channel": "Receiving Channel",
|
|
@@ -683,7 +737,9 @@
|
|
|
683
737
|
"channels": {
|
|
684
738
|
"boleto": "Bank Slip",
|
|
685
739
|
"card": "Card",
|
|
686
|
-
"transfer": "Transfer"
|
|
740
|
+
"transfer": "Transfer",
|
|
741
|
+
"debitAutomatico": "Automatic debit",
|
|
742
|
+
"debitEmConta": "Account debit"
|
|
687
743
|
},
|
|
688
744
|
"header": {
|
|
689
745
|
"title": "Receivable Titles",
|
|
@@ -735,6 +791,10 @@
|
|
|
735
791
|
"title": "Installments",
|
|
736
792
|
"description": "Review the due schedule and adjust installment amounts before saving."
|
|
737
793
|
},
|
|
794
|
+
"recurrence": {
|
|
795
|
+
"title": "Recurrence",
|
|
796
|
+
"description": "Configure the title repetition frequency."
|
|
797
|
+
},
|
|
738
798
|
"classification": {
|
|
739
799
|
"title": "Financial classification",
|
|
740
800
|
"description": "Assign category, cost center, and receiving channel to organize the operation."
|
|
@@ -184,6 +184,7 @@
|
|
|
184
184
|
"uploadingFile": "Enviando arquivo..."
|
|
185
185
|
}
|
|
186
186
|
},
|
|
187
|
+
"draftStatus": "Rascunho salvo {relativeLabel} • Último salvamento: {absoluteLabel}",
|
|
187
188
|
"validation": {
|
|
188
189
|
"documentRequired": "Documento é obrigatório",
|
|
189
190
|
"supplierRequired": "Fornecedor é obrigatório",
|
|
@@ -197,7 +198,30 @@
|
|
|
197
198
|
"installmentsRequired": "Informe ao menos uma parcela",
|
|
198
199
|
"installmentsCountMismatch": "Quantidade de parcelas não confere com o detalhamento",
|
|
199
200
|
"installmentsSumMismatch": "A soma das parcelas deve ser igual ao valor total",
|
|
200
|
-
"installmentRequired": "Parcela obrigatória"
|
|
201
|
+
"installmentRequired": "Parcela obrigatória",
|
|
202
|
+
"recurrenceEndOrCount": "Informe a data de término ou o número de repetições"
|
|
203
|
+
},
|
|
204
|
+
"titleType": {
|
|
205
|
+
"label": "Tipo de lançamento",
|
|
206
|
+
"installment": "Parcelado",
|
|
207
|
+
"recurring": "Recorrente"
|
|
208
|
+
},
|
|
209
|
+
"recurrenceEditor": {
|
|
210
|
+
"title": "Recorrência",
|
|
211
|
+
"description": "Configure a periodicidade do título",
|
|
212
|
+
"frequencyLabel": "Frequência",
|
|
213
|
+
"endDateLabel": "Termina em (opcional)",
|
|
214
|
+
"maxOccurrencesLabel": "Nº de repetições",
|
|
215
|
+
"preview": "Serão geradas {count} ocorrências de {amount} = total {total}",
|
|
216
|
+
"frequencies": {
|
|
217
|
+
"weekly": "Semanal",
|
|
218
|
+
"biweekly": "Quinzenal",
|
|
219
|
+
"monthly": "Mensal",
|
|
220
|
+
"bimonthly": "Bimestral",
|
|
221
|
+
"quarterly": "Trimestral",
|
|
222
|
+
"semiannual": "Semestral",
|
|
223
|
+
"annual": "Anual"
|
|
224
|
+
}
|
|
201
225
|
},
|
|
202
226
|
"newTitle": {
|
|
203
227
|
"action": "Novo Título",
|
|
@@ -211,6 +235,7 @@
|
|
|
211
235
|
"competency": "Competência",
|
|
212
236
|
"dueDate": "Vencimento",
|
|
213
237
|
"totalValue": "Valor Total",
|
|
238
|
+
"totalValueRecurring": "Valor por Período",
|
|
214
239
|
"category": "Categoria",
|
|
215
240
|
"costCenter": "Centro de Custo",
|
|
216
241
|
"paymentMethod": "Forma de Pagamento",
|
|
@@ -275,6 +300,10 @@
|
|
|
275
300
|
"title": "Parcelas",
|
|
276
301
|
"description": "Revise o cronograma de vencimentos e ajuste os valores antes de salvar."
|
|
277
302
|
},
|
|
303
|
+
"recurrence": {
|
|
304
|
+
"title": "Recorrência",
|
|
305
|
+
"description": "Configure a frequência de repetição do título."
|
|
306
|
+
},
|
|
278
307
|
"classification": {
|
|
279
308
|
"title": "Classificação financeira",
|
|
280
309
|
"description": "Associe categoria, centro de custo e forma de pagamento para organizar a operação."
|
|
@@ -634,6 +663,7 @@
|
|
|
634
663
|
"uploadingFile": "Enviando arquivo..."
|
|
635
664
|
}
|
|
636
665
|
},
|
|
666
|
+
"draftStatus": "Rascunho salvo {relativeLabel} • Último salvamento: {absoluteLabel}",
|
|
637
667
|
"validation": {
|
|
638
668
|
"documentRequired": "Documento é obrigatório",
|
|
639
669
|
"clientRequired": "Cliente é obrigatório",
|
|
@@ -646,7 +676,30 @@
|
|
|
646
676
|
"installmentAmountGreaterThanZero": "Valor da parcela deve ser maior que zero",
|
|
647
677
|
"installmentsRequired": "Informe ao menos uma parcela",
|
|
648
678
|
"installmentsCountMismatch": "Quantidade de parcelas não confere com o detalhamento",
|
|
649
|
-
"installmentsSumMismatch": "A soma das parcelas deve ser igual ao valor total"
|
|
679
|
+
"installmentsSumMismatch": "A soma das parcelas deve ser igual ao valor total",
|
|
680
|
+
"recurrenceEndOrCount": "Informe a data de término ou o número de repetições"
|
|
681
|
+
},
|
|
682
|
+
"titleType": {
|
|
683
|
+
"label": "Tipo de lançamento",
|
|
684
|
+
"installment": "Parcelado",
|
|
685
|
+
"recurring": "Recorrente"
|
|
686
|
+
},
|
|
687
|
+
"recurrenceEditor": {
|
|
688
|
+
"title": "Recorrência",
|
|
689
|
+
"description": "Configure a periodicidade do título",
|
|
690
|
+
"frequencyLabel": "Frequência",
|
|
691
|
+
"endDateLabel": "Termina em (opcional)",
|
|
692
|
+
"maxOccurrencesLabel": "Nº de repetições",
|
|
693
|
+
"preview": "Serão geradas {count} ocorrências de {amount} = total {total}",
|
|
694
|
+
"frequencies": {
|
|
695
|
+
"weekly": "Semanal",
|
|
696
|
+
"biweekly": "Quinzenal",
|
|
697
|
+
"monthly": "Mensal",
|
|
698
|
+
"bimonthly": "Bimestral",
|
|
699
|
+
"quarterly": "Trimestral",
|
|
700
|
+
"semiannual": "Semestral",
|
|
701
|
+
"annual": "Anual"
|
|
702
|
+
}
|
|
650
703
|
},
|
|
651
704
|
"newTitle": {
|
|
652
705
|
"action": "Novo Título",
|
|
@@ -660,6 +713,7 @@
|
|
|
660
713
|
"competency": "Competência",
|
|
661
714
|
"dueDate": "Vencimento",
|
|
662
715
|
"totalValue": "Valor Total",
|
|
716
|
+
"totalValueRecurring": "Valor por Período",
|
|
663
717
|
"category": "Categoria",
|
|
664
718
|
"costCenter": "Centro de Custo",
|
|
665
719
|
"channel": "Canal de Recebimento",
|
|
@@ -668,7 +722,9 @@
|
|
|
668
722
|
"channels": {
|
|
669
723
|
"boleto": "Boleto",
|
|
670
724
|
"card": "Cartão",
|
|
671
|
-
"transfer": "Transferência"
|
|
725
|
+
"transfer": "Transferência",
|
|
726
|
+
"debitAutomatico": "Débito automático",
|
|
727
|
+
"debitEmConta": "Débito em conta"
|
|
672
728
|
},
|
|
673
729
|
"header": {
|
|
674
730
|
"title": "Títulos a Receber",
|
|
@@ -720,6 +776,10 @@
|
|
|
720
776
|
"title": "Parcelas",
|
|
721
777
|
"description": "Revise o cronograma de vencimentos e ajuste os valores antes de salvar."
|
|
722
778
|
},
|
|
779
|
+
"recurrence": {
|
|
780
|
+
"title": "Recorrência",
|
|
781
|
+
"description": "Configure a frequência de repetição do título."
|
|
782
|
+
},
|
|
723
783
|
"classification": {
|
|
724
784
|
"title": "Classificação financeira",
|
|
725
785
|
"description": "Associe categoria, centro de custo e canal de recebimento para organizar a operação."
|
|
@@ -28,6 +28,16 @@ columns:
|
|
|
28
28
|
isNullable: true
|
|
29
29
|
- name: total_amount_cents
|
|
30
30
|
type: bigint
|
|
31
|
+
- name: is_recurring
|
|
32
|
+
type: boolean
|
|
33
|
+
default: false
|
|
34
|
+
- name: recurrence_frequency
|
|
35
|
+
type: varchar
|
|
36
|
+
length: 20
|
|
37
|
+
isNullable: true
|
|
38
|
+
- name: recurrence_end_date
|
|
39
|
+
type: date
|
|
40
|
+
isNullable: true
|
|
31
41
|
- name: finance_category_id
|
|
32
42
|
type: fk
|
|
33
43
|
isNullable: true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hed-hog/finance",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.351",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
"@nestjs/jwt": "^11",
|
|
11
11
|
"@nestjs/mapped-types": "*",
|
|
12
12
|
"@hed-hog/api": "0.0.8",
|
|
13
|
-
"@hed-hog/api-prisma": "0.0.6",
|
|
14
13
|
"@hed-hog/api-pagination": "0.0.7",
|
|
15
14
|
"@hed-hog/api-locale": "0.0.14",
|
|
15
|
+
"@hed-hog/api-prisma": "0.0.6",
|
|
16
16
|
"@hed-hog/api-types": "0.0.1",
|
|
17
|
-
"@hed-hog/
|
|
18
|
-
"@hed-hog/
|
|
19
|
-
"@hed-hog/tag": "0.0.
|
|
17
|
+
"@hed-hog/crm": "0.0.351",
|
|
18
|
+
"@hed-hog/core": "0.0.351",
|
|
19
|
+
"@hed-hog/tag": "0.0.351"
|
|
20
20
|
},
|
|
21
21
|
"exports": {
|
|
22
22
|
".": {
|