Merge branch 'development'

This commit is contained in:
Chika 2022-01-27 13:22:04 +03:00
commit 8ea2c5fdfe
2 changed files with 6 additions and 38 deletions

View File

@ -1469,35 +1469,6 @@ const reactionEffects: IReactionEffect[] = [
},
}),
(calculationStore, calculationProcess) => ({
expression: () => {
return calculationStore.getValue('leasingPeriod');
},
effect: () => {
if (calculationProcess.hasProcess(Process.LoadKp)) {
return;
}
const fuelCard = calculationStore.getOption('selectFuelCard');
if (fuelCard) {
const selectFuelCard_filter =
calculationStore.getFilter('selectFuelCard');
const selectFueldCard_options =
calculationStore.getOptions('selectFuelCard');
if (selectFuelCard_filter && selectFueldCard_options) {
const filtered_technicalCards = selectFuelCard_filter(
selectFueldCard_options,
);
calculationStore.setValue(
'fuelCard',
filtered_technicalCards?.[0]?.evo_addproduct_typeid,
);
}
}
},
}),
calculationStore => ({
expression: () => {
const {
@ -1710,7 +1681,7 @@ const reactionEffects: IReactionEffect[] = [
brand,
brand =>
brand?.evo_vehicle_type &&
brand?.evo_vehicle_type?.length &&
intersection(
brand.evo_vehicle_type?.filter(x => x > 0),
leaseObjectType.evo_vehicle_type,
@ -1719,7 +1690,7 @@ const reactionEffects: IReactionEffect[] = [
brand =>
brand &&
(!subsidy?.evo_brands ||
(!subsidy?.evo_brands?.length ||
subsidy?.evo_brands?.filter(
x => x.evo_brandid === brand.evo_brandid,
)?.length),
@ -1773,7 +1744,7 @@ const reactionEffects: IReactionEffect[] = [
calculationStore.setFilter('selectLeaseObjectType', types =>
types.filter(
type =>
!subsidy?.evo_leasingobject_types ||
!subsidy?.evo_leasingobject_types?.length ||
subsidy.evo_leasingobject_types.filter(
x => x.evo_leasingobject_typeid === type.evo_leasingobject_typeid,
)?.length,
@ -1783,7 +1754,7 @@ const reactionEffects: IReactionEffect[] = [
calculationStore.setFilter('selectDealer', dealers =>
dealers.filter(
dealer =>
!subsidy?.accounts ||
!subsidy?.accounts?.length ||
subsidy.accounts.filter(x => x.accountid === dealer.accountid)
?.length,
),
@ -1792,7 +1763,7 @@ const reactionEffects: IReactionEffect[] = [
calculationStore.setFilter('selectDealerPerson', dealerPersons =>
dealerPersons.filter(
dealerPerson =>
!subsidy?.accounts ||
!subsidy?.accounts?.length ||
subsidy.accounts.filter(x => x.accountid === dealerPerson.accountid)
?.length,
),

View File

@ -6,9 +6,6 @@ import { TElementFilter } from 'core/types/Calculation/Store/filters';
const initialFilters: TElements<TElementFilter> = {};
export const noResetValueElements: ElementsNames[] = [
'selectTechnicalCard',
'selectFuelCard',
];
export const noResetValueElements: ElementsNames[] = ['selectTechnicalCard'];
export default initialFilters;