@hed-hog/finance 0.0.300 → 0.0.302

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.
Files changed (41) hide show
  1. package/dist/finance.contract-activated.subscriber.d.ts +24 -0
  2. package/dist/finance.contract-activated.subscriber.d.ts.map +1 -0
  3. package/dist/finance.contract-activated.subscriber.js +519 -0
  4. package/dist/finance.contract-activated.subscriber.js.map +1 -0
  5. package/dist/finance.contract-activated.subscriber.spec.d.ts +2 -0
  6. package/dist/finance.contract-activated.subscriber.spec.d.ts.map +1 -0
  7. package/dist/finance.contract-activated.subscriber.spec.js +302 -0
  8. package/dist/finance.contract-activated.subscriber.spec.js.map +1 -0
  9. package/dist/finance.module.d.ts.map +1 -1
  10. package/dist/finance.module.js +6 -1
  11. package/dist/finance.module.js.map +1 -1
  12. package/hedhog/data/menu.yaml +0 -17
  13. package/hedhog/frontend/app/_components/finance-layout.tsx.ejs +108 -0
  14. package/hedhog/frontend/app/accounts-payable/approvals/page.tsx.ejs +51 -69
  15. package/hedhog/frontend/app/accounts-payable/installments/page.tsx.ejs +1312 -1138
  16. package/hedhog/frontend/app/accounts-receivable/collections-default/page.tsx.ejs +288 -268
  17. package/hedhog/frontend/app/accounts-receivable/installments/page.tsx.ejs +1175 -1016
  18. package/hedhog/frontend/app/administration/audit-logs/page.tsx.ejs +157 -173
  19. package/hedhog/frontend/app/administration/categories/page.tsx.ejs +44 -62
  20. package/hedhog/frontend/app/administration/cost-centers/page.tsx.ejs +62 -80
  21. package/hedhog/frontend/app/administration/period-close/page.tsx.ejs +151 -170
  22. package/hedhog/frontend/app/cash-and-banks/bank-accounts/page.tsx.ejs +369 -322
  23. package/hedhog/frontend/app/cash-and-banks/bank-reconciliation/page.tsx.ejs +204 -226
  24. package/hedhog/frontend/app/cash-and-banks/statements/page.tsx.ejs +122 -140
  25. package/hedhog/frontend/app/cash-and-banks/transfers/page.tsx.ejs +31 -49
  26. package/hedhog/frontend/app/page.tsx.ejs +3 -370
  27. package/hedhog/frontend/app/planning/cash-flow-forecast/page.tsx.ejs +150 -182
  28. package/hedhog/frontend/app/planning/receivables-calendar/page.tsx.ejs +52 -70
  29. package/hedhog/frontend/app/planning/scenarios/page.tsx.ejs +101 -95
  30. package/hedhog/frontend/app/reports/actual-vs-forecast/page.tsx.ejs +100 -125
  31. package/hedhog/frontend/app/reports/aging-default/page.tsx.ejs +77 -105
  32. package/hedhog/frontend/app/reports/cash-position/page.tsx.ejs +99 -134
  33. package/hedhog/frontend/app/reports/overview-results/page.tsx.ejs +147 -182
  34. package/hedhog/frontend/app/reports/top-customers/page.tsx.ejs +49 -61
  35. package/hedhog/frontend/app/reports/top-operational-expenses/page.tsx.ejs +49 -67
  36. package/hedhog/frontend/messages/en.json +176 -68
  37. package/hedhog/frontend/messages/pt.json +176 -68
  38. package/package.json +6 -5
  39. package/src/finance.contract-activated.subscriber.spec.ts +392 -0
  40. package/src/finance.contract-activated.subscriber.ts +780 -0
  41. package/src/finance.module.ts +6 -1
@@ -1,5 +1,6 @@
1
1
  'use client';
2
2
 
3
+ import { FinancePageSection } from '@/app/(app)/(libraries)/finance/_components/finance-layout';
3
4
  import { Page, PageHeader } from '@/components/entity-list';
4
5
  import { Button } from '@/components/ui/button';
