Lines 30-35
use C4::Members;
Link Here
|
30 |
use C4::Biblio; |
30 |
use C4::Biblio; |
31 |
use Koha::Database; |
31 |
use Koha::Database; |
32 |
use Koha::DateUtils; |
32 |
use Koha::DateUtils; |
|
|
33 |
use Koha::ArticleRequests; |
33 |
use Koha::Biblio; |
34 |
use Koha::Biblio; |
34 |
use Koha::Biblioitem; |
35 |
use Koha::Biblioitem; |
35 |
use Koha::Item; |
36 |
use Koha::Item; |
Lines 39-44
use Koha::Serial;
Link Here
|
39 |
use Koha::Subscription; |
40 |
use Koha::Subscription; |
40 |
use Koha::Suggestion; |
41 |
use Koha::Suggestion; |
41 |
use Koha::Checkout; |
42 |
use Koha::Checkout; |
|
|
43 |
use Koha::Notice::Messages; |
42 |
use Koha::Notice::Templates; |
44 |
use Koha::Notice::Templates; |
43 |
use Koha::Patron::Modification; |
45 |
use Koha::Patron::Modification; |
44 |
|
46 |
|
Lines 282-288
$prepared_letter = GetPreparedLetter(
Link Here
|
282 |
is( $prepared_letter->{content}, $modification->id(), 'Patron modification object used correctly' ); |
284 |
is( $prepared_letter->{content}, $modification->id(), 'Patron modification object used correctly' ); |
283 |
|
285 |
|
284 |
subtest 'regression tests' => sub { |
286 |
subtest 'regression tests' => sub { |
285 |
plan tests => 1; |
287 |
plan tests => 2; |
286 |
|
288 |
|
287 |
my $library = $builder->build( { source => 'Branch' } ); |
289 |
my $library = $builder->build( { source => 'Branch' } ); |
288 |
my $patron = $builder->build( { source => 'Borrower' } ); |
290 |
my $patron = $builder->build( { source => 'Borrower' } ); |
Lines 323-328
subtest 'regression tests' => sub {
Link Here
|
323 |
|
325 |
|
324 |
is( $tt_letter->{content}, $letter->{content}, ); |
326 |
is( $tt_letter->{content}, $letter->{content}, ); |
325 |
}; |
327 |
}; |
|
|
328 |
|
329 |
subtest 'AR_*' => sub { |
330 |
plan tests => 2; |
331 |
my $code = 'AR_CANCELED'; |
332 |
my $branchcode = $library->{branchcode}; |
333 |
|
334 |
my $template = q| |
335 |
<<borrowers.firstname>> <<borrowers.surname>> (<<borrowers.cardnumber>>) |
336 |
|
337 |
Your request for an article from <<biblio.title>> (<<items.barcode>>) has been canceled for the following reason: |
338 |
|
339 |
<<article_requests.notes>> |
340 |
|
341 |
Article requested: |
342 |
Title: <<article_requests.title>> |
343 |
Author: <<article_requests.author>> |
344 |
Volume: <<article_requests.volume>> |
345 |
Issue: <<article_requests.issue>> |
346 |
Date: <<article_requests.date>> |
347 |
Pages: <<article_requests.pages>> |
348 |
Chapters: <<article_requests.chapters>> |
349 |
Notes: <<article_requests.patron_notes>> |
350 |
|; |
351 |
reset_template( { template => $template, code => $code, module => 'circulation' } ); |
352 |
my $article_request = $builder->build({ source => 'ArticleRequest' }); |
353 |
Koha::ArticleRequests->find( $article_request->{id} )->cancel; |
354 |
my $letter = Koha::Notice::Messages->search( {}, { order_by => { -desc => 'message_id' } } )->next; |
355 |
|
356 |
my $tt_template = q| |
357 |
[% borrower.firstname %] [% borrower.surname %] ([% borrower.cardnumber %]) |
358 |
|
359 |
Your request for an article from [% biblio.title %] ([% item.barcode %]) has been canceled for the following reason: |
360 |
|
361 |
[% article_request.notes %] |
362 |
|
363 |
Article requested: |
364 |
Title: [% article_request.title %] |
365 |
Author: [% article_request.author %] |
366 |
Volume: [% article_request.volume %] |
367 |
Issue: [% article_request.issue %] |
368 |
Date: [% article_request.date %] |
369 |
Pages: [% article_request.pages %] |
370 |
Chapters: [% article_request.chapters %] |
371 |
Notes: [% article_request.patron_notes %] |
372 |
|; |
373 |
reset_template( { template => $tt_template, code => $code, module => 'circulation' } ); |
374 |
Koha::ArticleRequests->find( $article_request->{id} )->cancel; |
375 |
my $tt_letter = Koha::Notice::Messages->search( {}, { order_by => { -desc => 'message_id' } } )->next; |
376 |
is( $tt_letter->content, $letter->content, 'Compare AR_* notices' ); |
377 |
isnt( $tt_letter->message_id, $letter->message_id, 'Comparing AR_* notices should compare 2 different messages' ); |
378 |
}; |
326 |
}; |
379 |
}; |
327 |
|
380 |
|
328 |
sub reset_template { |
381 |
sub reset_template { |
329 |
- |
|
|