Added list of known names of XML invoice attachment files

This commit is contained in:
dankito 2024-11-22 21:13:01 +01:00
parent 0f97b8dae9
commit 3418ab9b0f
1 changed files with 7 additions and 0 deletions

View File

@ -10,6 +10,13 @@ open class EInvoiceReader(
protected open val mapper: MustangMapper = MustangMapper() protected open val mapper: MustangMapper = MustangMapper()
) { ) {
companion object {
val KnownEInvoiceXmlAttachmentNames = listOf(
"factur-x.xml", "zugferd-invoice.xml", "xrechnung.xml" // also "ZUGFeRD-invoice.xml" is found but we make compare case insensitive anyway
)
}
open fun extractFromXml(xmlFile: File) = extractFromXml(xmlFile.inputStream()) open fun extractFromXml(xmlFile: File) = extractFromXml(xmlFile.inputStream())
open fun extractFromXml(stream: InputStream) = extractFromXml(stream.reader().readText()) open fun extractFromXml(stream: InputStream) = extractFromXml(stream.reader().readText())