5
6
  import {
@@ -10,6 +11,7 @@ import {
10
11
  CardTitle,
11
12
  } from '@/components/ui/card';
12
13
  import { Input } from '@/components/ui/input';
14
+ import { KpiCardsGrid } from '@/components/ui/kpi-cards-grid';
13
15
  import { Money } from '@/components/ui/money';
14
16
  import {
15
17
  Select,
@@ -88,6 +90,41 @@ export default function TopOperationalExpensesReportPage() {
88
90
  setAppliedFilters(filters);
89
91
  };
90
92
 
93
+ const summaryCards = [
94
+ {
95
+ key: 'total',
96
+ title: t('cards.total'),
97
+ value: <Money value={viewData.total} />,
98
+ icon: CircleDollarSign,
99
+ layout: 'compact' as const,
100
+ iconContainerClassName: 'bg-orange-500/10 text-orange-600',
101
+ accentClassName: 'from-orange-500/20 via-amber-500/10 to-transparent',
102
+ },
103
+ {
104
+ key: 'highestExpense',
105
+ title: t('cards.highestExpense'),
106
+ value: viewData.highest?.category || '-',
107
+ description: viewData.highest ? (
108
+ <Money value={viewData.highest.value} />
109
+ ) : (
110
+ '-'
111
+ ),
112
+ icon: TriangleAlert,
113
+ layout: 'compact' as const,
114
+ iconContainerClassName: 'bg-amber-500/10 text-amber-500',
115
+ accentClassName: 'from-amber-500/20 via-yellow-500/10 to-transparent',
116
+ },
117
+ {
118
+ key: 'average',
119
+ title: t('cards.average'),
120
+ value: <Money value={viewData.average} />,
121
+ icon: Building2,
122
+ layout: 'compact' as const,
123
+ iconContainerClassName: 'bg-blue-500/10 text-blue-600',
124
+ accentClassName: 'from-blue-500/20 via-sky-500/10 to-transparent',
125
+ },
126
+ ];
127
+
91
128
  const renderSolidTooltip = ({
92
129
  active,
93
130
  payload,
@@ -163,7 +200,7 @@ export default function TopOperationalExpensesReportPage() {
163
200
  }))
164
201
  }
165
202
  max={filters.to}
166
- className="w-full lg:w-[170px]"
203
+ className="w-full lg:w-42.5"
167
204
  aria-label={t('filters.fromAria')}
168
205
  placeholder={t('filters.fromPlaceholder')}
169
206
  />
@@ -178,7 +215,7 @@ export default function TopOperationalExpensesReportPage() {
178
215
  }))
179
216
  }
180
217
  min={filters.from}
181
- className="w-full lg:w-[170px]"
218
+ className="w-full lg:w-42.5"
182
219
  aria-label={t('filters.toAria')}
183
220
  placeholder={t('filters.toPlaceholder')}
184
221
  />
@@ -192,7 +229,7 @@ export default function TopOperationalExpensesReportPage() {
192
229
  }
193
230
  >
194
231
  <SelectTrigger
195
- className="w-full lg:w-[150px]"
232
+ className="w-full lg:w-37.5"
196
233
  aria-label={t('filters.groupByAria')}
197
234
  >
198
235
  <SelectValue placeholder={t('filters.groupByPlaceholder')} />
