From 1b11e86c9ec4863aa738bd48c87c2eb7f102e234 Mon Sep 17 00:00:00 2001 From: hdl Date: Thu, 28 Jul 2005 15:40:52 +0000 Subject: [PATCH] Some Bug Fixes --- C4/Acquisition.pm | 13 +++++-------- acqui/receive.pl | 2 +- acqui/recieveorder.pl | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 69aec8fbbe..be2f99b7f0 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -393,7 +393,7 @@ sub getorders { my $dbh = C4::Context->dbh; my $strsth ="Select count(*),authorisedby,creationdate,aqbasket.basketno, -closedate,surname,firstname +closedate,surname,firstname,aqorders.title from aqorders left join aqbasket on aqbasket.basketno=aqorders.basketno left join borrowers on aqbasket.authorisedby=borrowers.borrowernumber @@ -407,7 +407,6 @@ quantityreceived is NULL) and datecancellationprinted is NULL "; } } $strsth.=" group by basketno order by aqbasket.basketno"; - warn "getorders :".$strsth; my $sth=$dbh->prepare($strsth); $sth->execute($supplierid); my @results = (); @@ -490,23 +489,21 @@ sub getallorders { my ($supid)=@_; my $dbh = C4::Context->dbh; my @results = (); - my $strsth="Select * from aqorders,biblio,biblioitems,aqbasket "; + my $strsth="Select *,aqorders.title as suggestedtitle,biblio.title as truetitle from aqorders,biblio,biblioitems,aqbasket,aqbooksellers "; $strsth .= ",borrowers " if (C4::Context->preference("IndependantBranches")); $strsth .=" where aqorders.basketno=aqbasket.basketno and aqbasket.booksellerid=aqbooksellers.id and biblio.biblionumber=aqorders.biblionumber "; $strsth .= " and aqbasket.authorisedby=borrowers.borrowernumber" if (C4::Context->preference("IndependantBranches")); $strsth.=" and booksellerid=? and (cancelledby is NULL or cancelledby = '') and (quantityreceived < quantity or quantityreceived is NULL) and biblio.biblionumber=aqorders.biblionumber and biblioitems.biblioitemnumber= - aqorders.biblioitemnumber"; + aqorders.biblioitemnumber "; if (C4::Context->preference("IndependantBranches")) { my $userenv = C4::Context->userenv; unless ($userenv->{flags} == 1){ $strsth .= " and (borrowers.branchcode = '".$userenv->{branch}."' or borrowers.branchcode ='')"; } } - $strsth .= "group by aqorders.biblioitemnumber - order by - biblio.title"; + $strsth .= " group by aqorders.biblioitemnumber order by biblio.title"; my $sth=$dbh->prepare($strsth); $sth->execute($supid); while (my $data=$sth->fetchrow_hashref){ @@ -581,7 +578,7 @@ sub ordersearch { my @searchterms = ($id); map { push(@searchterms,"$_%","% $_%") } @data; push(@searchterms,$search,$search,$biblio); - my $sth=$dbh->prepare("Select biblio.*,biblioitems.*,aqorders.*,aqbasket.*,biblio.title from aqorders,biblioitems,biblio,aqbasket + my $sth=$dbh->prepare("Select biblio.*,biblioitems.*,aqorders.*,aqbasket.* from aqorders,biblioitems,biblio,aqbasket where aqorders.biblioitemnumber = biblioitems.biblioitemnumber and aqorders.basketno = aqbasket.basketno and aqbasket.booksellerid = ? diff --git a/acqui/receive.pl b/acqui/receive.pl index 50ab147193..0f09e30527 100755 --- a/acqui/receive.pl +++ b/acqui/receive.pl @@ -79,7 +79,7 @@ for (my$i=0;$i<$count;$i++){ $line{biblionumber} = $results[$i]->{'biblionumber'}; $line{invoice} = $invoice; $line{gst} = $gst; - $line{title} = $results[$i]->{'title'}; + $line{title} = ($results[$i]->{'truetitle'}?$results[$i]->{'truetitle'}:$results[$i]->{'suggestedtitle'}); $line{author} = $results[$i]->{'author'}; $line{unitprice} = $results[$i]->{'unitprice'}; $line{quantityrecieved} = $results[$i]->{'quantityreceived'}; diff --git a/acqui/recieveorder.pl b/acqui/recieveorder.pl index 1c5f84c59a..024c4f8d2f 100755 --- a/acqui/recieveorder.pl +++ b/acqui/recieveorder.pl @@ -32,7 +32,7 @@ use HTML::Template; use C4::Acquisition; my $input=new CGI; -my $supplierid=$input->param('id'); +my $supplierid=$input->param('supplierid'); my ($count,@booksellers)=bookseller($supplierid); my ($template, $loggedinuser, $cookie) -- 2.39.5