From c3d1b33a2aac48e7825935f6f4ae35afe40d9aea Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Mon, 8 Feb 2010 12:20:24 +0000 Subject: [PATCH] Remove cause of some warnings in order display Signed-off-by: Galen Charlton --- 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 148d3a1893..80dd667826 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 a2f5b2e73b..eaa6f59084 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}; -- 2.39.5