Skip to content

Commit

Permalink
Upgrade to GOBL 0.115
Browse files Browse the repository at this point in the history
  • Loading branch information
samlown committed Sep 10, 2024
1 parent 5bb44c5 commit dcc0d47
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion assets/styles/invoice.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ section.title .hero img {
}
section.title span.paid {
font-size: 9pt;
font-weight: 600;
font-weight: 400;
vertical-align: text-bottom;
padding: 0.5mm 1.5mm;
border-radius: 1mm;
Expand Down
3 changes: 1 addition & 2 deletions components/org/address.templ
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"strings"

"github.com/invopop/ctxi18n/i18n"
"github.com/invopop/gobl/l10n"
"github.com/invopop/gobl/org"
"github.com/invopop/gobl.html/components/t"
)
Expand Down Expand Up @@ -73,7 +72,7 @@ func buildStreetWithNumbers(addr *org.Address) string {
func addrNumberFirst(addr *org.Address) bool {
// TODO: add more countries here!
switch addr.Country {
case l10n.GB, l10n.US, l10n.CA, l10n.FR:
case "GB", "US", "CA", "FR":
return true
default:
return false
Expand Down
5 changes: 2 additions & 3 deletions components/org/address_templ.go

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

15 changes: 7 additions & 8 deletions components/org/party.templ
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/invopop/gobl.html/components/regimes/co"
"github.com/invopop/gobl.html/components/t"
"github.com/invopop/gobl/cbc"
"github.com/invopop/gobl/l10n"
"github.com/invopop/gobl/org"
"github.com/invopop/gobl/tax"
)
Expand Down Expand Up @@ -169,17 +168,17 @@ func showTaxID(party *org.Party) bool {
func taxIDLabel(ctx context.Context, party *org.Party) string {
tID := party.TaxID
switch tID.Country {
case l10n.ES:
case "ES":
return "NIF"
case l10n.CO:
case "CO":
return "NIT"
case l10n.MX:
case "MX":
return "RFC"
case l10n.FR:
case "FR":
return "TVA"
case l10n.PT:
case "PT":
return "NIF"
case l10n.IT:
case "IT":
return "P.IVA"
default:
return i18n.T(ctx, ".labels.default")
Expand All @@ -190,7 +189,7 @@ func taxIDCode(party *org.Party) string {
tID := party.TaxID
code := tID.Code.String()
switch tID.Country {
case l10n.CO:
case "CO":
return co.FormatTaxIDCode(code)
default:
return tID.Code.String()
Expand Down
21 changes: 10 additions & 11 deletions components/org/party_templ.go

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

4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/a-h/templ v0.2.747
github.com/go-resty/resty/v2 v2.12.0
github.com/invopop/ctxi18n v0.6.0
github.com/invopop/gobl v0.112.0
github.com/invopop/gobl v0.115.0
github.com/invopop/princepdf v0.0.0-20240408123340-585be3cab91a
github.com/labstack/echo/v4 v4.12.0
github.com/piglig/go-qr v0.2.4
Expand All @@ -28,7 +28,7 @@ require (
github.com/google/uuid v1.6.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/invopop/jsonschema v0.12.0 // indirect
github.com/invopop/validation v0.3.0 // indirect
github.com/invopop/validation v0.7.0 // indirect
github.com/invopop/yaml v0.3.1 // indirect
github.com/joho/godotenv v1.5.1 // indirect
github.com/labstack/gommon v0.4.2 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ github.com/invopop/ctxi18n v0.6.0 h1:Qm3ZL/kK4EKvmLI3U2ETN2rWrtSTaxXrcA6ZUY9aVGE
github.com/invopop/ctxi18n v0.6.0/go.mod h1:1Osw+JGYA+anHt0Z4reF36r5FtGHYjGQ+m1X7keIhPc=
github.com/invopop/gobl v0.112.0 h1:nUzwrzogzjXhxBx5dZxq0dXkQhgTlMcGO7QQc++cLtA=
github.com/invopop/gobl v0.112.0/go.mod h1:SNuHEQJ0UEYVW9jd27MzlUiOWPviJnBygZ9/q5G5B5c=
github.com/invopop/gobl v0.115.0 h1:pLQZiCrlPQ904nV09xY32YPQPY3e2zXA4EMOAJVDSoA=
github.com/invopop/gobl v0.115.0/go.mod h1:lnlUK1cwjla/EPdxH1O7hKSSBv58DNWLV4/lOCv1vlQ=
github.com/invopop/jsonschema v0.12.0 h1:6ovsNSuvn9wEQVOyc72aycBMVQFKz7cPdMJn10CvzRI=
github.com/invopop/jsonschema v0.12.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0=
github.com/invopop/princepdf v0.0.0-20240408123340-585be3cab91a h1:xt18LlIfizLkFgLi+vK/m2SWOsAbQwVwQgbkzxKY0eU=
github.com/invopop/princepdf v0.0.0-20240408123340-585be3cab91a/go.mod h1:iYAJLConbhJ67An65H7Ei/o/ZGDvIQfyLA5JhxMQ1qY=
github.com/invopop/validation v0.3.0 h1:o260kbjXzoBO/ypXDSSrCLL7SxEFUXBsX09YTE9AxZw=
github.com/invopop/validation v0.3.0/go.mod h1:qIBG6APYLp2Wu3/96p3idYjP8ffTKVmQBfKiZbw0Hts=
github.com/invopop/validation v0.7.0 h1:NBPLqvYGmLZLQuk5jh0PbaBBetJW7f2VEk/BTWJkGBU=
github.com/invopop/validation v0.7.0/go.mod h1:nLLeXYPGwUNfdCdJo7/q3yaHO62LSx/3ri7JvgKR9vg=
github.com/invopop/yaml v0.3.1 h1:f0+ZpmhfBSS4MhG+4HYseMdJhoeeopbSKbq5Rpeelso=
github.com/invopop/yaml v0.3.1/go.mod h1:PMOp3nn4/12yEZUFfmOuNHJsZToEEOwoWsT+D81KkeA=
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
Expand Down

0 comments on commit dcc0d47

Please sign in to comment.