Skip to content

Commit b9564fe

Browse files
Merge pull request #708 from Dirksche/AvoidEmpty_PayeeBICID_WithVersion20
No empty `<ram:BICID/>` section with Version 20.
2 parents ea84e6c + 3676a7d commit b9564fe

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

ZUGFeRD/InvoiceDescriptor20Writer.cs

+7-4
Original file line numberDiff line numberDiff line change
@@ -674,10 +674,13 @@ public override void Save(InvoiceDescriptor descriptor, Stream stream, ZUGFeRDFo
674674
Writer.WriteOptionalElementString("ram", "ProprietaryID", creditorAccount.ID);
675675
Writer.WriteEndElement(); // !PayeePartyCreditorFinancialAccount
676676

677-
Writer.WriteStartElement("ram", "PayeeSpecifiedCreditorFinancialInstitution");
678-
Writer.WriteElementString("ram", "BICID", creditorAccount.BIC);
679-
Writer.WriteOptionalElementString("ram", "GermanBankleitzahlID", creditorAccount.Bankleitzahl);
680-
Writer.WriteEndElement(); // !PayeeSpecifiedCreditorFinancialInstitution
677+
if (!String.IsNullOrWhiteSpace(creditorAccount.BIC))
678+
{
679+
Writer.WriteStartElement("ram", "PayeeSpecifiedCreditorFinancialInstitution");
680+
Writer.WriteElementString("ram", "BICID", creditorAccount.BIC);
681+
Writer.WriteOptionalElementString("ram", "GermanBankleitzahlID", creditorAccount.Bankleitzahl);
682+
Writer.WriteEndElement(); // !PayeeSpecifiedCreditorFinancialInstitution
683+
}
681684
Writer.WriteEndElement(); // !SpecifiedTradeSettlementPaymentMeans
682685
}
683686

0 commit comments

Comments
 (0)