diff --git a/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts b/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts index c66d32f..fbe74b2 100644 --- a/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts +++ b/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts @@ -836,8 +836,13 @@ const reactionEffects: IReactionEffect[] = [ //@ts-ignore const importProgramSum: number = calculationStore.importProgramSum(); - const { leasingPeriod, leaseObjectType, addEquipmentPrice } = - calculationStore.values; + const { + leasingPeriod, + leaseObjectType, + addEquipmentPrice, + firstPaymentPerc, + model, + } = calculationStore.values; return { leasingPeriod, leaseObjectType, @@ -845,6 +850,8 @@ const reactionEffects: IReactionEffect[] = [ discountRub, addEquipmentPrice, importProgramSum, + firstPaymentPerc, + modelId: model, }; }, effect: ({ @@ -854,6 +861,8 @@ const reactionEffects: IReactionEffect[] = [ discountRub = 0, addEquipmentPrice = 0, importProgramSum = 0, + firstPaymentPerc = 0, + modelId, }) => { calculationStore.setFilter('selectLeasingWithoutKasko', options => options.filter( @@ -871,7 +880,12 @@ const reactionEffects: IReactionEffect[] = [ x.evo_leasingobject_types?.find( x => x.evo_leasingobject_typeid === leaseObjectType, ) && - x.evo_visible_calc, + x.evo_visible_calc && + x.evo_min_first_payment_perc && + x.evo_min_first_payment_perc <= firstPaymentPerc && + x.evo_max_first_payment_perc && + x.evo_max_first_payment_perc >= firstPaymentPerc && + !x.evo_models?.map(x => x.evo_modelid).includes(modelId), ), ); }, diff --git a/src/core/services/CrmService/graphql/query/options/main_options.graphql b/src/core/services/CrmService/graphql/query/options/main_options.graphql index 949d88d..d0bc4db 100644 --- a/src/core/services/CrmService/graphql/query/options/main_options.graphql +++ b/src/core/services/CrmService/graphql/query/options/main_options.graphql @@ -311,5 +311,10 @@ query GetMainOptions( evo_min_price evo_max_price evo_loss_kv + evo_min_first_payment_perc + evo_max_first_payment_perc + evo_models { + evo_modelid + } } } diff --git a/src/core/services/CrmService/graphql/schema.graphql b/src/core/services/CrmService/graphql/schema.graphql index 4eaf8c3..a9da930 100644 --- a/src/core/services/CrmService/graphql/schema.graphql +++ b/src/core/services/CrmService/graphql/schema.graphql @@ -405,6 +405,7 @@ type account { evo_div_12month: Boolean evo_documents(evo_documenttypeid_param: GuidParamInput, latestversion: Boolean = true): [evo_document] evo_economic_security_systemuserid: Uuid + evo_edos: [evo_edo] evo_employee_count: Int evo_fingap_number_rules: Int evo_fin_department_accountid: Uuid @@ -557,11 +558,14 @@ type evo_addproduct_type { evo_leasingobject_types(statecode: Int): [evo_leasingobject_type] evo_loss_kv: Decimal evo_max_age: Int + evo_max_first_payment_perc: Decimal evo_max_period: Decimal evo_max_price: Decimal evo_min_age: Int + evo_min_first_payment_perc: Decimal evo_min_period: Decimal evo_min_price: Decimal + evo_models: [evo_model] evo_name: String evo_nsib_limit: Decimal evo_planpayments(statecode: Int): [evo_planpayment] @@ -665,6 +669,7 @@ type evo_insurance_period { evo_invoice_date: DateTime evo_kasko_price: Decimal evo_leasingobjectid: Uuid + evo_loss_kv: Decimal evo_mobile_discount: Boolean evo_mobile_discount_factor: Decimal evo_mobile_discount_rub: Decimal @@ -2586,6 +2591,7 @@ type email { regardingobjectid_evo_list: Uuid regardingobjectid_incident: Uuid regardingobjectid_opportunity: Uuid + statecode: Int statuscode: Int subject: String templateid: Uuid @@ -2743,6 +2749,31 @@ type team { toObjectString: String } +type evo_edo { + createdon: DateTime + evo_accountid: Uuid + evo_accountidData: account + evo_activation_status: Int + evo_activation_statusname: String + evo_box_edoid: Uuid + evo_box_edoidData: evo_edo + evo_box_id: String + evo_box_name: String + evo_documentid: Uuid + evo_edoid: Uuid + evo_edo_status: Int + evo_edo_statusname: String + evo_edo_type: Int + evo_edo_typeename: String + evo_invite_crm_status: Int + evo_invite_crm_statusname: String + evo_name: String + evo_statuscodeid: Uuid + evo_statuscodeidData: evo_statuscode + modifiedon: DateTime + toObjectString: String +} + type evo_insurance_policy { createdon: DateTime evo_accountid: Uuid diff --git a/src/core/services/CrmService/types/entities.ts b/src/core/services/CrmService/types/entities.ts index 0ecabf9..df372ed 100644 --- a/src/core/services/CrmService/types/entities.ts +++ b/src/core/services/CrmService/types/entities.ts @@ -403,6 +403,12 @@ export interface IEvoAddproductType extends BaseEntity { evo_type_calc_cerebellum?: number; evo_addproduct_types?: IEvoAddproductType[]; evo_evokasko_calc_type?: number; + evo_min_price?: number; + evo_max_price?: number; + evo_loss_kv?: number; + evo_min_first_payment_perc?: number; + evo_max_first_payment_perc?: number; + evo_models?: IEvoModel; } export interface IEvoTarif extends BaseEntity { @@ -435,9 +441,6 @@ 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; - evo_loss_kv?: number; } export interface IEvoRate extends BaseEntity {