Skip to content

Commit

Permalink
Quick hack to add org party printing
Browse files Browse the repository at this point in the history
  • Loading branch information
samlown committed May 13, 2024
1 parent ec2c336 commit df76b01
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
4 changes: 4 additions & 0 deletions components/envelope.templ
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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:
<p>Unkown document type</p>
}
Expand Down
7 changes: 7 additions & 0 deletions components/envelope_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions examples/org.party.json
Original file line number Diff line number Diff line change
@@ -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": "[email protected]"
}
],
"logos": [
{
"label": "Invopop",
"url": "https://ams3.digitaloceanspaces.com/invopop-console-files-dev/3c5f601121ad9726776ce51b00a585e4e09387a7375fe352536bacd1793affd0"
}
]
}
}

0 comments on commit df76b01

Please sign in to comment.