diff --git a/src/webparts/requestPortal/forms/Vacation/sendToSign.ts b/src/webparts/requestPortal/forms/Vacation/sendToSign.ts index 7fca9c3..325bf8b 100644 --- a/src/webparts/requestPortal/forms/Vacation/sendToSign.ts +++ b/src/webparts/requestPortal/forms/Vacation/sendToSign.ts @@ -2,7 +2,7 @@ import { WebPartContext } from '@microsoft/sp-webpart-base'; import { getCompanies, getEmployeeOrganizations } from '../../shared/dictionary'; import { submitSigningRequest } from '../../shared/edo/edo.service'; import { ISigningCompany, ISkippedCompany, resolveSigningTargets } from '../../shared/edo/signingTarget'; -import { computeEndDate, formatRuDate } from './dates'; +import { formatRuDate } from './dates'; import { IFormData } from './model'; import { createVacationDocx, vacationFileName } from './vacationDocument'; @@ -96,7 +96,6 @@ export async function sendVacationForSigning( position: company.position || data.Position, employeeName, startDate: formatRuDate(data.StartDate), - endDate: formatRuDate(computeEndDate(data.StartDate, days)), daysCount: days, substituteName: substitute, requestCode: vacation.code || String(vacation.itemId), diff --git a/src/webparts/requestPortal/forms/Vacation/vacationDocument.test.ts b/src/webparts/requestPortal/forms/Vacation/vacationDocument.test.ts index 6b86ed3..5551581 100644 --- a/src/webparts/requestPortal/forms/Vacation/vacationDocument.test.ts +++ b/src/webparts/requestPortal/forms/Vacation/vacationDocument.test.ts @@ -13,7 +13,6 @@ const INPUT: IVacationDocumentInput = { position: 'Инженер', employeeName: 'Иванов Иван Иванович', startDate: '01.12.2026', - endDate: '14.12.2026', daysCount: 14, substituteName: 'Петров Пётр Петрович', requestCode: 'HR-0042', @@ -56,7 +55,7 @@ describe('заявление на отпуск', () => { 'Инженер', 'Иванов Иван Иванович', 'ЗАЯВЛЕНИЕ', - '14 календарных дней с 01.12.2026 по 14.12.2026', + '14 календарных дней, начиная с 01.12.2026', 'Петров Пётр Петрович', 'HR-0042', '30.09.2026' diff --git a/src/webparts/requestPortal/forms/Vacation/vacationDocument.ts b/src/webparts/requestPortal/forms/Vacation/vacationDocument.ts index dca7833..c2c452d 100644 --- a/src/webparts/requestPortal/forms/Vacation/vacationDocument.ts +++ b/src/webparts/requestPortal/forms/Vacation/vacationDocument.ts @@ -10,8 +10,7 @@ export interface IVacationDocumentInput { employeeName: string; /** Начало отпуска, ISO `YYYY-MM-DD`. */ startDate: string; - /** Конец отпуска, ISO `YYYY-MM-DD`. */ - endDate: string; + /** Сколько календарных дней длится отпуск. Конца нет: праздники и выходные считает кадровая служба. */ daysCount: number; /** Ф.И.О. замещающего; пусто — абзац о замещении не выводится. */ substituteName: string; @@ -71,7 +70,7 @@ export function buildVacationParagraphs(input: IVacationDocumentInput): IParagra { text: `Прошу предоставить мне ежегодный оплачиваемый трудовой отпуск продолжительностью ${input.daysCount} ` + - `календарных дней с ${input.startDate} по ${input.endDate} включительно.`, + `календарных дней, начиная с ${input.startDate}.`, align: 'both', firstLine: 709, after: 240