@accounter/client 0.0.8-alpha-20251030162201-d2f279aafe537912ec3546af855cbd3a38ac0f5c → 0.0.8-alpha-20251030162303-87017b2c2addf0e61478260aac336b9343f15c98

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 (116) hide show
  1. package/CHANGELOG.md +1 -16
  2. package/dist/assets/{Checkbox-qEdmT4HE.js → Checkbox-CLE7WylX.js} +2 -2
  3. package/dist/assets/{MultiSelect-Dm9mO7pJ.js → MultiSelect-SsgUtHuW.js} +1 -1
  4. package/dist/assets/{Progress-kr0gnfBa.js → Progress-D7j8SJRp.js} +1 -1
  5. package/dist/assets/{Table-DnHfGe-y.js → Table-DpZKU9e6.js} +1 -1
  6. package/dist/assets/{Typography-Cu3puAUK.js → Typography-DOCvIzjw.js} +1 -1
  7. package/dist/assets/{YearPickerInput-oa86GF4P.js → YearPickerInput-BbyQMsmW.js} +1 -1
  8. package/dist/assets/{accordion-DLtMSqIv.js → accordion-KRd9M_7N.js} +1 -1
  9. package/dist/assets/{accountant-approvals-DsL0uiBa.js → accountant-approvals-BWkXiUJx.js} +1 -1
  10. package/dist/assets/{accounter-table-BL_yrGIl.js → accounter-table-BvOYdMv2.js} +1 -1
  11. package/dist/assets/{addDays-DqZEDZy3.js → addDays-HTdY9JyJ.js} +1 -1
  12. package/dist/assets/{all-charges-D3Xf-pEY.js → all-charges-uOrXkSoe.js} +1 -1
  13. package/dist/assets/{arrow-up-down-DchtBEG4.js → arrow-up-down-D0e6luFS.js} +1 -1
  14. package/dist/assets/{building-2-ZTKteVvf.js → building-2-BScQAy2y.js} +1 -1
  15. package/dist/assets/{business-extended-info-1mzdXJbs.js → business-extended-info-BPdDug4k.js} +4 -4
  16. package/dist/assets/{business-header-CJqfKV4d.js → business-header-ScM944FH.js} +1 -1
  17. package/dist/assets/{business-ledger-filters-BRB1r_DP.js → business-ledger-filters-C6zdPVNQ.js} +1 -1
  18. package/dist/assets/{business-ledger-single-C8FIQJ8V.js → business-ledger-single-D_gxQY7c.js} +1 -1
  19. package/dist/assets/business-qHY5sNtm.js +37 -0
  20. package/dist/assets/business-trip-BD6qMULS.js +1 -0
  21. package/dist/assets/{charge-Df3lWZH-.js → charge-CXgCTI2e.js} +1 -1
  22. package/dist/assets/charges-filters-DhYogrgu.js +1 -0
  23. package/dist/assets/{charges-ledger-validation-CtCBR3C-.js → charges-ledger-validation-K96Gpr99.js} +1 -1
  24. package/dist/assets/{charges-table-CWbe3t13.js → charges-table-Cff0tibm.js} +7 -7
  25. package/dist/assets/{chart-Cmm-jp0c.js → chart-Rag7RVt5.js} +1 -1
  26. package/dist/assets/contracts-C26gq1yS.js +16 -0
  27. package/dist/assets/{data-table-pagination-fdOZTf64.js → data-table-pagination-BenxjRXY.js} +2 -2
  28. package/dist/assets/{download-csv-button-CwK31swX.js → download-csv-button-8ow10rSS.js} +1 -1
  29. package/dist/assets/edit-issue-document-modal-2d_PTbvO.js +1 -0
  30. package/dist/assets/{editable-business-trip-Bjxkm9xV.js → editable-business-trip-BFJ_Mqji.js} +2 -2
  31. package/dist/assets/eye-off-BNMLF-BO.js +6 -0
  32. package/dist/assets/{funnel-CMG4QvaK.js → funnel-DW3_rS_8.js} +1 -1
  33. package/dist/assets/{index-BZVrGMgV.js → index-1iKxq5ag.js} +2 -2
  34. package/dist/assets/{index-C_ZNQ0Zr.js → index-2unHvdGT.js} +1 -1
  35. package/dist/assets/{index-DInU4RP4.js → index-4ufIi3AX.js} +2 -2
  36. package/dist/assets/index-B0Je179L.js +1 -0
  37. package/dist/assets/index-B2VI47XT.js +1 -0
  38. package/dist/assets/index-B86FoQmY.js +1 -0
  39. package/dist/assets/{index-CgokSIpu.js → index-BCiHeRl-.js} +1 -1
  40. package/dist/assets/{index-6G62OvEh.js → index-BDUyPP2c.js} +1 -1
  41. package/dist/assets/index-BHA96r33.js +1 -0
  42. package/dist/assets/{index-CjC_SXIA.js → index-BPS5RB7_.js} +1 -1
  43. package/dist/assets/{index-B9CbQIGq.js → index-BQyZXdTq.js} +2 -2
  44. package/dist/assets/index-BZLSFBEt.js +1 -0
  45. package/dist/assets/{index-Cw_aKL-8.js → index-Bd-SKdyy.js} +178 -173
  46. package/dist/assets/{index-C7oYbGGm.js → index-Bo2SK7RM.js} +1 -1
  47. package/dist/assets/{index-jCPWIpdP.js → index-Bp6IHcih.js} +1 -1
  48. package/dist/assets/index-BrSZxw1u.css +1 -0
  49. package/dist/assets/{index-DFW4nqx8.js → index-CEiIgRJ2.js} +7 -7
  50. package/dist/assets/{index-CTatkdRy.js → index-CKNxDyu9.js} +2 -2
  51. package/dist/assets/index-CqIav7Xr.js +1 -0
  52. package/dist/assets/index-Dp9F68vS.js +1 -0
  53. package/dist/assets/{index-CriBDqbK.js → index-DvvRs9Ha.js} +1 -1
  54. package/dist/assets/{index-DLwMwjDQ.js → index-DyLWk3js.js} +1 -1
  55. package/dist/assets/index-NdA_oCxx.js +1 -0
  56. package/dist/assets/{index-BEahR51x.js → index-VD71ra9C.js} +2 -2
  57. package/dist/assets/{index-xxe8M91O.js → index-lMXNkFuw.js} +2 -2
  58. package/dist/assets/index-q3ev6JER.js +1 -0
  59. package/dist/assets/{index.es-B_Bf6nNm.js → index.es-C9I2aTP4.js} +1 -1
  60. package/dist/assets/{insert-business-trip-modal-Ds3RIlmF.js → insert-business-trip-modal-DVcWpJHr.js} +2 -2
  61. package/dist/assets/issue-document-BxTTlJ1T.js +1 -0
  62. package/dist/assets/{list-plus-B3EB-dKe.js → list-plus-B7wBrICK.js} +1 -1
  63. package/dist/assets/login-page-BpgscuKm.js +1 -0
  64. package/dist/assets/{match-document-modal-Bo9pBr8W.js → match-document-modal-CqP2SE2c.js} +4 -4
  65. package/dist/assets/{missing-info-charges-BQYXI7bj.js → missing-info-charges-CIs_kE3P.js} +1 -1
  66. package/dist/assets/{modal-Pj_6bAFk.js → modal-CwuHXtxz.js} +1 -1
  67. package/dist/assets/modify-contract-dialog-BoeamC68.js +1 -0
  68. package/dist/assets/{page-layout-CVTeUSZp.js → page-layout-XgNPsCmr.js} +1 -1
  69. package/dist/assets/{page-not-found-TvTAiAs4.js → page-not-found-CrFJMQNO.js} +1 -1
  70. package/dist/assets/{panel-top-open-DzBY_TuM.js → panel-top-open-DU7alj-S.js} +1 -1
  71. package/dist/assets/{pencil-BBmFhuZN.js → pencil-9DTTP5vx.js} +1 -1
  72. package/dist/assets/{report-commentary-row-Dqw62LLo.js → report-commentary-row-BdS3qqMS.js} +1 -1
  73. package/dist/assets/{save-BW18gNVs.js → save-i8sPy_OW.js} +1 -1
  74. package/dist/assets/similar-transactions-modal-CZAOYt-d.js +1 -0
  75. package/dist/assets/sub-BL9nfaPD.js +1 -0
  76. package/dist/assets/subMonths-DHPWOZP6.js +1 -0
  77. package/dist/assets/{summary-Bbsq64IN.js → summary-Dfiju7xJ.js} +1 -1
  78. package/dist/assets/{toggle-expansion-button-BrKkZtGj.js → toggle-expansion-button-BbVh8z6s.js} +1 -1
  79. package/dist/assets/tooltip-C-fd9L1l.js +1 -0
  80. package/dist/assets/{use-url-query-C0mVgO2i.js → use-url-query-5TFyEk1x.js} +1 -1
  81. package/dist/index.html +2 -2
  82. package/package.json +1 -1
  83. package/src/components/business/admin-business-section.tsx +103 -282
  84. package/src/components/clients/contracts/modify-contract-dialog.tsx +341 -253
  85. package/src/components/contracts/cells/client.tsx +24 -0
  86. package/src/components/contracts/cells/date.tsx +10 -0
  87. package/src/components/contracts/cells/index.ts +2 -0
  88. package/src/components/contracts/columns.tsx +182 -0
  89. package/src/components/contracts/contracts-filter.tsx +160 -0
  90. package/src/components/contracts/index.tsx +264 -0
  91. package/src/components/contracts/issue-documents-modal.tsx +234 -0
  92. package/src/components/layout/sidelinks.tsx +7 -0
  93. package/src/components/screens/businesses/clients/contracts/contracts.tsx +56 -0
  94. package/src/gql/gql.ts +27 -3
  95. package/src/gql/graphql.ts +73 -52
  96. package/src/router/config.tsx +13 -0
  97. package/src/router/routes.ts +1 -0
  98. package/dist/assets/business-CAcKSrnu.js +0 -37
  99. package/dist/assets/business-trip-DkTEY8b1.js +0 -1
  100. package/dist/assets/charges-filters-DUuY-N0H.js +0 -1
  101. package/dist/assets/index-BD4s2ucv.css +0 -1
  102. package/dist/assets/index-BFwWHKS1.js +0 -1
  103. package/dist/assets/index-BI0XToIk.js +0 -1
  104. package/dist/assets/index-BQb_C-JL.js +0 -1
  105. package/dist/assets/index-CJQlHnFs.js +0 -1
  106. package/dist/assets/index-Cm6Blkgf.js +0 -1
  107. package/dist/assets/index-DJLQkpmI.js +0 -6
  108. package/dist/assets/index-DcwGbXWr.js +0 -1
  109. package/dist/assets/index-Dlj3jpuW.js +0 -1
  110. package/dist/assets/index-iya2tfvn.js +0 -1
  111. package/dist/assets/issue-document-_iHCFO9h.js +0 -1
  112. package/dist/assets/login-page-BtT_TCEJ.js +0 -1
  113. package/dist/assets/similar-transactions-modal-B39q1NLa.js +0 -1
  114. package/dist/assets/sub-DOjETdwl.js +0 -1
  115. package/dist/assets/subMonths-DqeFZ4O6.js +0 -1
  116. package/dist/assets/tooltip-CbnJYNc4.js +0 -1
