Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Last active November 10, 2020 10:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/c72cfbadc2b8ee29899ccfa806effbeb to your computer and use it in GitHub Desktop.
Save bjoerntx/c72cfbadc2b8ee29899ccfa806effbeb to your computer and use it in GitHub Desktop.
private bool IsValidZUGFeRD(InvoiceDescriptor invoice, Lines pdfInvoice) {
// add key values to a list for validation
List<string> validationValues = new List<string>();
validationValues.Add(invoice.TaxTotalAmount.ToString(new CultureInfo("de-DE")));
validationValues.Add(invoice.GrandTotalAmount.ToString(new CultureInfo("de-DE")));
validationValues.Add(invoice.InvoiceNo);
// check, if key values exist in visible PDF
foreach (string value in validationValues) {
if (pdfInvoice.Find(value).Count == 0)
return false;
}
// all good
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment