Skip to content
Snippets Groups Projects
Verified Commit 35c892ae authored by Florian Azizian's avatar Florian Azizian
Browse files

FIX #14540 TIME 0:20 Add registered mail number in filename if only one registered mail printed

parent 41256974
No related branches found
No related tags found
No related merge requests found
......@@ -43,25 +43,30 @@ export class PrintRegisteredMailActionComponent implements OnInit {
} else {
Object.values(data.data).forEach((encodedFile: string) => {
if (!this.functions.empty(encodedFile)) {
let filenameDetail: string;
downloadLink.href = `data:application/pdf;base64,${encodedFile}`;
let today: any;
let dd: any;
let mm: any;
let yyyy: any;
if (this.data.resIds.length === 1) {
filenameDetail = this.data.resource.chrono.split(' ').join('_');
} else {
let today: any;
let dd: any;
let mm: any;
let yyyy: any;
today = new Date();
dd = today.getDate();
mm = today.getMonth() + 1;
yyyy = today.getFullYear();
today = new Date();
dd = today.getDate();
mm = today.getMonth() + 1;
yyyy = today.getFullYear();
if (dd < 10) {
dd = '0' + dd;
if (dd < 10) {
dd = '0' + dd;
}
if (mm < 10) {
mm = '0' + mm;
}
filenameDetail = dd + '-' + mm + '-' + yyyy;
}
if (mm < 10) {
mm = '0' + mm;
}
today = dd + '-' + mm + '-' + yyyy;
downloadLink.setAttribute('download', 'recommande_' + today + '.pdf');
downloadLink.setAttribute('download', 'recommande_' + filenameDetail + '.pdf');
document.body.appendChild(downloadLink);
downloadLink.click();
this.dialogRef.close(this.data.resIds);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment