From 3cee6a3b415c2b600009bbd5850defaca56eef28 Mon Sep 17 00:00:00 2001 From: apardods Date: Fri, 20 Dec 2024 13:06:53 +0000 Subject: [PATCH] fix tests --- cmd/gobl.html/convert.go | 2 +- examples/out/invoice-de-zugferd.html | 268 ++++++++++++++++++++------- pkg/pdf/pdf.go | 1 + 3 files changed, 201 insertions(+), 70 deletions(-) diff --git a/cmd/gobl.html/convert.go b/cmd/gobl.html/convert.go index 375face..d585310 100644 --- a/cmd/gobl.html/convert.go +++ b/cmd/gobl.html/convert.go @@ -52,7 +52,7 @@ func (c *convertOpts) runE(cmd *cobra.Command, args []string) error { return err } - data, err := goblhtml.Render(cmd.Context(), env) + data, err := goblhtml.Render(cmd.Context(), env, goblhtml.WithZugferd()) if err != nil { return fmt.Errorf("generating html: %w", err) } diff --git a/examples/out/invoice-de-zugferd.html b/examples/out/invoice-de-zugferd.html index 04230b0..0f5090b 100755 --- a/examples/out/invoice-de-zugferd.html +++ b/examples/out/invoice-de-zugferd.html @@ -1,24 +1,32 @@ - GOBL HTML Generator - - - - - - - + + GOBL HTML Generator + + + + + + + +
- Page 1 of 1 + + Page + + 1 + + of + + 1 + +
@@ -26,113 +34,238 @@
-
Provide One GmbH
-

Invoice

-

SAMPLE-001

+
+
+ Provide One GmbH +
+
+

+ Invoice +

+

+ SAMPLE-001 +

-

Summary

+

+ Summary +

    -
  • Issue Date 2024-02-13
  • -
  • Currency Euro (EUR)
  • -
  • Order XR-2024-2
  • +
  • + + Issue Date + + + 2024-02-13 + +
  • +
  • + + Currency + + + Euro (EUR) + +
  • +
  • + + Order + + + XR-2024-2 + +
-

Supplier

+

+ Supplier +

-
Provide One GmbH
-
John Doe
-
Dietmar-Hopp-Allee 16, Walldorf, 69190 (Germany)
-
Tel: +49100200300
-
Email: billing@example.com
-
TIN: (DE) 111111125
+
+ Provide One GmbH +
+
+ John Doe +
+
+ + Dietmar-Hopp-Allee 16, Walldorf, 69190 (Germany) + +
+
+ Tel: +49100200300 +
+
+ Email: billing@example.com +
+
+ TIN: (DE) 111111125 +
-

Customer

+

+ Customer +

-
Sample Consumer
-
Werner-Heisenberg-Allee 25, München, 80939 (Germany)
-
Email: email@sample.com
-
TIN: (DE) 282741168
+
+ Sample Consumer +
+
+ + Werner-Heisenberg-Allee 25, München, 80939 (Germany) + +
+
+ Email: email@sample.com +
+
+ TIN: (DE) 282741168 +
-

Lines

+

+ Lines +

- - - - - - - + + + + + + + - - - - - - - + + + + + + +
#DescriptionQty.UnitPriceVATTotal + # + + Description + + Qty. + + Unit + + Price + + VAT + + Total +
1Development services20h€90,0019%€1.800,00 + 1 + + + Development services + + + 20 + + h + + €90,00 + + 19% + + €1.800,00 +
-

Totals

+

+ Totals +

- - + + - - + + - - + +
Sum€1.800,00 + Sum + + €1.800,00 +
Tax€342,00 + Tax + + €342,00 +
Total to pay€2.142,00 + Total to pay + + €2.142,00 +
-

Taxes

+

+ Taxes +

- - - - + + + + - - - - + + + +
TaxBaseRateAmount + Tax + + Base + + Rate + + Amount +
VAT€1.800,0019%€342,00 + VAT + + €1.800,00 + + 19% + + €342,00 +
-

Payment

+

+ Payment +

    @@ -140,13 +273,10 @@

    Payment

    - + \ No newline at end of file diff --git a/pkg/pdf/pdf.go b/pkg/pdf/pdf.go index 13f80d2..d4ecfbf 100644 --- a/pkg/pdf/pdf.go +++ b/pkg/pdf/pdf.go @@ -158,5 +158,6 @@ func loadXMP() []byte { if err != nil { panic(err) } + fmt.Println(string(data)) return data }