1 package C4::Acquisition;
3 # Copyright 2000-2002 Katipo Communications
5 # This file is part of Koha.
7 # Koha is free software; you can redistribute it and/or modify it under the
8 # terms of the GNU General Public License as published by the Free Software
9 # Foundation; either version 2 of the License, or (at your option) any later
12 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License along with
17 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
18 # Suite 330, Boston, MA 02111-1307 USA
26 use vars qw($VERSION @ISA @EXPORT);
28 # set the version for version checking
33 C4::Acquisition - Koha functions for dealing with orders and acquisitions
41 The functions in this module deal with acquisitions, managing book
42 orders, converting money to different currencies, and so forth.
52 &getbasket &getbasketcontent &newbasket &closebasket
54 &getorders &getallorders &getrecorders
55 &getorder &neworder &delorder
57 &modorder &getsingleorder &invoice &receiveorder
58 &updaterecorder &newordernum
60 &bookfunds &curconvert &getcurrencies &bookfundbreakdown
61 &updatecurrencies &getcurrency
63 &branches &updatesup &insertsup
64 &bookseller &breakdown
76 $aqbasket = &getbasket($basketnumber);
78 get all basket informations in aqbasket for a given basket
83 my $dbh=C4::Context->dbh;
84 my $sth=$dbh->prepare("select aqbasket.*,borrowers.firstname+' '+borrowers.surname as authorisedbyname from aqbasket left join borrowers on aqbasket.authorisedby=borrowers.borrowernumber where basketno=?");
85 $sth->execute($basketno);
86 return($sth->fetchrow_hashref);
89 =item getbasketcontent
91 ($count, @orders) = &getbasketcontent($basketnumber, $booksellerID);
93 Looks up the pending (non-cancelled) orders with the given basket
94 number. If C<$booksellerID> is non-empty, only orders from that seller
97 C<&basket> returns a two-element array. C<@orders> is an array of
98 references-to-hash, whose keys are the fields from the aqorders,
99 biblio, and biblioitems tables in the Koha database. C<$count> is the
100 number of elements in C<@orders>.
104 sub getbasketcontent {
105 my ($basketno,$supplier)=@_;
106 my $dbh = C4::Context->dbh;
107 my $query="Select *,biblio.title from aqorders,biblio,biblioitems
108 where basketno='$basketno'
109 and biblio.biblionumber=aqorders.biblionumber and biblioitems.biblioitemnumber
110 =aqorders.biblioitemnumber
111 and (datecancellationprinted is NULL or datecancellationprinted =
113 if ($supplier ne ''){
114 $query.=" and aqorders.booksellerid='$supplier'";
116 $query.=" order by biblioitems.publishercode";
117 my $sth=$dbh->prepare($query);
122 while (my $data=$sth->fetchrow_hashref){
132 $basket = &newbasket();
134 Create a new basket in aqbasket table
138 my ($booksellerid,$authorisedby) = @_;
139 my $dbh = C4::Context->dbh;
140 my $sth=$dbh->do("insert into aqbasket (creationdate,booksellerid,authorisedby) values(now(),'$booksellerid','$authorisedby')");
141 #find & return basketno MYSQL dependant, but $dbh->last_insert_id always returns null :-(
142 my $basket = $dbh->{'mysql_insertid'};
148 &newbasket($basketno);
150 close a basket (becomes unmodifiable,except for recieves
155 my $dbh = C4::Context->dbh;
156 my $sth=$dbh->prepare("update aqbasket set closedate=now() where basketno=?");
157 $sth->execute($basketno);
162 &neworder($basket, $biblionumber, $title, $quantity, $listprice,
163 $booksellerid, $who, $notes, $bookfund, $biblioitemnumber, $rrp,
164 $ecost, $gst, $budget, $unitprice, $subscription,
165 $booksellerinvoicenumber);
167 Adds a new order to the database. Any argument that isn't described
168 below is the new value of the field with the same name in the aqorders
169 table of the Koha database.
171 C<$ordnum> is a "minimum order number." After adding the new entry to
172 the aqorders table, C<&neworder> finds the first entry in aqorders
173 with order number greater than or equal to C<$ordnum>, and adds an
174 entry to the aqorderbreakdown table, with the order number just found,
175 and the book fund ID of the newly-added order.
177 C<$budget> is effectively ignored.
179 C<$subscription> may be either "yes", or anything else for "no".
184 my ($basketno,$bibnum,$title,$quantity,$listprice,$booksellerid,$authorisedby,$notes,$bookfund,$bibitemnum,$rrp,$ecost,$gst,$budget,$cost,$sub,$invoice,$sort1,$sort2)=@_;
185 if ($budget eq 'now'){
188 $budget="'2001-07-01'";
195 # if $basket empty, it's also a new basket, create it
197 $basketno=newbasket($booksellerid,$authorisedby);
199 my $dbh = C4::Context->dbh;
200 my $sth=$dbh->prepare("insert into aqorders
201 (biblionumber,title,basketno,quantity,listprice,notes,
202 biblioitemnumber,rrp,ecost,gst,unitprice,subscription,sort1,sort2)
203 values (?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
204 $sth->execute($bibnum,$title,$basketno,$quantity,$listprice,$notes,
205 $bibitemnum,$rrp,$ecost,$gst,$cost,$sub,$sort1,$sort2);
207 #get ordnum MYSQL dependant, but $dbh->last_insert_id returns null
208 my $ordnum = $dbh->{'mysql_insertid'};
209 $sth=$dbh->prepare("insert into aqorderbreakdown (ordernumber,bookfundid) values
211 $sth->execute($ordnum,$bookfund);
218 &delorder($biblionumber, $ordernumber);
220 Cancel the order with the given order and biblio numbers. It does not
221 delete any entries in the aqorders table, it merely marks them as
227 my ($bibnum,$ordnum)=@_;
228 my $dbh = C4::Context->dbh;
229 my $sth=$dbh->prepare("update aqorders set datecancellationprinted=now()
230 where biblionumber=? and ordernumber=?");
231 $sth->execute($bibnum,$ordnum);
237 &modorder($title, $ordernumber, $quantity, $listprice,
238 $biblionumber, $basketno, $supplier, $who, $notes,
239 $bookfundid, $bibitemnum, $rrp, $ecost, $gst, $budget,
240 $unitprice, $booksellerinvoicenumber);
242 Modifies an existing order. Updates the order with order number
243 C<$ordernumber> and biblionumber C<$biblionumber>. All other arguments
244 update the fields with the same name in the aqorders table of the Koha
247 Entries with order number C<$ordernumber> in the aqorderbreakdown
248 table are also updated to the new book fund ID.
253 my ($title,$ordnum,$quantity,$listprice,$bibnum,$basketno,$supplier,$who,$notes,$bookfund,$bibitemnum,$rrp,$ecost,$gst,$budget,$cost,$invoice,$sort1,$sort2)=@_;
254 my $dbh = C4::Context->dbh;
255 my $sth=$dbh->prepare("update aqorders set title=?,
256 quantity=?,listprice=?,basketno=?,
257 rrp=?,ecost=?,unitprice=?,
260 ordernumber=? and biblionumber=?");
261 $sth->execute($title,$quantity,$listprice,$basketno,$rrp,$ecost,$cost,$sort1,$sort2,$ordnum,$bibnum);
263 $sth=$dbh->prepare("update aqorderbreakdown set bookfundid=? where
265 if ($sth->execute($bookfund,$ordnum) == 0) { # zero rows affected [Bug 734]
266 my $query="insert into aqorderbreakdown (ordernumber,bookfundid) values (?,?)";
267 $sth=$dbh->prepare($query);
268 $sth->execute($ordnum,$bookfund);
275 $order = &newordernum();
277 Finds the next unused order number in the aqorders table of the Koha
278 database, and returns it.
282 # FIXME - Race condition
284 my $dbh = C4::Context->dbh;
285 my $sth=$dbh->prepare("Select max(ordernumber) from aqorders");
287 my $data=$sth->fetchrow_arrayref;
288 my $ordnum=$$data[0];
296 &receiveorder($biblionumber, $ordernumber, $quantityreceived, $user,
297 $unitprice, $booksellerinvoicenumber, $biblioitemnumber,
298 $freight, $bookfund, $rrp);
300 Updates an order, to reflect the fact that it was received, at least
301 in part. All arguments not mentioned below update the fields with the
302 same name in the aqorders table of the Koha database.
304 Updates the order with bibilionumber C<$biblionumber> and ordernumber
307 Also updates the book fund ID in the aqorderbreakdown table.
312 my ($biblio,$ordnum,$quantrec,$user,$cost,$invoiceno,$freight,$rrp)=@_;
313 my $dbh = C4::Context->dbh;
314 my $sth=$dbh->prepare("update aqorders set quantityreceived=?,datereceived=now(),booksellerinvoicenumber=?,
315 unitprice=?,freight=?,rrp=?
316 where biblionumber=? and ordernumber=?");
317 $sth->execute($quantrec,$invoiceno,$cost,$freight,$rrp,$biblio,$ordnum);
323 &updaterecorder($biblionumber, $ordernumber, $user, $unitprice,
326 Updates the order with biblionumber C<$biblionumber> and order number
327 C<$ordernumber>. C<$bookfundid> is the new value for the book fund ID
328 in the aqorderbreakdown table of the Koha database. All other
329 arguments update the fields with the same name in the aqorders table.
336 my($biblio,$ordnum,$user,$cost,$bookfund,$rrp)=@_;
337 my $dbh = C4::Context->dbh;
338 my $sth=$dbh->prepare("update aqorders set
340 where biblionumber=? and ordernumber=?
342 $sth->execute($cost,$rrp,$biblio,$ordnum);
344 $sth=$dbh->prepare("update aqorderbreakdown set bookfundid=? where ordernumber=?");
345 $sth->execute($bookfund,$ordnum);
357 ($count, $orders) = &getorders($booksellerid);
359 Finds pending orders from the bookseller with the given ID. Ignores
360 completed and cancelled orders.
362 C<$count> is the number of elements in C<@{$orders}>.
364 C<$orders> is a reference-to-array; each element is a
365 reference-to-hash with the following fields:
371 Gives the number of orders in with this basket number.
373 =item C<authorizedby>
379 These give the value of the corresponding field in the aqorders table
380 of the Koha database.
384 Results are ordered from most to least recent.
390 my $dbh = C4::Context->dbh;
391 my $sth=$dbh->prepare("Select count(*),authorisedby,creationdate,aqbasket.basketno,closedate from aqorders left join aqbasket on
392 aqbasket.basketno=aqorders.basketno where booksellerid=? and (quantity > quantityreceived or
393 quantityreceived is NULL)
394 group by basketno order by aqbasket.basketno");
395 $sth->execute($supplierid);
397 while (my $data=$sth->fetchrow_hashref){
398 push(@results,$data);
401 return (scalar(@results),\@results);
406 ($order, $ordernumber) = &getorder($biblioitemnumber, $biblionumber);
408 Looks up the order with the given biblionumber and biblioitemnumber.
410 Returns a two-element array. C<$ordernumber> is the order number.
411 C<$order> is a reference-to-hash describing the order; its keys are
412 fields from the biblio, biblioitems, aqorders, and aqorderbreakdown
413 tables of the Koha database.
419 my $dbh = C4::Context->dbh;
420 my $sth=$dbh->prepare("Select ordernumber from aqorders where biblionumber=? and biblioitemnumber=?");
421 $sth->execute($bib,$bi);
422 # FIXME - Use fetchrow_array(), since we're only interested in the one
424 my $ordnum=$sth->fetchrow_hashref;
426 my $order=getsingleorder($ordnum->{'ordernumber'});
427 return ($order,$ordnum->{'ordernumber'});
432 $order = &getsingleorder($ordernumber);
434 Looks up an order by order number.
436 Returns a reference-to-hash describing the order. The keys of
437 C<$order> are fields from the biblio, biblioitems, aqorders, and
438 aqorderbreakdown tables of the Koha database.
444 my $dbh = C4::Context->dbh;
445 my $sth=$dbh->prepare("Select * from biblio,biblioitems,aqorders left join aqorderbreakdown
446 on aqorders.ordernumber=aqorderbreakdown.ordernumber
447 where aqorders.ordernumber=?
448 and biblio.biblionumber=aqorders.biblionumber and
449 biblioitems.biblioitemnumber=aqorders.biblioitemnumber");
450 $sth->execute($ordnum);
451 my $data=$sth->fetchrow_hashref;
458 ($count, @results) = &getallorders($booksellerid);
460 Looks up all of the pending orders from the supplier with the given
461 bookseller ID. Ignores cancelled and completed orders.
463 C<$count> is the number of elements in C<@results>. C<@results> is an
464 array of references-to-hash. The keys of each element are fields from
465 the aqorders, biblio, and biblioitems tables of the Koha database.
467 C<@results> is sorted alphabetically by book title.
472 #gets all orders from a certain supplier, orders them alphabetically
474 my $dbh = C4::Context->dbh;
476 my $sth=$dbh->prepare("Select * from aqorders,biblio,biblioitems where booksellerid=?
477 and (cancelledby is NULL or cancelledby = '')
478 and (quantityreceived < quantity or quantityreceived is NULL)
479 and biblio.biblionumber=aqorders.biblionumber and biblioitems.biblioitemnumber=
480 aqorders.biblioitemnumber
481 group by aqorders.biblioitemnumber
484 $sth->execute($supid);
485 while (my $data=$sth->fetchrow_hashref){
486 push(@results,$data);
489 return(scalar(@results),@results);
494 #gets all orders from a certain supplier, orders them alphabetically
496 my $dbh = C4::Context->dbh;
498 my $sth=$dbh->prepare("Select * from aqorders,biblio,biblioitems where booksellerid=?
499 and (cancelledby is NULL or cancelledby = '')
500 and biblio.biblionumber=aqorders.biblionumber and biblioitems.biblioitemnumber=
501 aqorders.biblioitemnumber and
502 aqorders.quantityreceived>0
503 and aqorders.datereceived >=now()
504 group by aqorders.biblioitemnumber
507 $sth->execute($supid);
508 while (my $data=$sth->fetchrow_hashref){
509 push(@results,$data);
512 return(scalar(@results),@results);
517 ($count, @results) = &ordersearch($search, $biblionumber, $complete);
521 C<$search> may take one of several forms: if it is an ISBN,
522 C<&ordersearch> returns orders with that ISBN. If C<$search> is an
523 order number, C<&ordersearch> returns orders with that order number
524 and biblionumber C<$biblionumber>. Otherwise, C<$search> is considered
525 to be a space-separated list of search terms; in this case, all of the
526 terms must appear in the title (matching the beginning of title
529 If C<$complete> is C<yes>, the results will include only completed
530 orders. In any case, C<&ordersearch> ignores cancelled orders.
532 C<&ordersearch> returns an array. C<$count> is the number of elements
533 in C<@results>. C<@results> is an array of references-to-hash with the
551 my ($search,$id,$biblio,$catview) = @_;
552 my $dbh = C4::Context->dbh;
553 my @data = split(' ',$search);
554 my @searchterms = ($id);
555 map { push(@searchterms,"$_%","% $_%") } @data;
556 push(@searchterms,$search,$search,$biblio);
557 my $sth=$dbh->prepare("Select *,biblio.title from aqorders,biblioitems,biblio,aqbasket
558 where aqorders.biblioitemnumber = biblioitems.biblioitemnumber and
559 aqorders.basketno = aqbasket.basketno
560 and aqbasket.booksellerid = ?
561 and biblio.biblionumber=aqorders.biblionumber
562 and ((datecancellationprinted is NULL)
563 or (datecancellationprinted = '0000-00-00'))
565 .(join(" and ",map { "(biblio.title like ? or biblio.title like ?)" } @data))
566 .") or biblioitems.isbn=? or (aqorders.ordernumber=? and aqorders.biblionumber=?)) "
567 .(($catview ne 'yes')?" and (quantityreceived < quantity or quantityreceived is NULL)":"")
568 ." group by aqorders.ordernumber");
569 $sth->execute(@searchterms);
571 my $sth2=$dbh->prepare("Select * from biblio where biblionumber=?");
572 my $sth3=$dbh->prepare("Select * from aqorderbreakdown where ordernumber=?");
573 while (my $data=$sth->fetchrow_hashref){
574 $sth2->execute($data->{'biblionumber'});
575 my $data2=$sth2->fetchrow_hashref;
576 $data->{'author'}=$data2->{'author'};
577 $data->{'seriestitle'}=$data2->{'seriestitle'};
578 $sth3->execute($data->{'ordernumber'});
579 my $data3=$sth3->fetchrow_hashref;
580 $data->{'branchcode'}=$data3->{'branchcode'};
581 $data->{'bookfundid'}=$data3->{'bookfundid'};
582 push(@results,$data);
587 return(scalar(@results),@results);
597 ($count, @results) = &invoice($booksellerinvoicenumber);
599 Looks up orders by invoice number.
601 Returns an array. C<$count> is the number of elements in C<@results>.
602 C<@results> is an array of references-to-hash; the keys of each
603 elements are fields from the aqorders, biblio, and biblioitems tables
604 of the Koha database.
610 my $dbh = C4::Context->dbh;
612 my $sth=$dbh->prepare("Select * from aqorders,biblio,biblioitems where
613 booksellerinvoicenumber=?
614 and biblio.biblionumber=aqorders.biblionumber and biblioitems.biblioitemnumber=
615 aqorders.biblioitemnumber group by aqorders.ordernumber,aqorders.biblioitemnumber");
616 $sth->execute($invoice);
617 while (my $data=$sth->fetchrow_hashref){
618 push(@results,$data);
621 return(scalar(@results),@results);
626 ($count, @results) = &bookfunds();
628 Returns a list of all book funds.
630 C<$count> is the number of elements in C<@results>. C<@results> is an
631 array of references-to-hash, whose keys are fields from the aqbookfund
632 and aqbudget tables of the Koha database. Results are ordered
633 alphabetically by book fund name.
638 my $dbh = C4::Context->dbh;
639 my $sth=$dbh->prepare("Select * from aqbookfund,aqbudget where aqbookfund.bookfundid
641 group by aqbookfund.bookfundid order by bookfundname");
644 while (my $data=$sth->fetchrow_hashref){
645 push(@results,$data);
648 return(scalar(@results),@results);
651 =item bookfundbreakdown
653 returns the total comtd & spent for a given bookfund
654 used in acqui-home.pl
658 sub bookfundbreakdown {
660 my $dbh = C4::Context->dbh;
661 my $sth=$dbh->prepare("Select quantity,datereceived,freight,unitprice,listprice,ecost,quantityreceived,subscription
662 from aqorders,aqorderbreakdown where bookfundid=? and
663 aqorders.ordernumber=aqorderbreakdown.ordernumber
664 and (datecancellationprinted is NULL or
665 datecancellationprinted='0000-00-00')");
669 while (my $data=$sth->fetchrow_hashref){
670 if ($data->{'subscription'} == 1){
671 $spent+=$data->{'quantity'}*$data->{'unitprice'};
673 my $leftover=$data->{'quantity'}-$data->{'quantityreceived'};
674 $comtd+=($data->{'ecost'})*$leftover;
675 $spent+=($data->{'unitprice'})*$data->{'quantityreceived'};
679 return($spent,$comtd);
686 $foreignprice = &curconvert($currency, $localprice);
688 Converts the price C<$localprice> to foreign currency C<$currency> by
689 dividing by the exchange rate, and returns the result.
691 If no exchange rate is found, C<&curconvert> assumes the rate is one
697 my ($currency,$price)=@_;
698 my $dbh = C4::Context->dbh;
699 my $sth=$dbh->prepare("Select rate from currency where currency=?");
700 $sth->execute($currency);
701 my $cur=($sth->fetchrow_array())[0];
706 return($price / $cur);
711 ($count, $currencies) = &getcurrencies();
713 Returns the list of all known currencies.
715 C<$count> is the number of elements in C<$currencies>. C<$currencies>
716 is a reference-to-array; its elements are references-to-hash, whose
717 keys are the fields from the currency table in the Koha database.
722 my $dbh = C4::Context->dbh;
723 my $sth=$dbh->prepare("Select * from currency");
726 while (my $data=$sth->fetchrow_hashref){
727 push(@results,$data);
730 return(scalar(@results),\@results);
733 =item updatecurrencies
735 &updatecurrencies($currency, $newrate);
737 Sets the exchange rate for C<$currency> to be C<$newrate>.
741 sub updatecurrencies {
742 my ($currency,$rate)=@_;
743 my $dbh = C4::Context->dbh;
744 my $sth=$dbh->prepare("update currency set rate=? where currency=?");
745 $sth->execute($rate,$currency);
757 ($count, @results) = &bookseller($searchstring);
759 Looks up a book seller. C<$searchstring> may be either a book seller
760 ID, or a string to look for in the book seller's name.
762 C<$count> is the number of elements in C<@results>. C<@results> is an
763 array of references-to-hash, whose keys are the fields of of the
764 aqbooksellers table in the Koha database.
769 my ($searchstring)=@_;
770 my $dbh = C4::Context->dbh;
771 my $sth=$dbh->prepare("Select * from aqbooksellers where name like ? or id = ?");
772 $sth->execute("$searchstring%",$searchstring);
774 while (my $data=$sth->fetchrow_hashref){
775 push(@results,$data);
778 return(scalar(@results),@results);
783 ($count, $results) = &breakdown($ordernumber);
785 Looks up an order by order ID, and returns its breakdown.
787 C<$count> is the number of elements in C<$results>. C<$results> is a
788 reference-to-array; its elements are references-to-hash, whose keys
789 are the fields of the aqorderbreakdown table in the Koha database.
795 my $dbh = C4::Context->dbh;
796 my $sth=$dbh->prepare("Select * from aqorderbreakdown where ordernumber=?");
799 while (my $data=$sth->fetchrow_hashref){
800 push(@results,$data);
803 return(scalar(@results),\@results);
808 ($count, @results) = &branches();
810 Returns a list of all library branches.
812 C<$count> is the number of elements in C<@results>. C<@results> is an
813 array of references-to-hash, whose keys are the fields of the branches
814 table of the Koha database.
819 my $dbh = C4::Context->dbh;
820 my $sth = $dbh->prepare("Select * from branches order by branchname");
824 while (my $data = $sth->fetchrow_hashref) {
825 push(@results,$data);
829 return(scalar(@results), @results);
834 &updatesup($bookseller);
836 Updates the information for a given bookseller. C<$bookseller> is a
837 reference-to-hash whose keys are the fields of the aqbooksellers table
838 in the Koha database. It must contain entries for all of the fields.
839 The entry to modify is determined by C<$bookseller-E<gt>{id}>.
841 The easiest way to get all of the necessary fields is to look up a
842 book seller with C<&booksellers>, modify what's necessary, then call
843 C<&updatesup> with the result.
849 my $dbh = C4::Context->dbh;
850 my $sth=$dbh->prepare("Update aqbooksellers set
851 name=?,address1=?,address2=?,address3=?,address4=?,postal=?,
852 phone=?,fax=?,url=?,contact=?,contpos=?,contphone=?,contfax=?,contaltphone=?,
853 contemail=?,contnotes=?,active=?,
854 listprice=?, invoiceprice=?,gstreg=?, listincgst=?,
855 invoiceincgst=?, specialty=?,discount=?,invoicedisc=?,
858 $sth->execute($data->{'name'},$data->{'address1'},$data->{'address2'},
859 $data->{'address3'},$data->{'address4'},$data->{'postal'},$data->{'phone'},
860 $data->{'fax'},$data->{'url'},$data->{'contact'},$data->{'contpos'},
861 $data->{'contphone'},$data->{'contfax'},$data->{'contaltphone'},
862 $data->{'contemail'},
863 $data->{'contnote'},$data->{'active'},$data->{'listprice'},
864 $data->{'invoiceprice'},$data->{'gstreg'},$data->{'listincgst'},
865 $data->{'invoiceincgst'},$data->{'specialty'},$data->{'discount'},
866 $data->{'invoicedisc'},$data->{'nocalc'},$data->{'id'});
872 $id = &insertsup($bookseller);
874 Creates a new bookseller. C<$bookseller> is a reference-to-hash whose
875 keys are the fields of the aqbooksellers table in the Koha database.
876 All fields must be present.
878 Returns the ID of the newly-created bookseller.
884 my $dbh = C4::Context->dbh;
885 my $sth=$dbh->prepare("Select max(id) from aqbooksellers");
887 my $data2=$sth->fetchrow_hashref;
889 $data2->{'max(id)'}++;
890 $sth=$dbh->prepare("Insert into aqbooksellers (id) values (?)");
891 $sth->execute($data2->{'max(id)'});
893 $data->{'id'}=$data2->{'max(id)'};
895 return($data->{'id'});
898 END { } # module clean-up code here (global destructor)
907 Koha Developement team <info@koha.org>