- possibility to print continuous barcodes numbers, but not from items
- possibility to replace the title/author by a manually typed text under the barcode itself.
# Takes inventary codes from database and if they are between
# the interval specify by parameters, it generates the correspond barcodes
subbarcodesGenerator{
my($from,$to,$individualCodes)=@_;
# Returns a database handler
my$dbh=C4::Context->dbh;
# Create the query to database
my$rangeCondition;
if($individualCodesne""){
$rangeCondition="AND (I.barcode IN ".$individualCodes.")";
}else{
$rangeCondition="AND (I.barcode >= ".$from." AND I.barcode <=".$to." )";
}
my$query="SELECT CONCAT('$numbersystem',REPEAT('0',((12 - LENGTH('$numbersystem')) - LENGTH(I.barcode))), I.barcode) AS Codigo, B.title, B.author FROM biblio B, items I WHERE (I.biblionumber = B.biblioNumber ) ".$rangeCondition." AND (I.barcode <> 'FALTA') ORDER BY Codigo";
$rangeCondition="AND (I.barcode IN ".$individualCodes.")";
}else{
$rangeCondition="AND (I.barcode >= ".$from." AND I.barcode <=".$to." )";
}
my$query="SELECT CONCAT('$numbersystem',REPEAT('0',((12 - LENGTH('$numbersystem')) - LENGTH(I.barcode))), I.barcode) AS Codigo, B.title, B.author FROM biblio B, items I WHERE (I.biblionumber = B.biblioNumber ) ".$rangeCondition." AND (I.barcode <> 'FALTA') ORDER BY Codigo";
# Prepare the query
my$sth=$dbh->prepare($query);
# Executes the query
$sth->execute;
if($sth->rows){# There are inventary codes
# Set the temp directory for pdf´s files
if(!defined($ENV{'TEMP'})){
$ENV{'TEMP'}='/tmp/';
}
# Assigns a temporary filename for the pdf file
my$tmpFileName=&assingFilename($from,$to);
$tmpFileName=$ENV{'TEMP'}.$tmpFileName;
# Creates a PDF object
my$pdf=PDF::API2->new(-file=>$tmpFileName);
# Set the positions where barcodes are going to be placed
<p style="font-size:13pt;color:red">Can´t find inventary codes on that range. Please try again.</p>
<p style="font-size:13pt;color:red">Can't find inventary codes on that range. Please try again.</p>
</td>
</tr>
<!-- /TMPL_IF -->
@ -145,7 +145,13 @@
</tr>
</table>
</td>
</tr>
</tr>
<tr>
<td align="right" style="padding-left:20px">Text under label</td>
<td>
<input type="text" name="text_under_label" size="40" value="<!-- TMPL_VAR name="text_under_label -->"> If this field is empty, author and title will be put instead