@accounter/client 0.0.8-alpha-20251029232510-4bc0c8b8c08a26f0c27788725ae584e515236d20 → 0.0.8-alpha-20251029233659-8fb74309c9f1de4f20423db029c5740e2df4bb5d
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/CHANGELOG.md +1 -15
- package/dist/assets/{Checkbox-Cmx4P-eR.js → Checkbox-CSPHEKoR.js} +2 -2
- package/dist/assets/{MultiSelect-tfWMeMsf.js → MultiSelect-CszuVk07.js} +1 -1
- package/dist/assets/{Pagination-p2BVFuhf.js → Pagination-Cp6iKPSu.js} +1 -1
- package/dist/assets/{Progress-BwoJerOb.js → Progress-ByaKYSXX.js} +1 -1
- package/dist/assets/{Table-Cve82Lq5.js → Table-CQ4GTcIY.js} +1 -1
- package/dist/assets/{Typography-CAgQOS4U.js → Typography-Cn08y9HC.js} +1 -1
- package/dist/assets/{YearPickerInput-BPVLgEAY.js → YearPickerInput-BsQymTcP.js} +1 -1
- package/dist/assets/{accordion-Ca5XgpUz.js → accordion-CG93-Cqs.js} +1 -1
- package/dist/assets/accountant-approvals-Dxy1hGw7.js +1 -0
- package/dist/assets/{accounter-table-CBlUbpQl.js → accounter-table-Dgvw-xm_.js} +1 -1
- package/dist/assets/{addDays-ClGDfhvI.js → addDays-Di-hbHs3.js} +1 -1
- package/dist/assets/{all-charges-DV7V8QJ6.js → all-charges-DRl4EcMG.js} +1 -1
- package/dist/assets/{arrow-up-down-DMdWvrmz.js → arrow-up-down-Hh3TlLSU.js} +1 -1
- package/dist/assets/{building-2-Y3dys8Pf.js → building-2-DGfYgfU_.js} +1 -1
- package/dist/assets/business-aamFaOhr.js +27 -0
- package/dist/assets/business-extended-info-CeEMIazB.js +13 -0
- package/dist/assets/{business-header-S5R7Fq8P.js → business-header-BphijNiC.js} +1 -1
- package/dist/assets/business-transactions-filters-DYBvDjKs.js +1 -0
- package/dist/assets/business-transactions-single-B77wu9sA.js +1 -0
- package/dist/assets/business-trip-C1cYIMHX.js +1 -0
- package/dist/assets/{charge-C79C95t6.js → charge-D-99eJ1v.js} +1 -1
- package/dist/assets/{charges-filters-RFRXF1Oa.js → charges-filters-Dxaf2lVd.js} +1 -1
- package/dist/assets/{charges-ledger-validation-DTglElRA.js → charges-ledger-validation-BAY3PYth.js} +1 -1
- package/dist/assets/charges-table-CNWVDMmv.js +62 -0
- package/dist/assets/{chart-2MG3qLL8.js → chart-DM5P1yGj.js} +1 -1
- package/dist/assets/{data-table-pagination-Dhmbf7BR.js → data-table-pagination-TG7sqb1-.js} +1 -1
- package/dist/assets/download-csv-button-jQXIlRax.js +1 -0
- package/dist/assets/{editable-business-trip-BlqinsvU.js → editable-business-trip-DlAsZ0aQ.js} +2 -2
- package/dist/assets/{funnel-B2plvroD.js → funnel-BQEGwl1q.js} +1 -1
- package/dist/assets/{index-Csdsjvrl.js → index--OgMtW-2.js} +2 -2
- package/dist/assets/index-B-USUC2v.js +1 -0
- package/dist/assets/index-BYfofaiM.js +1 -0
- package/dist/assets/{index-C6OmHOHr.js → index-BmZql10x.js} +213 -213
- package/dist/assets/{index-Bs4RBq4h.js → index-CFY-4iKE.js} +1 -1
- package/dist/assets/{index-C4gCwrJJ.js → index-CGQclWiq.js} +1 -1
- package/dist/assets/index-CIY9x3TF.js +6 -0
- package/dist/assets/{index-arYAg9nt.js → index-CJEUQmMx.js} +1 -1
- package/dist/assets/{index-DKZGNBg3.js → index-CXRSu47J.js} +2 -2
- package/dist/assets/{index-DemO-kJJ.js → index-CiXTFJcq.js} +2 -2
- package/dist/assets/{index-CSEktEoZ.js → index-CkIv3Veq.js} +7 -7
- package/dist/assets/{index-BRNnfzgV.js → index-ClzPFBOc.js} +2 -2
- package/dist/assets/{index-qMYyjtmt.js → index-CzEcZ0Dn.js} +2 -2
- package/dist/assets/{index-HG5RXBPG.js → index-D9zE4pLO.js} +1 -1
- package/dist/assets/{index-DZ6Bqs7R.js → index-DKjsW6q7.js} +7 -7
- package/dist/assets/{index-C0ZATVhv.js → index-DOh5XsM3.js} +2 -2
- package/dist/assets/index-DROHY2Kd.js +1 -0
- package/dist/assets/index-DWXHJxFq.css +1 -0
- package/dist/assets/index-DgbPiRkF.js +1 -0
- package/dist/assets/{index-5R7-0kTp.js → index-DkKTDpFK.js} +1 -1
- package/dist/assets/{index-Cn4t95Q9.js → index-DnFwBDCa.js} +1 -1
- package/dist/assets/index-Dt4KpoN0.js +1 -0
- package/dist/assets/{index-BdRubi2c.js → index-IuUe41KG.js} +1 -1
- package/dist/assets/{index-eIVAASqp.js → index-NofRnQ8o.js} +1 -1
- package/dist/assets/{index-P9_YuS6e.js → index-WaN-m0WB.js} +1 -1
- package/dist/assets/index-juMfNCjV.js +1 -0
- package/dist/assets/{index.es-BrfHJ6Yj.js → index.es-BJEu0vdb.js} +1 -1
- package/dist/assets/{insert-business-trip-modal-COXHjjIY.js → insert-business-trip-modal-CXgUJdgl.js} +2 -2
- package/dist/assets/issue-document-BSkWYnI5.js +1 -0
- package/dist/assets/{list-plus-DbuCDPM8.js → list-plus-BlHtPDEN.js} +1 -1
- package/dist/assets/{login-page-ChNFTZLU.js → login-page-DmCLAM1G.js} +1 -1
- package/dist/assets/{match-document-modal-Cp2DKG3j.js → match-document-modal-KjnSxB69.js} +4 -4
- package/dist/assets/{missing-info-charges-IUzXIDY1.js → missing-info-charges-BiEeQwER.js} +1 -1
- package/dist/assets/{modal-CCAYjiOC.js → modal-dLkQjDNz.js} +1 -1
- package/dist/assets/{page-layout-DpwpZHY3.js → page-layout-DxGYaCiw.js} +1 -1
- package/dist/assets/{page-not-found-NbOMK1Jv.js → page-not-found-ChLEFKCs.js} +1 -1
- package/dist/assets/{panel-top-open-CNX1-h4c.js → panel-top-open-CWsfFRNu.js} +1 -1
- package/dist/assets/{pencil-Z4i9z0vF.js → pencil-BEefjySD.js} +1 -1
- package/dist/assets/{report-commentary-row-C4I-ATEX.js → report-commentary-row-Cci0ntye.js} +1 -1
- package/dist/assets/{save-D0kOxdMh.js → save-BkV97OA1.js} +1 -1
- package/dist/assets/similar-transactions-modal-8T9lL2yX.js +1 -0
- package/dist/assets/sub-DdivcKGZ.js +1 -0
- package/dist/assets/subMonths-Kz3NJUOL.js +1 -0
- package/dist/assets/{summary-CkpRtdVA.js → summary-DzLJ6sUY.js} +1 -1
- package/dist/assets/{toggle-expansion-button-Babot8nj.js → toggle-expansion-button-BzVlE1kb.js} +1 -1
- package/dist/assets/tooltip-Ht3m2Q26.js +1 -0
- package/dist/assets/{use-url-query-BSUiacze.js → use-url-query-DV9K0FAR.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/src/app.tsx +108 -0
- package/src/components/business/admin-business-section.tsx +103 -299
- package/src/components/business/index.tsx +1 -33
- package/src/components/business/transactions-section.tsx +2 -24
- package/src/components/{business-ledger → business-transactions}/business-extended-info.tsx +27 -25
- package/src/components/{business-ledger/business-ledger-filters.tsx → business-transactions/business-transactions-filters.tsx} +12 -12
- package/src/components/{business-ledger/business-ledger-single.tsx → business-transactions/business-transactions-single.tsx} +13 -13
- package/src/components/{business-ledger → business-transactions}/download-csv.tsx +25 -25
- package/src/components/{business-ledger → business-transactions}/index.tsx +15 -15
- package/src/components/charges/charge-extended-info.tsx +4 -45
- package/src/components/layout/sidelinks.tsx +2 -2
- package/src/components/ledger-table/columns.tsx +4 -4
- package/src/components/ledger-table/index.tsx +181 -141
- package/src/components/reports/conto/custom-node.tsx +1 -1
- package/src/components/reports/trial-balance-report/trial-balance-report-account.tsx +1 -1
- package/src/components/tags/index.tsx +2 -4
- package/src/components/transactions-table/columns.tsx +9 -9
- package/src/components/transactions-table/index.tsx +21 -43
- package/src/gql/gql.ts +15 -33
- package/src/gql/graphql.ts +423 -234
- package/src/providers/index.tsx +56 -0
- package/src/router/config.tsx +14 -14
- package/src/router/routes.ts +2 -2
- package/dist/assets/accountant-approvals-BXTzXE96.js +0 -1
- package/dist/assets/business-CRd0ns94.js +0 -37
- package/dist/assets/business-extended-info-BKVk3weU.js +0 -13
- package/dist/assets/business-ledger-filters-C_x4y5uJ.js +0 -1
- package/dist/assets/business-ledger-single-Dku8gbU9.js +0 -1
- package/dist/assets/business-trip-CB51p6xt.js +0 -1
- package/dist/assets/charges-table-D3WwcB50.js +0 -62
- package/dist/assets/download-csv-button-BQSz29rY.js +0 -1
- package/dist/assets/index--xgmdJzW.js +0 -1
- package/dist/assets/index-BUJm5I0K.css +0 -1
- package/dist/assets/index-BgLtHIxa.js +0 -1
- package/dist/assets/index-CIdZZL-X.js +0 -1
- package/dist/assets/index-DA3Ccstm.js +0 -1
- package/dist/assets/index-DhRIY5eN.js +0 -1
- package/dist/assets/index-aEEtRfbo.js +0 -1
- package/dist/assets/index-nshyF-PE.js +0 -6
- package/dist/assets/issue-document-CBKTg1VC.js +0 -1
- package/dist/assets/similar-transactions-modal-DgD48GZ2.js +0 -1
- package/dist/assets/sub-BAZr7Qdd.js +0 -1
- package/dist/assets/subMonths-Df-03cZk.js +0 -1
- package/dist/assets/tooltip-DStdzzhK.js +0 -1
- package/src/components/business/balance-section.tsx +0 -26
- package/src/components/business/ledger-section.tsx +0 -49
- package/src/components/ui/pagination.tsx +0 -194
- package/src/providers/index.ts +0 -4
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import type React from 'react';
|
|
4
4
|
import { useEffect, useState } from 'react';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
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
|
-
):
|
|
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
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
-
socialSecurityDeductionsId: formData.socialSecurityDeductionsId,
|
|
141
|
-
taxAdvancesRates: formData.taxAdvancesRates as
|
|
142
|
-
| { date: TimelessDateString; rate: number }[]
|
|
143
|
-
| undefined,
|
|
144
|
-
taxAdvancesAnnualIds: formData.taxAdvancesAnnualIds,
|
|
145
118
|
};
|
|
146
119
|
}
|
|
147
120
|
|
|
@@ -193,75 +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 addAnnualId = (
|
|
218
|
-
field: 'withholdingTaxAnnualIds' | 'taxAdvancesAnnualIds' | 'socialSecurityEmployerIds',
|
|
219
|
-
) => {
|
|
220
|
-
switch (field) {
|
|
221
|
-
case 'withholdingTaxAnnualIds':
|
|
222
|
-
appendWithholdingTax({ year: new Date().getFullYear(), id: '' });
|
|
223
|
-
break;
|
|
224
|
-
case 'taxAdvancesAnnualIds':
|
|
225
|
-
appendTaxAdvances({ year: new Date().getFullYear(), id: '' });
|
|
226
|
-
break;
|
|
227
|
-
case 'socialSecurityEmployerIds':
|
|
228
|
-
appendSocialSecurity({ year: new Date().getFullYear(), id: '' });
|
|
229
|
-
break;
|
|
230
|
-
}
|
|
231
|
-
};
|
|
232
|
-
|
|
233
|
-
const removeAnnualId = (
|
|
234
|
-
field: 'withholdingTaxAnnualIds' | 'taxAdvancesAnnualIds' | 'socialSecurityEmployerIds',
|
|
235
|
-
index: number,
|
|
236
|
-
): void => {
|
|
237
|
-
switch (field) {
|
|
238
|
-
case 'withholdingTaxAnnualIds':
|
|
239
|
-
removeWithholdingTax(index);
|
|
240
|
-
break;
|
|
241
|
-
case 'taxAdvancesAnnualIds':
|
|
242
|
-
removeTaxAdvances(index);
|
|
243
|
-
break;
|
|
244
|
-
case 'socialSecurityEmployerIds':
|
|
245
|
-
removeSocialSecurity(index);
|
|
246
|
-
break;
|
|
247
|
-
}
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
// Make taxAdvancesRates a controlled field array using RHF's useFieldArray
|
|
251
|
-
const {
|
|
252
|
-
fields: taxAdvancesRateFields,
|
|
253
|
-
append: appendTaxAdvancesRate,
|
|
254
|
-
remove: removeTaxAdvancesRate,
|
|
255
|
-
} = useFieldArray({ control: form.control, name: 'taxAdvancesRates' as const });
|
|
256
|
-
|
|
257
|
-
const addRate = () => {
|
|
258
|
-
appendTaxAdvancesRate({ date: format(new Date(), 'yyyy-MM-dd'), rate: 0 });
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
const removeRate = (index: number): void => {
|
|
262
|
-
removeTaxAdvancesRate(index);
|
|
263
|
-
};
|
|
264
|
-
|
|
265
169
|
return (
|
|
266
170
|
<Card>
|
|
267
171
|
<CardHeader>
|
|
@@ -283,13 +187,13 @@ export function AdminBusinessSection({ data, refetchBusiness }: Props): React.Re
|
|
|
283
187
|
|
|
284
188
|
<FormField
|
|
285
189
|
control={form.control}
|
|
286
|
-
name="
|
|
190
|
+
name="withholdingTaxBookNumber"
|
|
287
191
|
render={({ field, fieldState }) => (
|
|
288
192
|
<FormItem>
|
|
289
|
-
<FormLabel>
|
|
193
|
+
<FormLabel>Book Number</FormLabel>
|
|
290
194
|
<FormControl>
|
|
291
195
|
<Input
|
|
292
|
-
placeholder="Enter
|
|
196
|
+
placeholder="Enter book number"
|
|
293
197
|
{...field}
|
|
294
198
|
className={dirtyFieldMarker(fieldState)}
|
|
295
199
|
/>
|
|
@@ -299,127 +203,67 @@ export function AdminBusinessSection({ data, refetchBusiness }: Props): React.Re
|
|
|
299
203
|
)}
|
|
300
204
|
/>
|
|
301
205
|
|
|
302
|
-
<
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
placeholder="Year"
|
|
320
|
-
type="number"
|
|
321
|
-
{...form.register(`withholdingTaxAnnualIds.${index}.year`, {
|
|
322
|
-
valueAsNumber: true,
|
|
323
|
-
})}
|
|
324
|
-
/>
|
|
325
|
-
<Input
|
|
326
|
-
placeholder="ID"
|
|
327
|
-
{...form.register(`withholdingTaxAnnualIds.${index}.id`)}
|
|
328
|
-
/>
|
|
329
|
-
</div>
|
|
330
|
-
<Button
|
|
331
|
-
type="button"
|
|
332
|
-
variant="ghost"
|
|
333
|
-
size="icon"
|
|
334
|
-
onClick={() => removeAnnualId('withholdingTaxAnnualIds', index)}
|
|
335
|
-
>
|
|
336
|
-
<X className="size-4" />
|
|
337
|
-
</Button>
|
|
338
|
-
</div>
|
|
339
|
-
))}
|
|
340
|
-
</div>
|
|
341
|
-
</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
|
+
/>
|
|
342
223
|
|
|
343
224
|
<Separator className="md:col-span-2" />
|
|
344
225
|
|
|
345
226
|
<h3 className="text-sm font-semibold text-foreground md:col-span-2">Tax Advances</h3>
|
|
346
227
|
|
|
347
|
-
<
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
placeholder="Year"
|
|
365
|
-
type="number"
|
|
366
|
-
{...form.register(`taxAdvancesAnnualIds.${index}.year`, {
|
|
367
|
-
valueAsNumber: true,
|
|
368
|
-
})}
|
|
369
|
-
/>
|
|
370
|
-
<Input
|
|
371
|
-
placeholder="ID"
|
|
372
|
-
{...form.register(`taxAdvancesAnnualIds.${index}.id`)}
|
|
373
|
-
/>
|
|
374
|
-
</div>
|
|
375
|
-
<Button
|
|
376
|
-
type="button"
|
|
377
|
-
variant="ghost"
|
|
378
|
-
size="icon"
|
|
379
|
-
onClick={() => removeAnnualId('taxAdvancesAnnualIds', index)}
|
|
380
|
-
>
|
|
381
|
-
<X className="size-4" />
|
|
382
|
-
</Button>
|
|
383
|
-
</div>
|
|
384
|
-
))}
|
|
385
|
-
</div>
|
|
386
|
-
</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
|
+
/>
|
|
387
245
|
|
|
388
|
-
<
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
/>
|
|
410
|
-
</div>
|
|
411
|
-
<Button
|
|
412
|
-
type="button"
|
|
413
|
-
variant="ghost"
|
|
414
|
-
size="icon"
|
|
415
|
-
onClick={() => removeRate(index)}
|
|
416
|
-
>
|
|
417
|
-
<X className="size-4" />
|
|
418
|
-
</Button>
|
|
419
|
-
</div>
|
|
420
|
-
))}
|
|
421
|
-
</div>
|
|
422
|
-
</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
|
+
/>
|
|
423
267
|
|
|
424
268
|
<Separator className="md:col-span-2" />
|
|
425
269
|
|
|
@@ -427,15 +271,16 @@ export function AdminBusinessSection({ data, refetchBusiness }: Props): React.Re
|
|
|
427
271
|
Social Security
|
|
428
272
|
</h3>
|
|
429
273
|
|
|
274
|
+
{/* Social Security Employer ID */}
|
|
430
275
|
<FormField
|
|
431
276
|
control={form.control}
|
|
432
|
-
name="
|
|
277
|
+
name="socialSecurityEmployerId"
|
|
433
278
|
render={({ field, fieldState }) => (
|
|
434
279
|
<FormItem>
|
|
435
|
-
<FormLabel>
|
|
280
|
+
<FormLabel>Employer Identifier</FormLabel>
|
|
436
281
|
<FormControl>
|
|
437
282
|
<Input
|
|
438
|
-
placeholder="Enter
|
|
283
|
+
placeholder="Enter employer ID"
|
|
439
284
|
{...field}
|
|
440
285
|
className={dirtyFieldMarker(fieldState)}
|
|
441
286
|
/>
|
|
@@ -445,47 +290,6 @@ export function AdminBusinessSection({ data, refetchBusiness }: Props): React.Re
|
|
|
445
290
|
)}
|
|
446
291
|
/>
|
|
447
292
|
|
|
448
|
-
<div className="space-y-4">
|
|
449
|
-
<div className="flex items-center justify-between">
|
|
450
|
-
<Label>Annual Employer IDs</Label>
|
|
451
|
-
<Button
|
|
452
|
-
type="button"
|
|
453
|
-
variant="outline"
|
|
454
|
-
size="sm"
|
|
455
|
-
onClick={() => addAnnualId('socialSecurityEmployerIds')}
|
|
456
|
-
>
|
|
457
|
-
<Plus className="size-4" />
|
|
458
|
-
</Button>
|
|
459
|
-
</div>
|
|
460
|
-
<div className="space-y-3">
|
|
461
|
-
{socialSecurityFields.map((field, index) => (
|
|
462
|
-
<div key={field.id} className="flex gap-2 items-start">
|
|
463
|
-
<div className="flex-1 grid grid-cols-2 gap-2">
|
|
464
|
-
<Input
|
|
465
|
-
placeholder="Year"
|
|
466
|
-
type="number"
|
|
467
|
-
{...form.register(`socialSecurityEmployerIds.${index}.year`, {
|
|
468
|
-
valueAsNumber: true,
|
|
469
|
-
})}
|
|
470
|
-
/>
|
|
471
|
-
<Input
|
|
472
|
-
placeholder="ID"
|
|
473
|
-
{...form.register(`socialSecurityEmployerIds.${index}.id`)}
|
|
474
|
-
/>
|
|
475
|
-
</div>
|
|
476
|
-
<Button
|
|
477
|
-
type="button"
|
|
478
|
-
variant="ghost"
|
|
479
|
-
size="icon"
|
|
480
|
-
onClick={() => removeAnnualId('socialSecurityEmployerIds', index)}
|
|
481
|
-
>
|
|
482
|
-
<X className="size-4" />
|
|
483
|
-
</Button>
|
|
484
|
-
</div>
|
|
485
|
-
))}
|
|
486
|
-
</div>
|
|
487
|
-
</div>
|
|
488
|
-
|
|
489
293
|
<Separator className="md:col-span-2" />
|
|
490
294
|
|
|
491
295
|
{/* Business Registration Start Date */}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
ArrowLeftRight,
|
|
4
4
|
Building2,
|
|
5
|
-
ChartLine,
|
|
6
5
|
DollarSign,
|
|
7
6
|
FileCheck,
|
|
8
7
|
FileText,
|
|
9
|
-
Notebook,
|
|
10
8
|
Plug,
|
|
11
9
|
Settings,
|
|
12
10
|
Shield,
|
|
@@ -15,10 +13,8 @@ import {
|
|
|
15
13
|
import { useSearchParams } from 'react-router-dom';
|
|
16
14
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs.js';
|
|
17
15
|
import { getFragmentData, type FragmentType } from '@/gql/index.js';
|
|
18
|
-
import { FiltersContext } from '@/providers/filters-context.js';
|
|
19
16
|
import { BusinessPageFragmentDoc } from '../../gql/graphql.js';
|
|
20
17
|
import { AdminBusinessSection } from './admin-business-section.js';
|
|
21
|
-
import { BalanceSection } from './balance-section.js';
|
|
22
18
|
import { BusinessHeader } from './business-header.js';
|
|
23
19
|
import { ChargesSection } from './charges-section.jsx';
|
|
24
20
|
import { ChartsSection } from './charts-section.jsx';
|
|
@@ -27,7 +23,6 @@ import { ContactInfoSection } from './contact-info-section.jsx';
|
|
|
27
23
|
import { ContractsSection } from './contracts-section.jsx';
|
|
28
24
|
import { DocumentsSection } from './documents-section.jsx';
|
|
29
25
|
import { IntegrationsSection } from './integrations-section.jsx';
|
|
30
|
-
import { LedgerSection } from './ledger-section.js';
|
|
31
26
|
import { TransactionsSection } from './transactions-section.js';
|
|
32
27
|
|
|
33
28
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- used by codegen
|
|
@@ -58,11 +53,6 @@ interface Props {
|
|
|
58
53
|
export default function Business({ data, refetchBusiness }: Props): ReactElement {
|
|
59
54
|
const business = getFragmentData(BusinessPageFragmentDoc, data);
|
|
60
55
|
const [searchParams, setSearchParams] = useSearchParams();
|
|
61
|
-
const { setFiltersContext } = useContext(FiltersContext);
|
|
62
|
-
|
|
63
|
-
useEffect(() => {
|
|
64
|
-
setFiltersContext(null);
|
|
65
|
-
}, [setFiltersContext]);
|
|
66
56
|
|
|
67
57
|
const activeTab = searchParams.get('tab') || 'contact';
|
|
68
58
|
|
|
@@ -119,20 +109,6 @@ export default function Business({ data, refetchBusiness }: Props): ReactElement
|
|
|
119
109
|
<FileText className="h-4 w-4" />
|
|
120
110
|
<span className="hidden sm:inline">Documents</span>
|
|
121
111
|
</TabsTrigger>
|
|
122
|
-
<TabsTrigger
|
|
123
|
-
value="ledger"
|
|
124
|
-
className="flex items-center gap-2 data-[state=active]:bg-background"
|
|
125
|
-
>
|
|
126
|
-
<Notebook className="h-4 w-4" />
|
|
127
|
-
<span className="hidden sm:inline">Ledger</span>
|
|
128
|
-
</TabsTrigger>
|
|
129
|
-
<TabsTrigger
|
|
130
|
-
value="balance"
|
|
131
|
-
className="flex items-center gap-2 data-[state=active]:bg-background"
|
|
132
|
-
>
|
|
133
|
-
<ChartLine className="h-4 w-4" />
|
|
134
|
-
<span className="hidden sm:inline">Balance</span>
|
|
135
|
-
</TabsTrigger>
|
|
136
112
|
{isClient && (
|
|
137
113
|
<>
|
|
138
114
|
<TabsTrigger
|
|
@@ -189,14 +165,6 @@ export default function Business({ data, refetchBusiness }: Props): ReactElement
|
|
|
189
165
|
<DocumentsSection businessId={business.id} />
|
|
190
166
|
</TabsContent>
|
|
191
167
|
|
|
192
|
-
<TabsContent value="ledger" className="mt-0">
|
|
193
|
-
<LedgerSection businessId={business.id} />
|
|
194
|
-
</TabsContent>
|
|
195
|
-
|
|
196
|
-
<TabsContent value="balance" className="mt-0">
|
|
197
|
-
<BalanceSection businessId={business.id} />
|
|
198
|
-
</TabsContent>
|
|
199
|
-
|
|
200
168
|
{isClient && (
|
|
201
169
|
<>
|
|
202
170
|
<TabsContent value="contracts" className="mt-0">
|
|
@@ -1,33 +1,11 @@
|
|
|
1
|
-
import { useQuery } from 'urql';
|
|
2
1
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card.js';
|
|
3
|
-
import {
|
|
4
|
-
import { TransactionsTable } from '../transactions-table';
|
|
2
|
+
import { BusinessExtendedInfo } from '../business-transactions/business-extended-info';
|
|
5
3
|
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- used by codegen
|
|
7
|
-
/* GraphQL */ `
|
|
8
|
-
query BusinessTransactionsSection($businessId: UUID!) {
|
|
9
|
-
transactionsByFinancialEntity(financialEntityID: $businessId) {
|
|
10
|
-
id
|
|
11
|
-
...TransactionForTransactionsTableFields
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
`;
|
|
15
4
|
interface Props {
|
|
16
5
|
businessId: string;
|
|
17
6
|
}
|
|
18
7
|
|
|
19
8
|
export function TransactionsSection({ businessId }: Props) {
|
|
20
|
-
const [{ data, fetching }] = useQuery({
|
|
21
|
-
query: BusinessTransactionsSectionDocument,
|
|
22
|
-
variables: {
|
|
23
|
-
businessId,
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
if (fetching) {
|
|
28
|
-
return <div>Loading transactions...</div>;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
9
|
return (
|
|
32
10
|
<Card>
|
|
33
11
|
<CardHeader className="flex w-full justify-between items-center">
|
|
@@ -40,7 +18,7 @@ export function TransactionsSection({ businessId }: Props) {
|
|
|
40
18
|
</CardHeader>
|
|
41
19
|
<CardContent>
|
|
42
20
|
<div className="rounded-md border">
|
|
43
|
-
<
|
|
21
|
+
<BusinessExtendedInfo businessID={businessId} filter={{}} />
|
|
44
22
|
</div>
|
|
45
23
|
</CardContent>
|
|
46
24
|
</Card>
|