@@ -213,62 +250,7 @@ export default function TopOperationalExpensesReportPage() {
213
250
  </Button>
214
251
  </form>
215
252
 
216
- <div className="grid gap-3 md:grid-cols-3">
217
- <Card>
218
- <CardHeader className="flex flex-row items-center justify-between space-y-0 pb-1 pt-3 px-4">
219
- <CardTitle className="text-xs font-medium tracking-wide text-muted-foreground uppercase">
220
- {t('cards.total')}
221
- </CardTitle>
222
- <div className="rounded-full bg-orange-500/10 p-1.5">
223
- <CircleDollarSign className="h-4 w-4 text-orange-600" />
224
- </div>
225
- </CardHeader>
226
- <CardContent className="pb-3 pt-0 px-4">
227
- <div className="text-xl font-bold">
228
- <Money value={viewData.total} />
229
- </div>
230
- </CardContent>
231
- </Card>
232
-
233
- <Card>
234
- <CardHeader className="flex flex-row items-center justify-between space-y-0 pb-1 pt-3 px-4">
235
- <CardTitle className="text-xs font-medium tracking-wide text-muted-foreground uppercase">
236
- {t('cards.highestExpense')}
237
- </CardTitle>
238
- <div className="rounded-full bg-amber-500/10 p-1.5">
239
- <TriangleAlert className="h-4 w-4 text-amber-500" />
240
- </div>
241
- </CardHeader>
242
- <CardContent className="pb-3 pt-0 px-4">
243
- <div className="text-sm font-medium">
244
- {viewData.highest?.category || '-'}
245
- </div>
246
- <div className="text-xs text-muted-foreground">
247
- {viewData.highest ? (
248
- <Money value={viewData.highest.value} />
249
- ) : (
250
- '-'
251
- )}
252
- </div>
253
- </CardContent>
254
- </Card>
255
-
256
- <Card>
257
- <CardHeader className="flex flex-row items-center justify-between space-y-0 pb-1 pt-3 px-4">
258
- <CardTitle className="text-xs font-medium tracking-wide text-muted-foreground uppercase">
259
- {t('cards.average')}
260
- </CardTitle>
261
- <div className="rounded-full bg-blue-500/10 p-1.5">
262
- <Building2 className="h-4 w-4 text-blue-600" />
263
- </div>
264
- </CardHeader>
265
- <CardContent className="pb-3 pt-0 px-4">
266
- <div className="text-xl font-bold">
267
- <Money value={viewData.average} />
268
- </div>
269
- </CardContent>
270
- </Card>
271
- </div>
253
+ <KpiCardsGrid items={summaryCards} columns={3} />
272
254
 
273
255
  <div className="grid gap-3 xl:grid-cols-5">
274
256
  <Card className="xl:col-span-3">
@@ -366,12 +348,12 @@ export default function TopOperationalExpensesReportPage() {
366
348
  </Card>
367
349
  </div>
368
350
 
369
- <Card>
370
- <CardHeader>
371
- <CardTitle>{t('table.title')}</CardTitle>
372
- <CardDescription>{t('table.description')}</CardDescription>
373
- </CardHeader>
374
- <CardContent>
351
+ <FinancePageSection
352
+ title={t('table.title')}
353
+ description={t('table.description')}
354
+ contentClassName="p-4 sm:p-5"
355
+ >
356
+ <div className="overflow-x-auto">
375
357
  <Table>
376
358
  <TableHeader>
377
359
  <TableRow>
@@ -418,8 +400,8 @@ export default function TopOperationalExpensesReportPage() {
418
400
  )}
419
401
  </TableBody>
420
402
  </Table>
421
- </CardContent>
422
- </Card>
403
+ </div>
404
+ </FinancePageSection>
423
405
  </Page>
424
406
  );
425
407
  }
@@ -130,11 +130,12 @@
130
130
  "actions": "Actions"
131
131
  }
132
132
  },
