diff --git a/src/__tests__/issued-orders.test.ts b/src/__tests__/issued-orders.test.ts index 2034973..6f58695 100644 --- a/src/__tests__/issued-orders.test.ts +++ b/src/__tests__/issued-orders.test.ts @@ -276,7 +276,7 @@ describe("renderIssuedOrderHtml", () => { }, ]; - const issuer = { name: "Jan Novák", email: "jan.novak@firma.cz" }; + const issuer = { name: "Jan Novák" }; it("renders the PO number, items, and both party names (PO direction)", () => { const html = renderIssuedOrderHtml( @@ -305,23 +305,13 @@ describe("renderIssuedOrderHtml", () => { expect(html).not.toContain("alert(1)"); }); - it("footer shows the logged-in user's name + e-mail, not the Schválil column", () => { + it("footer shows the logged-in user's name, no e-mail, no Schválil column", () => { const html = renderIssuedOrderHtml(order, items, null, null, "cs", issuer); - // New footer: Vystavil + E-mail from authData. + // Footer: Vystavil from authData. No e-mail line. expect(html).toContain("Jan Novák"); - expect(html).toContain("jan.novak@firma.cz"); - expect(html).toContain("E-mail:"); + expect(html).not.toContain("E-mail:"); // The old two-column signature footer is gone. expect(html).not.toContain("footer-row"); expect(html).not.toContain("Schválil:"); }); - - it("omits the e-mail line when the issuer has no e-mail", () => { - const html = renderIssuedOrderHtml(order, items, null, null, "cs", { - name: "Jan Novák", - email: "", - }); - expect(html).toContain("Jan Novák"); - expect(html).not.toContain("E-mail:"); - }); }); diff --git a/src/routes/admin/issued-orders-pdf.ts b/src/routes/admin/issued-orders-pdf.ts index 7083dda..1ff9c97 100644 --- a/src/routes/admin/issued-orders-pdf.ts +++ b/src/routes/admin/issued-orders-pdf.ts @@ -187,7 +187,6 @@ const translations: Record> = { delivery_terms: "Dodací podmínky:", payment_terms: "Platební podmínky:", issued_by: "Vystavil:", - email: "E-mail:", ico: "IČ: ", dic: "DIČ: ", }, @@ -215,7 +214,6 @@ const translations: Record> = { delivery_terms: "Delivery terms:", payment_terms: "Payment terms:", issued_by: "Issued by:", - email: "E-mail:", ico: "Reg. No.: ", dic: "Tax ID: ", }, @@ -249,7 +247,7 @@ export function renderIssuedOrderHtml( customer: Record | null, settings: Record | null, lang: Lang, - issuer: { name: string; email: string }, + issuer: { name: string }, ): string { const t = translations[lang]; const applyVat = order.apply_vat !== false; @@ -784,9 +782,8 @@ ${indentCSS} @@ -836,7 +833,6 @@ export default async function issuedOrdersPdfRoutes(fastify: FastifyInstance) { // authData is always present here. Mirrors orders-pdf.ts userName. const issuer = { name: `${request.authData?.firstName ?? ""} ${request.authData?.lastName ?? ""}`.trim(), - email: request.authData?.email ?? "", }; const html = renderIssuedOrderHtml(