koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] koha/C4 Bookfund.pm [rel_3_0]


From: Henri-Damien LAURENT
Subject: [Koha-cvs] koha/C4 Bookfund.pm [rel_3_0]
Date: Thu, 11 Jan 2007 09:30:12 +0000

CVSROOT:        /cvsroot/koha
Module name:    koha
Branch:         rel_3_0
Changes by:     Henri-Damien LAURENT <hdl>      07/01/11 09:30:11

Modified files:
        C4             : Bookfund.pm 

Log message:
        Still little Bug fixing:
        using undefined values in calculations

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Bookfund.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.3.2.2&r2=1.3.2.3

Patches:
Index: Bookfund.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Bookfund.pm,v
retrieving revision 1.3.2.2
retrieving revision 1.3.2.3
diff -u -b -r1.3.2.2 -r1.3.2.3
--- Bookfund.pm 19 Dec 2006 15:15:13 -0000      1.3.2.2
+++ Bookfund.pm 11 Jan 2007 09:30:11 -0000      1.3.2.3
@@ -17,7 +17,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: Bookfund.pm,v 1.3.2.2 2006/12/19 15:15:13 toins Exp $
+# $Id: Bookfund.pm,v 1.3.2.3 2007/01/11 09:30:11 hdl Exp $
 
 use strict;
 
@@ -25,7 +25,7 @@
 use vars qw($VERSION @ISA @EXPORT);
 
 # set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.3.2.2 $' =~ /\d+/g; shift(@v) . "." . 
join( "_", map { sprintf "%03d", $_ } @v ); };
+$VERSION = do { my @v = '$Revision: 1.3.2.3 $' =~ /\d+/g; shift(@v) . "." . 
join( "_", map { sprintf "%03d", $_ } @v ); };
 
 =head1 NAME
 
@@ -242,8 +242,8 @@
         }
         else {
 
-            my $leftover = $data->{'quantity'} - $data->{'quantityreceived'};
-            $spent += ( $data->{'unitprice'} ) * $data->{'quantityreceived'};
+            my $leftover = $data->{'quantity'} - 
($data->{'quantityreceived'}?$data->{'quantityreceived'}:0);
+            $spent += ( $data->{'unitprice'} ) * 
($data->{'quantityreceived'}?$data->{'quantityreceived'}:0);
 
         }
     }
@@ -480,7 +480,7 @@
     my $sth = $dbh->prepare($query);
     $sth->execute($currency);
     my $cur = ( $sth->fetchrow_array() )[0];
-    if ( $cur == 0 ) {
+    unless($cur) {
         $cur = 1;
     }
     return ( $price / $cur );




reply via email to

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