form 16 renaming done
This commit is contained in:
parent
872bda4731
commit
44a19bbfea
@ -709,8 +709,7 @@ function sanitizeForm16PdfCertSegment(text: string): string {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* PDF file name after successful 26AS match + credit note:
|
* PDF file name after successful 26AS match + credit note:
|
||||||
* [TAN]_[AY]_[Quarter]_[Name and address of deductor]_[Certificate][_Vn].pdf
|
* [TAN]_[Assessment Year]_[Quarter]_[Name and address of deductor]_[Certificate].pdf
|
||||||
* Revised submissions (version > 1) append _V2, _V3, ...
|
|
||||||
*/
|
*/
|
||||||
function buildForm16CreditNoteSuccessPdfFileName(sub: Form16aSubmission): string {
|
function buildForm16CreditNoteSuccessPdfFileName(sub: Form16aSubmission): string {
|
||||||
const tan = normalizeTanNumber(String(sub.tanNumber || ''))
|
const tan = normalizeTanNumber(String(sub.tanNumber || ''))
|
||||||
@ -730,13 +729,12 @@ function buildForm16CreditNoteSuccessPdfFileName(sub: Form16aSubmission): string
|
|||||||
if (!nameAddr) nameAddr = String(sub.deductorName || 'Deductor').trim();
|
if (!nameAddr) nameAddr = String(sub.deductorName || 'Deductor').trim();
|
||||||
let deductorSan = sanitizeForm16PdfDeductorSegment(nameAddr, 150);
|
let deductorSan = sanitizeForm16PdfDeductorSegment(nameAddr, 150);
|
||||||
const certSan = sanitizeForm16PdfCertSegment(String(sub.form16aNumber || ''));
|
const certSan = sanitizeForm16PdfCertSegment(String(sub.form16aNumber || ''));
|
||||||
const ver = typeof sub.version === 'number' && sub.version > 1 ? `_V${sub.version}` : '';
|
let base = `${tan}_${ay}_${q}_${deductorSan}_${certSan}`;
|
||||||
let base = `${tan}_${ay}_${q}_${deductorSan}_${certSan}${ver}`;
|
|
||||||
if (base.length > 220) {
|
if (base.length > 220) {
|
||||||
const over = base.length - 220;
|
const over = base.length - 220;
|
||||||
const shorter = Math.max(20, deductorSan.length - over - 5);
|
const shorter = Math.max(20, deductorSan.length - over - 5);
|
||||||
deductorSan = sanitizeForm16PdfDeductorSegment(nameAddr, shorter);
|
deductorSan = sanitizeForm16PdfDeductorSegment(nameAddr, shorter);
|
||||||
base = `${tan}_${ay}_${q}_${deductorSan}_${certSan}${ver}`;
|
base = `${tan}_${ay}_${q}_${deductorSan}_${certSan}`;
|
||||||
}
|
}
|
||||||
return `${base}.pdf`;
|
return `${base}.pdf`;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user