document instanceof PurchaseOrder) ? $this->document->vendor : $this->document->client; $e_document_type = strlen($settings_entity->getSetting('e_invoice_type')) > 2 ? $settings_entity->getSetting('e_invoice_type') : "XInvoice_3_0"; $e_quote_type = strlen($settings_entity->getSetting('e_quote_type')) > 2 ? $settings_entity->getSetting('e_quote_type') : "OrderX_Extended"; if ($this->document instanceof Invoice){ switch ($e_document_type) { case "EN16931": case "XInvoice_3_0": case "XInvoice_2_3": case "XInvoice_2_2": case "XInvoice_2_1": case "XInvoice_2_0": case "XInvoice_1_0": case "XInvoice-Extended": case "XInvoice-BasicWL": case "XInvoice-Basic": $xml = (new CreateEDocument($this->document))->handle(); (new ZugferdDocumentPdfBuilder($xml, $this->pdf_file))->generateDocument()->saveDocument($mergeToPdf); return $mergeToPdf; default: return $this->pdf_file; } } else{ return $this->pdf_file; } } }