133
- "empty": {
134
- "title": "All good!",
135
- "description": "There are no pending approvals."
136
- }
137
- },
133
+ "empty": {
134
+ "title": "All good!",
135
+ "description": "There are no pending approvals.",
136
+ "refresh": "Refresh"
137
+ }
138
+ },
138
139
  "PersonFieldWithCreate": {
139
140
  "sheet": {
140
141
  "title": "New {entityLabel}",
@@ -269,33 +270,71 @@
269
270
  "cash": "Cash",
270
271
  "check": "Check"
271
272
  },
272
- "header": {
273
- "title": "Payable Titles",
274
- "description": "Manage your accounts payable"
275
- },
276
- "breadcrumbs": {
277
- "home": "Home",
278
- "finance": "Finance",
279
- "current": "Payable Titles"
280
- },
273
+ "header": {
274
+ "title": "Payable Titles",
275
+ "description": "Manage your accounts payable"
276
+ },
277
+ "summary": {
278
+ "cards": {
279
+ "visible": {
280
+ "title": "Visible titles",
281
+ "description": "{total} records in total"
282
+ },
283
+ "value": {
284
+ "title": "Visible value",
285
+ "description": "Sum of the current page"
286
+ },
287
+ "attention": {
288
+ "title": "Pending",
289
+ "description": "{overdue} overdue"
290
+ }
291
+ }
292
+ },
293
+ "breadcrumbs": {
294
+ "home": "Home",
295
+ "finance": "Finance",
296
+ "current": "Payable Titles"
297
+ },
281
298
  "filters": {
282
299
  "searchPlaceholder": "Search by document or supplier...",
283
300
  "status": "Status"
284
301
  },
285
- "statuses": {
286
- "all": "All",
287
- "rascunho": "Draft",
288
- "aprovado": "Approved",
289
- "aberto": "Open",
302
+ "statuses": {
303
+ "all": "All",
304
+ "rascunho": "Draft",
305
+ "aprovado": "Approved",
306
+ "aberto": "Open",
290
307
  "parcial": "Partial",
291
308
  "liquidado": "Settled",
292
- "vencido": "Overdue",
293
- "cancelado": "Canceled"
294
- },
295
- "table": {
296
- "headers": {
297
- "document": "Document",
298
- "supplier": "Supplier",
309
+ "vencido": "Overdue",
310
+ "cancelado": "Canceled"
311
+ },
312
+ "list": {
313
+ "title": "Title portfolio",
314
+ "description": "Track documents, due dates, and operational actions for the current page."
315
+ },
316
+ "sections": {
317
+ "main": {
318
+ "title": "Main data",
319
+ "description": "Provide document, supplier, dates, and the total title amount."
320
+ },
321
+ "installments": {
322
+ "title": "Installments",
323
+ "description": "Review the due schedule and adjust installment amounts before saving."
324
+ },
325
+ "classification": {
326
+ "title": "Financial classification",
327
+ "description": "Assign category, cost center, and payment method to organize the operation."
328
+ },
329
+ "notes": {
330
+ "title": "Notes",
331
+ "description": "Use this field to add extra context to the title when needed."
332
+ }
333
+ },
334
+ "table": {
335
+ "headers": {
336
+ "document": "Document",
337
+ "supplier": "Supplier",
299
338
  "competency": "Competency",
300
339
  "dueDate": "Due Date",
301
340
  "value": "Value",
@@ -333,12 +372,18 @@
333
372
  "confirm": "Confirm reversal"
334
373
  }
335
374
  },
336
- "settleSheet": {
337
- "title": "Register settlement",
338
- "description": "Provide installment and settlement amount for title {document}.",
339
- "installmentLabel": "Installment",
340
- "installmentPlaceholder": "Select",
341
- "installmentOption": "Installment {number} - open amount: {amount}",
375
+ "settleSheet": {
376
+ "title": "Register settlement",
377
+ "description": "Provide installment and settlement amount for title {document}.",
378
+ "sections": {
379
+ "payment": {
380
+ "title": "Settlement data",
381
+ "description": "Choose the available installment and confirm the amount to settle."
382
+ }
383
+ },
384
+ "installmentLabel": "Installment",
385
+ "installmentPlaceholder": "Select",
386
+ "installmentOption": "Installment {number} - open amount: {amount}",
342
387
  "amountLabel": "Amount",
343
388
  "descriptionLabel": "Description (optional)",
344
389
  "confirm": "Confirm settlement"
@@ -671,31 +716,69 @@
671
716
  "card": "Card",
672
717
  "transfer": "Transfer"
673
718
  },
674
- "header": {
675
- "title": "Receivable Titles",
676
- "description": "Manage your accounts receivable"
677
- },
678
- "breadcrumbs": {
679
- "home": "Home",
680
- "finance": "Finance",
681
- "current": "Receivable Titles"
719
+ "header": {
720
+ "title": "Receivable Titles",
721
+ "description": "Manage your accounts receivable"
722
+ },
723
+ "summary": {
724
+ "cards": {
725
+ "visible": {
726
+ "title": "Visible titles",
727
+ "description": "{total} records in total"
728
+ },
729
+ "value": {
730
+ "title": "Visible value",
731
+ "description": "Sum of the current page"
732
+ },
733
+ "attention": {
734
+ "title": "Pending",
735
+ "description": "{overdue} overdue"
736
+ }
737
+ }
738
+ },
739
+ "breadcrumbs": {
740
+ "home": "Home",
741
+ "finance": "Finance",
742
+ "current": "Receivable Titles"
682
743
  },
683
744
  "filters": {
684
745
  "searchPlaceholder": "Search by document or client...",
685
746
  "status": "Status"
686
747
  },
687
- "statuses": {
688
- "all": "All",
689
- "aberto": "Open",
690
- "parcial": "Partial",
691
- "liquidado": "Settled",
692
- "vencido": "Overdue",
693
- "cancelado": "Canceled"
694
- },
695
- "table": {
696
- "headers": {
697
- "document": "Document",
698
- "client": "Client",
748
+ "statuses": {
749
+ "all": "All",
750
+ "aberto": "Open",
751
+ "parcial": "Partial",
752
+ "liquidado": "Settled",
753
+ "vencido": "Overdue",
754
+ "cancelado": "Canceled"
755
+ },
756
+ "list": {
757
+ "title": "Receivables portfolio",
758
+ "description": "Track clients, due dates, and operational actions for the current page."
759
+ },
760
+ "sections": {
761
+ "main": {
762
+ "title": "Main data",
763
+ "description": "Provide document, client, dates, and the total title amount."
764
+ },
765
+ "installments": {
766
+ "title": "Installments",
767
+ "description": "Review the due schedule and adjust installment amounts before saving."
768
+ },
769
+ "classification": {
770
+ "title": "Financial classification",
771
+ "description": "Assign category, cost center, and receiving channel to organize the operation."
772
+ },
773
+ "notes": {
774
+ "title": "Notes",
775
+ "description": "Use this field to add extra context to the title when needed."
776
+ }
777
+ },
778
+ "table": {
779
+ "headers": {
780
+ "document": "Document",
781
+ "client": "Client",
699
782
  "competency": "Competency",
700
783
  "dueDate": "Due Date",
701
784
  "value": "Value",
@@ -710,15 +793,20 @@
710
793
  "sendCollection": "Send Collection",
711
794
  "openAttachment": "Open attachment"
712
795
  }
713
- },
714
- "installmentsEditor": {
715
- "title": "Installments",
716
- "countLabel": "Installments Count",
717
- "recalculate": "Recalculate automatically",
718
- "autoRedistributeLabel": "Automatically redistribute remaining amount when editing installment",
719
- "dueDateLabel": "Due date",
720
- "amountLabel": "Amount",
721
- "totalPrefix": "Installments total: {total}",
796
+ },
797
+ "empty": {
798
+ "title": "No titles found",
799
+ "description": "Create the first title to start managing accounts receivable."
800
+ },
801
+ "installmentsEditor": {
802
+ "title": "Installments",
803
+ "countLabel": "Installments Count",
804
+ "recalculate": "Recalculate automatically",
805
+ "autoRedistributeLabel": "Automatically redistribute remaining amount when editing installment",
806
+ "autoRedistributeHint": "Redistribution occurs after typing stops and on field blur.",
807
+ "dueDateLabel": "Due date",
808
+ "amountLabel": "Amount",
809
+ "totalPrefix": "Installments total: {total}",
722
810
  "adjustmentNeeded": "(adjustment needed)"
723
811
  },
724
812
  "editTitle": {
@@ -920,13 +1008,33 @@
920
1008
  "finance": "Finance",
921
1009
  "current": "Bank Accounts"
922
1010
  },
923
- "cards": {
924
- "totalBalance": "Total Balance",
925
- "activeAccounts": "{count} active accounts",
926
- "reconciledBalance": "Reconciled Balance",
927
- "difference": "Difference"
928
- },
929
- "status": { "inactive": "Inactive" },
1011
+ "cards": {
1012
+ "totalBalance": "Total Balance",
1013
+ "activeAccounts": "{count} active accounts",
1014
+ "reconciledBalance": "Reconciled Balance",
1015
+ "difference": "Difference",
1016
+ "accountsOverview": "Active accounts",
1017
+ "inactiveAccounts": "{count} inactive accounts"
1018
+ },
1019
+ "sections": {
1020
+ "accountData": {
1021
+ "title": "Account details",
1022
+ "description": "Fill in the main information used to identify and classify the bank account."
1023
+ },
1024
+ "logo": {
1025
+ "title": "Logo and visual identity",
1026
+ "description": "Add an optional image to make the account easier to recognize across lists."
1027
+ }
1028
+ },
1029
+ "list": {
1030
+ "title": "Registered accounts",
1031
+ "description": "Track balances, reconciliation, and quick actions for each bank account."
1032
+ },
1033
+ "empty": {
1034
+ "title": "No bank accounts registered",
1035
+ "description": "Create your first account to start tracking balances, statements, and reconciliations."
1036
+ },
1037
+ "status": { "inactive": "Inactive" },
930
1038
  "accountCard": {
931
1039
  "bankAccount": "Br: {agency} | Ac: {account}",
932
1040
  "currentBalance": "Current Balance",