diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..63a17b6 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,27 @@ +name: Lint +on: + push: + tags: + - v* + branches: + - main + pull_request: +jobs: + lint: + name: golangci-lint + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: "go.mod" + id: go + + - name: Lint + uses: golangci/golangci-lint-action@v6 + with: + version: v1.58 diff --git a/README.md b/README.md index b61ae79..e7e2b6d 100644 --- a/README.md +++ b/README.md @@ -119,8 +119,6 @@ There are certain assumptions and lost information in the conversion from UBL to 3. Fields ProfileID (BT-23) and CustomizationID (BT-24) in UBL are not supported and lost in the conversion. 4. The AccountingCost (BT-19, BT-133) fields are added as notes. 5. Payment advances do not include their own tax rate, they use the global tax rate of the invoice. -6. Identification fields that use ISO/IEC 6523 codes are currently not directly mapped to their [codelist](https://docs.peppol.eu/poacc/billing/3.0/codelist/ICD/), with their reference code being mapped to the Label. -7. The field AdditionalItemProperty (BG-32) is currently not supported in GOBL and lost in the conversion. ## Development diff --git a/document/party.go b/document/party.go index e00c5f8..f7a7058 100644 --- a/document/party.go +++ b/document/party.go @@ -13,7 +13,7 @@ type CustomerParty struct { // Party represents a party involved in a transaction type Party struct { EndpointID *EndpointID `xml:"cbc:EndpointID"` - PartyIdentification []Identification `xml:"cac:PartyIdentification"` + PartyIdentification *Identification `xml:"cac:PartyIdentification"` PartyName *PartyName `xml:"cac:PartyName"` PostalAddress *PostalAddress `xml:"cac:PostalAddress"` PartyTaxScheme []PartyTaxScheme `xml:"cac:PartyTaxScheme"` @@ -29,7 +29,7 @@ type EndpointID struct { // Identification represents an identification type Identification struct { - ID IDType `xml:"cbc:ID"` + ID *IDType `xml:"cbc:ID"` } // PartyName represents the name of a party diff --git a/go.mod b/go.mod index 5bc53b5..c393d19 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22 toolchain go1.22.1 require ( - github.com/invopop/gobl v0.205.0 + github.com/invopop/gobl v0.205.1 github.com/joho/godotenv v1.5.1 // github.com/lestrrat-go/libxml2 v0.0.0-20240521004304-a75c203ac627 github.com/spf13/cobra v1.8.1 diff --git a/go.sum b/go.sum index d19db73..2e42c7a 100644 --- a/go.sum +++ b/go.sum @@ -20,8 +20,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/invopop/gobl v0.205.0 h1:NkwtCTBNVdcvZKebFOcYUt/FH5GGS9G9JH6eFSmtGpg= -github.com/invopop/gobl v0.205.0/go.mod h1:DmPohPel8b3ta4nDKnXRNzWQlB89cN74e0/WwPUEZUU= +github.com/invopop/gobl v0.205.1 h1:khW63/Hu2lzU+IpRN2RF71cfUttCizL0HHAmeakWHyE= +github.com/invopop/gobl v0.205.1/go.mod h1:DmPohPel8b3ta4nDKnXRNzWQlB89cN74e0/WwPUEZUU= github.com/invopop/jsonschema v0.12.0 h1:6ovsNSuvn9wEQVOyc72aycBMVQFKz7cPdMJn10CvzRI= github.com/invopop/jsonschema v0.12.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0= github.com/invopop/validation v0.8.0 h1:e5hXHGnONHImgJdonIpNbctg1hlWy1ncaHoVIQ0JWuw= diff --git a/internal/gtou/lines.go b/internal/gtou/lines.go index 9672805..306ae62 100644 --- a/internal/gtou/lines.go +++ b/internal/gtou/lines.go @@ -5,6 +5,7 @@ import ( "github.com/invopop/gobl.ubl/document" "github.com/invopop/gobl/bill" + "github.com/invopop/gobl/catalogues/iso" "github.com/invopop/gobl/catalogues/untdid" "github.com/invopop/gobl/num" ) @@ -99,6 +100,18 @@ func (c *Converter) newLines(inv *bill.Invoice) error { } } + if len(l.Item.Identities) > 0 { + for _, id := range l.Item.Identities { + s := id.Ext[iso.ExtKeySchemeID].String() + it.StandardItemIdentification = &document.ItemIdentification{ + ID: &document.IDType{ + SchemeID: &s, + Value: id.Code.String(), + }, + } + } + } + invLine.Item = it if l.Item.Price != (num.Amount{}) { diff --git a/internal/gtou/lines_test.go b/internal/gtou/lines_test.go index af8d56d..3385330 100644 --- a/internal/gtou/lines_test.go +++ b/internal/gtou/lines_test.go @@ -26,6 +26,8 @@ func TestNewLines(t *testing.T) { assert.False(t, doc.InvoiceLine[0].AllowanceCharge[1].ChargeIndicator) assert.Equal(t, "Damage", *doc.InvoiceLine[0].AllowanceCharge[1].AllowanceChargeReason) assert.Equal(t, "12.00", doc.InvoiceLine[0].AllowanceCharge[1].Amount.Value) + assert.Equal(t, "0088", *doc.InvoiceLine[0].Item.StandardItemIdentification.ID.SchemeID) + assert.Equal(t, "1234567890128", doc.InvoiceLine[0].Item.StandardItemIdentification.ID.Value) }) diff --git a/internal/gtou/party.go b/internal/gtou/party.go index 27004c6..6d25ef2 100644 --- a/internal/gtou/party.go +++ b/internal/gtou/party.go @@ -5,6 +5,7 @@ import ( "strconv" "github.com/invopop/gobl.ubl/document" + "github.com/invopop/gobl/catalogues/iso" "github.com/invopop/gobl/cbc" "github.com/invopop/gobl/org" ) @@ -58,6 +59,20 @@ func (c *Converter) newParty(party *org.Party) document.Party { Name: party.Alias, } } + + if len(party.Identities) > 0 { + for _, id := range party.Identities { + if id.Ext != nil { + s := id.Ext[iso.ExtKeySchemeID].String() + p.PartyIdentification = &document.Identification{ + ID: &document.IDType{ + SchemeID: &s, + Value: id.Code.String(), + }, + } + } + } + } return p } @@ -71,19 +86,13 @@ func newAddress(addresses []*org.Address) *document.PostalAddress { addr := &document.PostalAddress{} if a.Street != "" { - addr.StreetName = &a.Street - } - - if a.Number != "" { - addr.AddressLine = []document.AddressLine{ - { - Line: a.Number, - }, - } + l := a.LineOne() + addr.StreetName = &l } if a.StreetExtra != "" { - addr.AdditionalStreetName = &a.StreetExtra + l := a.LineTwo() + addr.AdditionalStreetName = &l } if a.Locality != "" { diff --git a/internal/gtou/party_test.go b/internal/gtou/party_test.go index ba74c65..43f3b2f 100644 --- a/internal/gtou/party_test.go +++ b/internal/gtou/party_test.go @@ -17,8 +17,7 @@ func TestNewParty(t *testing.T) { assert.Equal(t, "+49100200300", *doc.AccountingSupplierParty.Party.Contact.Telephone) assert.Equal(t, "billing@example.com", *doc.AccountingSupplierParty.Party.Contact.ElectronicMail) - assert.Equal(t, "16", doc.AccountingSupplierParty.Party.PostalAddress.AddressLine[0].Line) - assert.Equal(t, "Dietmar-Hopp-Allee", *doc.AccountingSupplierParty.Party.PostalAddress.StreetName) + assert.Equal(t, "Dietmar-Hopp-Allee 16", *doc.AccountingSupplierParty.Party.PostalAddress.StreetName) assert.Equal(t, "Walldorf", *doc.AccountingSupplierParty.Party.PostalAddress.CityName) assert.Equal(t, "69190", *doc.AccountingSupplierParty.Party.PostalAddress.PostalZone) assert.Equal(t, "DE", doc.AccountingSupplierParty.Party.PostalAddress.Country.IdentificationCode) @@ -27,11 +26,13 @@ func TestNewParty(t *testing.T) { assert.Equal(t, "Sample Consumer", *doc.AccountingCustomerParty.Party.PartyLegalEntity.RegistrationName) assert.Equal(t, "email@sample.com", *doc.AccountingCustomerParty.Party.Contact.ElectronicMail) - assert.Equal(t, "25", doc.AccountingCustomerParty.Party.PostalAddress.AddressLine[0].Line) - assert.Equal(t, "Werner-Heisenberg-Allee", *doc.AccountingCustomerParty.Party.PostalAddress.StreetName) + assert.Equal(t, "Werner-Heisenberg-Allee 25", *doc.AccountingCustomerParty.Party.PostalAddress.StreetName) assert.Equal(t, "München", *doc.AccountingCustomerParty.Party.PostalAddress.CityName) assert.Equal(t, "80939", *doc.AccountingCustomerParty.Party.PostalAddress.PostalZone) assert.Equal(t, "DE", doc.AccountingCustomerParty.Party.PostalAddress.Country.IdentificationCode) + + assert.Equal(t, "0088", *doc.AccountingCustomerParty.Party.PartyIdentification.ID.SchemeID) + assert.Equal(t, "1234567890128", doc.AccountingCustomerParty.Party.PartyIdentification.ID.Value) }) } diff --git a/internal/utog/lines.go b/internal/utog/lines.go index 9f7e233..74093a1 100644 --- a/internal/utog/lines.go +++ b/internal/utog/lines.go @@ -5,6 +5,7 @@ import ( "github.com/invopop/gobl.ubl/document" "github.com/invopop/gobl/bill" + "github.com/invopop/gobl/catalogues/iso" "github.com/invopop/gobl/cbc" "github.com/invopop/gobl/l10n" "github.com/invopop/gobl/num" @@ -135,11 +136,19 @@ func (c *Converter) getIdentities(docLine *document.InvoiceLine) []*org.Identity } } - if docLine.Item.StandardItemIdentification != nil && docLine.Item.StandardItemIdentification.ID != nil { - id := getIdentity(docLine.Item.StandardItemIdentification.ID) - if id != nil { - ids = append(ids, id) + if docLine.Item.StandardItemIdentification != nil && + docLine.Item.StandardItemIdentification.ID != nil && + docLine.Item.StandardItemIdentification.ID.SchemeID != nil { + s := *docLine.Item.StandardItemIdentification.ID.SchemeID + id := &org.Identity{ + Ext: tax.Extensions{ + iso.ExtKeySchemeID: tax.ExtValue(s), + }, + Code: cbc.Code(docLine.Item.StandardItemIdentification.ID.Value), } + + ids = append(ids, id) + } if docLine.Item.CommodityClassification != nil && len(*docLine.Item.CommodityClassification) > 0 { diff --git a/internal/utog/lines_test.go b/internal/utog/lines_test.go index 87a0a96..fdc396d 100644 --- a/internal/utog/lines_test.go +++ b/internal/utog/lines_test.go @@ -4,6 +4,7 @@ import ( "testing" "github.com/invopop/gobl/bill" + "github.com/invopop/gobl/catalogues/iso" "github.com/invopop/gobl/cbc" "github.com/invopop/gobl/l10n" "github.com/invopop/gobl/org" @@ -79,7 +80,7 @@ func TestGetLines(t *testing.T) { assert.Len(t, line.Item.Identities, 3) assert.Equal(t, cbc.Code("1234567890128"), line.Item.Identities[0].Code) - assert.Equal(t, "0088", line.Item.Identities[0].Label) + assert.Equal(t, "0088", line.Item.Identities[0].Ext[iso.ExtKeySchemeID].String()) assert.Equal(t, cbc.Code("12344321"), line.Item.Identities[1].Code) assert.Equal(t, "ZZZ", line.Item.Identities[1].Label) assert.Equal(t, cbc.Code("65434568"), line.Item.Identities[2].Code) diff --git a/internal/utog/party.go b/internal/utog/party.go index 42f2b8f..e5ca74e 100644 --- a/internal/utog/party.go +++ b/internal/utog/party.go @@ -2,6 +2,7 @@ package utog import ( "github.com/invopop/gobl.ubl/document" + "github.com/invopop/gobl/catalogues/iso" "github.com/invopop/gobl/cbc" "github.com/invopop/gobl/l10n" "github.com/invopop/gobl/org" @@ -91,17 +92,20 @@ func (c *Converter) getParty(party *document.Party) *org.Party { } } - if party.PartyIdentification != nil { - for _, id := range party.PartyIdentification { - identity := getIdentity(&id.ID) - if identity == nil { - continue - } - if p.Identities == nil { - p.Identities = make([]*org.Identity, 0) - } - p.Identities = append(p.Identities, identity) + if party.PartyIdentification != nil && + party.PartyIdentification.ID != nil && + party.PartyIdentification.ID.SchemeID != nil { + s := *party.PartyIdentification.ID.SchemeID + identity := &org.Identity{ + Ext: tax.Extensions{ + iso.ExtKeySchemeID: tax.ExtValue(s), + }, + Code: cbc.Code(party.PartyIdentification.ID.Value), + } + if p.Identities == nil { + p.Identities = make([]*org.Identity, 0) } + p.Identities = append(p.Identities, identity) } return p diff --git a/internal/utog/party_test.go b/internal/utog/party_test.go index de6a8ff..2ee7aae 100644 --- a/internal/utog/party_test.go +++ b/internal/utog/party_test.go @@ -4,6 +4,7 @@ import ( "testing" "github.com/invopop/gobl/bill" + "github.com/invopop/gobl/catalogues/iso" "github.com/invopop/gobl/cbc" "github.com/invopop/gobl/l10n" "github.com/stretchr/testify/assert" @@ -39,7 +40,7 @@ func TestGetParty(t *testing.T) { require.Len(t, seller.Identities, 2) assert.Equal(t, "CompanyID", seller.Identities[0].Label) assert.Equal(t, cbc.Code("123456789"), seller.Identities[0].Code) - assert.Equal(t, "0088", seller.Identities[1].Label) + assert.Equal(t, "0088", seller.Identities[1].Ext[iso.ExtKeySchemeID].String()) assert.Equal(t, cbc.Code("1238764941386"), seller.Identities[1].Code) assert.Equal(t, "Main street 34", seller.Addresses[0].Street) @@ -69,7 +70,7 @@ func TestGetParty(t *testing.T) { require.Len(t, customer.Identities, 2) assert.Equal(t, "CompanyID", customer.Identities[0].Label) assert.Equal(t, cbc.Code("987654321"), customer.Identities[0].Code) - assert.Equal(t, "0088", customer.Identities[1].Label) + assert.Equal(t, "0088", customer.Identities[1].Ext[iso.ExtKeySchemeID].String()) assert.Equal(t, cbc.Code("3456789012098"), customer.Identities[1].Code) assert.Equal(t, "John Doe", customer.People[0].Name.Given) @@ -98,7 +99,7 @@ func TestGetParty(t *testing.T) { require.Len(t, supplier.Identities, 2) assert.Equal(t, "CompanyID", supplier.Identities[0].Label) assert.Equal(t, cbc.Code("DK16356706"), supplier.Identities[0].Code) - assert.Equal(t, "0088", supplier.Identities[1].Label) + assert.Equal(t, "0088", supplier.Identities[1].Ext[iso.ExtKeySchemeID].String()) assert.Equal(t, cbc.Code("1238764941386"), supplier.Identities[1].Code) customer := inv.Customer diff --git a/internal/utog/payment_test.go b/internal/utog/payment_test.go index 79dd3be..d7f6f72 100644 --- a/internal/utog/payment_test.go +++ b/internal/utog/payment_test.go @@ -4,6 +4,7 @@ import ( "testing" "github.com/invopop/gobl/bill" + "github.com/invopop/gobl/catalogues/iso" "github.com/invopop/gobl/cbc" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -26,7 +27,7 @@ func TestGetPayment(t *testing.T) { require.Len(t, payment.Payee.Identities, 2) assert.Equal(t, "CompanyID", payment.Payee.Identities[0].Label) assert.Equal(t, cbc.Code("989823401"), payment.Payee.Identities[0].Code) - assert.Equal(t, "0088", payment.Payee.Identities[1].Label) + assert.Equal(t, "0088", payment.Payee.Identities[1].Ext[iso.ExtKeySchemeID].String()) assert.Equal(t, cbc.Code("2298740918237"), payment.Payee.Identities[1].Code) assert.Equal(t, "2 % discount if paid within 2 days\n Penalty percentage 10% from due date", payment.Terms.Notes) }) diff --git a/test/data/gtou/invoice-de-de.json b/test/data/gtou/invoice-de-de.json index 1e431d5..c9cd0c6 100644 --- a/test/data/gtou/invoice-de-de.json +++ b/test/data/gtou/invoice-de-de.json @@ -69,6 +69,14 @@ { "addr": "email@sample.com" } + ], + "identities": [ + { + "code": "1234567890128", + "ext": { + "iso-scheme-id": "0088" + } + } ] }, "lines": [ diff --git a/test/data/gtou/invoice-without-buyers-tax-id.json b/test/data/gtou/invoice-without-buyers-tax-id.json index fe89044..0304e50 100644 --- a/test/data/gtou/invoice-without-buyers-tax-id.json +++ b/test/data/gtou/invoice-without-buyers-tax-id.json @@ -74,7 +74,15 @@ "item": { "name": "Development services", "price": "90.00", - "unit": "h" + "unit": "h", + "identities": [ + { + "code": "1234567890128", + "ext": { + "iso-scheme-id": "0088" + } + } + ] }, "sum": "1800.00", "taxes": [ diff --git a/test/data/gtou/out/correction-invoice.xml b/test/data/gtou/out/correction-invoice.xml index ddca823..947eb32 100755 --- a/test/data/gtou/out/correction-invoice.xml +++ b/test/data/gtou/out/correction-invoice.xml @@ -11,12 +11,9 @@ - Dietmar-Hopp-Allee + Dietmar-Hopp-Allee 16 Walldorf 69190 - - 16 - DE @@ -40,12 +37,9 @@ - Werner-Heisenberg-Allee + Werner-Heisenberg-Allee 25 München 80939 - - 25 - DE diff --git a/test/data/gtou/out/credit-note.xml b/test/data/gtou/out/credit-note.xml index c0df882..e3c2663 100755 --- a/test/data/gtou/out/credit-note.xml +++ b/test/data/gtou/out/credit-note.xml @@ -11,12 +11,9 @@ - Dietmar-Hopp-Allee + Dietmar-Hopp-Allee 16 Walldorf 69190 - - 16 - DE @@ -40,12 +37,9 @@ - Werner-Heisenberg-Allee + Werner-Heisenberg-Allee 25 München 80939 - - 25 - DE diff --git a/test/data/gtou/out/invoice-complete.xml b/test/data/gtou/out/invoice-complete.xml index 49ad094..e59b32d 100755 --- a/test/data/gtou/out/invoice-complete.xml +++ b/test/data/gtou/out/invoice-complete.xml @@ -25,12 +25,9 @@ - Dietmar-Hopp-Allee + Dietmar-Hopp-Allee 16 Walldorf 69190 - - 16 - DE @@ -54,12 +51,9 @@ - Werner-Heisenberg-Allee + Werner-Heisenberg-Allee 25 München 80939 - - 25 - DE diff --git a/test/data/gtou/out/invoice-de-de.xml b/test/data/gtou/out/invoice-de-de.xml index 1eb3033..7ad3f7e 100755 --- a/test/data/gtou/out/invoice-de-de.xml +++ b/test/data/gtou/out/invoice-de-de.xml @@ -24,12 +24,9 @@ - Dietmar-Hopp-Allee + Dietmar-Hopp-Allee 16 Walldorf 69190 - - 16 - DE @@ -52,13 +49,13 @@ + + 1234567890128 + - Werner-Heisenberg-Allee + Werner-Heisenberg-Allee 25 München 80939 - - 25 - DE diff --git a/test/data/gtou/out/invoice-minimal.xml b/test/data/gtou/out/invoice-minimal.xml index 99579ba..a3cb719 100755 --- a/test/data/gtou/out/invoice-minimal.xml +++ b/test/data/gtou/out/invoice-minimal.xml @@ -8,12 +8,9 @@ - Dietmar-Hopp-Allee + Dietmar-Hopp-Allee 16 Walldorf 69190 - - 16 - DE @@ -35,12 +32,9 @@ - Werner-Heisenberg-Allee + Werner-Heisenberg-Allee 25 München 80939 - - 25 - DE diff --git a/test/data/gtou/out/invoice-without-buyers-tax-id.xml b/test/data/gtou/out/invoice-without-buyers-tax-id.xml index 3d6c3dd..26eae54 100755 --- a/test/data/gtou/out/invoice-without-buyers-tax-id.xml +++ b/test/data/gtou/out/invoice-without-buyers-tax-id.xml @@ -11,12 +11,9 @@ - Dietmar-Hopp-Allee + Dietmar-Hopp-Allee 16 Walldorf 69190 - - 16 - DE @@ -40,12 +37,9 @@ - Werner-Heisenberg-Allee + Werner-Heisenberg-Allee 25 München 80939 - - 25 - DE @@ -112,6 +106,9 @@ Development services + + 1234567890128 + 19 diff --git a/test/data/gtou/out/self-billed-invoice.xml b/test/data/gtou/out/self-billed-invoice.xml index e6b8636..57a9bdd 100755 --- a/test/data/gtou/out/self-billed-invoice.xml +++ b/test/data/gtou/out/self-billed-invoice.xml @@ -12,12 +12,9 @@ - Dietmar-Hopp-Allee + Dietmar-Hopp-Allee 16 Walldorf 69190 - - 16 - DE @@ -41,12 +38,9 @@ - Werner-Heisenberg-Allee + Werner-Heisenberg-Allee 25 München 80939 - - 25 - DE diff --git a/test/data/utog/out/ubl-example1.json b/test/data/utog/out/ubl-example1.json index 033ea71..d9b44bf 100755 --- a/test/data/utog/out/ubl-example1.json +++ b/test/data/utog/out/ubl-example1.json @@ -1,16 +1,16 @@ { "$schema": "https://gobl.org/draft-0/envelope", "head": { - "uuid": "01930b26-28a5-7ece-af1c-ed1260949291", + "uuid": "01933080-ae64-7397-82cb-6c42b0cea3da", "dig": { "alg": "sha256", - "val": "5340ecdf464caed281e721ab25072b791e219e5a7f2b760eeb8113aeb91d2553" + "val": "237a85d46aa33c97daf7498b302adb41c91dbac5670f1f985a0990f2a88fae5d" } }, "doc": { "$schema": "https://gobl.org/draft-0/bill/invoice", "$regime": "NL", - "uuid": "01930b26-28a5-7f28-a36f-472de7052cb8", + "uuid": "01933080-ae64-73db-87e5-aa6d5a4afa2e", "type": "standard", "code": "12115118", "issue_date": "2015-01-09", @@ -38,11 +38,6 @@ }, "customer": { "name": "ODIN 59", - "identities": [ - { - "code": "10202" - } - ], "people": [ { "name": { diff --git a/test/data/utog/out/ubl-example2.json b/test/data/utog/out/ubl-example2.json index aafecd1..f097bf6 100755 --- a/test/data/utog/out/ubl-example2.json +++ b/test/data/utog/out/ubl-example2.json @@ -1,15 +1,15 @@ { "$schema": "https://gobl.org/draft-0/envelope", "head": { - "uuid": "01930b26-28c8-7db2-86a4-951c8a9abdbf", + "uuid": "01933080-ae87-720b-a938-050d4dcc08ee", "dig": { "alg": "sha256", - "val": "8402dded5a3969bf96f52b8bf4470c6f76d60a6382703094d63eb364191f0193" + "val": "322d80f327812218e0e09c6d05bd1f1fe0a90c8a2b54e0e81c230238354c7f1e" } }, "doc": { "$schema": "https://gobl.org/draft-0/bill/invoice", - "uuid": "01930b26-28c8-7e42-b2fa-9e283f1d76cb", + "uuid": "01933080-ae87-726a-893e-fafd54752ff9", "type": "standard", "code": "TOSL108", "issue_date": "2013-06-30", @@ -43,8 +43,10 @@ "code": "987654321" }, { - "label": "0088", - "code": "3456789012098" + "code": "3456789012098", + "ext": { + "iso-scheme-id": "0088" + } } ], "people": [ @@ -84,8 +86,10 @@ "name": "Laptop computer", "identities": [ { - "label": "0088", - "code": "1234567890128" + "code": "1234567890128", + "ext": { + "iso-scheme-id": "0088" + } }, { "label": "ZZZ", @@ -142,8 +146,10 @@ "name": "Returned \"Advanced computing\" book", "identities": [ { - "label": "0088", - "code": "1234567890135" + "code": "1234567890135", + "ext": { + "iso-scheme-id": "0088" + } }, { "label": "ZZZ", @@ -183,8 +189,10 @@ "name": "\"Computing for dummies\" book", "identities": [ { - "label": "0088", - "code": "1234567890135" + "code": "1234567890135", + "ext": { + "iso-scheme-id": "0088" + } }, { "label": "ZZZ", @@ -221,8 +229,10 @@ "name": "Returned IBM 5150 desktop", "identities": [ { - "label": "0088", - "code": "1234567890159" + "code": "1234567890159", + "ext": { + "iso-scheme-id": "0088" + } }, { "label": "ZZZ", @@ -259,8 +269,10 @@ "name": "Network cable", "identities": [ { - "label": "0088", - "code": "1234567890166" + "code": "1234567890166", + "ext": { + "iso-scheme-id": "0088" + } }, { "label": "ZZZ", @@ -340,8 +352,10 @@ "code": "123456789" }, { - "label": "0088", - "code": "1238764941386" + "code": "1238764941386", + "ext": { + "iso-scheme-id": "0088" + } } ], "people": [ @@ -387,8 +401,10 @@ "code": "989823401" }, { - "label": "0088", - "code": "2298740918237" + "code": "2298740918237", + "ext": { + "iso-scheme-id": "0088" + } } ] }, diff --git a/test/data/utog/out/ubl-example3.json b/test/data/utog/out/ubl-example3.json index f2745f1..1efa6f4 100755 --- a/test/data/utog/out/ubl-example3.json +++ b/test/data/utog/out/ubl-example3.json @@ -1,15 +1,15 @@ { "$schema": "https://gobl.org/draft-0/envelope", "head": { - "uuid": "01930b26-28ec-74e0-84e4-10b472361757", + "uuid": "01933080-aea7-7a31-bdf1-f3069d5c7296", "dig": { "alg": "sha256", - "val": "b3bf6b29f65a693a9a2df9a9258c1900eb33350d467bc1fbbdc3958ffe7d07e1" + "val": "18a28b751e92010dd88cf2bc902ca328c709464408d26540973cf72614d7f2a9" } }, "doc": { "$schema": "https://gobl.org/draft-0/bill/invoice", - "uuid": "01930b26-28ec-7512-9e3b-072a58268fef", + "uuid": "01933080-aea7-7a7f-8ddc-19039fad7255", "type": "standard", "code": "TOSL108", "issue_date": "2013-04-10", @@ -26,8 +26,10 @@ "code": "DK16356706" }, { - "label": "0088", - "code": "1238764941386" + "code": "1238764941386", + "ext": { + "iso-scheme-id": "0088" + } } ], "addresses": [ @@ -56,8 +58,10 @@ "code": "987654321" }, { - "label": "0088", - "code": "5790000435975" + "code": "5790000435975", + "ext": { + "iso-scheme-id": "0088" + } } ], "addresses": [ diff --git a/test/data/utog/out/ubl-example4.json b/test/data/utog/out/ubl-example4.json index 950a9b4..cc368dd 100755 --- a/test/data/utog/out/ubl-example4.json +++ b/test/data/utog/out/ubl-example4.json @@ -1,15 +1,15 @@ { "$schema": "https://gobl.org/draft-0/envelope", "head": { - "uuid": "01930b26-2911-7e68-b2b6-7d1961771ec4", + "uuid": "01933080-aec6-7515-8cc6-9aa43bcbe8cb", "dig": { "alg": "sha256", - "val": "165ef67e2d718df1125583580d5fd4cb020b68497b3e7e3c7eeb6ed9c030e700" + "val": "595c99b48a1e721c38966534cbb0cb14004428999235d4b9321184ebe2746f3f" } }, "doc": { "$schema": "https://gobl.org/draft-0/bill/invoice", - "uuid": "01930b26-2911-7ee2-99e1-b40ed4f35a5f", + "uuid": "01933080-aec6-7586-ba39-4f1268a33066", "type": "standard", "code": "TOSL110", "issue_date": "2013-04-10", @@ -26,8 +26,10 @@ "code": "DK16356706" }, { - "label": "0088", - "code": "5790000436101" + "code": "5790000436101", + "ext": { + "iso-scheme-id": "0088" + } } ], "people": [ @@ -60,8 +62,10 @@ "name": "Buyercompany ltd", "identities": [ { - "label": "0088", - "code": "5790000436057" + "code": "5790000436057", + "ext": { + "iso-scheme-id": "0088" + } } ], "people": [ diff --git a/test/data/utog/out/ubl-example5.json b/test/data/utog/out/ubl-example5.json index 399942b..4cad830 100755 --- a/test/data/utog/out/ubl-example5.json +++ b/test/data/utog/out/ubl-example5.json @@ -1,15 +1,15 @@ { "$schema": "https://gobl.org/draft-0/envelope", "head": { - "uuid": "01930b26-2932-764f-a8ce-8438fd250484", + "uuid": "01933080-aeee-7771-a3b3-d3643091ccf8", "dig": { "alg": "sha256", - "val": "565879728ad2f826ab32e1cc2f599174c459794c754ce7c7ac52699bc2755461" + "val": "1d6dc2bf5d288ebf4935c4d3e4ef7299d750234c8c925411c482eccb11dc5863" } }, "doc": { "$schema": "https://gobl.org/draft-0/bill/invoice", - "uuid": "01930b26-2932-7686-abea-d84d6344618a", + "uuid": "01933080-aeee-77c0-87ee-35fd6a8a03fe", "type": "standard", "code": "TOSL110", "issue_date": "2013-04-10", @@ -50,8 +50,10 @@ "code": "DK16356607" }, { - "label": "0088", - "code": "5790000436057" + "code": "5790000436057", + "ext": { + "iso-scheme-id": "0088" + } } ], "people": [ @@ -94,8 +96,10 @@ "code": "BUY123" }, { - "label": "0088", - "code": "1234567890128" + "code": "1234567890128", + "ext": { + "iso-scheme-id": "0088" + } }, { "label": "ZZZ", @@ -255,8 +259,10 @@ "code": "NL16356706" }, { - "label": "0088", - "code": "5790000436101" + "code": "5790000436101", + "ext": { + "iso-scheme-id": "0088" + } } ], "people": [ @@ -310,9 +316,6 @@ { "label": "CompanyID", "code": "DK16356608" - }, - { - "code": "DK16356608" } ] }, diff --git a/test/data/utog/out/ubl-example6.json b/test/data/utog/out/ubl-example6.json index 8266211..97a8f23 100755 --- a/test/data/utog/out/ubl-example6.json +++ b/test/data/utog/out/ubl-example6.json @@ -1,15 +1,15 @@ { "$schema": "https://gobl.org/draft-0/envelope", "head": { - "uuid": "01930b26-2957-7b6b-b052-7a6fe1bcf676", + "uuid": "01933080-af0f-74b9-bc02-5b541d8f3bd8", "dig": { "alg": "sha256", - "val": "e082638dae2c99c8e7f74b3b13152e47fab97cfa4d4d0380adb3a6d2675a3b41" + "val": "85bcc599f49deb0c68d6497fbcb90cbaf5b9eb5e967621c587d8ea2b2f9b5563" } }, "doc": { "$schema": "https://gobl.org/draft-0/bill/invoice", - "uuid": "01930b26-2957-7ba1-b1e1-cf7179b3db2f", + "uuid": "01933080-af0f-7501-905c-1f08dc0000b8", "type": "standard", "code": "TOSL110", "issue_date": "2013-04-10", diff --git a/test/data/utog/out/ubl-example7.json b/test/data/utog/out/ubl-example7.json index e00dcfe..464f30b 100755 --- a/test/data/utog/out/ubl-example7.json +++ b/test/data/utog/out/ubl-example7.json @@ -1,15 +1,15 @@ { "$schema": "https://gobl.org/draft-0/envelope", "head": { - "uuid": "01930b26-2975-7993-b185-52d57fcfb13f", + "uuid": "01933080-af31-7255-bf0e-d2c89e276daa", "dig": { "alg": "sha256", - "val": "df89525a78982d67540eca4b49cc3d3f3469eeda6a90cd461ff7269de91ad9e7" + "val": "92931d10c6e04f334bbe20efe7fcf8e9ae6fd4d940c29bf488a2dafcef8a6031" } }, "doc": { "$schema": "https://gobl.org/draft-0/bill/invoice", - "uuid": "01930b26-2975-7a1f-8e4d-6f44dbcf82c0", + "uuid": "01933080-af31-72b5-b6f3-412414f99f28", "type": "standard", "code": "INVOICE_test_7", "issue_date": "2013-03-11", @@ -17,11 +17,6 @@ "supplier": { "name": "The Sellercompany Incorporated", "alias": "Civic Service Centre", - "identities": [ - { - "code": "5532331183" - } - ], "people": [ { "name": { diff --git a/test/data/utog/out/ubl-example8.json b/test/data/utog/out/ubl-example8.json index ca152a7..1292163 100755 --- a/test/data/utog/out/ubl-example8.json +++ b/test/data/utog/out/ubl-example8.json @@ -1,16 +1,16 @@ { "$schema": "https://gobl.org/draft-0/envelope", "head": { - "uuid": "01930b26-2999-708b-9213-83b392feac60", + "uuid": "01933080-af57-75f0-9016-3338b6cd2caf", "dig": { "alg": "sha256", - "val": "5746fd7fe071c3fa8a9582635e1c2aa888c6941172827ab58b8c57673b81e8d2" + "val": "c6939643f6a14cd7d96ae019f0558dc7dce9dee9a9a8c90cc00642a199a34709" } }, "doc": { "$schema": "https://gobl.org/draft-0/bill/invoice", "$regime": "NL", - "uuid": "01930b26-2999-70e9-a1d3-4914dd5e7f5e", + "uuid": "01933080-af57-762c-b7a8-beb8b4569e06", "type": "standard", "code": "1100512149", "issue_date": "2014-11-10", @@ -44,11 +44,6 @@ }, "customer": { "name": "Klant", - "identities": [ - { - "code": "1081119" - } - ], "addresses": [ { "street": "Bedrijfslaan 4", diff --git a/test/data/utog/out/ubl-example9.json b/test/data/utog/out/ubl-example9.json index f02b545..1276f26 100755 --- a/test/data/utog/out/ubl-example9.json +++ b/test/data/utog/out/ubl-example9.json @@ -1,16 +1,16 @@ { "$schema": "https://gobl.org/draft-0/envelope", "head": { - "uuid": "01930b26-29c9-7b5b-b460-a850f3e1ffb1", + "uuid": "01933080-af7a-72a0-87cd-10cfba393c5e", "dig": { "alg": "sha256", - "val": "247143271cd61ddcf1116a64ef9b63a223db38d0fc99d4e07b1f55c0ed41bdb7" + "val": "8835eb09722a05dd702744499f3cb02f289cfb1896198c860bec65b2c6bab9ff" } }, "doc": { "$schema": "https://gobl.org/draft-0/bill/invoice", "$regime": "NL", - "uuid": "01930b26-29c9-7bb1-b1ad-d2bbb2b73a6a", + "uuid": "01933080-af7a-72e3-ac02-1a1b5dd3431a", "type": "standard", "code": "20150483", "issue_date": "2015-04-01",