Barcodes - OO replacements, extensible module, tests.
authorJoe Atzberger <joe.atzberger@liblime.com>
Thu, 3 Jul 2008 19:18:01 +0000 (14:18 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Fri, 4 Jul 2008 14:22:22 +0000 (09:22 -0500)
commit46a43c0a93f5a7297452352e97b405c35d354cbd
tree5aecd08ac5629fe1edf271d24f173cbabc3e29dd
parent1aed87679d72c2e01badef5359e67735edabf678
Barcodes - OO replacements, extensible module, tests.

This code is intended to replace current value_builder code in 3.2, but
it does not affect it directly (yet) and is safe to include in 3.0.
This structure will be used to handle more complicated formats, like those
with checkdigits.  Please note that "incremental" format is still STRONGLY
recommended because it will always perform the best, and most flexibly.
The desire to include other information (like branchcode) should compel
the proper use of the barcode generator to print the info ON the barcode,
not IN the barcode.

One of the nicer features of this structure is that you are able to
create a new barcode (of the same type) based on any previous Barcodes object.
That means you can create an array of 51 consecutive barcodes like:
my $x = C4::Barcodes->new('annual'); # for example
my @set = ($x);
for (1..50) {
push @set, $x=$x->new;
}
Importantly, this can happen without referencing the database after the
first constructor.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Barcodes.pm [new file with mode: 0755]
C4/Barcodes/annual.pm [new file with mode: 0755]
C4/Barcodes/hbyymmincr.pm [new file with mode: 0755]
C4/Barcodes/incremental.pm [new file with mode: 0755]
t/Barcodes.t [new file with mode: 0755]