1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-15 07:33:04 +01:00

readd case

This commit is contained in:
paulwer 2024-06-23 09:36:54 +02:00
parent e3da9914ba
commit 682d4883ff

View File

@ -42,7 +42,14 @@ class ParseEDocument extends AbstractService
// try to parse via Zugferd lib // try to parse via Zugferd lib
$zugferd_exception = null; $zugferd_exception = null;
try { try {
$expense = (new ZugferdEDocument($this->file))->run(); switch (true) {
case $this->file->getExtension() == 'pdf':
case $this->file->getExtension() == 'xml' && stristr($this->file->get(), "urn:cen.eu:en16931:2017"):
case $this->file->getExtension() == 'xml' && stristr($this->file->get(), "urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0"):
case $this->file->getExtension() == 'xml' && stristr($this->file->get(), "urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_2.1"):
case $this->file->getExtension() == 'xml' && stristr($this->file->get(), "urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_2.0"):
$expense = (new ZugferdEDocument($this->file))->run();
}
} catch (Exception $e) { } catch (Exception $e) {
$zugferd_exception = $e; $zugferd_exception = $e;
} }