Skip to content

Commit

Permalink
[HOTFIX] BSDD signoperation foreign company (#3986)
Browse files Browse the repository at this point in the history
  • Loading branch information
kornifex authored Feb 19, 2025
1 parent 3f3dcf0 commit 032b4de
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions front/src/Apps/Dashboard/Validation/BSDD/SignOperation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ function SignOperationModal({
);

const [isForeignCompany, setIsForeignCompany] = useState(false);
const [isForeignCompanyNameDisabled, setIsForeignCompanyNameDisabled] =
useState(false);
const [isForeignCompanyAddressDisabled, setIsForeignCompanyAddressDisabled] =
useState(false);

/**
* Hack the API requirement for any value in nextDestination.company.extraEuropeanId
Expand Down Expand Up @@ -494,6 +498,9 @@ function SignOperationModal({
"nextDestination.company.country",
company.codePaysEtrangerEtablissement
);

setIsForeignCompanyNameDisabled(!!company.name);
setIsForeignCompanyAddressDisabled(!!company.address);
}

setIsForeignCompany(isForeignVat(company.vatNumber!));
Expand All @@ -513,7 +520,7 @@ function SignOperationModal({
(errors?.nextDestination?.company?.name
?.message as string) ?? ""
}
disabled={!!nextDestination?.company?.name}
disabled={isForeignCompanyNameDisabled}
nativeInputProps={{
...register("nextDestination.company.name")
}}
Expand All @@ -529,7 +536,7 @@ function SignOperationModal({
(errors?.nextDestination?.company?.address
?.message as string) ?? ""
}
disabled={!!nextDestination?.company?.address}
disabled={isForeignCompanyAddressDisabled}
nativeInputProps={{
...register("nextDestination.company.address")
}}
Expand Down

0 comments on commit 032b4de

Please sign in to comment.