Merge branch 'development'

This commit is contained in:
vchikalkin 2023-03-24 15:09:27 +03:00
commit 4bd7214fed
6 changed files with 37 additions and 3 deletions

View File

@ -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>> =

View File

@ -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);
}

View File

@ -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,14 +40,34 @@ 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 {
if (
!tarif?.evo_pl_use_type?.length ||
tarif.evo_pl_use_type.includes(100_000_000)
) {
return tarif;
}
}
},
),
);

View File

@ -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

View File

@ -2152,6 +2152,7 @@ type evo_tarif {
modifiedon: DateTime
statecode: Int
toObjectString: String
evo_pl_use_type: [Int!]
}
type evo_rate {

View File

@ -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[];