Business::Colissimo - Shipping labels for ColiPoste
Version 0.2200
use Business::Colissimo; $colissimo = Business::Colissimo->new(mode => 'access_f', customer_number => '900001', parcel_number => '2052475203', postal_code => '72240', weight => 120); # get logo file name $colissimo->logo; # produce barcode images $colissimo->barcode('tracking', spacing => 1); $colissimo->barcode('shipping', spacing => 1); # customer number $colissimo->customer_number('900001') # parcel number from your alloted range numbers $colissimo->parcel_number('2052475203'); # country code for recipient (expert_i and expert_i_kpg mode) $colissimo->country_code('DE'); # postal code for recipient $colissimo->postal_code('72240'); # add weight in grams $colissimo->weight(250); # not mechanisable option $colissimo->not_mechanisable(1); # cash on delivery option (expert mode only) $colissimo->cod(1); # insurance level (expert mode only) $colissimo->level('01'); # recommendation level (expert_f and expert_om mode only) $colissimo->level('21'); # set scale in pixels for barcode image (default: 1) $colissimo->scale(2); # set height in pixels for barcode image (default: 77) $colissimo->height(100);
Business::Colissimo helps you to produce shipping labels for the following ColiPoste services:
$colissimo = Business::Colissimo->new(mode => 'access_f');
$colissimo = Business::Colissimo->new(mode => 'expert_f');
$colissimo = Business::Colissimo->new(mode => 'expert_om');
KPG countries: $colissimo = Business::Colissimo->new(mode => 'expert_i_kpg'); Countries outside of KPG: $colissimo = Business::Colissimo->new(mode => 'expert_i');
$colissimo = Business::Colissimo->new(mode => 'access_f', customer_number => '900001', parcel_number => '2052475203', postal_code => '72240', weight => 250); $colissimo = Business::Colissimo->new(mode => 'expert_f', customer_number => '900001', parcel_number => '2052475203', postal_code => '72240', weight => 250, cod => 1, level => '01');
Produces the tracking barcode:
$colissimo->barcode('tracking');
Same with proper spacing for the shipping label:
$colissimo->barcode('tracking', spacing => 1);
Produces the sorting barcode:
$colissimo->barcode('sorting');
$colissimo->barcode('sorting', spacing => 1);
Produces PNG image for tracking barcode:
$colissimo->barcode_image('tracking');
Produces PNG image for sorting barcode:
$colissimo->barcode_image('sorting');
Produces PNG image for arbitrary barcode:
$colissimo->barcode_image('8L20524752032');
The scale of the image can be changed for each barcode individually:
$colissimo->barcode_image('8L20524752032', scale => 2);
The default scale is set to 1, because that produces images with the right number of pixels to include them into PDF with PDF::API2, which uses 72dpi resolution for images unless you specify width and height explicitly (see PDF::API2::Content).
The formula for calculating width in mm for a 72dpi resolution is as follows:
(1px * 25.4) / 72dpi
This fits into Colissimo's requirement for the basic module (narrowest element of the bar code) of 0.33 to 0.375 mm.
Returns logo file name for selected service.
$colissimo->logo;
Toggles testing.
$colissimo->test(1);
Get current scale for barcode image:
$colissimo->scale;
Set current scale for barcode image:
$colissimo->scale(3);
Get current height for barcode image:
$colissimo->height;
Set current height for barcode image:
$colissimo->height(100);
Get current padding for barcode image:
$colissimo->padding;
Set current padding for barcode image:
$colissimo->padding(0);
Get current customer number:
$colissimo->customer_number;
Set current customer number:
$colissimo->customer_number('900001');
Get current parcel number:
$colissimo->parcel_number;
Set current parcel number:
$colissimo->parcel_number('2052475203');
Get current country code:
$colissimo->country
Set current country code:
$colissimo->country('BE');
The country code is defined in the ISO 3166 standard.
Switches to expert_i_kpg mode automatically.
Get current postal code:
$colissimo->postal_code
Set current postal code:
$colissimo->postal_code('72240');
Get current weight:
$colissimo->weight;
Set weight in grams:
$colissimo->weight(250);
Get current value of not mechanisable option:
$colissimo->not_mechanisable;
Set current value of not mechanisable option:
$colissimo->not_mechanisable(1);
Possible values are 0 (No) and 1 (Yes).
Get current value of cash on delivery option:
$colissimo->cod;
Set current value of cash on delivery option:
$colissimo->cod(1);
The cash on delivery option is available only in export mode, possible values are 0 (No) and 1 (Yes).
Get current insurance resp. recommendation level:
$colissimo->level;
Set current insurance resp. recommendation level:
$colissimo->level('O1'); $colissimo->level('21');
The level option is only available in expert mode, possible values are 01 ... 10 for insurance level and 21 ... 23 for recommendation level.
Get current value for acknowledgement of receipt (AR):
$colissimo->ack_receipt;
Set current value for acknowledgement of receipt (AR):
$colissimo->ack_receipt(1);
Returns 1 if acknowledgement of receipt is enabled, 0 otherwise.
The ack_receipt option is only available in expert_om and expert_i modes, possible values are 0 (No) and 1 (Yes).
Get current value for customs duty free (FTD):
$colissimo->duty_free;
Set current value for customs duty free (FTD):
$colissimo->duty_free(1);
The custom duty free option is only available in expert_om mode, possible values are 0 (No) and 1 (Yes).
Returns 1 on international (expert_i or expert_i_kpg) shippings, 0 otherwise.
Returns the acronym of the inter-postal organisation (KPG or EPG) corresponding to the destination country.
Returns control key for barcode.
Stefan Hornburg (Racke), <racke at linuxia.de>
<racke at linuxia.de>
Please report any bugs or feature requests to bug-business-colissimo at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Business-Colissimo. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-business-colissimo at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Business::Colissimo
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Business-Colissimo
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Business-Colissimo
CPAN Ratings
http://cpanratings.perl.org/d/Business-Colissimo
Search CPAN
http://search.cpan.org/dist/Business-Colissimo/
Thanks to Ton Verhagen for being a big supporter of my projects in all aspects.
Copyright 2011-2012 Stefan Hornburg (Racke).
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Business::Colissimo, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Business::Colissimo
CPAN shell
perl -MCPAN -e shell install Business::Colissimo
For more information on module installation, please visit the detailed CPAN module installation guide.