Business::DPD::Label - one DPD label
use Business::DPD::Label; my $label = Business::DPD::Label->new( $dpd, { zip => '12555', country => 'DE', depot => '1090', serial => '50123456%0878', service_code => '101', }); $label->calc_fields; say $label->tracking_number; say $label->d_sort;
TODO
my $label = Business::DPD::Label->new( $dpd, { zip => '12555', country => 'DE', depot => '1090', serial => '5012345678', service_code => '101', });
TODO: take a Business::DPD::Address as an agrument (instead of zip & country)
$label->calc_fields;
Calculate all caluclatable fields from the provided data using the DPD database from $schema:
$schema
target_country
$label->calc_tracking_number;
Calulates the tracking number and stores it in tracking_number. tracking_number consists of
tracking_number
DDDDXXLLLLLLLLP | | | | | | | +-> iso7064_mod37_36_checksum L | | +----> serial 12345678 | +----------> first two positions of serial 50 +------------> depot 1090
We additionally store the checksum in checksum_tracking_number and the tracking_number_without_checksum
checksum_tracking_number
tracking_number_without_checksum
$label->calc_routing; $label->o_sort
Calculates the following fields:
o_sort d_sort d_depot barcode_id
TODO: calc route_code ("Beförderungsweg")
$label->calc_target_country_code;
Store the numeric country code from the alpha2 target country (i.e.: 'DE' -> 276) into target_country_code
target_country_code
$label->calc_barcode;
Generate the various parts of the barcode, which are:
code
PPPPPPPTTTTTTTTTTTTTTSSSCCC
code_human
PPPPPPPTTTTTTTTTTTTTTSSSCCCP
code_barcode
IPPPPPPPTTTTTTTTTTTTTTSSSCCC
And here's the explanation of those strange letter:
IPPPPPPPTTTTTTTTTTTTTTSSSCCCP | | | | | | | | | | | +-> iso7064_mod37_36_checksum Z | | | | +---> target_country_code 276 | | | +------> service_code 101 | | +--------------> tracking_number_without_checksum 01905002345615 | +-------------------------> zip (zero padded) 0012555 +-----------------------------> barcode_id %
* weiters:
kennzeichnung (kleingewicht, Express) Servicetext Servicecode
Lableursprung( datum/zeit, routenDB version, software)
input: adressdaten
* one object for one address * required fields ** target country ** target zipcode ** laufende nummer ** depot number ** service code * semi-required ** address data * optional ** referenznummer ** auftragsnummer ** gewicht ** n of m ** template
RevDev <we {at} revdev.at>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in '("Beförderungsweg")'. Assuming UTF-8
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.