[FE][Certs] Generate preview certs with code 0000

master
Araozu 2023-09-20 12:35:15 -05:00
parent e8e5835236
commit a0bf96a4c1
1 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,4 @@
import { For, Match, Show, createEffect, createMemo, createSignal } from "solid-js"; import { For, Show, createEffect, createMemo, createSignal } from "solid-js";
import { Person } from "../../types/Person"; import { Person } from "../../types/Person";
import { Register } from "../../types/Register"; import { Register } from "../../types/Register";
import { courseMap } from "../../utils/allCourses"; import { courseMap } from "../../utils/allCourses";
@ -159,12 +159,13 @@ function RegisterEl(props: {register: Register, person: Person, onClick: () => v
? "" ? ""
: customLabelsMap()[register.register_custom_label]?.custom_label_value ?? ""; : customLabelsMap()[register.register_custom_label]?.custom_label_value ?? "";
const certCode = register.register_is_preview ? "0000" : register.register_code.toString().padStart(4, "0");
generator(`${courseN} - ${personFullName}.docx`, { generator(`${courseN} - ${personFullName}.docx`, {
matpel: null, matpel: null,
personFullName, personFullName,
personDni: person.person_dni.toString(), personDni: person.person_dni.toString(),
certCode: register.register_code.toString().padStart(4, "0"), certCode,
certYear: year, certYear: year,
certMonth: month, certMonth: month,
certDay: day, certDay: day,