[Koha-cvs] CVS: koha/C4 Acquisition.pm,1.7,1.8
Paul POULAIN
tipaul at users.sourceforge.net
Tue Oct 19 14:24:59 CEST 2004
Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15688/C4
Modified Files:
Acquisition.pm
Log Message:
adding search orders history feature
Index: Acquisition.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Acquisition.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** Acquisition.pm 5 Oct 2004 09:22:16 -0000 1.7
--- Acquisition.pm 19 Oct 2004 12:24:57 -0000 1.8
***************
*** 54,58 ****
&getorders &getallorders &getrecorders
&getorder &neworder &delorder
! &ordersearch
&modorder &getsingleorder &invoice &receiveorder
&updaterecorder &newordernum
--- 54,58 ----
&getorders &getallorders &getrecorders
&getorder &neworder &delorder
! &ordersearch &histsearch
&modorder &getsingleorder &invoice &receiveorder
&updaterecorder &newordernum
***************
*** 596,599 ****
--- 596,620 ----
}
+
+ sub histsearch {
+ my ($title,$author,$name)=@_;
+ my $dbh= C4::Context->dbh;
+ my $query = "select biblio.title,aqorders.basketno,name,aqbasket.creationdate,aqorders.datereceived, aqorders.quantity
+ from aqorders,aqbasket,aqbooksellers,biblio
+ where aqorders.basketno=aqbasket.basketno and aqbasket.booksellerid=aqbooksellers.id and
+ biblio.biblionumber=aqorders.biblionumber";
+ $query .= " and biblio.title like ".$dbh->quote("%".$title."%") if $title;
+ $query .= " and biblio.author like ".$dbh->quote("%".$author."%") if $author;
+ $query .= " and name like ".$dbh->quote("%".$name."%") if $name;
+ warn "Q : $query";
+ my $sth = $dbh->prepare($query);
+ $sth->execute;
+ my @order_loop;
+ while (my $line = $sth->fetchrow_hashref) {
+ push @order_loop, $line;
+ }
+ return \@order_loop;
+ }
+
#
#
More information about the Koha-cvs
mailing list