2017 © Pedro Peláez
 

symfony-bundle bvr-bundle

A bundle with useful functions and template for swiss bvr+

image

sirgix/bvr-bundle

A bundle with useful functions and template for swiss bvr+

  • Thursday, May 18, 2017
  • by sirgix
  • Repository
  • 2 Watchers
  • 2 Stars
  • 96 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

BvrBundle

The goal of this bundle is to help you generating swiss BVR+ with Symfony2. For more information and documentation about BVR+ (in french) go to http://fr.wikipedia.org/wiki/Bulletin_de_versement_avec_num%C3%A9ro_de_r%C3%A9f%C3%A9rence, (*1)

License

GPL-V2, (*2)

Installation

Using Composer (Symfony 2.1+)

  • Add a new line to your composer.json file:
"require": {
    ...
    "sirgix/bvr-bundle": "1.0.*@dev"
}
  • Run a command
php composer.phar update
  • Add a new line to app/AppKernel.php:
$bundles = array(
  ...
  new sirgix\BvrBundle\BvrBundle(),
)

A Quick Start guide

The BVR classes

There are currently 2 bvr classes extending an abstract bvr class. If you just need to generate the encoding lines, you need to instantiante the bvr class and fill all the variables:, (*3)


        $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);

Generate the HTML to print the BVR

I have provided some html for the generation of the bvr html template. This can be used with mpdf to render a PDF. It should be placed at the end of a page. It has been tested with https://github.com/tasmanianfox/MpdfPortBundle, (*4)


        $bvrRender = $this->get("sirgix.bvr.renderer");
        echo $bvrRender->renderBVR($bvr);//$bvr is an instance of a BVR class

/!\ THIS IS STILL WIP, (*5)

Banks

Some banks have different ways to use the reference number. PosteBVR is the standard one. UbsBVR implements it for the UBS Bank, (*6)

Warning

This is still work in progress and there could be bugs. Use at your own risk., (*7)

The Versions

18/05 2017

dev-master

9999999-dev http://github.com/sirgix/BvrBundle

A bundle with useful functions and template for swiss bvr+

  Sources   Download

GPL-v2

The Requires

 

by Sergio Mendolia

bvr bvrb bvr plus

18/05 2017

1.0.1

1.0.1.0 http://github.com/sirgix/BvrBundle

A bundle with useful functions and template for swiss bvr+

  Sources   Download

GPL-v2

The Requires

 

by Sergio Mendolia

bvr bvrb bvr plus

26/06 2014

1.0.0

1.0.0.0 http://github.com/sirgix/BvrBundle

A bundle with useful functions and template for swiss bvr+

  Sources   Download

GPL-v2

The Requires

 

by Sergio Mendolia

bvr bvrb bvr plus