From 23881a317e684284241ba7a0d9d515ebc1c763ec Mon Sep 17 00:00:00 2001 From: tipaul Date: Wed, 24 Nov 2004 15:59:15 +0000 Subject: [PATCH] * critical fix for acquisition (see RC3 release notes) --- C4/Acquisition.pm | 3 +-- acqui/addorder.pl | 17 ++++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 0530d27a02..e158eeede8 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -265,7 +265,7 @@ sub modorder { $sth->finish; $sth=$dbh->prepare("update aqorderbreakdown set bookfundid=? where ordernumber=?"); - if ($sth->execute($bookfund,$ordnum) == 0) { # zero rows affected [Bug 734] + unless ($sth->execute($bookfund,$ordnum)) { # zero rows affected [Bug 734] my $query="insert into aqorderbreakdown (ordernumber,bookfundid) values (?,?)"; $sth=$dbh->prepare($query); $sth->execute($ordnum,$bookfund); @@ -606,7 +606,6 @@ sub histsearch { $query .= " and biblio.title like ".$dbh->quote("%".$title."%") if $title; $query .= " and biblio.author like ".$dbh->quote("%".$author."%") if $author; $query .= " and name like ".$dbh->quote("%".$name."%") if $name; - warn "Q : $query"; my $sth = $dbh->prepare($query); $sth->execute; my @order_loop; diff --git a/acqui/addorder.pl b/acqui/addorder.pl index 2332ab7cef..4c86623628 100755 --- a/acqui/addorder.pl +++ b/acqui/addorder.pl @@ -86,6 +86,7 @@ my $bibitemnum; if ($quantity ne '0'){ #check to see if biblio exists if ($existing eq 'no'){ + warn "ADDING"; #if it doesnt create it $bibnum = &newbiblio({ title => $title?$title:"", author => $author?$author:"", @@ -105,6 +106,7 @@ if ($quantity ne '0'){ changestatus($suggestionid,'ORDERED'); } } else { + warn "MODIFYING"; $bibnum=$input->param('biblio'); $bibitemnum=$input->param('bibitemnum'); # my $oldtype=$input->param('oldtype'); @@ -112,15 +114,16 @@ if ($quantity ne '0'){ # isbn => $isbn, # publishercode => $publishercode, # }); -# &modbiblio({ -# biblionumber => $bibnum, -# title => $title?$title:"", -# author => $author?$author:"", -# copyrightdate => $copyrightdate?$copyrightdate:"", -# series => $series?$series:"" }, -# ); + &modbiblio({ + biblionumber => $bibnum, + title => $title?$title:"", + author => $author?$author:"", + copyrightdate => $copyrightdate?$copyrightdate:"", + series => $series?$series:"" }, + ); } if ($ordnum) { + warn "MODORDER $title / $ordnum / $quantity / $bookfund"; modorder($title,$ordnum,$quantity,$listprice,$bibnum,$basketno,$booksellerid,$loggedinuser,$notes,$bookfund,$bibitemnum,$rrp,$ecost,$gst,$budget,$cost,$invoice,$sort1,$sort2); }else { $basketno=neworder($basketno,$bibnum,$title,$quantity,$listprice,$booksellerid,$loggedinuser,$notes,$bookfund,$bibitemnum,$rrp,$ecost,$gst,$budget,$cost,$sub,$invoice,$sort1,$sort2); -- 2.39.5