[Koha-cvs] koha/C4 Acquisition.pm [rel_2_2]

paul poulain paul at koha-fr.org
Tue Apr 4 15:14:55 CEST 2006


CVSROOT:	/cvsroot/koha
Module name:	koha
Branch: 	rel_2_2
Changes by:	paul poulain <tipaul at savannah.gnu.org>	06/04/04 13:14:54

Modified files:
	C4             : Acquisition.pm 

Log message:
	* removing Smart::Comment dependency (should not be required for 2.4, only for 3.0)
	* fixing some SQL bug

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha/C4/Acquisition.pm.diff?only_with_tag=rel_2_2&tr1=1.9.2.15&tr2=1.9.2.16&r1=text&r2=text

Patches:
Index: koha/C4/Acquisition.pm
diff -u koha/C4/Acquisition.pm:1.9.2.15 koha/C4/Acquisition.pm:1.9.2.16
--- koha/C4/Acquisition.pm:1.9.2.15	Mon Feb 27 16:43:42 2006
+++ koha/C4/Acquisition.pm	Tue Apr  4 13:14:54 2006
@@ -23,7 +23,6 @@
 use C4::Date;
 use MARC::Record;
 use C4::Suggestions;
-use Smart::Comments;
 # use C4::Biblio;
 
 use vars qw($VERSION @ISA @EXPORT);
@@ -407,8 +406,7 @@
 left join aqbasket on aqbasket.basketno=aqorders.basketno 
 left join borrowers on aqbasket.authorisedby=borrowers.borrowernumber
 where booksellerid=? and (quantity > quantityreceived or
-quantityreceived is NULL) and datecancellationprinted is NULL ";
-		
+quantityreceived is NULL) and datecancellationprinted is NULL and (to_days(now())-to_days(closedate) < 180 or closedate is null)";
 	if (C4::Context->preference("IndependantBranches")) {
 		my $userenv = C4::Context->userenv;
 		if (($userenv)&&($userenv->{flags} != 1)){
@@ -541,8 +539,8 @@
   my ($supplierid,$code, $datereceived)=@_;
   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\'";
+  $code .='%' if $code; # add % if we search on a given code (otherwise, let him empty)
+	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;





More information about the Koha-cvs mailing list