diff --git a/components/envelope.templ b/components/envelope.templ index e15a988..8004adc 100644 --- a/components/envelope.templ +++ b/components/envelope.templ @@ -8,8 +8,10 @@ import ( "github.com/invopop/gobl" "github.com/invopop/gobl/bill" "github.com/invopop/gobl/note" + gorg "github.com/invopop/gobl/org" "github.com/invopop/gobl.html/components/bill/invoice" "github.com/invopop/gobl.html/components/notes" + "github.com/invopop/gobl.html/components/org" "github.com/invopop/gobl.html/assets" "github.com/invopop/gobl.html/internal" ) @@ -34,6 +36,8 @@ templ Envelope(env *gobl.Envelope) { @invoice.Invoice(env, doc) case *note.Message: @notes.Message(doc) + case *gorg.Party: + @org.Party(doc) default:
Unkown document type
} diff --git a/components/envelope_templ.go b/components/envelope_templ.go index d0e868d..2a928e3 100644 --- a/components/envelope_templ.go +++ b/components/envelope_templ.go @@ -19,9 +19,11 @@ import ( "github.com/invopop/gobl.html/assets" "github.com/invopop/gobl.html/components/bill/invoice" "github.com/invopop/gobl.html/components/notes" + "github.com/invopop/gobl.html/components/org" "github.com/invopop/gobl.html/internal" "github.com/invopop/gobl/bill" "github.com/invopop/gobl/note" + gorg "github.com/invopop/gobl/org" ) func Envelope(env *gobl.Envelope) templ.Component { @@ -64,6 +66,11 @@ func Envelope(env *gobl.Envelope) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } + case *gorg.Party: + templ_7745c5c3_Err = org.Party(doc).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } default: _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Unkown document type
") if templ_7745c5c3_Err != nil { diff --git a/examples/org.party.json b/examples/org.party.json new file mode 100644 index 0000000..f4c5fd1 --- /dev/null +++ b/examples/org.party.json @@ -0,0 +1,50 @@ +{ + "$schema": "https://gobl.org/draft-0/envelope", + "head": { + "uuid": "018f73cb-34b4-7000-aaa1-17f9d9604da0", + "dig": { + "alg": "sha256", + "val": "c198db6985c94bbc7798e5d60ed95b3434c3eef911623e2b38e465e03f590904" + }, + "draft": true + }, + "doc": { + "$schema": "https://gobl.org/draft-0/org/party", + "uuid": "018f73cb-34b3-7000-80f6-4e452c9df78c", + "name": "Biz EspaƱa S.L.", + "tax_id": { + "country": "ES", + "code": "B28774008" + }, + "identities": [ + { + "type": "LEI", + "code": "1010101010" + }, + { + "code": "ABC1234" + } + ], + "addresses": [ + { + "num": "42", + "street": "Calle Pradillo", + "locality": "Madrid", + "region": "Madrid", + "code": "28002", + "country": "ES" + } + ], + "emails": [ + { + "addr": "billing@bizspain.es" + } + ], + "logos": [ + { + "label": "Invopop", + "url": "https://ams3.digitaloceanspaces.com/invopop-console-files-dev/3c5f601121ad9726776ce51b00a585e4e09387a7375fe352536bacd1793affd0" + } + ] + } +} \ No newline at end of file