diff --git a/apps/web/process/gibdd/reactions.ts b/apps/web/process/gibdd/reactions.ts index dd7927c..e37b2f1 100644 --- a/apps/web/process/gibdd/reactions.ts +++ b/apps/web/process/gibdd/reactions.ts @@ -404,6 +404,28 @@ export function common({ store, apolloClient, queryClient }: ProcessContext) { } ); + reaction( + () => $calculation.$values.getValues(['lead', 'opportunity', 'objectRegistration']), + async ({ lead, objectRegistration, opportunity }) => { + const { account } = await getData({ lead, opportunity, quote: null }); + + if (objectRegistration === 100_000_000 && account.evo_regionid) { + $calculation.element('selectRegionRegistration').setValue(account.evo_regionid).block(); + } else { + $calculation.element('selectRegionRegistration').unblock(); + } + + if (objectRegistration === 100_000_000 && account.evo_townid) { + $calculation.element('selectTownRegistration').setValue(account.evo_townid).block(); + } else { + $calculation.element('selectTownRegistration').unblock(); + } + }, + { + delay: 50, + } + ); + reaction( () => $calculation.element('radioObjectRegistration').getValue(), (objectRegistration) => {