Skip to content

Commit

Permalink
Fixing name in party
Browse files Browse the repository at this point in the history
  • Loading branch information
samlown committed Jul 19, 2024
1 parent 78dbc8a commit 66a9984
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 66a9984

Please sign in to comment.