feat(pdf): drop the prices-excl.-VAT notice from offer/order/PO PDFs

The 'Ceny jsou uvedeny bez DPH...' explanatory line is removed at user request from all three non-tax-document PDFs - the 'Celkem bez DPH' total label carries the information by itself. Dead vat_notice keys and .vat-note CSS removed; tests now pin the notice's ABSENCE (file renamed pdf-vat-note -> pdf-no-vat).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
BOHA
2026-06-10 13:19:08 +02:00
parent 7398cad466
commit 7b20c47937
5 changed files with 20 additions and 57 deletions

View File

@@ -532,7 +532,7 @@ describe("renderIssuedOrderHtml", () => {
expect(fallback).toContain("Objednáváme si u Vás:");
});
it("never renders VAT columns, totals NET with 'Celkem bez DPH' and the prices notice", () => {
it("never renders VAT columns or notices; totals NET with 'Celkem bez DPH'", () => {
const html = renderIssuedOrderHtml(order, items, null, null, "cs", issuer);
// No VAT anywhere — the PO is not a tax document.
expect(html).not.toContain("%DPH");
@@ -540,21 +540,17 @@ describe("renderIssuedOrderHtml", () => {
// Line total = netto (2 × 100).
expect(html).toContain('<td class="right total-cell">200,00</td>');
expect(html).toContain("Celkem bez DPH");
// No Mezisoučet row (it would duplicate the grand total).
// No Mezisoučet row (it would duplicate the grand total) and no
// prices-excl.-VAT notice (user removed it — the total label suffices).
expect(html).not.toContain("Mezisoučet");
// The fixed prices-excl.-VAT notice.
expect(html).toContain(
"Ceny jsou uvedeny bez DPH. DPH bude účtováno dle platných předpisů.",
);
expect(html).not.toContain("Ceny jsou uvedeny bez DPH");
});
it("renders the English notice and total label for lang=en", () => {
it("renders the English total label for lang=en, no VAT columns or notice", () => {
const html = renderIssuedOrderHtml(order, items, null, null, "en", issuer);
expect(html).toContain("Total excl. VAT");
expect(html).toContain(
"Prices are exclusive of VAT. VAT will be charged according to applicable regulations.",
);
expect(html).not.toContain("VAT%");
expect(html).not.toContain("Prices are exclusive of VAT");
});
it("footer shows the logged-in user's name, no e-mail, no Schválil column", () => {

View File

@@ -8,14 +8,14 @@ import offersPdfRoutes from "../routes/admin/offers-pdf";
// Offers, received orders (their confirmation PDF) and issued orders are NOT
// tax documents — VAT must never appear on them. These tests pin that contract
// for the confirmation and offer PDFs: no VAT columns/rows, the grand total is
// "Celkem bez DPH" / "Total excl. VAT", and the fixed prices-excl.-VAT notice
// is printed. (The issued-order PDF is covered in issued-orders.test.ts.)
// for the confirmation and offer PDFs: no VAT columns/rows/notices, and the
// grand total is "Celkem bez DPH" / "Total excl. VAT". (The issued-order PDF
// is covered in issued-orders.test.ts.)
const CS_NOTE =
"Ceny jsou uvedeny bez DPH. DPH bude účtováno dle platných předpisů.";
const EN_NOTE =
"Prices are exclusive of VAT. VAT will be charged according to applicable regulations.";
// The explanatory prices-excl.-VAT notice was removed at user request — the
// total label alone carries the information. Pin its absence too.
const CS_NOTE = "Ceny jsou uvedeny bez DPH";
const EN_NOTE = "Prices are exclusive of VAT";
describe("renderOrderConfirmationHtml (order confirmation PDF)", () => {
const order = {
@@ -36,7 +36,7 @@ describe("renderOrderConfirmationHtml (order confirmation PDF)", () => {
},
];
it("cs: NET total labeled 'Celkem bez DPH', no VAT columns, notice present", () => {
it("cs: NET total labeled 'Celkem bez DPH', no VAT columns or notice", () => {
const html = renderOrderConfirmationHtml(order, items, null, "cs", "Jan");
expect(html).not.toContain("%DPH");
expect(html).not.toContain(">DPH<");
@@ -44,14 +44,14 @@ describe("renderOrderConfirmationHtml (order confirmation PDF)", () => {
// Line total = netto (2 × 100), no VAT-on-top anywhere.
expect(html).toContain('<td class="right total-cell">200,00</td>');
expect(html).toContain("Celkem bez DPH");
expect(html).toContain(CS_NOTE);
expect(html).not.toContain(CS_NOTE);
});
it("en: 'Total excl. VAT' + the English notice, no VAT columns", () => {
it("en: 'Total excl. VAT', no VAT columns or notice", () => {
const html = renderOrderConfirmationHtml(order, items, null, "en", "Jan");
expect(html).not.toContain("VAT%");
expect(html).toContain("Total excl. VAT");
expect(html).toContain(EN_NOTE);
expect(html).not.toContain(EN_NOTE);
});
it("excludes not-included lines from the NET total", () => {
@@ -107,7 +107,7 @@ afterAll(async () => {
});
describe("GET /api/admin/offers-pdf/:id (offer PDF html)", () => {
it("renders NET-only totals with 'Celkem bez DPH' and the cs notice", async () => {
it("renders NET-only totals with 'Celkem bez DPH', no notice", async () => {
// Direct prisma insert (explicit number → no sequence consumed).
const quotation = await prisma.quotations.create({
data: {
@@ -139,7 +139,7 @@ describe("GET /api/admin/offers-pdf/:id (offer PDF html)", () => {
expect(res.statusCode).toBe(200);
const html = res.body;
expect(html).toContain("Celkem bez DPH");
expect(html).toContain(CS_NOTE);
expect(html).not.toContain(CS_NOTE);
expect(html).not.toContain("%DPH");
expect(html).not.toContain("Mezisoučet");
expect(html).not.toContain("Celkem k úhradě");