@accounter/client 0.0.8-alpha-20251028123619-bcce9ab485db2997b6b76ff0df765834d86f30e7 → 0.0.8-alpha-20251028124234-328844c99a42b68aa9e2f32fd86da80b4832f631
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 +13 -13
- package/dist/assets/{Checkbox-BZ680-Kk.js → Checkbox-BR6kGuhg.js} +2 -2
- package/dist/assets/MultiSelect-BqcJrWnD.js +1 -0
- package/dist/assets/Pagination-6Sv5LXxl.js +1 -0
- package/dist/assets/{Progress-DembKoIO.js → Progress-7xtiFwK3.js} +1 -1
- package/dist/assets/Table-C5zxD95i.js +1 -0
- package/dist/assets/Typography-CMzSQZKD.js +1 -0
- package/dist/assets/YearPickerInput-CllwSjcn.js +1 -0
- package/dist/assets/accordion-CMR2fANH.js +1 -0
- package/dist/assets/accountant-approvals-BHFXpHHc.js +1 -0
- package/dist/assets/accounter-table-CpeQD4PG.js +1 -0
- package/dist/assets/addDays-DvwuJbUs.js +1 -0
- package/dist/assets/all-charges-At7WJXuW.js +1 -0
- package/dist/assets/{arrow-up-down-J9wnXx-h.js → arrow-up-down-DPG1l9S1.js} +1 -1
- package/dist/assets/{building-2-1saARtmG.js → building-2-BgvPBt2Z.js} +1 -1
- package/dist/assets/business-DKvbSnga.js +32 -0
- package/dist/assets/business-extended-info-7CM8px2e.js +13 -0
- package/dist/assets/{business-header-SAnNK6FP.js → business-header-u2sfE_d8.js} +1 -1
- package/dist/assets/business-transactions-filters-DmpO9Bwo.js +1 -0
- package/dist/assets/business-transactions-single-rF6JbAL7.js +1 -0
- package/dist/assets/business-trip-BGrp09N7.js +1 -0
- package/dist/assets/charge-C-EaA1Xc.js +1 -0
- package/dist/assets/charges-filters-Dq-8QHH-.js +1 -0
- package/dist/assets/charges-ledger-validation-DlkzVow7.js +1 -0
- package/dist/assets/charges-table-Cncs1HLi.js +62 -0
- package/dist/assets/{chart-Dq5fMHeT.js → chart-ByngRufj.js} +6 -6
- package/dist/assets/create-event-handler-BiA-1lGu.js +1 -0
- package/dist/assets/{data-table-pagination-4YqSgXqX.js → data-table-pagination-D4OEFmX_.js} +1 -1
- package/dist/assets/download-csv-button-Df5rDeDc.js +1 -0
- package/dist/assets/editable-business-trip-Bav24z0u.js +16 -0
- package/dist/assets/funnel-BJ71hzoq.js +6 -0
- package/dist/assets/index-BRv0JZw4.js +1 -0
- package/dist/assets/index-BXlS8oD_.js +1 -0
- package/dist/assets/{index-BYoh_mMo.js → index-BetG0HVN.js} +3 -3
- package/dist/assets/index-BplSRMAq.css +1 -0
- package/dist/assets/{index-B4-_AJ5N.js → index-Bsl7tJp_.js} +16 -16
- package/dist/assets/{index-sA_45leD.js → index-CLUhAJ3t.js} +3 -3
- package/dist/assets/index-Cix5qjA-.js +2 -0
- package/dist/assets/index-CizLtiES.js +1 -0
- package/dist/assets/index-DKBzv0gc.js +1 -0
- package/dist/assets/index-DR_5jpS4.js +6 -0
- package/dist/assets/index-DTmtILfq.js +1 -0
- package/dist/assets/index-DU0G7FZm.js +1 -0
- package/dist/assets/index-DUWRgLfu.js +9 -0
- package/dist/assets/index-DYZPWG4k.js +2 -0
- package/dist/assets/index-DdUE2_44.js +1 -0
- package/dist/assets/index-De5dvO0S.js +1 -0
- package/dist/assets/index-Des3eR4f.js +1 -0
- package/dist/assets/index-DpYwi5kf.js +6 -0
- package/dist/assets/index-GzyQZkbY.js +1 -0
- package/dist/assets/index-HzLXi-qB.js +1 -0
- package/dist/assets/index-Ji28AZwq.js +1 -0
- package/dist/assets/{index-AxUq37Ea.js → index-UMFH47hN.js} +2 -2
- package/dist/assets/index-fuT9duEO.js +1 -0
- package/dist/assets/{index-CBQNwu37.js → index-vChLJwSt.js} +2 -2
- package/dist/assets/index-wck8Xuay.js +1 -0
- package/dist/assets/index-wyU9I4Kz.js +768 -0
- package/dist/assets/{index.es-Dwfw0glc.js → index.es-NphQjU3m.js} +1 -1
- package/dist/assets/insert-business-trip-modal-vS1QrUJz.js +6 -0
- package/dist/assets/issue-document-pIswc_8i.js +1 -0
- package/dist/assets/list-plus-Dy3vzJVy.js +6 -0
- package/dist/assets/login-page-YXRfklK1.js +1 -0
- package/dist/assets/match-document-modal-BPG_hljb.js +16 -0
- package/dist/assets/missing-info-charges-D8dUfChs.js +1 -0
- package/dist/assets/modal-D47umnak.js +1 -0
- package/dist/assets/page-layout-BG0XvWfD.js +1 -0
- package/dist/assets/page-not-found-Cy6oIIb1.js +1 -0
- package/dist/assets/panel-top-open-B1rhJYjQ.js +11 -0
- package/dist/assets/{pencil-CYypGy_s.js → pencil-tV0FsM6V.js} +1 -1
- package/dist/assets/report-commentary-row-BL2RkIHq.js +1 -0
- package/dist/assets/{save-BE7zhMeq.js → save-Czmh3tvC.js} +1 -1
- package/dist/assets/similar-transactions-modal-MQeC2gtu.js +1 -0
- package/dist/assets/sub-B4_VmmF9.js +1 -0
- package/dist/assets/subMonths-DG7w6bCY.js +1 -0
- package/dist/assets/summary-DvHtnArZ.js +1 -0
- package/dist/assets/switch-GSloW_Ey.js +1 -0
- package/dist/assets/toggle-expansion-button-lwJYTklN.js +1 -0
- package/dist/assets/tooltip-BbKSwLCX.js +1 -0
- package/dist/assets/use-url-query-CUVSXgm0.js +1 -0
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/src/components/business/contracts-section.tsx +0 -7
- package/src/components/business-transactions/business-extended-info.tsx +5 -5
- package/src/components/business-transactions/index.tsx +1 -28
- package/src/components/businesses/index.tsx +6 -2
- package/src/components/charges/cells/business-trip.tsx +6 -1
- package/src/components/charges/cells/counterparty.tsx +4 -28
- package/src/components/clients/contracts/modify-contract-dialog.tsx +3 -7
- package/src/components/common/business-trip-report/parts/core-expense-row.tsx +2 -2
- package/src/components/common/business-trip-report/parts/report-header.tsx +2 -1
- package/src/components/common/business-trip-report/parts/uncategorized-transactions.tsx +2 -2
- package/src/components/common/buttons/charge-navigate-button.tsx +12 -11
- package/src/components/common/modals/edit-charge-modal.tsx +2 -2
- package/src/components/common/modals/insert-document-modal.tsx +2 -2
- package/src/components/common/modals/match-document-modal.tsx +2 -2
- package/src/components/common/new-documents-list.tsx +2 -2
- package/src/components/documents-table/cells/creditor.tsx +2 -11
- package/src/components/documents-table/cells/debtor.tsx +2 -11
- package/src/components/ledger-table/counterparty-cell.tsx +4 -33
- package/src/components/reports/conto/index.tsx +1 -18
- package/src/components/reports/trial-balance-report/index.tsx +1 -17
- package/src/components/screens/businesses/business.tsx +0 -4
- package/src/components/screens/charges/all-charges.tsx +1 -17
- package/src/components/screens/charges/charge.tsx +0 -4
- package/src/components/screens/reports/balance-report/index.tsx +0 -14
- package/src/components/screens/reports/depreciation-report/index.tsx +0 -14
- package/src/components/transactions-table/cells/counterparty.tsx +2 -23
- package/src/components/transactions-table/cells-legacy/counterparty.tsx +3 -26
- package/src/gql/gql.ts +3 -3
- package/src/gql/graphql.ts +2 -5
- package/src/providers/urql.tsx +2 -2
- package/dist/assets/Typography-DPXB3hIS.js +0 -1
- package/dist/assets/accordion-UZwiz3fM.js +0 -1
- package/dist/assets/accountant-approvals-DDxSuMql.js +0 -1
- package/dist/assets/all-charges-BCP7OG1d.js +0 -1
- package/dist/assets/business-CBRlGy9p.js +0 -32
- package/dist/assets/business-transactions-single-DvPZFvmH.js +0 -1
- package/dist/assets/business-trip-g2hB76cn.js +0 -1
- package/dist/assets/charges-filters-T9c4RGLH.js +0 -1
- package/dist/assets/charges-ledger-validation-DaD8DCN4.js +0 -1
- package/dist/assets/editable-business-trip-B95j7iAh.js +0 -16
- package/dist/assets/index-5Fl36gjg.js +0 -1
- package/dist/assets/index-BDKAR_k1.js +0 -1
- package/dist/assets/index-BKXeyD9a.js +0 -1
- package/dist/assets/index-BPSZWRv9.js +0 -9
- package/dist/assets/index-BVetJA6_.js +0 -6
- package/dist/assets/index-BXp9NrWt.js +0 -1
- package/dist/assets/index-Br0-IMSG.js +0 -1
- package/dist/assets/index-Bw6OrQ7c.js +0 -1
- package/dist/assets/index-C3bFFbEz.js +0 -1
- package/dist/assets/index-CDIzaROV.js +0 -2
- package/dist/assets/index-CgQ4Qjvh.js +0 -886
- package/dist/assets/index-D4O5HA1y.js +0 -1
- package/dist/assets/index-DAbvR7_s.js +0 -1
- package/dist/assets/index-DkwmPZgt.js +0 -1
- package/dist/assets/index-DpsNoHLd.js +0 -2
- package/dist/assets/index-DtE5Y1ZB.css +0 -1
- package/dist/assets/index-k-cHMsFi.js +0 -1
- package/dist/assets/index-vkYxo-Uq.js +0 -1
- package/dist/assets/index-vstSRm8a.js +0 -1
- package/dist/assets/issue-document-umUFIxCu.js +0 -1
- package/dist/assets/login-page-Ck61EC35.js +0 -1
- package/dist/assets/missing-info-charges-aak-KkPt.js +0 -1
- package/dist/assets/page-not-found-Dzg-czJK.js +0 -1
- package/dist/assets/report-commentary-row-B479zk-x.js +0 -1
- package/dist/assets/sub-BxFupCKS.js +0 -1
- package/dist/assets/subMonths-DskeQPiN.js +0 -1
- package/src/components/charges/helpers.ts +0 -15
package/package.json
CHANGED
|
@@ -35,7 +35,6 @@ import {
|
|
|
35
35
|
remarks
|
|
36
36
|
plan
|
|
37
37
|
msCloud
|
|
38
|
-
operationsLimit
|
|
39
38
|
}
|
|
40
39
|
}
|
|
41
40
|
`;
|
|
@@ -59,7 +58,6 @@ function convertContractDataToFormValues(
|
|
|
59
58
|
subscriptionPlan: contract.plan ?? undefined,
|
|
60
59
|
defaultRemark: contract.remarks ?? undefined,
|
|
61
60
|
defaultDocumentType: contract.documentType ?? undefined,
|
|
62
|
-
operationsLimit: contract.operationsLimit,
|
|
63
61
|
};
|
|
64
62
|
}
|
|
65
63
|
|
|
@@ -163,11 +161,6 @@ export function ContractsSection({ clientId }: Props) {
|
|
|
163
161
|
</p>
|
|
164
162
|
</div>
|
|
165
163
|
|
|
166
|
-
<div className="space-y-0">
|
|
167
|
-
<p className="text-sm text-muted-foreground">Operations Limit</p>
|
|
168
|
-
<p className="text-sm font-medium">{contract.operationsLimit.toLocaleString()}</p>
|
|
169
|
-
</div>
|
|
170
|
-
|
|
171
164
|
<div className="space-y-0">
|
|
172
165
|
<p className="text-sm text-muted-foreground">Document Type</p>
|
|
173
166
|
<p className="text-sm font-medium">
|
|
@@ -3,6 +3,7 @@ import { format } from 'date-fns';
|
|
|
3
3
|
import { ChevronsLeftRightEllipsis, ChevronsRightLeft } from 'lucide-react';
|
|
4
4
|
import { Link } from 'react-router-dom';
|
|
5
5
|
import { useQuery } from 'urql';
|
|
6
|
+
import { ROUTES } from '@/router/routes.js';
|
|
6
7
|
import { Mark, Table, Tooltip } from '@mantine/core';
|
|
7
8
|
import {
|
|
8
9
|
BusinessTransactionsInfoDocument,
|
|
@@ -12,10 +13,8 @@ import {
|
|
|
12
13
|
} from '../../gql/graphql.js';
|
|
13
14
|
import { FIAT_CURRENCIES, formatAmountWithCurrency } from '../../helpers/index.js';
|
|
14
15
|
import { AccounterLoader } from '../common/index.js';
|
|
15
|
-
import { getChargeHref } from '../screens/charges/charge.js';
|
|
16
16
|
import { Button } from '../ui/button.js';
|
|
17
17
|
import { DownloadCSV } from './download-csv.js';
|
|
18
|
-
import { getBusinessTransactionsHref } from './index.js';
|
|
19
18
|
|
|
20
19
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- used by codegen
|
|
21
20
|
/* GraphQL */ `
|
|
@@ -229,14 +228,15 @@ export function BusinessExtendedInfo({ businessID, filter }: Props): ReactElemen
|
|
|
229
228
|
{extendedTransactions.map((row, index) => (
|
|
230
229
|
<tr
|
|
231
230
|
key={index}
|
|
231
|
+
className="cursor-pointer"
|
|
232
232
|
onClick={event => {
|
|
233
233
|
event.stopPropagation();
|
|
234
|
-
window.open(
|
|
234
|
+
window.open(ROUTES.CHARGES.DETAIL(row.chargeId), '_blank', 'noreferrer');
|
|
235
235
|
}}
|
|
236
236
|
>
|
|
237
237
|
<td>
|
|
238
238
|
<Link
|
|
239
|
-
to={
|
|
239
|
+
to={ROUTES.BUSINESSES.DETAIL(row.business.id)}
|
|
240
240
|
target="_blank"
|
|
241
241
|
rel="noreferrer"
|
|
242
242
|
onClick={event => event.stopPropagation()}
|
|
@@ -274,7 +274,7 @@ export function BusinessExtendedInfo({ businessID, filter }: Props): ReactElemen
|
|
|
274
274
|
<td>
|
|
275
275
|
{row.counterAccount && (
|
|
276
276
|
<Link
|
|
277
|
-
to={
|
|
277
|
+
to={ROUTES.BUSINESSES.DETAIL(row.counterAccount.id)}
|
|
278
278
|
target="_blank"
|
|
279
279
|
rel="noreferrer"
|
|
280
280
|
onClick={event => event.stopPropagation()}
|
|
@@ -21,10 +21,7 @@ import { AccounterTableRow } from '../common/index.js';
|
|
|
21
21
|
import { PageLayout } from '../layout/page-layout.js';
|
|
22
22
|
import { Button } from '../ui/button.js';
|
|
23
23
|
import { BusinessExtendedInfo } from './business-extended-info.js';
|
|
24
|
-
import {
|
|
25
|
-
BusinessTransactionsFilters,
|
|
26
|
-
encodeTransactionsFilters,
|
|
27
|
-
} from './business-transactions-filters.js';
|
|
24
|
+
import { BusinessTransactionsFilters } from './business-transactions-filters.js';
|
|
28
25
|
|
|
29
26
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- used by codegen
|
|
30
27
|
/* GraphQL */ `
|
|
@@ -69,30 +66,6 @@ import {
|
|
|
69
66
|
}
|
|
70
67
|
`;
|
|
71
68
|
|
|
72
|
-
export function getBusinessTransactionsHref(filter?: BusinessTransactionsFilter | null): string {
|
|
73
|
-
const params = new URLSearchParams();
|
|
74
|
-
|
|
75
|
-
let businessId: string | undefined = undefined;
|
|
76
|
-
let adjustedFilter = filter;
|
|
77
|
-
if (filter?.businessIDs && filter.businessIDs.length === 1) {
|
|
78
|
-
const { businessIDs, ...rest } = filter;
|
|
79
|
-
businessId = businessIDs[0];
|
|
80
|
-
adjustedFilter = rest;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const transactionsFilters = encodeTransactionsFilters(adjustedFilter);
|
|
84
|
-
if (transactionsFilters) {
|
|
85
|
-
// Add it as a single encoded parameter
|
|
86
|
-
params.append('transactionsFilters', transactionsFilters);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const queryParams = params.size > 0 ? `?${params}` : '';
|
|
90
|
-
if (businessId) {
|
|
91
|
-
return `/businesses/${businessId}/transactions${queryParams}`;
|
|
92
|
-
}
|
|
93
|
-
return `/businesses/transactions${queryParams}`;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
69
|
type BusinessTransactionsSum = Extract<
|
|
97
70
|
BusinessTransactionsSummeryQuery['businessTransactionsSumFromLedgerRecords'],
|
|
98
71
|
{ businessTransactionsSum: unknown }
|
|
@@ -159,12 +159,16 @@ export const Businesses = (): ReactElement => {
|
|
|
159
159
|
tabIndex={0}
|
|
160
160
|
className="flex-1 cursor-pointer"
|
|
161
161
|
onClick={(): void => {
|
|
162
|
-
navigate(ROUTES.BUSINESSES.DETAIL(business.id)
|
|
162
|
+
navigate(ROUTES.BUSINESSES.DETAIL(business.id), {
|
|
163
|
+
state: { from: ROUTES.BUSINESSES.ALL },
|
|
164
|
+
});
|
|
163
165
|
}}
|
|
164
166
|
onKeyDown={(e): void => {
|
|
165
167
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
166
168
|
e.preventDefault();
|
|
167
|
-
navigate(ROUTES.BUSINESSES.DETAIL(business.id)
|
|
169
|
+
navigate(ROUTES.BUSINESSES.DETAIL(business.id), {
|
|
170
|
+
state: { from: ROUTES.BUSINESSES.ALL },
|
|
171
|
+
});
|
|
168
172
|
}
|
|
169
173
|
}}
|
|
170
174
|
>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import { Link } from 'react-router-dom';
|
|
3
|
+
import { ROUTES } from '@/router/routes.js';
|
|
3
4
|
import { ChargesTableBusinessTripFieldsFragmentDoc } from '../../../gql/graphql.js';
|
|
4
5
|
import { getFragmentData, type FragmentType } from '../../../gql/index.js';
|
|
5
6
|
|
|
@@ -30,7 +31,11 @@ export const BusinessTrip = ({ data }: Props): ReactElement => {
|
|
|
30
31
|
return (
|
|
31
32
|
<td>
|
|
32
33
|
<Link
|
|
33
|
-
to={
|
|
34
|
+
to={
|
|
35
|
+
charge.businessTrip?.id
|
|
36
|
+
? ROUTES.BUSINESS_TRIPS.DETAIL(charge.businessTrip?.id)
|
|
37
|
+
: ROUTES.BUSINESS_TRIPS.ROOT
|
|
38
|
+
}
|
|
34
39
|
target="_blank"
|
|
35
40
|
rel="noreferrer"
|
|
36
41
|
onClick={event => event.stopPropagation()}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useMemo, type ReactElement } from 'react';
|
|
2
2
|
import { Link } from 'react-router-dom';
|
|
3
|
+
import { ROUTES } from '@/router/routes.js';
|
|
3
4
|
import { Indicator } from '@mantine/core';
|
|
4
|
-
import {
|
|
5
|
-
ChargesTableEntityFieldsFragmentDoc,
|
|
6
|
-
MissingChargeInfo,
|
|
7
|
-
type ChargeFilter,
|
|
8
|
-
} from '../../../gql/graphql.js';
|
|
5
|
+
import { ChargesTableEntityFieldsFragmentDoc, MissingChargeInfo } from '../../../gql/graphql.js';
|
|
9
6
|
import { getFragmentData, type FragmentType } from '../../../gql/index.js';
|
|
10
|
-
import { useUrlQuery } from '../../../hooks/use-url-query.js';
|
|
11
|
-
import { getBusinessTransactionsHref } from '../../business-transactions/index.js';
|
|
12
7
|
|
|
13
8
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- used by codegen
|
|
14
9
|
/* GraphQL */ `
|
|
@@ -32,7 +27,6 @@ type Props = {
|
|
|
32
27
|
};
|
|
33
28
|
|
|
34
29
|
export const Counterparty = ({ data }: Props): ReactElement => {
|
|
35
|
-
const { get } = useUrlQuery();
|
|
36
30
|
const { counterparty, validationData, __typename } = getFragmentData(
|
|
37
31
|
ChargesTableEntityFieldsFragmentDoc,
|
|
38
32
|
data,
|
|
@@ -59,31 +53,13 @@ export const Counterparty = ({ data }: Props): ReactElement => {
|
|
|
59
53
|
);
|
|
60
54
|
const { name, id } = counterparty ?? { name: 'Missing', id: undefined };
|
|
61
55
|
|
|
62
|
-
const encodedFilters = get('chargesFilters');
|
|
63
|
-
|
|
64
|
-
const getHref = useCallback(
|
|
65
|
-
(businessID: string) => {
|
|
66
|
-
const currentFilters = encodedFilters
|
|
67
|
-
? (JSON.parse(decodeURIComponent(encodedFilters as string)) as ChargeFilter)
|
|
68
|
-
: {};
|
|
69
|
-
|
|
70
|
-
return getBusinessTransactionsHref({
|
|
71
|
-
fromDate: currentFilters.fromDate,
|
|
72
|
-
toDate: currentFilters.toDate,
|
|
73
|
-
ownerIds: currentFilters.byOwners,
|
|
74
|
-
businessIDs: [businessID],
|
|
75
|
-
});
|
|
76
|
-
},
|
|
77
|
-
[encodedFilters],
|
|
78
|
-
);
|
|
79
|
-
|
|
80
56
|
return (
|
|
81
57
|
<td>
|
|
82
58
|
<div className="flex flex-wrap">
|
|
83
59
|
<Indicator inline size={12} disabled={!isError} color="red" zIndex="auto">
|
|
84
60
|
{!isError && id && (
|
|
85
61
|
<Link
|
|
86
|
-
to={
|
|
62
|
+
to={ROUTES.BUSINESSES.DETAIL(id)}
|
|
87
63
|
target="_blank"
|
|
88
64
|
rel="noreferrer"
|
|
89
65
|
onClick={event => event.stopPropagation()}
|
|
@@ -58,7 +58,6 @@ const contractFormSchema = z.object({
|
|
|
58
58
|
isActive: z.boolean(),
|
|
59
59
|
defaultRemark: z.string().optional(),
|
|
60
60
|
defaultDocumentType: z.enum(Object.values(DocumentType)),
|
|
61
|
-
operationsLimit: z.int().min(0, 'Operations limit must be non-negative'),
|
|
62
61
|
});
|
|
63
62
|
|
|
64
63
|
export type ContractFormValues = z.infer<typeof contractFormSchema>;
|
|
@@ -78,7 +77,6 @@ const newContractDefaultValues: ContractFormValues = {
|
|
|
78
77
|
isActive: true,
|
|
79
78
|
defaultRemark: undefined,
|
|
80
79
|
defaultDocumentType: DocumentType.Proforma,
|
|
81
|
-
operationsLimit: 0,
|
|
82
80
|
};
|
|
83
81
|
|
|
84
82
|
interface Props {
|
|
@@ -117,7 +115,6 @@ export function ModifyContractDialog({ clientId, contract, onDone }: Props) {
|
|
|
117
115
|
isActive: contract.isActive,
|
|
118
116
|
defaultRemark: contract.defaultRemark,
|
|
119
117
|
defaultDocumentType: contract.defaultDocumentType,
|
|
120
|
-
operationsLimit: contract.operationsLimit,
|
|
121
118
|
});
|
|
122
119
|
setIsDialogOpen(true);
|
|
123
120
|
}
|
|
@@ -147,7 +144,6 @@ export function ModifyContractDialog({ clientId, contract, onDone }: Props) {
|
|
|
147
144
|
purchaseOrder: values.po,
|
|
148
145
|
remarks: values.defaultRemark,
|
|
149
146
|
startDate: format(new Date(values.startDate), 'yyyy-MM-dd') as TimelessDateString,
|
|
150
|
-
operationsLimit: values.operationsLimit,
|
|
151
147
|
},
|
|
152
148
|
});
|
|
153
149
|
} else {
|
|
@@ -170,7 +166,6 @@ export function ModifyContractDialog({ clientId, contract, onDone }: Props) {
|
|
|
170
166
|
purchaseOrder: values.po,
|
|
171
167
|
remarks: values.defaultRemark,
|
|
172
168
|
startDate: format(new Date(values.startDate), 'yyyy-MM-dd') as TimelessDateString,
|
|
173
|
-
operationsLimit: values.operationsLimit,
|
|
174
169
|
},
|
|
175
170
|
});
|
|
176
171
|
}
|
|
@@ -202,7 +197,8 @@ export function ModifyContractDialog({ clientId, contract, onDone }: Props) {
|
|
|
202
197
|
<form onSubmit={form.handleSubmit(onSubmit)}>
|
|
203
198
|
<div className="grid gap-4 py-4">
|
|
204
199
|
<div className="grid gap-4 md:grid-cols-2">
|
|
205
|
-
|
|
200
|
+
{/* TODO: activate this field later. requires additional backend support */}
|
|
201
|
+
{/* <FormField
|
|
206
202
|
control={form.control}
|
|
207
203
|
name="operationsLimit"
|
|
208
204
|
render={({ field }) => (
|
|
@@ -214,7 +210,7 @@ export function ModifyContractDialog({ clientId, contract, onDone }: Props) {
|
|
|
214
210
|
<FormMessage />
|
|
215
211
|
</FormItem>
|
|
216
212
|
)}
|
|
217
|
-
/>
|
|
213
|
+
/> */}
|
|
218
214
|
<FormField
|
|
219
215
|
control={form.control}
|
|
220
216
|
name="po"
|
|
@@ -4,6 +4,7 @@ import { Controller, type Control } from 'react-hook-form';
|
|
|
4
4
|
import { Link } from 'react-router-dom';
|
|
5
5
|
import { toast } from 'sonner';
|
|
6
6
|
import { useQuery } from 'urql';
|
|
7
|
+
import { ROUTES } from '@/router/routes.js';
|
|
7
8
|
import { Select, Text } from '@mantine/core';
|
|
8
9
|
import { DatePickerInput } from '@mantine/dates';
|
|
9
10
|
import {
|
|
@@ -14,7 +15,6 @@ import {
|
|
|
14
15
|
} from '../../../../gql/graphql.js';
|
|
15
16
|
import { getFragmentData, type FragmentType } from '../../../../gql/index.js';
|
|
16
17
|
import { TIMELESS_DATE_REGEX } from '../../../../helpers/consts.js';
|
|
17
|
-
import { getChargeHref } from '../../../screens/charges/charge.js';
|
|
18
18
|
import { CurrencyInput } from '../../index.js';
|
|
19
19
|
|
|
20
20
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- used by codegen
|
|
@@ -239,7 +239,7 @@ export const CoreExpenseRow = ({
|
|
|
239
239
|
{linkedChargeIds.map(id => (
|
|
240
240
|
<Link
|
|
241
241
|
key={id}
|
|
242
|
-
to={
|
|
242
|
+
to={ROUTES.CHARGES.DETAIL(id)}
|
|
243
243
|
target="_blank"
|
|
244
244
|
rel="noreferrer"
|
|
245
245
|
onClick={event => event.stopPropagation()}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import { differenceInDays, format, setHours } from 'date-fns';
|
|
3
|
+
import { ROUTES } from '@/router/routes.js';
|
|
3
4
|
import { Grid, Text } from '@mantine/core';
|
|
4
5
|
import { BusinessTripReportHeaderFieldsFragmentDoc } from '../../../../gql/graphql.js';
|
|
5
6
|
import { getFragmentData, type FragmentType } from '../../../../gql/index.js';
|
|
@@ -43,7 +44,7 @@ export const ReportHeader = ({ data, onChange }: Props): ReactElement => {
|
|
|
43
44
|
<AccountantApproval data={businessTrip} onChange={onChange} />
|
|
44
45
|
<CopyToClipboardButton
|
|
45
46
|
isLink
|
|
46
|
-
content={`${window.location.origin}
|
|
47
|
+
content={`${window.location.origin}${ROUTES.BUSINESS_TRIPS.DETAIL(businessTrip.id)}`}
|
|
47
48
|
/>
|
|
48
49
|
<BusinessTripToggleMenu businessTripId={businessTrip.id} />
|
|
49
50
|
</div>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import { AlertCircle } from 'lucide-react';
|
|
3
3
|
import { Link } from 'react-router-dom';
|
|
4
|
+
import { ROUTES } from '@/router/routes.js';
|
|
4
5
|
import { Popover, Table, Text } from '@mantine/core';
|
|
5
6
|
import { useDisclosure } from '@mantine/hooks';
|
|
6
7
|
import {
|
|
@@ -10,7 +11,6 @@ import {
|
|
|
10
11
|
} from '../../../../gql/graphql.js';
|
|
11
12
|
import { getFragmentData, type FragmentType } from '../../../../gql/index.js';
|
|
12
13
|
import { formatStringifyAmount } from '../../../../helpers/index.js';
|
|
13
|
-
import { getChargeHref } from '../../../screens/charges/charge.js';
|
|
14
14
|
import {
|
|
15
15
|
Account,
|
|
16
16
|
Counterparty,
|
|
@@ -94,7 +94,7 @@ export const UncategorizedTransactions = ({ data, onChange }: Props): ReactEleme
|
|
|
94
94
|
<Amount data={uncategorizedTransaction} />
|
|
95
95
|
<td>
|
|
96
96
|
<Link
|
|
97
|
-
to={
|
|
97
|
+
to={ROUTES.CHARGES.DETAIL(uncategorizedTransaction.transaction.chargeId)}
|
|
98
98
|
target="_blank"
|
|
99
99
|
rel="noreferrer"
|
|
100
100
|
onClick={event => event.stopPropagation()}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { ComponentProps, ReactElement } from 'react';
|
|
2
2
|
import { ExternalLink } from 'lucide-react';
|
|
3
|
+
import { Link } from 'react-router-dom';
|
|
3
4
|
import { Tooltip } from '@mantine/core';
|
|
4
5
|
import { cn } from '../../../lib/utils.js';
|
|
5
|
-
import {
|
|
6
|
+
import { ROUTES } from '../../../router/routes.js';
|
|
6
7
|
import { Button } from '../../ui/button.js';
|
|
7
8
|
|
|
8
9
|
export function ChargeNavigateButton(
|
|
@@ -10,17 +11,17 @@ export function ChargeNavigateButton(
|
|
|
10
11
|
): ReactElement {
|
|
11
12
|
return (
|
|
12
13
|
<Tooltip label="To Charge">
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
className={cn('size-7.5', props.className)}
|
|
20
|
-
variant="ghost"
|
|
14
|
+
<Link
|
|
15
|
+
to={ROUTES.CHARGES.DETAIL(props.chargeId)}
|
|
16
|
+
target="_blank"
|
|
17
|
+
rel="noreferrer"
|
|
18
|
+
onClick={event => event.stopPropagation()}
|
|
19
|
+
className="inline-block"
|
|
21
20
|
>
|
|
22
|
-
<
|
|
23
|
-
|
|
21
|
+
<Button {...props} className={cn('size-7.5', props.className)} variant="ghost">
|
|
22
|
+
<ExternalLink className="size-5" />
|
|
23
|
+
</Button>
|
|
24
|
+
</Link>
|
|
24
25
|
</Tooltip>
|
|
25
26
|
);
|
|
26
27
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import { useQuery } from 'urql';
|
|
3
|
+
import { ROUTES } from '@/router/routes.js';
|
|
3
4
|
import { Loader } from '@mantine/core';
|
|
4
5
|
import { EditChargeDocument } from '../../../gql/graphql.js';
|
|
5
|
-
import { getChargeHref } from '../../screens/charges/charge.js';
|
|
6
6
|
import { CopyToClipboardButton, EditCharge, PopUpDrawer } from '../index.js';
|
|
7
7
|
|
|
8
8
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- used by codegen
|
|
@@ -89,7 +89,7 @@ export const EditChargeModalContent = ({
|
|
|
89
89
|
ID: {chargeId}
|
|
90
90
|
<CopyToClipboardButton
|
|
91
91
|
isLink
|
|
92
|
-
content={`${window.location.origin}${
|
|
92
|
+
content={`${window.location.origin}${ROUTES.CHARGES.DETAIL(chargeId)}`}
|
|
93
93
|
/>
|
|
94
94
|
</div>
|
|
95
95
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ROUTES } from '@/router/routes.js';
|
|
3
3
|
import { CopyToClipboardButton, InsertDocument, PopUpDrawer } from '../index.js';
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
@@ -24,7 +24,7 @@ export const InsertDocumentModal = ({
|
|
|
24
24
|
Charge ID: {chargeId}
|
|
25
25
|
<CopyToClipboardButton
|
|
26
26
|
isLink
|
|
27
|
-
content={`${window.location.origin}${
|
|
27
|
+
content={`${window.location.origin}${ROUTES.CHARGES.DETAIL(chargeId)}`}
|
|
28
28
|
/>
|
|
29
29
|
</div>
|
|
30
30
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ROUTES } from '@/router/routes.js';
|
|
3
3
|
import { DocumentsToChargeMatcher } from '../documents-to-charge-matcher/index.js';
|
|
4
4
|
import { CopyToClipboardButton, PopUpDrawer } from '../index.js';
|
|
5
5
|
|
|
@@ -25,7 +25,7 @@ export const MatchDocumentModal = ({
|
|
|
25
25
|
Charge ID: {chargeId}
|
|
26
26
|
<CopyToClipboardButton
|
|
27
27
|
isLink
|
|
28
|
-
content={`${window.location.origin}${
|
|
28
|
+
content={`${window.location.origin}${ROUTES.CHARGES.DETAIL(chargeId)}`}
|
|
29
29
|
/>
|
|
30
30
|
</div>
|
|
31
31
|
</div>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import { Link } from 'react-router-dom';
|
|
3
|
+
import { ROUTES } from '@/router/routes.js';
|
|
3
4
|
import { NewFetchedDocumentFieldsFragmentDoc } from '../../gql/graphql.js';
|
|
4
5
|
import { getFragmentData, type FragmentType } from '../../gql/index.js';
|
|
5
|
-
import { getChargeHref } from '../screens/charges/charge.js';
|
|
6
6
|
|
|
7
7
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- used by codegen
|
|
8
8
|
/* GraphQL */ `
|
|
@@ -34,7 +34,7 @@ export const NewDocumentsList = ({ data }: Props): ReactElement => {
|
|
|
34
34
|
.map(doc => (
|
|
35
35
|
<Link
|
|
36
36
|
key={doc.id}
|
|
37
|
-
to={
|
|
37
|
+
to={ROUTES.CHARGES.DETAIL(doc.charge!.id)}
|
|
38
38
|
target="_blank"
|
|
39
39
|
rel="noreferrer"
|
|
40
40
|
onClick={event => event.stopPropagation()}
|
|
@@ -3,9 +3,8 @@ import { Link } from 'react-router-dom';
|
|
|
3
3
|
import { DocumentType } from '@/gql/graphql.js';
|
|
4
4
|
import { useGetBusinesses } from '@/hooks/use-get-businesses.js';
|
|
5
5
|
import { useUpdateDocument } from '@/hooks/use-update-document.js';
|
|
6
|
-
import {
|
|
6
|
+
import { ROUTES } from '@/router/routes.js';
|
|
7
7
|
import { Indicator } from '@mantine/core';
|
|
8
|
-
import { getBusinessHref } from '../../charges/helpers.js';
|
|
9
8
|
import { ConfirmMiniButton, InsertBusiness, SelectWithSearch } from '../../common/index.js';
|
|
10
9
|
import type { DocumentsTableRowType } from '../columns.js';
|
|
11
10
|
|
|
@@ -20,7 +19,6 @@ type Props = {
|
|
|
20
19
|
};
|
|
21
20
|
|
|
22
21
|
export const Creditor = ({ document, onChange }: Props): ReactElement => {
|
|
23
|
-
const { get } = useUrlQuery();
|
|
24
22
|
const dbCreditor = 'creditor' in document ? document.creditor : undefined;
|
|
25
23
|
|
|
26
24
|
const shouldHaveCreditor =
|
|
@@ -30,13 +28,6 @@ export const Creditor = ({ document, onChange }: Props): ReactElement => {
|
|
|
30
28
|
|
|
31
29
|
const { selectableBusinesses, refresh: refreshBusinesses } = useGetBusinesses();
|
|
32
30
|
|
|
33
|
-
const encodedFilters = get('chargesFilters');
|
|
34
|
-
|
|
35
|
-
const getHref = useCallback(
|
|
36
|
-
(businessId: string) => getBusinessHref(businessId, encodedFilters as string),
|
|
37
|
-
[encodedFilters],
|
|
38
|
-
);
|
|
39
|
-
|
|
40
31
|
const suggestedCreditor = useMemo(() => {
|
|
41
32
|
if (dbCreditor || !('missingInfoSuggestions' in document) || !document.missingInfoSuggestions) {
|
|
42
33
|
// case when creditor is already set or no suggestions
|
|
@@ -106,7 +97,7 @@ export const Creditor = ({ document, onChange }: Props): ReactElement => {
|
|
|
106
97
|
{shouldHaveCreditor &&
|
|
107
98
|
(id ? (
|
|
108
99
|
<Link
|
|
109
|
-
to={
|
|
100
|
+
to={ROUTES.BUSINESSES.DETAIL(id)}
|
|
110
101
|
target="_blank"
|
|
111
102
|
rel="noreferrer"
|
|
112
103
|
onClick={event => event.stopPropagation()}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { useCallback, useMemo, useState, type ReactElement } from 'react';
|
|
2
2
|
import { Link } from 'react-router-dom';
|
|
3
3
|
import { useGetBusinesses } from '@/hooks/use-get-businesses.js';
|
|
4
|
+
import { ROUTES } from '@/router/routes.js';
|
|
4
5
|
import { Indicator } from '@mantine/core';
|
|
5
6
|
import { DocumentType } from '../../../gql/graphql.js';
|
|
6
7
|
import { useUpdateDocument } from '../../../hooks/use-update-document.js';
|
|
7
|
-
import { useUrlQuery } from '../../../hooks/use-url-query.js';
|
|
8
|
-
import { getBusinessHref } from '../../charges/helpers.js';
|
|
9
8
|
import { ConfirmMiniButton, InsertBusiness, SelectWithSearch } from '../../common/index.js';
|
|
10
9
|
import type { DocumentsTableRowType } from '../columns.js';
|
|
11
10
|
import { COUNTERPARTIES_LESS_DOCUMENT_TYPES } from './index.js';
|
|
@@ -16,7 +15,6 @@ type Props = {
|
|
|
16
15
|
};
|
|
17
16
|
|
|
18
17
|
export const Debtor = ({ document, onChange }: Props): ReactElement => {
|
|
19
|
-
const { get } = useUrlQuery();
|
|
20
18
|
const dbDebtor = 'debtor' in document ? document.debtor : undefined;
|
|
21
19
|
|
|
22
20
|
const shouldHaveDebtor =
|
|
@@ -26,13 +24,6 @@ export const Debtor = ({ document, onChange }: Props): ReactElement => {
|
|
|
26
24
|
|
|
27
25
|
const { selectableBusinesses, refresh: refreshBusinesses } = useGetBusinesses();
|
|
28
26
|
|
|
29
|
-
const encodedFilters = get('chargesFilters');
|
|
30
|
-
|
|
31
|
-
const getHref = useCallback(
|
|
32
|
-
(businessId: string) => getBusinessHref(businessId, encodedFilters as string),
|
|
33
|
-
[encodedFilters],
|
|
34
|
-
);
|
|
35
|
-
|
|
36
27
|
const suggestedDebtor = useMemo(() => {
|
|
37
28
|
if (dbDebtor || !('missingInfoSuggestions' in document) || !document.missingInfoSuggestions) {
|
|
38
29
|
// case when creditor is already set or no suggestions
|
|
@@ -102,7 +93,7 @@ export const Debtor = ({ document, onChange }: Props): ReactElement => {
|
|
|
102
93
|
{shouldHaveDebtor &&
|
|
103
94
|
(id ? (
|
|
104
95
|
<Link
|
|
105
|
-
to={
|
|
96
|
+
to={ROUTES.BUSINESSES.DETAIL(id)}
|
|
106
97
|
target="_blank"
|
|
107
98
|
rel="noreferrer"
|
|
108
99
|
onClick={event => event.stopPropagation()}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
2
|
import { Link } from 'react-router-dom';
|
|
3
|
-
import
|
|
4
|
-
import { useUrlQuery } from '../../hooks/use-url-query.js';
|
|
5
|
-
import { getBusinessTransactionsHref } from '../business-transactions/index.js';
|
|
3
|
+
import { ROUTES } from '@/router/routes.js';
|
|
6
4
|
|
|
7
5
|
type Props = {
|
|
8
6
|
account?: {
|
|
@@ -16,33 +14,6 @@ type Props = {
|
|
|
16
14
|
};
|
|
17
15
|
|
|
18
16
|
export const CounterpartyCell = ({ account, diffAccount }: Props): ReactElement => {
|
|
19
|
-
const { get } = useUrlQuery();
|
|
20
|
-
|
|
21
|
-
const encodedFilters = get('chargesFilters');
|
|
22
|
-
|
|
23
|
-
const getHref = useCallback(
|
|
24
|
-
(businessID: string) => {
|
|
25
|
-
let currentFilters: ChargeFilter = {};
|
|
26
|
-
if (encodedFilters) {
|
|
27
|
-
try {
|
|
28
|
-
const decoded = decodeURIComponent(encodedFilters);
|
|
29
|
-
const parsed = JSON.parse(decoded);
|
|
30
|
-
currentFilters = parsed as ChargeFilter;
|
|
31
|
-
} catch (error) {
|
|
32
|
-
console.error('Failed to parse filters from URL:', error);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return getBusinessTransactionsHref({
|
|
37
|
-
ownerIds: currentFilters.byOwners || [],
|
|
38
|
-
businessIDs: [businessID],
|
|
39
|
-
...(currentFilters.fromDate && { fromDate: currentFilters.fromDate }),
|
|
40
|
-
...(currentFilters.toDate && { toDate: currentFilters.toDate }),
|
|
41
|
-
});
|
|
42
|
-
},
|
|
43
|
-
[encodedFilters],
|
|
44
|
-
);
|
|
45
|
-
|
|
46
17
|
const isAccountDiff = diffAccount && diffAccount?.id !== account?.id;
|
|
47
18
|
|
|
48
19
|
return (
|
|
@@ -51,7 +22,7 @@ export const CounterpartyCell = ({ account, diffAccount }: Props): ReactElement
|
|
|
51
22
|
<>
|
|
52
23
|
{account && (
|
|
53
24
|
<Link
|
|
54
|
-
to={
|
|
25
|
+
to={ROUTES.BUSINESSES.DETAIL(account.id)}
|
|
55
26
|
target="_blank"
|
|
56
27
|
rel="noreferrer"
|
|
57
28
|
onClick={event => event.stopPropagation()}
|
|
@@ -63,7 +34,7 @@ export const CounterpartyCell = ({ account, diffAccount }: Props): ReactElement
|
|
|
63
34
|
{isAccountDiff && diffAccount && (
|
|
64
35
|
<div className="border-2 border-yellow-500 rounded-md">
|
|
65
36
|
<Link
|
|
66
|
-
to={
|
|
37
|
+
to={ROUTES.BUSINESSES.DETAIL(diffAccount.id)}
|
|
67
38
|
target="_blank"
|
|
68
39
|
rel="noreferrer"
|
|
69
40
|
onClick={event => event.stopPropagation()}
|
|
@@ -19,11 +19,7 @@ import { Tooltip } from '../../common/index.js';
|
|
|
19
19
|
import { Button } from '../../ui/button.js';
|
|
20
20
|
import { Label } from '../../ui/label.js';
|
|
21
21
|
import { Switch } from '../../ui/switch.js';
|
|
22
|
-
import {
|
|
23
|
-
ContoReportFilters,
|
|
24
|
-
encodeContoReportFilters,
|
|
25
|
-
type ContoReportFiltersType,
|
|
26
|
-
} from './conto-report-filters.js';
|
|
22
|
+
import { ContoReportFilters, type ContoReportFiltersType } from './conto-report-filters.js';
|
|
27
23
|
import { ManageTemplates } from './conto-report-manage-templates.js';
|
|
28
24
|
import { SaveTemplate } from './conto-report-save-template.js';
|
|
29
25
|
import { DownloadCSV } from './download-csv.js';
|
|
@@ -93,19 +89,6 @@ const BANK_TREE_ROOT_ID = 'bank';
|
|
|
93
89
|
export const REPORT_TREE_ROOT_ID = 'report';
|
|
94
90
|
export const CONTO_REPORT_FILTERS_KEY = 'contoReportFilters';
|
|
95
91
|
|
|
96
|
-
export function getContoReportHref(filter?: ContoReportFiltersType | null): string {
|
|
97
|
-
const params = new URLSearchParams();
|
|
98
|
-
|
|
99
|
-
const contoReportFilters = encodeContoReportFilters(filter);
|
|
100
|
-
if (contoReportFilters) {
|
|
101
|
-
// Add it as a single encoded parameter
|
|
102
|
-
params.append(CONTO_REPORT_FILTERS_KEY, contoReportFilters);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
const queryParams = params.size > 0 ? `?${params}` : '';
|
|
106
|
-
return `/reports/conto${queryParams}`;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
92
|
function buildSortCodeFinancialEntitiesMaps(tree: NodeModel<CustomData>[]) {
|
|
110
93
|
const sortCodeMap = new Map<number, string | number>();
|
|
111
94
|
const financialEntitiesMap = new Map<string, string | number>();
|