&itemdata &bibdata &GetItems &borrdata &getacctlist &itemnodata &itemcount
&OpacSearch &borrdata2 &NewBorrowerNumber &bibitemdata &borrissues
&getboracctrecord &ItemType &itemissues &FrontSearch &subject &subtitle
-&addauthor &bibitems &barcodes &findguarantees &allissues &systemprefs);
+&addauthor &bibitems &barcodes &findguarantees &allissues &systemprefs
+&findguarantor);
%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
# your exported package globals go here,
return($i,\@dat);
}
+sub findguarantor{
+ my ($bornum)=@_;
+ my $dbh=C4Connect;
+ my $query="select guarantor from borrowers where
+ borrowernumber='$bornum'";
+ my $sth=$dbh->prepare($query);
+ $sth->execute;
+ my $data=$sth->fetchrow_hashref;
+ $sth->finish;
+ $query="Select * from borrowers where borrowernumber='$data->{'guarantor'}'";
+ $sth=$dbh->prepare($query);
+ $sth->execute;
+ $data=$sth->fetchrow_hashref;
+ $sth->finish;
+ $dbh->disconnect;
+ return($data);
+}
+
sub NewBorrowerNumber {
my $dbh=C4Connect;
my $sth=$dbh->prepare("Select max(borrowernumber) from borrowers");
my $count=@key;
my $i=1;
my @results;
- my $query ="Select * from biblio,bibliosubtitle,biblioitems where
- biblio.biblionumber=bibliosubtitle.biblionumber and
- biblioitems.biblionumber=biblio.biblionumber and
+ my $query ="Select * from biblio
+ left join bibliosubtitle on
+ bibliosubtitle.biblionumber=biblio.biblionumber
+ left join biblioitems on
+ biblioitems.biblionumber=biblio.biblionumber
+ where
(((title like '$key[0]%' or title like '% $key[0]%')";
while ($i < $count){
$query=$query." and (title like '$key[$i]%' or title like '% $key[$i]%')";
my $count=@key;
my $i=1;
$query="select *,biblio.author,biblio.biblionumber from
- biblioitems,biblio
+ biblio
left join additionalauthors
on additionalauthors.biblionumber =biblio.biblionumber
- where biblioitems.biblionumber=biblio.biblionumber
- and
+ left join biblioitems on biblioitems.biblionumber=biblio.biblionumber
+ where
((biblio.author like '$key[0]%' or biblio.author like '% $key[0]%' or
additionalauthors.author like '$key[0]%' or additionalauthors.author
like '% $key[0]%'
my @key=split(' ',$search->{'title'});
my $count=@key;
my $i=1;
- $query="select * from biblio,bibliosubtitle,biblioitems
+ $query="select * from biblio
+ left join bibliosubtitle on
+ bibliosubtitle.biblionumber=biblio.biblionumber
+ left join biblioitems on biblioitems.biblionumber=biblio.biblionumber
where
- (biblio.biblionumber=bibliosubtitle.biblionumber and
- biblioitems.biblionumber=biblio.biblionumber) and
(((title like '$key[0]%' or title like '% $key[0]%' or title like '% $key[0]')";
while ($i<$count){
$query=$query." and (title like '$key[$i]%' or title like '% $key[$i]%' or title like '% $key[$i]')";
sub bibitemdata {
my ($bibitem)=@_;
my $dbh=C4Connect;
- my $query="Select * from biblio,biblioitems,itemtypes where biblio.biblionumber=
+ my $query="Select *, biblioitems.notes as bnotes
+ from biblio,biblioitems,itemtypes where biblio.biblionumber=
biblioitems.biblionumber and biblioitemnumber=$bibitem and
biblioitems.itemtype=itemtypes.itemtype";
# print $query;
my $query="Select * from items where
biblionumber=$bibnum ";
if ($type eq 'opac'){
- $query.=" and (itemlost <>1 or itemlost is NULL) and
- (wthdrawn <> 1 or wthdrawn is NULL)";
+ $query.=" and (itemlost =0 or itemlost is NULL) and
+ (wthdrawn = 0 or wthdrawn is NULL)";
}
my $sth=$dbh->prepare($query);
# print $query;
if ($data->{'holdingbranch'} eq 'S' || $data->{'holdingbranch'} eq 'SP'){
$scount++;
}
- if ($data->{'itemlost'} eq '1'){
+ if ($data->{'itemlost'} eq '1' || $data->{'itemlost'} eq '2'){
$lostcount++;
}
if ($data->{'holdingbranch'} eq 'FM'){
my $data=bibitemdata($bi);
my (@items)=itemissues($bi);
-my ($order)=getorder($bi,$bib);
+my ($order,$ordernum)=getorder($bi,$bib);
#print @items;
my $count=@items;
<b>Pages:</b> $data->{'pages'}<br>
<b>Illus:</b> $data->{'illus'}<br>
<b>Size:</b> $data->{'size'}<br>
-<b>Notes:</b> $data->{'notes'}<br>
+<b>Notes:</b> $data->{'bnotes'}<br>
<b>No. of Items:</b> $count
+
printend
;
if ($type eq 'catmain'){
}
print <<printend
+
</font>
</TD>
</tr>
<form action=/cgi-bin/koha/moditem.pl method=post>
<input type=hidden name=bibitem value=$bi>
<input type=hidden name=item value=$items[$i]->{'itemnumber'}>
+<input type=hidden name=type value=$type>
<INPUT TYPE="image" name="submit" VALUE="modify" height=42 WIDTH=93 BORDER=0 src="/images/modify-mem.gif">
<INPUT TYPE="image" name="delete" VALUE="delete" height=42 WIDTH=93 BORDER=0 src="/images/delete-mem.gif">
<br>
<b>Current Branch:</b> $items[$i]->{'holdingbranch'}<br>
<b>Replacement Price:</b> $items[$i]->{'replacementprice'}<br>
<b>Item lost:</b> $items[$i]->{'itemlost'}<br>
-<b>paid by:</b><br>
+<b>Paid for:</b> $items[$i]->{'paidfor'}<br>
<b>Notes:</b> $items[$i]->{'itemnotes'}<br>
<b>Renewals:</b> $items[$i]->{'renewals'}<br>
-<b><a href=/cgi-bin/koha/acqui/acquire.pl?recieve=$order->{'ordernumber'}&biblio=$bib&invoice=$order->{'booksellerinvoicenumber'}&catview=yes>Accession</a> Date: $items[$i]->{'dateaccessioned'}<br>
+<b><a href=/cgi-bin/koha/acqui/acquire.pl?recieve=$ordernum&biblio=$bib&invoice=$order->{'booksellerinvoicenumber'}&catview=yes>Accession</a> Date: $items[$i]->{'dateaccessioned'}<br>
printend
;
if ($items[$i]->{'wthdrawn'} eq '1'){