@hed-hog/finance 0.0.329 → 0.0.330
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/hedhog/frontend/app/accounts-payable/approvals/page.tsx.ejs +18 -15
- package/hedhog/frontend/app/accounts-payable/installments/page.tsx.ejs +6 -14
- package/hedhog/frontend/app/accounts-receivable/collections-default/page.tsx.ejs +4 -8
- package/hedhog/frontend/app/accounts-receivable/installments/page.tsx.ejs +6 -14
- package/hedhog/frontend/app/administration/audit-logs/page.tsx.ejs +10 -4
- package/hedhog/frontend/app/administration/categories/page.tsx.ejs +3 -5
- package/hedhog/frontend/app/administration/cost-centers/page.tsx.ejs +3 -5
- package/hedhog/frontend/app/administration/currencies/page.tsx.ejs +3 -5
- package/hedhog/frontend/app/administration/period-close/page.tsx.ejs +3 -5
- package/hedhog/frontend/app/cash-and-banks/bank-accounts/page.tsx.ejs +48 -72
- package/hedhog/frontend/app/cash-and-banks/bank-reconciliation/page.tsx.ejs +7 -9
- package/hedhog/frontend/app/cash-and-banks/statements/page.tsx.ejs +91 -73
- package/hedhog/frontend/app/cash-and-banks/transfers/page.tsx.ejs +33 -25
- package/hedhog/frontend/app/planning/scenarios/page.tsx.ejs +2 -2
- package/hedhog/frontend/app/reports/actual-vs-forecast/page.tsx.ejs +3 -1
- package/hedhog/frontend/app/reports/aging-default/page.tsx.ejs +3 -1
- package/hedhog/frontend/app/reports/cash-position/page.tsx.ejs +3 -1
- package/hedhog/frontend/app/reports/overview-results/page.tsx.ejs +15 -8
- package/hedhog/frontend/app/reports/top-customers/page.tsx.ejs +9 -5
- package/hedhog/frontend/app/reports/top-operational-expenses/page.tsx.ejs +9 -5
- package/hedhog/frontend/messages/en.json +110 -2
- package/hedhog/frontend/messages/pt.json +92 -2
- package/package.json +6 -6
|
@@ -131,10 +131,9 @@ export default function AprovacoesPage() {
|
|
|
131
131
|
const { request, showToastHandler } = useApp();
|
|
132
132
|
const [page, setPage] = useState(1);
|
|
133
133
|
const pageSize = 10;
|
|
134
|
-
const {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
} = useQuery<PaginatedResponse<ApprovalTitle>>({
|
|
134
|
+
const { data: approvalsResponse, refetch } = useQuery<
|
|
135
|
+
PaginatedResponse<ApprovalTitle>
|
|
136
|
+
>({
|
|
138
137
|
queryKey: ['finance-payable-approvals', page, pageSize],
|
|
139
138
|
queryFn: async () => {
|
|
140
139
|
const response = await request({
|
|
@@ -165,7 +164,7 @@ export default function AprovacoesPage() {
|
|
|
165
164
|
|
|
166
165
|
const handleAprovacao = async (_id: string, tituloId?: string) => {
|
|
167
166
|
if (!tituloId) {
|
|
168
|
-
showToastHandler?.('error', '
|
|
167
|
+
showToastHandler?.('error', t('messages.invalidTitleForApproval'));
|
|
169
168
|
return;
|
|
170
169
|
}
|
|
171
170
|
|
|
@@ -176,9 +175,9 @@ export default function AprovacoesPage() {
|
|
|
176
175
|
});
|
|
177
176
|
|
|
178
177
|
await refetch();
|
|
179
|
-
showToastHandler?.('success', '
|
|
178
|
+
showToastHandler?.('success', t('messages.approveSuccess'));
|
|
180
179
|
} catch {
|
|
181
|
-
showToastHandler?.('error', '
|
|
180
|
+
showToastHandler?.('error', t('messages.approveError'));
|
|
182
181
|
}
|
|
183
182
|
};
|
|
184
183
|
|
|
@@ -188,7 +187,7 @@ export default function AprovacoesPage() {
|
|
|
188
187
|
reason?: string
|
|
189
188
|
) => {
|
|
190
189
|
if (!tituloId) {
|
|
191
|
-
showToastHandler?.('error', '
|
|
190
|
+
showToastHandler?.('error', t('messages.invalidTitleForRejection'));
|
|
192
191
|
return;
|
|
193
192
|
}
|
|
194
193
|
|
|
@@ -202,9 +201,9 @@ export default function AprovacoesPage() {
|
|
|
202
201
|
});
|
|
203
202
|
|
|
204
203
|
await refetch();
|
|
205
|
-
showToastHandler?.('success', '
|
|
204
|
+
showToastHandler?.('success', t('messages.rejectSuccess'));
|
|
206
205
|
} catch {
|
|
207
|
-
showToastHandler?.('error', '
|
|
206
|
+
showToastHandler?.('error', t('messages.rejectError'));
|
|
208
207
|
}
|
|
209
208
|
};
|
|
210
209
|
|
|
@@ -316,21 +315,25 @@ export default function AprovacoesPage() {
|
|
|
316
315
|
{urgencia.label}
|
|
317
316
|
</Badge>
|
|
318
317
|
</TableCell>
|
|
319
|
-
<TableCell>
|
|
320
|
-
{formatarData(aprovacao.criadoEm)}
|
|
321
|
-
</TableCell>
|
|
318
|
+
<TableCell>{formatarData(aprovacao.criadoEm)}</TableCell>
|
|
322
319
|
<TableCell>
|
|
323
320
|
<div className="flex justify-end gap-2">
|
|
324
321
|
<AprovacaoDialog
|
|
325
322
|
tipo="aprovar"
|
|
326
323
|
t={t}
|
|
327
|
-
onConfirm={() =>
|
|
324
|
+
onConfirm={() =>
|
|
325
|
+
void handleAprovacao(aprovacao.id, aprovacao.id)
|
|
326
|
+
}
|
|
328
327
|
/>
|
|
329
328
|
<AprovacaoDialog
|
|
330
329
|
tipo="reprovar"
|
|
331
330
|
t={t}
|
|
332
331
|
onConfirm={(comment) =>
|
|
333
|
-
void handleReprovacao(
|
|
332
|
+
void handleReprovacao(
|
|
333
|
+
aprovacao.id,
|
|
334
|
+
aprovacao.id,
|
|
335
|
+
comment
|
|
336
|
+
)
|
|
334
337
|
}
|
|
335
338
|
/>
|
|
336
339
|
</div>
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { PersonPickerField } from '@/app/(app)/(libraries)/contact/_components/person-picker';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
} from '@/app/(app)/(libraries)/finance/_components/category-picker-field';
|
|
7
|
-
import {
|
|
8
|
-
CostCenterPickerField,
|
|
9
|
-
} from '@/app/(app)/(libraries)/finance/_components/cost-center-picker-field';
|
|
4
|
+
import { CategoryPickerField } from '@/app/(app)/(libraries)/finance/_components/category-picker-field';
|
|
5
|
+
import { CostCenterPickerField } from '@/app/(app)/(libraries)/finance/_components/cost-center-picker-field';
|
|
10
6
|
import {
|
|
11
7
|
FinancePageSection,
|
|
12
8
|
FinanceSheetBody,
|
|
@@ -446,10 +442,8 @@ function NovoTituloSheet({
|
|
|
446
442
|
currentLocaleCode
|
|
447
443
|
);
|
|
448
444
|
|
|
449
|
-
return
|
|
450
|
-
|
|
451
|
-
: `Draft saved ${relativeLabel} • Last saved: ${absoluteLabel}`;
|
|
452
|
-
}, [draftSavedAt, currentLocaleCode, getSettingValue, hasDraft]);
|
|
445
|
+
return t('draftStatus', { relativeLabel, absoluteLabel });
|
|
446
|
+
}, [draftSavedAt, currentLocaleCode, getSettingValue, hasDraft, t]);
|
|
453
447
|
|
|
454
448
|
const watchedInstallmentsCount = form.watch('installmentsCount');
|
|
455
449
|
const watchedTotalValue = form.watch('valor');
|
|
@@ -1505,10 +1499,8 @@ function EditarTituloSheet({
|
|
|
1505
1499
|
currentLocaleCode
|
|
1506
1500
|
);
|
|
1507
1501
|
|
|
1508
|
-
return
|
|
1509
|
-
|
|
1510
|
-
: `Draft saved ${relativeLabel} • Last saved: ${absoluteLabel}`;
|
|
1511
|
-
}, [draftSavedAt, currentLocaleCode, getSettingValue, hasDraft]);
|
|
1502
|
+
return t('draftStatus', { relativeLabel, absoluteLabel });
|
|
1503
|
+
}, [draftSavedAt, currentLocaleCode, getSettingValue, hasDraft, t]);
|
|
1512
1504
|
|
|
1513
1505
|
const watchedInstallmentsCount = form.watch('installmentsCount');
|
|
1514
1506
|
const watchedTotalValue = form.watch('valor');
|
|
@@ -232,10 +232,8 @@ function EnviarCobrancaDialog({
|
|
|
232
232
|
currentLocaleCode
|
|
233
233
|
);
|
|
234
234
|
|
|
235
|
-
return
|
|
236
|
-
|
|
237
|
-
: `Draft saved ${relativeLabel} • Last saved: ${absoluteLabel}`;
|
|
238
|
-
}, [draftSavedAt, currentLocaleCode, getSettingValue, hasDraft]);
|
|
235
|
+
return t('draftStatus', { relativeLabel, absoluteLabel });
|
|
236
|
+
}, [draftSavedAt, currentLocaleCode, getSettingValue, hasDraft, t]);
|
|
239
237
|
|
|
240
238
|
useEffect(() => {
|
|
241
239
|
if (!open) {
|
|
@@ -425,10 +423,8 @@ function RegistrarAcordoDialog({
|
|
|
425
423
|
currentLocaleCode
|
|
426
424
|
);
|
|
427
425
|
|
|
428
|
-
return
|
|
429
|
-
|
|
430
|
-
: `Draft saved ${relativeLabel} • Last saved: ${absoluteLabel}`;
|
|
431
|
-
}, [draftSavedAt, currentLocaleCode, getSettingValue, hasDraft]);
|
|
426
|
+
return t('draftStatus', { relativeLabel, absoluteLabel });
|
|
427
|
+
}, [draftSavedAt, currentLocaleCode, getSettingValue, hasDraft, t]);
|
|
432
428
|
|
|
433
429
|
useEffect(() => {
|
|
434
430
|
if (!open) {
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { PersonPickerField } from '@/app/(app)/(libraries)/contact/_components/person-picker';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
} from '@/app/(app)/(libraries)/finance/_components/category-picker-field';
|
|
7
|
-
import {
|
|
8
|
-
CostCenterPickerField,
|
|
9
|
-
} from '@/app/(app)/(libraries)/finance/_components/cost-center-picker-field';
|
|
4
|
+
import { CategoryPickerField } from '@/app/(app)/(libraries)/finance/_components/category-picker-field';
|
|
5
|
+
import { CostCenterPickerField } from '@/app/(app)/(libraries)/finance/_components/cost-center-picker-field';
|
|
10
6
|
import {
|
|
11
7
|
FinancePageSection,
|
|
12
8
|
FinanceSheetBody,
|
|
@@ -426,10 +422,8 @@ function NovoTituloSheet({
|
|
|
426
422
|
currentLocaleCode
|
|
427
423
|
);
|
|
428
424
|
|
|
429
|
-
return
|
|
430
|
-
|
|
431
|
-
: `Draft saved ${relativeLabel} • Last saved: ${absoluteLabel}`;
|
|
432
|
-
}, [draftSavedAt, currentLocaleCode, getSettingValue, hasDraft]);
|
|
425
|
+
return t('draftStatus', { relativeLabel, absoluteLabel });
|
|
426
|
+
}, [draftSavedAt, currentLocaleCode, getSettingValue, hasDraft, t]);
|
|
433
427
|
|
|
434
428
|
const watchedInstallmentsCount = form.watch('installmentsCount');
|
|
435
429
|
const watchedTotalValue = form.watch('valor');
|
|
@@ -1475,10 +1469,8 @@ function EditarTituloSheet({
|
|
|
1475
1469
|
currentLocaleCode
|
|
1476
1470
|
);
|
|
1477
1471
|
|
|
1478
|
-
return
|
|
1479
|
-
|
|
1480
|
-
: `Draft saved ${relativeLabel} • Last saved: ${absoluteLabel}`;
|
|
1481
|
-
}, [draftSavedAt, currentLocaleCode, getSettingValue, hasDraft]);
|
|
1472
|
+
return t('draftStatus', { relativeLabel, absoluteLabel });
|
|
1473
|
+
}, [draftSavedAt, currentLocaleCode, getSettingValue, hasDraft, t]);
|
|
1482
1474
|
|
|
1483
1475
|
const watchedInstallmentsCount = form.watch('installmentsCount');
|
|
1484
1476
|
const watchedTotalValue = form.watch('valor');
|
|
@@ -150,9 +150,15 @@ export default function AuditLogsPage() {
|
|
|
150
150
|
</SelectTrigger>
|
|
151
151
|
<SelectContent>
|
|
152
152
|
<SelectItem value="all">{t('filters.allActions')}</SelectItem>
|
|
153
|
-
<SelectItem value="create">
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
<SelectItem value="create">
|
|
154
|
+
{t('filters.actionOptions.create')}
|
|
155
|
+
</SelectItem>
|
|
156
|
+
<SelectItem value="update">
|
|
157
|
+
{t('filters.actionOptions.update')}
|
|
158
|
+
</SelectItem>
|
|
159
|
+
<SelectItem value="delete">
|
|
160
|
+
{t('filters.actionOptions.delete')}
|
|
161
|
+
</SelectItem>
|
|
156
162
|
</SelectContent>
|
|
157
163
|
</Select>
|
|
158
164
|
|
|
@@ -234,7 +240,7 @@ export default function AuditLogsPage() {
|
|
|
234
240
|
<TableHead>{t('table.headers.entity')}</TableHead>
|
|
235
241
|
<TableHead>{t('table.headers.record')}</TableHead>
|
|
236
242
|
<TableHead>{t('table.headers.summary')}</TableHead>
|
|
237
|
-
<TableHead>
|
|
243
|
+
<TableHead>{t('table.headers.ip')}</TableHead>
|
|
238
244
|
</TableRow>
|
|
239
245
|
</TableHeader>
|
|
240
246
|
<TableBody>
|
|
@@ -214,10 +214,8 @@ function CategoriaSheet({
|
|
|
214
214
|
currentLocaleCode
|
|
215
215
|
);
|
|
216
216
|
|
|
217
|
-
return
|
|
218
|
-
|
|
219
|
-
: `Draft saved ${relativeLabel} • Last saved: ${absoluteLabel}`;
|
|
220
|
-
}, [draftSavedAt, currentLocaleCode, getSettingValue, hasDraft]);
|
|
217
|
+
return t('draftStatus', { relativeLabel, absoluteLabel });
|
|
218
|
+
}, [draftSavedAt, currentLocaleCode, getSettingValue, hasDraft, t]);
|
|
221
219
|
|
|
222
220
|
useEffect(() => {
|
|
223
221
|
if (!open) {
|
|
@@ -300,7 +298,7 @@ function CategoriaSheet({
|
|
|
300
298
|
|
|
301
299
|
return (
|
|
302
300
|
<Sheet open={open} onOpenChange={handleOpenChange}>
|
|
303
|
-
<SheetContent className="w-full overflow-y-auto sm:max-w-lg">
|
|
301
|
+
<SheetContent className="w-full overflow-y-auto sm:max-w-lg">
|
|
304
302
|
<SheetHeader>
|
|
305
303
|
<SheetTitle>
|
|
306
304
|
{editing ? t('sheet.editTitle') : t('sheet.newTitle')}
|
|
@@ -133,10 +133,8 @@ function CentroCustoSheet({
|
|
|
133
133
|
currentLocaleCode
|
|
134
134
|
);
|
|
135
135
|
|
|
136
|
-
return
|
|
137
|
-
|
|
138
|
-
: `Draft saved ${relativeLabel} • Last saved: ${absoluteLabel}`;
|
|
139
|
-
}, [draftSavedAt, currentLocaleCode, getSettingValue, hasDraft]);
|
|
136
|
+
return t('draftStatus', { relativeLabel, absoluteLabel });
|
|
137
|
+
}, [draftSavedAt, currentLocaleCode, getSettingValue, hasDraft, t]);
|
|
140
138
|
|
|
141
139
|
useEffect(() => {
|
|
142
140
|
if (!open) {
|
|
@@ -216,7 +214,7 @@ function CentroCustoSheet({
|
|
|
216
214
|
|
|
217
215
|
return (
|
|
218
216
|
<Sheet open={open} onOpenChange={handleOpenChange}>
|
|
219
|
-
<SheetContent className="w-full overflow-y-auto sm:max-w-lg">
|
|
217
|
+
<SheetContent className="w-full overflow-y-auto sm:max-w-lg">
|
|
220
218
|
<SheetHeader>
|
|
221
219
|
<SheetTitle>
|
|
222
220
|
{editingCostCenter ? t('sheet.editTitle') : t('sheet.newTitle')}
|
|
@@ -141,10 +141,8 @@ function CurrencySheet({
|
|
|
141
141
|
getSettingValue,
|
|
142
142
|
currentLocaleCode
|
|
143
143
|
);
|
|
144
|
-
return
|
|
145
|
-
|
|
146
|
-
: `Draft saved ${relativeLabel} • Last saved: ${absoluteLabel}`;
|
|
147
|
-
}, [draftSavedAt, currentLocaleCode, getSettingValue, hasDraft]);
|
|
144
|
+
return t('draftStatus', { relativeLabel, absoluteLabel });
|
|
145
|
+
}, [draftSavedAt, currentLocaleCode, getSettingValue, hasDraft, t]);
|
|
148
146
|
|
|
149
147
|
useEffect(() => {
|
|
150
148
|
if (!open) return;
|
|
@@ -225,7 +223,7 @@ function CurrencySheet({
|
|
|
225
223
|
|
|
226
224
|
return (
|
|
227
225
|
<Sheet open={open} onOpenChange={handleOpenChange}>
|
|
228
|
-
<SheetContent className="w-full overflow-y-auto sm:max-w-lg">
|
|
226
|
+
<SheetContent className="w-full overflow-y-auto sm:max-w-lg">
|
|
229
227
|
<SheetHeader>
|
|
230
228
|
<SheetTitle>
|
|
231
229
|
{editingCurrency ? t('sheet.editTitle') : t('sheet.newTitle')}
|
|
@@ -160,10 +160,8 @@ function ClosePeriodSheet({
|
|
|
160
160
|
currentLocaleCode
|
|
161
161
|
);
|
|
162
162
|
|
|
163
|
-
return
|
|
164
|
-
|
|
165
|
-
: `Draft saved ${relativeLabel} • Last saved: ${absoluteLabel}`;
|
|
166
|
-
}, [draftSavedAt, currentLocaleCode, getSettingValue, hasDraft]);
|
|
163
|
+
return t('draftStatus', { relativeLabel, absoluteLabel });
|
|
164
|
+
}, [draftSavedAt, currentLocaleCode, getSettingValue, hasDraft, t]);
|
|
167
165
|
|
|
168
166
|
useEffect(() => {
|
|
169
167
|
if (!open) {
|
|
@@ -212,7 +210,7 @@ function ClosePeriodSheet({
|
|
|
212
210
|
onOpenChange(nextOpen);
|
|
213
211
|
}}
|
|
214
212
|
>
|
|
215
|
-
<SheetContent className="w-full overflow-y-auto sm:max-w-lg">
|
|
213
|
+
<SheetContent className="w-full overflow-y-auto sm:max-w-lg">
|
|
216
214
|
<SheetHeader>
|
|
217
215
|
<SheetTitle>{t('sheet.title')}</SheetTitle>
|
|
218
216
|
<SheetDescription>{t('sheet.description')}</SheetDescription>
|
|
@@ -82,19 +82,22 @@ import {
|
|
|
82
82
|
FinanceSheetSection,
|
|
83
83
|
} from '../../_components/finance-layout';
|
|
84
84
|
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
85
|
+
const createBankAccountFormSchema = (t: ReturnType<typeof useTranslations>) =>
|
|
86
|
+
z.object({
|
|
87
|
+
banco: z.string().trim().min(1, t('validation.bankRequired')),
|
|
88
|
+
agencia: z.string().optional(),
|
|
89
|
+
conta: z.string().optional(),
|
|
90
|
+
tipo: z.string().min(1, t('validation.typeRequired')),
|
|
91
|
+
descricao: z.string().optional(),
|
|
92
|
+
logoFileId: z.number().int().nullable().optional(),
|
|
93
|
+
currencyId: z.number().int().nullable().optional(),
|
|
94
|
+
dataInicial: z.string().optional(),
|
|
95
|
+
saldoInicial: z.number().min(0, t('validation.initialBalanceInvalid')),
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
type BankAccountFormValues = z.infer<
|
|
99
|
+
ReturnType<typeof createBankAccountFormSchema>
|
|
100
|
+
>;
|
|
98
101
|
|
|
99
102
|
type Currency = {
|
|
100
103
|
id: string;
|
|
@@ -226,36 +229,18 @@ function NovaContaSheet({
|
|
|
226
229
|
});
|
|
227
230
|
const currencies = currenciesData || [];
|
|
228
231
|
|
|
229
|
-
const createSuccessMessage = t
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
const
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
const updateErrorMessage = t.has('messages.updateError')
|
|
239
|
-
? t('messages.updateError')
|
|
240
|
-
: 'Erro ao atualizar conta bancária';
|
|
241
|
-
const logoUploadSuccessMessage = t.has('messages.logoUploadSuccess')
|
|
242
|
-
? t('messages.logoUploadSuccess')
|
|
243
|
-
: 'Logo enviado com sucesso';
|
|
244
|
-
const logoUploadErrorMessage = t.has('messages.logoUploadError')
|
|
245
|
-
? t('messages.logoUploadError')
|
|
246
|
-
: 'Erro ao enviar logo';
|
|
247
|
-
const logoRemoveSuccessMessage = t.has('messages.logoRemoveSuccess')
|
|
248
|
-
? t('messages.logoRemoveSuccess')
|
|
249
|
-
: 'Logo removido com sucesso';
|
|
250
|
-
const logoInvalidTypeMessage = t.has('messages.logoInvalidType')
|
|
251
|
-
? t('messages.logoInvalidType')
|
|
252
|
-
: 'Selecione um arquivo de imagem válido';
|
|
253
|
-
const logoTooLargeMessage = t.has('messages.logoTooLarge')
|
|
254
|
-
? t('messages.logoTooLarge')
|
|
255
|
-
: 'O logo deve ter no máximo 5 MB';
|
|
232
|
+
const createSuccessMessage = t('messages.createSuccess');
|
|
233
|
+
const createErrorMessage = t('messages.createError');
|
|
234
|
+
const updateSuccessMessage = t('messages.updateSuccess');
|
|
235
|
+
const updateErrorMessage = t('messages.updateError');
|
|
236
|
+
const logoUploadSuccessMessage = t('messages.logoUploadSuccess');
|
|
237
|
+
const logoUploadErrorMessage = t('messages.logoUploadError');
|
|
238
|
+
const logoRemoveSuccessMessage = t('messages.logoRemoveSuccess');
|
|
239
|
+
const logoInvalidTypeMessage = t('messages.logoInvalidType');
|
|
240
|
+
const logoTooLargeMessage = t('messages.logoTooLarge');
|
|
256
241
|
|
|
257
242
|
const form = useForm<BankAccountFormValues>({
|
|
258
|
-
resolver: zodResolver(
|
|
243
|
+
resolver: zodResolver(createBankAccountFormSchema(t)),
|
|
259
244
|
defaultValues: {
|
|
260
245
|
banco: '',
|
|
261
246
|
agencia: '',
|
|
@@ -354,10 +339,11 @@ function NovaContaSheet({
|
|
|
354
339
|
currentLocaleCode
|
|
355
340
|
);
|
|
356
341
|
|
|
357
|
-
return
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
342
|
+
return t('draftStatus', {
|
|
343
|
+
relativeLabel,
|
|
344
|
+
absoluteLabel,
|
|
345
|
+
});
|
|
346
|
+
}, [draftSavedAt, currentLocaleCode, getSettingValue, hasDraft, t]);
|
|
361
347
|
|
|
362
348
|
const getLogoUrl = (fileId?: number | null) => {
|
|
363
349
|
if (typeof fileId !== 'number' || fileId <= 0) {
|
|
@@ -839,35 +825,35 @@ function NovaContaSheet({
|
|
|
839
825
|
<EntityPicker<Currency>
|
|
840
826
|
form={form as never}
|
|
841
827
|
name="currencyId"
|
|
842
|
-
label=
|
|
843
|
-
placeholder=
|
|
844
|
-
searchPlaceholder=
|
|
845
|
-
entityLabel=
|
|
828
|
+
label={t('fields.currency')}
|
|
829
|
+
placeholder={t('fields.currencyPlaceholder')}
|
|
830
|
+
searchPlaceholder={t('fields.currencySearchPlaceholder')}
|
|
831
|
+
entityLabel={t('fields.currencyEntityLabel')}
|
|
846
832
|
valueType="number"
|
|
847
833
|
clearable
|
|
848
834
|
options={currencies}
|
|
849
835
|
getOptionValue={(c) => c.id}
|
|
850
836
|
getOptionLabel={(c) => `${c.symbol} ${c.code} — ${c.name}`}
|
|
851
|
-
createTitle=
|
|
852
|
-
createDescription=
|
|
837
|
+
createTitle={t('fields.currencyCreateTitle')}
|
|
838
|
+
createDescription={t('fields.currencyCreateDescription')}
|
|
853
839
|
mapSearchToCreateValues={(s) => ({ code: s.toUpperCase() })}
|
|
854
840
|
createFields={[
|
|
855
841
|
{
|
|
856
842
|
name: 'code',
|
|
857
|
-
label: '
|
|
858
|
-
placeholder: '
|
|
843
|
+
label: t('fields.currencyCode'),
|
|
844
|
+
placeholder: t('fields.currencyCodePlaceholder'),
|
|
859
845
|
required: true,
|
|
860
846
|
},
|
|
861
847
|
{
|
|
862
848
|
name: 'name',
|
|
863
|
-
label: '
|
|
864
|
-
placeholder: '
|
|
849
|
+
label: t('fields.currencyName'),
|
|
850
|
+
placeholder: t('fields.currencyNamePlaceholder'),
|
|
865
851
|
required: true,
|
|
866
852
|
},
|
|
867
853
|
{
|
|
868
854
|
name: 'symbol',
|
|
869
|
-
label: '
|
|
870
|
-
placeholder: '
|
|
855
|
+
label: t('fields.currencySymbol'),
|
|
856
|
+
placeholder: t('fields.currencySymbolPlaceholder'),
|
|
871
857
|
required: true,
|
|
872
858
|
},
|
|
873
859
|
]}
|
|
@@ -1004,21 +990,11 @@ export default function ContasBancariasPage() {
|
|
|
1004
990
|
const t = useTranslations('finance.BankAccountsPage');
|
|
1005
991
|
const { request, showToastHandler, currentLocaleCode } = useApp();
|
|
1006
992
|
|
|
1007
|
-
const deleteSuccessMessage = t
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
const
|
|
1011
|
-
|
|
1012
|
-
: 'Erro ao inativar conta bancária';
|
|
1013
|
-
const deleteDialogTitle = t.has('deleteDialog.title')
|
|
1014
|
-
? t('deleteDialog.title')
|
|
1015
|
-
: 'Inativar conta bancária';
|
|
1016
|
-
const deleteDialogDescription = t.has('deleteDialog.description')
|
|
1017
|
-
? t('deleteDialog.description')
|
|
1018
|
-
: 'Deseja realmente inativar esta conta bancária?';
|
|
1019
|
-
const deleteDialogConfirm = t.has('deleteDialog.confirm')
|
|
1020
|
-
? t('deleteDialog.confirm')
|
|
1021
|
-
: 'Inativar';
|
|
993
|
+
const deleteSuccessMessage = t('messages.deleteSuccess');
|
|
994
|
+
const deleteErrorMessage = t('messages.deleteError');
|
|
995
|
+
const deleteDialogTitle = t('deleteDialog.title');
|
|
996
|
+
const deleteDialogDescription = t('deleteDialog.description');
|
|
997
|
+
const deleteDialogConfirm = t('deleteDialog.confirm');
|
|
1022
998
|
|
|
1023
999
|
const [sheetOpen, setSheetOpen] = useState(false);
|
|
1024
1000
|
const [editingAccount, setEditingAccount] = useState<BankAccount | null>(
|
|
@@ -201,10 +201,8 @@ function CriarAjusteSheet({
|
|
|
201
201
|
currentLocaleCode
|
|
202
202
|
);
|
|
203
203
|
|
|
204
|
-
return
|
|
205
|
-
|
|
206
|
-
: `Draft saved ${relativeLabel} • Last saved: ${absoluteLabel}`;
|
|
207
|
-
}, [draftSavedAt, currentLocaleCode, getSettingValue, hasDraft]);
|
|
204
|
+
return t('draftStatus', { relativeLabel, absoluteLabel });
|
|
205
|
+
}, [draftSavedAt, currentLocaleCode, getSettingValue, hasDraft, t]);
|
|
208
206
|
|
|
209
207
|
useEffect(() => {
|
|
210
208
|
if (!open) {
|
|
@@ -226,7 +224,7 @@ function CriarAjusteSheet({
|
|
|
226
224
|
|
|
227
225
|
const handleSubmit = async (values: AjusteFormValues) => {
|
|
228
226
|
if (!contaFilter) {
|
|
229
|
-
showToastHandler?.('error', '
|
|
227
|
+
showToastHandler?.('error', t('messages.selectBankAccount'));
|
|
230
228
|
return;
|
|
231
229
|
}
|
|
232
230
|
|
|
@@ -244,10 +242,10 @@ function CriarAjusteSheet({
|
|
|
244
242
|
|
|
245
243
|
clearDraft();
|
|
246
244
|
await onCreated();
|
|
247
|
-
showToastHandler?.('success', '
|
|
245
|
+
showToastHandler?.('success', t('messages.createAdjustmentSuccess'));
|
|
248
246
|
setOpen(false);
|
|
249
247
|
} catch {
|
|
250
|
-
showToastHandler?.('error', '
|
|
248
|
+
showToastHandler?.('error', t('messages.createAdjustmentError'));
|
|
251
249
|
}
|
|
252
250
|
};
|
|
253
251
|
|
|
@@ -677,9 +675,9 @@ export default function ConciliacaoPage() {
|
|
|
677
675
|
setSelectedExtrato(null);
|
|
678
676
|
setSelectedTitulo(null);
|
|
679
677
|
await handleRefreshData();
|
|
680
|
-
showToastHandler?.('success', '
|
|
678
|
+
showToastHandler?.('success', t('messages.reconcileSuccess'));
|
|
681
679
|
} catch {
|
|
682
|
-
showToastHandler?.('error', '
|
|
680
|
+
showToastHandler?.('error', t('messages.reconcileError'));
|
|
683
681
|
}
|
|
684
682
|
};
|
|
685
683
|
|