[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] koha/C4 Acquisition.pm [rel_3_0]
From: |
paul poulain |
Subject: |
[Koha-cvs] koha/C4 Acquisition.pm [rel_3_0] |
Date: |
Thu, 25 Jan 2007 09:37:38 +0000 |
CVSROOT: /sources/koha
Module name: koha
Branch: rel_3_0
Changes by: paul poulain <tipaul> 07/01/25 09:37:38
Modified files:
C4 : Acquisition.pm
Log message:
- adding a "grouped" option to GetPendingOrders, to group or not group
the result list basket by basket
- returning an expected date in NodReceiveOrder
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Acquisition.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.43.2.9&r2=1.43.2.10
Patches:
Index: Acquisition.pm
===================================================================
RCS file: /sources/koha/koha/C4/Acquisition.pm,v
retrieving revision 1.43.2.9
retrieving revision 1.43.2.10
diff -u -b -r1.43.2.9 -r1.43.2.10
--- Acquisition.pm 24 Jan 2007 13:47:02 -0000 1.43.2.9
+++ Acquisition.pm 25 Jan 2007 09:37:38 -0000 1.43.2.10
@@ -17,7 +17,7 @@
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
-# $Id: Acquisition.pm,v 1.43.2.9 2007/01/24 13:47:02 tipaul Exp $
+# $Id: Acquisition.pm,v 1.43.2.10 2007/01/25 09:37:38 tipaul Exp $
use strict;
require Exporter;
@@ -30,7 +30,7 @@
use vars qw($VERSION @ISA @EXPORT);
# set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.43.2.9 $' =~ /\d+/g; shift(@v) . "." .
join( "_", map { sprintf "%03d", $_ } @v ); };
+$VERSION = do { my @v = '$Revision: 1.43.2.10 $' =~ /\d+/g; shift(@v) . "." .
join( "_", map { sprintf "%03d", $_ } @v ); };
# used in receiveorder subroutine
# to provide library specific handling
@@ -180,13 +180,15 @@
=over 4
-$orders = &GetPendingOrders($booksellerid);
+$orders = &GetPendingOrders($booksellerid, $grouped);
Finds pending orders from the bookseller with the given ID. Ignores
completed and cancelled orders.
C<$orders> is a reference-to-array; each element is a
reference-to-hash with the following fields:
+C<$grouped> is a boolean that, if set to 1 will group all order lines of the
same basket
+in a single result line
=over 2
@@ -208,10 +210,10 @@
=cut
sub GetPendingOrders {
- my ($supplierid) = @_;
+ my ($supplierid,$grouped) = @_;
my $dbh = C4::Context->dbh;
my $strsth = "
- SELECT count(*),aqbasket.basketno,
+ SELECT ".($grouped?"count(*),":"")."aqbasket.basketno,
surname,firstname,aqorders.*,
aqbasket.closedate, aqbasket.creationdate
FROM aqorders
@@ -232,7 +234,8 @@
. "' or borrowers.branchcode ='')";
}
}
- $strsth .= " group by aqbasket.basketno order by aqbasket.basketno";
+ $strsth .= " group by aqbasket.basketno" if $grouped;
+ $strsth .= " order by aqbasket.basketno";
my $sth = $dbh->prepare($strsth);
$sth->execute($supplierid);
@@ -584,7 +587,9 @@
)
= @_;
my $dbh = C4::Context->dbh;
+# warn "DATE BEFORE : $daterecieved";
$daterecieved=POSIX::strftime("%Y-%m-%d",CORE::localtime) unless
$daterecieved;
+# warn "DATE REC : $daterecieved";
my $query = "
UPDATE aqorders
SET quantityreceived=?,datereceived=?,booksellerinvoicenumber=?,
@@ -612,6 +617,7 @@
$sth->execute( $bookfund, $ordnum );
$sth->finish;
}
+ return $daterecieved;
}
#------------------------------------------------------------#