@@ -2,9 +2,8 @@
2
2
 
3
3
  import type React from 'react';
4
4
  import { useEffect, useState } from 'react';
5
- import { format } from 'date-fns';
6
- import { Plus, Save, Shield, X } from 'lucide-react';
7
- import { useFieldArray, useForm } from 'react-hook-form';
5
+ import { Save, Shield } from 'lucide-react';
6
+ import { useForm } from 'react-hook-form';
8
7
  import { z } from 'zod';
9
8
  import { Button } from '@/components/ui/button.js';
10
9
  import {
@@ -39,7 +38,6 @@ import {
39
38
  } from '@/helpers/index.js';
40
39
  import { useUpdateAdminBusiness } from '@/hooks/use-update-admin-business.js';
41
40
  import { zodResolver } from '@hookform/resolvers/zod';
42
- import { Label } from '../ui/label';
43
41
  import { Separator } from '../ui/separator';
44
42
 
45
43
  // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- used by codegen
@@ -49,81 +47,59 @@ import { Separator } from '../ui/separator';
49
47
  ... on LtdFinancialEntity {
50
48
  adminInfo {
51
49
  id
50
+ withholdingTaxBookNumber
51
+ withholdingTaxFileNumber
52
+ socialSecurityEmployerId
53
+ taxAdvancesRate
54
+ taxAdvancesId
52
55
  registrationDate
53
- withholdingTaxAnnualIds {
54
- id
55
- year
56
- }
57
- withholdingTaxCompanyId
58
- socialSecurityEmployerIds {
59
- id
60
- year
61
- }
62
- socialSecurityDeductionsId
63
- taxAdvancesAnnualIds {
64
- id
65
- year
66
- }
67
- taxAdvancesRates {
68
- date
69
- rate
70
- }
71
56
  }
72
57
  }
73
58
  }
