Merge branch 'development'
This commit is contained in:
commit
4bd7214fed
@ -369,6 +369,12 @@ const elementsProps: Partial<Record<AllElementsNames, ElementProps>> = {
|
||||
labelImportProgramSum: {
|
||||
middleware: value => formatMoney(value),
|
||||
},
|
||||
tbxBonusCoefficient: {
|
||||
min: '0.00',
|
||||
max: '10.00',
|
||||
step: '0.10',
|
||||
precision: 4,
|
||||
},
|
||||
};
|
||||
|
||||
export const numberElementsProps: Partial<Record<ElementsNames, ElementProps>> =
|
||||
|
||||
@ -136,7 +136,10 @@ export default function ($calculation: ICalculationStore) {
|
||||
const max_sale_bonus =
|
||||
(evo_coefficient_bonus?.evo_sot_coefficient || 0) * 100;
|
||||
if (max_sale_bonus) {
|
||||
$calculation.setValue('bonusCoefficient', saleBonus / max_sale_bonus);
|
||||
$calculation.setValue(
|
||||
'bonusCoefficient',
|
||||
round(saleBonus / max_sale_bonus, 4),
|
||||
);
|
||||
} else {
|
||||
$calculation.setValue('bonusCoefficient', 0);
|
||||
}
|
||||
|
||||
@ -14,6 +14,7 @@ export default function ($calculation: ICalculationStore) {
|
||||
'firstPaymentPerc',
|
||||
'lastPaymentPerc',
|
||||
'leaseObjectUsed',
|
||||
'leaseObjectType',
|
||||
]),
|
||||
};
|
||||
},
|
||||
@ -24,6 +25,7 @@ export default function ($calculation: ICalculationStore) {
|
||||
firstPaymentPerc,
|
||||
lastPaymentPerc,
|
||||
leaseObjectUsed,
|
||||
leaseObjectType,
|
||||
}) => {
|
||||
if (product && leasingPeriod && deliveryTime) {
|
||||
const target_tarif = $calculation.options.selectTarif?.find(
|
||||
@ -38,13 +40,33 @@ export default function ($calculation: ICalculationStore) {
|
||||
tarif.evo_min_last_payment <= lastPaymentPerc &&
|
||||
tarif.evo_max_last_payment >= lastPaymentPerc &&
|
||||
tarif,
|
||||
|
||||
tarif => {
|
||||
if (
|
||||
!tarif?.evo_leasingobject_types?.length ||
|
||||
(leaseObjectType &&
|
||||
tarif.evo_leasingobject_types
|
||||
.map(x => x.evo_leasingobject_typeid)
|
||||
.includes(leaseObjectType))
|
||||
) {
|
||||
return tarif;
|
||||
}
|
||||
},
|
||||
tarif => {
|
||||
if (leaseObjectUsed === true) {
|
||||
if (tarif.evo_used) {
|
||||
if (
|
||||
!tarif?.evo_pl_use_type?.length ||
|
||||
tarif.evo_pl_use_type.includes(100_000_001)
|
||||
) {
|
||||
return tarif;
|
||||
}
|
||||
} else {
|
||||
return tarif;
|
||||
if (
|
||||
!tarif?.evo_pl_use_type?.length ||
|
||||
tarif.evo_pl_use_type.includes(100_000_000)
|
||||
) {
|
||||
return tarif;
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
|
||||
@ -199,6 +199,7 @@ query GetMainOptions(
|
||||
evo_margin_min
|
||||
evo_cut_irr_with_bonus_coefficient
|
||||
evo_used
|
||||
evo_pl_use_type
|
||||
}
|
||||
selectRate: evo_rates(
|
||||
statecode: $statecode
|
||||
|
||||
@ -2152,6 +2152,7 @@ type evo_tarif {
|
||||
modifiedon: DateTime
|
||||
statecode: Int
|
||||
toObjectString: String
|
||||
evo_pl_use_type: [Int!]
|
||||
}
|
||||
|
||||
type evo_rate {
|
||||
|
||||
@ -439,6 +439,7 @@ export interface IEvoTarif extends BaseEntity {
|
||||
evo_dateto?: Date;
|
||||
evo_irr_plan?: number;
|
||||
evo_used?: boolean;
|
||||
evo_pl_use_type?: number[];
|
||||
evo_ins_type?: number;
|
||||
evo_client_risks?: IEvoClientRisk[];
|
||||
evo_leasingobject_types?: IEvoLeasingObjectType[];
|
||||
|
||||
Reference in New Issue
Block a user