From ddfc4053eb038bb50e14edfed734297afc0594c5 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Fri, 19 Jan 2024 14:02:18 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B0=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B7=D0=BD=D0=B0=D1=87=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BF=D0=BE=D0=BB=D1=8F=20"=D0=A7=D0=B0=D1=81?= =?UTF-8?q?=D1=82=D0=B8=D1=87=D0=BD=D1=8B=D0=B9=20=D0=9D=D0=94=D0=A1"=20cb?= =?UTF-8?q?xPartialVAT=20=20=D0=B8=D0=BB=D0=B8=20"=D0=9F=D0=BB=D0=B0=D0=B2?= =?UTF-8?q?=D0=B0=D1=8E=D1=89=D0=B0=D1=8F=20=D1=81=D1=82=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B0"=20cbxFloatingRate=20=D0=B4=D0=BE=D0=BB=D0=B6=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=BE=D1=82=D1=80=D0=B0=D0=B1=D0=B0=D1=82=D1=8B=D0=B2?= =?UTF-8?q?=D0=B0=D1=82=D1=8C=20=D0=BB=D0=BE=D0=B3=D0=B8=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=B4=D0=B1=D0=BE=D1=80=D0=B0=20=D0=A2=D0=B0=D1=80?= =?UTF-8?q?=D0=B8=D1=84=D0=B0=20selectTarif,=20=D0=B0=20=20=D0=B8=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D0=BD=D0=BE=20(=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D1=8F=D0=B5=D1=82=D1=81=D1=8F=20=D0=B2=20=D1=82=D0=B5?= =?UTF-8?q?=D0=BA=D1=83=D1=89=D1=83=D1=8E):?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit если в поле "Частичный НДС" cbxPartialVAT указано Да, то фильтруются Тарифы, у который НДС evo_nds_rules = любой 100000000 или только частичный 100000002, иначе у которых НДС evo_nds_rules = любой 100000000 или только полный 100000001 2. если в поле "Плавающая ставка" cbxFloatingRate указано Да, то фильтруются Тарифы, у которых "Плавающая ставка" evo_floating_rate = Да иначе у которых "Плавающая ставка" evo_floating_rate = Нет --- apps/web/graphql/crm.query.graphql | 2 ++ apps/web/graphql/crm.schema.graphql | 31 +++++++++++++++++++ apps/web/graphql/crm.types.ts | 7 +++-- apps/web/process/configurator/lib/helper.ts | 23 ++++++++++++++ .../process/configurator/reactions/values.ts | 2 ++ 5 files changed, 63 insertions(+), 2 deletions(-) diff --git a/apps/web/graphql/crm.query.graphql b/apps/web/graphql/crm.query.graphql index 240c1ca..87dbe6d 100644 --- a/apps/web/graphql/crm.query.graphql +++ b/apps/web/graphql/crm.query.graphql @@ -131,6 +131,8 @@ query GetTarifs($currentDate: DateTime) { evo_leasingobject_typeid } evo_pl_use_type + evo_nds_rules + evo_floating_rate } } diff --git a/apps/web/graphql/crm.schema.graphql b/apps/web/graphql/crm.schema.graphql index f2fcfd6..45dfb58 100644 --- a/apps/web/graphql/crm.schema.graphql +++ b/apps/web/graphql/crm.schema.graphql @@ -170,6 +170,7 @@ type account { evo_address_postalidData: evo_address evo_agency_agreementid: Uuid evo_bank_detailses(statecode: Int): [evo_bank_details] + evo_block_pay_supplier: Boolean evo_branch_count: String evo_branch_type: Int evo_broker_accountid: Uuid @@ -462,6 +463,7 @@ type evo_baseproduct { evo_leasingobject_types(statecode: Int): [evo_leasingobject_type] evo_name: String evo_object_count_max: Int + evo_product_properties: [Int!] evo_relation: [Int!] evo_sale_without_nds: Boolean evo_scoring_available: Boolean @@ -964,6 +966,7 @@ type quote { evo_add_director_bonus: Decimal evo_add_equipment: Boolean evo_add_region_director_bonus: Decimal + evo_advance_regulations: Decimal evo_agent_accountid: Uuid evo_agent_reward_conditionid: Uuid evo_agent_reward_summ: Decimal @@ -1070,6 +1073,7 @@ type quote { evo_first_payment_perc_without_subsidy: Decimal evo_first_payment_rub: Decimal evo_first_payment_rub_without_subsidy: Decimal + evo_floating_rate: Boolean evo_franchise: Decimal evo_fssp_legal_entity: Decimal evo_fuel: Boolean @@ -1197,6 +1201,7 @@ type quote { evo_program_import_subsidyid: Uuid evo_program_import_subsidy_sum: Decimal evo_promotion: [Int!] + evo_promotion_credit: Boolean evo_pts_type: Int evo_purchases_participation: Boolean evo_question_credit_committees: [evo_question_credit_committee] @@ -1638,11 +1643,16 @@ type evo_contract { evo_agent_reward_summ: Decimal evo_agent_reward_tech: Decimal evo_agent_service_list: [Int!] + evo_all_payment_summ: Decimal + evo_all_payment_summ_leasing: Decimal + evo_all_payment_summ_penalty_fee: Decimal evo_approvallogs: [evo_approvallog] evo_balance_holder: Int evo_bank_detailsid: Uuid evo_bank_detailsidData: evo_bank_details evo_base_calc_pay: Decimal + evo_bch_account_state: Int + evo_bch_account_state_date: DateTime evo_bonus_pay_systemuserid: Uuid evo_broker_accountid: Uuid evo_broker_request_paymentid: Uuid @@ -1749,6 +1759,11 @@ type evo_contract { evo_fin_department_reward_summ: Decimal evo_fin_department_reward_tech: Decimal evo_fin_department_service_list: [Int!] + evo_first_cre_export_date: DateTime + evo_first_cre_export_date_guarantor1: DateTime + evo_first_cre_export_date_guarantor2: DateTime + evo_first_cre_export_date_guarantor3: DateTime + evo_first_cre_export_date_guarantor4: DateTime evo_first_payment_fact: Decimal evo_first_payment_fact_date: DateTime evo_first_payment_perc: Decimal @@ -1792,6 +1807,11 @@ type evo_contract { evo_last_data_transfer_to_bch_date: DateTime evo_last_formation_cre_date: DateTime evo_last_formation_cre_status: Int + evo_last_missed_payment_leasing_date: DateTime + evo_last_payment_amount: Decimal + evo_last_payment_date: DateTime + evo_last_payment_debt_leasing: Decimal + evo_last_payment_debt_penalty_fee: Decimal evo_last_payment_redemption: Boolean evo_leasingobjectid: Uuid evo_leasingobjectidData: evo_leasingobject @@ -1825,6 +1845,8 @@ type evo_contract { evo_number_dkp: String evo_ownership_date: DateTime evo_paymentorders(evo_name: String, statecode: Int): [evo_paymentorder] + evo_payment_compliance_code: Int + evo_payment_due_date_code: Int evo_payment_redemption: Int evo_payment_redemption_sum: Decimal evo_payment_redemption_sum_without_nds: Decimal @@ -2076,6 +2098,7 @@ type evo_tarif { evo_datefrom: DateTime evo_dateto: DateTime evo_delivery_time: [Int!] + evo_floating_rate: Boolean evo_graphtype_exception: [Int!] evo_id: String evo_ins_type: [Int!] @@ -2099,9 +2122,11 @@ type evo_tarif { evo_models(statecode: Int): [evo_model] evo_model_exceptions(statecode: Int): [evo_model] evo_name: String + evo_nds_rules: Int evo_pay_supplier_without_addcontract: Boolean evo_pl_use_type: [Int!] evo_rates(statecode: Int): [evo_rate] + evo_scoring_accept: Boolean evo_seasons_type_exception: [Int!] evo_tarifid: Uuid evo_transactioncurrencyid: Uuid @@ -2235,6 +2260,7 @@ type systemuser { evo_can_import_sheduled_calls: Boolean evo_datebirth: DateTime evo_editing_question_cc: Boolean + evo_edit_parking: Boolean evo_edo: Boolean evo_edo_department: [Int!] evo_edo_departmentData: [picklist_value] @@ -2645,6 +2671,7 @@ type evo_addcontract { evo_pts_change: Boolean evo_pts_type: Int evo_pts_type_new: Int + evo_publish_site: Boolean evo_quoteid: Uuid evo_reasons_calc: [Int!] evo_reason_validation_doc: [Int!] @@ -3112,6 +3139,7 @@ type evo_systemparameters { evo_card_number_count_request: Int evo_clientfinance_queueid: Uuid evo_client_queueid: Uuid + evo_cre_xml_folder: String evo_custom_reports_directory: String evo_dadata_account_update_maxday: Int evo_dadata_key: String @@ -3600,6 +3628,7 @@ input quoteInput { evo_add_director_bonus: Decimal evo_add_equipment: Boolean evo_add_region_director_bonus: Decimal + evo_advance_regulations: Decimal evo_agent_accountid: Uuid evo_agent_reward_conditionid: Uuid evo_agent_reward_summ: Decimal @@ -3704,6 +3733,7 @@ input quoteInput { evo_first_payment_perc_without_subsidy: Decimal evo_first_payment_rub: Decimal evo_first_payment_rub_without_subsidy: Decimal + evo_floating_rate: Boolean evo_franchise: Decimal evo_fssp_legal_entity: Decimal evo_fuel: Boolean @@ -3824,6 +3854,7 @@ input quoteInput { evo_program_import_subsidyid: Uuid evo_program_import_subsidy_sum: Decimal evo_promotion: [Int!] + evo_promotion_credit: Boolean evo_pts_type: Int evo_purchases_participation: Boolean evo_quotename: String diff --git a/apps/web/graphql/crm.types.ts b/apps/web/graphql/crm.types.ts index c0ab1d5..635444e 100644 --- a/apps/web/graphql/crm.types.ts +++ b/apps/web/graphql/crm.types.ts @@ -402,6 +402,7 @@ export type QuoteInput = { evo_add_director_bonus?: InputMaybe; evo_add_equipment?: InputMaybe; evo_add_region_director_bonus?: InputMaybe; + evo_advance_regulations?: InputMaybe; evo_age_drivers?: InputMaybe; evo_agent_accountid?: InputMaybe; evo_agent_reward_conditionid?: InputMaybe; @@ -506,6 +507,7 @@ export type QuoteInput = { evo_first_payment_perc_without_subsidy?: InputMaybe; evo_first_payment_rub?: InputMaybe; evo_first_payment_rub_without_subsidy?: InputMaybe; + evo_floating_rate?: InputMaybe; evo_franchise?: InputMaybe; evo_fssp_legal_entity?: InputMaybe; evo_fuel?: InputMaybe; @@ -626,6 +628,7 @@ export type QuoteInput = { evo_program_import_subsidyid?: InputMaybe; evo_programsolution?: InputMaybe; evo_promotion?: InputMaybe>; + evo_promotion_credit?: InputMaybe; evo_pts_type?: InputMaybe; evo_purchases_participation?: InputMaybe; evo_quotename?: InputMaybe; @@ -767,7 +770,7 @@ export type GetTarifsQueryVariables = Exact<{ }>; -export type GetTarifsQuery = { __typename?: 'Query', evo_tarifs: Array<{ __typename?: 'evo_tarif', evo_tarifid: string | null, evo_baseproductid: string | null, evo_min_period: number | null, evo_max_period: number | null, evo_delivery_time: Array | null, evo_min_first_payment: number | null, evo_max_first_payment: number | null, evo_min_last_payment: number | null, evo_max_last_payment: number | null, evo_used: boolean | null, evo_pl_use_type: Array | null, label: string | null, value: string | null, evo_leasingobject_types: Array<{ __typename?: 'evo_leasingobject_type', evo_leasingobject_typeid: string | null } | null> | null } | null> | null }; +export type GetTarifsQuery = { __typename?: 'Query', evo_tarifs: Array<{ __typename?: 'evo_tarif', evo_tarifid: string | null, evo_baseproductid: string | null, evo_min_period: number | null, evo_max_period: number | null, evo_delivery_time: Array | null, evo_min_first_payment: number | null, evo_max_first_payment: number | null, evo_min_last_payment: number | null, evo_max_last_payment: number | null, evo_used: boolean | null, evo_pl_use_type: Array | null, evo_nds_rules: number | null, evo_floating_rate: boolean | null, label: string | null, value: string | null, evo_leasingobject_types: Array<{ __typename?: 'evo_leasingobject_type', evo_leasingobject_typeid: string | null } | null> | null } | null> | null }; export type GetTarifQueryVariables = Exact<{ tarifId: Scalars['Uuid']['input']; @@ -1204,7 +1207,7 @@ export const GetOpportunityDocument = {"kind":"Document","definitions":[{"kind": export const GetOpportunitiesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetOpportunities"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"domainname"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"opportunities"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"owner_domainname"},"value":{"kind":"Variable","name":{"kind":"Name","value":"domainname"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"opportunityid"}}]}}]}}]} as unknown as DocumentNode; export const GetQuotesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuotes"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quotes"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_leadid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_quotename"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"quoteid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_recalc_limit"}},{"kind":"Field","name":{"kind":"Name","value":"evo_statuscodeidData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_purchases_participation"}}]}}]}}]} as unknown as DocumentNode; export const GetQuoteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuote"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_baseproductid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_one_year_insurance"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_change_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_price_change"}},{"kind":"Field","name":{"kind":"Name","value":"evo_discount_supplier_currency"}},{"kind":"Field","name":{"kind":"Name","value":"evo_equip_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_program_import_subsidy_sum"}},{"kind":"Field","name":{"kind":"Name","value":"evo_nds_in_price_supplier_currency"}},{"kind":"Field","name":{"kind":"Name","value":"evo_supplier_currency_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_approved_first_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_recalc_limit"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_mass"}},{"kind":"Field","name":{"kind":"Name","value":"evo_seats"}},{"kind":"Field","name":{"kind":"Name","value":"evo_year"}},{"kind":"Field","name":{"kind":"Name","value":"evo_last_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_maximum_percentage_av"}},{"kind":"Field","name":{"kind":"Name","value":"evo_untype_insurance"}},{"kind":"Field","name":{"kind":"Name","value":"evo_percent_subsidy"}},{"kind":"Field","name":{"kind":"Name","value":"evo_programsolution"}},{"kind":"Field","name":{"kind":"Name","value":"evo_kasko_payer"}},{"kind":"Field","name":{"kind":"Name","value":"evo_promotion"}}]}}]}}]} as unknown as DocumentNode; -export const GetTarifsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTarifs"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_tarifs"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_tarifid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_tarifid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_baseproductid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_delivery_time"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_first_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_first_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_last_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_last_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_used"}},{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_pl_use_type"}}]}}]}}]} as unknown as DocumentNode; +export const GetTarifsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTarifs"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_tarifs"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_tarifid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_tarifid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_baseproductid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_delivery_time"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_first_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_first_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_last_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_last_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_used"}},{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_pl_use_type"}},{"kind":"Field","name":{"kind":"Name","value":"evo_nds_rules"}},{"kind":"Field","name":{"kind":"Name","value":"evo_floating_rate"}}]}}]}}]} as unknown as DocumentNode; export const GetTarifDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTarif"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"tarifId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_tarif"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_tarifid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"tarifId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_irr"}},{"kind":"Field","name":{"kind":"Name","value":"evo_graphtype_exception"}},{"kind":"Field","name":{"kind":"Name","value":"evo_seasons_type_exception"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_decreasing_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_irr"}},{"kind":"Field","name":{"kind":"Name","value":"evo_cut_irr_with_bonus_coefficient"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_irr"}},{"kind":"Field","name":{"kind":"Name","value":"evo_rates"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_datefrom"}},{"kind":"Field","name":{"kind":"Name","value":"evo_rateid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_irr_plan"}},{"kind":"Field","name":{"kind":"Name","value":"evo_margin_min"}}]}}]}}]} as unknown as DocumentNode; export const GetRatesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRates"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_rates"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_rateid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id"}},{"kind":"Field","name":{"kind":"Name","value":"evo_tarifs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_tarifid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_rateid"}}]}}]}}]} as unknown as DocumentNode; export const GetRateDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRate"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"rateId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_rate"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_rateid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"rateId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_base_rate"}},{"kind":"Field","name":{"kind":"Name","value":"evo_credit_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id"}},{"kind":"Field","name":{"kind":"Name","value":"evo_finance_rate"}}]}}]}}]} as unknown as DocumentNode; diff --git a/apps/web/process/configurator/lib/helper.ts b/apps/web/process/configurator/lib/helper.ts index a93de4d..c149189 100644 --- a/apps/web/process/configurator/lib/helper.ts +++ b/apps/web/process/configurator/lib/helper.ts @@ -1,3 +1,4 @@ +/* eslint-disable sonarjs/cognitive-complexity */ import defaultValues from '@/config/default-values'; import * as CRMTypes from '@/graphql/crm.types'; import type { ProcessContext } from '@/process/types'; @@ -9,10 +10,12 @@ type GetTarifInputValues = Pick< CalculationValues, | 'deliveryTime' | 'firstPaymentPerc' + | 'floatingRate' | 'lastPaymentPerc' | 'leaseObjectType' | 'leaseObjectUsed' | 'leasingPeriod' + | 'partialVAT' | 'product' >; @@ -128,6 +131,8 @@ export default function helper({ apolloClient }: Pick { + if (partialVAT) { + return ( + tarif?.evo_nds_rules && [100_000_000, 100_000_002].includes(tarif?.evo_nds_rules) + ); + } else { + return ( + tarif?.evo_nds_rules && [100_000_000, 100_000_001].includes(tarif?.evo_nds_rules) + ); + } + }) + .filter((tarif) => { + if (floatingRate) { + return tarif?.evo_floating_rate; + } else { + return !tarif?.evo_floating_rate; + } + }) .at(0); return { evo_tarif, evo_tarifs }; diff --git a/apps/web/process/configurator/reactions/values.ts b/apps/web/process/configurator/reactions/values.ts index 405d7c2..d1c451e 100644 --- a/apps/web/process/configurator/reactions/values.ts +++ b/apps/web/process/configurator/reactions/values.ts @@ -26,6 +26,8 @@ export default function valuesReactions({ store, apolloClient }: ProcessContext) 'firstPaymentPerc', 'lastPaymentPerc', 'leaseObjectType', + 'floatingRate', + 'partialVAT', ]), async (values) => { const { evo_tarif, evo_tarifs } = await getTarifs(values);