@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.
- package/CHANGELOG.md +1 -16
- package/dist/assets/{Checkbox-qEdmT4HE.js → Checkbox-CLE7WylX.js} +2 -2
- package/dist/assets/{MultiSelect-Dm9mO7pJ.js → MultiSelect-SsgUtHuW.js} +1 -1
- package/dist/assets/{Progress-kr0gnfBa.js → Progress-D7j8SJRp.js} +1 -1
- package/dist/assets/{Table-DnHfGe-y.js → Table-DpZKU9e6.js} +1 -1
- package/dist/assets/{Typography-Cu3puAUK.js → Typography-DOCvIzjw.js} +1 -1
- package/dist/assets/{YearPickerInput-oa86GF4P.js → YearPickerInput-BbyQMsmW.js} +1 -1
- package/dist/assets/{accordion-DLtMSqIv.js → accordion-KRd9M_7N.js} +1 -1
- package/dist/assets/{accountant-approvals-DsL0uiBa.js → accountant-approvals-BWkXiUJx.js} +1 -1
- package/dist/assets/{accounter-table-BL_yrGIl.js → accounter-table-BvOYdMv2.js} +1 -1
- package/dist/assets/{addDays-DqZEDZy3.js → addDays-HTdY9JyJ.js} +1 -1
- package/dist/assets/{all-charges-D3Xf-pEY.js → all-charges-uOrXkSoe.js} +1 -1
- package/dist/assets/{arrow-up-down-DchtBEG4.js → arrow-up-down-D0e6luFS.js} +1 -1
- package/dist/assets/{building-2-ZTKteVvf.js → building-2-BScQAy2y.js} +1 -1
- package/dist/assets/{business-extended-info-1mzdXJbs.js → business-extended-info-BPdDug4k.js} +4 -4
- package/dist/assets/{business-header-CJqfKV4d.js → business-header-ScM944FH.js} +1 -1
- package/dist/assets/{business-ledger-filters-BRB1r_DP.js → business-ledger-filters-C6zdPVNQ.js} +1 -1
- package/dist/assets/{business-ledger-single-C8FIQJ8V.js → business-ledger-single-D_gxQY7c.js} +1 -1
- package/dist/assets/business-qHY5sNtm.js +37 -0
- package/dist/assets/business-trip-BD6qMULS.js +1 -0
- package/dist/assets/{charge-Df3lWZH-.js → charge-CXgCTI2e.js} +1 -1
- package/dist/assets/charges-filters-DhYogrgu.js +1 -0
- package/dist/assets/{charges-ledger-validation-CtCBR3C-.js → charges-ledger-validation-K96Gpr99.js} +1 -1
- package/dist/assets/{charges-table-CWbe3t13.js → charges-table-Cff0tibm.js} +7 -7
- package/dist/assets/{chart-Cmm-jp0c.js → chart-Rag7RVt5.js} +1 -1
- package/dist/assets/contracts-C26gq1yS.js +16 -0
- package/dist/assets/{data-table-pagination-fdOZTf64.js → data-table-pagination-BenxjRXY.js} +2 -2
- package/dist/assets/{download-csv-button-CwK31swX.js → download-csv-button-8ow10rSS.js} +1 -1
- package/dist/assets/edit-issue-document-modal-2d_PTbvO.js +1 -0
- package/dist/assets/{editable-business-trip-Bjxkm9xV.js → editable-business-trip-BFJ_Mqji.js} +2 -2
- package/dist/assets/eye-off-BNMLF-BO.js +6 -0
- package/dist/assets/{funnel-CMG4QvaK.js → funnel-DW3_rS_8.js} +1 -1
- package/dist/assets/{index-BZVrGMgV.js → index-1iKxq5ag.js} +2 -2
- package/dist/assets/{index-C_ZNQ0Zr.js → index-2unHvdGT.js} +1 -1
- package/dist/assets/{index-DInU4RP4.js → index-4ufIi3AX.js} +2 -2
- package/dist/assets/index-B0Je179L.js +1 -0
- package/dist/assets/index-B2VI47XT.js +1 -0
- package/dist/assets/index-B86FoQmY.js +1 -0
- package/dist/assets/{index-CgokSIpu.js → index-BCiHeRl-.js} +1 -1
- package/dist/assets/{index-6G62OvEh.js → index-BDUyPP2c.js} +1 -1
- package/dist/assets/index-BHA96r33.js +1 -0
- package/dist/assets/{index-CjC_SXIA.js → index-BPS5RB7_.js} +1 -1
- package/dist/assets/{index-B9CbQIGq.js → index-BQyZXdTq.js} +2 -2
- package/dist/assets/index-BZLSFBEt.js +1 -0
- package/dist/assets/{index-Cw_aKL-8.js → index-Bd-SKdyy.js} +178 -173
- package/dist/assets/{index-C7oYbGGm.js → index-Bo2SK7RM.js} +1 -1
- package/dist/assets/{index-jCPWIpdP.js → index-Bp6IHcih.js} +1 -1
- package/dist/assets/index-BrSZxw1u.css +1 -0
- package/dist/assets/{index-DFW4nqx8.js → index-CEiIgRJ2.js} +7 -7
- package/dist/assets/{index-CTatkdRy.js → index-CKNxDyu9.js} +2 -2
- package/dist/assets/index-CqIav7Xr.js +1 -0
- package/dist/assets/index-Dp9F68vS.js +1 -0
- package/dist/assets/{index-CriBDqbK.js → index-DvvRs9Ha.js} +1 -1
- package/dist/assets/{index-DLwMwjDQ.js → index-DyLWk3js.js} +1 -1
- package/dist/assets/index-NdA_oCxx.js +1 -0
- package/dist/assets/{index-BEahR51x.js → index-VD71ra9C.js} +2 -2
- package/dist/assets/{index-xxe8M91O.js → index-lMXNkFuw.js} +2 -2
- package/dist/assets/index-q3ev6JER.js +1 -0
- package/dist/assets/{index.es-B_Bf6nNm.js → index.es-C9I2aTP4.js} +1 -1
- package/dist/assets/{insert-business-trip-modal-Ds3RIlmF.js → insert-business-trip-modal-DVcWpJHr.js} +2 -2
- package/dist/assets/issue-document-BxTTlJ1T.js +1 -0
- package/dist/assets/{list-plus-B3EB-dKe.js → list-plus-B7wBrICK.js} +1 -1
- package/dist/assets/login-page-BpgscuKm.js +1 -0
- package/dist/assets/{match-document-modal-Bo9pBr8W.js → match-document-modal-CqP2SE2c.js} +4 -4
- package/dist/assets/{missing-info-charges-BQYXI7bj.js → missing-info-charges-CIs_kE3P.js} +1 -1
- package/dist/assets/{modal-Pj_6bAFk.js → modal-CwuHXtxz.js} +1 -1
- package/dist/assets/modify-contract-dialog-BoeamC68.js +1 -0
- package/dist/assets/{page-layout-CVTeUSZp.js → page-layout-XgNPsCmr.js} +1 -1
- package/dist/assets/{page-not-found-TvTAiAs4.js → page-not-found-CrFJMQNO.js} +1 -1
- package/dist/assets/{panel-top-open-DzBY_TuM.js → panel-top-open-DU7alj-S.js} +1 -1
- package/dist/assets/{pencil-BBmFhuZN.js → pencil-9DTTP5vx.js} +1 -1
- package/dist/assets/{report-commentary-row-Dqw62LLo.js → report-commentary-row-BdS3qqMS.js} +1 -1
- package/dist/assets/{save-BW18gNVs.js → save-i8sPy_OW.js} +1 -1
- package/dist/assets/similar-transactions-modal-CZAOYt-d.js +1 -0
- package/dist/assets/sub-BL9nfaPD.js +1 -0
- package/dist/assets/subMonths-DHPWOZP6.js +1 -0
- package/dist/assets/{summary-Bbsq64IN.js → summary-Dfiju7xJ.js} +1 -1
- package/dist/assets/{toggle-expansion-button-BrKkZtGj.js → toggle-expansion-button-BbVh8z6s.js} +1 -1
- package/dist/assets/tooltip-C-fd9L1l.js +1 -0
- package/dist/assets/{use-url-query-C0mVgO2i.js → use-url-query-5TFyEk1x.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/src/components/business/admin-business-section.tsx +103 -282
- package/src/components/clients/contracts/modify-contract-dialog.tsx +341 -253
- package/src/components/contracts/cells/client.tsx +24 -0
- package/src/components/contracts/cells/date.tsx +10 -0
- package/src/components/contracts/cells/index.ts +2 -0
- package/src/components/contracts/columns.tsx +182 -0
- package/src/components/contracts/contracts-filter.tsx +160 -0
- package/src/components/contracts/index.tsx +264 -0
- package/src/components/contracts/issue-documents-modal.tsx +234 -0
- package/src/components/layout/sidelinks.tsx +7 -0
- package/src/components/screens/businesses/clients/contracts/contracts.tsx +56 -0
- package/src/gql/gql.ts +27 -3
- package/src/gql/graphql.ts +73 -52
- package/src/router/config.tsx +13 -0
- package/src/router/routes.ts +1 -0
- package/dist/assets/business-CAcKSrnu.js +0 -37
- package/dist/assets/business-trip-DkTEY8b1.js +0 -1
- package/dist/assets/charges-filters-DUuY-N0H.js +0 -1
- package/dist/assets/index-BD4s2ucv.css +0 -1
- package/dist/assets/index-BFwWHKS1.js +0 -1
- package/dist/assets/index-BI0XToIk.js +0 -1
- package/dist/assets/index-BQb_C-JL.js +0 -1
- package/dist/assets/index-CJQlHnFs.js +0 -1
- package/dist/assets/index-Cm6Blkgf.js +0 -1
- package/dist/assets/index-DJLQkpmI.js +0 -6
- package/dist/assets/index-DcwGbXWr.js +0 -1
- package/dist/assets/index-Dlj3jpuW.js +0 -1
- package/dist/assets/index-iya2tfvn.js +0 -1
- package/dist/assets/issue-document-_iHCFO9h.js +0 -1
- package/dist/assets/login-page-BtT_TCEJ.js +0 -1
- package/dist/assets/similar-transactions-modal-B39q1NLa.js +0 -1
- package/dist/assets/sub-DOjETdwl.js +0 -1
- package/dist/assets/subMonths-DqeFZ4O6.js +0 -1
- package/dist/assets/tooltip-CbnJYNc4.js +0 -1
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useCallback,
|
|
3
|
+
useEffect,
|
|
4
|
+
useMemo,
|
|
5
|
+
useState,
|
|
6
|
+
type ComponentProps,
|
|
7
|
+
type ReactElement,
|
|
8
|
+
} from 'react';
|
|
9
|
+
import { format, subMonths } from 'date-fns';
|
|
10
|
+
import { X } from 'lucide-react';
|
|
11
|
+
import { useFieldArray, useForm } from 'react-hook-form';
|
|
12
|
+
import { useQuery } from 'urql';
|
|
13
|
+
import { AccounterLoader } from '@/components/common/loader.js';
|
|
14
|
+
import {
|
|
15
|
+
ContractBasedDocumentDraftsDocument,
|
|
16
|
+
NewDocumentInfoFragmentDoc,
|
|
17
|
+
type NewDocumentInfoFragment,
|
|
18
|
+
} from '@/gql/graphql.js';
|
|
19
|
+
import { getFragmentData } from '@/gql/index.js';
|
|
20
|
+
import type { TimelessDateString } from '@/helpers/dates.js';
|
|
21
|
+
import { useIssueMonthlyDocuments } from '@/hooks/use-issue-monthly-documents.js';
|
|
22
|
+
import { MonthPickerInput } from '@mantine/dates';
|
|
23
|
+
import { ConfirmationModal } from '../common/index.js';
|
|
24
|
+
import { EditIssueDocumentModal } from '../screens/documents/issue-documents/edit-issue-document-modal.js';
|
|
25
|
+
import { type IssueDocumentsVariables } from '../screens/documents/issue-documents/issue-documents-table.js';
|
|
26
|
+
import { Button } from '../ui/button.js';
|
|
27
|
+
import {
|
|
28
|
+
Dialog,
|
|
29
|
+
DialogContent,
|
|
30
|
+
DialogDescription,
|
|
31
|
+
DialogHeader,
|
|
32
|
+
DialogTitle,
|
|
33
|
+
DialogTrigger,
|
|
34
|
+
} from '../ui/dialog.js';
|
|
35
|
+
import { Form } from '../ui/form.js';
|
|
36
|
+
import { Label } from '../ui/label.js';
|
|
37
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '../ui/table.js';
|
|
38
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip.js';
|
|
39
|
+
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- used by codegen
|
|
41
|
+
/* GraphQL */ `
|
|
42
|
+
query ContractBasedDocumentDrafts($issueMonth: TimelessDate!, $contractIds: [UUID!]!) {
|
|
43
|
+
clientChargesDraftsByContracts(issueMonth: $issueMonth, contractIds: $contractIds) {
|
|
44
|
+
...NewDocumentInfo
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
type Props = ComponentProps<typeof Button> & {
|
|
50
|
+
contractIds: string[];
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const IssueDocumentsModal = ({ contractIds }: Props): ReactElement => {
|
|
54
|
+
const [isDialogOpen, setIsDialogOpen] = useState(false);
|
|
55
|
+
const [issueMonth, setIssueMonth] = useState<TimelessDateString>(
|
|
56
|
+
format(subMonths(new Date(), 1), 'yyyy-MM-dd') as TimelessDateString,
|
|
57
|
+
);
|
|
58
|
+
const [documentDrafts, setDocumentDrafts] = useState<
|
|
59
|
+
(Omit<NewDocumentInfoFragment, 'client'> & {
|
|
60
|
+
client: NewDocumentInfoFragment['client'] & { id: string };
|
|
61
|
+
})[]
|
|
62
|
+
>([]);
|
|
63
|
+
const { issueDocuments } = useIssueMonthlyDocuments();
|
|
64
|
+
|
|
65
|
+
const [{ data, fetching }, fetchDrafts] = useQuery({
|
|
66
|
+
query: ContractBasedDocumentDraftsDocument,
|
|
67
|
+
variables: {
|
|
68
|
+
issueMonth,
|
|
69
|
+
contractIds,
|
|
70
|
+
},
|
|
71
|
+
pause: !isDialogOpen,
|
|
72
|
+
});
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
if (data?.clientChargesDraftsByContracts) {
|
|
75
|
+
setDocumentDrafts(
|
|
76
|
+
data.clientChargesDraftsByContracts.map(draft =>
|
|
77
|
+
getFragmentData(NewDocumentInfoFragmentDoc, draft),
|
|
78
|
+
) as (Omit<NewDocumentInfoFragment, 'client'> & {
|
|
79
|
+
client: NewDocumentInfoFragment['client'] & { id: string };
|
|
80
|
+
})[],
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
}, [data, setDocumentDrafts]);
|
|
84
|
+
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
if (isDialogOpen) {
|
|
87
|
+
void fetchDrafts();
|
|
88
|
+
}
|
|
89
|
+
}, [isDialogOpen, fetchDrafts]);
|
|
90
|
+
|
|
91
|
+
const form = useForm<IssueDocumentsVariables>({
|
|
92
|
+
values: {
|
|
93
|
+
generateDocumentsInfo: documentDrafts,
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const onSubmit = useCallback(
|
|
98
|
+
(data: IssueDocumentsVariables) => {
|
|
99
|
+
issueDocuments(data);
|
|
100
|
+
},
|
|
101
|
+
[issueDocuments],
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
const { fields, remove, update } = useFieldArray({
|
|
105
|
+
control: form.control,
|
|
106
|
+
name: 'generateDocumentsInfo',
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
const watchFieldArray = form.watch('generateDocumentsInfo');
|
|
110
|
+
|
|
111
|
+
const controlledFields = useMemo(() => {
|
|
112
|
+
return fields.map((field, index) => {
|
|
113
|
+
return {
|
|
114
|
+
...field,
|
|
115
|
+
...watchFieldArray[index],
|
|
116
|
+
id: field.client?.id,
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
}, [fields, watchFieldArray]);
|
|
120
|
+
|
|
121
|
+
return (
|
|
122
|
+
<Dialog open={isDialogOpen} onOpenChange={setIsDialogOpen}>
|
|
123
|
+
<DialogTrigger asChild>
|
|
124
|
+
<Button size="sm" variant="outline" disabled={contractIds.length === 0}>
|
|
125
|
+
Issue Documents
|
|
126
|
+
</Button>
|
|
127
|
+
</DialogTrigger>
|
|
128
|
+
<DialogContent className="min-w-[90vw] w-full max-h-[90vh] overflow-y-auto">
|
|
129
|
+
<DialogHeader>
|
|
130
|
+
<DialogTitle>Filter Contracts</DialogTitle>
|
|
131
|
+
<DialogDescription>Filter contracts based on various criteria</DialogDescription>
|
|
132
|
+
</DialogHeader>
|
|
133
|
+
{fetching ? (
|
|
134
|
+
<AccounterLoader />
|
|
135
|
+
) : (
|
|
136
|
+
<Form {...form}>
|
|
137
|
+
<form onSubmit={form.handleSubmit(onSubmit)} className="min-w-5xl w-full">
|
|
138
|
+
{/* date input for issueMonth */}
|
|
139
|
+
<div className="flex gap-2 items-center mb-4">
|
|
140
|
+
<Label>Issue Month:</Label>
|
|
141
|
+
<MonthPickerInput
|
|
142
|
+
value={new Date(issueMonth)}
|
|
143
|
+
onChange={(date: Date) => {
|
|
144
|
+
const month = new Date(date.getFullYear(), date.getMonth(), 15);
|
|
145
|
+
setIssueMonth(format(month, 'yyyy-MM-dd') as TimelessDateString);
|
|
146
|
+
}}
|
|
147
|
+
popoverProps={{ withinPortal: false }}
|
|
148
|
+
/>
|
|
149
|
+
</div>
|
|
150
|
+
<Table>
|
|
151
|
+
<TableHeader>
|
|
152
|
+
<TableRow>
|
|
153
|
+
<TableHead>Name</TableHead>
|
|
154
|
+
<TableHead>Document</TableHead>
|
|
155
|
+
<TableHead>Amount</TableHead>
|
|
156
|
+
<TableHead>Remark</TableHead>
|
|
157
|
+
<TableHead>Recipients</TableHead>
|
|
158
|
+
<TableHead />
|
|
159
|
+
</TableRow>
|
|
160
|
+
</TableHeader>
|
|
161
|
+
<TableBody>
|
|
162
|
+
{controlledFields.map(({ id, ...row }, index) => {
|
|
163
|
+
return (
|
|
164
|
+
<TableRow key={id}>
|
|
165
|
+
<TableCell>{row.client?.name}</TableCell>
|
|
166
|
+
<TableCell>{row.type}</TableCell>
|
|
167
|
+
<TableCell>
|
|
168
|
+
{row.income?.[0]?.price} {row.income?.[0]?.currency}
|
|
169
|
+
</TableCell>
|
|
170
|
+
<TableCell>
|
|
171
|
+
<span className="text-sm text-gray-500 whitespace-normal max-w-50">
|
|
172
|
+
{row.remarks}
|
|
173
|
+
</span>
|
|
174
|
+
</TableCell>
|
|
175
|
+
<TableCell>
|
|
176
|
+
<div className="flex flex-col">
|
|
177
|
+
{row.client?.emails?.map(email => (
|
|
178
|
+
<span key={email} className="text-sm text-gray-500">
|
|
179
|
+
{email}
|
|
180
|
+
</span>
|
|
181
|
+
))}
|
|
182
|
+
</div>
|
|
183
|
+
</TableCell>
|
|
184
|
+
<TableCell>
|
|
185
|
+
<div className="flex flex-col gap-2">
|
|
186
|
+
<Tooltip>
|
|
187
|
+
<TooltipTrigger asChild type="button">
|
|
188
|
+
<Button
|
|
189
|
+
className="size-7.5"
|
|
190
|
+
variant="secondary"
|
|
191
|
+
onClick={() => remove(index)}
|
|
192
|
+
>
|
|
193
|
+
<X size={16} />
|
|
194
|
+
</Button>
|
|
195
|
+
</TooltipTrigger>
|
|
196
|
+
<TooltipContent>
|
|
197
|
+
<p>Remove document</p>
|
|
198
|
+
</TooltipContent>
|
|
199
|
+
</Tooltip>
|
|
200
|
+
<EditIssueDocumentModal
|
|
201
|
+
draft={row}
|
|
202
|
+
onApprove={document => {
|
|
203
|
+
form.setValue(`generateDocumentsInfo.${index}`, document, {
|
|
204
|
+
shouldDirty: true,
|
|
205
|
+
shouldTouch: true,
|
|
206
|
+
shouldValidate: true,
|
|
207
|
+
});
|
|
208
|
+
update(index, {
|
|
209
|
+
...document,
|
|
210
|
+
});
|
|
211
|
+
}}
|
|
212
|
+
/>
|
|
213
|
+
</div>
|
|
214
|
+
</TableCell>
|
|
215
|
+
</TableRow>
|
|
216
|
+
);
|
|
217
|
+
})}
|
|
218
|
+
</TableBody>
|
|
219
|
+
</Table>
|
|
220
|
+
<div className="flex justify-between items-center mt-4">
|
|
221
|
+
<ConfirmationModal
|
|
222
|
+
onConfirm={form.handleSubmit(onSubmit)}
|
|
223
|
+
title={`Are you sure you want to issue ${controlledFields.length} documents?`}
|
|
224
|
+
>
|
|
225
|
+
<Button>Issue</Button>
|
|
226
|
+
</ConfirmationModal>
|
|
227
|
+
</div>
|
|
228
|
+
</form>
|
|
229
|
+
</Form>
|
|
230
|
+
)}
|
|
231
|
+
</DialogContent>
|
|
232
|
+
</Dialog>
|
|
233
|
+
);
|
|
234
|
+
};
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
RectangleEllipsis,
|
|
25
25
|
Rows4,
|
|
26
26
|
Scale,
|
|
27
|
+
Signature,
|
|
27
28
|
Tags,
|
|
28
29
|
} from 'lucide-react';
|
|
29
30
|
import { ROUTES } from '../../router/routes.js';
|
|
@@ -170,6 +171,12 @@ export const sidelinks: SideLink[] = [
|
|
|
170
171
|
href: ROUTES.BUSINESSES.LEDGER,
|
|
171
172
|
icon: <ArrowLeftRight size={18} />,
|
|
172
173
|
},
|
|
174
|
+
{
|
|
175
|
+
title: 'Contracts',
|
|
176
|
+
label: '',
|
|
177
|
+
href: ROUTES.BUSINESSES.CONTRACTS,
|
|
178
|
+
icon: <Signature size={18} />,
|
|
179
|
+
},
|
|
173
180
|
{
|
|
174
181
|
title: 'Tax Categories',
|
|
175
182
|
label: '',
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { useContext, type ReactElement } from 'react';
|
|
2
|
+
import { useLoaderData } from 'react-router-dom';
|
|
3
|
+
import { useQuery } from 'urql';
|
|
4
|
+
import { AccounterLoader } from '@/components/common/index.js';
|
|
5
|
+
import { ContractsTable } from '@/components/contracts/index.js';
|
|
6
|
+
import { ContractsScreenDocument, type ContractsScreenQuery } from '@/gql/graphql.js';
|
|
7
|
+
import { UserContext } from '@/providers/index.js';
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- used by codegen
|
|
10
|
+
/* GraphQL */ `
|
|
11
|
+
query ContractsScreen($adminId: UUID!) {
|
|
12
|
+
contractsByAdmin(adminId: $adminId) {
|
|
13
|
+
id
|
|
14
|
+
...ContractForContractsTableFields
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
export const ContractsScreen = (): ReactElement => {
|
|
20
|
+
const { userContext } = useContext(UserContext);
|
|
21
|
+
const adminId = userContext?.context.adminBusinessId;
|
|
22
|
+
|
|
23
|
+
// Try to get loader data (will be available when navigating via router)
|
|
24
|
+
let loaderData: ContractsScreenQuery | undefined;
|
|
25
|
+
try {
|
|
26
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
27
|
+
loaderData = useLoaderData() as ContractsScreenQuery;
|
|
28
|
+
} catch {
|
|
29
|
+
// No loader data - fallback to query
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Only fetch if we don't have loader data
|
|
33
|
+
const [{ data, fetching }, fetchContracts] = useQuery({
|
|
34
|
+
query: ContractsScreenDocument,
|
|
35
|
+
pause: !adminId || !!loaderData,
|
|
36
|
+
variables: {
|
|
37
|
+
adminId: adminId ?? '',
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// Use loader data if available, otherwise use query data
|
|
42
|
+
const contractsData = loaderData || data;
|
|
43
|
+
const isLoading = !loaderData && fetching;
|
|
44
|
+
|
|
45
|
+
if (isLoading && !contractsData?.contractsByAdmin) {
|
|
46
|
+
return <AccounterLoader />;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (!adminId || !contractsData?.contractsByAdmin) {
|
|
50
|
+
return <div>Contracts not found</div>;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<ContractsTable data={contractsData.contractsByAdmin} onChange={async () => fetchContracts()} />
|
|
55
|
+
);
|
|
56
|
+
};
|
package/src/gql/gql.ts
CHANGED
|
@@ -21,7 +21,7 @@ type Documents = {
|
|
|
21
21
|
"\n query BusinessTripsRowValidation($id: UUID!) {\n businessTrip(id: $id) {\n id\n uncategorizedTransactions {\n transaction {\n ... on Transaction @defer {\n id\n }\n }\n }\n summary {\n ... on BusinessTripSummary @defer {\n errors\n }\n }\n }\n }\n": typeof types.BusinessTripsRowValidationDocument,
|
|
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
|
-
"\n fragment BusinessAdminSection on Business {\n id\n ... on LtdFinancialEntity {\n adminInfo {\n id\n
|
|
24
|
+
"\n fragment BusinessAdminSection on Business {\n id\n ... on LtdFinancialEntity {\n adminInfo {\n id\n withholdingTaxBookNumber\n withholdingTaxFileNumber\n socialSecurityEmployerId\n taxAdvancesRate\n taxAdvancesId\n registrationDate\n }\n }\n }\n": typeof types.BusinessAdminSectionFragmentDoc,
|
|
25
25
|
"\n fragment BusinessHeader on Business {\n __typename\n id\n name\n createdAt\n isActive\n ... on LtdFinancialEntity {\n governmentId\n adminInfo {\n id\n }\n clientInfo {\n id\n }\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,
|
|
@@ -62,6 +62,7 @@ type Documents = {
|
|
|
62
62
|
"\n query IncomeChargesChart($filters: ChargeFilter) {\n allCharges(filters: $filters) {\n nodes {\n id\n transactions {\n id\n eventDate\n effectiveDate\n amount {\n currency\n formatted\n raw\n }\n eventExchangeRates {\n aud\n cad\n eur\n gbp\n jpy\n sek\n usd\n date\n }\n debitExchangeRates {\n aud\n cad\n eur\n gbp\n jpy\n sek\n usd\n date\n }\n }\n }\n }\n }\n": typeof types.IncomeChargesChartDocument,
|
|
63
63
|
"\n fragment MonthlyIncomeExpenseChartInfo on IncomeExpenseChart {\n monthlyData {\n income {\n formatted\n raw\n }\n expense {\n formatted\n raw\n }\n balance {\n formatted\n raw\n }\n date\n }\n }\n": typeof types.MonthlyIncomeExpenseChartInfoFragmentDoc,
|
|
64
64
|
"\n query MonthlyIncomeExpenseChart($filters: IncomeExpenseChartFilters!) {\n incomeExpenseChart(filters: $filters) {\n fromDate\n toDate\n currency\n ...MonthlyIncomeExpenseChartInfo\n }\n }\n": typeof types.MonthlyIncomeExpenseChartDocument,
|
|
65
|
+
"\n query ContractsEditModal($contractId: UUID!) {\n contractsById(id: $contractId) {\n id\n startDate\n endDate\n purchaseOrders\n amount {\n raw\n currency\n }\n product\n msCloud\n billingCycle\n plan\n isActive\n remarks\n documentType\n operationsLimit\n }\n }\n": typeof types.ContractsEditModalDocument,
|
|
65
66
|
"\n fragment BusinessTripReportFields on BusinessTrip {\n id\n ...BusinessTripReportHeaderFields\n ...BusinessTripReportSummaryFields\n }\n": typeof types.BusinessTripReportFieldsFragmentDoc,
|
|
66
67
|
"\n fragment BusinessTripAccountantApprovalFields on BusinessTrip {\n id\n accountantApproval\n }\n": typeof types.BusinessTripAccountantApprovalFieldsFragmentDoc,
|
|
67
68
|
"\n query UncategorizedTransactionsByBusinessTrip($businessTripId: UUID!) {\n businessTrip(id: $businessTripId) {\n id\n uncategorizedTransactions {\n transaction {\n id\n eventDate\n sourceDescription\n referenceKey\n counterparty {\n id\n name\n }\n amount {\n formatted\n raw\n }\n }\n }\n }\n }\n": typeof types.UncategorizedTransactionsByBusinessTripDocument,
|
|
@@ -120,6 +121,8 @@ type Documents = {
|
|
|
120
121
|
"\n query SimilarTransactions($transactionId: UUID!, $withMissingInfo: Boolean!) {\n similarTransactions(transactionId: $transactionId, withMissingInfo: $withMissingInfo) {\n id\n account {\n id\n name\n type\n }\n amount {\n formatted\n raw\n }\n effectiveDate\n eventDate\n sourceDescription\n }\n }\n": typeof types.SimilarTransactionsDocument,
|
|
121
122
|
"\n query UniformFormat($fromDate: TimelessDate!, $toDate: TimelessDate!) {\n uniformFormat(fromDate: $fromDate, toDate: $toDate) {\n bkmvdata\n ini\n }\n }\n": typeof types.UniformFormatDocument,
|
|
122
123
|
"\n fragment NewFetchedDocumentFields on Document {\n id\n documentType\n charge {\n id\n userDescription\n counterparty {\n id\n name\n }\n }\n }\n": typeof types.NewFetchedDocumentFieldsFragmentDoc,
|
|
124
|
+
"\n fragment ContractForContractsTableFields on Contract {\n id\n isActive\n client {\n id\n originalBusiness {\n id\n name\n }\n }\n purchaseOrders\n startDate\n endDate\n amount {\n raw\n formatted\n }\n billingCycle\n product\n plan\n operationsLimit\n msCloud\n # documentType\n # remarks\n # operationsLimit\n }\n": typeof types.ContractForContractsTableFieldsFragmentDoc,
|
|
125
|
+
"\n query ContractBasedDocumentDrafts($issueMonth: TimelessDate!, $contractIds: [UUID!]!) {\n clientChargesDraftsByContracts(issueMonth: $issueMonth, contractIds: $contractIds) {\n ...NewDocumentInfo\n }\n }\n": typeof types.ContractBasedDocumentDraftsDocument,
|
|
123
126
|
"\n fragment TableDocumentsRowFields on Document {\n id\n documentType\n image\n file\n charge {\n id\n }\n ... on FinancialDocument {\n amount {\n raw\n formatted\n currency\n }\n missingInfoSuggestions {\n amount {\n raw\n formatted\n currency\n }\n isIncome\n counterparty {\n id\n name\n }\n owner {\n id\n name\n }\n }\n date\n vat {\n raw\n formatted\n currency\n }\n serialNumber\n allocationNumber\n creditor {\n id\n name\n }\n debtor {\n id\n name\n }\n issuedDocumentInfo {\n id\n status\n originalDocument {\n income {\n description\n }\n }\n }\n }\n }\n": typeof types.TableDocumentsRowFieldsFragmentDoc,
|
|
124
127
|
"\n fragment DocumentsGalleryFields on Charge {\n id\n additionalDocuments {\n id\n image\n ... on FinancialDocument {\n documentType\n }\n }\n }\n": typeof types.DocumentsGalleryFieldsFragmentDoc,
|
|
125
128
|
"\n fragment LedgerRecordsTableFields on LedgerRecord {\n id\n creditAccount1 {\n __typename\n id\n name\n }\n creditAccount2 {\n __typename\n id\n name\n }\n debitAccount1 {\n __typename\n id\n name\n }\n debitAccount2 {\n __typename\n id\n name\n }\n creditAmount1 {\n formatted\n currency\n }\n creditAmount2 {\n formatted\n currency\n }\n debitAmount1 {\n formatted\n currency\n }\n debitAmount2 {\n formatted\n currency\n }\n localCurrencyCreditAmount1 {\n formatted\n raw\n }\n localCurrencyCreditAmount2 {\n formatted\n raw\n }\n localCurrencyDebitAmount1 {\n formatted\n raw\n }\n localCurrencyDebitAmount2 {\n formatted\n raw\n }\n invoiceDate\n valueDate\n description\n reference\n }\n": typeof types.LedgerRecordsTableFieldsFragmentDoc,
|
|
@@ -158,6 +161,7 @@ type Documents = {
|
|
|
158
161
|
"\n fragment SalariesTableFields on Salary {\n month\n employee {\n id\n }\n ...SalariesMonthFields\n }\n": typeof types.SalariesTableFieldsFragmentDoc,
|
|
159
162
|
"\n fragment SalariesRecordFields on Salary {\n month\n employee {\n id\n }\n ...SalariesRecordEmployeeFields\n ...SalariesRecordMainSalaryFields\n ...SalariesRecordFundsFields\n ...SalariesRecordInsurancesAndTaxesFields\n ...SalariesRecordWorkFrameFields\n }\n": typeof types.SalariesRecordFieldsFragmentDoc,
|
|
160
163
|
"\n query BusinessScreen($businessId: UUID!) {\n business(id: $businessId) {\n id\n ...BusinessPage\n }\n }\n": typeof types.BusinessScreenDocument,
|
|
164
|
+
"\n query ContractsScreen($adminId: UUID!) {\n contractsByAdmin(adminId: $adminId) {\n id\n ...ContractForContractsTableFields\n }\n }\n": typeof types.ContractsScreenDocument,
|
|
161
165
|
"\n query AllCharges($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.AllChargesDocument,
|
|
162
166
|
"\n query ChargeScreen($chargeId: UUID!) {\n charge(chargeId: $chargeId) {\n id\n ...ChargesTableFields\n }\n }\n": typeof types.ChargeScreenDocument,
|
|
163
167
|
"\n query MissingInfoCharges($page: Int, $limit: Int) {\n chargesWithMissingRequiredInfo(page: $page, limit: $limit) {\n nodes {\n id\n ...ChargesTableFields\n }\n pageInfo {\n totalPages\n }\n }\n }\n": typeof types.MissingInfoChargesDocument,
|
|
@@ -276,7 +280,7 @@ const documents: Documents = {
|
|
|
276
280
|
"\n query BusinessTripsRowValidation($id: UUID!) {\n businessTrip(id: $id) {\n id\n uncategorizedTransactions {\n transaction {\n ... on Transaction @defer {\n id\n }\n }\n }\n summary {\n ... on BusinessTripSummary @defer {\n errors\n }\n }\n }\n }\n": types.BusinessTripsRowValidationDocument,
|
|
277
281
|
"\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,
|
|
278
282
|
"\n query BusinessTripsScreen {\n allBusinessTrips {\n id\n name\n dates {\n start\n }\n ...BusinessTripsRowFields\n }\n }\n": types.BusinessTripsScreenDocument,
|
|
279
|
-
"\n fragment BusinessAdminSection on Business {\n id\n ... on LtdFinancialEntity {\n adminInfo {\n id\n
|
|
283
|
+
"\n fragment BusinessAdminSection on Business {\n id\n ... on LtdFinancialEntity {\n adminInfo {\n id\n withholdingTaxBookNumber\n withholdingTaxFileNumber\n socialSecurityEmployerId\n taxAdvancesRate\n taxAdvancesId\n registrationDate\n }\n }\n }\n": types.BusinessAdminSectionFragmentDoc,
|
|
280
284
|
"\n fragment BusinessHeader on Business {\n __typename\n id\n name\n createdAt\n isActive\n ... on LtdFinancialEntity {\n governmentId\n adminInfo {\n id\n }\n clientInfo {\n id\n }\n }\n }\n": types.BusinessHeaderFragmentDoc,
|
|
281
285
|
"\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,
|
|
282
286
|
"\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,
|
|
@@ -317,6 +321,7 @@ const documents: Documents = {
|
|
|
317
321
|
"\n query IncomeChargesChart($filters: ChargeFilter) {\n allCharges(filters: $filters) {\n nodes {\n id\n transactions {\n id\n eventDate\n effectiveDate\n amount {\n currency\n formatted\n raw\n }\n eventExchangeRates {\n aud\n cad\n eur\n gbp\n jpy\n sek\n usd\n date\n }\n debitExchangeRates {\n aud\n cad\n eur\n gbp\n jpy\n sek\n usd\n date\n }\n }\n }\n }\n }\n": types.IncomeChargesChartDocument,
|
|
318
322
|
"\n fragment MonthlyIncomeExpenseChartInfo on IncomeExpenseChart {\n monthlyData {\n income {\n formatted\n raw\n }\n expense {\n formatted\n raw\n }\n balance {\n formatted\n raw\n }\n date\n }\n }\n": types.MonthlyIncomeExpenseChartInfoFragmentDoc,
|
|
319
323
|
"\n query MonthlyIncomeExpenseChart($filters: IncomeExpenseChartFilters!) {\n incomeExpenseChart(filters: $filters) {\n fromDate\n toDate\n currency\n ...MonthlyIncomeExpenseChartInfo\n }\n }\n": types.MonthlyIncomeExpenseChartDocument,
|
|
324
|
+
"\n query ContractsEditModal($contractId: UUID!) {\n contractsById(id: $contractId) {\n id\n startDate\n endDate\n purchaseOrders\n amount {\n raw\n currency\n }\n product\n msCloud\n billingCycle\n plan\n isActive\n remarks\n documentType\n operationsLimit\n }\n }\n": types.ContractsEditModalDocument,
|
|
320
325
|
"\n fragment BusinessTripReportFields on BusinessTrip {\n id\n ...BusinessTripReportHeaderFields\n ...BusinessTripReportSummaryFields\n }\n": types.BusinessTripReportFieldsFragmentDoc,
|
|
321
326
|
"\n fragment BusinessTripAccountantApprovalFields on BusinessTrip {\n id\n accountantApproval\n }\n": types.BusinessTripAccountantApprovalFieldsFragmentDoc,
|
|
322
327
|
"\n query UncategorizedTransactionsByBusinessTrip($businessTripId: UUID!) {\n businessTrip(id: $businessTripId) {\n id\n uncategorizedTransactions {\n transaction {\n id\n eventDate\n sourceDescription\n referenceKey\n counterparty {\n id\n name\n }\n amount {\n formatted\n raw\n }\n }\n }\n }\n }\n": types.UncategorizedTransactionsByBusinessTripDocument,
|
|
@@ -375,6 +380,8 @@ const documents: Documents = {
|
|
|
375
380
|
"\n query SimilarTransactions($transactionId: UUID!, $withMissingInfo: Boolean!) {\n similarTransactions(transactionId: $transactionId, withMissingInfo: $withMissingInfo) {\n id\n account {\n id\n name\n type\n }\n amount {\n formatted\n raw\n }\n effectiveDate\n eventDate\n sourceDescription\n }\n }\n": types.SimilarTransactionsDocument,
|
|
376
381
|
"\n query UniformFormat($fromDate: TimelessDate!, $toDate: TimelessDate!) {\n uniformFormat(fromDate: $fromDate, toDate: $toDate) {\n bkmvdata\n ini\n }\n }\n": types.UniformFormatDocument,
|
|
377
382
|
"\n fragment NewFetchedDocumentFields on Document {\n id\n documentType\n charge {\n id\n userDescription\n counterparty {\n id\n name\n }\n }\n }\n": types.NewFetchedDocumentFieldsFragmentDoc,
|
|
383
|
+
"\n fragment ContractForContractsTableFields on Contract {\n id\n isActive\n client {\n id\n originalBusiness {\n id\n name\n }\n }\n purchaseOrders\n startDate\n endDate\n amount {\n raw\n formatted\n }\n billingCycle\n product\n plan\n operationsLimit\n msCloud\n # documentType\n # remarks\n # operationsLimit\n }\n": types.ContractForContractsTableFieldsFragmentDoc,
|
|
384
|
+
"\n query ContractBasedDocumentDrafts($issueMonth: TimelessDate!, $contractIds: [UUID!]!) {\n clientChargesDraftsByContracts(issueMonth: $issueMonth, contractIds: $contractIds) {\n ...NewDocumentInfo\n }\n }\n": types.ContractBasedDocumentDraftsDocument,
|
|
378
385
|
"\n fragment TableDocumentsRowFields on Document {\n id\n documentType\n image\n file\n charge {\n id\n }\n ... on FinancialDocument {\n amount {\n raw\n formatted\n currency\n }\n missingInfoSuggestions {\n amount {\n raw\n formatted\n currency\n }\n isIncome\n counterparty {\n id\n name\n }\n owner {\n id\n name\n }\n }\n date\n vat {\n raw\n formatted\n currency\n }\n serialNumber\n allocationNumber\n creditor {\n id\n name\n }\n debtor {\n id\n name\n }\n issuedDocumentInfo {\n id\n status\n originalDocument {\n income {\n description\n }\n }\n }\n }\n }\n": types.TableDocumentsRowFieldsFragmentDoc,
|
|
379
386
|
"\n fragment DocumentsGalleryFields on Charge {\n id\n additionalDocuments {\n id\n image\n ... on FinancialDocument {\n documentType\n }\n }\n }\n": types.DocumentsGalleryFieldsFragmentDoc,
|
|
380
387
|
"\n fragment LedgerRecordsTableFields on LedgerRecord {\n id\n creditAccount1 {\n __typename\n id\n name\n }\n creditAccount2 {\n __typename\n id\n name\n }\n debitAccount1 {\n __typename\n id\n name\n }\n debitAccount2 {\n __typename\n id\n name\n }\n creditAmount1 {\n formatted\n currency\n }\n creditAmount2 {\n formatted\n currency\n }\n debitAmount1 {\n formatted\n currency\n }\n debitAmount2 {\n formatted\n currency\n }\n localCurrencyCreditAmount1 {\n formatted\n raw\n }\n localCurrencyCreditAmount2 {\n formatted\n raw\n }\n localCurrencyDebitAmount1 {\n formatted\n raw\n }\n localCurrencyDebitAmount2 {\n formatted\n raw\n }\n invoiceDate\n valueDate\n description\n reference\n }\n": types.LedgerRecordsTableFieldsFragmentDoc,
|
|
@@ -413,6 +420,7 @@ const documents: Documents = {
|
|
|
413
420
|
"\n fragment SalariesTableFields on Salary {\n month\n employee {\n id\n }\n ...SalariesMonthFields\n }\n": types.SalariesTableFieldsFragmentDoc,
|
|
414
421
|
"\n fragment SalariesRecordFields on Salary {\n month\n employee {\n id\n }\n ...SalariesRecordEmployeeFields\n ...SalariesRecordMainSalaryFields\n ...SalariesRecordFundsFields\n ...SalariesRecordInsurancesAndTaxesFields\n ...SalariesRecordWorkFrameFields\n }\n": types.SalariesRecordFieldsFragmentDoc,
|
|
415
422
|
"\n query BusinessScreen($businessId: UUID!) {\n business(id: $businessId) {\n id\n ...BusinessPage\n }\n }\n": types.BusinessScreenDocument,
|
|
423
|
+
"\n query ContractsScreen($adminId: UUID!) {\n contractsByAdmin(adminId: $adminId) {\n id\n ...ContractForContractsTableFields\n }\n }\n": types.ContractsScreenDocument,
|
|
416
424
|
"\n query AllCharges($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.AllChargesDocument,
|
|
417
425
|
"\n query ChargeScreen($chargeId: UUID!) {\n charge(chargeId: $chargeId) {\n id\n ...ChargesTableFields\n }\n }\n": types.ChargeScreenDocument,
|
|
418
426
|
"\n query MissingInfoCharges($page: Int, $limit: Int) {\n chargesWithMissingRequiredInfo(page: $page, limit: $limit) {\n nodes {\n id\n ...ChargesTableFields\n }\n pageInfo {\n totalPages\n }\n }\n }\n": types.MissingInfoChargesDocument,
|
|
@@ -569,7 +577,7 @@ export function graphql(source: "\n query BusinessTripsScreen {\n allBusines
|
|
|
569
577
|
/**
|
|
570
578
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
571
579
|
*/
|
|
572
|
-
export function graphql(source: "\n fragment BusinessAdminSection on Business {\n id\n ... on LtdFinancialEntity {\n adminInfo {\n id\n
|
|
580
|
+
export function graphql(source: "\n fragment BusinessAdminSection on Business {\n id\n ... on LtdFinancialEntity {\n adminInfo {\n id\n withholdingTaxBookNumber\n withholdingTaxFileNumber\n socialSecurityEmployerId\n taxAdvancesRate\n taxAdvancesId\n registrationDate\n }\n }\n }\n"): (typeof documents)["\n fragment BusinessAdminSection on Business {\n id\n ... on LtdFinancialEntity {\n adminInfo {\n id\n withholdingTaxBookNumber\n withholdingTaxFileNumber\n socialSecurityEmployerId\n taxAdvancesRate\n taxAdvancesId\n registrationDate\n }\n }\n }\n"];
|
|
573
581
|
/**
|
|
574
582
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
575
583
|
*/
|
|
@@ -730,6 +738,10 @@ export function graphql(source: "\n fragment MonthlyIncomeExpenseChartInfo on I
|
|
|
730
738
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
731
739
|
*/
|
|
732
740
|
export function graphql(source: "\n query MonthlyIncomeExpenseChart($filters: IncomeExpenseChartFilters!) {\n incomeExpenseChart(filters: $filters) {\n fromDate\n toDate\n currency\n ...MonthlyIncomeExpenseChartInfo\n }\n }\n"): (typeof documents)["\n query MonthlyIncomeExpenseChart($filters: IncomeExpenseChartFilters!) {\n incomeExpenseChart(filters: $filters) {\n fromDate\n toDate\n currency\n ...MonthlyIncomeExpenseChartInfo\n }\n }\n"];
|
|
741
|
+
/**
|
|
742
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
743
|
+
*/
|
|
744
|
+
export function graphql(source: "\n query ContractsEditModal($contractId: UUID!) {\n contractsById(id: $contractId) {\n id\n startDate\n endDate\n purchaseOrders\n amount {\n raw\n currency\n }\n product\n msCloud\n billingCycle\n plan\n isActive\n remarks\n documentType\n operationsLimit\n }\n }\n"): (typeof documents)["\n query ContractsEditModal($contractId: UUID!) {\n contractsById(id: $contractId) {\n id\n startDate\n endDate\n purchaseOrders\n amount {\n raw\n currency\n }\n product\n msCloud\n billingCycle\n plan\n isActive\n remarks\n documentType\n operationsLimit\n }\n }\n"];
|
|
733
745
|
/**
|
|
734
746
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
735
747
|
*/
|
|
@@ -962,6 +974,14 @@ export function graphql(source: "\n query UniformFormat($fromDate: TimelessDate
|
|
|
962
974
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
963
975
|
*/
|
|
964
976
|
export function graphql(source: "\n fragment NewFetchedDocumentFields on Document {\n id\n documentType\n charge {\n id\n userDescription\n counterparty {\n id\n name\n }\n }\n }\n"): (typeof documents)["\n fragment NewFetchedDocumentFields on Document {\n id\n documentType\n charge {\n id\n userDescription\n counterparty {\n id\n name\n }\n }\n }\n"];
|
|
977
|
+
/**
|
|
978
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
979
|
+
*/
|
|
980
|
+
export function graphql(source: "\n fragment ContractForContractsTableFields on Contract {\n id\n isActive\n client {\n id\n originalBusiness {\n id\n name\n }\n }\n purchaseOrders\n startDate\n endDate\n amount {\n raw\n formatted\n }\n billingCycle\n product\n plan\n operationsLimit\n msCloud\n # documentType\n # remarks\n # operationsLimit\n }\n"): (typeof documents)["\n fragment ContractForContractsTableFields on Contract {\n id\n isActive\n client {\n id\n originalBusiness {\n id\n name\n }\n }\n purchaseOrders\n startDate\n endDate\n amount {\n raw\n formatted\n }\n billingCycle\n product\n plan\n operationsLimit\n msCloud\n # documentType\n # remarks\n # operationsLimit\n }\n"];
|
|
981
|
+
/**
|
|
982
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
983
|
+
*/
|
|
984
|
+
export function graphql(source: "\n query ContractBasedDocumentDrafts($issueMonth: TimelessDate!, $contractIds: [UUID!]!) {\n clientChargesDraftsByContracts(issueMonth: $issueMonth, contractIds: $contractIds) {\n ...NewDocumentInfo\n }\n }\n"): (typeof documents)["\n query ContractBasedDocumentDrafts($issueMonth: TimelessDate!, $contractIds: [UUID!]!) {\n clientChargesDraftsByContracts(issueMonth: $issueMonth, contractIds: $contractIds) {\n ...NewDocumentInfo\n }\n }\n"];
|
|
965
985
|
/**
|
|
966
986
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
967
987
|
*/
|
|
@@ -1114,6 +1134,10 @@ export function graphql(source: "\n fragment SalariesRecordFields on Salary {\n
|
|
|
1114
1134
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
1115
1135
|
*/
|
|
1116
1136
|
export function graphql(source: "\n query BusinessScreen($businessId: UUID!) {\n business(id: $businessId) {\n id\n ...BusinessPage\n }\n }\n"): (typeof documents)["\n query BusinessScreen($businessId: UUID!) {\n business(id: $businessId) {\n id\n ...BusinessPage\n }\n }\n"];
|
|
1137
|
+
/**
|
|
1138
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
1139
|
+
*/
|
|
1140
|
+
export function graphql(source: "\n query ContractsScreen($adminId: UUID!) {\n contractsByAdmin(adminId: $adminId) {\n id\n ...ContractForContractsTableFields\n }\n }\n"): (typeof documents)["\n query ContractsScreen($adminId: UUID!) {\n contractsByAdmin(adminId: $adminId) {\n id\n ...ContractForContractsTableFields\n }\n }\n"];
|
|
1117
1141
|
/**
|
|
1118
1142
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
1119
1143
|
*/
|