summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcos <cos>2015-01-25 23:36:46 +0100
committercos <cos>2015-01-25 23:36:46 +0100
commitf1020f3096ecff934ad93bb78ba597ff4249e068 (patch)
treec4fe15e505b42a215ca3eb5a92daabedfd36260b
parent84e3857e881a8f3e665df837e6c8d3c06fe61b7b (diff)
downloadmat-f1020f3096ecff934ad93bb78ba597ff4249e068.zip
Optimize strings on labels, to prepare to fit more information.
-rwxr-xr-xmat8
1 files changed, 4 insertions, 4 deletions
diff --git a/mat b/mat
index 898f957..09aa559 100755
--- a/mat
+++ b/mat
@@ -282,18 +282,18 @@ sub print_label {
my $iconv = Text::Iconv->new("UTF-8", "ISO8859-1");
my $latin1_dish = $iconv->convert($dish_name);
- my $row0 = $Config{'label_name'};
+ my $row0 = $Config{'label_name'}." ".$preparation_date;
my $row1;
my $row2;
if( length($latin1_dish) < 15) {
$row1 = $latin1_dish;
- $row2 = "";
+ $row2 = "(".$amount."g)";
} else {
$row1 = $latin1_dish;
$row1 =~ s/(.{15,23}) .*/$1/;
- $row2 = substr($latin1_dish, (length $row1) + 1);
+ $row2 = substr($latin1_dish, (length $row1) + 1).' ('.$amount.'g)';
}
- my $row3 = $preparation_date.' ('.$amount.'g)';
+ my $row3 = '<available label space>';
my $idbarcode = GD::Barcode::QRcode->new(sprintf("%s%d", $Config{'label_id_prefix'}, $id), { Version=>3 });
my $idbarcode_image=$idbarcode->plot();