[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 { Register } from "../../types/Register";
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 ?? "";
const certCode = register.register_is_preview ? "0000" : register.register_code.toString().padStart(4, "0");
generator(`${courseN} - ${personFullName}.docx`, {
matpel: null,
personFullName,
personDni: person.person_dni.toString(),
certCode: register.register_code.toString().padStart(4, "0"),
certCode,
certYear: year,
certMonth: month,
certDay: day,