No::Giro - Perl Module for generating Norwegian bank slips
use No::Giro; use PostScript::Simple; my $p = new PostScript::Simple(papersize => "A4", colour => 0, eps => 0, units => "mm"); $p->newpage; my $giro = new No::Giro; $giro->kid(242345); $giro->belop(4534); $giro->tilkonto(12345678901); $giro->bettil(["Payme", 'Somewhere', '4932 Place']); my $e = $giro->eps; $p->importeps($e, 0,0); $p->output("giro.ps");
It provides some methods to enter data into a standard F60-1 GIRO slip. This is an A4 sheet with a standard layout and where data are entered at the bottom and there is some space to enter any information at the top. It returns an Encapsulated Postscript object that can be used in a Postscript document, which again is suitable to be printed.
These are the accessor methods, they serve only the purpose of setting and retrieving the values of the data fields of the object.
These methods have Norwegian-looking names, except for that they are abbreviations and has not Norwegian characters, so I suppose you need to be Norwegian to understand them, or grab someone who is...
The amount of money to be paid.
Date payment is due. Currently, it should be a simple string.
Name and address of the person or institution making the payment. It is an array where each element represents a line. It takes 3-4 lines and does not attempt to check that it is within bounds.
Name and address of the person or institution getting the payment. Like above, it is an array where each element representing a line.
Payment information. This field can contain comments without any particular semantics. It is an array of strings, where each element represents an array. Each element should not exceed 40 characters, but only a warning is issued if it does.
The customer identification number, or KID. You need agreements with the banking system to actually use this meaningfully. There are constraints on length of numbers and how they are to be computed. Contact your bank for details if you plan to use this.
The account number to be credited.
The account number of the payer.
The constructor of this class.
This method uses whatever data that has been previously set by the data methods, and puts them in appropriate positions, and returns a PostScript::Simple::EPS object. You may then use this object to import in a PostScript::Simple document, save it to a file or whatever. Just remember that it has to be imported at the very bottom of the an A4 page.
This is an early release, mostly thrown together to meet the needs of the author. As is seen from the method documentation, it has methods to set all sensible fields, but not all of them are implemented to print anything. The fields that are unimplemented in this release are both something that very few issuers of these slips would ever need to do, and this module addresses their concerns mainly.
The standard strongly recommends the use of the ISO OCR B font for the fields that are to be OCRed, allthough Courier is also supported. I haven't got OCRB to work, even on a machine that has it, so for now, Courier-iso has been hardcoded as the font to use.
Internally, I have noted some problems with the measuring units, but right now it "works for me" and I have little time to grok the problem.
The module could also do some checking that KID and account numbers are valid, that's also a TODO.
I should probably have read the fine specifications for this stuff, but it is not quite clear to me what applies... Pointers are appreciated.
For other issues, please use the CPAN Request Tracker to report bugs.
Kjetil Kjernsmo, firstname.lastname@example.org. You may use English or Norwegian if you write me about this module.
Copyright (C) 2004 by Kjetil Kjernsmo
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, at your option, any later version of Perl 5 you may have available.