Compare commits

..

5 Commits

Author SHA1 Message Date
vchikalkin
3c25ba30d0 merge branch 'release/dyn-4885' 2024-12-10 10:11:43 +03:00
vchikalkin
ba36eb502b merge branch 'release/dyn-4872' 2024-12-03 12:09:07 +03:00
vchikalkin
2c9a2bd30c fix selectDealerPerson validation 2024-10-18 16:29:07 +03:00
vchikalkin
f35acee64b fix tbxVATInLeaseObjectPrice block/unblock by cbxPartialVAT 2024-10-18 14:56:50 +03:00
vchikalkin
a4c02a747f merge branch 'release/dyn-4790' 2024-10-18 13:39:03 +03:00
4 changed files with 27 additions and 11 deletions

View File

@ -618,7 +618,7 @@ export async function makeEltKaskoRequest(
} }
} }
let classification = '11635'; let classification = '11606';
switch (evo_leasingobject_type?.evo_id) { switch (evo_leasingobject_type?.evo_id) {
case '7': { case '7': {
@ -634,7 +634,7 @@ export async function makeEltKaskoRequest(
break; break;
} }
default: { default: {
classification = '11635'; classification = '11606';
break; break;
} }
} }

View File

@ -259,6 +259,8 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
} }
let okved: string | null | undefined; let okved: string | null | undefined;
let evo_inn: string | null | undefined;
if (leadid) { if (leadid) {
const { const {
data: { lead }, data: { lead },
@ -268,6 +270,7 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
}); });
okved = lead?.accountidData?.evo_okved; okved = lead?.accountidData?.evo_okved;
evo_inn = lead?.evo_inn;
} }
if (!okved && opportunityid) { if (!okved && opportunityid) {
@ -302,6 +305,14 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
path: ['eltKasko', 'eltOsago'], path: ['eltKasko', 'eltOsago'],
}); });
} }
if (!evo_inn) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: 'ИНН в интересе не заполнен',
path: ['eltKasko', 'eltOsago'],
});
}
} }
); );
} }

View File

@ -171,8 +171,10 @@ export function common({ store, apolloClient }: ProcessContext) {
{ {
// eslint-disable-next-line no-inner-declarations // eslint-disable-next-line no-inner-declarations
function unblock() { function unblock() {
$calculation.element('cbxPartialVAT').unblock(); const cbxPartialVAT = $calculation.element('cbxPartialVAT');
$calculation.element('tbxVATInLeaseObjectPrice').unblock(); cbxPartialVAT.unblock();
if (cbxPartialVAT.getValue()) $calculation.element('tbxVATInLeaseObjectPrice').unblock();
$calculation.element('cbxInsDecentral').unblock(); $calculation.element('cbxInsDecentral').unblock();
$calculation.element('selectDealerPerson').unblock(); $calculation.element('selectDealerPerson').unblock();
$calculation.element('selectDealerRewardCondition').unblock(); $calculation.element('selectDealerRewardCondition').unblock();
@ -180,9 +182,12 @@ export function common({ store, apolloClient }: ProcessContext) {
$calculation.element('selectDealerBrokerRewardCondition').unblock(); $calculation.element('selectDealerBrokerRewardCondition').unblock();
} }
/**
* @see 'apps/web/process/used-pl/reactions.ts:common (40)'
*/
reaction( reaction(
() => $calculation.element('selectDealerPerson').getValue(), () => $calculation.$values.getValues(['dealerPerson', 'partialVAT']),
async (dealerPersonId) => { async ({ dealerPerson: dealerPersonId }) => {
if (!dealerPersonId) { if (!dealerPersonId) {
unblock(); unblock();

View File

@ -508,11 +508,11 @@ export function createValidationSchema(context: ValidationContext) {
} }
if ( if (
(dealer_person?.evo_legal_form === 100_000_004 && dealer_person?.evo_legal_form === 100_000_004 &&
((await isAgentEqualsToDealerPerson(indAgent)) || ((await isAgentEqualsToDealerPerson(indAgent)) ||
(await isAgentEqualsToDealerPerson(calcDoubleAgent)))) || (await isAgentEqualsToDealerPerson(calcDoubleAgent)) ||
(await isAgentEqualsToDealerPerson(calcBroker)) || (await isAgentEqualsToDealerPerson(calcBroker)) ||
(await isAgentEqualsToDealerPerson(calcFinDepartment)) (await isAgentEqualsToDealerPerson(calcFinDepartment)))
) { ) {
ctx.addIssue({ ctx.addIssue({
code: z.ZodIssueCode.custom, code: z.ZodIssueCode.custom,