Bug 18259: [QA Follow-up] Replace variable name
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 14 Jul 2017 09:20:28 +0000 (11:20 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 14 Jul 2017 15:02:30 +0000 (12:02 -0300)
The variable name has_subscriptions implies that it is a boolean. In reality
we save the number of subscriptions into it. Renaming has_ to cnt_.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

acqui/basket.pl
acqui/parcel.pl

index 02b9eba..7a039d4 100755 (executable)
@@ -134,10 +134,10 @@ if ( $op eq 'delete_confirm' ) {
             my $biblio = Koha::Biblios->find( $biblionumber );
             my $countbiblio = CountBiblioInOrders($biblionumber);
             my $ordernumber = $myorder->{'ordernumber'};
-            my $has_subscriptions = $biblio->subscriptions->count;
+            my $cnt_subscriptions = $biblio->subscriptions->count;
             my $itemcount = $biblio->items->count;
             my $error;
-            if ($countbiblio == 0 && $itemcount == 0 && not $has_subscriptions ) {
+            if ($countbiblio == 0 && $itemcount == 0 && not $cnt_subscriptions ) {
                 $error = DelBiblio($myorder->{biblionumber}) }
             else {
                 push @cannotdelbiblios, {biblionumber=> ($myorder->{biblionumber}),
@@ -145,7 +145,7 @@ if ( $op eq 'delete_confirm' ) {
                                          author=> $myorder->{'author'},
                                          countbiblio=> $countbiblio,
                                          itemcount=>$itemcount,
-                                         subscriptions => $has_subscriptions};
+                                         subscriptions => $cnt_subscriptions};
             }
             if ($error) {
                 push @cannotdelbiblios, {biblionumber=> ($myorder->{biblionumber}),
@@ -474,20 +474,20 @@ sub get_order_infos {
         my $biblio = Koha::Biblios->find( $biblionumber );
         my $countbiblio = CountBiblioInOrders($biblionumber);
         my $ordernumber = $order->{'ordernumber'};
-        my $has_subscriptions = $biblio->subscriptions->count;
+        my $cnt_subscriptions = $biblio->subscriptions->count;
         my $itemcount   = $biblio->items->count;
         my $holds_count = $biblio->holds->count;
         my @items = GetItemnumbersFromOrder( $ordernumber );
         my $itemholds  = $biblio->holds->search({ itemnumber => { -in => \@items } })->count;
 
         # if the biblio is not in other orders and if there is no items elsewhere and no subscriptions and no holds we can then show the link "Delete order and Biblio" see bug 5680
-        $line{can_del_bib}          = 1 if $countbiblio <= 1 && $itemcount == scalar @items && !($has_subscriptions) && !($holds_count);
+        $line{can_del_bib}          = 1 if $countbiblio <= 1 && $itemcount == scalar @items && !($cnt_subscriptions) && !($holds_count);
         $line{items}                = ($itemcount) - (scalar @items);
         $line{left_item}            = 1 if $line{items} >= 1;
         $line{left_biblio}          = 1 if $countbiblio > 1;
         $line{biblios}              = $countbiblio - 1;
-        $line{left_subscription}    = 1 if $has_subscriptions;
-        $line{subscriptions}        = $has_subscriptions;
+        $line{left_subscription}    = 1 if $cnt_subscriptions;
+        $line{subscriptions}        = $cnt_subscriptions;
         ($holds_count >= 1) ? $line{left_holds} = 1 : $line{left_holds} = 0;
         $line{left_holds_on_order}  = 1 if $line{left_holds}==1 && ($line{items} == 0 || $itemholds );
         $line{holds}                = $holds_count;
index 14518a8..5c73d97 100755 (executable)
@@ -241,7 +241,7 @@ unless( defined $invoice->{closedate} ) {
         my $biblio = Koha::Biblios->find( $biblionumber );
         my $countbiblio = CountBiblioInOrders($biblionumber);
         my $ordernumber = $line{'ordernumber'};
-        my $has_subscriptions = $biblio->subscriptions->count;
+        my $cnt_subscriptions = $biblio->subscriptions->count;
         my $itemcount   = $biblio->items->count;
         my $holds_count = $biblio->holds->count;
         my @items = GetItemnumbersFromOrder( $ordernumber );
@@ -253,13 +253,13 @@ unless( defined $invoice->{closedate} ) {
         $line{firstnamesuggestedby} = $suggestion->{firstnamesuggestedby};
 
         # if the biblio is not in other orders and if there is no items elsewhere and no subscriptions and no holds we can then show the link "Delete order and Biblio" see bug 5680
-        $line{can_del_bib}          = 1 if $countbiblio <= 1 && $itemcount == scalar @items && !($has_subscriptions) && !($holds_count);
+        $line{can_del_bib}          = 1 if $countbiblio <= 1 && $itemcount == scalar @items && !($cnt_subscriptions) && !($holds_count);
         $line{items}                = ($itemcount) - (scalar @items);
         $line{left_item}            = 1 if $line{items} >= 1;
         $line{left_biblio}          = 1 if $countbiblio > 1;
         $line{biblios}              = $countbiblio - 1;
-        $line{left_subscription}    = 1 if $has_subscriptions;
-        $line{subscriptions}        = $has_subscriptions;
+        $line{left_subscription}    = 1 if $cnt_subscriptions;
+        $line{subscriptions}        = $cnt_subscriptions;
         $line{left_holds}           = ($holds_count >= 1) ? 1 : 0;
         $line{left_holds_on_order}  = 1 if $line{left_holds}==1 && ($line{items} == 0 || $itemholds );
         $line{holds}                = $holds_count;