feat(orders): issued-order PDF on the shared invoice/confirmation template

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
BOHA
2026-06-09 13:27:12 +02:00
parent 3b48bd0523
commit 162f9b9fdf
2 changed files with 726 additions and 139 deletions

View File

@@ -256,7 +256,7 @@ describe("renderIssuedOrderHtml", () => {
const items = [
{
description: "Materiál",
item_description: null,
item_description: "Detailní popis položky",
quantity: 2,
unit: "ks",
unit_price: 100,
@@ -264,18 +264,24 @@ describe("renderIssuedOrderHtml", () => {
},
];
it("renders the PO number, items, and both party names", () => {
it("renders the PO number, items, and both party names (PO direction)", () => {
const html = renderIssuedOrderHtml(
order,
items,
{ name: "Dodavatel" },
{ name: "Dodavatel s.r.o." },
{ company_name: "Naše firma" },
"cs",
);
expect(html).toContain("26720001");
expect(html).toContain("Materiál");
expect(html).toContain("Dodavatel");
// Optional item sub-line.
expect(html).toContain("Detailní popis položky");
// PO direction: the customer record is the Dodavatel (supplier), our
// company is the Odběratel (buyer).
expect(html).toContain("Dodavatel s.r.o.");
expect(html).toContain("Naše firma");
expect(html).toContain("Dodavatel");
expect(html).toContain("Odběratel");
});
it("strips script tags from notes", () => {