Добавить валидацию:
Если в списке поля selectDealerBroker есть запись, у которой есть запись evo_reward_condition, у которой evo_reward_condition.evo_agency_agreementid. Обязательная выплата АВ (evo_required_reward) = True, и данная запись не указана в поле selectDealerBroker, то поле tbxDealerBrokerRewardSumm обводить красной рамкой и выводить ошибку "Согласно Агентскому договору с данным Брокером поставщика обязательна выплата АВ. Заложите АВ в расчет"
This commit is contained in:
parent
e9b07ed67c
commit
13f511a0a0
@ -383,8 +383,23 @@ export function createValidationSchema(context: ValidationContext) {
|
|||||||
sumFieldName: 'tbxDealerRewardSumm',
|
sumFieldName: 'tbxDealerRewardSumm',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let evo_broker_accountid: string | null = null;
|
||||||
|
|
||||||
|
if (dealerPerson) {
|
||||||
|
const {
|
||||||
|
data: { dealer_person },
|
||||||
|
} = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetDealerPersonDocument,
|
||||||
|
variables: {
|
||||||
|
dealerPersonId: dealerPerson,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
evo_broker_accountid = dealer_person?.evo_broker_accountid || null;
|
||||||
|
}
|
||||||
|
|
||||||
await validateRewardSum({
|
await validateRewardSum({
|
||||||
agentid: dealerBroker,
|
agentid: dealerBroker || evo_broker_accountid,
|
||||||
conditionId: dealerBrokerRewardCondition,
|
conditionId: dealerBrokerRewardCondition,
|
||||||
sum: dealerBrokerRewardSumm,
|
sum: dealerBrokerRewardSumm,
|
||||||
sumFieldName: 'tbxDealerBrokerRewardSumm',
|
sumFieldName: 'tbxDealerBrokerRewardSumm',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user