diff --git a/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts b/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts index a1529e7..136764d 100644 --- a/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts +++ b/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts @@ -822,6 +822,66 @@ const reactionEffects: IReactionEffect[] = [ }, }), + /** + * сделали здесь для экономии времени + * перенести в отдельный процесс leasingWithoutKasko + */ + + calculationStore => ({ + expression: () => { + //@ts-ignore + const plPriceRub = calculationStore.plPriceRub(); + //@ts-ignore + const discountRub = calculationStore.discountRub(); + + const { + leasingPeriod, + leaseObjectType, + addEquipmentPrice, + importProgram, + } = calculationStore.values; + return { + leasingPeriod, + leaseObjectType, + plPriceRub, + discountRub, + addEquipmentPrice, + importProgram, + }; + }, + effect: ({ + leasingPeriod, + leaseObjectType, + plPriceRub, + discountRub, + addEquipmentPrice, + importProgram, + }) => { + calculationStore.setFilter('selectLeasingWithoutKasko', options => + options.filter( + x => + x?.evo_max_period && + x?.evo_min_period && + x.evo_max_period >= leasingPeriod && + x.evo_min_period <= leasingPeriod && + x?.evo_max_price && + x?.evo_min_price && + x.evo_max_price >= + plPriceRub - discountRub - importProgram + addEquipmentPrice && + x.evo_min_price <= + plPriceRub - discountRub - importProgram + addEquipmentPrice && + x.evo_leasingobject_types?.find( + x => x.evo_leasingobject_typeid === leaseObjectType, + ) && + x.evo_visible_calc, + ), + ); + }, + options: { + fireImmediately: true, + }, + }), + calculationStore => ({ expression: () => { const { leasingPeriod, leaseObjectType } = calculationStore.values; diff --git a/src/core/services/CrmService/graphql/schema.graphql b/src/core/services/CrmService/graphql/schema.graphql index dc9dd33..66ebcd0 100644 --- a/src/core/services/CrmService/graphql/schema.graphql +++ b/src/core/services/CrmService/graphql/schema.graphql @@ -556,8 +556,10 @@ type evo_addproduct_type { evo_leasingobject_types(statecode: Int): [evo_leasingobject_type] evo_max_age: Int evo_max_period: Decimal + evo_max_price: Decimal evo_min_age: Int evo_min_period: Decimal + evo_min_price: Decimal evo_name: String evo_nsib_limit: Decimal evo_planpayments(statecode: Int): [evo_planpayment] @@ -956,6 +958,7 @@ type opportunity { evo_assignor_accountid: Uuid evo_businessunitid: Uuid evo_businessunitidData: businessunit + evo_cession_incidentid: Uuid evo_check_type: [Int!] evo_check_type_fact: [Int!] evo_client_riskid: Uuid @@ -1617,6 +1620,7 @@ type evo_contract { evo_agent_reward: Decimal evo_agent_reward_conditionid: Uuid evo_agent_reward_summ: Decimal + evo_agent_reward_tech: Decimal evo_agent_service_list: [Int!] evo_approvallogs: [evo_approvallog] evo_balance_holder: Int @@ -1629,6 +1633,7 @@ type evo_contract { evo_broker_reward: Decimal evo_broker_reward_conditionid: Uuid evo_broker_reward_summ: Decimal + evo_broker_reward_tech: Decimal evo_broker_service_list: [Int!] evo_businessunitid: Uuid evo_calc_irr: Decimal @@ -1655,6 +1660,7 @@ type evo_contract { evo_dealer_broker_reward: Decimal evo_dealer_broker_reward_conditionid: Uuid evo_dealer_broker_reward_summ: Decimal + evo_dealer_broker_reward_tech: Decimal evo_dealer_broker_service_list: [Int!] evo_dealer_person_accountid: Uuid evo_dealer_person_accountidData: account @@ -1662,6 +1668,7 @@ type evo_contract { evo_dealer_person_reward: Decimal evo_dealer_person_reward_conditionid: Uuid evo_dealer_person_reward_summ: Decimal + evo_dealer_person_reward_tech: Decimal evo_dealer_person_service_list: [Int!] evo_debtwork_contractid: Uuid evo_debtwork_contractidData: evo_debtwork_contract @@ -1685,6 +1692,7 @@ type evo_contract { evo_double_agent_reward: Decimal evo_double_agent_reward_conditionid: Uuid evo_double_agent_reward_summ: Decimal + evo_double_agent_reward_tech: Decimal evo_double_agent_service_list: [Int!] evo_economic: Decimal evo_economic_actual: Decimal @@ -1704,6 +1712,7 @@ type evo_contract { evo_fin_department_reward: Decimal evo_fin_department_reward_conditionid: Uuid evo_fin_department_reward_summ: Decimal + evo_fin_department_reward_tech: Decimal evo_fin_department_service_list: [Int!] evo_first_payment_fact: Decimal evo_first_payment_fact_date: DateTime @@ -2261,6 +2270,7 @@ type evo_addcontract { evo_add_region_director_bonus: Decimal evo_agent_reward: Decimal evo_agent_reward_summ: Decimal + evo_agent_reward_tech: Decimal evo_age_drivers: Int evo_age_drivers_new: Int evo_approv_business_analyst: Boolean @@ -2276,6 +2286,7 @@ type evo_addcontract { evo_base_new: String evo_broker_reward: Decimal evo_broker_reward_summ: Decimal + evo_broker_reward_tech: Decimal evo_businessunitid: Uuid evo_calculation_method: Int evo_calculator_type: Int @@ -2313,6 +2324,7 @@ type evo_addcontract { evo_dealer_broker_reward_new: Decimal evo_dealer_broker_reward_summ: Decimal evo_dealer_broker_reward_summ_new: Decimal + evo_dealer_broker_reward_tech: Decimal evo_dealer_person_accountid: Uuid evo_dealer_person_accountid_new: Uuid evo_dealer_person_reward: Decimal @@ -2321,6 +2333,7 @@ type evo_addcontract { evo_dealer_person_reward_new: Decimal evo_dealer_person_reward_summ: Decimal evo_dealer_person_reward_summ_new: Decimal + evo_dealer_person_reward_tech: Decimal evo_deviation_investments_withoutnds: Decimal evo_deviation_irr: Decimal evo_dgo_price: Decimal @@ -2334,6 +2347,7 @@ type evo_addcontract { evo_dog_credit_new: Decimal evo_double_agent_reward: Decimal evo_double_agent_reward_summ: Decimal + evo_double_agent_reward_tech: Decimal evo_driving_axle: String evo_driving_axle_new: String evo_early_change_discount: Boolean @@ -2366,6 +2380,7 @@ type evo_addcontract { evo_fin_department_reward_new: Decimal evo_fin_department_reward_summ: Decimal evo_fin_department_reward_summ_new: Decimal + evo_fin_department_reward_tech: Decimal evo_fix_last_payment: Boolean evo_franchise: Decimal evo_franchise_new: Decimal diff --git a/src/core/services/CrmService/types/entities.ts b/src/core/services/CrmService/types/entities.ts index 9c97126..c9572d0 100644 --- a/src/core/services/CrmService/types/entities.ts +++ b/src/core/services/CrmService/types/entities.ts @@ -435,6 +435,8 @@ export interface IEvoTarif extends BaseEntity { evo_delivery_time?: number[]; evo_cut_irr_with_bonus_coefficient?: number; evo_margin_min?: number; + evo_min_price?: number; + evo_max_price?: number; } export interface IEvoRate extends BaseEntity {