### getYamlDirectory Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdSettings Get the directory where all the assets are stored. ```APIDOC ## getYamlDirectory ### Description Get the directory where all the assets are stored ### Method static ### Returns string ``` -------------------------------- ### getRootDirectory Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdSettings Get root directory. ```APIDOC ## getRootDirectory ### Description Get root directory ### Method static ### Returns string ``` -------------------------------- ### getAssetDirectory Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdSettings Get the directory where all the assets are stored. ```APIDOC ## getAssetDirectory ### Description Get the directory where all the assets are stored ### Method static ### Returns string ``` -------------------------------- ### Running Validation Source: https://github.com/horstoeko/zugferd/wiki/Validation Provides examples of how to initiate the validation process using the `validate` method. ```APIDOC ## Run Validation To start a validation, use the ``validate`` method ```php $document = ZugferdDocumentPdfReader::readAndGuessFromFile(dirname(__FILE__) . "/invoice.pdf"); $kositValidator = new ZugferdKositValidator($document) $kositValidator->validate(); ``` or ```php $document = ZugferdDocumentPdfReader::readAndGuessFromFile(dirname(__FILE__) . "/invoice.pdf"); $kositValidator = new ZugferdKositValidator() $kositValidator->setDocument($document)->validate(); ``` ``` -------------------------------- ### initNewDocument Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentBuilder Initializes a new Zugferd document with profile settings. This is the starting point for building a new document. ```APIDOC ## initNewDocument ### Description Initialized a new document with profile settings. ### Signature ```php public function initNewDocument(): \ZugferdDocumentBuilder { } ``` ### Returns Returns a value of type __\ZugferdDocumentBuilder__ ``` -------------------------------- ### Get Procuring Project Details - PHP Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentReader Retrieves details of a project reference using its ID and name. ```php public function getDocumentProcuringProject(?string $id, ?string $name): \ZugferdDocumentReader { } ``` -------------------------------- ### Get Source Directory (PHP) Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdSettings Retrieves the directory where all source files are stored. ```php public static function getSourceDirectory(): string { } ``` -------------------------------- ### Get Root Directory (PHP) Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdSettings Retrieves the root directory of the project. ```php public static function getRootDirectory(): string { } ``` -------------------------------- ### Get Document Billing Period Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentReader Retrieves the start and end dates of the billing period for the document. Use this to get detailed information on when the document's services or goods were billed. ```php public function getDocumentBillingPeriod(?DateTime $startDate, ?DateTime $endDate): ZugferdDocumentReader { } ``` -------------------------------- ### Example: Set Additional Creator Tool and Generate Document Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentPdfBuilder Demonstrates how to set an additional creator tool, generate the document, and save it. The creator information in the PDF will reflect both the library and the specified ERP solution. ```php // Before calling this method the creator of the PDF is identified as 'Factur-X library 1.x.x by HorstOeko'. // After calling this method you get 'MyERPSolution 1.0 / Factur-X PHP library 1.x.x by HorstOeko' as the creator $zugferdDocumentPdfBuilder = ZugferdDocumentPdfBuilder::fromPdfFile($zugferdDocumentBuilder, '/tmp/existingprintlayout.pdf'); $zugferdDocumentPdfBuilder->setAdditionalCreatorTool('MyERPSolution 1.0'); $zugferdDocumentPdfBuilder->generateDocument(); $zugferdDocumentPdfBuilder->saveDocument('/tmp/merged.pdf'); ``` -------------------------------- ### Create Validator from File Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdPdfValidator Instantiates a ZugferdPdfValidator from an existing PDF file. Requires a JAVA running setup. ```php public static function fromFile(string $pdfFilename): \ZugferdPdfValidator { } ``` -------------------------------- ### getDocumentPositionBillingPeriod Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentReader Gets information about the billing period relevant for an invoice item, also known as the invoice line delivery period. It accepts start and end dates for the period. ```APIDOC ## getDocumentPositionBillingPeriod ### Description Gets information about the billing period relevant for an invoice item, also known as the invoice line delivery period. It accepts start and end dates for the period. ### Method ```php public function getDocumentPositionBillingPeriod(?DateTime $startDate, ?DateTime $endDate): \ZugferdDocumentReader ``` ### Parameters #### Path Parameters - startDate (DateTime, nullable) - __BT-134, From BASIC__ Start of the billing period - endDate (DateTime, nullable) - __BT-135, From BASIC__ End of the billing period ### Returns Returns a value of type \ZugferdDocumentReader ``` -------------------------------- ### Instantiating ZugferdDocumentPdfMerger Source: https://github.com/horstoeko/zugferd/wiki/Merging-XML-and-PDF-Documents Demonstrates how to instantiate the ZugferdDocumentPdfMerger class with various combinations of file paths and data streams for XML and PDF. ```APIDOC ## Instantiating ZugferdDocumentPdfMerger ### Description Instantiate the `ZugferdDocumentPdfMerger` class by providing either file paths or data streams for the XML and PDF inputs. ### Constructor Parameters - **xml**: (string) A fully-qualified path to a valid XML file or the XML data stream. - **pdf**: (string) A fully-qualified path to a PDF file or a PDF data stream. ### Examples #### Using file paths: ```php $xmlFilename = '/path/to/existing/xml.xml'; $pdfFilename = '/path/to/existing/pdf.pdf'; $pdfMerger = new ZugferdDocumentPdfMerger($xmlFilename, $pdfFilename); ``` #### Using XML data stream and PDF file path: ```php $xmlData = '....'; $pdfFilename = '/path/to/existing/pdf.pdf'; $pdfMerger = new ZugferdDocumentPdfMerger($xmlData, $pdfFilename); ``` #### Using XML file path and PDF data stream: ```php $xmlFilename = '/path/to/existing/xml.xml'; $pdData = '%PDF-1.5.......'; $pdfMerger = new ZugferdDocumentPdfMerger($xmlFilename, $pdfData); ``` #### Using XML data stream and PDF data stream: ```php $xmlData = '....'; $pdData = '%PDF-1.5.......'; $pdfMerger = new ZugferdDocumentPdfMerger($xmlData, $pdfData); ``` ``` -------------------------------- ### Get XMP Meta Data Filename (PHP) Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdSettings Retrieves the configured filename for XMP meta data. Call this to get the current XMP filename. ```php public static function getXmpMetaDataFilename(): string { } ``` -------------------------------- ### Constructor (__construct) Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentPdfMerger Initializes the ZugferdDocumentPdfMerger with XML data and a PDF file or data. ```APIDOC ## __construct ### Summary _Constructor_ ### Signature ```php public function __construct(string $xmlDataOrFilename, string $pdfData): void { } ``` ### Parameters | Name | Type | Allows Null | Description | :------ | :------ | :-----: | :------ | xmlDataOrFilename | string | :x: |
The XML data as a string or the full qualified path to an XML-File
containing the XML-data | pdfData | string | :x: |
The full filename or a string containing the binary pdf data. This
is the original PDF (e.g. created by a ERP system) ``` -------------------------------- ### Get Invoicee Legal Organisation - PHP Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentReader Retrieves the legal organization details of the invoice recipient. Use this to get information like the legal ID, type, and name. ```php public function getDocumentInvoiceeLegalOrganisation( ?string $legalOrgId, ?string $legalOrgType, ?string $legalOrgName, ): ZugferdDocumentReader { } ``` -------------------------------- ### Get Seller Legal Organisation - PHP Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentReader Retrieves the legal organization details of the seller. Use this to get the seller's official registration ID, type, and name. ```php public function getDocumentSellerLegalOrganisation( ?string $legalOrgId, ?string $legalOrgType, ?string $legalOrgName, ): ZugferdDocumentReader { } ``` -------------------------------- ### Get Document Position Gross Price - PHP Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentReader Retrieves the unit price excluding sales tax before discount for an invoice item. Use this to get pricing information for line items. ```php public function getDocumentPositionGrossPrice( ?float $amount, ?float $basisQuantity, ?string $basisQuantityUnitCode, ): \ZugferdDocumentReader { } ``` -------------------------------- ### Initialize New Document Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentBuilder Initializes a new ZUGFeRD document builder instance with profile settings. ```php public function initNewDocument(): \ZugferdDocumentBuilder { } ``` -------------------------------- ### Get Seller Communication Information - PHP Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentReader Retrieves the seller's electronic communication details, such as URI scheme and URI. Use this to get contact endpoints like email or web addresses. ```php public function getDocumentSellerCommunication(?string $uriScheme, ?string $uri): ZugferdDocumentReader { } ``` -------------------------------- ### Configure Payment Details Source: https://context7.com/horstoeko/zugferd/llms.txt Sets up payment information, including direct debit details with IBAN and reference, and payment terms with a due date. ```php // 7. Payment $builder->addDocumentPaymentMeanToDirectDebit('DE12500105170648489890', 'INV-2024-0001'); $builder->addDocumentPaymentTerm('30 days net', \DateTime::createFromFormat('Ymd', '20250130')); ``` -------------------------------- ### Initialize ZugferdDocumentBuilder for XRECHNUNG 3 Profile Source: https://github.com/horstoeko/zugferd/wiki/Example-ZugferdDocumentBuilder-in-XRECHNUNG3-profile This snippet shows how to create a new document builder instance specifically configured for the XRECHNUNG 3 profile. Ensure the vendor autoloader is included. ```php use horstoeko\zugferd\codelists\ZugferdCountryCodes; use horstoeko\zugferd\codelists\ZugferdCurrencyCodes; use horstoeko\zugferd\codelists\ZugferdElectronicAddressScheme; use horstoeko\zugferd\codelists\ZugferdInvoiceType; use horstoeko\zugferd\codelists\ZugferdReferenceCodeQualifiers; use horstoeko\zugferd\codelists\ZugferdUnitCodes; use horstoeko\zugferd\codelists\ZugferdVatCategoryCodes; use horstoeko\zugferd\codelists\ZugferdVatTypeCodes; use horstoeko\zugferd\ZugferdDocumentBuilder; use horstoeko\zugferd\ZugferdProfiles; require __DIR__ . "/../vendor/autoload.php"; $documentBuilder = ZugferdDocumentBuilder::createNew(ZugferdProfiles::PROFILE_XRECHNUNG_3); ``` -------------------------------- ### getDocumentPositionQuantity Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentReader Get the position Quantity. ```APIDOC ## getDocumentPositionQuantity ### Description Get the position Quantity. ### Method public function getDocumentPositionQuantity(?float $billedQuantity, ?string $billedQuantityUnitCode, ?float $chargeFreeQuantity, ?string $chargeFreeQuantityUnitCpde, ?float $packageQuantity, ?string $packageQuantityUnitCode): \ZugferdDocumentReader ### Parameters #### Path Parameters - **billedQuantity** (float) - Optional - - **billedQuantityUnitCode** (string) - Optional - - **chargeFreeQuantity** (float) - Optional - - **chargeFreeQuantityUnitCpde** (string) - Optional - - **packageQuantity** (float) - Optional - - **packageQuantityUnitCode** (string) - Optional - ### Returns #### Success Response Returns a value of type __\ZugferdDocumentReader__ ``` -------------------------------- ### Initialize ZugferdDocumentBuilder Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentPdfBuilder Initializes a new ZugferdDocumentBuilder instance with a specified profile and sets basic document information. ```php use horstoeko\zugferd\codelists\ZugferdCurrencyCodes; use horstoeko\zugferd\codelists\ZugferdInvoiceType; use horstoeko\zugferd\ZugferdDocumentBuilder; use horstoeko\zugferd\ZugferdProfiles; // Build the XML using ZugferdDocumentBuilder $zugferdDocumentBuilder = ZugferdDocumentBuilder::CreateNew(ZugferdProfiles::PROFILE_EN16931); $zugferdDocumentBuilder ->setDocumentInformation('R-2024/00001', ZugferdInvoiceType::INVOICE, DateTime::createFromFormat('Ymd', '20241231'), ZugferdCurrencyCodes::EURO) ->...... ``` -------------------------------- ### Instantiate ZugferdDocumentPdfMerger with XML file and PDF file Source: https://github.com/horstoeko/zugferd/wiki/Merging-XML-and-PDF-Documents Use this constructor when you have the XML and PDF as separate files on the filesystem. Ensure the paths are fully qualified. ```php $xmlFilename = '/path/to/existing/xml.xml'; $pdfFilename = '/path/to/existing/pdf.pdf'; $pdfMerger = new ZugferdDocumentPdfMerger($xmlFilename, $pdfFilename) ``` -------------------------------- ### Create New Invoice in XRECHNUNG-Profile (Version 3.x) Source: https://github.com/horstoeko/zugferd/wiki/Example-ZugferdDocumentBuilder-in-XRECHNUNG3-profile Initialize a new ZugferdDocumentBuilder instance for the XRECHNUNG 3 profile. ```php $documentBuilder = ZugferdDocumentBuilder::createNew(ZugferdProfiles::PROFILE_XRECHNUNG_3); ``` -------------------------------- ### getSourceDirectory Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdSettings Get the directory where all the sources are stored. ```APIDOC ## getSourceDirectory ### Description Get the directory where all the sources are stored ### Method static ### Returns string ``` -------------------------------- ### Create and Configure ZugferdDocumentBuilder Source: https://context7.com/horstoeko/zugferd/llms.txt Initializes a new ZugferdDocumentBuilder instance for a specific profile (e.g., EN16931) and sets basic document information like invoice number, date, type, and currency. ```php use horstoeko\zugferd\ZugferdDocumentBuilder; use horstoeko\zugferd\ZugferdProfiles; use horstoeko\zugferd\codelists\ZugferdInvoiceType; use horstoeko\zugferd\codelists\ZugferdCurrencyCodes; // 1. Create a new builder for the EN16931 (Comfort) profile $builder = ZugferdDocumentBuilder::createNew(ZugferdProfiles::PROFILE_EN16931); // 2. Set document header information $builder->setDocumentInformation( 'INV-2024-0001', // BT-1: Invoice number ZugferdInvoiceType::INVOICE, // BT-3: Document type code \DateTime::createFromFormat('Ymd', '20241231'), // BT-2: Invoice date ZugferdCurrencyCodes::EURO // BT-5: Invoice currency ); // Optional: buyer routing ID (mandatory for XRechnung) $builder->setDocumentBuyerReference('ROUTE-12345'); // Optional: free-text note $builder->addDocumentNote('Payment due within 30 days.', null, 'AAI'); ``` -------------------------------- ### getDocumentPayeeGlobalId Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentReader Get global identifier of the payee party. ```APIDOC ## getDocumentPayeeGlobalId ### Description Get global identifier of the payee party. ### Method ```php public function getDocumentPayeeGlobalId(?array $globalID): ``` ### Parameters #### Path Parameters - **globalID** (array) - Optional - Array of global ids indexed by the identification scheme. ### Returns Returns a value of type \ZugferdDocumentReader ``` -------------------------------- ### Create New Invoice Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdQuickDescriptor Initializes a new invoice document with essential details like invoice number, date, and currency. An optional reference number can be provided. ```php public function doCreateInvoice( string $invoiceNo, DateTime $invoiceDate, string $currency, ?string $invoiceNoReference = null, ): \ZugferdQuickDescriptor { } ``` -------------------------------- ### getValidationDirectory Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdSettings Get the directory where all the validation files are located. ```APIDOC ## getValidationDirectory ### Description Get the directory where all the validation files are located ### Method static ### Returns string ``` -------------------------------- ### Set Document Buyer Details Source: https://github.com/horstoeko/zugferd/wiki/Example-ZugferdDocumentBuilder-in-EN16391-profile Configure the buyer's information including name, ID, address, contact person, and electronic communication details. ```php $documentBuilder->setDocumentBuyer('Kunden AG Mitte', 'GE2020211'); $documentBuilder->setDocumentBuyerAddress('Kundenstraße 15', '', '', '69876', 'Frankfurt', ZugferdCountryCodes::GERMANY); $documentBuilder->setDocumentBuyerContact('H. Meier', 'Einkauf', '+49-333-4444444', '+49-333-5555555', 'hm@kunde.de'); $documentBuilder->setDocumentBuyerCommunication(ZugferdElectronicAddressScheme::UNECE3155_EM, 'purchase@kunde.de'); ``` -------------------------------- ### getDocumentPositionNetPrice Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentReader Get detailed information on the net price of the item. ```APIDOC ## getDocumentPositionNetPrice ### Description Get detailed information on the net price of the item. ### Method public function getDocumentPositionNetPrice(?float $amount, ?float $basisQuantity, ?string $basisQuantityUnitCode): \ZugferdDocumentReader ### Parameters #### Path Parameters - **amount** (float) - Optional - BT-146, From BASIC__ Net price of the item - **basisQuantity** (float) - Optional - BT-149, From BASIC__ Base quantity at the item price - **basisQuantityUnitCode** (string) - Optional - BT-150, From BASIC__ Code of the unit of measurement of the base quantity at the item price ### Returns #### Success Response Returns a value of type __\ZugferdDocumentReader__ ``` -------------------------------- ### getDocumentPayeeLegalOrganisation Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentReader Get information about the legal organisation of the payee party. ```APIDOC ## getDocumentPayeeLegalOrganisation ### Description Get information about the legal organisation of the payee party. ### Method ```php public function getDocumentPayeeLegalOrganisation( ?string $legalOrgId, ?string $legalOrgType, ?string $legalOrgName, ): ``` ### Parameters #### Path Parameters - **legalOrgId** (string) - Optional - An identifier issued by an official registrar that identifies the party as a legal entity or legal person. If no identification scheme ($legalorgtype) is provided, it should be known to the buyer or seller party - **legalOrgType** (string) - Optional - The identifier for the identification scheme of the legal registration of the party. In particular, the following scheme codes are used: 0021 : SWIFT, 0088 : EAN, 0060 : DUNS, 0177 : ODETTE - **legalOrgName** (string) - Optional - A name by which the party is known, if different from the party's name (also known as the company name) ### Returns Returns a value of type \ZugferdDocumentReader ``` -------------------------------- ### Instantiate ZugferdDocumentPdfMerger with XML data and PDF file Source: https://github.com/horstoeko/zugferd/wiki/Merging-XML-and-PDF-Documents Use this constructor when you have the XML content as a string and the PDF as a file. The XML data should be a valid XML string. ```php $xmlData = '....'; $pdfFilename = '/path/to/existing/pdf.pdf'; $pdfMerger = new ZugferdDocumentPdfMerger($xmlData, $pdfFilename) ``` -------------------------------- ### getDocumentPayeeAddress Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentReader Get Detailed information on the address of the payee party. ```APIDOC ## getDocumentPayeeAddress ### Description Get Detailed information on the address of the payee party. ### Method ```php public function getDocumentPayeeAddress( ?string $lineOne, ?string $lineTwo, ?string $lineThree, ?string $postCode, ?string $city, ?string $country, ?array $subDivision, ): ``` ### Parameters #### Path Parameters - **lineOne** (string) - Optional - The main line in the party's address. This is usually the street name and house number or the post office box - **lineTwo** (string) - Optional - Line 2 of the party's address. This is an additional address line in an address that can be used to provide additional details in addition to the main line - **lineThree** (string) - Optional - Line 3 of the party's address. This is an additional address line in an address that can be used to provide additional details in addition to the main line - **postCode** (string) - Optional - Identifier for a group of properties, such as a zip code - **city** (string) - Optional - Usual name of the city or municipality in which the party's address is located - **country** (string) - Optional - Code used to identify the country. If no tax agent is specified, this is the country in which the sales tax is due. The lists of approved countries are maintained by the EN ISO 3166-1 Maintenance Agency “Codes for the representation of names of countries and their
subdivisions” - **subDivision** (array) - Optional - The party's state ### Returns Returns a value of type \ZugferdDocumentReader ``` -------------------------------- ### Set Buyer Information - PHP Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdQuickDescriptor Set detailed information about the buyer, including name, address, and optional references or IDs. All address fields are mandatory. ```php public function doSetBuyer( string $name, string $postcode, string $city, string $street, string $country, ?string $buyerReference = null, ?string $id = null, ?string $globalID = null, ?string $globalIDscheme = null, ): ZugferdQuickDescriptor { } ``` -------------------------------- ### getDocumentUltimateShipTo Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentReader Get detailed information on the different end recipient. ```APIDOC ## getDocumentUltimateShipTo ### Description Get detailed information on the different end recipient. ### Method public function getDocumentUltimateShipTo(?string $name, ?array $id, ?string $description): ### Parameters #### Path Parameters - **name** (string) - Optional - BT-X-165, From EXTENDED__ Name or company name of the different end recipient - **id** (array) - Optional - __BT-X-162, From EXTENDED__ An array of identifiers - **description** (string) - Optional - Further legal information that is relevant for the different end recipient ### Returns Returns a value of type __ZugferdDocumentReader__ ``` -------------------------------- ### Adding Seller Information in Correct Order Source: https://github.com/horstoeko/zugferd/wiki/Creating-XML-Documents This example shows the correct order of operations, calling `setDocumentSeller` before `addDocumentSellerGlobalId`. This ensures that the seller's details, including their ID, name, address, and contact information, are properly included in the generated XML. ```php $document = ZugferdDocumentBuilder::CreateNew(ZugferdProfiles::PROFILE_EN16931); $document ->setDocumentInformation("471102", "380", \DateTime::createFromFormat("Ymd", "20180305"), "EUR") ->setDocumentSeller("Lieferant GmbH", "549910") ->addDocumentSellerGlobalId("4000001123452", "0088") ->addDocumentSellerTaxRegistration("FC", "201/113/40209") ->addDocumentSellerTaxRegistration("VA", "DE123456789") ->setDocumentSellerAddress("Lieferantenstraße 20", "", "", "80333", "München", "DE") ->setDocumentSellerContact("Heinz Mükker", "Buchhaltung", "+49-111-2222222", "+49-111-3333333","info@lieferant.de") ->writeFile(dirname(__FILE__) . "/factur-x.xml"); ``` ```xml urn:cen.eu:en16931:2017 471102 380 20180305 549910 4000001123452 Lieferant GmbH Heinz Mükker Buchhaltung +49-111-2222222 info@lieferant.de 80333 ``` -------------------------------- ### Run Validation with Document Instance Source: https://github.com/horstoeko/zugferd/wiki/Validation Initiate the validation process by providing a ZugferdDocument instance directly to the validate method. This is an alternative to setting the document beforehand. ```php $document = ZugferdDocumentPdfReader::readAndGuessFromFile(dirname(__FILE__) . "/invoice.pdf"); $kositValidator = new ZugferdKositValidator($document) $kositValidator->validate(); ``` -------------------------------- ### getFullIccProfileFilename Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdSettings Get the full filename of the ICC profile to use. ```APIDOC ## getFullIccProfileFilename ### Description Get the full filename of the ICC profile to use ### Method static ### Returns string ``` -------------------------------- ### Configure Payment Means and Terms Source: https://github.com/horstoeko/zugferd/wiki/Example-ZugferdDocumentBuilder-in-EN16391-profile Sets up payment details, including direct debit information with mandate references and specific payment terms with due dates. This ensures correct payment processing and reconciliation. ```php $documentBuilder->addDocumentPaymentMeanToDirectDebit('DE12500105170648489890', 'R-2024/00001'); $documentBuilder->addDocumentPaymentTerm('Wird von Konto DE12500105170648489890 abgebucht', DateTime::createFromFormat('Ymd', '20250131'), 'MANDATE-2024/000001'); ``` -------------------------------- ### getXsltDirectory Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdSettings Get the directory where all the stylesheets (XSLT) files are located. ```APIDOC ## getXsltDirectory ### Description Get the directory where all the stylesheets (XSLT) files are located ### Method static ### Returns string ``` -------------------------------- ### doCreateNew Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdQuickDescriptor Creates a new ZugferdDocumentBuilder instance with the EN16931 profile. ```APIDOC ## doCreateNew ### Description Creates a new ZugferdDocumentBuilder with profile EN16931. ### Method `static` ### Returns Returns a value of type `\ZugferdQuickDescriptor` ``` -------------------------------- ### getSchematronDirectory Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdSettings Get the directory where all the stylesheets (XSLT) files are located. ```APIDOC ## getSchematronDirectory ### Description Get the directory where all the stylesheets (XSLT) files are located ### Method static ### Returns string ``` -------------------------------- ### Create ZugferdDocumentPdfBuilder from PDF File Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentPdfBuilder Initializes a ZugferdDocumentPdfBuilder instance using an existing PDF file as a base. This is a static method. ```php public static function fromPdfFile( horstoeko\zugferd\ZugferdDocumentBuilder $documentBuilder, string $pdfFileName, ): void { } ``` -------------------------------- ### getSchemaDirectory Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdSettings Get the directory where all the schema (XSD) files are located. ```APIDOC ## getSchemaDirectory ### Description Get the directory where all the schema (XSD) files are located ### Method static ### Returns string ``` -------------------------------- ### getDocumentPayeeTaxRegistration Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentReader Get detailed information on tax details of the payee party. ```APIDOC ## getDocumentPayeeTaxRegistration ### Description Get detailed information on tax details of the payee party. ### Method ```php public function getDocumentPayeeTaxRegistration(?array $taxReg): ``` ### Parameters #### Path Parameters - **taxReg** (array) - Optional - Array of tax numbers indexed by the schemeid (VA, FC, etc.) ### Returns Returns a value of type \ZugferdDocumentReader ``` -------------------------------- ### Download PDF as String Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentPdfBuilder Generates the PDF invoice and returns its binary content as a string, suitable for direct download or further processing. ```php use horstoeko\zugferd\ZugferdDocumentPdfBuilder; // Alternatively, you can also return the merged output as a content stream (string) $zugferdDocumentPdfBuilder = ZugferdDocumentPdfBuilder::fromPdfFile($zugferdDocumentBuilder, '/tmp/existingprintlayout.pdf'); $zugferdDocumentPdfBuilder->generateDocument(); $pdfBinaryString = $zugferdDocumentPdfBuilder->generateDocument()->downloadString(); ``` -------------------------------- ### getDocumentUltimateShipToGlobalId Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentReader Get global identifiers of the different end recipient party. ```APIDOC ## getDocumentUltimateShipToGlobalId ### Description Get global identifiers of the different end recipient party. ### Method public function getDocumentUltimateShipToGlobalId(?array $globalID): ### Parameters #### Path Parameters - **globalID** (array) - Optional - __BT-X-163/BT-X-163-0, From EXTENDED__ Array of global ids indexed by the identification scheme. ### Returns Returns a value of type __ZugferdDocumentReader__ ``` -------------------------------- ### Create New Credit Memo Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdQuickDescriptor Initializes a new credit memo document with its number, date, currency, and an optional reference number for the refund. ```php public function doCreateCreditMemo( string $creditMemoNo, DateTime $invoiceDate, string $currency, string $creditMemoNoReference = '', ): \ZugferdQuickDescriptor { } ``` -------------------------------- ### getDocumentRoutingId Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentReader Gets the routing-id, which is needed for German XRechnung. This is an alias for getDocumentBuyerReference. ```APIDOC ## getDocumentRoutingId ### Description Get the routing-id (needed for German XRechnung). This is an alias-method for getDocumentBuyerReference. ### Method getDocumentRoutingId ### Parameters #### Path Parameters - **routingId** (string) - Required - The routing identifier. ### Returns Returns a value of type \ZugferdDocumentReader ``` -------------------------------- ### Instantiate ZugferdDocumentPdfMerger with XML file and PDF data Source: https://github.com/horstoeko/zugferd/wiki/Merging-XML-and-PDF-Documents Use this constructor when you have the XML as a file and the PDF content as a string. The PDF data should be a valid PDF string. ```php $xmlFilename = '/path/to/existing/xml.xml'; $pdData = '%PDF-1.5.......'; $pdfMerger = new ZugferdDocumentPdfMerger($xmlFilename, $pdData) ``` -------------------------------- ### getDocumentBuyerReference Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentReader Gets the identifier assigned by the buyer for internal routing purposes. ```APIDOC ## getDocumentBuyerReference ### Description Get the identifier assigned by the buyer and used for internal routing. ### Method getDocumentBuyerReference ### Parameters #### Path Parameters - **buyerReference** (string) - Optional - BT-10, From MINIMUM. An identifier assigned by the buyer and used for internal routing ### Returns Returns a value of type \ZugferdDocumentReader ``` -------------------------------- ### Create PDF with Existing Binary Content Source: https://github.com/horstoeko/zugferd/wiki/Creating-PDF-Documents Instantiate ZugferdDocumentPdfBuilder with the binary content of an existing PDF. This allows attaching XML to PDFs loaded from memory. ```php $pdfContent = file_get_contents('/path/to/existing/pdf.pdf'); $pdfDocument = new ZugferdDocumentPdfBuilder($document, $pdfContent); ``` -------------------------------- ### Set Specified Procuring Project in PHP Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdQuickDescriptor Sets details of a project reference. Requires a project ID and name as strings. ```php public function doSetSpecifiedProcuringProject(string $id, string $name): ZugferdQuickDescriptor { } ``` -------------------------------- ### getFullXmpMetaDataFilename Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdSettings Get the full filename containing the XNP information to use. ```APIDOC ## getFullXmpMetaDataFilename ### Description Get the full filename containg the XNP information to user ### Method static ### Returns string ``` -------------------------------- ### Merge Existing PDF with XML String Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentPdfMerger This example demonstrates merging an existing PDF file with XML data provided as a string. It requires the PDF file to exist. ```php use horstoeko\zugferd\ZugferdDocumentPdfMerger; $xmlString= "..."; $existingPdfFile = "/tmp/emptypdf.pdf"; $mergeToPdf = "/tmp/fullpdf.pdf"; if (!file_exists($existingPdfFile)) { throw new \Exception("XML and/or PDF does not exist"); } (new ZugferdDocumentPdfMerger($xmlString, $existingPdfFile)) ->generateDocument() ->saveDocument($mergeToPdf); ``` -------------------------------- ### Get Validation Information Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdKositValidator Returns an array containing all validation information. ```php public function getValidationInformation(): array { } ``` -------------------------------- ### Merge PDF String with XML String Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentPdfMerger This example shows how to merge a PDF provided as a string with XML data also provided as a string. No file existence checks are needed for this combination. ```php use horstoeko\zugferd\ZugferdDocumentPdfMerger; $xmlString= "..."; $pdfString = "%PDF-1.4....."; $mergeToPdf = "/tmp/fullpdf.pdf"; (new ZugferdDocumentPdfMerger($xmlString, $pdfString)) ->generateDocument() ->saveDocument($mergeToPdf); ``` -------------------------------- ### Get Document Content as String Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentBuilder Retrieves the content of the CrossIndustryInvoice object as a string. ```php public function getContent(): string { } ``` -------------------------------- ### getDocumentUltimateShipToAddress Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdDocumentReader Get detailed information on the address of the different end recipient party. ```APIDOC ## getDocumentUltimateShipToAddress ### Description Get detailed information on the address of the different end recipient party. ### Method public function getDocumentUltimateShipToAddress(?string $lineOne, ?string $lineTwo, ?string $lineThree, ?string $postCode, ?string $city, ?string $country, ?array $subDivision): ### Parameters #### Path Parameters - **lineOne** (string) - Optional - __BT-X-173, From EXTENDED__ The main line in the party's address. This is usually the street name and house number or the post office box. For major customer addresses, this field must be filled with "-". - **lineTwo** (string) - Optional - __BT-X-174, From EXTENDED__ Line 2 of the party's address. This is an additional address line in an address that can be used to provide additional details in addition to the main line - **lineThree** (string) - Optional - __BT-X-175, From EXTENDED__ Line 3 of the party's address. This is an additional address line in an address that can be used to provide additional details in addition to the main line - **postCode** (string) - Optional - __BT-X-172, From EXTENDED__ Identifier for a group of properties, such as a zip code - **city** (string) - Optional - __BT-X-176, From EXTENDED__ Usual name of the city or municipality in which the party's address is located - **country** (string) - Optional - __BT-X-177, From EXTENDED__ Code used to identify the country. If no tax agent is specified, this is the country in which the sales tax is due. The lists of approved countries are maintained by the EN ISO 3166-1 Maintenance Agency “Codes for the representation of names of countries and their subdivisions” - **subDivision** (array) - Optional - __BT-X-178, From EXTENDED__ The party's state ### Returns Returns a value of type __ZugferdDocumentReader__ ``` -------------------------------- ### setBaseDirectory Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdPdfValidator Sets the base directory where files will be downloaded and created. ```APIDOC ## setBaseDirectory ### Description Setup the base directory. In the base directory all files will be downloaded and created. ### Method `public function setBaseDirectory(string $newBaseDirectory): ZugferdPdfValidator` ### Parameters #### Path Parameters - **newBaseDirectory** (string) - Required - The path to the base directory. ``` -------------------------------- ### Get Validation Directory (PHP) Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdSettings Retrieves the directory where all validation files are located. ```php public static function getValidationDirectory(): string { } ``` -------------------------------- ### Get Asset Directory (PHP) Source: https://github.com/horstoeko/zugferd/wiki/Class-ZugferdSettings Retrieves the directory where all asset files are stored. ```php public static function getAssetDirectory(): string { } ``` -------------------------------- ### Create PDF from Existing File Source: https://github.com/horstoeko/zugferd/blob/master/make/md/ZugferdDocumentPdfBuilder.md Generates a PDF document by merging Zugferd XML data with an existing PDF template file. The merged PDF is then saved to a specified path. ```php use horstoeko\zugferd\codelists\ZugferdCurrencyCodes; use horstoeko\zugferd\codelists\ZugferdInvoiceType; use horstoeko\zugferd\ZugferdDocumentBuilder; use horstoeko\zugferd\ZugferdDocumentPdfBuilderAbstract; use horstoeko\zugferd\ZugferdDocumentPdfBuilder; use horstoeko\zugferd\ZugferdProfiles; // Build the XML using ZugferdDocumentBuilder $zugferdDocumentBuilder = ZugferdDocumentBuilder::CreateNew(ZugferdProfiles::PROFILE_EN16931); $zugferdDocumentBuilder ->setDocumentInformation('R-2024/00001', ZugferdInvoiceType::INVOICE, DateTime::createFromFormat('Ymd', '20241231'), ZugferdCurrencyCodes::EURO) ->...... // Create a PDF using the XML content from ZugferdDocumentBuilder and an existing print-output file $zugferdDocumentPdfBuilder = ZugferdDocumentPdfBuilder::fromPdfFile($zugferdDocumentBuilder, '/tmp/existingprintlayout.pdf'); $zugferdDocumentPdfBuilder->generateDocument(); $zugferdDocumentPdfBuilder->saveDocument('/tmp/merged.pdf'); ```