horstoeko/zugferd-laravel
Composer 安装命令:
composer require horstoeko/zugferd-laravel
包简介
A library for Laravel-Framework for creating and reading european electronic invoices
README 文档
README
A simple ZUGFeRD/XRechnung/Factur-X Library for Laravel
Table of Contents
- ZUGFeRD/XRechnung/Factur-X for Laravel
- Table of Contents
- License
- Overview
- Dependencies
- Installation
- Usage
- Create a new Document Builder in the MINIMUM-Profile
- Create a new Document Builder in the BASIC-Profile
- Create a new Document Builder in the BASIC-WL-Profile
- Create a new Document Builder in the EN16931-Profile (COMFORT-Profile)
- Create a new Document Builder in the EXTENDED-Profile
- Create a new Document Builder in the XRECHNUNG-Profile (Version 2.2)
- Create a new Document Builder in the XRECHNUNG-Profile (Version 2.3)
- Create a new Document Builder in the XRECHNUNG-Profile (Version 3.0)
- Create a Document Reader from an existing XML file
- Create a Document Reader from an XML string
- Create a Document Reader from an existing PDF file (which has an attached XML file)
- Create a merged PDF (XML as attachment) by the output of a ZugferdDocumentBuilder
- Create a merged PDF by an existing XML file and existing PDF file
- Create a merged PDF by an existing XML data string and existing PDF file
- Create a merged PDF by an existing XML file and a PDF data string
- Create a merged PDF by an existing XML data string and a PDF data string
License
The code in this project is provided under the MIT license.
Overview
This library is an extension of the horstoeko/zugferd library for the Laravel framework. It provides facades for communication with the underlying library horstoeko/zugferd.
Dependencies
This package makes use of
Installation
There is one recommended way to install horstoeko/zugferd-laravel via Composer:
- adding the dependency to your
composer.jsonfile:
"require": { .. "horstoeko/zugferd-laravel":"^1", .. },
Usage
In general, you should read the documentation and examples of the horstoeko/zugferd library before using this library.
This package provides a facade ZugferdLaravel which is used in the following examples.
Just add an use clause in the form of
use horstoeko\zugferdlaravel\Facades\ZugferdLaravel;
Create a new Document Builder in the MINIMUM-Profile
$document = ZugferdLaravel::createDocumentInMinimumProfile();
Create a new Document Builder in the BASIC-Profile
$document = ZugferdLaravel::createDocumentInBasicProfile();
Create a new Document Builder in the BASIC-WL-Profile
$document = ZugferdLaravel::createDocumentInBasicWlProfile();
Create a new Document Builder in the EN16931-Profile (COMFORT-Profile)
$document = ZugferdLaravel::createDocumentInEN16931Profile();
Create a new Document Builder in the EXTENDED-Profile
$document = ZugferdLaravel::createDocumentInExtendedProfile();
Create a new Document Builder in the XRECHNUNG-Profile (Version 2.2)
$document = ZugferdLaravel::createDocumentInXRechnung22Profile();
Create a new Document Builder in the XRECHNUNG-Profile (Version 2.3)
$document = ZugferdLaravel::createDocumentInXRechnung23Profile();
Create a new Document Builder in the XRECHNUNG-Profile (Version 3.0)
$document = ZugferdLaravel::createDocumentInXRechnung30Profile();
Create a Document Reader from an existing XML file
$document = ZugferdLaravel::readXmlFromFile('/path/to/file.xml');
Create a Document Reader from an XML string
$document = ZugferdLaravel::readXmlFromString('<xml>...</xml>');
Create a Document Reader from an existing PDF file (which has an attached XML file)
$document = ZugferdLaravel::readXmlFromPdfFile('/path/to/file.pdf');
Create a merged PDF (XML as attachment) by the output of a ZugferdDocumentBuilder
$document = ZugferdLaravel::createDocumentInEN16931Profile(); $document ->setDocumentInformation("471102", "380", \DateTime::createFromFormat("Ymd", "20180305"), "EUR") ->....; $pdfDataOrFilename = '/path/to/file.pdf'; $mergedPdfFilename = '/path/to/merged.pdf'; ZugferdLaravel::buildMergedPdfByDocumentBuilder($document, $pdfDataOrFilename, $mergedPdfFilename);
Create a merged PDF by an existing XML file and existing PDF file
$xmlDataOrFilename = '/path/to/file.xml'; $pdfDataOrFilename = '/path/to/file.pdf'; $mergedPdfFilename = '/path/to/merged.pdf'; ZugferdLaravel::buildMergedPdfByXmlDataOrXmlFilename($xmlDataOrFilename, $pdfDataOrFilename, $mergedPdfFilename);
Create a merged PDF by an existing XML data string and existing PDF file
$xmlDataOrFilename = '<?xml version="1.0" encoding="UTF-8"?><rsm:CrossIndustryInvoice.....'; $pdfDataOrFilename = '/path/to/file.pdf'; $mergedPdfFilename = '/path/to/merged.pdf'; ZugferdLaravel::buildMergedPdfByXmlDataOrXmlFilename($xmlDataOrFilename, $pdfDataOrFilename, $mergedPdfFilename);
Create a merged PDF by an existing XML file and a PDF data string
$xmlDataOrFilename = '/path/to/file.xml'; $pdfDataOrFilename = '%PDF-1.5....'; $mergedPdfFilename = '/path/to/merged.pdf'; ZugferdLaravel::buildMergedPdfByXmlDataOrXmlFilename($xmlDataOrFilename, $pdfDataOrFilename, $mergedPdfFilename);
Create a merged PDF by an existing XML data string and a PDF data string
$xmlDataOrFilename = '<?xml version="1.0" encoding="UTF-8"?><rsm:CrossIndustryInvoice....'; $pdfDataOrFilename = '%PDF-1.5....'; $mergedPdfFilename = '/path/to/merged.pdf'; ZugferdLaravel::buildMergedPdfByXmlDataOrXmlFilename($xmlDataOrFilename, $pdfDataOrFilename, $mergedPdfFilename);
horstoeko/zugferd-laravel 适用场景与选型建议
horstoeko/zugferd-laravel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 132.12k 次下载、GitHub Stars 达 39, 最近一次更新时间为 2023 年 09 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「invoice」 「laravel」 「electronic」 「ZUGFeRD」 「factur-x」 「xrechnung」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 horstoeko/zugferd-laravel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 horstoeko/zugferd-laravel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 horstoeko/zugferd-laravel 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PHP wrapper for UBL invoices
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
Laravel MPdf : Easily generate PDF files with arabic support
Szamlazz.hu integration for Laravel
统计信息
- 总下载量: 132.12k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 39
- 点击次数: 39
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-09-27