Skip to content

Commit

Permalink
Correction for SpecifiedPaymentTerms reading
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanstapel committed Jan 9, 2025
1 parent 339d7ef commit a9ebbf3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions ZUGFeRD.Test/ZUGFeRD22Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2922,5 +2922,17 @@ public void TestInNonDebitInvoiceTheDirectDebitFieldsShouldNotExist()
Assert.IsFalse(content.Contains($"<ram:DirectDebitMandateID>REF A-123</ram:DirectDebitMandateID>"));
}
} // !TestInNonDebitInvoiceTheDirectDebitFieldsShouldNotExist()


[TestMethod]
public void TestDueDate()
{
string path = @"..\..\..\..\documentation\zugferd23en\Examples\2. BASIC\BASIC_Einfach\factur-x.xml";
path = _makeSurePathIsCrossPlatformCompatible(path);

InvoiceDescriptor desc = InvoiceDescriptor.Load(path);
Assert.IsTrue(desc.GetTradePaymentTerms().First().DueDate.HasValue);
Assert.AreEqual(new DateTime(2024, 12, 15), desc.GetTradePaymentTerms().First().DueDate.Value);
} // !TestDueDate()
}
}
2 changes: 1 addition & 1 deletion ZUGFeRD/InvoiceDescriptor23CIIReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ public override InvoiceDescriptor Load(Stream stream)
(PaymentTermsType?)null;

retval.AddTradePaymentTerms(XmlUtils.NodeAsString(node, ".//ram:Description", nsmgr),
XmlUtils.NodeAsDateTime(node, ".//ram:DueDateDateTime", nsmgr),
XmlUtils.NodeAsDateTime(node, ".//ram:DueDateDateTime/udt:DateTimeString", nsmgr),
paymentTermsType,
discountDueDays ?? penaltyDueDays,
discountPercent ?? penaltyPercent,
Expand Down

0 comments on commit a9ebbf3

Please sign in to comment.