revert(orders-pdf): remove the E-mail line from the issued-order footer
Keeps the 'Vystavil: <name>' line (logged-in user) and the removed Schválil signature row; drops the e-mail line + its param field/translation keys per request. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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)", () => {
|
it("renders the PO number, items, and both party names (PO direction)", () => {
|
||||||
const html = renderIssuedOrderHtml(
|
const html = renderIssuedOrderHtml(
|
||||||
@@ -305,23 +305,13 @@ describe("renderIssuedOrderHtml", () => {
|
|||||||
expect(html).not.toContain("alert(1)");
|
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);
|
const html = renderIssuedOrderHtml(order, items, null, null, "cs", issuer);
|
||||||
// New footer: Vystavil <name> + E-mail <email> from authData.
|
// Footer: Vystavil <name> from authData. No e-mail line.
|
||||||
expect(html).toContain("Jan Novák");
|
expect(html).toContain("Jan Novák");
|
||||||
expect(html).toContain("jan.novak@firma.cz");
|
expect(html).not.toContain("E-mail:");
|
||||||
expect(html).toContain("E-mail:");
|
|
||||||
// The old two-column signature footer is gone.
|
// The old two-column signature footer is gone.
|
||||||
expect(html).not.toContain("footer-row");
|
expect(html).not.toContain("footer-row");
|
||||||
expect(html).not.toContain("Schválil:");
|
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:");
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -187,7 +187,6 @@ const translations: Record<Lang, Record<string, string>> = {
|
|||||||
delivery_terms: "Dodací podmínky:",
|
delivery_terms: "Dodací podmínky:",
|
||||||
payment_terms: "Platební podmínky:",
|
payment_terms: "Platební podmínky:",
|
||||||
issued_by: "Vystavil:",
|
issued_by: "Vystavil:",
|
||||||
email: "E-mail:",
|
|
||||||
ico: "IČ: ",
|
ico: "IČ: ",
|
||||||
dic: "DIČ: ",
|
dic: "DIČ: ",
|
||||||
},
|
},
|
||||||
@@ -215,7 +214,6 @@ const translations: Record<Lang, Record<string, string>> = {
|
|||||||
delivery_terms: "Delivery terms:",
|
delivery_terms: "Delivery terms:",
|
||||||
payment_terms: "Payment terms:",
|
payment_terms: "Payment terms:",
|
||||||
issued_by: "Issued by:",
|
issued_by: "Issued by:",
|
||||||
email: "E-mail:",
|
|
||||||
ico: "Reg. No.: ",
|
ico: "Reg. No.: ",
|
||||||
dic: "Tax ID: ",
|
dic: "Tax ID: ",
|
||||||
},
|
},
|
||||||
@@ -249,7 +247,7 @@ export function renderIssuedOrderHtml(
|
|||||||
customer: Record<string, unknown> | null,
|
customer: Record<string, unknown> | null,
|
||||||
settings: Record<string, unknown> | null,
|
settings: Record<string, unknown> | null,
|
||||||
lang: Lang,
|
lang: Lang,
|
||||||
issuer: { name: string; email: string },
|
issuer: { name: string },
|
||||||
): string {
|
): string {
|
||||||
const t = translations[lang];
|
const t = translations[lang];
|
||||||
const applyVat = order.apply_vat !== false;
|
const applyVat = order.apply_vat !== false;
|
||||||
@@ -784,9 +782,8 @@ ${indentCSS}
|
|||||||
</div><!-- /.invoice-content -->
|
</div><!-- /.invoice-content -->
|
||||||
<div class="invoice-footer">
|
<div class="invoice-footer">
|
||||||
|
|
||||||
<!-- Vystavil (jmeno + e-mail prihlaseneho uzivatele) -->
|
<!-- Vystavil (jmeno prihlaseneho uzivatele) -->
|
||||||
<div class="issued-by"><span class="lbl">${escapeHtml(t.issued_by)}</span> ${escapeHtml(issuer.name)}</div>
|
<div class="issued-by"><span class="lbl">${escapeHtml(t.issued_by)}</span> ${escapeHtml(issuer.name)}</div>
|
||||||
${issuer.email ? `<div class="issued-by"><span class="lbl">${escapeHtml(t.email)}</span> ${escapeHtml(issuer.email)}</div>` : ""}
|
|
||||||
|
|
||||||
</div><!-- /.invoice-footer -->
|
</div><!-- /.invoice-footer -->
|
||||||
</div><!-- /.invoice-page -->
|
</div><!-- /.invoice-page -->
|
||||||
@@ -836,7 +833,6 @@ export default async function issuedOrdersPdfRoutes(fastify: FastifyInstance) {
|
|||||||
// authData is always present here. Mirrors orders-pdf.ts userName.
|
// authData is always present here. Mirrors orders-pdf.ts userName.
|
||||||
const issuer = {
|
const issuer = {
|
||||||
name: `${request.authData?.firstName ?? ""} ${request.authData?.lastName ?? ""}`.trim(),
|
name: `${request.authData?.firstName ?? ""} ${request.authData?.lastName ?? ""}`.trim(),
|
||||||
email: request.authData?.email ?? "",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const html = renderIssuedOrderHtml(
|
const html = renderIssuedOrderHtml(
|
||||||
|
|||||||
Reference in New Issue
Block a user