[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] koha/C4 Acquisition.pm [rel_2_2]
From: |
Henri-Damien LAURENT |
Subject: |
[Koha-cvs] koha/C4 Acquisition.pm [rel_2_2] |
Date: |
Mon, 27 Feb 2006 16:43:42 +0000 |
CVSROOT: /cvsroot/koha
Module name: koha
Branch: rel_2_2
Changes by: Henri-Damien LAURENT <address@hidden> 06/02/27 16:43:42
Modified files:
C4 : Acquisition.pm
Log message:
Committing a new function for parcel management.
Was needed but not comitted.
Sorry.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha/C4/Acquisition.pm.diff?only_with_tag=rel_2_2&tr1=1.9.2.14&tr2=1.9.2.15&r1=text&r2=text
Patches:
Index: koha/C4/Acquisition.pm
diff -u koha/C4/Acquisition.pm:1.9.2.14 koha/C4/Acquisition.pm:1.9.2.15
--- koha/C4/Acquisition.pm:1.9.2.14 Tue Feb 14 17:07:24 2006
+++ koha/C4/Acquisition.pm Mon Feb 27 16:43:42 2006
@@ -61,7 +61,7 @@
&updaterecorder &newordernum
&getsupplierlistwithlateorders
&getlateorders
- &getparcels
+ &getparcels &getparcelinformation
&bookfunds &curconvert &getcurrencies &bookfundbreakdown
&updatecurrencies &getcurrency
@@ -499,7 +499,7 @@
my $dbh = C4::Context->dbh;
my @results = ();
my $strsth ="Select
count(*),authorisedby,creationdate,aqbasket.basketno,
-closedate,surname,firstname,aqorders.title
+closedate,surname,firstname,aqorders.biblionumber,aqorders.title,
aqorders.ordernumber
from aqorders
left join aqbasket on aqbasket.basketno=aqorders.basketno
left join borrowers on aqbasket.authorisedby=borrowers.borrowernumber
@@ -521,6 +521,48 @@
$sth->finish;
return(scalar(@results),@results);
}
+=item getparcelinformation
+
+ ($count, @results) = &getparcelinformation($booksellerid, $code, $date);
+
+Looks up all of the received items from the supplier with the given
+bookseller ID at the given date, for the given code. Ignores cancelled and
completed orders.
+
+C<$count> is the number of elements in C<@results>. C<@results> is an
+array of references-to-hash. The keys of each element are fields from
+the aqorders, biblio, and biblioitems tables of the Koha database.
+
+C<@results> is sorted alphabetically by book title.
+
+=cut
+#'
+sub getparcelinformation {
+ #gets all orders from a certain supplier, orders them alphabetically
+ my ($supplierid,$code, $datereceived)address@hidden;
+ my $dbh = C4::Context->dbh;
+ my @results = ();
+
+ my $strsth ="Select
authorisedby,creationdate,aqbasket.basketno,closedate,surname,firstname,aqorders.biblionumber,aqorders.title,aqorders.ordernumber,
aqorders.quantity, aqorders.quantityreceived, aqorders.unitprice,
aqorders.listprice, aqorders.rrp, aqorders.ecost from aqorders,aqbasket left
join borrowers on aqbasket.authorisedby=borrowers.borrowernumber where
aqbasket.basketno=aqorders.basketno and aqbasket.booksellerid=? and
aqorders.booksellerinvoicenumber like \"$code%\" and aqorders.datereceived=
\'$datereceived\'";
+
+ if (C4::Context->preference("IndependantBranches")) {
+ my $userenv = C4::Context->userenv;
+ if (($userenv) &&($userenv->{flags} != 1)){
+ $strsth .= " and (borrowers.branchcode =
'".$userenv->{branch}."' or borrowers.branchcode ='')";
+ }
+ }
+ $strsth.=" order by aqbasket.basketno";
+ ### parcelinformation : $strsth
+ my $sth=$dbh->prepare($strsth);
+ $sth->execute($supplierid);
+ while (my $data=$sth->fetchrow_hashref){
+ push(@results,$data);
+ }
+ my $count =scalar(@results);
+ ### countparcelbiblio: $count
+ $sth->finish;
+
+ return(scalar(@results),@results);
+}
=item getsupplierlistwithlateorders
%results = &getsupplierlistwithlateorders;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] koha/C4 Acquisition.pm [rel_2_2],
Henri-Damien LAURENT <=