koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/C4 Biblio.pm [rel_2_2]


From: Ryan Higgins
Subject: [Koha-cvs] koha/C4 Biblio.pm [rel_2_2]
Date: Sat, 28 Jul 2007 19:39:15 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_2_2
Changes by:     Ryan Higgins <rych>     07/07/28 19:39:14

Modified files:
        C4             : Biblio.pm 

Log message:
        Allow modification of price & replacementprice in OLDmoditem.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Biblio.pm?cvsroot=koha&only_with_tag=rel_2_2&r1=1.115.2.72&r2=1.115.2.73

Patches:
Index: Biblio.pm
===================================================================
RCS file: /sources/koha/koha/C4/Biblio.pm,v
retrieving revision 1.115.2.72
retrieving revision 1.115.2.73
diff -u -b -r1.115.2.72 -r1.115.2.73
--- Biblio.pm   29 May 2007 13:13:32 -0000      1.115.2.72
+++ Biblio.pm   28 Jul 2007 19:39:14 -0000      1.115.2.73
@@ -26,7 +26,7 @@
 use vars qw($VERSION @ISA @EXPORT);
 
 # set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.115.2.72 $' =~ /\d+/g;
+$VERSION = do { my @v = '$Revision: 1.115.2.73 $' =~ /\d+/g;
                     shift(@v) . "." . join("_", map {sprintf "%03d", $_ } @v); 
};
 
 @ISA = qw(Exporter);
@@ -594,7 +594,7 @@
             $record->add_fields($field);
         }
     }
-    warn "XML : ".$record->as_xml();
+#    warn "XML : ".$record->as_xml();
     return $record;
 }
 
@@ -2024,18 +2024,9 @@
                $item->{wthdrawn},
     );
     if ( $item->{'lost'} ne '' ) {
-        $query = "update items set 
biblioitemnumber=?,barcode=?,itemnotes=?,homebranch=?,
-                                                       
itemlost=?,wthdrawn=?,itemcallnumber=?,notforloan=?,
-                                                       
location=?,multivolumepart=?,multivolume=?,stack=?,wthdrawn=?";
-        @bind = (
-            $item->{'bibitemnum'},     $item->{'barcode'},
-            $item->{'itemnotes'},          $item->{'homebranch'},
-            $item->{'lost'},           $item->{'wthdrawn'},
-            $item->{'itemcallnumber'}, $item->{'notforloan'},
-            $item->{'location'},               $item->{multivolumepart},
-                       $item->{multivolume},           $item->{stack},
-                       $item->{wthdrawn},
-        );
+       # FIXME - why do we add bibitem ?
+       $query .= " ,itemlost=?,biblioitemnumber=?";
+               push @bind,  ( $item->{'lost'}, $item->{'bibitemnum'} );
     }
     if ($item->{homebranch}) {
         $query.=",homebranch=?";
@@ -2045,11 +2036,21 @@
         $query.=",holdingbranch=?";
         push @bind, $item->{holdingbranch};
     }
+    if ($item->{replacement} || $item->{replacementprice}) {
+        $query.=",replacementprice=?";
+               my $currency = $item->{replacement} || 
$item->{replacementprice};
+               $currency =~ s/[^0-9.]//g;
+        push @bind, $currency ;
+    }
+    if ($item->{price}) {
+        $query.=",price=?";
+               my $currency = $item->{price};
+               $currency =~ s/[^0-9.]//g;
+        push @bind, $currency ;
+    }
        $query.=" where itemnumber=?";
        push @bind,$item->{'itemnum'};
-   if ( $item->{'replacement'} ne '' ) {
-        $query =~ s/ where/,replacementprice='$item->{'replacement'}' where/;
-    }
+
     my $sth = $dbh->prepare($query);
     $sth->execute(@bind);
     $sth->finish;
@@ -3040,8 +3041,11 @@
 
 =cut
 
-# $Id: Biblio.pm,v 1.115.2.72 2007/05/29 13:13:32 hdl Exp $
+# $Id: Biblio.pm,v 1.115.2.73 2007/07/28 19:39:14 rych Exp $
 # $Log: Biblio.pm,v $
+# Revision 1.115.2.73  2007/07/28 19:39:14  rych
+# Allow modification of price & replacementprice in OLDmoditem.
+#
 # Revision 1.115.2.72  2007/05/29 13:13:32  hdl
 # Adding delete from subtitle in OLDdelbiblio
 #




reply via email to

[Prev in Thread] Current Thread [Next in Thread]