diff --git a/Components/Calculation/Form/Leasing/config.ts b/Components/Calculation/Form/Leasing/config.ts index c47402d..a7b55c2 100644 --- a/Components/Calculation/Form/Leasing/config.ts +++ b/Components/Calculation/Form/Leasing/config.ts @@ -10,6 +10,8 @@ export const rows: FormTabRows = [ [['selectSupplierCurrency', 'tbxSupplierDiscountRub', 'tbxSupplierDiscountPerc']], [['tbxFirstPaymentPerc', 'tbxFirstPaymentRub']], [['tbxLeasingPeriod', 'tbxSaleBonus', 'tbxRedemptionPaymentSum']], - [['selectSubsidy', 'labelSubsidySum']], - [['tbxLastPaymentPerc', 'tbxLastPaymentRub', 'radioLastPaymentRule']], + [['selectSubsidy', 'tbxSubsidySum']], + [['selectImportProgram', 'tbxImportProgramSum', 'tbxAddEquipmentPrice']], + [['radioLastPaymentRule'], { gridTemplateColumns: '1fr' }], + [['tbxLastPaymentPerc', 'tbxLastPaymentRub']], ]; diff --git a/Components/Calculation/config/elements-builders.ts b/Components/Calculation/config/elements-builders.ts index c16f8a5..79699d9 100644 --- a/Components/Calculation/config/elements-builders.ts +++ b/Components/Calculation/config/elements-builders.ts @@ -20,6 +20,9 @@ const builders = wrapElementsBuilders({ tbxFirstPaymentRub: buildValue, tbxLastPaymentPerc: buildValue, tbxLastPaymentRub: buildValue, + selectImportProgram: buildOptions, + tbxImportProgramSum: buildReadonly, + tbxAddEquipmentPrice: buildValue, tbxRedemptionPaymentSum: buildValue, tbxParmentsDecreasePercent: buildValue, tbxComissionPerc: buildValue, @@ -133,7 +136,7 @@ const builders = wrapElementsBuilders({ labelIrrInfo: buildReadonly, labelRegistrationDescription: buildReadonly, labelDepreciationGroup: buildReadonly, - labelSubsidySum: buildReadonly, + tbxSubsidySum: buildReadonly, btnCreateKP: buildAction, btnCalculate: buildAction, diff --git a/Components/Calculation/config/elements-components.ts b/Components/Calculation/config/elements-components.ts index b11afc8..bb80694 100644 --- a/Components/Calculation/config/elements-components.ts +++ b/Components/Calculation/config/elements-components.ts @@ -30,9 +30,12 @@ const components = wrapComponentsMap({ tbxSaleBonus: InputNumber, tbxFirstPaymentPerc: InputNumber, tbxFirstPaymentRub: InputNumber, - radioLastPaymentRule: Radio, + radioLastPaymentRule: Segmented, tbxLastPaymentPerc: InputNumber, tbxLastPaymentRub: InputNumber, + selectImportProgram: Select, + tbxImportProgramSum: InputNumber, + tbxAddEquipmentPrice: InputNumber, tbxRedemptionPaymentSum: InputNumber, tbxLeasingPeriod: InputNumber, radioGraphType: Radio, @@ -142,7 +145,7 @@ const components = wrapComponentsMap({ labelIrrInfo: Text, labelRegistrationDescription: Text, labelDepreciationGroup: Text, - labelSubsidySum: InputNumber, + tbxSubsidySum: InputNumber, /** Button Elements */ btnCreateKP: Button, diff --git a/Components/Calculation/config/elements-props.ts b/Components/Calculation/config/elements-props.ts index 7263e30..89036e8 100644 --- a/Components/Calculation/config/elements-props.ts +++ b/Components/Calculation/config/elements-props.ts @@ -1,7 +1,6 @@ import { MAX_FRANCHISE, MAX_LEASING_PERIOD } from 'constants/values'; import DownloadOutlined from 'Elements/icons/DownloadOutlined'; import date from 'tools/date'; -import { formatNumber } from 'tools/format'; import type { ElementsProps } from './elements-components'; const props: Partial = { @@ -10,40 +9,38 @@ const props: Partial = { max: 1_000_000_000, step: 10_000, precision: 2, - formatter: formatNumber, }, tbxLeaseObjectPriceWthtVAT: { min: 0, max: 1_000_000_000, step: 10_000, precision: 2, - formatter: formatNumber, }, tbxVATInLeaseObjectPrice: { min: 0, max: 1_000_000_000, step: 10_000, precision: 2, - formatter: formatNumber, }, tbxEngineHours: { min: 0, step: 10, precision: 2, - formatter: formatNumber, }, tbxSupplierDiscountRub: { min: 0, max: 1_000_000_000, step: 10_000, precision: 2, - formatter: formatNumber, + + addonBefore: '₽', }, tbxSupplierDiscountPerc: { min: 0, max: 100, precision: 2, - formatter: formatNumber, + + addonBefore: '%', }, radioBalanceHolder: { optionType: 'button', @@ -54,50 +51,70 @@ const props: Partial = { // max: 1.30, step: 0.1, precision: 2, - formatter: formatNumber, + + addonBefore: '%', }, radioLastPaymentRule: { - spaceProps: { - direction: 'vertical', - }, + block: true, }, tbxFirstPaymentPerc: { min: 0, max: 50, precision: 4, - formatter: formatNumber, + + addonBefore: '%', }, tbxFirstPaymentRub: { min: 0, max: 1_000_000_000, step: 10_000, precision: 2, - formatter: formatNumber, + + addonBefore: '₽', }, tbxLastPaymentPerc: { min: 0, max: 70, step: 1, precision: 6, - formatter: formatNumber, + + addonBefore: '%', }, tbxLastPaymentRub: { min: 0, max: 1_000_000_000, step: 10_000, precision: 2, - formatter: formatNumber, + + addonBefore: '₽', }, tbxRedemptionPaymentSum: { min: 1000, max: 2000, step: 1000, precision: 2, - formatter: formatNumber, + + addonBefore: '₽', }, tbxLeasingPeriod: { min: 13, max: MAX_LEASING_PERIOD, + addonAfter: 'мес.', + }, + tbxSubsidySum: { + min: 0, + precision: 2, + addonBefore: '₽', + }, + tbxImportProgramSum: { + min: 0, + precision: 2, + addonBefore: '₽', + }, + tbxAddEquipmentPrice: { + min: 0, + precision: 2, + addonBefore: '₽', }, tbxParmentsDecreasePercent: { min: 50, @@ -146,20 +163,17 @@ const props: Partial = { max: 20_000, step: 10, precision: 2, - formatter: formatNumber, }, tbxEngineVolume: { min: 0, max: 99.9999, step: 0.5, precision: 4, - formatter: formatNumber, }, tbxMaxMass: { min: 0, max: 999_999, step: 100, - formatter: formatNumber, }, tbxCountSeats: { min: 0, @@ -177,42 +191,36 @@ const props: Partial = { max: 20, step: 0.1, precision: 2, - formatter: formatNumber, }, tbxDealerBrokerRewardSumm: { min: 0, max: 20, step: 0.1, precision: 2, - formatter: formatNumber, }, tbxIndAgentRewardSumm: { min: 0, max: 20, step: 0.1, precision: 2, - formatter: formatNumber, }, tbxCalcDoubleAgentRewardSumm: { min: 0, max: 20, step: 0.1, precision: 2, - formatter: formatNumber, }, tbxCalcBrokerRewardSum: { min: 0, max: 20, step: 0.1, precision: 2, - formatter: formatNumber, }, tbxFinDepartmentRewardSumm: { min: 0, max: 20, step: 0.1, precision: 2, - formatter: formatNumber, }, radioInsKaskoType: { optionType: 'button', @@ -223,7 +231,6 @@ const props: Partial = { max: MAX_FRANCHISE, step: 10_000, precision: 2, - formatter: formatNumber, }, tbxInsAgeDrivers: { // min: 18, @@ -292,7 +299,6 @@ const props: Partial = { max: 500, step: 0.0001, precision: 6, - formatter: formatNumber, }, linkDownloadKp: { type: 'primary', @@ -303,7 +309,6 @@ const props: Partial = { min: 0, step: 100, precision: 2, - formatter: formatNumber, }, cbxRecalcWithRevision: { text: 'Пересчет без пересмотра', @@ -315,7 +320,6 @@ const props: Partial = { min: 0, step: 1000, precision: 2, - formatter: formatNumber, }, tbxVehicleTaxInYear: { min: 0, @@ -335,7 +339,7 @@ const props: Partial = { tbxInsKaskoPriceLeasePeriod: { min: 0, precision: 2, - formatter: formatNumber, + readOnly: true, controls: false, }, diff --git a/Components/Calculation/config/elements-titles.ts b/Components/Calculation/config/elements-titles.ts index d68bc26..307ac1d 100644 --- a/Components/Calculation/config/elements-titles.ts +++ b/Components/Calculation/config/elements-titles.ts @@ -10,16 +10,19 @@ const titles: Record = { selectClientRisk: 'Риск клиента', selectClientType: 'Тип клиента', tbxLeaseObjectPrice: 'Стоимость ПЛ с НДС', - selectSupplierCurrency: 'Валюта поставщика', - tbxSupplierDiscountRub: 'Скидка от поставщика', - tbxSupplierDiscountPerc: 'Скидка от поставщика, %', - tbxLeasingPeriod: 'Срок лизинга, мес', - tbxFirstPaymentPerc: 'Первый платеж, %', - tbxFirstPaymentRub: 'Первый платеж, руб.', - tbxLastPaymentPerc: 'Последний платеж, %', - tbxLastPaymentRub: 'Последний платеж, руб.', + selectSupplierCurrency: 'Валюта поставщика (ДКП)', + tbxSupplierDiscountRub: 'Сумма скидки от поставщика', + tbxSupplierDiscountPerc: 'Размер скидки от поставщика', + tbxLeasingPeriod: 'Срок лизинга', + tbxFirstPaymentPerc: 'Размер первого платежа', + tbxFirstPaymentRub: 'Сумма первого платежа', + tbxLastPaymentPerc: 'Размер последнего платежа', + tbxLastPaymentRub: 'Сумма последнего платежа', radioLastPaymentRule: 'Последний платеж', - tbxRedemptionPaymentSum: 'Сумма выкупного платежа, руб', + selectImportProgram: 'Программа от производителя', + tbxImportProgramSum: 'Сумма скидки от производителя', + tbxAddEquipmentPrice: 'Стоимость доп.оборудования', + tbxRedemptionPaymentSum: 'Сумма выкупного платежа', radioBalanceHolder: 'Балансодержатель', radioGraphType: 'Вид графика', tbxParmentsDecreasePercent: 'Процент убывания платежей', @@ -133,7 +136,7 @@ const titles: Record = { labelRegistrationDescription: 'Описание регистрации', tbxInsKaskoPriceLeasePeriod: 'Стоимость страховки КАСКО на весь срок', labelDepreciationGroup: 'Группа обесценения', - labelSubsidySum: 'Сумма субсидии с НДС', + tbxSubsidySum: 'Сумма субсидии', /** Action Elements */ btnCalculate: '', diff --git a/Components/Calculation/config/map/values.ts b/Components/Calculation/config/map/values.ts index a0a52b3..71c71b7 100644 --- a/Components/Calculation/config/map/values.ts +++ b/Components/Calculation/config/map/values.ts @@ -25,6 +25,9 @@ const elementsToValues = wrapElementsMap({ tbxLastPaymentPerc: 'lastPaymentPerc', tbxLastPaymentRub: 'lastPaymentRub', radioLastPaymentRule: 'lastPaymentRule', + selectImportProgram: 'importProgram', + tbxImportProgramSum: 'importProgramSum', + tbxAddEquipmentPrice: 'addEquipmentPrice', tbxRedemptionPaymentSum: 'redemptionPaymentSum', radioBalanceHolder: 'balanceHolder', radioGraphType: 'graphType', @@ -121,7 +124,7 @@ const elementsToValues = wrapElementsMap({ selectLegalClientRegion: 'legalClientRegion', selectLegalClientTown: 'legalClientTown', selectSubsidy: 'subsidy', - labelSubsidySum: 'subsidySum', + tbxSubsidySum: 'subsidySum', selectFuelCard: 'fuelCard', tbxMinPriceChange: 'minPriceChange', diff --git a/Components/Output/Results/config.ts b/Components/Output/Results/config.ts index 977bf7d..15ac610 100644 --- a/Components/Output/Results/config.ts +++ b/Components/Output/Results/config.ts @@ -44,7 +44,7 @@ const moneyFormatters = Object.fromEntries( 'resultBonusMPL', 'resultDopMPLLeasing', 'resultBonusDopProd', - 'labelSubsidySum', + 'tbxSubsidySum', 'resultBonusSafeFinance', 'resultPriceUpPr', ] as Values[] diff --git a/config/default-options.ts b/config/default-options.ts index 21a9de7..5ee29e6 100644 --- a/config/default-options.ts +++ b/config/default-options.ts @@ -4,16 +4,16 @@ import type { CalculationOptions } from 'stores/calculation/options/types'; const defaultOptions: CalculationOptions = { radioLastPaymentRule: [ { - label: 'равен платежу', - value: 100_000_002, + label: 'в процентах', + value: 100_000_001, }, { label: 'в рублях', value: 100_000_000, }, { - label: 'в процентах', - value: 100_000_001, + label: 'равен платежу', + value: 100_000_002, }, ], @@ -488,10 +488,20 @@ const defaultOptions: CalculationOptions = { selectLegalClientRegion: [], selectLegalClientTown: [], selectSubsidy: [], - labelSubsidySum: [], + tbxSubsidySum: [], selectFuelCard: [], tbxMinPriceChange: [], linkDownloadKp: [], + selectImportProgram: [], + tbxImportProgramSum: [], + tbxAddEquipmentPrice: [], + labelLeaseObjectRisk: [], + tbxInsKaskoPriceLeasePeriod: [], + labelIrrInfo: [], + labelRegistrationDescription: [], + linkLeadUrl: [], + linkOpportunityUrl: [], + linkQuoteUrl: [], }; export default defaultOptions; diff --git a/config/default-statuses.ts b/config/default-statuses.ts index e1d9324..f1180a4 100644 --- a/config/default-statuses.ts +++ b/config/default-statuses.ts @@ -118,10 +118,20 @@ const defaultStatuses: CalculationStatuses = { selectLegalClientRegion: 'Default', selectLegalClientTown: 'Default', selectSubsidy: 'Default', - labelSubsidySum: 'Default', + tbxSubsidySum: 'Default', selectFuelCard: 'Default', tbxMinPriceChange: 'Default', linkDownloadKp: 'Default', + selectImportProgram: 'Default', + tbxImportProgramSum: 'Default', + tbxAddEquipmentPrice: 'Default', + labelLeaseObjectRisk: 'Default', + tbxInsKaskoPriceLeasePeriod: 'Default', + labelIrrInfo: 'Default', + labelRegistrationDescription: 'Default', + linkLeadUrl: 'Default', + linkOpportunityUrl: 'Default', + linkQuoteUrl: 'Default', }; export default defaultStatuses; diff --git a/config/default-values.ts b/config/default-values.ts index aab14d2..7f23bd3 100644 --- a/config/default-values.ts +++ b/config/default-values.ts @@ -131,6 +131,9 @@ const defaultValues: CalculationValues = { irrInfo: '-', registrationDescription: '-', depreciationGroup: '-', + importProgram: null, + importProgramSum: 0, + addEquipmentPrice: 0, }; export default defaultValues; diff --git a/stores/calculation/values/types.ts b/stores/calculation/values/types.ts index ae45e97..a4aeea3 100644 --- a/stores/calculation/values/types.ts +++ b/stores/calculation/values/types.ts @@ -16,6 +16,9 @@ export type CalculationValues = { lastPaymentPerc: number; lastPaymentRub: number; lastPaymentRule: 100_000_000 | 100_000_001 | 100_000_002 | null; + importProgram: string | null; + importProgramSum: number; + addEquipmentPrice: number; redemptionPaymentSum: number; balanceHolder: 100_000_000 | 100_000_001 | null; graphType: 100_000_000 | 100_000_001 | 100_000_002 | 100_000_003 | 100_000_004 | null;