abcaeffchen/sepa-documentor
Composer 安装命令:
composer require abcaeffchen/sepa-documentor
包简介
Generates file routing slips and control lists from SEPA file data
README 文档
README
General
SepaDocumentor is a module for Sephpa to create file routing slips and control lists as PDF file(s) while generating SEPA xml files.
Requirements
SepaDocumentor works with PHP >=8.1 and requires mPDF >=8.0. It is an optional module of Sephpa >= 2.0, but you can also use it with other SEPA projects as well.
Installation
Composer
Just add
{
"require": {
"abcaeffchen/sepa-documentor": "~2.0"
}
}
to your composer.json and include the Composer autoloader to your script. If you want to use
SepaDocumentor with Sephpa, you also need to add the line "abcaeffchen/sephpa": "~2.0.0"
Direct download
You can download it here on GitHub. You need to make it available in all files, where Sephpa is used. You also have to download mPDF and make it available to SepaDocumentor. It integrates with Sephpa, so you don't have to do anything else.
What do the PDF files contain?
There are two files that can be generated: File Routing Slip and Control Lists.
File Routing Slip
The File Routing Slip contains a summary of the SEPA file. This contains the username of the creator and ID of the file, the number of transactions and the sum of the transferred money and some more information.
Control List
This contains a detailed list of all transactions that are contained in the SEPA file.
Personalize the PDF files
You can modify the templates in src/templates to change the look of the PDF files.
This files also contain the localizations. There are a german and english template included but
there is a good chance that the english version is a very bad translations, since I have no
clue about finance speak. So I would be happy if someone will check this and send me a correct
version :)
How to use
With Sephpa
Just use Sephpa as usual. When you call download or store, set the addDocumentation flag.
If you want to download a file, you have to download a zip file that contains the xml file(s) and
the documentation files as PDF files.
With other SEPA libraries
Overview
There are four functions you can use:
FileRoutingSlip::createText($template, $data): Inserts the $data array into the template.$templatecan be a path to a template or the name of a default template, and it can have any format.FileRoutingSlip::createPDF($template, $data): The same ascreateText(), but the template needs to be in HTML format.ControlList::createText($template, $data, $transactions): Inserts the $data array into the template and repeats the transaction block as often as needed, each filled with the values from one of the arrays in$transactions$templatecan be a path to a template or the name of a default template, and it can have any format.ControlList::createPDF($template, $data, $transactions): The same ascreateText(), but the template needs to be in HTML format.
Templates
Templates can have any format. You can use
- placeholders of the form
{{KEYWORD}}, whereKEYWORDis a string mating[a-zA-Z0-9_-]+. - conditionals
{{ifdef KEYWORD}} BODY {{endif KEYWORD}}:BODYis only printed ifKEYWORDis set.BODYcan contain placeholders and other conditionals as long as the nested conditionals use other keywords.{{ifndef KEYWORD}} BODY {{endif KEYWORD}}:BODYis only printed ifKEYWORDis not set.BODYcan also contain placeholders and other conditionals as long as the nested conditionals use other keywords.{{TRANSACTION!}} BLOCK {{/TRANSACTION!}}: This is a spacial command block only allowed for control lists.BLOCKcan contain any other placeholders or conditionals. This block will be repeated and interpreted for each transaction. Every unused placeholder will be removed from the output.
Inputs
$datais a key => value array, where keys are the placeholders without the braces.$transactionsis an array of key => value arrays, one for each transaction.
Not every placeholder needs to be present in the input. Keys without a corresponding placeholder will be ignored.
License
Licensed under the LGPL v3.0 License.
abcaeffchen/sepa-documentor 适用场景与选型建议
abcaeffchen/sepa-documentor 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 262.88k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2017 年 10 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「xml」 「files」 「sepa」 「Banking」 「finance」 「control list」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 abcaeffchen/sepa-documentor 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 abcaeffchen/sepa-documentor 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 abcaeffchen/sepa-documentor 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
An HTML5 upload field for the CMS and frontend forms.
Creates an XML file for a Single Euro Payments Area (SEPA) Credit Transfer.
Simple classes for creating SEPA transfer and direct debit xml files. No dependencies
This package parses and validates International Bank Account Number (IBAN).
Creates an XML file for a Single Euro Payments Area (SEPA) Credit Transfer.
A very simple yet useful helper class to handle PHP file uploads.
统计信息
- 总下载量: 262.88k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 31
- 依赖项目数: 3
- 推荐数: 2
其他信息
- 授权协议: LGPL-3.0-only
- 更新时间: 2017-10-22