Pull request #2443: feat(TEAMMSBMOB-22193): фикс кпп и Кода там.органа

Merge in MCB_FE/mcb-platform-monorepo from story/TEAMMSBMOB-22193_fix_kpp_and_taxperiod to release-1.10.0

* commit 'a28ffaa94a88ec866ed1e76216741674d5734c3d':
  feat(TEAMMSBMOB-22193): фикс кпп и Кода там.органа
This commit is contained in:
Андрей Воронов
2026-01-29 17:54:32 +03:00
4 changed files with 20 additions and 3 deletions
@@ -7,7 +7,13 @@ import {
setUnknownControlTexts,
} from './backendControlsStore';
import { getPaymentsI18nData } from './paymentsI18nStore';
import { ValidationMessage, mapServerFieldToUi, FormValidation, PaymentFormFields } from '@/features/Forms';
import {
BUDGET_PAYMENT_SERVER_FIELD_NAMES,
ValidationMessage,
mapServerFieldToUi,
FormValidation,
PaymentFormFields,
} from '@/features/Forms';
const isSignAndSendAllowedStatus = (status: string | null | undefined): boolean =>
!!status && (ALLOWED_SIGN_AND_SEND_STATUSES as readonly string[]).includes(status);
@@ -41,8 +47,12 @@ const collectValidationMessages = (vr?: ValidationResultData): ValidationMessage
(checkResults || []).forEach((check: CheckResult) => {
const { fieldName, message } = check;
const field = mapServerFieldToUi(fieldName, FormValidation.isThirdPartyEnabled());
const key = message?.message;
const mappedServerFieldName =
fieldName === BUDGET_PAYMENT_SERVER_FIELD_NAMES.TAX_PERIOD_VALUE
? BUDGET_PAYMENT_SERVER_FIELD_NAMES.TAX_PERIOD_VALUE_TYPE
: fieldName;
const field = mapServerFieldToUi(mappedServerFieldName, FormValidation.isThirdPartyEnabled());
const params = message?.params;
let template = (key ? i18nData?.[key] : undefined) || key || null;
@@ -31,6 +31,11 @@ const fieldIdentitiesMapper: Record<string, string> = {
'budgetInfo.paymentBasisDocDate': FIELD_IDENTITY.BUDGET_PAYMENT_BASIS_DOC_DATE,
} as const;
const SERVER_FIELD_NAMES = {
TAX_PERIOD_VALUE: 'budgetInfo.taxPeriodValue',
TAX_PERIOD_VALUE_TYPE: 'budgetInfo.taxPeriodValueType',
} as const;
const mapTitleIdentity: Record<string, string> = {
[FIELD_IDENTITY.BUDGET_DOC_AUTHOR_STATUS]: LOCALIZATION.DOC_AUTHOR_STATUS.TITLE,
[FIELD_IDENTITY.BUDGET_KBK]: LOCALIZATION.KBK.TITLE,
@@ -46,4 +51,4 @@ const mapTitleIdentity: Record<string, string> = {
[FIELD_IDENTITY.BUDGET_PAYMENT_BASIS_DOC_DATE]: LOCALIZATION.PAYMENT_BASIS_DOC_DATE.TITLE,
} as const;
export { FIELD_IDENTITY, fieldIdentitiesMapper, mapTitleIdentity };
export { FIELD_IDENTITY, fieldIdentitiesMapper, mapTitleIdentity, SERVER_FIELD_NAMES };
@@ -5,5 +5,6 @@ export {
FIELD_IDENTITY as BUDGET_PAYMENT_FIELD_IDENTITY,
fieldIdentitiesMapper as budgetPaymentFieldIdentitiesMapper,
mapTitleIdentity as budgetPaymentMapTitleIdentity,
SERVER_FIELD_NAMES as BUDGET_PAYMENT_SERVER_FIELD_NAMES,
} from './fieldIdentity';
export { LOCALIZATION as BUDGET_PAYMENT_LOCALIZATION } from './localization';
@@ -589,6 +589,7 @@ namespace PayerFormFields {
name={FORM_FIELD_NAMES.PAYER_KPP}
size="M"
value={payerDetails.kpp || ''}
warningText={formValidation.getMessage(FIELD_IDENTITY.PAYER_KPP)?.warningText}
onBlur={handlePayerKppBlur}
onChange={handlePayerKppChange}
/>