Skip to content

Commit

Permalink
Merge pull request #236 from drocx/feature/xrechnung_v3_warnings
Browse files Browse the repository at this point in the history
If the ram:ID is not set for the Seller or Buyer Party, an empty tag is no longer written
  • Loading branch information
stephanstapel authored Feb 17, 2024
2 parents e5e0c5c + db7b58d commit 27e2bd5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ZUGFeRD/InvoiceDescriptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ public void AddNote(string note, SubjectCodes subjectCode = SubjectCodes.Unknown
} // !AddNote()


public void SetBuyer(string name, string postcode, string city, string street, CountryCodes country, string id,
public void SetBuyer(string name, string postcode, string city, string street, CountryCodes country, string id = null,
GlobalID globalID = null, string receiver = "", LegalOrganization legalOrganization = null)
{
this.Buyer = new Party()
Expand All @@ -498,7 +498,7 @@ public void SetBuyer(string name, string postcode, string city, string street, C
}


public void SetSeller(string name, string postcode, string city, string street, CountryCodes country, string id,
public void SetSeller(string name, string postcode, string city, string street, CountryCodes country, string id = null,
GlobalID globalID = null, LegalOrganization legalOrganization = null)
{
this.Seller = new Party()
Expand Down
2 changes: 1 addition & 1 deletion ZUGFeRD/InvoiceDescriptor21Writer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,7 @@ private void _writeOptionalParty(ProfileAwareXmlTextWriter writer, PartyTypes pa
writer.WriteValue(party.ID.ID);
writer.WriteEndElement();
}
else
else if (!String.IsNullOrEmpty(party.ID.ID))
{
writer.WriteElementString("ram:ID", party.ID.ID);
}
Expand Down

0 comments on commit 27e2bd5

Please sign in to comment.