$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);
$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;
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:"",
changestatus($suggestionid,'ORDERED');
}
} else {
+ warn "MODIFYING";
$bibnum=$input->param('biblio');
$bibitemnum=$input->param('bibitemnum');
# my $oldtype=$input->param('oldtype');
# 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);