horstoeko/zugferdublbridge
Composer 安装命令:
composer require horstoeko/zugferdublbridge
包简介
Convert Factur-X/ZUGFeRD (CII-Syntax) to PEPPOL (UBL-Syntax) and visa versa
README 文档
README
Table of Contents
- ZUGFeRD/Factur-X (CII-Syntax) to PEPPOL (UBL-Syntax)
License
The code in this project is provided under the MIT license.
Overview
Caution
This library is currently still considered experimental and should therefore be used with caution. I would be happy for an issue to be posted if bugs are found.
With horstoeko/zugferdublbridge you can convert the Factur-X/ZUGFeRD-CII-Syntax to PEPPOL UBL-Syntax and visa versa.
Further information
Related projects
Dependencies
This package has no dependencies.
Installation
There is one recommended way to install horstoeko/zugferdublbridge via Composer:
- adding the dependency to your
composer.jsonfile:
"require": { .. "horstoeko/zugferdublbridge":"^1", .. },
Usage
For detailed eplanation you may have a look in the examples of this package and the documentation attached to every release.
Convert CII to UBL
From XML file to XML file
use horstoeko\zugferdublbridge\XmlConverterCiiToUbl; $sourceXmlFilename = '/path/to/cii.xml.file'; $destinationXmlFilename = '/path/to/ubl.xml.file' XmlConverterCiiToUbl::fromFile($sourceXmlFilename)->convert()->saveXmlFile($destinationXmlFilename);
From XML string to XML file
use horstoeko\zugferdublbridge\XmlConverterCiiToUbl; $xmlContent = '<xml>....</xml>'; $destinationXmlFilename = '/path/to/ubl.xml.file' XmlConverterCiiToUbl::fromString($xmlContent)->convert()->saveXmlFile($destinationXmlFilename);
From XML file to XML string
use horstoeko\zugferdublbridge\XmlConverterCiiToUbl; $sourceXmlFilename = '/path/to/cii.xml.file'; $converterXmlString = XmlConverterCiiToUbl::fromFile($sourceXmlFilename)->convert()->saveXmlString();
Convert UBL to CII
From XML file to XML file
use horstoeko\zugferdublbridge\XmlConverterUblToCii; $sourceXmlFilename = '/path/to/ubl.xml.file'; $destinationXmlFilename = '/path/to/cii.xml.file' XmlConverterUblToCii::fromFile($sourceXmlFilename)->convert()->saveXmlFile($destinationXmlFilename);
From XML string to XML file
use horstoeko\zugferdublbridge\XmlConverterUblToCii; $xmlContent = '<xml>....</xml>'; $destinationXmlFilename = '/path/to/cii.xml.file' XmlConverterUblToCii::fromString($xmlContent)->convert()->saveXmlFile($destinationXmlFilename);
From XML file to XML string
use horstoeko\zugferdublbridge\XmlConverterUblToCii; $sourceXmlFilename = '/path/to/ubl.xml.file'; $converterXmlString = XmlConverterUblToCii::fromFile($sourceXmlFilename)->convert()->saveXmlString();
Usage with horstoeko/zugferd
CII to UBL
You can convert the output of horstoko/zugferd to UBL using this library:
use horstoeko\zugferd\ZugferdDocumentBuilder; use horstoeko\zugferd\ZugferdProfiles; use horstoeko\zugferd\codelists\ZugferdPaymentMeans; use horstoeko\zugferdublbridge\XmlConverterCiiToUbl; $document = ZugferdDocumentBuilder::CreateNew(ZugferdProfiles::PROFILE_EN16931); $document ->setDocumentInformation("471102", "380", \DateTime::createFromFormat("Ymd", "20180305"), "EUR") ---- $destinationXmlFilename = '/path/to/ubl.xml.file' XmlConverterCiiToUbl::fromString($document->getContent())->convert()->saveXmlFile($destinationXmlFilename);
UBL to CII
You can convert a UBL document and handle it with horstoko/zugferd
use horstoeko\zugferd\ZugferdDocumentReader; use horstoeko\zugferdublbridge\XmlConverterUblToCii; $sourceXmlFilename = '/path/to/ubl.xml.file'; $converterXmlString = XmlConverterUblToCii::fromFile($sourceXmlFilename)->convert()->saveXmlString(); $document = ZugferdDocumentReader::readAndGuessFromContent($converterXmlString); $document->getDocumentInformation( $documentno, $documenttypecode, $documentdate, $duedate, $invoiceCurrency, $taxCurrency, $documentname, $documentlanguage, $effectiveSpecifiedPeriod ); echo "The Invoice No. is {$documentno}" . PHP_EOL;
horstoeko/zugferdublbridge 适用场景与选型建议
horstoeko/zugferdublbridge 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 171.24k 次下载、GitHub Stars 达 17, 最近一次更新时间为 2024 年 08 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「convert」 「invoice」 「electronic」 「ZUGFeRD」 「cii」 「ubl」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 horstoeko/zugferdublbridge 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 horstoeko/zugferdublbridge 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 horstoeko/zugferdublbridge 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PHP wrapper for UBL invoices
Provides a simple decimal/roman number converter
A library that provides a simple infrastructure to create your own converters and to perform any conversion you want
B2Brouter PHP SDK - Official library for the B2Brouter API
Easy invoice generation using Laravel Eloquent
An unofficial PHP library for generating ZATCA Fatoora e-invoices. This library facilitates the creation of compliant e-invoices, QR Codes, and certificates, as well as the submission of e-invoices to ZATCA's servers. It provides developers with an easy-to-use, customizable, and robust toolkit to in
统计信息
- 总下载量: 171.24k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 17
- 点击次数: 40
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-08-08