NAME

Business::DPD::Label - one DPD label

SYNOPSIS

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;

DESCRIPTION

TODO

METHODS

Public Methods

new

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)

calc_fields

$label->calc_fields;

Calculate all caluclatable fields from the provided data using the DPD database from $schema:

target_country

calc_tracking_number

$label->calc_tracking_number;

Calulates the tracking number and stores it in tracking_number. tracking_number consists of

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

calc_routing

$label->calc_routing;
$label->o_sort

Calculates the following fields:

o_sort d_sort d_depot barcode_id

TODO: calc route_code ("Beförderungsweg")

calc_target_country_code

$label->calc_target_country_code;

Store the numeric country code from the alpha2 target country (i.e.: 'DE' -> 276) into target_country_code

calc_barcode

$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                        %                   

TODO

* weiters:

kennzeichnung (kleingewicht, Express) Servicetext Servicecode

Lableursprung( datum/zeit, routenDB version, software)

Sendungsinformationsfeld

input: adressdaten

needed methods

* 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

AUTHOR

RevDev <we {at} revdev.at>

SEE ALSO

LICENSE

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:

Around line 145:

Non-ASCII character seen before =encoding in '("Beförderungsweg")'. Assuming UTF-8