Business::DPD - handle DPD label generation
use Business::DPD; my $dpd = Business::DPD->new(); $dpd->connect_schema; my $label = $dpd->generate_label({ zip => '12555', country => 'DE', depot => '1090', serial => '5012345678', service_code => '101', }); say $label->tracking_number; say $label->d_sort; use Business::DPD; my $dpd = Business::DPD->new(); $dpd->connect_schema; $dpd->set_originator_address({ name1 => 'DELICom DPD GmbH', street => 'Wailandtstrasse 1', postal => '63741', city => 'Aschaffenburg', country => 'DE', phone => '06021/ 0815', fax => '06021/ 0816', email => 'test.dpd@dpd.com', depot => '0176', })); my $label = $dpd->generate_label({ address => Business::DPD::Address->new($dpd,{ ... }); serial => '5012345678', service_code => '101', }); say $label->tracking_number; say $label->d_sort;
Calculate routing information for parcel sending via DPD (http://dpd.com)
Generate labels for parcels (including barcode)
my $dpd = Business::DPD->new();
Perl default, Business::DPD will use the included SQLite DB and Business::DPD::DBIC::Schema. If you want to use another DB or another schema-class, you can define them via the options schema_class and dbi_connect.
Business::DPD::DBIC::Schema
schema_class
dbi_connect
my $dpd = Business::DPD->new({ schema_class => 'Your::Schema::DPD', dbi_connect => ['dbi:Pg:dbname=yourdb','dbuser','dbpasswd', { } ], });
$dpd->connect_schema;
Connect to the Schema/DB specified in new.
Stores the DBIx::Class Schema in $dpd->schema.
$dpd->schema
my $label = $dpd->generate_label({ zip => '12555', country => 'DE', depot => '1090', serial => '5012345678', service_code => '101', });
my $country_num = $dpd->country_code('DE');
my $country = $dpd->country_alpha2(276);
my $routing_version = $dpd->routing_meta->version;
Returns Business::DPD::DBIC::Schema::DpdMeta object.
cd Business-DPD mkdir route-db cd route-db wget https://www.dpdportal.sk/download/routing_tables/rlatest_rev_dpdshipper_legacy.zip unzip rlatest_rev_dpdshipper_legacy.zip cd .. rm -f lib/Business/DPD/dpd.sqlite perl -Ilib helper/generate_sqlite_db.pl perl -Ilib helper/import_dpd_data.pl route-db/ perl Build.PL perl Build test sudo perl Build install
Thomas Klausner domm AT cpan.org
domm AT cpan.org
Jozef Kutej jozef@kutej.net
jozef@kutej.net
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Business::DPD, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Business::DPD
CPAN shell
perl -MCPAN -e shell install Business::DPD
For more information on module installation, please visit the detailed CPAN module installation guide.