* critical fix for acquisition (see RC3 release notes)
authortipaul <tipaul>
Wed, 24 Nov 2004 15:59:15 +0000 (15:59 +0000)
committertipaul <tipaul>
Wed, 24 Nov 2004 15:59:15 +0000 (15:59 +0000)
C4/Acquisition.pm
acqui/addorder.pl

index 0530d27..e158eee 100644 (file)
@@ -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;
index 2332ab7..4c86623 100755 (executable)
@@ -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);