diff --git a/src/client/Containers/Calculation/lib/fetchData/queries/optionsQuery.ts b/src/client/Containers/Calculation/lib/fetchData/queries/optionsQuery.ts index 10ef217..5e67126 100644 --- a/src/client/Containers/Calculation/lib/fetchData/queries/optionsQuery.ts +++ b/src/client/Containers/Calculation/lib/fetchData/queries/optionsQuery.ts @@ -250,6 +250,7 @@ const query = gql` evo_id evo_leasingobject_typeid } + evo_delivery_time } selectRate: evo_rates( statecode: $statecode diff --git a/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts b/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts index 9101930..48e06f0 100644 --- a/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts +++ b/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts @@ -1374,11 +1374,11 @@ const reactionEffects: IReactionEffect[] = [ calculationStore => ({ expression: () => { - const { product, leasingPeriod } = calculationStore.values; - return { product_evo_id: product, leasingPeriod }; + const { product, leasingPeriod, deliveryTime } = calculationStore.values; + return { product_evo_id: product, leasingPeriod, deliveryTime }; }, - effect: ({ product_evo_id, leasingPeriod }) => { - if (product_evo_id && leasingPeriod) { + effect: ({ product_evo_id, leasingPeriod, deliveryTime }) => { + if (product_evo_id && leasingPeriod && deliveryTime) { const product = calculationStore.getOption('selectProduct', { evo_id: product_evo_id, }); @@ -1389,7 +1389,8 @@ const reactionEffects: IReactionEffect[] = [ x.evo_min_period && x.evo_min_period <= leasingPeriod && x.evo_max_period && - x.evo_max_period >= leasingPeriod, + x.evo_max_period >= leasingPeriod && + x.evo_delivery_time?.includes(deliveryTime), ); calculationStore.setValue('tarif', tarif?.evo_tarifid); } diff --git a/src/core/types/Entities/crmEntities.ts b/src/core/types/Entities/crmEntities.ts index f030571..80b0630 100644 --- a/src/core/types/Entities/crmEntities.ts +++ b/src/core/types/Entities/crmEntities.ts @@ -372,6 +372,7 @@ export interface IEvoTarif { evo_models?: IEvoModel[]; evo_model_exceptions?: IEvoModel[]; evo_rates?: IEvoRate[]; + evo_delivery_time?: number[]; } export interface IEvoRate {