NAME

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

SYNOPSYS

use Business::Payment::SwissESR::PaymentSlip;
my $nl = '\newline';
my $bs = '\\';
my $esr = Business::Payment::SwissESR::PaymentSlip->new(
   shiftRightMm => $x,
   shiftDownMm => $y,
   senderAddressLaTeX => <<'LaTeX_End'
Oltner 2-Stunden Lauf\newline
Florastrasse 21\newline
4600 Olten
LaTeX_End
   account => '01-17546-3',
);
$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 $pdf = $esr->renderPdf(showPaymentSlip=>1);

DESCRIPTION

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 https://www.postfinance.ch/content/dam/pf/de/doc/consult/manual/dlserv/inpayslip_isr_man_de.pdf

PROPERTIES

The SwissESR objects have the following properties:

luaLaTeX

the lualatex binary to run

shiftRightMm

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 payment slip right in milimeters.

shiftDownMm

This is for shifting the payment slip down.

scale

Some printers seem to not be able to accurately scale the output ... this lets you scale the payment slip in the oposite direction.

senderAddressLaTeX

A default sender address for invoice and payment slip. This can be overridden in an individual basis

account

The default account to be printed on the payment slips.

preambleAddons

Additional lines for the latex preable

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 => 'complete body of the letter including all addrssing',

   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.

renderPdf(showPaymentSlip => 1|0)

Render the invoice in pdf format.

If the showPaymentSlip option is set, the invoice will contain a grey rendering of the official ESR payment slip. For payment at the Post Office counter, the invoice and payment slip have to be printed on 'official' paper containing a pre-printed ESR slip.

$p->quoteLaTeX($str)

return the string with 'magic' latex characters escaped (eg & -> \&).

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 27:

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

Around line 381:

=back without =over