{"id":15296439,"url":"https://github.com/horstoeko/orderx","last_synced_at":"2025-04-13T19:32:05.125Z","repository":{"id":65108957,"uuid":"575729940","full_name":"horstoeko/orderx","owner":"horstoeko","description":"Order-X Library","archived":false,"fork":false,"pushed_at":"2024-10-22T03:28:22.000Z","size":3872,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-22T20:54:42.279Z","etag":null,"topics":["cross-industry-order","order-x","php","php7","php8","uncefact"],"latest_commit_sha":null,"homepage":"https://github.com/horstoeko/orderx","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/horstoeko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-08T07:00:07.000Z","updated_at":"2024-10-22T03:25:00.000Z","dependencies_parsed_at":"2023-02-12T13:18:12.572Z","dependency_job_id":"59f4b83e-4571-47cb-9b65-96133b3e80e7","html_url":"https://github.com/horstoeko/orderx","commit_stats":{"total_commits":135,"total_committers":2,"mean_commits":67.5,"dds":0.007407407407407418,"last_synced_commit":"5bef353aa18fa08230a44a1487071ddfec9836bc"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/horstoeko%2Forderx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/horstoeko%2Forderx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/horstoeko%2Forderx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/horstoeko%2Forderx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/horstoeko","download_url":"https://codeload.github.com/horstoeko/orderx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248768001,"owners_count":21158569,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cross-industry-order","order-x","php","php7","php8","uncefact"],"created_at":"2024-09-30T18:10:30.099Z","updated_at":"2025-04-13T19:32:02.650Z","avatar_url":"https://github.com/horstoeko.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Order-X\n\n[![Latest Stable Version](https://img.shields.io/packagist/v/horstoeko/orderx.svg?style=plastic)](https://packagist.org/packages/horstoeko/orderx)\n[![PHP version](https://img.shields.io/packagist/php-v/horstoeko/orderx.svg?style=plastic)](https://packagist.org/packages/horstoeko/orderx)\n[![License](https://img.shields.io/packagist/l/horstoeko/orderx.svg?style=plastic)](https://packagist.org/packages/horstoeko/orderx)\n\n[![Build Status](https://github.com/horstoeko/orderx/actions/workflows/build.ci.yml/badge.svg)](https://github.com/horstoeko/orderx/actions/workflows/build.ci.yml)\n[![Release Status](https://github.com/horstoeko/orderx/actions/workflows/build.release.yml/badge.svg)](https://github.com/horstoeko/orderx/actions/workflows/build.release.yml)\n\nA simple Order-X Library\n\nWith `horstoeko/orderx` you can read and write xml files containing electronic orders data in all Profiles.\n\nInformation about...\n* [OrderX](https://www.ferd-net.de/standards/order-x/index.html) (German)\n\nThis package makes use of [JMS Serializer](http://jmsyst.com/libs/serializer), [Xsd2Php](https://github.com/goetas-webservices/xsd2php), [FPDF](https://github.com/Setasign/FPDF) and  [FPDI](https://github.com/Setasign/FPDI).\n\n## Installation\n\nThere is one recommended way to install `horstoeko/orderx` via [Composer](https://getcomposer.org/):\n\n* adding the dependency to your ``composer.json`` file:\n\n```js\n  \"require\": {\n      ..\n      \"horstoeko/orderx\":\"^1\",\n      ..\n  },\n```\n\n## Usage\n\nFor detailed eplanation you may have a look in the `examples` of this package and the documentation attached to every release.\n\n### Reading a xml file\n\n```php\nuse horstoeko\\orderx\\OrderDocumentReader;\n\n$document = OrderDocumentReader::readAndGuessFromFile(dirname(__FILE__) . \"/order-x.xml\");\n\n$document-\u003egetDocumentInformation(\n    $documentNo,\n    $documentTypeCode,\n    $documentDate,\n    $documentCurrency,\n    $documentName,\n    $documentLanguageId,\n    $documentEffectiveSpecifiedPeriod,\n    $documentPurposeCode,\n    $documentRequestedResponseTypeCode)\n\necho \"The Order No. is {$documentno}\" . PHP_EOL;\n```\n\n### Reading a pdf file with xml attachment\n\n```php\nuse horstoeko\\orderx\\OrderDocumentPdfReader;\n\n$document = OrderDocumentPdfReader::readAndGuessFromFile(dirname(__FILE__) . \"/order-x.pdf\");\n\n$document-\u003egetDocumentInformation(\n    $documentNo,\n    $documentTypeCode,\n    $documentDate,\n    $documentCurrency,\n    $documentName,\n    $documentLanguageId,\n    $documentEffectiveSpecifiedPeriod,\n    $documentPurposeCode,\n    $documentRequestedResponseTypeCode)\n\necho \"The Order No. is {$documentno}\" . PHP_EOL;\n```\n\n### Writing a xml file\n\n```php\nuse horstoeko\\orderx\\OrderProfiles;\nuse horstoeko\\orderx\\OrderDocumentBuilder;\n\n$document = OrderDocumentBuilder::createNew(\n    OrderProfiles::PROFILE_EXTENDED\n);\n\n$document\n    -\u003esetIsDocumentCopy(false)\n    -\u003esetIsTestDocument(false)\n    -\u003esetDocumentBusinessProcessSpecifiedDocumentContextParameter(\"A1\")\n\n    -\u003esetDocumentInformation(\"PO123456789\", \"220\", new \\DateTime(), \"EUR\", \"Doc Name\", null, new \\DateTime(), \"9\", \"AC\")\n    -\u003eaddDocumentNote(\"Content of Note\", \"AAI\", \"AAI\")\n    -\u003esetDocumentBuyerReference(\"BUYER_REF_BU123\")\n\n    -\u003esetDocumentSeller(\"SELLER_NAME\", \"SUPPLIER_ID_321654\", \"SELLER_ADD_LEGAL_INFORMATION\")\n    -\u003eaddDocumentSellerGlobalId(\"123654879\", \"0088\")\n    -\u003eaddDocumentSellerTaxRegistration(\"VA\", \"FR 32 123 456 789\")\n    -\u003eaddDocumentSellerTaxRegistration(\"FC\", \"SELLER_TAX_ID\")\n    -\u003esetDocumentSellerAddress(\"SELLER_ADDR_1\", \"SELLER_ADDR_2\", \"SELLER_ADDR_3\", \"75001\", \"SELLER_CITY\", \"FR\")\n    -\u003esetDocumentSellerLegalOrganisation(\"123456789\", \"0002\", \"SELLER_TRADING_NAME\")\n    -\u003esetDocumentSellerContact(\"SELLER_CONTACT_NAME\", \"SELLER_CONTACT_DEP\", \"+33 6 25 64 98 75\", null, \"contact@seller.com\", \"SR\")\n    -\u003esetDocumentSellerElectronicAddress(\"EM\", \"sales@seller.com\")\n\n    -\u003esetDocumentBuyer(\"BUYER_NAME\", \"BY_ID_9587456\")\n    -\u003eaddDocumentBuyerGlobalId(\"98765432179\", \"0088\")\n    -\u003eaddDocumentBuyerTaxRegistration(\"VA\", \"FR 05 987 654 321\")\n    -\u003esetDocumentBuyerAddress(\"BUYER_ADDR_1\", \"BUYER_ADDR_2\", \"BUYER_ADDR_3\", \"69001\", \"BUYER_CITY\", \"FR\")\n    -\u003esetDocumentBuyerLegalOrganisation(\"987654321\", \"0002\", \"BUYER_TRADING_NAME\")\n    -\u003esetDocumentBuyerContact(\"BUYER_CONTACT_NAME\", \"BUYER_CONTACT_DEP\", \"+33 6 65 98 75 32\", null, \"contact@buyer.com\", \"LB\")\n    -\u003esetDocumentBuyerElectronicAddress(\"EM\", \"operation@buyer.com\")\n\n    -\u003esetDocumentBuyerRequisitioner(\"BUYER_REQ_NAME\", \"BUYER_REQ_ID_25987\")\n    -\u003eaddDocumentBuyerRequisitionerGlobalId(\"654987321\", \"0088\")\n    -\u003eaddDocumentBuyerRequisitionerTaxRegistration(\"VA\", \"FR 92 654 987 321\")\n    -\u003esetDocumentBuyerRequisitionerAddress(\"BUYER_REQ_ADDR_1\", \"BUYER_REQ_ADDR_2\", \"BUYER_REQ_ADDR_3\", \"69001\", \"BUYER_REQ_CITY\", \"FR\")\n    -\u003esetDocumentBuyerRequisitionerLegalOrganisation(\"654987321\", \"0022\", \"BUYER_REQ_TRADING_NAME\")\n    -\u003esetDocumentBuyerRequisitionerContact(\"BUYER_REQ_CONTACT_NAME\", \"BUYER_REQ_CONTACT_DEP\", \"+33 6 54 98 65 32\", null, \"requisitioner@buyer.com\", \"PD\")\n    -\u003esetDocumentBuyerRequisitionerElectronicAddress(\"EM\", \"purchase@buyer.com\")\n\n    -\u003esetDocumentDeliveryTerms(\"FCA\", \"Free Carrier\", \"7\", \"DEL_TERMS_LOC_ID\", \"DEL_TERMS_LOC_Name\")\n\n    -\u003esetDocumentSellerOrderReferencedDocument(\"SALES_REF_ID_459875\")\n    -\u003esetDocumentBuyerOrderReferencedDocument(\"PO123456789\")\n    -\u003esetDocumentQuotationReferencedDocument(\"QUOT_125487\")\n    -\u003esetDocumentContractReferencedDocument(\"CONTRACT_2020-25987\")\n    -\u003esetDocumentRequisitionReferencedDocument(\"REQ_875498\")\n    -\u003eaddDocumentAdditionalReferencedDocument(\"916\", \"ADD_REF_DOC_ID\", \"ADD_REF_DOC_URIID\", \"ADD_REF_DOC_Desc\")\n    -\u003eaddDocumentAdditionalReferencedDocument(\"50\", \"TENDER_ID\")\n    -\u003eaddDocumentAdditionalReferencedDocument(\"130\", \"OBJECT_ID\", null, null, \"AWV\")\n    -\u003esetDocumentBlanketOrderReferencedDocument(\"BLANKET_ORDER_OD\", new \\DateTime())\n    -\u003esetDocumentPreviousOrderChangeReferencedDocument(\"PREV_ORDER_C_ID\", new \\DateTime())\n    -\u003esetDocumentPreviousOrderResponseReferencedDocument(\"PREV_ORDER_R_ID\", new \\DateTime())\n    -\u003esetDocumentProcuringProject(\"PROJECT_ID\", \"Project Reference\")\n\n    -\u003esetDocumentShipTo(\"SHIP_TO_NAME\", \"SHIP_TO_ID\")\n    -\u003eaddDocumentShipToGlobalId(\"5897546912\", \"0088\")\n    -\u003eaddDocumentShipToTaxRegistration(\"VA\", \"FR 66 951 632 874\")\n    -\u003esetDocumentShipToAddress(\"SHIP_TO_ADDR_1\", \"SHIP_TO_ADDR_2\", \"SHIP_TO_ADDR_3\", \"69003\", \"SHIP_TO_CITY\", \"FR\")\n    -\u003esetDocumentShipToLegalOrganisation(\"951632874\", \"0002\", \"SHIP_TO_TRADING_NAME\")\n    -\u003esetDocumentShipToContact(\"SHIP_TO_CONTACT_NAME\", \"SHIP_TO_CONTACT_DEP\", \"+33 6 85 96 32 41\", null, \"shipto@customer.com\", \"SD\")\n    -\u003esetDocumentShipToElectronicAddress(\"EM\", \"delivery@buyer.com\")\n\n    -\u003esetDocumentShipFrom(\"SHIP_FROM_NAME\", \"SHIP_FROM_ID\")\n    -\u003eaddDocumentShipFromGlobalId(\"875496123\", \"0088\")\n    -\u003eaddDocumentShipFromTaxRegistration(\"VA\", \"FR 16 548 963 127\")\n    -\u003esetDocumentShipFromAddress(\"SHIP_FROM_ADDR_1\", \"SHIP_FROM_ADDR_2\", \"SHIP_FROM_ADDR_3\", \"75003\", \"SHIP_FROM_CITY\", \"FR\")\n    -\u003esetDocumentShipFromLegalOrganisation(\"548963127\", \"0002\", \"SHIP_FROM_TRADING_NAME\")\n    -\u003esetDocumentShipFromContact(\"SHIP_FROM_CONTACT_NAME\", \"SHIP_FROM_CONTACT_DEP\", \"+33 6 85 96 32 41\", null, \"shipfrom@seller.com\", \"SD\")\n    -\u003esetDocumentShipFromElectronicAddress(\"EM\", \"warehouse@seller.com\")\n\n    -\u003esetDocumentRequestedDeliverySupplyChainEvent(new \\DateTime(), new \\DateTime(), new \\DateTime())\n\n    -\u003esetDocumentInvoicee(\"INVOICEE_NAME\", \"INVOICEE_ID_9587456\")\n    -\u003eaddDocumentInvoiceeGlobalId(\"98765432179\", \"0088\")\n    -\u003eaddDocumentInvoiceeTaxRegistration(\"VA\", \"FR 05 987 654 321\")\n    -\u003eaddDocumentInvoiceeTaxRegistration(\"FC\", \"INVOICEE_TAX_ID\")\n    -\u003esetDocumentInvoiceeAddress(\"INVOICEE_ADDR_1\", \"INVOICEE_ADDR_2\", \"INVOICEE_ADDR_3\", \"69001\", \"INVOICEE_CITY\", \"FR\")\n    -\u003esetDocumentInvoiceeLegalOrganisation(\"987654321\", \"0002\", \"INVOICEE_TRADING_NAME\")\n    -\u003esetDocumentInvoiceeContact(\"INVOICEE_CONTACT_NAME\", \"INVOICEE_CONTACT_DEP\", \"+33 6 65 98 75 32\", null, \"invoicee@buyer.com\", \"LB\")\n    -\u003esetDocumentInvoiceeElectronicAddress(\"EM\", \"invoicee@buyer.com\")\n\n    -\u003esetDocumentPaymentMean(\"30\", \"Credit Transfer\")\n    -\u003eaddDocumentPaymentTerm(\"PAYMENT_TERMS_DESC\")\n    -\u003eaddDocumentAllowanceCharge(31.00, false, \"S\", \"VAT\", 20, null, 10.00, 310.00, null, null, \"64\", \"SPECIAL AGREEMENT\")\n    -\u003eaddDocumentAllowanceCharge(21.00, true, \"S\", \"VAT\", 20, null, 10.00, 210.00, null, null, \"FC\", \"FREIGHT SERVICES\")\n    -\u003esetDocumentSummation(310, 360, 21, 31, 300, 60)\n    -\u003esetDocumentReceivableSpecifiedTradeAccountingAccount(\"BUYER_ACCOUNT_REF\")\n\n    -\u003eaddNewPosition(\"1\")\n    -\u003esetDocumentPositionNote(\"WEEE Tax of 0,50 euros per item included\", null, \"TXD\")\n    -\u003esetDocumentPositionProductDetails(\"Product Name\", \"Product Description\", \"987654321\", \"654987321\", \"0160\", \"1234567890123\", \"Product Batch ID (lot ID)\", \"Product Brand Name\")\n    -\u003eaddDocumentPositionProductCharacteristic(\"Characteristic Description\", \"5 meters\", \"Characteristic_Code\")\n    -\u003eaddDocumentPositionProductClassification(\"Class_code\", \"Name Class Codification\", \"TST\")\n    -\u003esetDocumentPositionProductInstance(\"Product Instances Batch ID\", \"Product Instances Supplier Serial ID\")\n    -\u003esetDocumentPositionSupplyChainPackaging(\"7B\", 5, \"MTR\", 3, \"MTR\", 1, \"MTR\")\n    -\u003esetDocumentPositionProductOriginTradeCountry(\"FR\")\n    -\u003esetDocumentPositionProductReferencedDocument(\"ADD_REF_PROD_ID\", \"6\", \"ADD_REF_PROD_URIID\", null, \"ADD_REF_PROD_Desc\")\n    -\u003esetDocumentPositionBuyerOrderReferencedDocument(\"1\")\n    -\u003esetDocumentPositionQuotationReferencedDocument(\"QUOT_125487\", \"3\")\n    -\u003eaddDocumentPositionAdditionalReferencedDocument(\"ADD_REF_DOC_ID\", \"916\", \"ADD_REF_DOC_URIID\", 5, \"ADD_REF_DOC_Desc\")\n    -\u003eaddDocumentPositionAdditionalReferencedDocument(\"OBJECT_125487\", \"130\", null, null, null, \"AWV\")\n    -\u003esetDocumentPositionGrossPrice(10.50, 1, \"C62\")\n    -\u003eaddDocumentPositionGrossPriceAllowanceCharge(1.00, false, \"DISCOUNT\", \"95\")\n    -\u003eaddDocumentPositionGrossPriceAllowanceCharge(0.50, true, \"WEEE\", \"AEW\")\n    -\u003esetDocumentPositionNetPrice(10, 1, \"C62\")\n    -\u003esetDocumentPositionCatalogueReferencedDocument(\"CATALOG_REF_ID\", 2)\n    -\u003esetDocumentPositionBlanketOrderReferencedDocument(2)\n    -\u003esetDocumentPositionPartialDelivery(true)\n    -\u003esetDocumentPositionDeliverReqQuantity(6, \"C62\")\n    -\u003esetDocumentPositionDeliverPackageQuantity(3, \"C62\")\n    -\u003esetDocumentPositionDeliverPerPackageQuantity(2, \"C62\")\n    -\u003eaddDocumentPositionRequestedDeliverySupplyChainEvent(null, new \\DateTime(), new \\DateTime())\n    -\u003eaddDocumentPositionTax(\"S\", \"VAT\", 20.0)\n    -\u003eaddDocumentPositionAllowanceCharge(6.00, false, 10.0, 60.0, \"64\", \"SPECIAL AGREEMENT\")\n    -\u003eaddDocumentPositionAllowanceCharge(6.00, true, 10.0, 60.0, \"FC\", \"FREIGHT SERVICES\")\n    -\u003esetDocumentPositionLineSummation(60.0)\n    -\u003esetDocumentPositionReceivableTradeAccountingAccount(\"BUYER_ACCOUNTING_REF\")\n\n    -\u003ewriteFile(getcwd() . \"/order-x.xml\");\n```\n\n### Writing a pdf file with attached xml file\n\n```php\nuse horstoeko\\orderx\\OrderProfiles;\nuse horstoeko\\orderx\\OrderDocumentBuilder;\nuse horstoeko\\orderx\\OrderDocumentPdfBuilder;\n\n$document = OrderDocumentBuilder::createNew(\n    OrderProfiles::PROFILE_EXTENDED\n);\n\n$document\n    -\u003esetIsDocumentCopy(false)\n    -\u003esetIsTestDocument(false)\n    -\u003esetDocumentBusinessProcessSpecifiedDocumentContextParameter(\"A1\")\n\n    -\u003esetDocumentInformation(\"PO123456789\", \"220\", new \\DateTime(), \"EUR\", \"Doc Name\", null, new \\DateTime(), \"9\", \"AC\");\n\n    // Do some other stuff (see above)\n\n$pdfDocument = new OrderDocumentPdfBuilder(\n    $document,\n    dirname(__FILE__) . \"/../src/assets/empty.pdf\"\n);\n\n$pdfDocument\n    -\u003egenerateDocument()\n    -\u003esaveDocument(getcwd() . \"/order-x.pdf\");\n\n```\n\n## Note\n\nThe code in this project is provided under the [MIT](https://opensource.org/licenses/MIT) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhorstoeko%2Forderx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhorstoeko%2Forderx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhorstoeko%2Forderx/lists"}