[Koha-patches] [PATCH] Remove some warnings in manual invoice/credit

Colin Campbell colin.campbell at ptfs-europe.com
Fri Mar 26 17:43:27 CET 2010


---
 C4/Accounts.pm        |    3 +--
 members/mancredit.pl  |    5 ++++-
 members/maninvoice.pl |    5 ++++-
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/C4/Accounts.pm b/C4/Accounts.pm
index bce9c19..c7e05bc 100644
--- a/C4/Accounts.pm
+++ b/C4/Accounts.pm
@@ -454,7 +454,6 @@ sub manualinvoice {
     my $dbh      = C4::Context->dbh;
     my $notifyid = 0;
     my $insert;
-    $itemnum =~ s/ //g;
     my $accountno  = getnextacctno($borrowernumber);
     my $amountleft = $amount;
 
@@ -498,7 +497,7 @@ sub manualinvoice {
         $notifyid = 1;
     }
 
-    if ( $itemnum ne '' ) {
+    if ( $itemnum  ) {
         $desc .= " " . $itemnum;
         my $sth = $dbh->prepare(
             "INSERT INTO  accountlines
diff --git a/members/mancredit.pl b/members/mancredit.pl
index 51b71d6..6d28201 100755
--- a/members/mancredit.pl
+++ b/members/mancredit.pl
@@ -43,7 +43,10 @@ my $add=$input->param('add');
 
 if ($add){
     my $barcode=$input->param('barcode');
-    my $itemnum = GetItemnumberFromBarcode($barcode) if $barcode;
+    my $itemnum;
+    if ( $barcode ) {
+        $itemnum = GetItemnumberFromBarcode($barcode);
+    }
     my $desc=$input->param('desc');
     my $amount=$input->param('amount') || 0;
     $amount = -$amount;
diff --git a/members/maninvoice.pl b/members/maninvoice.pl
index df12a2a..ab05aca 100755
--- a/members/maninvoice.pl
+++ b/members/maninvoice.pl
@@ -43,7 +43,10 @@ my $add=$input->param('add');
 if ($add){
 #  print $input->header;
     my $barcode=$input->param('barcode');
-    my $itemnum = GetItemnumberFromBarcode($barcode) if $barcode;
+    my $itemnum;
+    if ($barcode) {
+        $itemnum = GetItemnumberFromBarcode($barcode);
+    }
     my $desc=$input->param('desc');
     my $amount=$input->param('amount');
     my $type=$input->param('type');
-- 
1.6.6.1




More information about the Koha-patches mailing list