@saasquatch/mint-components 1.16.0-19 → 1.16.0-20
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/dist/cjs/sqm-banking-info-form_17.cjs.entry.js +49 -22
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.js +30 -13
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.js +1 -1
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/useTaxAndCashDashboard.js +22 -11
- package/dist/esm/sqm-banking-info-form_17.entry.js +50 -23
- package/dist/esm-es5/sqm-banking-info-form_17.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-2d7f9c4e.system.entry.js +1 -0
- package/dist/mint-components/p-37996351.system.js +1 -1
- package/dist/mint-components/{p-f6d876c2.entry.js → p-e69a0b40.entry.js} +18 -12
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.d.ts +1 -0
- package/docs/docs.docx +0 -0
- package/package.json +1 -1
- package/dist/mint-components/p-9b6ac371.system.entry.js +0 -1
|
@@ -5806,19 +5806,36 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
5806
5806
|
function getAlert(status) {
|
|
5807
5807
|
switch (status) {
|
|
5808
5808
|
case "OVER_W9_THRESHOLD":
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5809
|
+
if (states.enforceUsTaxComplianceOption === "CASH_ONLY_DEFER_W9") {
|
|
5810
|
+
return {
|
|
5811
|
+
header: text.w9RequiredHeader,
|
|
5812
|
+
description: global.intl.formatMessage({
|
|
5813
|
+
id: "w9RequiredDescription",
|
|
5814
|
+
defaultMessage: text.w9RequiredDescription,
|
|
5815
|
+
}, {
|
|
5816
|
+
termsAndConditions: (index.h("a", { target: "_blank", href: `https://terms.advocate.impact.com/PayoutTermsAndConditions.html` }, text.termsAndConditions)),
|
|
5817
|
+
}),
|
|
5818
|
+
button: (index.h("sl-button", { style: { marginTop: "var(--sl-spacing-x-small)" }, type: "default", onClick: callbacks.onNewFormClick }, text.w9RequiredButtonText)),
|
|
5819
|
+
alertType: "info",
|
|
5820
|
+
icon: "info-circle",
|
|
5821
|
+
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5822
|
+
};
|
|
5823
|
+
}
|
|
5824
|
+
else {
|
|
5825
|
+
return {
|
|
5826
|
+
header: text.payoutHoldAlertHeader,
|
|
5827
|
+
description: global.intl.formatMessage({
|
|
5828
|
+
id: "payoutHoldAlertDescription",
|
|
5829
|
+
defaultMessage: text.payoutHoldAlertDescription,
|
|
5830
|
+
}, {
|
|
5831
|
+
supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5832
|
+
}),
|
|
5833
|
+
buttonText: null,
|
|
5834
|
+
alertType: "warning",
|
|
5835
|
+
icon: "exclamation-triangle",
|
|
5836
|
+
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5837
|
+
};
|
|
5838
|
+
}
|
|
5822
5839
|
case "VERIFICATION:REQUIRED":
|
|
5823
5840
|
return {
|
|
5824
5841
|
header: text.verificationRequiredHeader,
|
|
@@ -6090,6 +6107,13 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
6090
6107
|
index.h("sqm-invoice-table-data-column", { "column-title": text.earningsAfterTaxColumnTitle, property: "netEarnings" })))))))))));
|
|
6091
6108
|
};
|
|
6092
6109
|
|
|
6110
|
+
const GET_TAX_SETTING = index_module.dist.gql `
|
|
6111
|
+
query getTenantSettings {
|
|
6112
|
+
tenantSettings {
|
|
6113
|
+
enforceUsTaxCompliance
|
|
6114
|
+
}
|
|
6115
|
+
}
|
|
6116
|
+
`;
|
|
6093
6117
|
function getCountryName(countryCode, locale) {
|
|
6094
6118
|
if (!countryCode)
|
|
6095
6119
|
return undefined;
|
|
@@ -6125,11 +6149,12 @@ function getIndirectTaxType(taxInformation) {
|
|
|
6125
6149
|
return "Indirect Tax";
|
|
6126
6150
|
}
|
|
6127
6151
|
const useTaxAndCashDashboard = (props) => {
|
|
6128
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
6152
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
6129
6153
|
const setStep = index_module.En(TAX_CONTEXT_NAMESPACE);
|
|
6130
6154
|
const setContext = index_module.En(TAX_FORM_CONTEXT_NAMESPACE);
|
|
6131
6155
|
const [showDialog, setShowDialog] = stencilHooks_module.useState(false);
|
|
6132
6156
|
const { render, loading: veriffLoading, errors: veriffErrors, } = usePayoutStatus.useVeriffApp();
|
|
6157
|
+
const { data: taxSettingRes } = index_module.wn(GET_TAX_SETTING, {});
|
|
6133
6158
|
const locale = index_module.L();
|
|
6134
6159
|
stencilHooks_module.useEffect(() => {
|
|
6135
6160
|
// Clear override context once on submitted
|
|
@@ -6170,30 +6195,32 @@ const useTaxAndCashDashboard = (props) => {
|
|
|
6170
6195
|
window.removeEventListener(usePayoutStatus.VERIFF_COMPLETE_EVENT_KEY, cb);
|
|
6171
6196
|
};
|
|
6172
6197
|
}, []);
|
|
6198
|
+
const enforceUsTaxComplianceOption = (_e = taxSettingRes === null || taxSettingRes === void 0 ? void 0 : taxSettingRes.tenantSettings) === null || _e === void 0 ? void 0 : _e.enforceUsTaxCompliance;
|
|
6173
6199
|
return {
|
|
6174
6200
|
states: {
|
|
6175
6201
|
dateSubmitted,
|
|
6176
6202
|
documentType,
|
|
6177
6203
|
canEditPayoutInfo: publisher === null || publisher === void 0 ? void 0 : publisher.brandedSignup,
|
|
6178
6204
|
documentTypeString: sqmInvoiceTableView.taxTypeToName(documentType),
|
|
6179
|
-
status: (
|
|
6180
|
-
subRegion: getSubRegionName((
|
|
6181
|
-
subRegionTaxNumber: (
|
|
6182
|
-
qstNumber: (
|
|
6205
|
+
status: (_f = publisher === null || publisher === void 0 ? void 0 : publisher.currentTaxDocument) === null || _f === void 0 ? void 0 : _f.status,
|
|
6206
|
+
subRegion: getSubRegionName((_g = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _g === void 0 ? void 0 : _g.indirectTaxRegion),
|
|
6207
|
+
subRegionTaxNumber: (_h = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _h === void 0 ? void 0 : _h.withholdingTaxId,
|
|
6208
|
+
qstNumber: (_j = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _j === void 0 ? void 0 : _j.additionalTaxId,
|
|
6183
6209
|
indirectTaxType: getIndirectTaxType(publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation),
|
|
6184
|
-
indirectTaxNumber: (
|
|
6210
|
+
indirectTaxNumber: (_k = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _k === void 0 ? void 0 : _k.indirectTaxId,
|
|
6185
6211
|
isBusinessEntity: (publisher === null || publisher === void 0 ? void 0 : publisher.requiredTaxDocumentType) === "W8BENE",
|
|
6186
6212
|
province: provinceName,
|
|
6187
|
-
country: getCountryName((
|
|
6188
|
-
notRegistered: !((
|
|
6213
|
+
country: getCountryName((_l = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _l === void 0 ? void 0 : _l.indirectTaxCountryCode, locale),
|
|
6214
|
+
notRegistered: !((_m = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _m === void 0 ? void 0 : _m.indirectTaxId),
|
|
6189
6215
|
noFormNeeded: !documentType,
|
|
6190
6216
|
disabled: loading,
|
|
6191
6217
|
loading,
|
|
6192
6218
|
loadingError: !!(userError === null || userError === void 0 ? void 0 : userError.message),
|
|
6193
6219
|
showNewFormDialog: showDialog,
|
|
6194
|
-
hasHold: !!((
|
|
6220
|
+
hasHold: !!((_o = publisher === null || publisher === void 0 ? void 0 : publisher.payoutsAccount) === null || _o === void 0 ? void 0 : _o.hold),
|
|
6195
6221
|
payoutStatus,
|
|
6196
6222
|
veriffLoading,
|
|
6223
|
+
enforceUsTaxComplianceOption,
|
|
6197
6224
|
},
|
|
6198
6225
|
callbacks: {
|
|
6199
6226
|
onClick: () => setShowDialog(true),
|
|
@@ -200,19 +200,36 @@ export const TaxAndCashDashboardView = (props) => {
|
|
|
200
200
|
function getAlert(status) {
|
|
201
201
|
switch (status) {
|
|
202
202
|
case "OVER_W9_THRESHOLD":
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
203
|
+
if (states.enforceUsTaxComplianceOption === "CASH_ONLY_DEFER_W9") {
|
|
204
|
+
return {
|
|
205
|
+
header: text.w9RequiredHeader,
|
|
206
|
+
description: intl.formatMessage({
|
|
207
|
+
id: "w9RequiredDescription",
|
|
208
|
+
defaultMessage: text.w9RequiredDescription,
|
|
209
|
+
}, {
|
|
210
|
+
termsAndConditions: (h("a", { target: "_blank", href: `https://terms.advocate.impact.com/PayoutTermsAndConditions.html` }, text.termsAndConditions)),
|
|
211
|
+
}),
|
|
212
|
+
button: (h("sl-button", { style: { marginTop: "var(--sl-spacing-x-small)" }, type: "default", onClick: callbacks.onNewFormClick }, text.w9RequiredButtonText)),
|
|
213
|
+
alertType: "info",
|
|
214
|
+
icon: "info-circle",
|
|
215
|
+
class: sheet.classes.WarningHoldAlertContainer,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
return {
|
|
220
|
+
header: text.payoutHoldAlertHeader,
|
|
221
|
+
description: intl.formatMessage({
|
|
222
|
+
id: "payoutHoldAlertDescription",
|
|
223
|
+
defaultMessage: text.payoutHoldAlertDescription,
|
|
224
|
+
}, {
|
|
225
|
+
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
226
|
+
}),
|
|
227
|
+
buttonText: null,
|
|
228
|
+
alertType: "warning",
|
|
229
|
+
icon: "exclamation-triangle",
|
|
230
|
+
class: sheet.classes.WarningHoldAlertContainer,
|
|
231
|
+
};
|
|
232
|
+
}
|
|
216
233
|
case "VERIFICATION:REQUIRED":
|
|
217
234
|
return {
|
|
218
235
|
header: text.verificationRequiredHeader,
|
|
@@ -1869,7 +1869,7 @@ export class TaxAndCashDashboard {
|
|
|
1869
1869
|
"mutable": false,
|
|
1870
1870
|
"complexType": {
|
|
1871
1871
|
"original": "DemoData<UseTaxAndCashDashboardResult>",
|
|
1872
|
-
"resolved": "{ states?: { status?: string; documentType: TaxDocumentType; documentTypeString: string; canEditPayoutInfo: boolean; disabled?: boolean; dateSubmitted?: string; noFormNeeded?: boolean; indirectTaxType?: string; qstNumber?: string; subRegionTaxNumber?: string; subRegion?: string; indirectTaxNumber?: string; province?: string; country?: string; notRegistered?: boolean; isBusinessEntity?: boolean; loading?: boolean; loadingError?: boolean; showNewFormDialog: boolean; hasHold: boolean; payoutStatus: PayoutStatus; veriffLoading: boolean; errors?: { general?: boolean; }; }; }",
|
|
1872
|
+
"resolved": "{ states?: { status?: string; documentType: TaxDocumentType; documentTypeString: string; canEditPayoutInfo: boolean; disabled?: boolean; dateSubmitted?: string; noFormNeeded?: boolean; indirectTaxType?: string; qstNumber?: string; subRegionTaxNumber?: string; subRegion?: string; indirectTaxNumber?: string; province?: string; country?: string; notRegistered?: boolean; isBusinessEntity?: boolean; loading?: boolean; loadingError?: boolean; showNewFormDialog: boolean; hasHold: boolean; payoutStatus: PayoutStatus; veriffLoading: boolean; errors?: { general?: boolean; }; enforceUsTaxComplianceOption?: string; }; }",
|
|
1873
1873
|
"references": {
|
|
1874
1874
|
"DemoData": {
|
|
1875
1875
|
"location": "import",
|
package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/useTaxAndCashDashboard.js
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import { useLocale, useParentQueryValue, useSetParent, } from "@saasquatch/component-boilerplate";
|
|
1
|
+
import { useLocale, useParentQueryValue, useQuery, useSetParent, } from "@saasquatch/component-boilerplate";
|
|
2
2
|
import { useEffect, useState } from "@saasquatch/universal-hooks";
|
|
3
3
|
import { DateTime } from "luxon";
|
|
4
4
|
import { vatLabels } from "../countries";
|
|
5
|
-
import { getStatus } from "../sqm-payout-status-alert/usePayoutStatus";
|
|
5
|
+
import { getStatus, } from "../sqm-payout-status-alert/usePayoutStatus";
|
|
6
6
|
import { TAX_CONTEXT_NAMESPACE, TAX_FORM_CONTEXT_NAMESPACE, USER_QUERY_NAMESPACE, } from "../sqm-tax-and-cash/data";
|
|
7
7
|
import { INDIRECT_TAX_PROVINCES, INDIRECT_TAX_SPAIN_REGIONS, } from "../subregions";
|
|
8
8
|
import { useVeriffApp, VERIFF_COMPLETE_EVENT_KEY } from "../useVeriffApp";
|
|
9
9
|
import { taxTypeToName } from "../utils";
|
|
10
|
+
import { gql } from "graphql-request";
|
|
11
|
+
const GET_TAX_SETTING = gql `
|
|
12
|
+
query getTenantSettings {
|
|
13
|
+
tenantSettings {
|
|
14
|
+
enforceUsTaxCompliance
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
10
18
|
function getCountryName(countryCode, locale) {
|
|
11
19
|
if (!countryCode)
|
|
12
20
|
return undefined;
|
|
@@ -42,11 +50,12 @@ function getIndirectTaxType(taxInformation) {
|
|
|
42
50
|
return "Indirect Tax";
|
|
43
51
|
}
|
|
44
52
|
export const useTaxAndCashDashboard = (props) => {
|
|
45
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
53
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
46
54
|
const setStep = useSetParent(TAX_CONTEXT_NAMESPACE);
|
|
47
55
|
const setContext = useSetParent(TAX_FORM_CONTEXT_NAMESPACE);
|
|
48
56
|
const [showDialog, setShowDialog] = useState(false);
|
|
49
57
|
const { render, loading: veriffLoading, errors: veriffErrors, } = useVeriffApp();
|
|
58
|
+
const { data: taxSettingRes } = useQuery(GET_TAX_SETTING, {});
|
|
50
59
|
const locale = useLocale();
|
|
51
60
|
useEffect(() => {
|
|
52
61
|
// Clear override context once on submitted
|
|
@@ -87,30 +96,32 @@ export const useTaxAndCashDashboard = (props) => {
|
|
|
87
96
|
window.removeEventListener(VERIFF_COMPLETE_EVENT_KEY, cb);
|
|
88
97
|
};
|
|
89
98
|
}, []);
|
|
99
|
+
const enforceUsTaxComplianceOption = (_e = taxSettingRes === null || taxSettingRes === void 0 ? void 0 : taxSettingRes.tenantSettings) === null || _e === void 0 ? void 0 : _e.enforceUsTaxCompliance;
|
|
90
100
|
return {
|
|
91
101
|
states: {
|
|
92
102
|
dateSubmitted,
|
|
93
103
|
documentType,
|
|
94
104
|
canEditPayoutInfo: publisher === null || publisher === void 0 ? void 0 : publisher.brandedSignup,
|
|
95
105
|
documentTypeString: taxTypeToName(documentType),
|
|
96
|
-
status: (
|
|
97
|
-
subRegion: getSubRegionName((
|
|
98
|
-
subRegionTaxNumber: (
|
|
99
|
-
qstNumber: (
|
|
106
|
+
status: (_f = publisher === null || publisher === void 0 ? void 0 : publisher.currentTaxDocument) === null || _f === void 0 ? void 0 : _f.status,
|
|
107
|
+
subRegion: getSubRegionName((_g = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _g === void 0 ? void 0 : _g.indirectTaxRegion),
|
|
108
|
+
subRegionTaxNumber: (_h = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _h === void 0 ? void 0 : _h.withholdingTaxId,
|
|
109
|
+
qstNumber: (_j = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _j === void 0 ? void 0 : _j.additionalTaxId,
|
|
100
110
|
indirectTaxType: getIndirectTaxType(publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation),
|
|
101
|
-
indirectTaxNumber: (
|
|
111
|
+
indirectTaxNumber: (_k = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _k === void 0 ? void 0 : _k.indirectTaxId,
|
|
102
112
|
isBusinessEntity: (publisher === null || publisher === void 0 ? void 0 : publisher.requiredTaxDocumentType) === "W8BENE",
|
|
103
113
|
province: provinceName,
|
|
104
|
-
country: getCountryName((
|
|
105
|
-
notRegistered: !((
|
|
114
|
+
country: getCountryName((_l = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _l === void 0 ? void 0 : _l.indirectTaxCountryCode, locale),
|
|
115
|
+
notRegistered: !((_m = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _m === void 0 ? void 0 : _m.indirectTaxId),
|
|
106
116
|
noFormNeeded: !documentType,
|
|
107
117
|
disabled: loading,
|
|
108
118
|
loading,
|
|
109
119
|
loadingError: !!(userError === null || userError === void 0 ? void 0 : userError.message),
|
|
110
120
|
showNewFormDialog: showDialog,
|
|
111
|
-
hasHold: !!((
|
|
121
|
+
hasHold: !!((_o = publisher === null || publisher === void 0 ? void 0 : publisher.payoutsAccount) === null || _o === void 0 ? void 0 : _o.hold),
|
|
112
122
|
payoutStatus,
|
|
113
123
|
veriffLoading,
|
|
124
|
+
enforceUsTaxComplianceOption,
|
|
114
125
|
},
|
|
115
126
|
callbacks: {
|
|
116
127
|
onClick: () => setShowDialog(true),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as Host, g as getElement } from './index-91e7729f.js';
|
|
2
2
|
import { m as useRef, k as useState, f as useEffect, n as h$1, l, u as useMemo, b as browser, j as useReducer } from './stencil-hooks.module-4bc38af4.js';
|
|
3
3
|
import { i as intl } from './global-be1f9992.js';
|
|
4
|
-
import { d as dist, _, L, J, t as Pn, F as Fn, x as $n, $ as $e, i as isDemo, q as En, u as useCallback, R as Rn, M as Mn, I as In, S as Sn } from './index.module-89a79f66.js';
|
|
4
|
+
import { d as dist, _, L, J, t as Pn, F as Fn, x as $n, $ as $e, i as isDemo, q as En, u as useCallback, R as Rn, M as Mn, I as In, S as Sn, w as wn } from './index.module-89a79f66.js';
|
|
5
5
|
import { j as jsonpointer } from './jsonpointer-388a7082.js';
|
|
6
6
|
import { c as cjs } from './cjs-bdfb4486.js';
|
|
7
7
|
import { g as getProps, l as luxonLocale } from './utils-334c1e34.js';
|
|
@@ -5802,19 +5802,36 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
5802
5802
|
function getAlert(status) {
|
|
5803
5803
|
switch (status) {
|
|
5804
5804
|
case "OVER_W9_THRESHOLD":
|
|
5805
|
-
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5805
|
+
if (states.enforceUsTaxComplianceOption === "CASH_ONLY_DEFER_W9") {
|
|
5806
|
+
return {
|
|
5807
|
+
header: text.w9RequiredHeader,
|
|
5808
|
+
description: intl.formatMessage({
|
|
5809
|
+
id: "w9RequiredDescription",
|
|
5810
|
+
defaultMessage: text.w9RequiredDescription,
|
|
5811
|
+
}, {
|
|
5812
|
+
termsAndConditions: (h("a", { target: "_blank", href: `https://terms.advocate.impact.com/PayoutTermsAndConditions.html` }, text.termsAndConditions)),
|
|
5813
|
+
}),
|
|
5814
|
+
button: (h("sl-button", { style: { marginTop: "var(--sl-spacing-x-small)" }, type: "default", onClick: callbacks.onNewFormClick }, text.w9RequiredButtonText)),
|
|
5815
|
+
alertType: "info",
|
|
5816
|
+
icon: "info-circle",
|
|
5817
|
+
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5818
|
+
};
|
|
5819
|
+
}
|
|
5820
|
+
else {
|
|
5821
|
+
return {
|
|
5822
|
+
header: text.payoutHoldAlertHeader,
|
|
5823
|
+
description: intl.formatMessage({
|
|
5824
|
+
id: "payoutHoldAlertDescription",
|
|
5825
|
+
defaultMessage: text.payoutHoldAlertDescription,
|
|
5826
|
+
}, {
|
|
5827
|
+
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
|
|
5828
|
+
}),
|
|
5829
|
+
buttonText: null,
|
|
5830
|
+
alertType: "warning",
|
|
5831
|
+
icon: "exclamation-triangle",
|
|
5832
|
+
class: sheet$5.classes.WarningHoldAlertContainer,
|
|
5833
|
+
};
|
|
5834
|
+
}
|
|
5818
5835
|
case "VERIFICATION:REQUIRED":
|
|
5819
5836
|
return {
|
|
5820
5837
|
header: text.verificationRequiredHeader,
|
|
@@ -6086,6 +6103,13 @@ const TaxAndCashDashboardView = (props) => {
|
|
|
6086
6103
|
h("sqm-invoice-table-data-column", { "column-title": text.earningsAfterTaxColumnTitle, property: "netEarnings" })))))))))));
|
|
6087
6104
|
};
|
|
6088
6105
|
|
|
6106
|
+
const GET_TAX_SETTING = dist.gql `
|
|
6107
|
+
query getTenantSettings {
|
|
6108
|
+
tenantSettings {
|
|
6109
|
+
enforceUsTaxCompliance
|
|
6110
|
+
}
|
|
6111
|
+
}
|
|
6112
|
+
`;
|
|
6089
6113
|
function getCountryName(countryCode, locale) {
|
|
6090
6114
|
if (!countryCode)
|
|
6091
6115
|
return undefined;
|
|
@@ -6121,11 +6145,12 @@ function getIndirectTaxType(taxInformation) {
|
|
|
6121
6145
|
return "Indirect Tax";
|
|
6122
6146
|
}
|
|
6123
6147
|
const useTaxAndCashDashboard = (props) => {
|
|
6124
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
6148
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
6125
6149
|
const setStep = En(TAX_CONTEXT_NAMESPACE);
|
|
6126
6150
|
const setContext = En(TAX_FORM_CONTEXT_NAMESPACE);
|
|
6127
6151
|
const [showDialog, setShowDialog] = useState(false);
|
|
6128
6152
|
const { render, loading: veriffLoading, errors: veriffErrors, } = useVeriffApp();
|
|
6153
|
+
const { data: taxSettingRes } = wn(GET_TAX_SETTING, {});
|
|
6129
6154
|
const locale = L();
|
|
6130
6155
|
useEffect(() => {
|
|
6131
6156
|
// Clear override context once on submitted
|
|
@@ -6166,30 +6191,32 @@ const useTaxAndCashDashboard = (props) => {
|
|
|
6166
6191
|
window.removeEventListener(VERIFF_COMPLETE_EVENT_KEY, cb);
|
|
6167
6192
|
};
|
|
6168
6193
|
}, []);
|
|
6194
|
+
const enforceUsTaxComplianceOption = (_e = taxSettingRes === null || taxSettingRes === void 0 ? void 0 : taxSettingRes.tenantSettings) === null || _e === void 0 ? void 0 : _e.enforceUsTaxCompliance;
|
|
6169
6195
|
return {
|
|
6170
6196
|
states: {
|
|
6171
6197
|
dateSubmitted,
|
|
6172
6198
|
documentType,
|
|
6173
6199
|
canEditPayoutInfo: publisher === null || publisher === void 0 ? void 0 : publisher.brandedSignup,
|
|
6174
6200
|
documentTypeString: taxTypeToName(documentType),
|
|
6175
|
-
status: (
|
|
6176
|
-
subRegion: getSubRegionName((
|
|
6177
|
-
subRegionTaxNumber: (
|
|
6178
|
-
qstNumber: (
|
|
6201
|
+
status: (_f = publisher === null || publisher === void 0 ? void 0 : publisher.currentTaxDocument) === null || _f === void 0 ? void 0 : _f.status,
|
|
6202
|
+
subRegion: getSubRegionName((_g = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _g === void 0 ? void 0 : _g.indirectTaxRegion),
|
|
6203
|
+
subRegionTaxNumber: (_h = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _h === void 0 ? void 0 : _h.withholdingTaxId,
|
|
6204
|
+
qstNumber: (_j = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _j === void 0 ? void 0 : _j.additionalTaxId,
|
|
6179
6205
|
indirectTaxType: getIndirectTaxType(publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation),
|
|
6180
|
-
indirectTaxNumber: (
|
|
6206
|
+
indirectTaxNumber: (_k = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _k === void 0 ? void 0 : _k.indirectTaxId,
|
|
6181
6207
|
isBusinessEntity: (publisher === null || publisher === void 0 ? void 0 : publisher.requiredTaxDocumentType) === "W8BENE",
|
|
6182
6208
|
province: provinceName,
|
|
6183
|
-
country: getCountryName((
|
|
6184
|
-
notRegistered: !((
|
|
6209
|
+
country: getCountryName((_l = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _l === void 0 ? void 0 : _l.indirectTaxCountryCode, locale),
|
|
6210
|
+
notRegistered: !((_m = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _m === void 0 ? void 0 : _m.indirectTaxId),
|
|
6185
6211
|
noFormNeeded: !documentType,
|
|
6186
6212
|
disabled: loading,
|
|
6187
6213
|
loading,
|
|
6188
6214
|
loadingError: !!(userError === null || userError === void 0 ? void 0 : userError.message),
|
|
6189
6215
|
showNewFormDialog: showDialog,
|
|
6190
|
-
hasHold: !!((
|
|
6216
|
+
hasHold: !!((_o = publisher === null || publisher === void 0 ? void 0 : publisher.payoutsAccount) === null || _o === void 0 ? void 0 : _o.hold),
|
|
6191
6217
|
payoutStatus,
|
|
6192
6218
|
veriffLoading,
|
|
6219
|
+
enforceUsTaxComplianceOption,
|
|
6193
6220
|
},
|
|
6194
6221
|
callbacks: {
|
|
6195
6222
|
onClick: () => setShowDialog(true),
|