Lines 220-226
sub report_full {
Link Here
|
220 |
# Summary |
220 |
# Summary |
221 |
$header .= "STOCKROTATION REPORT\n"; |
221 |
$header .= "STOCKROTATION REPORT\n"; |
222 |
$header .= "--------------------\n"; |
222 |
$header .= "--------------------\n"; |
223 |
$body .= sprintf " |
223 |
$body .= sprintf " |
224 |
Total number of rotas: %5u |
224 |
Total number of rotas: %5u |
225 |
Inactive rotas: %5u |
225 |
Inactive rotas: %5u |
226 |
Active rotas: %5u |
226 |
Active rotas: %5u |
Lines 275-289
sub report_full {
Link Here
|
275 |
|
275 |
|
276 |
=head3 report_email |
276 |
=head3 report_email |
277 |
|
277 |
|
278 |
my $email_report = report_email($report); |
278 |
my $email_report = report_email($report, [$branch]); |
279 |
|
279 |
|
280 |
Returns an arrayref containing a header string, with basic report information, |
280 |
Returns an arrayref containing a header string, with basic report information, |
281 |
and any number of 'per_branch' strings, containing a detailed report about the |
281 |
and any number of 'per_branch' strings, containing a detailed report about the |
282 |
current state of the stockrotation subsystem, from the perspective of those |
282 |
current state of the stockrotation subsystem, from the perspective of those |
283 |
individual branches. |
283 |
individual branches. |
284 |
|
284 |
|
285 |
$REPORT should be the return value of `investigate`, and $BRANCH should be |
285 |
=over 2 |
286 |
either 0 (to indicate 'all'), or a specific Koha::Library object. |
286 |
|
|
|
287 |
=item $report should be the return value of `investigate` |
288 |
=item $branch is optional and should be either 0 (to indicate 'all'), or a specific Koha::Library object. |
289 |
|
290 |
=back |
287 |
|
291 |
|
288 |
No data in the database is manipulated by this procedure. |
292 |
No data in the database is manipulated by this procedure. |
289 |
|
293 |
|
Lines 323-329
sub report_email {
Link Here
|
323 |
|
327 |
|
324 |
=head3 _report_per_branch |
328 |
=head3 _report_per_branch |
325 |
|
329 |
|
326 |
my $branch_string = _report_per_branch($branch_details, $branchcode, $branchname); |
330 |
my $branch_string = _report_per_branch($branch_details); |
327 |
|
331 |
|
328 |
return a string containing details about the stockrotation items and their |
332 |
return a string containing details about the stockrotation items and their |
329 |
status for the branch identified by $BRANCHCODE. |
333 |
status for the branch identified by $BRANCHCODE. |
Lines 346-351
sub _report_per_branch {
Link Here
|
346 |
my $letter = C4::Letters::GetPreparedLetter( |
350 |
my $letter = C4::Letters::GetPreparedLetter( |
347 |
module => 'circulation', |
351 |
module => 'circulation', |
348 |
letter_code => "SR_SLIP", |
352 |
letter_code => "SR_SLIP", |
|
|
353 |
branchcode => $branch->{code}, |
349 |
message_transport_type => 'email', |
354 |
message_transport_type => 'email', |
350 |
substitute => $branch |
355 |
substitute => $branch |
351 |
) |
356 |
) |
Lines 470-483
sub emit {
Link Here
|
470 |
} |
475 |
} |
471 |
} |
476 |
} |
472 |
else { |
477 |
else { |
473 |
$addressee ||= q{}; |
478 |
$addressee ||= |
474 |
$params->{admin_email} ||= q{}; |
479 |
defined( $params->{admin_email} ) |
|
|
480 |
? $params->{admin_email} . "\n" |
481 |
: 'No recipient found' . "\n"; |
475 |
my $email = |
482 |
my $email = |
476 |
"-------- Email message --------" . "\n\n" . "To: " |
483 |
"-------- Email message --------" . "\n\n"; |
477 |
. defined($addressee) ? $addressee |
484 |
$email .= "To: $addressee\n"; |
478 |
: defined( $params->{admin_email} ) ? $params->{admin_email} |
485 |
$email .= "Subject: " |
479 |
: '' . "\n" |
|
|
480 |
. "Subject: " |
481 |
. $part->{letter}->{title} . "\n\n" |
486 |
. $part->{letter}->{title} . "\n\n" |
482 |
. $part->{letter}->{content}; |
487 |
. $part->{letter}->{content}; |
483 |
push @emails, $email; |
488 |
push @emails, $email; |
484 |
- |
|
|