Skip to content

Commit

Permalink
Merge pull request #33 from invopop/party-fix
Browse files Browse the repository at this point in the history
Fixing name in party
  • Loading branch information
samlown authored Jul 19, 2024
2 parents 78dbc8a + 66a9984 commit 90593ff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 1 addition & 2 deletions parties.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ type Profile struct {
// Name of the organization
Name string `xml:"Denominazione,omitempty"`
// Natural person's first or given name if no "Denominazione" is provided
Given string `xml:"Name,omitempty"`
Given string `xml:"Nome,omitempty"`
// Surname of the person
Surname string `xml:"Cognome,omitempty"`
// Title of the person
Expand Down Expand Up @@ -147,7 +147,6 @@ func newProfile(party *org.Party) *Profile {
// not a company
if len(party.People) > 0 {
name := party.People[0].Name

return &Profile{
Given: name.Given,
Surname: name.Surname,
Expand Down
8 changes: 8 additions & 0 deletions test/data/invoice-hotel-private.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@
"tax_id": {
"country": "GB"
},
"people": [
{
"name": {
"given": "John",
"surname": "Doe"
}
}
],
"addresses": [
{
"num": "23",
Expand Down

0 comments on commit 90593ff

Please sign in to comment.