Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@
"positionMillis",
"Postharvest",
"Postproduction",
"Powerform",
"POWERFORM",
"Précédent",
"precheck",
"Precheck",
Expand Down
7 changes: 7 additions & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,11 @@ const CONST = {
SMS: {
DOMAIN: '@expensify.sms',
},
DOCUSIGN_POWERFORM_LINK: {
US: 'https://powerforms.docusign.net/ddc56dcb-9cc7-4b36-997c-fea9327f570e?env=na1&acct=cf4cc39a-1c3e-4c19-bbf9-71844e1bcbde&accountId=cf4cc39a-1c3e-4c19-bbf9-71844e1bcbde',
CA: 'https://powerforms.docusign.net/efc57fcc-0d5d-43c3-a175-1687ad456242?env=na1&acct=cf4cc39a-1c3e-4c19-bbf9-71844e1bcbde&accountId=cf4cc39a-1c3e-4c19-bbf9-71844e1bcbde',
AU: 'https://powerforms.docusign.net/2ff347bb-172a-4138-b1cd-4001a7c319b5?env=na1&acct=cf4cc39a-1c3e-4c19-bbf9-71844e1bcbde&accountId=cf4cc39a-1c3e-4c19-bbf9-71844e1bcbde',
},
BANK_ACCOUNT: {
BENEFICIAL_OWNER_INFO_STEP: {
SUBSTEP: {
Expand Down Expand Up @@ -538,6 +543,7 @@ const CONST = {
BENEFICIAL_OWNER_INFO: 'BeneficialOwnerInfoStep',
SIGNER_INFO: 'SignerInfoStep',
AGREEMENTS: 'AgreementsStep',
DOCUSIGN: 'DocusignStep',
FINISH: 'FinishStep',
},
BANK_INFO_STEP_ACH_DATA_INPUT_IDS: {
Expand Down Expand Up @@ -587,6 +593,7 @@ const CONST = {
},
},
STEP_NAMES: ['1', '2', '3', '4', '5', '6'],
DOCUSIGN_REQUIRED_STEP_NAMES: ['1', '2', '3', '4', '5', '6', '7'],
STEP_HEADER_HEIGHT: 40,
SIGNER_INFO_STEP: {
SUBSTEP: {
Expand Down
12 changes: 12 additions & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3185,6 +3185,18 @@ const translations = {
consent: 'Bitte stimmen Sie der Datenschutzerklärung zu.',
},
},
docusignStep: {
subheader: 'Docusign-Formular',
pleaseComplete:
'Bitte füllen Sie das ACH-Autorisierungsformular über den untenstehenden Docusign-Link aus und laden Sie anschließend die unterschriebene Kopie hier hoch, damit wir direkt von Ihrem Bankkonto abbuchen können.',
pleaseCompleteTheBusinessAccount: 'Bitte füllen Sie den Antrag für ein Geschäftskonto und die Vereinbarung zum Lastschrifteinzug aus.',
pleaseCompleteTheDirect:
'Bitte füllen Sie die Vereinbarung zum Lastschrifteinzug über den untenstehenden Docusign-Link aus und laden Sie anschließend die unterschriebene Kopie hier hoch, damit wir direkt von Ihrem Bankkonto abbuchen können.',
takeMeTo: 'Zu Docusign',
uploadAdditional: 'Zusätzliche Dokumente hochladen',
pleaseUpload: 'Bitte laden Sie das DEFT-Formular und die unterschriebene Docusign-Seite hoch.',
pleaseUploadTheDirect: 'Bitte laden Sie die Lastschriftvereinbarung und die Docusign-Unterschriftsseite hoch.',
},
finishStep: {
connect: 'Bankkonto verbinden',
letsFinish: 'Lass uns im Chat fertig werden!',
Expand Down
12 changes: 12 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3177,6 +3177,18 @@ const translations = {
consent: 'Please consent to the privacy notice',
},
},
docusignStep: {
subheader: 'Docusign Form',
pleaseComplete:
'Please complete the ACH authorization form with the Docusign link below and then upload that signed copy here so we can withdraw funds directly from your bank account',
pleaseCompleteTheBusinessAccount: 'Please complete the Business Account Application Direct Debit Arrangement',
pleaseCompleteTheDirect:
'Please complete the Direct Debit Arrangement using the Docusign link below and then upload that signed copy here so we can withdraw funds directly from your bank account.',
takeMeTo: 'Take me to Docusign',
uploadAdditional: 'Upload additional documentation',
pleaseUpload: 'Please upload the DEFT form and Docusign signature page',
pleaseUploadTheDirect: 'Please upload the Direct Debit Arrangements and Docusign signature page',
},
finishStep: {
connect: 'Connect bank account',
letsFinish: "Let's finish in chat!",
Expand Down
12 changes: 12 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3169,6 +3169,18 @@ const translations = {
consent: 'Por favor, acepte el aviso de privacidad',
},
},
docusignStep: {
subheader: 'Formulario de Docusign',
pleaseComplete:
'Por favor, complete el formulario de autorización ACH utilizando el enlace de Docusign a continuación y luego cargue esa copia firmada aquí para que podamos retirar fondos directamente de su cuenta bancaria.',
pleaseCompleteTheBusinessAccount: 'Por favor, complete la Solicitud de Cuenta Comercial y el Acuerdo de Débito Directo.',
pleaseCompleteTheDirect:
'Por favor, complete el Acuerdo de Débito Directo utilizando el enlace de Docusign a continuación y luego cargue esa copia firmada aquí para que podamos retirar fondos directamente de su cuenta bancaria.',
takeMeTo: 'Llévame a Docusign',
uploadAdditional: 'Cargar documentación adicional',
pleaseUpload: 'Por favor, cargue el formulario DEFT y la página de firma de Docusign.',
pleaseUploadTheDirect: 'Por favor, cargue los Acuerdos de Débito Directo y la página de firma de Docusign.',
},
finishStep: {
connect: 'Conectar cuenta bancaria',
letsFinish: '¡Terminemos en el chat!',
Expand Down
12 changes: 12 additions & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3190,6 +3190,18 @@ const translations = {
consent: "Veuillez consentir à l'avis de confidentialité",
},
},
docusignStep: {
subheader: 'Formulaire Docusign',
pleaseComplete:
'Veuillez remplir le formulaire d’autorisation ACH via le lien Docusign ci-dessous, puis téléversez une copie signée ici afin que nous puissions prélever les fonds directement de votre compte bancaire.',
pleaseCompleteTheBusinessAccount: 'Veuillez remplir la demande de compte professionnel et l’accord de prélèvement automatique.',
pleaseCompleteTheDirect:
'Veuillez remplir l’accord de prélèvement automatique via le lien Docusign ci-dessous, puis téléversez une copie signée ici afin que nous puissions prélever les fonds directement de votre compte bancaire.',
takeMeTo: 'Aller à Docusign',
uploadAdditional: 'Téléverser des documents supplémentaires',
pleaseUpload: 'Veuillez téléverser le formulaire DEFT et la page de signature Docusign.',
pleaseUploadTheDirect: 'Veuillez téléverser les accords de prélèvement automatique et la page de signature Docusign.',
},
finishStep: {
connect: 'Connecter un compte bancaire',
letsFinish: 'Terminons dans le chat !',
Expand Down
12 changes: 12 additions & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3197,6 +3197,18 @@ const translations = {
consent: "Si prega di acconsentire all'informativa sulla privacy",
},
},
docusignStep: {
subheader: 'Modulo Docusign',
pleaseComplete:
'Completa il modulo di autorizzazione ACH tramite il link Docusign qui sotto e carica una copia firmata qui per consentirci di prelevare fondi direttamente dal tuo conto bancario.',
pleaseCompleteTheBusinessAccount: 'Completa la richiesta di conto aziendale e l’accordo di addebito diretto.',
pleaseCompleteTheDirect:
'Completa l’accordo di addebito diretto tramite il link Docusign qui sotto e carica una copia firmata qui per consentirci di prelevare fondi direttamente dal tuo conto bancario.',
takeMeTo: 'Vai a Docusign',
uploadAdditional: 'Carica documentazione aggiuntiva',
pleaseUpload: 'Carica il modulo DEFT e la pagina di firma Docusign.',
pleaseUploadTheDirect: 'Carica l’accordo di addebito diretto e la pagina di firma Docusign.',
},
finishStep: {
connect: 'Collega conto bancario',
letsFinish: 'Finisciamo in chat!',
Expand Down
11 changes: 11 additions & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3201,6 +3201,17 @@ const translations = {
consent: 'プライバシー通知に同意してください',
},
},
docusignStep: {
subheader: 'Docusignフォーム',
pleaseComplete: '以下のDocusignリンクからACH認可フォームに記入し、署名済みのコピーをこちらにアップロードしてください。これにより、銀行口座から直接資金を引き落とすことができます。',
pleaseCompleteTheBusinessAccount: 'ビジネスアカウント申請書および口座振替契約を記入してください。',
pleaseCompleteTheDirect:
'以下のDocusignリンクを使用して口座振替契約を記入し、署名済みのコピーをこちらにアップロードしてください。これにより、銀行口座から直接資金を引き落とすことができます。',
takeMeTo: 'Docusignへ移動',
uploadAdditional: '追加書類をアップロード',
pleaseUpload: 'DEFTフォームおよびDocusign署名ページをアップロードしてください。',
pleaseUploadTheDirect: '口座振替契約およびDocusign署名ページをアップロードしてください。',
},
finishStep: {
connect: '銀行口座を接続',
letsFinish: 'チャットで終わらせましょう!',
Expand Down
12 changes: 12 additions & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3203,6 +3203,18 @@ const translations = {
consent: 'Gelieve in te stemmen met de privacyverklaring.',
},
},
docusignStep: {
subheader: 'Docusign-formulier',
pleaseComplete:
'Vul het ACH-autorisatieformulier in via de onderstaande Docusign-link en upload daarna een ondertekende kopie hier zodat we rechtstreeks geld van uw bankrekening kunnen afschrijven.',
pleaseCompleteTheBusinessAccount: 'Vul de aanvraag voor een zakelijke rekening en de automatische incassoregeling in.',
pleaseCompleteTheDirect:
'Vul de automatische incassoregeling in via de onderstaande Docusign-link en upload daarna een ondertekende kopie hier zodat we rechtstreeks geld van uw bankrekening kunnen afschrijven.',
takeMeTo: 'Ga naar Docusign',
uploadAdditional: 'Upload extra documentatie',
pleaseUpload: 'Upload het DEFT-formulier en de ondertekende Docusign-pagina.',
pleaseUploadTheDirect: 'Upload de automatische incassoregelingen en de Docusign-handtekeningenpagina.',
},
finishStep: {
connect: 'Bankrekening koppelen',
letsFinish: 'Laten we in de chat afronden!',
Expand Down
12 changes: 12 additions & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3197,6 +3197,18 @@ const translations = {
consent: 'Proszę wyrazić zgodę na politykę prywatności',
},
},
docusignStep: {
subheader: 'Formularz Docusign',
pleaseComplete:
'Proszę wypełnić formularz autoryzacji ACH za pomocą poniższego linku Docusign, a następnie przesłać tutaj podpisaną kopię, abyśmy mogli pobierać środki bezpośrednio z Twojego konta bankowego.',
pleaseCompleteTheBusinessAccount: 'Proszę wypełnić Wniosek o Konto Firmowe oraz Umowę Polecenia Zapłaty.',
pleaseCompleteTheDirect:
'Proszę wypełnić Umowę Polecenia Zapłaty za pomocą poniższego linku Docusign, a następnie przesłać tutaj podpisaną kopię, abyśmy mogli pobierać środki bezpośrednio z Twojego konta bankowego.',
takeMeTo: 'Przejdź do Docusign',
uploadAdditional: 'Prześlij dodatkowe dokumenty',
pleaseUpload: 'Proszę przesłać formularz DEFT oraz stronę z podpisem Docusign.',
pleaseUploadTheDirect: 'Proszę przesłać Umowy Polecenia Zapłaty oraz stronę z podpisem Docusign.',
},
finishStep: {
connect: 'Połącz konto bankowe',
letsFinish: 'Zakończmy na czacie!',
Expand Down
12 changes: 12 additions & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3202,6 +3202,18 @@ const translations = {
consent: 'Por favor, consinta com o aviso de privacidade',
},
},
docusignStep: {
subheader: 'Formulário Docusign',
pleaseComplete:
'Por favor, preencha o formulário de autorização ACH pelo link do Docusign abaixo e envie uma cópia assinada aqui para que possamos debitar diretamente da sua conta bancária.',
pleaseCompleteTheBusinessAccount: 'Por favor, preencha a Solicitação de Conta Empresarial e o Acordo de Débito Direto.',
pleaseCompleteTheDirect:
'Por favor, preencha o Acordo de Débito Direto usando o link do Docusign abaixo e envie uma cópia assinada aqui para que possamos debitar diretamente da sua conta bancária.',
takeMeTo: 'Ir para o Docusign',
uploadAdditional: 'Enviar documentação adicional',
pleaseUpload: 'Por favor, envie o formulário DEFT e a página de assinatura do Docusign.',
pleaseUploadTheDirect: 'Por favor, envie os Acordos de Débito Direto e a página de assinatura do Docusign.',
},
finishStep: {
connect: 'Conectar conta bancária',
letsFinish: 'Vamos terminar no chat!',
Expand Down
10 changes: 10 additions & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3167,6 +3167,16 @@ const translations = {
consent: '请同意隐私声明',
},
},
docusignStep: {
subheader: 'Docusign 表格',
pleaseComplete: '请通过以下 Docusign 链接填写 ACH 授权表格,并将签署后的副本上传到此处,以便我们可以直接从您的银行账户扣款。',
pleaseCompleteTheBusinessAccount: '请填写企业账户申请表及直接借记协议。',
pleaseCompleteTheDirect: '请通过以下 Docusign 链接填写直接借记协议,并将签署后的副本上传到此处,以便我们可以直接从您的银行账户扣款。',
takeMeTo: '前往 Docusign',
uploadAdditional: '上传其他文件',
pleaseUpload: '请上传 DEFT 表格和 Docusign 签名页。',
pleaseUploadTheDirect: '请上传直接借记协议和 Docusign 签名页。',
},
finishStep: {
connect: '连接银行账户',
letsFinish: '让我们在聊天中完成!',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import type {FileObject} from '@pages/media/AttachmentModalScreen/types';

type FinishCorpayBankAccountOnboardingParams = {
inputs: string;
achAuthorizationForm?: FileObject;
bankAccountID: number;
};

Expand Down
40 changes: 35 additions & 5 deletions src/pages/ReimbursementAccount/NonUSD/Agreements/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import useSubStep from '@hooks/useSubStep';
import type {SubStepProps} from '@hooks/useSubStep/types';
import requiresDocusignStep from '@pages/ReimbursementAccount/NonUSD/utils/requiresDocusignStep';
import getSubStepValues from '@pages/ReimbursementAccount/utils/getSubStepValues';
import {clearReimbursementAccountFinishCorpayBankAccountOnboarding, finishCorpayBankAccountOnboarding} from '@userActions/BankAccounts';
import {clearErrors} from '@userActions/FormActions';
Expand All @@ -19,9 +20,19 @@ type AgreementsProps = {

/** Handles submit button press */
onSubmit: () => void;

/** Array of step names */
stepNames?: readonly string[];

/** Currency of the policy */
policyCurrency: string | undefined;
};

type AgreementsSubStepProps = SubStepProps & {
policyCurrency: string | undefined;
};

const bodyContent: Array<ComponentType<SubStepProps>> = [Confirmation];
const bodyContent: Array<ComponentType<AgreementsSubStepProps>> = [Confirmation];

const INPUT_KEYS = {
PROVIDE_TRUTHFUL_INFORMATION: INPUT_IDS.ADDITIONAL_DATA.CORPAY.PROVIDE_TRUTHFUL_INFORMATION,
Expand All @@ -30,14 +41,20 @@ const INPUT_KEYS = {
AUTHORIZED_TO_BIND_CLIENT_TO_AGREEMENT: INPUT_IDS.ADDITIONAL_DATA.CORPAY.AUTHORIZED_TO_BIND_CLIENT_TO_AGREEMENT,
};

function Agreements({onBackButtonPress, onSubmit}: AgreementsProps) {
function Agreements({onBackButtonPress, onSubmit, stepNames, policyCurrency}: AgreementsProps) {
const {translate} = useLocalize();
const [reimbursementAccount] = useOnyx(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {canBeMissing: false});
const [reimbursementAccountDraft] = useOnyx(ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM_DRAFT, {canBeMissing: false});
const agreementsStepValues = useMemo(() => getSubStepValues(INPUT_KEYS, reimbursementAccountDraft, reimbursementAccount), [reimbursementAccount, reimbursementAccountDraft]);
const bankAccountID = reimbursementAccount?.achData?.bankAccountID ?? CONST.DEFAULT_NUMBER_ID;
const isDocusignStepRequired = requiresDocusignStep(policyCurrency);

const submit = () => {
if (isDocusignStepRequired) {
onSubmit();
return;
}

finishCorpayBankAccountOnboarding({
inputs: JSON.stringify({
provideTruthfulInformation: agreementsStepValues.provideTruthfulInformation,
Expand All @@ -50,6 +67,10 @@ function Agreements({onBackButtonPress, onSubmit}: AgreementsProps) {
};

useEffect(() => {
if (isDocusignStepRequired) {
return;
}

// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
if (reimbursementAccount?.errors || reimbursementAccount?.isFinishingCorpayBankAccountOnboarding || !reimbursementAccount?.isSuccess) {
return;
Expand All @@ -63,9 +84,17 @@ function Agreements({onBackButtonPress, onSubmit}: AgreementsProps) {
return () => {
clearReimbursementAccountFinishCorpayBankAccountOnboarding();
};
}, [reimbursementAccount, onSubmit]);
}, [reimbursementAccount, onSubmit, policyCurrency, isDocusignStepRequired]);

const {componentToRender: SubStep, isEditing, screenIndex, nextScreen, prevScreen, moveTo, goToTheLastStep} = useSubStep({bodyContent, startFrom: 0, onFinished: submit});
const {
componentToRender: SubStep,
isEditing,
screenIndex,
nextScreen,
prevScreen,
moveTo,
goToTheLastStep,
} = useSubStep<AgreementsSubStepProps>({bodyContent, startFrom: 0, onFinished: submit});

const handleBackButtonPress = () => {
clearErrors(ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM);
Expand All @@ -86,13 +115,14 @@ function Agreements({onBackButtonPress, onSubmit}: AgreementsProps) {
wrapperID={Agreements.displayName}
handleBackButtonPress={handleBackButtonPress}
headerTitle={translate('agreementsStep.agreements')}
stepNames={CONST.NON_USD_BANK_ACCOUNT.STEP_NAMES}
stepNames={stepNames}
startStepIndex={5}
>
<SubStep
isEditing={isEditing}
onNext={nextScreen}
onMove={moveTo}
policyCurrency={policyCurrency}
/>
</InteractiveStepWrapper>
);
Expand Down
Loading