diff --git a/components/bill/invoice.templ b/components/bill/invoice.templ
index 408c2c0..c130114 100644
--- a/components/bill/invoice.templ
+++ b/components/bill/invoice.templ
@@ -14,6 +14,7 @@ import (
"github.com/invopop/gobl.html/components/regimes/mx"
"github.com/invopop/gobl.html/components/regimes/pl"
"github.com/invopop/gobl.html/components/regimes/pt"
+ "github.com/invopop/gobl.html/components/regimes/sa"
"github.com/invopop/gobl.html/components/t"
"github.com/invopop/gobl.html/components/utils"
"github.com/invopop/gobl.html/internal"
@@ -50,6 +51,7 @@ templ Invoice(env *gobl.Envelope, inv *bill.Invoice) {
@mx.CFDI(env, inv)
@pl.KSeFQR(env)
@pt.ATQR(env)
+ @sa.ZATCAQR(env)
@gr.IAPR(env)
diff --git a/components/bill/invoice_templ.go b/components/bill/invoice_templ.go
index 69f2548..493bf82 100644
--- a/components/bill/invoice_templ.go
+++ b/components/bill/invoice_templ.go
@@ -22,6 +22,7 @@ import (
"github.com/invopop/gobl.html/components/regimes/mx"
"github.com/invopop/gobl.html/components/regimes/pl"
"github.com/invopop/gobl.html/components/regimes/pt"
+ "github.com/invopop/gobl.html/components/regimes/sa"
"github.com/invopop/gobl.html/components/t"
"github.com/invopop/gobl.html/components/utils"
"github.com/invopop/gobl.html/internal"
@@ -174,6 +175,10 @@ func Invoice(env *gobl.Envelope, inv *bill.Invoice) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
+ templ_7745c5c3_Err = sa.ZATCAQR(env).Render(ctx, templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
templ_7745c5c3_Err = gr.IAPR(env).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
@@ -266,7 +271,7 @@ func title(env *gobl.Envelope, doc internal.Document) templ.Component {
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/bill/invoice.templ`, Line: 67, Col: 9}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/bill/invoice.templ`, Line: 69, Col: 9}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {
@@ -331,7 +336,7 @@ func titleHero(doc internal.Document) templ.Component {
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(img.URL)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/bill/invoice.templ`, Line: 81, Col: 22}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/bill/invoice.templ`, Line: 83, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
if templ_7745c5c3_Err != nil {
@@ -344,7 +349,7 @@ func titleHero(doc internal.Document) templ.Component {
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(img.Label)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/bill/invoice.templ`, Line: 81, Col: 40}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/bill/invoice.templ`, Line: 83, Col: 40}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
if templ_7745c5c3_Err != nil {
@@ -357,7 +362,7 @@ func titleHero(doc internal.Document) templ.Component {
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(logoHeight(img))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/bill/invoice.templ`, Line: 81, Col: 67}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/bill/invoice.templ`, Line: 83, Col: 67}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil {
@@ -371,7 +376,7 @@ func titleHero(doc internal.Document) templ.Component {
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(supplierAlias(doc.GetSupplier()))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/bill/invoice.templ`, Line: 83, Col: 38}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/bill/invoice.templ`, Line: 85, Col: 38}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
if templ_7745c5c3_Err != nil {
@@ -479,7 +484,7 @@ func defaultJoinCode(_ internal.Document, series, code cbc.Code) templ.Component
var templ_7745c5c3_Var20 string
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(series.Join(code).String())
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/bill/invoice.templ`, Line: 102, Col: 29}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/bill/invoice.templ`, Line: 104, Col: 29}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
if templ_7745c5c3_Err != nil {
@@ -560,7 +565,7 @@ func untdidTitleType(doc internal.Document) templ.Component {
var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(lbl)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/bill/invoice.templ`, Line: 122, Col: 7}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/bill/invoice.templ`, Line: 124, Col: 7}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
if templ_7745c5c3_Err != nil {
@@ -678,7 +683,7 @@ func titleBadges(env *gobl.Envelope, doc internal.Document) templ.Component {
var templ_7745c5c3_Var26 string
templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(lbl)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/bill/invoice.templ`, Line: 158, Col: 8}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/bill/invoice.templ`, Line: 160, Col: 8}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
if templ_7745c5c3_Err != nil {
diff --git a/components/regimes/sa/sa.go b/components/regimes/sa/sa.go
new file mode 100644
index 0000000..383cbd8
--- /dev/null
+++ b/components/regimes/sa/sa.go
@@ -0,0 +1,2 @@
+// Package sa defines extra output for Saudi Arabian invoices.
+package sa
diff --git a/components/regimes/sa/zatca.templ b/components/regimes/sa/zatca.templ
new file mode 100644
index 0000000..e46328f
--- /dev/null
+++ b/components/regimes/sa/zatca.templ
@@ -0,0 +1,42 @@
+package sa
+
+import (
+ "github.com/invopop/gobl"
+ "github.com/invopop/gobl.html/components/images"
+ "github.com/invopop/gobl/addons/sa/zatca"
+)
+
+// ZATCAQR renders the ZATCA QR code carried as a stamp on the envelope
+// header. The stamp value is the base64-encoded TLV payload defined by
+// the ZATCA e-invoicing specification.
+templ ZATCAQR(env *gobl.Envelope) {
+ if qr := zatcaQR(env); qr != "" {
+ @generateQR(qr)
+ }
+}
+
+templ generateQR(qr string) {
+
+
- Simplified Tax Invoice