[Koha-patches] [PATCH] Remove cause of some warnings in order display

Colin Campbell colin.campbell at ptfs-europe.com
Mon Feb 8 13:20:24 CET 2010


---
 C4/Acquisition.pm |    2 +-
 acqui/basket.pl   |    8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm
index 148d3a1..80dd667 100644
--- a/C4/Acquisition.pm
+++ b/C4/Acquisition.pm
@@ -1009,7 +1009,7 @@ sub NewOrder {
         die "Mandatory parameter $key missing" unless $orderinfo->{$key};
     }
 
-    if ( $orderinfo->{'subscription'} eq 'yes' ) {
+    if ( defined $orderinfo->{subscription} && $orderinfo->{'subscription'} eq 'yes' ) {
         $orderinfo->{'subscription'} = 1;
     } else {
         $orderinfo->{'subscription'} = 0;
diff --git a/acqui/basket.pl b/acqui/basket.pl
index a2f5b2e..eaa6f59 100755
--- a/acqui/basket.pl
+++ b/acqui/basket.pl
@@ -86,6 +86,9 @@ my $basket = GetBasket($basketno);
 $booksellerid = $basket->{booksellerid} unless $booksellerid;
 my ($bookseller) = GetBookSellerFromId($booksellerid);
 my $op = $query->param('op');
+if (!defined $op) {
+    $op = q{};
+}
 
 if ( $op eq 'delete_confirm' ) {
     my $basketno = $query->param('basketno');
@@ -231,6 +234,9 @@ if ( $op eq 'delete_confirm' ) {
     for ( my $i = 0 ; $i < $count ; $i++ ) {
         my $rrp = $results[$i]->{'listprice'};
 		my $qty = $results[$i]->{'quantity'} || 0;
+        if (!defined $results[$i]->{quantityreceived}) {
+            $results[$i]->{quantityreceived} = 0;
+        }
 
         my $budget = GetBudget(  $results[$i]->{'budget_id'} );
         $rrp = ConvertCurrency( $results[$i]->{'currency'}, $rrp );
@@ -242,7 +248,7 @@ if ( $op eq 'delete_confirm' ) {
         my %line = %{ $results[$i] };
 		($i%2) and $line{toggle} = 1;
 
-        $line{order_received} = ( $qty eq $results[$i]->{'quantityreceived'} );
+        $line{order_received} = ( $qty == $results[$i]->{'quantityreceived'} );
         $line{basketno}       = $basketno;
         $line{i}              = $i;
         $line{budget_name}    = $budget->{budget_name};
-- 
1.6.6




More information about the Koha-patches mailing list