Добавить в Пересчете без пересмотра что если в поле ЮЛ поставщка Тип поставщика = Непрофессиональный (evo_supplier_type = 100 000 001), то увеличение стоимости запрещено.
Надо вписаться в ту же проверку что делали на прошлой неделе по закрытию увеличения стоимости при БУ. См. по коду изменения зеленым
This commit is contained in:
parent
e22d25c64b
commit
798eaec2e6
@ -4,7 +4,7 @@ import { resetIns } from 'client/Containers/Calculation/Components/ELT/lib/reset
|
|||||||
import { numberElementsProps } from 'client/Containers/Calculation/Elements/props/common';
|
import { numberElementsProps } from 'client/Containers/Calculation/Elements/props/common';
|
||||||
import {
|
import {
|
||||||
getTitle,
|
getTitle,
|
||||||
getValueName,
|
getValueName
|
||||||
} from 'client/Containers/Calculation/Elements/tools';
|
} from 'client/Containers/Calculation/Elements/tools';
|
||||||
import { ElementsNames } from 'client/Containers/Calculation/types/elements';
|
import { ElementsNames } from 'client/Containers/Calculation/types/elements';
|
||||||
import { openNotification } from 'client/Elements/Notification';
|
import { openNotification } from 'client/Elements/Notification';
|
||||||
@ -14,7 +14,7 @@ import {
|
|||||||
mainOptionsForQuoteQuery,
|
mainOptionsForQuoteQuery,
|
||||||
quoteQuery,
|
quoteQuery,
|
||||||
secondaryOptionsForQuoteQuery,
|
secondaryOptionsForQuoteQuery,
|
||||||
singleOptionsForQuoteQuery,
|
singleOptionsForQuoteQuery
|
||||||
} from 'core/services/CrmService/graphql/query/quote';
|
} from 'core/services/CrmService/graphql/query/quote';
|
||||||
import { TOptionizedEntity } from 'core/services/CrmService/types/common';
|
import { TOptionizedEntity } from 'core/services/CrmService/types/common';
|
||||||
import {
|
import {
|
||||||
@ -23,7 +23,7 @@ import {
|
|||||||
IEvoGraph,
|
IEvoGraph,
|
||||||
IEvoRewardCondition,
|
IEvoRewardCondition,
|
||||||
IEvoTown,
|
IEvoTown,
|
||||||
IQuote,
|
IQuote
|
||||||
} from 'core/services/CrmService/types/entities';
|
} from 'core/services/CrmService/types/entities';
|
||||||
import { currentISODate } from 'core/tools/date';
|
import { currentISODate } from 'core/tools/date';
|
||||||
import { NIL } from 'core/tools/uuid';
|
import { NIL } from 'core/tools/uuid';
|
||||||
@ -317,6 +317,7 @@ const loadKpReaction: IReactionEffect = calculationStore => ({
|
|||||||
evo_broker_accountid
|
evo_broker_accountid
|
||||||
evo_kpp
|
evo_kpp
|
||||||
evo_inn
|
evo_inn
|
||||||
|
evo_supplier_type
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
|
|||||||
@ -108,6 +108,8 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
const importProgramSum = calculationStore.importProgramSum();
|
const importProgramSum = calculationStore.importProgramSum();
|
||||||
|
|
||||||
|
const dealerPerson = calculationStore.getOption('selectDealerPerson');
|
||||||
|
|
||||||
return [
|
return [
|
||||||
supplierDiscountRub,
|
supplierDiscountRub,
|
||||||
price,
|
price,
|
||||||
@ -115,6 +117,7 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
recalcWithRevision,
|
recalcWithRevision,
|
||||||
addEquipmentPrice,
|
addEquipmentPrice,
|
||||||
importProgramSum,
|
importProgramSum,
|
||||||
|
dealerPerson,
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
effect: ([
|
effect: ([
|
||||||
@ -124,6 +127,7 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
recalcWithRevision,
|
recalcWithRevision,
|
||||||
addEquipmentPrice,
|
addEquipmentPrice,
|
||||||
importProgramSum,
|
importProgramSum,
|
||||||
|
dealerPerson,
|
||||||
]) => {
|
]) => {
|
||||||
if (!recalcWithRevision) {
|
if (!recalcWithRevision) {
|
||||||
calculationStore.setValidation('tbxLeaseObjectPrice', undefined);
|
calculationStore.setValidation('tbxLeaseObjectPrice', undefined);
|
||||||
@ -138,6 +142,7 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
|
|
||||||
const maxCondition1 =
|
const maxCondition1 =
|
||||||
leaseObjectUsed === false &&
|
leaseObjectUsed === false &&
|
||||||
|
dealerPerson?.evo_supplier_type !== 100_000_001 &&
|
||||||
quote?.evo_max_price_change &&
|
quote?.evo_max_price_change &&
|
||||||
!product?.evo_sale_without_nds &&
|
!product?.evo_sale_without_nds &&
|
||||||
price - supplierDiscountRub + addEquipmentPrice - importProgramSum >
|
price - supplierDiscountRub + addEquipmentPrice - importProgramSum >
|
||||||
@ -145,6 +150,7 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
|
|
||||||
const maxCondition2 =
|
const maxCondition2 =
|
||||||
leaseObjectUsed === false &&
|
leaseObjectUsed === false &&
|
||||||
|
dealerPerson?.evo_supplier_type !== 100_000_001 &&
|
||||||
quote?.evo_max_price_change &&
|
quote?.evo_max_price_change &&
|
||||||
product?.evo_sale_without_nds &&
|
product?.evo_sale_without_nds &&
|
||||||
leaseObjectPriceWthtVAT >
|
leaseObjectPriceWthtVAT >
|
||||||
@ -152,7 +158,8 @@ const reactionEffects: IReactionEffect[] = [
|
|||||||
(quote.evo_nds_in_price_supplier_currency || 0);
|
(quote.evo_nds_in_price_supplier_currency || 0);
|
||||||
|
|
||||||
const maxCondition3 =
|
const maxCondition3 =
|
||||||
leaseObjectUsed === true &&
|
(leaseObjectUsed === true ||
|
||||||
|
dealerPerson?.evo_supplier_type === 100_000_001) &&
|
||||||
quote?.evo_supplier_currency_price &&
|
quote?.evo_supplier_currency_price &&
|
||||||
price - supplierDiscountRub + addEquipmentPrice - importProgramSum >
|
price - supplierDiscountRub + addEquipmentPrice - importProgramSum >
|
||||||
quote.evo_supplier_currency_price -
|
quote.evo_supplier_currency_price -
|
||||||
|
|||||||
@ -47,6 +47,7 @@ query GetMainOptionsForKP(
|
|||||||
evo_broker_accountid
|
evo_broker_accountid
|
||||||
evo_kpp
|
evo_kpp
|
||||||
evo_inn
|
evo_inn
|
||||||
|
evo_supplier_type
|
||||||
}
|
}
|
||||||
selectDealerRewardCondition: evo_reward_conditions(
|
selectDealerRewardCondition: evo_reward_conditions(
|
||||||
evo_agent_accountid: $dealer_person_accountid
|
evo_agent_accountid: $dealer_person_accountid
|
||||||
|
|||||||
Reference in New Issue
Block a user