sirgix / bvr-bundle
此包已被弃用且不再维护。作者建议使用 GeneralMediaCH/BvrBundle 包。
包含有用功能和模板的瑞士 bvr+ 包
1.0.1
2017-05-18 11:59 UTC
Requires
- symfony/framework-bundle: ~2.1
This package is not auto-updated.
Last update: 2022-02-01 12:37:04 UTC
README
本包的目标是帮助您使用 Symfony2 生成瑞士 BVR+。有关 BVR+(法语)的更多信息及相关文档,请访问 http://fr.wikipedia.org/wiki/Bulletin_de_versement_avec_num%C3%A9ro_de_r%C3%A9f%C3%A9rence
许可
GPL-V2
安装
使用 Composer(Symfony 2.1+)
- 在您的
composer.json
文件中添加一行
"require": {
...
"sirgix/bvr-bundle": "1.0.*@dev"
}
- 运行一条命令
php composer.phar update
- 在
app/AppKernel.php
中添加一行
$bundles = array(
...
new sirgix\BvrBundle\BvrBundle(),
)
快速入门指南
BVR 类
目前有 2 个扩展自抽象 BVR 类的 bvr 类。如果您只需要生成编码行,您需要实例化 bvr 类并填写所有变量
$bvr = new PosteBVR();
$bvr->setType(PosteBVR::BVR_CHF_PLUS);
$bvr->setAmount(234.8);
$bvr->setPaymentFor('test testson
route des chemins 4
1000 tonvillage');//Provide an adress. It will be displayed with nl2br
$bvr->setPaymentFrom(/*see paymentFor*/);
$bvr->setPostalAccount('17-6358-7');
$bvr->setReferenceNumber(23456);
$bvrRender = $this->get("sirgix.bvr.renderer");
echo $bvrRender->renderBVR($bvr);
生成用于打印 BVR 的 HTML
我提供了一些用于生成 bvr HTML 模板的 HTML 代码。这可以与 mpdf 一起使用来渲染 PDF。它应该放在页面末尾。它已经与 https://github.com/tasmanianfox/MpdfPortBundle 进行了测试
$bvrRender = $this->get("sirgix.bvr.renderer");
echo $bvrRender->renderBVR($bvr);//$bvr is an instance of a BVR class
/!\ 这仍然是 WIP
银行
一些银行对参考号的使用方式不同。PosteBVR 是标准方式。UbsBVR 为 UBS 银行实现。
警告
这仍然是正在进行中的工作,可能存在错误。请自行承担风险。