@accounter/client 0.0.8-alpha-20251023065832-9a9f37786b0e29dc8e6ea58ec9856bc043cc0e8a → 0.0.8-alpha-20251023070808-bdd9d09db3d693f2c0061a2bbd66a4bfe5224012
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 -1
- package/dist/assets/{Checkbox-lfqFDKZM.js → Checkbox-Bm30-WRa.js} +2 -2
- package/dist/assets/{Progress-DvGsu87E.js → Progress-DxcT-wYo.js} +1 -1
- package/dist/assets/{Typography-BX4mj53o.js → Typography-CZLHs9y2.js} +1 -1
- package/dist/assets/{accordion-lOk81yKP.js → accordion-_VaDHoQb.js} +1 -1
- package/dist/assets/accountant-approvals-C7GnMLyl.js +1 -0
- package/dist/assets/{all-charges-DhPxcK73.js → all-charges-DS-mdep6.js} +1 -1
- package/dist/assets/{arrow-up-down-CFrneqND.js → arrow-up-down-Bt3_puEZ.js} +1 -1
- package/dist/assets/business-Db4PzgLz.js +42 -0
- package/dist/assets/{business-transactions-single-CJ5pLN-D.js → business-transactions-single-Canul8rR.js} +1 -1
- package/dist/assets/{business-trip-Jlc0bfXC.js → business-trip-x8lljSMP.js} +1 -1
- package/dist/assets/charges-filters-DkO9FBdC.js +1 -0
- package/dist/assets/{charges-ledger-validation-Bln73m_U.js → charges-ledger-validation-wla_aWIc.js} +1 -1
- package/dist/assets/{chart-Wut6cPCx.js → chart-2uS7cQLX.js} +1 -1
- package/dist/assets/{data-table-pagination-BnQGVnmE.js → data-table-pagination-CQQBbtVE.js} +1 -1
- package/dist/assets/{editable-business-trip-CjJg13b0.js → editable-business-trip-D50scoPo.js} +2 -2
- package/dist/assets/{index-y8Z-aJKc.js → index-B20Tn_iF.js} +2 -2
- package/dist/assets/{index-BoSqeUi7.js → index-BJ63UrPP.js} +6 -6
- package/dist/assets/{index-C2INIVq3.js → index-BNPAKzBY.js} +1 -1
- package/dist/assets/index-BP2Hv2J-.js +1 -0
- package/dist/assets/{index-Csqyxwgx.js → index-BTiGhl3N.js} +2 -2
- package/dist/assets/index-BaDl3RPI.js +1 -0
- package/dist/assets/index-BmSAw35b.js +1 -0
- package/dist/assets/{index-CN7VPpiB.js → index-BsGG-RLV.js} +13 -13
- package/dist/assets/index-Bskia9ol.js +1 -0
- package/dist/assets/index-C4JVZBO-.js +1 -0
- package/dist/assets/{index-BX3VSsge.js → index-CDHKPA0l.js} +1 -1
- package/dist/assets/{index-DquDHLbE.js → index-CqZy7PVr.js} +1 -1
- package/dist/assets/index-CzzfC-dD.css +1 -0
- package/dist/assets/index-D2w9iaKk.js +1 -0
- package/dist/assets/index-D5CFY1GF.js +1 -0
- package/dist/assets/index-DBjj2AmF.js +1 -0
- package/dist/assets/index-DJ33tRZ1.js +1 -0
- package/dist/assets/index-DKS2QKOQ.js +1 -0
- package/dist/assets/index-DOKYSdGb.js +1 -0
- package/dist/assets/{index-BagyRbeI.js → index-D_PykgGt.js} +2 -2
- package/dist/assets/index-Dk4NeG4m.js +1 -0
- package/dist/assets/{index-DjSJrgv5.js → index-Dkqd5T8J.js} +2 -2
- package/dist/assets/{index-CVz9TqoS.js → index-IN8Kpfsx.js} +2 -2
- package/dist/assets/index-OqG78rNq.js +9 -0
- package/dist/assets/{index.es-D8leRAY2.js → index.es-DKjfxgqg.js} +1 -1
- package/dist/assets/{issue-document-DKE0dzdE.js → issue-document-BFOjGS-U.js} +1 -1
- package/dist/assets/login-page-CpRailN7.js +1 -0
- package/dist/assets/{missing-info-charges-CgMJ4Bu3.js → missing-info-charges-BnYMeatL.js} +1 -1
- package/dist/assets/page-not-found-BLrYvmf4.js +1 -0
- package/dist/assets/{pencil-CUSCcyVn.js → pencil-DC6M9VTY.js} +1 -1
- package/dist/assets/report-commentary-row-DJPRyQur.js +1 -0
- package/dist/assets/save-Dr3CNkcl.js +11 -0
- package/dist/assets/similar-charges-by-business-modal-CCw5opHn.js +1 -0
- package/dist/assets/sub-DKnwnbwx.js +1 -0
- package/dist/assets/subMonths-B44KizJf.js +1 -0
- package/dist/index.html +2 -2
- package/package.json +2 -2
- package/src/components/business/business-header.tsx +2 -21
- package/src/components/businesses/all-businesses-row.tsx +87 -0
- package/src/components/businesses/cells/hebrew-name.tsx +31 -0
- package/src/components/businesses/cells/index.ts +2 -0
- package/src/components/businesses/cells/name.tsx +31 -0
- package/src/components/businesses/index.tsx +36 -45
- package/src/components/common/forms/business-card.tsx +234 -0
- package/src/components/common/forms/index.ts +1 -0
- package/src/gql/gql.ts +30 -6
- package/src/gql/graphql.ts +30 -7
- package/dist/assets/accountant-approvals-DWLEu1Um.js +0 -1
- package/dist/assets/building-2-Bqvbwz7Q.js +0 -6
- package/dist/assets/business--eNnF4xF.js +0 -42
- package/dist/assets/business-header-DjutqTRC.js +0 -1
- package/dist/assets/charges-filters-C-H07qp1.js +0 -1
- package/dist/assets/index-BE5nnZYY.js +0 -9
- package/dist/assets/index-BQrSA2Kk.js +0 -1
- package/dist/assets/index-BkeJsHyM.js +0 -1
- package/dist/assets/index-BtAgm6J8.js +0 -1
- package/dist/assets/index-BwIQ8ifH.js +0 -1
- package/dist/assets/index-Bxlzprxi.js +0 -1
- package/dist/assets/index-C--YkrHw.js +0 -1
- package/dist/assets/index-CQXFj3Uj.css +0 -1
- package/dist/assets/index-CalcGztb.js +0 -1
- package/dist/assets/index-Dr2UkUOm.js +0 -1
- package/dist/assets/index-E2rO9Bsf.js +0 -1
- package/dist/assets/index-Ggixi4PP.js +0 -1
- package/dist/assets/index-WCosiqtQ.js +0 -1
- package/dist/assets/index-vsZbkVMv.js +0 -1
- package/dist/assets/login-page-BYwtRBMd.js +0 -1
- package/dist/assets/page-not-found-Cfte6bjZ.js +0 -1
- package/dist/assets/report-commentary-row-B-uxVnyO.js +0 -1
- package/dist/assets/save-qyt28nOG.js +0 -6
- package/dist/assets/sub-LLu8afpC.js +0 -1
- package/dist/assets/subMonths-C1UIPrOU.js +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { useCallback, useContext, useEffect, useState, type ReactElement } from 'react';
|
|
2
2
|
import { Loader2, PanelTopClose, PanelTopOpen } from 'lucide-react';
|
|
3
|
-
import { useNavigate } from 'react-router-dom';
|
|
4
3
|
import { useQuery } from 'urql';
|
|
5
|
-
import { Tooltip } from '@mantine/core';
|
|
6
|
-
import {
|
|
4
|
+
import { Table, Tooltip } from '@mantine/core';
|
|
5
|
+
import {
|
|
6
|
+
AllBusinessesForScreenDocument,
|
|
7
|
+
type AllBusinessesForScreenQuery,
|
|
8
|
+
} from '../../gql/graphql.js';
|
|
7
9
|
import { useUrlQuery } from '../../hooks/use-url-query.js';
|
|
8
10
|
import { cn } from '../../lib/utils.js';
|
|
9
11
|
import { FiltersContext } from '../../providers/filters-context.js';
|
|
10
|
-
import { ROUTES } from '../../router/routes.js';
|
|
11
|
-
import { BusinessHeader } from '../business/business-header.js';
|
|
12
12
|
import { MergeBusinessesButton } from '../common/index.js';
|
|
13
13
|
import { PageLayout } from '../layout/page-layout.js';
|
|
14
14
|
import { Button } from '../ui/button.js';
|
|
15
|
-
import {
|
|
15
|
+
import { AllBusinessesRow } from './all-businesses-row.js';
|
|
16
16
|
import { BusinessesFilters } from './businesses-filters.js';
|
|
17
17
|
|
|
18
18
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- used by codegen
|
|
@@ -24,7 +24,7 @@ import { BusinessesFilters } from './businesses-filters.js';
|
|
|
24
24
|
id
|
|
25
25
|
name
|
|
26
26
|
... on LtdFinancialEntity {
|
|
27
|
-
...
|
|
27
|
+
...AllBusinessesRowFields
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
pageInfo {
|
|
@@ -52,7 +52,6 @@ export const Businesses = (): ReactElement => {
|
|
|
52
52
|
},
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
-
const navigate = useNavigate();
|
|
56
55
|
const [mergeSelectedBusinesses, setMergeSelectedBusinesses] = useState<
|
|
57
56
|
Array<{ id: string; onChange: () => void }>
|
|
58
57
|
>([]);
|
|
@@ -128,43 +127,35 @@ export const Businesses = (): ReactElement => {
|
|
|
128
127
|
<Loader2 className={cn('h-10 w-10 animate-spin mr-2')} />
|
|
129
128
|
</div>
|
|
130
129
|
) : (
|
|
131
|
-
<
|
|
132
|
-
|
|
133
|
-
<
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}}
|
|
161
|
-
>
|
|
162
|
-
<BusinessHeader data={business} />
|
|
163
|
-
</div>
|
|
164
|
-
</div>
|
|
165
|
-
</div>
|
|
166
|
-
))}
|
|
167
|
-
</div>
|
|
130
|
+
<Table striped highlightOnHover>
|
|
131
|
+
<thead className="sticky top-0 z-20">
|
|
132
|
+
<tr className="px-10 py-10 title-font tracking-wider font-medium text-gray-900 text-sm bg-gray-100 rounded-tl rounded-bl">
|
|
133
|
+
<th>Name</th>
|
|
134
|
+
<th>Hebrew Name</th>
|
|
135
|
+
<th>More Info</th>
|
|
136
|
+
</tr>
|
|
137
|
+
</thead>
|
|
138
|
+
<tbody>
|
|
139
|
+
{businesses.map(business => (
|
|
140
|
+
<AllBusinessesRow
|
|
141
|
+
key={business.id}
|
|
142
|
+
data={
|
|
143
|
+
business as Extract<
|
|
144
|
+
NonNullable<AllBusinessesForScreenQuery['allBusinesses']>['nodes'][number],
|
|
145
|
+
{ __typename: 'LtdFinancialEntity' }
|
|
146
|
+
>
|
|
147
|
+
}
|
|
148
|
+
isAllOpened={isAllOpened}
|
|
149
|
+
toggleMergeBusiness={
|
|
150
|
+
toggleMergeBusiness
|
|
151
|
+
? (onChange: () => void): void => toggleMergeBusiness(business.id, onChange)
|
|
152
|
+
: undefined
|
|
153
|
+
}
|
|
154
|
+
isSelectedForMerge={selectedIds.has(business.id) ?? false}
|
|
155
|
+
/>
|
|
156
|
+
))}
|
|
157
|
+
</tbody>
|
|
158
|
+
</Table>
|
|
168
159
|
)}
|
|
169
160
|
</PageLayout>
|
|
170
161
|
);
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { useContext, useEffect, useState, type ReactElement } from 'react';
|
|
2
|
+
import { useForm, type SubmitHandler } from 'react-hook-form';
|
|
3
|
+
import { useQuery, type UseQueryExecute } from 'urql';
|
|
4
|
+
import { Loader } from '@mantine/core';
|
|
5
|
+
import {
|
|
6
|
+
FetchBusinessDocument,
|
|
7
|
+
type AllBusinessesRowFieldsFragment,
|
|
8
|
+
type FetchBusinessQuery,
|
|
9
|
+
type UpdateBusinessInput,
|
|
10
|
+
} from '../../../gql/graphql.js';
|
|
11
|
+
import { relevantDataPicker, type MakeBoolean } from '../../../helpers/index.js';
|
|
12
|
+
import { useUpdateBusiness } from '../../../hooks/use-update-business.js';
|
|
13
|
+
import { UserContext } from '../../../providers/user-provider.js';
|
|
14
|
+
import { Form } from '../../ui/form.js';
|
|
15
|
+
import { CopyToClipboardButton, SimilarChargesByBusinessModal } from '../index.js';
|
|
16
|
+
import { ModifyBusinessFields } from './modify-business-fields.js';
|
|
17
|
+
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- used by codegen
|
|
19
|
+
/* GraphQL */ `
|
|
20
|
+
query FetchBusiness($id: UUID!) {
|
|
21
|
+
business(id: $id) {
|
|
22
|
+
__typename
|
|
23
|
+
id
|
|
24
|
+
... on LtdFinancialEntity {
|
|
25
|
+
country
|
|
26
|
+
address
|
|
27
|
+
email
|
|
28
|
+
exemptDealer
|
|
29
|
+
governmentId
|
|
30
|
+
hebrewName
|
|
31
|
+
name
|
|
32
|
+
phoneNumber
|
|
33
|
+
sortCode {
|
|
34
|
+
id
|
|
35
|
+
key
|
|
36
|
+
name
|
|
37
|
+
}
|
|
38
|
+
taxCategory {
|
|
39
|
+
id
|
|
40
|
+
name
|
|
41
|
+
}
|
|
42
|
+
website
|
|
43
|
+
suggestions {
|
|
44
|
+
phrases
|
|
45
|
+
tags {
|
|
46
|
+
id
|
|
47
|
+
name
|
|
48
|
+
}
|
|
49
|
+
description
|
|
50
|
+
emails
|
|
51
|
+
emailListener {
|
|
52
|
+
internalEmailLinks
|
|
53
|
+
emailBody
|
|
54
|
+
attachments
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
optionalVAT
|
|
58
|
+
irsCode
|
|
59
|
+
pcn874RecordType
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
`;
|
|
64
|
+
|
|
65
|
+
interface Props {
|
|
66
|
+
businessID: string;
|
|
67
|
+
updateBusiness: React.Dispatch<React.SetStateAction<AllBusinessesRowFieldsFragment>>;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function BusinessCard({ businessID, updateBusiness }: Props): ReactElement {
|
|
71
|
+
const [business, setBusiness] = useState<
|
|
72
|
+
Extract<FetchBusinessQuery['business'], { __typename: 'LtdFinancialEntity' }> | undefined
|
|
73
|
+
>(undefined);
|
|
74
|
+
|
|
75
|
+
// Form business data handle
|
|
76
|
+
const [{ data, fetching: businessFetching }, refetchBusiness] = useQuery({
|
|
77
|
+
query: FetchBusinessDocument,
|
|
78
|
+
variables: {
|
|
79
|
+
id: businessID,
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
if (businessFetching) {
|
|
85
|
+
setBusiness(undefined);
|
|
86
|
+
} else if (data && data.business.__typename === 'LtdFinancialEntity') {
|
|
87
|
+
setBusiness(data.business);
|
|
88
|
+
}
|
|
89
|
+
}, [data, businessFetching]);
|
|
90
|
+
|
|
91
|
+
// on every business successful fetch, update the business in the parent component
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
if (business) {
|
|
94
|
+
updateBusiness(business);
|
|
95
|
+
}
|
|
96
|
+
}, [business, updateBusiness]);
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<div className="flex flex-col gap-5">
|
|
100
|
+
{business ? (
|
|
101
|
+
<BusinessCardContent business={business} refetchBusiness={refetchBusiness} />
|
|
102
|
+
) : businessFetching ? (
|
|
103
|
+
<Loader className="flex self-center my-5" color="dark" size="xl" variant="dots" />
|
|
104
|
+
) : (
|
|
105
|
+
<p>Error fetching extended information for this business</p>
|
|
106
|
+
)}
|
|
107
|
+
</div>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
interface ContentProps {
|
|
112
|
+
business: Extract<FetchBusinessQuery['business'], { __typename: 'LtdFinancialEntity' }>;
|
|
113
|
+
refetchBusiness: UseQueryExecute;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function BusinessCardContent({ business, refetchBusiness }: ContentProps): ReactElement {
|
|
117
|
+
const [fetching, setFetching] = useState<boolean>(false);
|
|
118
|
+
const [similarChargesOpen, setSimilarChargesOpen] = useState(false);
|
|
119
|
+
const [similarChargesData, setSimilarChargesData] = useState<
|
|
120
|
+
| {
|
|
121
|
+
tagIds?: { id: string }[];
|
|
122
|
+
description?: string;
|
|
123
|
+
}
|
|
124
|
+
| undefined
|
|
125
|
+
>(undefined);
|
|
126
|
+
const { userContext } = useContext(UserContext);
|
|
127
|
+
|
|
128
|
+
const { updateBusiness: updateDbBusiness, fetching: isBusinessLoading } = useUpdateBusiness();
|
|
129
|
+
|
|
130
|
+
// form management
|
|
131
|
+
const formManager = useForm<UpdateBusinessInput>({
|
|
132
|
+
defaultValues: {
|
|
133
|
+
...business,
|
|
134
|
+
taxCategory: business.taxCategory?.id,
|
|
135
|
+
sortCode: business?.sortCode?.key,
|
|
136
|
+
irsCode: business?.irsCode,
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
const {
|
|
141
|
+
handleSubmit: handleBusinessSubmit,
|
|
142
|
+
formState: { dirtyFields: dirtyBusinessFields },
|
|
143
|
+
} = formManager;
|
|
144
|
+
|
|
145
|
+
const onBusinessSubmit: SubmitHandler<UpdateBusinessInput> = async data => {
|
|
146
|
+
if (!business || !userContext?.context.adminBusinessId) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const dataToUpdate = relevantDataPicker(data, dirtyBusinessFields as MakeBoolean<typeof data>);
|
|
151
|
+
if (dataToUpdate && Object.keys(dataToUpdate).length > 0) {
|
|
152
|
+
dataToUpdate.sortCode &&= parseInt(dataToUpdate.sortCode.toString());
|
|
153
|
+
|
|
154
|
+
if (dataToUpdate.suggestions?.tags) {
|
|
155
|
+
dataToUpdate.suggestions.tags = dataToUpdate.suggestions.tags.map(tag => ({ id: tag.id }));
|
|
156
|
+
}
|
|
157
|
+
if (dataToUpdate.suggestions?.phrases) {
|
|
158
|
+
dataToUpdate.suggestions.phrases = data.suggestions!.phrases!.map(phrase => phrase);
|
|
159
|
+
}
|
|
160
|
+
if (dataToUpdate.suggestions?.emails) {
|
|
161
|
+
dataToUpdate.suggestions.emails = data.suggestions!.emails!.map(email => email);
|
|
162
|
+
}
|
|
163
|
+
if (dataToUpdate.suggestions?.emailListener) {
|
|
164
|
+
dataToUpdate.suggestions.emailListener.attachments &&=
|
|
165
|
+
data.suggestions!.emailListener!.attachments!.map(type => type);
|
|
166
|
+
dataToUpdate.suggestions.emailListener.internalEmailLinks &&=
|
|
167
|
+
data.suggestions!.emailListener!.internalEmailLinks!.map(link => link);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
await updateDbBusiness({
|
|
171
|
+
businessId: business.id,
|
|
172
|
+
ownerId: userContext.context.adminBusinessId,
|
|
173
|
+
fields: dataToUpdate,
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
if (dataToUpdate.suggestions?.tags?.length || dataToUpdate.suggestions?.description) {
|
|
177
|
+
setSimilarChargesData({
|
|
178
|
+
tagIds: dataToUpdate.suggestions?.tags?.map(t => ({ id: t.id })),
|
|
179
|
+
description: dataToUpdate.suggestions?.description ?? undefined,
|
|
180
|
+
});
|
|
181
|
+
setSimilarChargesOpen(true);
|
|
182
|
+
} else {
|
|
183
|
+
refetchBusiness();
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
return (
|
|
189
|
+
<>
|
|
190
|
+
{fetching && (
|
|
191
|
+
<Loader className="flex self-center my-5" color="dark" size="xl" variant="dots" />
|
|
192
|
+
)}
|
|
193
|
+
<div className="flex flex-row gap-5">
|
|
194
|
+
<Form {...formManager}>
|
|
195
|
+
<form onSubmit={handleBusinessSubmit(onBusinessSubmit)}>
|
|
196
|
+
<div className="flex flex-row mx-3 pt-3 sm:text-1xl gap-10">
|
|
197
|
+
<h1 className="sm:text-2xl font-small text-gray-900">Edit Business:</h1>
|
|
198
|
+
<div className="flex flex-row gap-2">
|
|
199
|
+
ID: {business.id}
|
|
200
|
+
<CopyToClipboardButton content={business.id} />
|
|
201
|
+
</div>
|
|
202
|
+
</div>
|
|
203
|
+
<div className="flex-row px-10 h-max justify-start block">
|
|
204
|
+
<ModifyBusinessFields
|
|
205
|
+
isInsert={false}
|
|
206
|
+
formManager={formManager}
|
|
207
|
+
setFetching={setFetching}
|
|
208
|
+
/>
|
|
209
|
+
</div>
|
|
210
|
+
<div className="mt-10 mb-5 flex justify-center gap-5">
|
|
211
|
+
<button
|
|
212
|
+
type="submit"
|
|
213
|
+
onClick={(): (() => Promise<void>) => handleBusinessSubmit(onBusinessSubmit)}
|
|
214
|
+
className="mt-8 text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-indigo-600 rounded-sm text-lg"
|
|
215
|
+
disabled={isBusinessLoading || Object.keys(dirtyBusinessFields).length === 0}
|
|
216
|
+
>
|
|
217
|
+
Update
|
|
218
|
+
</button>
|
|
219
|
+
</div>
|
|
220
|
+
</form>
|
|
221
|
+
</Form>
|
|
222
|
+
</div>
|
|
223
|
+
|
|
224
|
+
<SimilarChargesByBusinessModal
|
|
225
|
+
businessId={business.id}
|
|
226
|
+
tagIds={similarChargesData?.tagIds}
|
|
227
|
+
description={similarChargesData?.description}
|
|
228
|
+
open={similarChargesOpen}
|
|
229
|
+
onOpenChange={setSimilarChargesOpen}
|
|
230
|
+
onClose={refetchBusiness}
|
|
231
|
+
/>
|
|
232
|
+
</>
|
|
233
|
+
);
|
|
234
|
+
}
|
package/src/gql/gql.ts
CHANGED
|
@@ -22,7 +22,7 @@ type Documents = {
|
|
|
22
22
|
"\n query EditableBusinessTrip($businessTripId: UUID!) {\n businessTrip(id: $businessTripId) {\n id\n ...BusinessTripReportHeaderFields\n ...BusinessTripReportAttendeesFields\n ...BusinessTripUncategorizedTransactionsFields\n ...BusinessTripReportFlightsFields\n ...BusinessTripReportAccommodationsFields\n ...BusinessTripReportTravelAndSubsistenceFields\n ...BusinessTripReportCarRentalFields\n ...BusinessTripReportOtherFields\n ...BusinessTripReportSummaryFields\n ... on BusinessTrip {\n uncategorizedTransactions {\n transaction {\n id\n }\n }\n }\n }\n }\n": typeof types.EditableBusinessTripDocument,
|
|
23
23
|
"\n query BusinessTripsScreen {\n allBusinessTrips {\n id\n name\n dates {\n start\n }\n ...BusinessTripsRowFields\n }\n }\n": typeof types.BusinessTripsScreenDocument,
|
|
24
24
|
"\n fragment BusinessAdminSection on Business {\n id\n ... on LtdFinancialEntity {\n adminInfo {\n id\n employerWithholdingTaxAccountNumber\n taxPrepaymentId\n nationalInsuranceEmployerId\n advanceTaxRate\n registrationDate\n }\n }\n }\n": typeof types.BusinessAdminSectionFragmentDoc,
|
|
25
|
-
"\n fragment BusinessHeader on Business {\n __typename\n id\n name\n createdAt\n
|
|
25
|
+
"\n fragment BusinessHeader on Business {\n __typename\n id\n name\n createdAt\n ... on LtdFinancialEntity {\n governmentId\n }\n }\n": typeof types.BusinessHeaderFragmentDoc,
|
|
26
26
|
"\n query BusinessChargesSection($page: Int, $limit: Int, $filters: ChargeFilter) {\n allCharges(page: $page, limit: $limit, filters: $filters) {\n nodes {\n id\n ...ChargesTableFields\n }\n pageInfo {\n totalPages\n }\n }\n }\n": typeof types.BusinessChargesSectionDocument,
|
|
27
27
|
"\n fragment BusinessConfigurationSection on Business {\n __typename\n id\n pcn874RecordType\n irsCode\n isActive\n ... on LtdFinancialEntity {\n optionalVAT\n exemptDealer\n isReceiptEnough\n isDocumentsOptional\n sortCode {\n id\n key\n defaultIrsCode\n }\n taxCategory {\n id\n }\n suggestions {\n phrases\n emails\n tags {\n id\n }\n description\n emailListener {\n internalEmailLinks\n emailBody\n attachments\n }\n }\n clientInfo {\n id\n }\n }\n }\n": typeof types.BusinessConfigurationSectionFragmentDoc,
|
|
28
28
|
"\n fragment BusinessContactSection on Business {\n __typename\n id\n ... on LtdFinancialEntity {\n name\n hebrewName\n country\n governmentId\n address\n email\n # localAddress\n phoneNumber\n website\n clientInfo {\n id\n emails\n }\n }\n }\n": typeof types.BusinessContactSectionFragmentDoc,
|
|
@@ -30,7 +30,10 @@ type Documents = {
|
|
|
30
30
|
"\n fragment BusinessPage on Business {\n id\n ... on LtdFinancialEntity {\n clientInfo {\n id\n }\n adminInfo {\n id\n }\n }\n ...ClientIntegrationsSection\n ...BusinessHeader\n ...BusinessContactSection\n ...BusinessConfigurationSection\n ...BusinessAdminSection\n }\n": typeof types.BusinessPageFragmentDoc,
|
|
31
31
|
"\n fragment ClientIntegrationsSection on LtdFinancialEntity {\n id\n clientInfo {\n id\n greenInvoiceId\n hiveId\n }\n }\n": typeof types.ClientIntegrationsSectionFragmentDoc,
|
|
32
32
|
"\n query ClientIntegrationsSectionGreenInvoice($clientId: UUID!) {\n greenInvoiceClient(clientId: $clientId) {\n id\n country\n emails\n name\n phone\n taxId\n address\n city\n zip\n fax\n mobile\n }\n }\n": typeof types.ClientIntegrationsSectionGreenInvoiceDocument,
|
|
33
|
-
"\n
|
|
33
|
+
"\n fragment AllBusinessesRowFields on LtdFinancialEntity {\n id\n ...AllBusinessesNameFields\n ...AllBusinessesHebrewNameFields\n }\n": typeof types.AllBusinessesRowFieldsFragmentDoc,
|
|
34
|
+
"\n fragment AllBusinessesHebrewNameFields on LtdFinancialEntity {\n id\n hebrewName\n }\n": typeof types.AllBusinessesHebrewNameFieldsFragmentDoc,
|
|
35
|
+
"\n fragment AllBusinessesNameFields on LtdFinancialEntity {\n id\n name\n }\n": typeof types.AllBusinessesNameFieldsFragmentDoc,
|
|
36
|
+
"\n query AllBusinessesForScreen($page: Int, $limit: Int, $name: String) {\n allBusinesses(page: $page, limit: $limit, name: $name) {\n nodes {\n __typename\n id\n name\n ... on LtdFinancialEntity {\n ...AllBusinessesRowFields\n }\n }\n pageInfo {\n totalPages\n }\n }\n }\n": typeof types.AllBusinessesForScreenDocument,
|
|
34
37
|
"\n query ChargesLedgerValidation($limit: Int, $filters: ChargeFilter) {\n chargesWithLedgerChanges(limit: $limit, filters: $filters) @stream {\n progress\n charge {\n id\n ...ChargesTableFields\n }\n }\n }\n": typeof types.ChargesLedgerValidationDocument,
|
|
35
38
|
"\n fragment ChargesTableAccountantApprovalFields on Charge {\n id\n accountantApproval\n }\n": typeof types.ChargesTableAccountantApprovalFieldsFragmentDoc,
|
|
36
39
|
"\n fragment ChargesTableAmountFields on Charge {\n __typename\n id\n totalAmount {\n raw\n formatted\n }\n ... on CreditcardBankCharge @defer {\n validCreditCardAmount\n }\n }\n": typeof types.ChargesTableAmountFieldsFragmentDoc,
|
|
@@ -88,6 +91,7 @@ type Documents = {
|
|
|
88
91
|
"\n fragment DocumentsToMatchFields on Document {\n id\n __typename\n charge {\n id\n }\n image\n file\n documentType\n ... on FinancialDocument {\n creditor {\n id\n name\n }\n serialNumber\n date\n amount {\n raw\n formatted\n currency\n }\n }\n }\n": typeof types.DocumentsToMatchFieldsFragmentDoc,
|
|
89
92
|
"\n query RecentBusinessIssuedDocuments($businessId: UUID!, $limit: Int) {\n recentDocumentsByBusiness(businessId: $businessId, limit: $limit) {\n id\n ... on FinancialDocument {\n issuedDocumentInfo {\n id\n status\n externalId\n }\n }\n ...TableDocumentsRowFields\n }\n }\n": typeof types.RecentBusinessIssuedDocumentsDocument,
|
|
90
93
|
"\n query RecentIssuedDocumentsOfSameType($documentType: DocumentType!) {\n recentIssuedDocumentsByType(documentType: $documentType) {\n id\n ...TableDocumentsRowFields\n }\n }\n": typeof types.RecentIssuedDocumentsOfSameTypeDocument,
|
|
94
|
+
"\n query FetchBusiness($id: UUID!) {\n business(id: $id) {\n __typename\n id\n ... on LtdFinancialEntity {\n country\n address\n email\n exemptDealer\n governmentId\n hebrewName\n name\n phoneNumber\n sortCode {\n id\n key\n name\n }\n taxCategory {\n id\n name\n }\n website\n suggestions {\n phrases\n tags {\n id\n name\n }\n description\n emails\n emailListener {\n internalEmailLinks\n emailBody\n attachments\n }\n }\n optionalVAT\n irsCode\n pcn874RecordType\n }\n }\n }\n": typeof types.FetchBusinessDocument,
|
|
91
95
|
"\n query EditDocument($documentId: UUID!) {\n documentById(documentId: $documentId) {\n id\n image\n file\n documentType\n __typename\n ... on FinancialDocument {\n vat {\n raw\n currency\n }\n serialNumber\n date\n amount {\n raw\n currency\n }\n debtor {\n id\n name\n }\n creditor {\n id\n name\n }\n vatReportDateOverride\n noVatAmount\n allocationNumber\n exchangeRateOverride\n }\n }\n }\n": typeof types.EditDocumentDocument,
|
|
92
96
|
"\n fragment EditMiscExpenseFields on MiscExpense {\n id\n amount {\n raw\n currency\n }\n description\n invoiceDate\n valueDate\n creditor {\n id\n }\n debtor {\n id\n }\n }\n": typeof types.EditMiscExpenseFieldsFragmentDoc,
|
|
93
97
|
"\n fragment EditTagFields on Tag {\n id\n name\n parent {\n id\n name\n }\n }\n": typeof types.EditTagFieldsFragmentDoc,
|
|
@@ -274,7 +278,7 @@ const documents: Documents = {
|
|
|
274
278
|
"\n query EditableBusinessTrip($businessTripId: UUID!) {\n businessTrip(id: $businessTripId) {\n id\n ...BusinessTripReportHeaderFields\n ...BusinessTripReportAttendeesFields\n ...BusinessTripUncategorizedTransactionsFields\n ...BusinessTripReportFlightsFields\n ...BusinessTripReportAccommodationsFields\n ...BusinessTripReportTravelAndSubsistenceFields\n ...BusinessTripReportCarRentalFields\n ...BusinessTripReportOtherFields\n ...BusinessTripReportSummaryFields\n ... on BusinessTrip {\n uncategorizedTransactions {\n transaction {\n id\n }\n }\n }\n }\n }\n": types.EditableBusinessTripDocument,
|
|
275
279
|
"\n query BusinessTripsScreen {\n allBusinessTrips {\n id\n name\n dates {\n start\n }\n ...BusinessTripsRowFields\n }\n }\n": types.BusinessTripsScreenDocument,
|
|
276
280
|
"\n fragment BusinessAdminSection on Business {\n id\n ... on LtdFinancialEntity {\n adminInfo {\n id\n employerWithholdingTaxAccountNumber\n taxPrepaymentId\n nationalInsuranceEmployerId\n advanceTaxRate\n registrationDate\n }\n }\n }\n": types.BusinessAdminSectionFragmentDoc,
|
|
277
|
-
"\n fragment BusinessHeader on Business {\n __typename\n id\n name\n createdAt\n
|
|
281
|
+
"\n fragment BusinessHeader on Business {\n __typename\n id\n name\n createdAt\n ... on LtdFinancialEntity {\n governmentId\n }\n }\n": types.BusinessHeaderFragmentDoc,
|
|
278
282
|
"\n query BusinessChargesSection($page: Int, $limit: Int, $filters: ChargeFilter) {\n allCharges(page: $page, limit: $limit, filters: $filters) {\n nodes {\n id\n ...ChargesTableFields\n }\n pageInfo {\n totalPages\n }\n }\n }\n": types.BusinessChargesSectionDocument,
|
|
279
283
|
"\n fragment BusinessConfigurationSection on Business {\n __typename\n id\n pcn874RecordType\n irsCode\n isActive\n ... on LtdFinancialEntity {\n optionalVAT\n exemptDealer\n isReceiptEnough\n isDocumentsOptional\n sortCode {\n id\n key\n defaultIrsCode\n }\n taxCategory {\n id\n }\n suggestions {\n phrases\n emails\n tags {\n id\n }\n description\n emailListener {\n internalEmailLinks\n emailBody\n attachments\n }\n }\n clientInfo {\n id\n }\n }\n }\n": types.BusinessConfigurationSectionFragmentDoc,
|
|
280
284
|
"\n fragment BusinessContactSection on Business {\n __typename\n id\n ... on LtdFinancialEntity {\n name\n hebrewName\n country\n governmentId\n address\n email\n # localAddress\n phoneNumber\n website\n clientInfo {\n id\n emails\n }\n }\n }\n": types.BusinessContactSectionFragmentDoc,
|
|
@@ -282,7 +286,10 @@ const documents: Documents = {
|
|
|
282
286
|
"\n fragment BusinessPage on Business {\n id\n ... on LtdFinancialEntity {\n clientInfo {\n id\n }\n adminInfo {\n id\n }\n }\n ...ClientIntegrationsSection\n ...BusinessHeader\n ...BusinessContactSection\n ...BusinessConfigurationSection\n ...BusinessAdminSection\n }\n": types.BusinessPageFragmentDoc,
|
|
283
287
|
"\n fragment ClientIntegrationsSection on LtdFinancialEntity {\n id\n clientInfo {\n id\n greenInvoiceId\n hiveId\n }\n }\n": types.ClientIntegrationsSectionFragmentDoc,
|
|
284
288
|
"\n query ClientIntegrationsSectionGreenInvoice($clientId: UUID!) {\n greenInvoiceClient(clientId: $clientId) {\n id\n country\n emails\n name\n phone\n taxId\n address\n city\n zip\n fax\n mobile\n }\n }\n": types.ClientIntegrationsSectionGreenInvoiceDocument,
|
|
285
|
-
"\n
|
|
289
|
+
"\n fragment AllBusinessesRowFields on LtdFinancialEntity {\n id\n ...AllBusinessesNameFields\n ...AllBusinessesHebrewNameFields\n }\n": types.AllBusinessesRowFieldsFragmentDoc,
|
|
290
|
+
"\n fragment AllBusinessesHebrewNameFields on LtdFinancialEntity {\n id\n hebrewName\n }\n": types.AllBusinessesHebrewNameFieldsFragmentDoc,
|
|
291
|
+
"\n fragment AllBusinessesNameFields on LtdFinancialEntity {\n id\n name\n }\n": types.AllBusinessesNameFieldsFragmentDoc,
|
|
292
|
+
"\n query AllBusinessesForScreen($page: Int, $limit: Int, $name: String) {\n allBusinesses(page: $page, limit: $limit, name: $name) {\n nodes {\n __typename\n id\n name\n ... on LtdFinancialEntity {\n ...AllBusinessesRowFields\n }\n }\n pageInfo {\n totalPages\n }\n }\n }\n": types.AllBusinessesForScreenDocument,
|
|
286
293
|
"\n query ChargesLedgerValidation($limit: Int, $filters: ChargeFilter) {\n chargesWithLedgerChanges(limit: $limit, filters: $filters) @stream {\n progress\n charge {\n id\n ...ChargesTableFields\n }\n }\n }\n": types.ChargesLedgerValidationDocument,
|
|
287
294
|
"\n fragment ChargesTableAccountantApprovalFields on Charge {\n id\n accountantApproval\n }\n": types.ChargesTableAccountantApprovalFieldsFragmentDoc,
|
|
288
295
|
"\n fragment ChargesTableAmountFields on Charge {\n __typename\n id\n totalAmount {\n raw\n formatted\n }\n ... on CreditcardBankCharge @defer {\n validCreditCardAmount\n }\n }\n": types.ChargesTableAmountFieldsFragmentDoc,
|
|
@@ -340,6 +347,7 @@ const documents: Documents = {
|
|
|
340
347
|
"\n fragment DocumentsToMatchFields on Document {\n id\n __typename\n charge {\n id\n }\n image\n file\n documentType\n ... on FinancialDocument {\n creditor {\n id\n name\n }\n serialNumber\n date\n amount {\n raw\n formatted\n currency\n }\n }\n }\n": types.DocumentsToMatchFieldsFragmentDoc,
|
|
341
348
|
"\n query RecentBusinessIssuedDocuments($businessId: UUID!, $limit: Int) {\n recentDocumentsByBusiness(businessId: $businessId, limit: $limit) {\n id\n ... on FinancialDocument {\n issuedDocumentInfo {\n id\n status\n externalId\n }\n }\n ...TableDocumentsRowFields\n }\n }\n": types.RecentBusinessIssuedDocumentsDocument,
|
|
342
349
|
"\n query RecentIssuedDocumentsOfSameType($documentType: DocumentType!) {\n recentIssuedDocumentsByType(documentType: $documentType) {\n id\n ...TableDocumentsRowFields\n }\n }\n": types.RecentIssuedDocumentsOfSameTypeDocument,
|
|
350
|
+
"\n query FetchBusiness($id: UUID!) {\n business(id: $id) {\n __typename\n id\n ... on LtdFinancialEntity {\n country\n address\n email\n exemptDealer\n governmentId\n hebrewName\n name\n phoneNumber\n sortCode {\n id\n key\n name\n }\n taxCategory {\n id\n name\n }\n website\n suggestions {\n phrases\n tags {\n id\n name\n }\n description\n emails\n emailListener {\n internalEmailLinks\n emailBody\n attachments\n }\n }\n optionalVAT\n irsCode\n pcn874RecordType\n }\n }\n }\n": types.FetchBusinessDocument,
|
|
343
351
|
"\n query EditDocument($documentId: UUID!) {\n documentById(documentId: $documentId) {\n id\n image\n file\n documentType\n __typename\n ... on FinancialDocument {\n vat {\n raw\n currency\n }\n serialNumber\n date\n amount {\n raw\n currency\n }\n debtor {\n id\n name\n }\n creditor {\n id\n name\n }\n vatReportDateOverride\n noVatAmount\n allocationNumber\n exchangeRateOverride\n }\n }\n }\n": types.EditDocumentDocument,
|
|
344
352
|
"\n fragment EditMiscExpenseFields on MiscExpense {\n id\n amount {\n raw\n currency\n }\n description\n invoiceDate\n valueDate\n creditor {\n id\n }\n debtor {\n id\n }\n }\n": types.EditMiscExpenseFieldsFragmentDoc,
|
|
345
353
|
"\n fragment EditTagFields on Tag {\n id\n name\n parent {\n id\n name\n }\n }\n": types.EditTagFieldsFragmentDoc,
|
|
@@ -567,7 +575,7 @@ export function graphql(source: "\n fragment BusinessAdminSection on Business {
|
|
|
567
575
|
/**
|
|
568
576
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
569
577
|
*/
|
|
570
|
-
export function graphql(source: "\n fragment BusinessHeader on Business {\n __typename\n id\n name\n createdAt\n
|
|
578
|
+
export function graphql(source: "\n fragment BusinessHeader on Business {\n __typename\n id\n name\n createdAt\n ... on LtdFinancialEntity {\n governmentId\n }\n }\n"): (typeof documents)["\n fragment BusinessHeader on Business {\n __typename\n id\n name\n createdAt\n ... on LtdFinancialEntity {\n governmentId\n }\n }\n"];
|
|
571
579
|
/**
|
|
572
580
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
573
581
|
*/
|
|
@@ -599,7 +607,19 @@ export function graphql(source: "\n query ClientIntegrationsSectionGreenInvoice
|
|
|
599
607
|
/**
|
|
600
608
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
601
609
|
*/
|
|
602
|
-
export function graphql(source: "\n
|
|
610
|
+
export function graphql(source: "\n fragment AllBusinessesRowFields on LtdFinancialEntity {\n id\n ...AllBusinessesNameFields\n ...AllBusinessesHebrewNameFields\n }\n"): (typeof documents)["\n fragment AllBusinessesRowFields on LtdFinancialEntity {\n id\n ...AllBusinessesNameFields\n ...AllBusinessesHebrewNameFields\n }\n"];
|
|
611
|
+
/**
|
|
612
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
613
|
+
*/
|
|
614
|
+
export function graphql(source: "\n fragment AllBusinessesHebrewNameFields on LtdFinancialEntity {\n id\n hebrewName\n }\n"): (typeof documents)["\n fragment AllBusinessesHebrewNameFields on LtdFinancialEntity {\n id\n hebrewName\n }\n"];
|
|
615
|
+
/**
|
|
616
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
617
|
+
*/
|
|
618
|
+
export function graphql(source: "\n fragment AllBusinessesNameFields on LtdFinancialEntity {\n id\n name\n }\n"): (typeof documents)["\n fragment AllBusinessesNameFields on LtdFinancialEntity {\n id\n name\n }\n"];
|
|
619
|
+
/**
|
|
620
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
621
|
+
*/
|
|
622
|
+
export function graphql(source: "\n query AllBusinessesForScreen($page: Int, $limit: Int, $name: String) {\n allBusinesses(page: $page, limit: $limit, name: $name) {\n nodes {\n __typename\n id\n name\n ... on LtdFinancialEntity {\n ...AllBusinessesRowFields\n }\n }\n pageInfo {\n totalPages\n }\n }\n }\n"): (typeof documents)["\n query AllBusinessesForScreen($page: Int, $limit: Int, $name: String) {\n allBusinesses(page: $page, limit: $limit, name: $name) {\n nodes {\n __typename\n id\n name\n ... on LtdFinancialEntity {\n ...AllBusinessesRowFields\n }\n }\n pageInfo {\n totalPages\n }\n }\n }\n"];
|
|
603
623
|
/**
|
|
604
624
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
605
625
|
*/
|
|
@@ -828,6 +848,10 @@ export function graphql(source: "\n query RecentBusinessIssuedDocuments($busine
|
|
|
828
848
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
829
849
|
*/
|
|
830
850
|
export function graphql(source: "\n query RecentIssuedDocumentsOfSameType($documentType: DocumentType!) {\n recentIssuedDocumentsByType(documentType: $documentType) {\n id\n ...TableDocumentsRowFields\n }\n }\n"): (typeof documents)["\n query RecentIssuedDocumentsOfSameType($documentType: DocumentType!) {\n recentIssuedDocumentsByType(documentType: $documentType) {\n id\n ...TableDocumentsRowFields\n }\n }\n"];
|
|
851
|
+
/**
|
|
852
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
853
|
+
*/
|
|
854
|
+
export function graphql(source: "\n query FetchBusiness($id: UUID!) {\n business(id: $id) {\n __typename\n id\n ... on LtdFinancialEntity {\n country\n address\n email\n exemptDealer\n governmentId\n hebrewName\n name\n phoneNumber\n sortCode {\n id\n key\n name\n }\n taxCategory {\n id\n name\n }\n website\n suggestions {\n phrases\n tags {\n id\n name\n }\n description\n emails\n emailListener {\n internalEmailLinks\n emailBody\n attachments\n }\n }\n optionalVAT\n irsCode\n pcn874RecordType\n }\n }\n }\n"): (typeof documents)["\n query FetchBusiness($id: UUID!) {\n business(id: $id) {\n __typename\n id\n ... on LtdFinancialEntity {\n country\n address\n email\n exemptDealer\n governmentId\n hebrewName\n name\n phoneNumber\n sortCode {\n id\n key\n name\n }\n taxCategory {\n id\n name\n }\n website\n suggestions {\n phrases\n tags {\n id\n name\n }\n description\n emails\n emailListener {\n internalEmailLinks\n emailBody\n attachments\n }\n }\n optionalVAT\n irsCode\n pcn874RecordType\n }\n }\n }\n"];
|
|
831
855
|
/**
|
|
832
856
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
833
857
|
*/
|