View | Details | Raw Unified | Return to bug 21620
Collapse All | Expand All

(-)a/misc/cronjobs/stockrotation.pl (-15 / +11 lines)
Lines 216-224 sub report_full { Link Here
216
    my $body   = "";
216
    my $body   = "";
217
217
218
    # Summary
218
    # Summary
219
    $header .= sprintf "
219
    $header .= "STOCKROTATION REPORT\n";
220
STOCKROTATION REPORT
220
    $header .= "--------------------\n";
221
--------------------\n";
222
    $body .= sprintf "
221
    $body .= sprintf "
223
  Total number of rotas:         %5u
222
  Total number of rotas:         %5u
224
    Inactive rotas:              %5u
223
    Inactive rotas:              %5u
Lines 237-261 STOCKROTATION REPORT Link Here
237
      $data->{advanceable}, $data->{indemand};
236
      $data->{advanceable}, $data->{indemand};
238
237
239
    if ( @{ $data->{rotas} } ) {    # Per Rota details
238
    if ( @{ $data->{rotas} } ) {    # Per Rota details
240
        $body .= sprintf "ROTAS DETAIL\n------------\n\n";
239
        $body .= "ROTAS DETAIL\n";
240
        $body .= "------------\n\n";
241
        foreach my $rota ( @{ $data->{rotas} } ) {
241
        foreach my $rota ( @{ $data->{rotas} } ) {
242
            $body .= sprintf "Details for %s [%s]:\n",
242
            $body .= sprintf "Details for %s [%s]:\n",
243
              $rota->{name}, $rota->{id};
243
              $rota->{name}, $rota->{id};
244
            $body .= sprintf "\n  Items:";    # Rota item details
244
            $body .= "\n  Items:";    # Rota item details
245
            if ( @{ $rota->{items} } ) {
245
            if ( @{ $rota->{items} } ) {
246
                $body .=
246
                $body .=
247
                  join( "", map { _print_item($_) } @{ $rota->{items} } );
247
                  join( "", map { _print_item($_) } @{ $rota->{items} } );
248
            }
248
            }
249
            else {
249
            else {
250
                $body .=
250
                $body .= "\n    No items to be processed for this rota.\n";
251
                  sprintf "\n    No items to be processed for this rota.\n";
252
            }
251
            }
253
            $body .= sprintf "\n  Log:";      # Rota log details
252
            $body .= "\n  Log:";      # Rota log details
254
            if ( @{ $rota->{log} } ) {
253
            if ( @{ $rota->{log} } ) {
255
                $body .= join( "", map { _print_item($_) } @{ $rota->{log} } );
254
                $body .= join( "", map { _print_item($_) } @{ $rota->{log} } );
256
            }
255
            }
257
            else {
256
            else {
258
                $body .= sprintf "\n    No items in log for this rota.\n\n";
257
                $body .= "\n    No items in log for this rota.\n\n";
259
            }
258
            }
260
        }
259
        }
261
    }
260
    }
Lines 298-306 sub report_email { Link Here
298
    my $branched = $data->{branched};
297
    my $branched = $data->{branched};
299
    my $flag     = 0;
298
    my $flag     = 0;
300
299
301
    $header .= sprintf "
300
    $header .= "BRANCH-BASED STOCKROTATION REPORT\n";
302
BRANCH-BASED STOCKROTATION REPORT
301
    $header .= "---------------------------------\n";
303
---------------------------------\n";
304
    push @{$out}, $header;
302
    push @{$out}, $header;
305
303
306
    if ($branch) {    # Branch limited report
304
    if ($branch) {    # Branch limited report
Lines 314-321 BRANCH-BASED STOCKROTATION REPORT Link Here
314
    }
312
    }
315
    else {
313
    else {
316
        push @{$out}, {
314
        push @{$out}, {
317
            body => sprintf "
315
            body => "No actionable items at any libraries.\n\n",    # The body of the report
318
No actionable items at any libraries.\n\n",    # The body of the report
319
            no_branch_email => 1,    # We don't expect branch email in report
316
            no_branch_email => 1,    # We don't expect branch email in report
320
        };
317
        };
321
    }
318
    }
322
- 

Return to bug 21620