Remove superfluous whitespace in Storage/Publisher/action.pm.
authorJason Stephenson <jason@sigio.com>
Tue, 7 Jan 2014 16:46:22 +0000 (11:46 -0500)
committerKathy Lussier <klussier@masslnc.org>
Thu, 13 Feb 2014 05:39:42 +0000 (00:39 -0500)
Also fix a typo in a comment in CircCommon.pm.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm

index e4508bd..9416770 100644 (file)
@@ -395,7 +395,7 @@ sub bill_payment_map_for_xact {
         }
     } @$bills;
 
-    # Find all unvoided payments in order.  Flesh voids do that we
+    # Find all unvoided payments in order.  Flesh voids so that we
     # don't have to retrieve them later.
     my $payments = $e->search_money_payment(
         [
index 912996d..08bd32c 100644 (file)
@@ -288,7 +288,7 @@ sub grab_overdue {
     my $client = shift;
 
     my $idlist = $self->api_name =~/id_list/o ? 1 : 0;
-    
+
     $client->respond( $idlist ? $_ : $_->to_fieldmapper ) for ( overdue_circs('', $idlist) );
 
     return undef;
@@ -557,7 +557,7 @@ sub nearest_hold {
         ORDER BY CASE WHEN h.hold_type IN ('R','F') THEN 0 ELSE 1 END, $holdsort
         LIMIT $limit
     SQL
-    
+
     $client->respond( $_ ) for ( @$ids );
     return undef;
 }
@@ -1051,7 +1051,7 @@ sub generate_fines {
 
         my $ctype = ref($c);
         $ctype =~ s/^.+::(\w+)$/$1/;
-    
+
         my $due_date_method = 'due_date';
         my $target_copy_method = 'target_copy';
         my $circ_lib_method = 'circ_lib';
@@ -1082,36 +1082,36 @@ sub generate_fines {
 
 
             my $due_dt = $parser->parse_datetime( cleanse_ISO8601( $c->$due_date_method ) );
-    
+
             my $due = $due_dt->epoch;
             my $now = time;
 
             my $fine_interval = $c->fine_interval;
             $fine_interval =~ s/(\d{2}):(\d{2}):(\d{2})/$1 h $2 m $3 s/o;
             $fine_interval = interval_to_seconds( $fine_interval );
-    
+
             if ( $fine_interval == 0 || int($c->$recurring_fine_method * 100) == 0 || int($c->max_fine * 100) == 0 ) {
                 $client->respond( "Fine Generator skipping circ due to 0 fine interval, 0 fine rate, or 0 max fine.\n" );
                 $log->info( "Fine Generator skipping circ " . $c->id . " due to 0 fine interval, 0 fine rate, or 0 max fine." );
                 return;
             }
 
-            if ( $is_reservation and $fine_interval >= interval_to_seconds('1d') ) {    
+            if ( $is_reservation and $fine_interval >= interval_to_seconds('1d') ) {
                 my $tz_offset_s = 0;
                 if ($due_dt->strftime('%z') =~ /(-|\+)(\d{2}):?(\d{2})/) {
                     $tz_offset_s = $1 . interval_to_seconds( "${2}h ${3}m"); 
                 }
-    
+
                 $due -= ($due % $fine_interval) + $tz_offset_s;
                 $now -= ($now % $fine_interval) + $tz_offset_s;
             }
-    
+
             $client->respond(
                 "ARG! Overdue $ctype ".$c->id.
                 " for item ".$c->$target_copy_method.
                 " (user ".$c->usr.").\n".
                 "\tItem was due on or before: ".localtime($due)."\n");
-    
+
             my @fines = money::billing->search_where(
                 { xact => $c->id,
                   btype => 1,
@@ -1127,7 +1127,7 @@ sub generate_fines {
 
             my $current_fine_total = 0;
             $current_fine_total += int($_->amount * 100) for (grep { $_ and !$_->voided } @fines);
-    
+
             my $last_fine;
             if ($fine) {
                 $client->respond( "Last billing time: ".$fine->billing_ts." (clensed format: ".cleanse_ISO8601( $fine->billing_ts ).")");
@@ -1168,7 +1168,7 @@ sub generate_fines {
 
             my ($latest_billing_ts, $latest_amount) = ('',0);
             for (my $bill = 1; $bill <= $pending_fine_count; $bill++) {
-    
+
                 if ($current_fine_total >= $max_fine) {
                     $c->update({stop_fines => 'MAXFINES', stop_fines_time => 'now'}) if ($ctype eq 'circulation');
                     $client->respond(
@@ -1177,7 +1177,7 @@ sub generate_fines {
                         "\tNo more fines will be generated.\n" );
                     last;
                 }
-                
+
                 # XXX Use org time zone (or default to 'local') once we have the ou setting built for that
                 my $billing_ts = DateTime->from_epoch( epoch => $last_fine, time_zone => 'local' );
                 my $current_bill_count = $bill;
@@ -1195,7 +1195,7 @@ sub generate_fines {
                     if (my $h = $hoo{$c->$circ_lib_method}) {
                         next if ( $h->$dow_open eq '00:00:00' and $h->$dow_close eq '00:00:00');
                     }
-    
+
                     my @cl = actor::org_unit::closed_date->search_where(
                             { close_start   => { '<=' => $timestamptz },
                               close_end => { '>=' => $timestamptz },
@@ -1232,7 +1232,7 @@ sub generate_fines {
 
             $self->method_lookup('open-ils.storage.transaction.commit')->run;
 
-            if(1) { 
+            if(1) {
 
                 # Caluclate penalties inline
                 OpenILS::Utils::Penalty->calculate_penalties(
@@ -1242,7 +1242,7 @@ sub generate_fines {
 
                 # Calculate penalties with an aysnc call to the penalty server.  This approach
                 # may lead to duplicate penalties since multiple penalty processes for a
-                # given user may be running at the same time. Leave this here for reference 
+                # given user may be running at the same time. Leave this here for reference
                 # in case we later find that asyc calls are needed in some environments.
                 $penalty->request(
                     'open-ils.penalty.patron_penalty.calculate',
@@ -1404,16 +1404,16 @@ sub new_hold_copy_targeter {
                 if ( DateTime->compare($ex_time, DateTime->now) < 0 ) {
 
                     # cancel cause = un-targeted expiration
-                    $hold->update( { cancel_time => 'now', cancel_cause => 1 } ); 
+                    $hold->update( { cancel_time => 'now', cancel_cause => 1 } );
 
                     # refresh fields from the DB while still in the xact
-                    my $fm_hold = $hold->to_fieldmapper; 
+                    my $fm_hold = $hold->to_fieldmapper;
 
                     $self->method_lookup('open-ils.storage.transaction.commit')->run;
 
                     # tell A/T the hold was cancelled
                     my $ses = OpenSRF::AppSession->create('open-ils.trigger');
-                    $ses->request('open-ils.trigger.event.autocreate', 
+                    $ses->request('open-ils.trigger.event.autocreate',
                         'hold_request.cancel.expire_no_target', $fm_hold, $fm_hold->pickup_lib);
 
                     die "OK\n";
@@ -1495,7 +1495,7 @@ sub new_hold_copy_targeter {
                           deleted => 'f' }
                     )
                 ] if (@part_maps);
-                    
+
             } elsif ($hold->hold_type eq 'I') {
                 my ($itree) = $self
                     ->method_lookup( 'open-ils.storage.serial.issuance.ranged_tree')
@@ -1506,7 +1506,7 @@ sub new_hold_copy_targeter {
                         { id => [map {$_->unit->id} @{ $itree->items }],
                           deleted => 'f' }
                     ) if ($itree && @{ $itree->items });
-                    
+
             } elsif  ($hold->hold_type eq 'C' || $hold->hold_type eq 'R' || $hold->hold_type eq 'F') {
                 my $_cp = asset::copy->retrieve($hold->target);
                 push @$all_copies, $_cp if $_cp;
@@ -1515,8 +1515,8 @@ sub new_hold_copy_targeter {
             # Force and recall holds bypass pretty much everything
             if ($hold->hold_type ne 'R' && $hold->hold_type ne 'F') {
                 # trim unholdables
-                @$all_copies = grep {   isTrue($_->status->holdable) && 
-                            isTrue($_->location->holdable) && 
+                @$all_copies = grep {   isTrue($_->status->holdable) &&
+                            isTrue($_->location->holdable) &&
                             isTrue($_->holdable) &&
                             !isTrue($_->deleted) &&
                             (isTrue($hold->mint_condition) ? isTrue($_->mint_condition) : 1) &&
@@ -1527,7 +1527,7 @@ sub new_hold_copy_targeter {
 
             # let 'em know we're still working
             $client->status( new OpenSRF::DomainObject::oilsContinueStatus );
-            
+
             # if we have no copies ...
             if (!ref $all_copies || !@$all_copies) {
                 $log->info("\tNo copies available for targeting at all!\n");
@@ -1614,7 +1614,7 @@ sub new_hold_copy_targeter {
             my $old_best_still_valid = 0; # Assume no, but the next line says yes if it is still a potential.
             $old_best_still_valid = 1 if ( $old_best && grep { ''.$old_best->id eq ''.$_->id } @$all_copies );
             $hold->update({ current_copy => undef }) if ($old_best);
-    
+
             if (!scalar(@good_copies)) {
                 $log->info("\tNo (non-current) copies eligible to fill the hold.");
                 if ( $old_best_still_valid ) {
@@ -1662,9 +1662,9 @@ sub new_hold_copy_targeter {
 
                     my %circ_lib_map =  map { (''.$_->circ_lib => 1) } @$all_copies;
                     my $circ_lib_list = [keys %circ_lib_map];
-    
+
                     my $cstore = OpenSRF::AppSession->create('open-ils.cstore');
-    
+
                     # Grab the "biggest" loop for this hold so far
                     my $current_loop = $cstore->request(
                         'open-ils.cstore.json_query',
@@ -1674,10 +1674,10 @@ sub new_hold_copy_targeter {
                           where => { hold => $hold->id}
                         }
                     )->gather(1);
-    
+
                     $current_loop = $current_loop->{max} if ($current_loop);
                     $current_loop ||= 1;
-    
+
                     my $exclude_list = $cstore->request(
                         'open-ils.cstore.json_query.atomic',
                         { distinct => 1,
@@ -1686,7 +1686,7 @@ sub new_hold_copy_targeter {
                           where => { hold => $hold->id}
                         }
                     )->gather(1);
-    
+
                     my @keepers;
                     if ($exclude_list && @$exclude_list) {
                         $exclude_list = [map {$_->{circ_lib}} @$exclude_list];
@@ -1704,9 +1704,9 @@ sub new_hold_copy_targeter {
                     } else {
                         @keepers = @$circ_lib_list;
                     }
-    
+
                     $current_loop++ if (!@keepers);
-    
+
                     if ($self->{max_loops}{$pu_lib} && $self->{max_loops}{$pu_lib} >= $current_loop) {
                         # We haven't exceeded max_loops yet
                         my @keeper_copies;
@@ -1721,16 +1721,16 @@ sub new_hold_copy_targeter {
                         $_->delete for (@oldmaps);
 
                         # cancel cause = un-targeted expiration
-                        $hold->update( { cancel_time => 'now', cancel_cause => 1 } ); 
+                        $hold->update( { cancel_time => 'now', cancel_cause => 1 } );
 
                         # refresh fields from the DB while still in the xact
-                        my $fm_hold = $hold->to_fieldmapper; 
+                        my $fm_hold = $hold->to_fieldmapper;
 
                         $self->method_lookup('open-ils.storage.transaction.commit')->run;
 
                         # tell A/T the hold was cancelled
                         my $ses = OpenSRF::AppSession->create('open-ils.trigger');
-                        $ses->request('open-ils.trigger.event.autocreate', 
+                        $ses->request('open-ils.trigger.event.autocreate',
                             'hold_request.cancel.expire_no_target', $fm_hold, $fm_hold->pickup_lib);
 
                         die "OK\n";
@@ -1748,7 +1748,7 @@ sub new_hold_copy_targeter {
             $client->status( new OpenSRF::DomainObject::oilsContinueStatus );
             if ($old_best) {
                 # hold wasn't fulfilled, record the fact
-            
+
                 $log->info("\tHold was not (but should have been) fulfilled by ".$old_best->id);
                 action::unfulfilled_hold_list->create(
                         { hold => ''.$hold->id,
@@ -1767,7 +1767,7 @@ sub new_hold_copy_targeter {
                         { current_copy => $old_best->id,
                           fulfillment_time => undef,
                           cancel_time => undef,
-                        }       
+                        }
                     ) &&
                 ( OpenILS::Utils::PermitHold::permit_copy_hold(
                     { title => $old_best->call_number->record->to_fieldmapper,
@@ -1780,7 +1780,7 @@ sub new_hold_copy_targeter {
                       retarget => 1
                     }
                 ))
-            ) {     
+            ) {
                 $hold->update( { prev_check_time => 'now', current_copy => ''.$old_best->id } );
                 $log->debug( "\tRetargeting the previously targeted copy [".$old_best->id."]" );
             } else {
@@ -1959,7 +1959,7 @@ sub reservation_targeter {
             if (DateTime->compare($end_time, DateTime->now) < 0) {
 
                 # cancel cause = un-targeted expiration
-                $bresv->update( { cancel_time => 'now' } ); 
+                $bresv->update( { cancel_time => 'now' } );
 
                 # refresh fields from the DB while still in the xact
                 my $fm_bresv = $bresv->to_fieldmapper;
@@ -1968,7 +1968,7 @@ sub reservation_targeter {
 
                 # tell A/T the reservation was cancelled
                 my $ses = OpenSRF::AppSession->create('open-ils.trigger');
-                $ses->request('open-ils.trigger.event.autocreate', 
+                $ses->request('open-ils.trigger.event.autocreate',
                     'booking.reservation.cancel.expire_no_target', $fm_bresv, $fm_bresv->pickup_lib);
 
                 die "OK\n";
@@ -2048,7 +2048,7 @@ sub reservation_targeter {
 
             # let 'em know we're still working
             $client->status( new OpenSRF::DomainObject::oilsContinueStatus );
-            
+
             # if we have no copies ...
             if (!@good_resources) {
                 $log->info("\tNo resources available for targeting at all!\n");
@@ -2150,7 +2150,7 @@ sub copy_hold_capture {
 
     for (my $i = 0; $i < @$cps; $i++) {
         next unless $$cps[$i];
-        
+
         my $cn = $cache{cns}{$copies[$i]->call_number};
         my $rec = $cache{titles}{$cn->record};
         $copies[$i] = undef if ($copies[$i] && !grep{ $copies[$i]->status eq $_->id}@$statuses);
@@ -2179,9 +2179,9 @@ sub copy_hold_capture {
     my $count = @copies;
 
     return unless ($count);
-    
+
     action::hold_copy_map->search( hold => $hold->id )->delete_all;
-    
+
     my @maps;
     $self->{client}->respond( "\tMapping ".scalar(@copies)." eligable copies for hold ".$hold->id."\n");
     for my $c (@copies) {
@@ -2274,7 +2274,7 @@ sub volume_hold_capture {
     my $cp_list;
     try {
         $cp_list = [ asset::copy->search( call_number => \@v_ids ) ];
-    
+
     } catch Error with {
         my $e = shift;
         warn "Could not retrieve copy list:\n\n$e\n";
@@ -2302,7 +2302,7 @@ sub title_hold_capture {
     my $cn_list;
     try {
         ($cn_list) = $self->method_lookup('open-ils.storage.direct.asset.call_number.search.record.atomic')->run( \@t_ids );
-    
+
     } catch Error with {
         my $e = shift;
         warn "Could not retrieve volume list:\n\n$e\n";
@@ -2320,17 +2320,17 @@ sub metarecord_hold_capture {
     my $titles;
     try {
         $titles = [ metabib::metarecord_source_map->search( metarecord => $hold->target) ];
-    
+
     } catch Error with {
         my $e = shift;
         die "Could not retrieve initial title list:\n\n$e\n";
     };
 
     try {
-        my @recs = map {$_->record} metabib::record_descriptor->search( record => $titles, item_type => [split '', $hold->holdable_formats] ); 
+        my @recs = map {$_->record} metabib::record_descriptor->search( record => $titles, item_type => [split '', $hold->holdable_formats] );
 
         $titles = [ biblio::record_entry->search( id => \@recs ) ];
-    
+
     } catch Error with {
         my $e = shift;
         die "Could not retrieve format-pruned title list:\n\n$e\n";