The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Business::Payment::SwissESR - Class for creating Esr PDFs

SYNOPSYS

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

DESCRIPTION

This class let's you create ESR pdfs both for email and to to print on official esr forms. The content is modled after:

https://www.postfinance.ch/content/dam/pf/de/doc/consult/templ/example/44218_templ_de_fr_it.pdf

PROPERTIES

The SwissESR objects have the following properties:

shiftRightMm

Swiss Post is very picky about proper positioning of the text in the page. Make sure you get one of the official transparencies to verify that your printouts look ok. And 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.

shiftDownMm

This is for shifting the entire printout down.

senderAddressLaTeX

A default sender address for your invoices. This can be overridden in an individual basis

METHODS

The SwissERS objects have the following methods.

add(key=>value, ...)

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.

pdfEmail

Render the invoice for sending via email. The invoice will contain a grey rendering of the official ESR invoice form. 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.

pdfPrint

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 reading paper invoices. Make sure to send a few test prints to Swiss Post prior to doing a big runoff.

COPYRIGHT

Copyright (c) 2014 by OETIKER+PARTNER AG. All rights reserved.

LICENSE

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.

AUTHOR

Tobias Oetiker <tobi@oetiker.ch>

HISTORY

 2014-06-08 to 0.2 extracted from o2h
 

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 26:

Non-ASCII character seen before =encoding in 'Müller\newline'. Assuming UTF-8

Around line 329:

=back without =over