document->client->locale()); /* Set customized translations _NOW_ */ $t->replace(Ninja::transformTranslations($this->document->client->getMergedSettings())); $e_document_type = $this->document->client->getSetting('e_invoice_type'); 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": $zugferd = (new ZugferdEDokument($this->document))->run(); return $this->returnObject ? $zugferd->xdocument : $zugferd->getXml(); case "Facturae_3.2": case "Facturae_3.2.1": case "Facturae_3.2.2": return (new FacturaEInvoice($this->document, str_replace("Facturae_", "", $e_document_type)))->run(); default: $zugferd = (new ZugferdEDokument($this->document))->run(); return $this->returnObject ? $zugferd : $zugferd->getXml(); } } elseif ($this->document instanceof Quote){ 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": $zugferd = (new ZugferdEDokument($this->document))->run(); return $this->returnObject ? $zugferd->xdocument : $zugferd->getXml(); default: $zugferd = (new ZugferdEDokument($this->document))->run(); return $this->returnObject ? $zugferd : $zugferd->getXml(); } } elseif ($this->document instanceof PurchaseOrder){ switch ($e_document_type){ // No supported implementation yet. default: return ""; } } elseif ($this->document instanceof Credit) { 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": $zugferd = (new ZugferdEDokument($this->document))->run(); return $this->returnObject ? $zugferd->xdocument : $zugferd->getXml(); default: $zugferd = (new ZugferdEDokument($this->document))->run(); return $this->returnObject ? $zugferd : $zugferd->getXml(); } } else{ return ""; } } }