Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion delivery_parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ func (ui *Invoice) goblAddDelivery(out *bill.Invoice) error {
}
}

if ui.DeliveryTerms != nil {
// Terms with no ID carry only free text, and an identity with no code fails
// validation.
if ui.DeliveryTerms != nil && ui.DeliveryTerms.ID != "" {
d.Identities = []*org.Identity{
{
Code: cbc.Code(ui.DeliveryTerms.ID),
Expand Down
22 changes: 14 additions & 8 deletions party_parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,23 @@ func goblParty(party *Party, o *options) *org.Party {

if party.Contact != nil {
if party.Contact.Telephone != nil {
p.Telephones = []*org.Telephone{
{
Number: cleanString(*party.Contact.Telephone),
},
number := cleanString(*party.Contact.Telephone)
if number != "" {
p.Telephones = []*org.Telephone{
{
Number: number,
},
}
}
}
if party.Contact.ElectronicMail != nil {
p.Emails = []*org.Email{
{
Address: cleanString(*party.Contact.ElectronicMail),
},
address := cleanString(*party.Contact.ElectronicMail)
if address != "" {
p.Emails = []*org.Email{
{
Address: address,
},
}
}
Comment thread
CarlosMari marked this conversation as resolved.
}
}
Expand Down
Loading