Business::Payment::SwissESR - Class for creating Esr PDFs
use Esr; my $nl = '\newline'; my $bs = '\\'; my $esr = Esr->new( shiftRightMm => shiftDownMm => senderAddressLaTeX => <<'LaTeX_End' Oltner 2-Stunden Lauf\newline Florastrasse 21\newline 4600 Olten LaTeX_End ); $esr->add( amount => 44.40, account => '01-17546-3', senderAddressLaTeX => 'Override', recipientAddressLaTeX => <<'LaTeX_End', Peter Müller\newline Haldenweg 12b\newline 4600 Olten LaTeX_End bodyLaTeX => 'the boddy of the bill in latex format', referenceNumber => 3423, watermark => 'secret marker', ); my $pdfEmail = $esr->pdfEmail(); my $pdfPrint = $esr->pdfPrint();
This class let's you create Swiss ESR payment slips in PDF format both for email and to to print on official ESR pre-prints forms. The content is modeled after:
https://www.postfinance.ch/content/dam/pf/de/doc/consult/templ/example/44218_templ_de_fr_it.pdf
The SwissESR objects have the following properties:
Swiss Post is very picky about proper positioning of the text in the ESR payment slip. Make sure you get one of the official transparencies to verify that your printouts look ok. Even that may not suffice, to be sure, send a bunch of printouts for verification to Swiss Post.
With this property you can shift the entire printout to the right in milimeters.
This is for shifting the entire printout down.
A default sender address for invoice and payment slip. This can be overridden in an individual basis
The SwissERS objects have the following methods.
Adds an invoice. Specify the following properties for each invoice:
amount => 44.40, account => '01-17546-3', recipientAddressLaTeX => <<'LaTeX_End', Peter Müller\newline Haldenweg 12b\newline 4600 Olten LaTeX_End bodyLaTeX => 'the boddy of the bill in latex format', referenceNumber => 3423,
these two properties are optional
senderAddressLaTeX => 'Override', watermark => 'small marker to be printed on the invoice',
You can call add multiple times to generate a buch of invoices in one pdf file.
Render the invoice for sending via email. The invoice will contain a grey rendering of the official ESR payment slip. It can NOT be used for payment at the Post Office counter, but it holds all information required for electronic payment and it is readable by OCR payment processing devices.
Renders to pdf fit to print on the official pink invoce forms (A4 Upright). Use the shiftRight and shiftDown properties to position the output properly. This depends on your printing device as not all printers position the output exactly the same, but SwissPost is very picky when processing paper payment slips Make sure to send a few test prints to Swiss Post prior to doing a big runoff.
Copyright (c) 2014 by OETIKER+PARTNER AG. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Tobias Oetiker <tobi@oetiker.ch>
2014-06-08 to 0.2 extracted from o2h
2 POD Errors
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'Müller\newline'. Assuming UTF-8
=back without =over
To install Business::Payment::SwissESR, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Business::Payment::SwissESR
CPAN shell
perl -MCPAN -e shell install Business::Payment::SwissESR
For more information on module installation, please visit the detailed CPAN module installation guide.