Some Bugfixing for Acquisitions : ModOrderReceive would create 2 lines in baskets...
authorHenri-Damien LAURENT <henridamien@koha-fr.org>
Thu, 20 Mar 2008 15:08:33 +0000 (16:08 +0100)
committerJoshua Ferraro <jmf@liblime.com>
Sat, 22 Mar 2008 02:45:11 +0000 (21:45 -0500)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Acquisition.pm
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tmpl

index 2b2f001..e7547fd 100644 (file)
@@ -506,22 +506,23 @@ sub ModOrder {
                $ordnum,   $bibnum
     );
     $sth->finish;
+    my $branchcode;  
     $query = "
         UPDATE aqorderbreakdown
-        SET    bookfundid=?
+        SET    bookfundid=?,branchcode=?
         WHERE  ordernumber=?
     ";
     $sth = $dbh->prepare($query);
 
-    unless ( $sth->execute( $bookfund, $ordnum ) )
+    unless ( $sth->execute( $bookfund,$branchcode, $ordnum ) )
     {    # zero rows affected [Bug 734]
         my $query ="
             INSERT INTO aqorderbreakdown
-                     (ordernumber,bookfundid)
-            VALUES   (?,?)
+                     (ordernumber,branchcode,bookfundid)
+            VALUES   (?,?,?)
         ";
         $sth = $dbh->prepare($query);
-        $sth->execute( $ordnum, $bookfund );
+        $sth->execute( $ordnum,$branchcode, $bookfund );
     }
     $sth->finish;
 }
@@ -626,10 +627,7 @@ sub ModReceiveOrder {
                     $order->{'listprice'},$order->{'booksellerid'},$order->{'authorisedby'},$order->{'notes'},   
                     $order->{'bookfundid'},$order->{'biblioitemnumber'},$order->{'rrp'},$order->{'ecost'},$order->{'gst'},
                     $order->{'budget'},$order->{'unitcost'},$order->{'sub'},'',$order->{'sort1'},$order->{'sort2'},$order->{'purchaseordernumber'});
-    
-        $sth=$dbh->prepare(" insert into aqorderbreakdown (ordernumber, branchcode, bookfundid) values (?,?,?)"); 
-        $sth->execute($newOrder,$order->{branch},$order->{bookfundid});
-    } else {
+  } else {
         $sth=$dbh->prepare("update aqorders 
                                                        set quantityreceived=?,datereceived=?,booksellerinvoicenumber=?, 
                                                                unitprice=?,freight=?,rrp=?
index e3f8509..645e1d7 100644 (file)
                 <td><a href="/cgi-bin/koha/acqui/basket.pl?basketno=<!-- TMPL_VAR NAME="basketno" -->"><!-- TMPL_VAR NAME="basketno" --></a></td>
                 <td>
                   <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->"><!-- TMPL_VAR NAME="title" --></a>
-                  <!-- TMPL_VAR NAME="title" --></a>
                 <!-- TMPL_IF NAME="isbn" --><br />ISBN: <!-- TMPL_VAR NAME="isbn" --><!--/TMPL_IF-->
                 <!-- TMPL_IF NAME="author" --><br />author :<!-- TMPL_VAR NAME="author" --><!--/TMPL_IF-->
                 <!-- TMPL_IF NAME="publishercode" --><br />Publisher :<!-- TMPL_VAR NAME="publishercode" --><!--/TMPL_IF-->