Merge branch 'development'
This commit is contained in:
commit
f2523885d7
@ -116,9 +116,9 @@ export default function (this: ICalculationStore): PreparedData {
|
|||||||
preparedValues.subsidySum =
|
preparedValues.subsidySum =
|
||||||
parseInt(values.subsidySum) / (1 + valuesConstants.VAT);
|
parseInt(values.subsidySum) / (1 + valuesConstants.VAT);
|
||||||
preparedValues.subsidyPaymentNumber =
|
preparedValues.subsidyPaymentNumber =
|
||||||
this.getOption('selectSubsidy')?.evo_get_subsidy_payment;
|
this.getOption('selectSubsidy')?.evo_get_subsidy_payment || 0;
|
||||||
preparedValues.fuelCardSum =
|
preparedValues.fuelCardSum =
|
||||||
this.getOption('selectFuelCard')?.evo_graph_price_withoutnds;
|
this.getOption('selectFuelCard')?.evo_graph_price_withoutnds || 0;
|
||||||
preparedValues.scheduleOfPayments = values.graphType;
|
preparedValues.scheduleOfPayments = values.graphType;
|
||||||
preparedValues.comissionRub =
|
preparedValues.comissionRub =
|
||||||
(values.comissionRub as number) / (1 + valuesConstants.VAT);
|
(values.comissionRub as number) / (1 + valuesConstants.VAT);
|
||||||
@ -846,19 +846,7 @@ export default function (this: ICalculationStore): PreparedData {
|
|||||||
//
|
//
|
||||||
|
|
||||||
const nsibBaseValue =
|
const nsibBaseValue =
|
||||||
((preparedValues.plPrice || 0) -
|
((preparedValues.plPrice || 0) - preparedValues.firstPaymentSum) *
|
||||||
(preparedValues.importProgramSum || 0) +
|
|
||||||
(preparedValues.insuranceContract +
|
|
||||||
(preparedValues.rats || 0) +
|
|
||||||
(preparedValues.registration || 0) +
|
|
||||||
(preparedValues.trackerCost || 0) +
|
|
||||||
(preparedValues.tLMCost || 0) +
|
|
||||||
(preparedValues.transportTaxGr || 0) +
|
|
||||||
(preparedValues.tlmCostPaymentSum || 0) +
|
|
||||||
(preparedValues.gpsCostPaymentSum || 0)) *
|
|
||||||
preparedValues.leasing0K -
|
|
||||||
preparedValues.firstPaymentSum -
|
|
||||||
(values.product === 'LEASING0' ? 0 : preparedValues.discount || 0)) *
|
|
||||||
(1 + valuesConstants.VAT);
|
(1 + valuesConstants.VAT);
|
||||||
|
|
||||||
if (nsibBaseValue > valuesConstants.NSIB_MAX) {
|
if (nsibBaseValue > valuesConstants.NSIB_MAX) {
|
||||||
|
|||||||
@ -43,9 +43,13 @@ const customConditions: Partial<Record<ElementsNames, ValidationCondition>> = {
|
|||||||
tbxVehicleTaxInYear: calculationStore => {
|
tbxVehicleTaxInYear: calculationStore => {
|
||||||
const objectRegistration = calculationStore.getValue('objectRegistration');
|
const objectRegistration = calculationStore.getValue('objectRegistration');
|
||||||
const vehicleTaxInYear = calculationStore.getValue('vehicleTaxInYear');
|
const vehicleTaxInYear = calculationStore.getValue('vehicleTaxInYear');
|
||||||
|
const vehicleTaxInLeasingPeriod = calculationStore.getValue(
|
||||||
|
'vehicleTaxInLeasingPeriod',
|
||||||
|
);
|
||||||
if (
|
if (
|
||||||
objectRegistration === 100000001 &&
|
objectRegistration === 100000001 &&
|
||||||
CONDITIONS.LESS_OR_EQUALS_ZERO(vehicleTaxInYear)
|
(CONDITIONS.LESS_OR_EQUALS_ZERO(vehicleTaxInLeasingPeriod) ||
|
||||||
|
CONDITIONS.LESS_OR_EQUALS_ZERO(vehicleTaxInYear))
|
||||||
) {
|
) {
|
||||||
return {
|
return {
|
||||||
isValid: false,
|
isValid: false,
|
||||||
|
|||||||
@ -404,17 +404,36 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
|
|
||||||
calculationStore => ({
|
calculationStore => ({
|
||||||
expression: () => {
|
expression: () => {
|
||||||
const { leasingPeriod } = calculationStore.values;
|
const { leasingPeriod, leasingWithoutKasko } = calculationStore.values;
|
||||||
return leasingPeriod;
|
const kaskoInsured =
|
||||||
|
calculationStore.tables.tableInsurance.rows[1].insured?.value;
|
||||||
|
|
||||||
|
const fingapInsured =
|
||||||
|
calculationStore.tables.tableInsurance.rows[4].insured?.value;
|
||||||
|
|
||||||
|
return {
|
||||||
|
leasingPeriod,
|
||||||
|
leasingWithoutKasko,
|
||||||
|
kaskoInsured,
|
||||||
|
fingapInsured,
|
||||||
|
};
|
||||||
},
|
},
|
||||||
effect: leasingPeriod => {
|
effect: ({
|
||||||
if (leasingPeriod) {
|
leasingPeriod,
|
||||||
if (parseInt(leasingPeriod) < 12) {
|
leasingWithoutKasko,
|
||||||
calculationStore.setValue('insNSIB', null);
|
kaskoInsured,
|
||||||
calculationStore.setStatus('selectInsNSIB', ElementStatus.Disabled);
|
fingapInsured,
|
||||||
} else {
|
}) => {
|
||||||
calculationStore.setStatus('selectInsNSIB', ElementStatus.Default);
|
if (
|
||||||
}
|
leasingPeriod < 12 ||
|
||||||
|
leasingWithoutKasko ||
|
||||||
|
kaskoInsured === 100_000_001 ||
|
||||||
|
(fingapInsured === 100_000_001 && leasingPeriod < 36)
|
||||||
|
) {
|
||||||
|
calculationStore.setValue('insNSIB', null);
|
||||||
|
calculationStore.setStatus('selectInsNSIB', ElementStatus.Disabled);
|
||||||
|
} else {
|
||||||
|
calculationStore.setStatus('selectInsNSIB', ElementStatus.Default);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
@ -422,6 +441,69 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
calculationStore => ({
|
||||||
|
expression: () => {
|
||||||
|
//@ts-ignore
|
||||||
|
const plPriceRub = calculationStore.plPriceRub();
|
||||||
|
//@ts-ignore
|
||||||
|
const discountRub = calculationStore.discountRub();
|
||||||
|
//@ts-ignore
|
||||||
|
const importProgramSum: number = calculationStore.importProgramSum();
|
||||||
|
|
||||||
|
const {
|
||||||
|
leasingPeriod,
|
||||||
|
leaseObjectType,
|
||||||
|
addEquipmentPrice,
|
||||||
|
firstPaymentPerc,
|
||||||
|
} = calculationStore.values;
|
||||||
|
return {
|
||||||
|
leasingPeriod,
|
||||||
|
leaseObjectType,
|
||||||
|
plPriceRub,
|
||||||
|
discountRub,
|
||||||
|
addEquipmentPrice,
|
||||||
|
importProgramSum,
|
||||||
|
firstPaymentPerc,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
effect: ({
|
||||||
|
leasingPeriod = 0,
|
||||||
|
leaseObjectType,
|
||||||
|
plPriceRub = 0,
|
||||||
|
discountRub = 0,
|
||||||
|
addEquipmentPrice = 0,
|
||||||
|
importProgramSum = 0,
|
||||||
|
firstPaymentPerc = 0,
|
||||||
|
}) => {
|
||||||
|
calculationStore.setFilter('selectInsNSIB', options =>
|
||||||
|
options.filter(
|
||||||
|
x =>
|
||||||
|
x?.evo_max_period !== undefined &&
|
||||||
|
x?.evo_min_period !== undefined &&
|
||||||
|
x.evo_max_period >= leasingPeriod &&
|
||||||
|
x.evo_min_period <= leasingPeriod &&
|
||||||
|
x?.evo_max_price !== undefined &&
|
||||||
|
x?.evo_min_price !== undefined &&
|
||||||
|
x.evo_max_price >=
|
||||||
|
plPriceRub - discountRub - importProgramSum + addEquipmentPrice &&
|
||||||
|
x.evo_min_price <=
|
||||||
|
plPriceRub - discountRub - importProgramSum + addEquipmentPrice &&
|
||||||
|
x.evo_leasingobject_types?.find(
|
||||||
|
x => x.evo_leasingobject_typeid === leaseObjectType,
|
||||||
|
) &&
|
||||||
|
x.evo_visible_calc &&
|
||||||
|
x.evo_min_first_payment_perc !== undefined &&
|
||||||
|
x.evo_min_first_payment_perc <= firstPaymentPerc &&
|
||||||
|
x.evo_max_first_payment_perc !== undefined &&
|
||||||
|
x.evo_max_first_payment_perc >= firstPaymentPerc,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
fireImmediately: true,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
|
||||||
// calculationStore => ({
|
// calculationStore => ({
|
||||||
// expression: () => {
|
// expression: () => {
|
||||||
// const { leasingPeriod } = calculationStore.values;
|
// const { leasingPeriod } = calculationStore.values;
|
||||||
@ -800,22 +882,28 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
|
|
||||||
calculationStore => ({
|
calculationStore => ({
|
||||||
expression: () => {
|
expression: () => {
|
||||||
const { leasingPeriod, leaseObjectType } = calculationStore.values;
|
const { leasingPeriod, leaseObjectType, maxMass } =
|
||||||
return { leasingPeriod, leaseObjectType };
|
calculationStore.values;
|
||||||
|
return { leasingPeriod, leaseObjectType, maxMass };
|
||||||
},
|
},
|
||||||
effect: ({ leasingPeriod, leaseObjectType }) => {
|
effect: ({ leasingPeriod, leaseObjectType, maxMass }) => {
|
||||||
calculationStore.setFilter('selectTechnicalCard', options =>
|
if (maxMass >= 40000) {
|
||||||
options.filter(
|
calculationStore.setFilter('selectTechnicalCard', () => []);
|
||||||
x =>
|
calculationStore.setValue('technicalCard', null);
|
||||||
x?.evo_max_period &&
|
} else {
|
||||||
x?.evo_min_period &&
|
calculationStore.setFilter('selectTechnicalCard', options =>
|
||||||
x.evo_max_period >= leasingPeriod &&
|
options.filter(
|
||||||
x.evo_min_period <= leasingPeriod &&
|
x =>
|
||||||
x.evo_leasingobject_types?.find(
|
x?.evo_max_period &&
|
||||||
x => x.evo_leasingobject_typeid === leaseObjectType,
|
x?.evo_min_period &&
|
||||||
),
|
x.evo_max_period >= leasingPeriod &&
|
||||||
),
|
x.evo_min_period <= leasingPeriod &&
|
||||||
);
|
x.evo_leasingobject_types?.find(
|
||||||
|
x => x.evo_leasingobject_typeid === leaseObjectType,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
fireImmediately: true,
|
fireImmediately: true,
|
||||||
|
|||||||
@ -116,6 +116,20 @@ query GetMainOptions(
|
|||||||
evo_dateto_param: { gte: $currentDate }
|
evo_dateto_param: { gte: $currentDate }
|
||||||
) {
|
) {
|
||||||
...evo_addproduct_types_fields
|
...evo_addproduct_types_fields
|
||||||
|
evo_leasingobject_types {
|
||||||
|
evo_leasingobject_typeid
|
||||||
|
}
|
||||||
|
evo_visible_calc
|
||||||
|
evo_min_price
|
||||||
|
evo_max_price
|
||||||
|
evo_loss_kv
|
||||||
|
evo_min_first_payment_perc
|
||||||
|
evo_max_first_payment_perc
|
||||||
|
evo_models {
|
||||||
|
evo_modelid
|
||||||
|
}
|
||||||
|
evo_evokasko_calc_type
|
||||||
|
evo_price_service_provider_withoutnds
|
||||||
}
|
}
|
||||||
selectTracker: evo_addproduct_types(
|
selectTracker: evo_addproduct_types(
|
||||||
statecode: $statecode
|
statecode: $statecode
|
||||||
|
|||||||
Reference in New Issue
Block a user