mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
fixes
This commit is contained in:
parent
2c7bf4f44d
commit
144d52b444
@ -46,11 +46,11 @@ class ParseEDocument extends AbstractService
|
|||||||
|
|
||||||
// ZUGFERD - try to parse via Zugferd lib
|
// ZUGFERD - try to parse via Zugferd lib
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case $this->file->getExtension() == 'pdf':
|
case ($this->file->getExtension() == 'pdf' || $this->file->getMimeType() == 'application/pdf'):
|
||||||
case $this->file->getExtension() == 'xml' && stristr($this->file->get(), "urn:cen.eu:en16931:2017"):
|
case ($this->file->getExtension() == 'xml' || $this->file->getMimeType() == 'application/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' || $this->file->getMimeType() == 'application/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' || $this->file->getMimeType() == 'application/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"):
|
case ($this->file->getExtension() == 'xml' || $this->file->getMimeType() == 'application/xml') && stristr($this->file->get(), "urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_2.0"):
|
||||||
try {
|
try {
|
||||||
return (new ZugferdEDocument($this->file, $this->company))->run();
|
return (new ZugferdEDocument($this->file, $this->company))->run();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
@ -229,20 +229,20 @@ class InboundMailEngine
|
|||||||
if (!$expense->vendor_id && $expense_vendor)
|
if (!$expense->vendor_id && $expense_vendor)
|
||||||
$expense->vendor_id = $expense_vendor->id;
|
$expense->vendor_id = $expense_vendor->id;
|
||||||
|
|
||||||
|
if ($is_imported_by_parser)
|
||||||
|
$expense->saveQuietly();
|
||||||
|
else
|
||||||
|
$expense->save();
|
||||||
|
|
||||||
// save document only, when not imported by parser
|
// save document only, when not imported by parser
|
||||||
$documents = [];
|
$documents = [];
|
||||||
if ($is_imported_by_parser)
|
if (!$is_imported_by_parser)
|
||||||
array_push($documents, $document);
|
array_push($documents, $document);
|
||||||
|
|
||||||
// email document
|
// email document
|
||||||
if ($email->body_document !== null)
|
if ($email->body_document !== null)
|
||||||
array_push($documents, $email->body_document);
|
array_push($documents, $email->body_document);
|
||||||
|
|
||||||
if ($is_imported_by_parser)
|
|
||||||
$expense->saveQuietly();
|
|
||||||
else
|
|
||||||
$expense->save();
|
|
||||||
|
|
||||||
$this->saveDocuments($documents, $expense);
|
$this->saveDocuments($documents, $expense);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user