From ca2aba8788b9580111d9184bcd5206e63ed51181 Mon Sep 17 00:00:00 2001 From: arensb Date: Mon, 23 Sep 2002 13:52:38 +0000 Subject: [PATCH] Added POD. Removed unnecessary trailing whitespace. --- C4/Catalogue.pm | 535 ++++++++++++++++++++++++++++++++++++++++++--- C4/Maintainance.pm | 145 ++++++++++-- 2 files changed, 629 insertions(+), 51 deletions(-) diff --git a/C4/Catalogue.pm b/C4/Catalogue.pm index 70c37dbf4c..3d8a0f76f9 100644 --- a/C4/Catalogue.pm +++ b/C4/Catalogue.pm @@ -1,4 +1,4 @@ -package C4::Catalogue; #asummes C4/Acquisitions.pm +package C4::Catalogue; #assumes C4/Acquisitions.pm # Continue working on updateItem!!!!!! # @@ -38,18 +38,36 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); # set the version for version checking $VERSION = 0.01; +=head1 NAME + +C4::Catalogue - FIXME + +=head1 SYNOPSIS + + use C4::Catalogue; + +=head1 DESCRIPTION + +FIXME + +=head1 FUNCTIONS + +=over 2 + +=cut + @ISA = qw(Exporter); @EXPORT = qw( &basket &newbasket - &getorders &getallorders &getrecorders + &getorders &getallorders &getrecorders &getorder &neworder &delorder &ordersearch &modorder &getsingleorder &invoice &receiveorder - &updaterecorder &newordernum + &updaterecorder &newordernum - &bookfunds &bookfundbreakdown &updatecost - &curconvert &getcurrencies &updatecurrencies &getcurrency + &bookfunds &bookfundbreakdown &updatecost + &curconvert &getcurrencies &updatecurrencies &getcurrency &findall &needsmod &branches &updatesup &insertsup &bookseller &breakdown &checkitems @@ -60,19 +78,20 @@ $VERSION = 0.01; # your exported package globals go here, # as well as any optionally exported functions -@EXPORT_OK = qw($Var1 %Hashit); +@EXPORT_OK = qw($Var1 %Hashit); # FIXME - Unused # non-exported package globals go here -use vars qw(@more $stuff); +use vars qw(@more $stuff); # FIXME - Unused # initalize package globals, first exported ones - +# FIXME - Unused my $Var1 = ''; my %Hashit = (); # then the others (which are still accessible as $Some::Module::stuff) +# FIXME - Unused my $stuff = ''; my @more = (); @@ -80,15 +99,17 @@ my @more = (); # the functions below that use them. # file-private lexicals go here +# FIXME - Unused my $priv_var = ''; my %secret_hash = (); # here's a file-private function as a closure, # callable as &$priv_func; it cannot be prototyped. +# FIXME - Unused my $priv_func = sub { # stuff goes here. }; - + # make all your functions, whether exported or not; @@ -99,13 +120,28 @@ my $priv_func = sub { # # # +=item basket + + ($count, @orders) = &basket($basketnumber, $booksellerID); + +Looks up the pending (non-cancelled) orders with the given basket +number. If C<$booksellerID> is non-empty, only orders from that seller +are returned. + +C<&basket> returns a two-element array. C<@orders> is an array of +references-to-hash, whose keys are the fields from the aqorders, +biblio, and biblioitems tables in the Koha database. C<$count> is the +number of elements in C<@orders>. + +=cut +#' sub basket { my ($basketno,$supplier)=@_; my $dbh=C4Connect; - my $query="Select *,biblio.title from aqorders,biblio,biblioitems + my $query="Select *,biblio.title from aqorders,biblio,biblioitems where basketno='$basketno' and biblio.biblionumber=aqorders.biblionumber and biblioitems.biblioitemnumber - =aqorders.biblioitemnumber + =aqorders.biblioitemnumber and (datecancellationprinted is NULL or datecancellationprinted = '0000-00-00')"; if ($supplier ne ''){ @@ -126,6 +162,24 @@ sub basket { return($i,@results); } +=item newbasket + + $basket = &newbasket(); + +Finds the next unused basket number in the aqorders table of the Koha +database, and returns it. + +=cut +#' +# FIXME - There's a race condition here: +# A calls &newbasket +# B calls &newbasket (gets the same number as A) +# A updates the basket +# B updates the basket, and clobbers A's result. +# A better approach might be to create a dummy order (with, say, +# requisitionedby == "Dummy-$$" or notes == "dummy