Merge branch 'development'

This commit is contained in:
vchikalkin 2023-03-14 11:36:41 +03:00
commit 4fcc896357
5 changed files with 39 additions and 2 deletions

View File

@ -87,6 +87,12 @@ export default function ($calculation: ICalculationStore) {
x => x.accountid === dealer.accountid, x => x.accountid === dealer.accountid,
)?.length) && )?.length) &&
dealer, dealer,
dealer =>
(!product?.accounts?.length ||
//@ts-ignore
product.accounts.filter(x => x.accountid === dealer.accountid)
?.length) &&
dealer,
dealer => { dealer => {
if (product?.evo_supplier_financing_accept) { if (product?.evo_supplier_financing_accept) {
//@ts-ignore //@ts-ignore
@ -116,6 +122,13 @@ export default function ($calculation: ICalculationStore) {
x => x.accountid === dealerPerson.accountid, x => x.accountid === dealerPerson.accountid,
)?.length) && )?.length) &&
dealerPerson, dealerPerson,
dealerPerson =>
(!product?.accounts?.length ||
product.accounts.filter(
//@ts-ignore
x => x.accountid === dealerPerson.accountid,
)?.length) &&
dealerPerson,
dealerPerson => { dealerPerson => {
if (product?.evo_supplier_financing_accept) { if (product?.evo_supplier_financing_accept) {
//@ts-ignore //@ts-ignore

View File

@ -20,6 +20,7 @@ const reactionEffects: IReactionEffect[] = [
supplierDiscountPerc, supplierDiscountPerc,
leaseObjectPrice, leaseObjectPrice,
addEquipmentPrice, addEquipmentPrice,
leaseObjectType,
} = calculationStore.values; } = calculationStore.values;
//@ts-ignore //@ts-ignore
const importProgramSum = calculationStore.importProgramSum(); const importProgramSum = calculationStore.importProgramSum();
@ -31,6 +32,7 @@ const reactionEffects: IReactionEffect[] = [
leaseObjectPrice, leaseObjectPrice,
importProgramSum, importProgramSum,
addEquipmentPrice, addEquipmentPrice,
leaseObjectType,
]; ];
}, },
effect: ([ effect: ([
@ -51,10 +53,19 @@ const reactionEffects: IReactionEffect[] = [
calculationStore, calculationStore,
); );
const leaseObjectType = calculationStore.getOption(
'selectLeaseObjectType',
);
const maxPriceChangeValue = const maxPriceChangeValue =
price - supplierDiscountRub < 800000 price - supplierDiscountRub < 800000
? price - supplierDiscountRub + 50000 ? price - supplierDiscountRub + 50000
: (price - supplierDiscountRub) * 1.05; : (price - supplierDiscountRub) *
(leaseObjectType?.evo_vehicle_type?.includes(100_000_001) ||
leaseObjectType?.evo_vehicle_type?.includes(100_000_005)
? 1.01
: 1.05);
calculationStore.setValue('maxPriceChange', maxPriceChangeValue); calculationStore.setValue('maxPriceChange', maxPriceChangeValue);
const minPriceChangeValue = const minPriceChangeValue =
@ -180,7 +191,7 @@ const reactionEffects: IReactionEffect[] = [
quote.evo_min_change_price - quote.evo_min_change_price -
(quote.evo_nds_in_price_supplier_currency || 0); (quote.evo_nds_in_price_supplier_currency || 0);
if (maxCondition1 || maxCondition2 || maxCondition3) { if (maxCondition1 || maxCondition2) {
calculationStore.setValidation('tbxLeaseObjectPrice', false); calculationStore.setValidation('tbxLeaseObjectPrice', false);
openNotification({ openNotification({
type: 'error', type: 'error',
@ -189,6 +200,14 @@ const reactionEffects: IReactionEffect[] = [
'Указанная стоимость предмета лизинга больше возможного изменения стоимости предмета лизинга при пересчете без пересмотра. ' + 'Указанная стоимость предмета лизинга больше возможного изменения стоимости предмета лизинга при пересчете без пересмотра. ' +
'Уменьшите стоимость предмета лизинга', 'Уменьшите стоимость предмета лизинга',
}); });
} else if (maxCondition3) {
calculationStore.setValidation('tbxLeaseObjectPrice', false);
openNotification({
type: 'error',
message: 'Ошибка',
description:
'При пересчете без пересмотра КП с ПЛ БУ или с непрофессиональным поставщиком недопустимо увеличение стоимости. Создайте новое КП и отправьте его на рассмотрение андеррайтингу для повторной проверки оценщиком.',
});
} else if (minCondition1 || minCondition2) { } else if (minCondition1 || minCondition2) {
calculationStore.setValidation('tbxLeaseObjectPrice', false); calculationStore.setValidation('tbxLeaseObjectPrice', false);
openNotification({ openNotification({

View File

@ -89,6 +89,9 @@ query GetMainOptions(
evo_baseproductid evo_baseproductid
} }
evo_supplier_financing_accept evo_supplier_financing_accept
accounts {
accountid
}
} }
selectRegistration: evo_addproduct_types( selectRegistration: evo_addproduct_types(
statecode: $statecode statecode: $statecode

View File

@ -685,6 +685,7 @@ type evo_baseproduct {
statecode: Int statecode: Int
systemusers(statecode: Int): [systemuser] systemusers(statecode: Int): [systemuser]
toObjectString: String toObjectString: String
accounts: [account]
} }
type evo_graph { type evo_graph {

View File

@ -223,6 +223,7 @@ export interface IEvoBaseproduct extends BaseEntity {
evo_calculation_method?: number[]; evo_calculation_method?: number[];
evo_baseproducts?: IEvoBaseproduct[]; evo_baseproducts?: IEvoBaseproduct[];
evo_supplier_financing_accept?: boolean; evo_supplier_financing_accept?: boolean;
accounts?: IAccount[];
} }
export interface IEvoLeasingObjectType extends BaseEntity { export interface IEvoLeasingObjectType extends BaseEntity {