From 1560a33ee64f70f79747d6fceedc5a206267156c Mon Sep 17 00:00:00 2001 From: Sam Lown <sam.lown@invopop.com> Date: Wed, 7 Feb 2024 22:53:42 +0000 Subject: [PATCH] Fix missing tax ID issue --- bill/invoice.go | 9 +++++++++ version.go | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/bill/invoice.go b/bill/invoice.go index 83c0e0f5..1b8687b8 100644 --- a/bill/invoice.go +++ b/bill/invoice.go @@ -504,9 +504,18 @@ func (inv *Invoice) determineTaxIdentity() (*tax.Identity, error) { if inv.Customer == nil { return nil, fmt.Errorf("missing customer for %s", tax.TagCustomerRates.String()) } + if inv.Customer.TaxID == nil { + return nil, fmt.Errorf("missing customer tax ID for %s", tax.TagCustomerRates.String()) + } return inv.Customer.TaxID, nil } } + if inv.Supplier == nil { + return nil, errors.New("missing supplier") + } + if inv.Supplier.TaxID == nil { + return nil, errors.New("missing supplier tax ID") + } return inv.Supplier.TaxID, nil } diff --git a/version.go b/version.go index ad0242e1..4804448f 100644 --- a/version.go +++ b/version.go @@ -8,7 +8,7 @@ import ( type Version string // VERSION is the current version of the GOBL library. -const VERSION Version = "v0.67.1" +const VERSION Version = "v0.67.2" // Semver parses and returns semver func (v Version) Semver() *semver.Version {