74
59
  `;
75
60
 
76
- const annualIdSchema = z.object({
77
- year: z.number().min(2000).max(2100),
78
- id: z.string().min(1, { message: 'ID is required' }),
79
- });
80
-
81
61
  const adminBusinessFormSchema = z.object({
62
+ withholdingTaxBookNumber: z.string().min(1, {
63
+ message: 'Withholding Tax Book Number is required',
64
+ }),
65
+ withholdingTaxFileNumber: z.string().min(1, {
66
+ message: 'Withholding Tax File Number is required',
67
+ }),
68
+ socialSecurityEmployerId: z.string().min(1, {
69
+ message: 'National Insurance Employer ID is required',
70
+ }),
71
+ taxAdvancesRate: z
72
+ .number()
73
+ .min(0, {
74
+ message: 'Advance Tax Rate must be at least 0',
75
+ })
76
+ .max(100, {
77
+ message: 'Advance Tax Rate must be at most 100',
78
+ }),
79
+ taxAdvancesId: z.string().min(1, {
80
+ message: 'Tax Advances ID is required',
81
+ }),
82
82
  registrationDate: z.string().min(1, {
83
83
  message: 'Business Registration Start Date is required',
84
84
  }),
85
- withholdingTaxAnnualIds: z.array(annualIdSchema),
86
- withholdingTaxCompanyId: z.string().min(1, { message: 'Withholding Tax Company ID is required' }),
87
- socialSecurityEmployerIds: z.array(annualIdSchema),
88
- socialSecurityDeductionsId: z
89
- .string()
90
- .min(1, { message: 'Social Security Deductions ID is required' }),
91
- taxAdvancesAnnualIds: z.array(annualIdSchema),
92
- taxAdvancesRates: z.array(
93
- z.object({
94
- date: z.iso.date(),
95
- rate: z
96
- .number()
97
- .min(0, { message: 'Rate must be at least 0' })
98
- .max(100, { message: 'Rate must be at most 100' }),
99
- }),
100
- ),
101
85
  });
102
86
 
103
87
  type AdminBusinessFormValues = z.infer<typeof adminBusinessFormSchema>;
104
88
 
105
89
  function BusinessAdminSectionFragmentToFormValues(
106
90
  admin?: BusinessAdminSectionFragment,
107
- ): Partial<AdminBusinessFormValues> {
91
+ ): AdminBusinessFormValues {
108
92
  if (!admin || admin.__typename !== 'LtdFinancialEntity' || !admin.adminInfo) {
109
- return {};
93
+ return {} as AdminBusinessFormValues;
110
94
  }
111
95
 
112
96
  return {
113
- registrationDate: admin.adminInfo.registrationDate,
114
- withholdingTaxAnnualIds: admin.adminInfo.withholdingTaxAnnualIds.sort(
115
- (a, b) => b.year - a.year,
116
- ),
117
- withholdingTaxCompanyId: admin.adminInfo.withholdingTaxCompanyId ?? undefined,
118
- socialSecurityEmployerIds: admin.adminInfo.socialSecurityEmployerIds.sort(
119
- (a, b) => b.year - a.year,
120
- ),
121
- socialSecurityDeductionsId: admin.adminInfo.socialSecurityDeductionsId ?? undefined,
122
- taxAdvancesAnnualIds: admin.adminInfo.taxAdvancesAnnualIds.sort((a, b) => b.year - a.year),
123
- taxAdvancesRates: admin.adminInfo.taxAdvancesRates?.map(rate => ({
124
- date: rate.date,
125
- rate: rate.rate * 100,
126
- })),
97
+ withholdingTaxBookNumber: admin.adminInfo.withholdingTaxBookNumber ?? '',
98
+ withholdingTaxFileNumber: admin.adminInfo.withholdingTaxFileNumber ?? '',
99
+ socialSecurityEmployerId: admin.adminInfo.socialSecurityEmployerId ?? '',
100
+ taxAdvancesRate: admin.adminInfo.taxAdvancesRate ?? 0,
101
+ taxAdvancesId: admin.adminInfo.taxAdvancesId ?? '',
102
+ registrationDate: admin.adminInfo.registrationDate ?? '',
127
103
  };
128
104
  }
129
105
 
@@ -131,17 +107,14 @@ function convertFormDataToUpdateAdminBusinessInput(
131
107
  formData: Partial<AdminBusinessFormValues>,
132
108
  ): UpdateAdminBusinessInput {
133
109
  return {
110
+ withholdingTaxBookNumber: formData.withholdingTaxBookNumber,
111
+ withholdingTaxFileNumber: formData.withholdingTaxFileNumber,
112
+ socialSecurityEmployerId: formData.socialSecurityEmployerId,
113
+ taxAdvancesRate: formData.taxAdvancesRate,
114
+ taxAdvancesId: formData.taxAdvancesId,
134
115
  registrationDate: formData.registrationDate
135
- ? formatTimelessDateString(new Date(formData.registrationDate))
116
+ ? (formatTimelessDateString(new Date(formData.registrationDate)) as TimelessDateString)
136
117
  : undefined,
137
- withholdingTaxAnnualIds: formData.withholdingTaxAnnualIds,
138
- withholdingTaxCompanyId: formData.withholdingTaxCompanyId,
139
- socialSecurityEmployerIds: formData.socialSecurityEmployerIds,
140
- taxAdvancesRates: formData.taxAdvancesRates?.map(rate => ({
141
- date: rate.date,
142
- rate: rate.rate / 100,
143
- })) as { date: TimelessDateString; rate: number }[] | undefined,
144
- taxAdvancesAnnualIds: formData.taxAdvancesAnnualIds,
145
118
  };
146
119
  }
147
120
 
@@ -193,58 +166,6 @@ export function AdminBusinessSection({ data, refetchBusiness }: Props): React.Re
193
166
  }
194
167
  }, [admin, form]);
195
168
 
196
- // Make taxAdvancesAnnualIds a controlled field array using RHF's useFieldArray
197
- const {
198
- fields: taxAdvancesFields,
199
- append: appendTaxAdvances,
200
- remove: removeTaxAdvances,
201
- } = useFieldArray({ control: form.control, name: 'taxAdvancesAnnualIds' as const });
202
-
203
- // Make withholdingTaxAnnualIds a controlled field array using RHF's useFieldArray
204
- const {
205
- fields: withholdingTaxFields,
206
- append: appendWithholdingTax,
207
- remove: removeWithholdingTax,
208
- } = useFieldArray({ control: form.control, name: 'withholdingTaxAnnualIds' as const });
209
-
210
- // Make socialSecurityEmployerIds a controlled field array using RHF's useFieldArray
211
- const {
212
- fields: socialSecurityFields,
213
- append: appendSocialSecurity,
214
- remove: removeSocialSecurity,
215
- } = useFieldArray({ control: form.control, name: 'socialSecurityEmployerIds' as const });
216
-
217
- const annualIdActions = {
218
- withholdingTaxAnnualIds: { append: appendWithholdingTax, remove: removeWithholdingTax },
219
- taxAdvancesAnnualIds: { append: appendTaxAdvances, remove: removeTaxAdvances },
220
- socialSecurityEmployerIds: { append: appendSocialSecurity, remove: removeSocialSecurity },
221
- };
222
-
223
- type AnnualIdField = keyof typeof annualIdActions;
224
-
225
- const addAnnualId = (field: AnnualIdField) => {
226
- annualIdActions[field].append({ year: new Date().getFullYear(), id: '' });
227
- };
228
-
229
- const removeAnnualId = (field: AnnualIdField, index: number): void => {
230
- annualIdActions[field].remove(index);
231
- };
232
-
233
- // Make taxAdvancesRates a controlled field array using RHF's useFieldArray
234
- const {
235
- fields: taxAdvancesRateFields,
236
- append: appendTaxAdvancesRate,
237
- remove: removeTaxAdvancesRate,
238
- } = useFieldArray({ control: form.control, name: 'taxAdvancesRates' as const });
239
-
240
- const addRate = () => {
241
- appendTaxAdvancesRate({ date: format(new Date(), 'yyyy-MM-dd'), rate: 0 });
242
- };
243
-
244
- const removeRate = (index: number): void => {
245
- removeTaxAdvancesRate(index);
246
- };
247
-
248
169
  return (
249
170
  <Card>
250
171
  <CardHeader>
@@ -266,13 +187,13 @@ export function AdminBusinessSection({ data, refetchBusiness }: Props): React.Re
266
187
 
267
188
  <FormField
268
189
  control={form.control}
269
- name="withholdingTaxCompanyId"
190
+ name="withholdingTaxBookNumber"
270
191
  render={({ field, fieldState }) => (
271
192
  <FormItem>
272
- <FormLabel>Company Tax ID</FormLabel>
193
+ <FormLabel>Book Number</FormLabel>
273
194
  <FormControl>
274
195
  <Input
275
- placeholder="Enter company ID"
196
+ placeholder="Enter book number"
276
197
  {...field}
277
198
  className={dirtyFieldMarker(fieldState)}
278
199
  />
@@ -282,127 +203,67 @@ export function AdminBusinessSection({ data, refetchBusiness }: Props): React.Re
282
203
  )}
283
204
  />
284
205
 
285
- <div className="space-y-4">
286
- <div className="flex items-center justify-between">
287
- <Label>Annual IDs</Label>
288
- <Button
289
- type="button"
290
- variant="outline"
291
- size="sm"
292
- onClick={() => addAnnualId('withholdingTaxAnnualIds')}
293
- >
294
- <Plus className="size-4" />
295
- </Button>
296
- </div>
297
- <div className="space-y-3">
298
- {withholdingTaxFields.map((field, index) => (
299
- <div key={field.id} className="flex gap-2 items-start">
300
- <div className="flex-1 grid grid-cols-2 gap-2">
301
- <Input
302
- placeholder="Year"
303
- type="number"
304
- {...form.register(`withholdingTaxAnnualIds.${index}.year`, {
305
- valueAsNumber: true,
306
- })}
307
- />
308
- <Input
309
- placeholder="ID"
310
- {...form.register(`withholdingTaxAnnualIds.${index}.id`)}
311
- />
312
- </div>
313
- <Button
314
- type="button"
315
- variant="ghost"
316
- size="icon"
317
- onClick={() => removeAnnualId('withholdingTaxAnnualIds', index)}
318
- >
319
- <X className="size-4" />
320
- </Button>
321
- </div>
322
- ))}
323
- </div>
324
- </div>
206
+ <FormField
207
+ control={form.control}
208
+ name="withholdingTaxFileNumber"
209
+ render={({ field, fieldState }) => (
210
+ <FormItem>
211
+ <FormLabel>File Number</FormLabel>
212
+ <FormControl>
213
+ <Input
214
+ placeholder="Enter file number"
215
+ {...field}
216
+ className={dirtyFieldMarker(fieldState)}
217
+ />
218
+ </FormControl>
219
+ <FormMessage />
220
+ </FormItem>
221
+ )}
222
+ />
325
223
 
326
224
  <Separator className="md:col-span-2" />
327
225
 
328
226
  <h3 className="text-sm font-semibold text-foreground md:col-span-2">Tax Advances</h3>
329
227
 
330
- <div className="space-y-4">
331
- <div className="flex items-center justify-between">
332
- <Label>Annual IDs</Label>
333
- <Button
334
- type="button"
335
- variant="outline"
336
- size="sm"
337
- onClick={() => addAnnualId('taxAdvancesAnnualIds')}
338
- >
339
- <Plus className="size-4" />
340
- </Button>
341
- </div>
342
- <div className="space-y-3">
343
- {taxAdvancesFields.map((field, index) => (
344
- <div key={field.id} className="flex gap-2 items-start">
345
- <div className="flex-1 grid grid-cols-2 gap-2">
346
- <Input
347
- placeholder="Year"
348
- type="number"
349
- {...form.register(`taxAdvancesAnnualIds.${index}.year`, {
350
- valueAsNumber: true,
351
- })}
352
- />
353
- <Input
354
- placeholder="ID"
355
- {...form.register(`taxAdvancesAnnualIds.${index}.id`)}
356
- />
357
- </div>
358
- <Button
359
- type="button"
360
- variant="ghost"
361
- size="icon"
362
- onClick={() => removeAnnualId('taxAdvancesAnnualIds', index)}
363
- >
364
- <X className="size-4" />
365
- </Button>
366
- </div>
367
- ))}
368
- </div>
369
- </div>
228
+ <FormField
229
+ control={form.control}
230
+ name="taxAdvancesId"
231
+ render={({ field, fieldState }) => (
232
+ <FormItem>
233
+ <FormLabel>Identification number</FormLabel>
234
+ <FormControl>
235
+ <Input
236
+ placeholder="Enter tax advances ID"
237
+ {...field}
238
+ className={dirtyFieldMarker(fieldState)}
239
+ />
240
+ </FormControl>
241
+ <FormMessage />
242
+ </FormItem>
243
+ )}
244
+ />
370
245
 
371
- <div className="space-y-4">
372
- <div className="flex items-center justify-between">
373
- <Label>Rates (%)</Label>
374
- <Button type="button" variant="outline" size="sm" onClick={addRate}>
375
- <Plus className="size-4" />
376
- </Button>
377
- </div>
378
- <div className="space-y-3">
379
- {taxAdvancesRateFields.map((field, index) => (
380
- <div key={field.id} className="flex gap-2 items-start">
381
- <div className="flex-1 grid grid-cols-2 gap-2">
382
- <Input
383
- placeholder="Date"
384
- type="date"
385
- {...form.register(`taxAdvancesRates.${index}.date`)}
386
- />
387
- <Input
388
- placeholder="Rate"
389
- {...form.register(`taxAdvancesRates.${index}.rate`, {
390
- valueAsNumber: true,
391
- })}
392
- />
393
- </div>
394
- <Button
395
- type="button"
396
- variant="ghost"
397
- size="icon"
398
- onClick={() => removeRate(index)}
399
- >
400
- <X className="size-4" />
401
- </Button>
402
- </div>
403
- ))}
404
- </div>
405
- </div>
246
+ <FormField
247
+ control={form.control}
248
+ name="taxAdvancesRate"
249
+ render={({ field, fieldState }) => (
250
+ <FormItem>
251
+ <FormLabel>Tax Rate (%)</FormLabel>
252
+ <FormControl>
253
+ <Input
254
+ type="number"
255
+ step="0.01"
256
+ min="0"
257
+ max="100"
258
+ placeholder="Enter tax rate"
259
+ {...field}
260
+ className={dirtyFieldMarker(fieldState)}
261
+ />
262
+ </FormControl>
263
+ <FormMessage />
264
+ </FormItem>
265
+ )}
266
+ />
406
267
 
407
268
  <Separator className="md:col-span-2" />
408
269
 
@@ -410,15 +271,16 @@ export function AdminBusinessSection({ data, refetchBusiness }: Props): React.Re
410
271
  Social Security
411
272
  </h3>
412
273
 
274
+ {/* Social Security Employer ID */}
413
275
  <FormField
414
276
  control={form.control}
415
- name="socialSecurityDeductionsId"
277
+ name="socialSecurityEmployerId"
416
278
  render={({ field, fieldState }) => (
417
279
  <FormItem>
418
- <FormLabel>Deductions ID</FormLabel>
280
+ <FormLabel>Employer Identifier</FormLabel>
419
281
  <FormControl>
420
282
  <Input
421
- placeholder="Enter deductions ID"
283
+ placeholder="Enter employer ID"
422
284
  {...field}
423
285
  className={dirtyFieldMarker(fieldState)}
424
286
  />
@@ -428,47 +290,6 @@ export function AdminBusinessSection({ data, refetchBusiness }: Props): React.Re
428
290
  )}
429
291
  />
430
292
 
431
- <div className="space-y-4">
432
- <div className="flex items-center justify-between">
433
- <Label>Annual Employer IDs</Label>
434
- <Button
435
- type="button"
436
- variant="outline"
437
- size="sm"
438
- onClick={() => addAnnualId('socialSecurityEmployerIds')}
439
- >
440
- <Plus className="size-4" />
441
- </Button>
442
- </div>
443
- <div className="space-y-3">
444
- {socialSecurityFields.map((field, index) => (
445
- <div key={field.id} className="flex gap-2 items-start">
446
- <div className="flex-1 grid grid-cols-2 gap-2">
447
- <Input
448
- placeholder="Year"
449
- type="number"
450
- {...form.register(`socialSecurityEmployerIds.${index}.year`, {
451
- valueAsNumber: true,
452
- })}
453
- />
454
- <Input
455
- placeholder="ID"
456
- {...form.register(`socialSecurityEmployerIds.${index}.id`)}
457
- />
458
- </div>
459
- <Button
460
- type="button"
461
- variant="ghost"
462
- size="icon"
463
- onClick={() => removeAnnualId('socialSecurityEmployerIds', index)}
464
- >
465
- <X className="size-4" />
466
- </Button>
467
- </div>
468
- ))}
469
- </div>
470
- </div>
471
-
472
293
  <Separator className="md:col-span-2" />
473
294
 
474
295
  {/* Business Registration Start Date */}