Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanstapel committed Jan 10, 2025
2 parents cf2858b + d4376bd commit 92844da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion ZUGFeRD/InvoiceDescriptor22UBLWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,6 @@ private void _WriteTradeLineItem(TradeLineItem tradeLineItem)
Writer.WriteEndElement(); //!SellersItemIdentification
}

_writeApplicableProductCharacteristics(Writer, tradeLineItem.ApplicableProductCharacteristics);
_writeIncludedReferencedProducts(Writer, tradeLineItem.IncludedReferencedProducts);
_WriteCommodityClassification(Writer, tradeLineItem.GetDesignatedProductClassifications());

Expand All @@ -610,6 +609,8 @@ private void _WriteTradeLineItem(TradeLineItem tradeLineItem)

Writer.WriteEndElement();// !ClassifiedTaxCategory

_writeApplicableProductCharacteristics(Writer, tradeLineItem.ApplicableProductCharacteristics);

Writer.WriteEndElement(); //!Item

Writer.WriteStartElement("cac", "Price"); // BG-29
Expand Down
8 changes: 4 additions & 4 deletions ZUGFeRD/InvoiceDescriptor23CIIWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public override void Save(InvoiceDescriptor descriptor, Stream stream, ZUGFeRDFo

#region BuyerOrderReferencedDocument (Comfort, Extended, XRechnung)
//Detailangaben zur zugehörigen Bestellung
if (tradeLineItem.BuyerOrderReferencedDocument != null)
if (tradeLineItem.BuyerOrderReferencedDocument != null && (!string.IsNullOrWhiteSpace(tradeLineItem.BuyerOrderReferencedDocument.LineID) || descriptor.Profile == Profile.Extended))
{
Writer.WriteStartElement("ram", "BuyerOrderReferencedDocument", Profile.Comfort | Profile.Extended | Profile.XRechnung1 | Profile.XRechnung);

Expand Down Expand Up @@ -430,7 +430,7 @@ public override void Save(InvoiceDescriptor descriptor, Stream stream, ZUGFeRDFo

if (tradeLineItem.DeliveryNoteReferencedDocument != null)
{
Writer.WriteStartElement("ram", "DeliveryNoteReferencedDocument", ALL_PROFILES ^ (Profile.XRechnung1 | Profile.XRechnung)); // this violates CII-SR-175 for XRechnung 3
Writer.WriteStartElement("ram", "DeliveryNoteReferencedDocument", Profile.Extended); // this violates CII-SR-175 for XRechnung 3
Writer.WriteOptionalElementString("ram", "IssuerAssignedID", tradeLineItem.DeliveryNoteReferencedDocument.ID);

if (tradeLineItem.DeliveryNoteReferencedDocument.IssueDateTime.HasValue)
Expand Down Expand Up @@ -657,7 +657,7 @@ public override void Save(InvoiceDescriptor descriptor, Stream stream, ZUGFeRDFo
Writer.WriteElementString("ram", "IssuerAssignedID", this.Descriptor.OrderNo);
if (this.Descriptor.OrderDate.HasValue)
{
Writer.WriteStartElement("ram", "FormattedIssueDateTime", ALL_PROFILES ^ (Profile.XRechnung1 | Profile.XRechnung));
Writer.WriteStartElement("ram", "FormattedIssueDateTime", Profile.Extended);
Writer.WriteStartElement("qdt", "DateTimeString");
Writer.WriteAttributeString("format", "102");
Writer.WriteValue(_formatDate(this.Descriptor.OrderDate.Value));
Expand Down Expand Up @@ -756,7 +756,7 @@ public override void Save(InvoiceDescriptor descriptor, Stream stream, ZUGFeRDFo
#region DeliveryNoteReferencedDocument
if (this.Descriptor.DeliveryNoteReferencedDocument != null)
{
Writer.WriteStartElement("ram", "DeliveryNoteReferencedDocument");
Writer.WriteStartElement("ram", "DeliveryNoteReferencedDocument", Profile.Extended);
Writer.WriteElementString("ram", "IssuerAssignedID", this.Descriptor.DeliveryNoteReferencedDocument.ID);

if (this.Descriptor.DeliveryNoteReferencedDocument.IssueDateTime.HasValue)
Expand Down

0 comments on commit 92844da

Please sign in to comment.