Last active
November 10, 2020 10:12
-
-
Save bjoerntx/c72cfbadc2b8ee29899ccfa806effbeb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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