Skip to content

Commit

Permalink
Added CreditNote tag check for ns0
Browse files Browse the repository at this point in the history
Added a tag check for "<ns0:CreditNote"
  • Loading branch information
AlUllrich committed Feb 28, 2025
1 parent 45161f7 commit 853a583
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ZUGFeRD/InvoiceDescriptor22UblReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ public override InvoiceDescriptor Load(Stream stream)
XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.DocumentElement.OwnerDocument.NameTable);

if ((firstPartOfDocument.IndexOf("<CreditNote", StringComparison.OrdinalIgnoreCase) > -1) ||
(firstPartOfDocument.IndexOf("<ubl:CreditNote", StringComparison.OrdinalIgnoreCase) > -1))
(firstPartOfDocument.IndexOf("<ubl:CreditNote", StringComparison.OrdinalIgnoreCase) > -1) ||
(firstPartOfDocument.IndexOf("<ns0:CreditNote", StringComparison.OrdinalIgnoreCase) > -1))
{
isInvoice = false;
}
Expand Down Expand Up @@ -93,6 +94,10 @@ public override InvoiceDescriptor Load(Stream stream)
{
baseNode = doc.SelectSingleNode("/CreditNote", nsmgr);
}
if (baseNode == null)
{
baseNode = doc.SelectSingleNode("/ns0:CreditNote", nsmgr);
}
}

InvoiceDescriptor retval = new InvoiceDescriptor
Expand Down

0 comments on commit 853a583

Please sign in to comment.