Only print two lines max

This commit is contained in:
Peter Stuifzand 2013-04-04 14:58:38 +02:00
parent 769bdfab33
commit af1c209dfa
2 changed files with 22 additions and 3 deletions

20
bin/sendtest.pl Normal file
View File

@ -0,0 +1,20 @@
#!/usr/bin/env perl
use lib '/srv/kassa-alpha/app/lib';
use Protocol::Zebra::Label;
use Kassa::Net::Kassabon;
BEGIN {
$ENV{ZMQ_PERL_BACKEND} = 'ZMQ::LibZMQ3';
}
use ZMQ;
use ZMQ::Constants ':all';
my $zmq_context = ZMQ::Context->new(1);
my $printer = Kassa::Net::Kassabon->new($zmq_context, 'tcp://192.168.1.82:9999');
my $p = Protocol::Zebra::Label->new;
my $data = $p->format({ name => "Test label met een langere tekst adf df efe efei hemelsblauw", price => 'EUR 1,10', barcode => '812345678901', count => 1 });
$printer->send($data);
sleep 1;

View File

@ -56,9 +56,8 @@ sub format {
$self->append_data($self->header);
# add_line
for (@line) {
$self->add_line($_);
}
$self->add_line($line[0]) if @line > 0;
$self->add_line($line[1]) if @line > 1;
# add_price
$self->add_line($vars->{price}, 32);