Skip to content

Commit

Permalink
Merge pull request #2 from invopop/org-party-quick
Browse files Browse the repository at this point in the history
Quick hack to add org party printing
  • Loading branch information
samlown authored May 14, 2024
2 parents ec2c336 + 897494f commit 60d917b
Show file tree
Hide file tree
Showing 4 changed files with 125 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"
}
]
}
}
64 changes: 64 additions & 0 deletions examples/out/org.party.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<html data-theme="light">
<head>
<title>
GOBL HTML Generator
</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:[email protected]&amp;display=swap" rel="stylesheet">
<link rel="stylesheet" href="styles/envelope.css">
<link rel="stylesheet" href="styles/invoice.css">
</head>
<body>
<article class="envelope">
<footer class="print">
<span class="page">
Page
<span class="page-number">
1
</span>
of
<span class="pages-number">
1
</span>
</span>
<div class="gobl-logo">
<a href="https://gobl.org">
<img src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjQuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkNhcGFfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgdmlld0JveD0iMCAwIDE4MC42IDIxOC44IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAxODAuNiAyMTguODsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8Zz4KCTxwYXRoIGQ9Ik0xNzIsMTI3LjVWMzIuNmMwLTEuNC0wLjctMi44LTEuOS0zLjZjLTEuMi0wLjgtMi43LTAuOS00LT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YKCQkJCXY0MC41aDI0LjFjOS45LDAsMTQuNC01LjEsMTQuNC0xMS41QzE0Mi4xLDIwMC45LDEzOS4xLDE5Ny40LDEzMy40LDE5Ni41eiIvPgoJCQk8cG9seWdvbiBwb2ludHM9IjE0OS4yLDE3Ny4yIDE0OS4yLDIxNy43IDE4MC42LDIxNy43IDE4MC42LDIwOS41IDE1OS40LDIwOS41IDE1OS40LDE3Ny4yIAkJCSIvPgoJCTwvZz4KCTwvZz4KPC9nPgo8L3N2Zz4K" alt="GOBL">
</a>
</div>
</footer>
<div class="org-party">
<div class="name">
Biz España S.L.
</div>
<div class="org-address">
<span>
Calle Pradillo 42, Madrid, Madrid, 28002 (Spain)
</span>
</div>
<div class="emails">
Email: [email protected]
</div>
<div class="tax-id">
NIF: (ES) B28774008
</div>
<div class="identitiy">
LEI: 1010101010
</div>
<div class="identitiy">
Identity code: ABC1234
</div>
</div>
<footer class="screen">
<div class="gobl-logo">
<a href="https://gobl.org">
<img src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjQuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkNhcGFfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgdmlld0JveD0iMCAwIDE4MC42IDIxOC44IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAxODAuNiAyMTguODsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8Zz4KCTxwYXRoIGQ9Ik0xNzIsMTI3LjVWMzIuNmMwLTEuNC0wLjct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WMwLTUuOS00LjMtMTAuMy0xMy44LTEwLjNoLTIzLjYKCQkJCXY0MC41aDI0LjFjOS45LDAsMTQuNC01LjEsMTQuNC0xMS41QzE0Mi4xLDIwMC45LDEzOS4xLDE5Ny40LDEzMy40LDE5Ni41eiIvPgoJCQk8cG9seWdvbiBwb2ludHM9IjE0OS4yLDE3Ny4yIDE0OS4yLDIxNy43IDE4MC42LDIxNy43IDE4MC42LDIwOS41IDE1OS40LDIwOS41IDE1OS40LDE3Ny4yIAkJCSIvPgoJCTwvZz4KCTwvZz4KPC9nPgo8L3N2Zz4K" alt="GOBL">
</a>
</div>
</footer>
</article>
</body>
</html>

0 comments on commit 60d917b

Please sign in to comment.