From fc9fb3986e7432cc36b069b4c9f54fad58c8ccef Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Sat, 21 Jan 2017 15:48:57 +0100 Subject: [PATCH] Bug 17964: Add old_issues If it's a CHECKIN, C4::Circulation::SendCirculationAlert set a "old_issues" key instead of "issues". --- C4/Letters.pm | 6 ++++++ t/db_dependent/Letters/TemplateToolkit.t | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index 29e54c8..2d3fbe4 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -1534,6 +1534,12 @@ sub _get_tt_params { plural => 'checkouts', fk => 'itemnumber', }, + old_issues => { + module => 'Koha::Old::Checkouts', + singular => 'old_checkout', + plural => 'old_checkouts', + fk => 'itemnumber', + }, borrower_modifications => { module => 'Koha::Patron::Modifications', singular => 'patron_modification', diff --git a/t/db_dependent/Letters/TemplateToolkit.t b/t/db_dependent/Letters/TemplateToolkit.t index 13bd13c..c8f2e0d 100644 --- a/t/db_dependent/Letters/TemplateToolkit.t +++ b/t/db_dependent/Letters/TemplateToolkit.t @@ -415,13 +415,13 @@ The following items have been checked out: Thank you for visiting <>. |; reset_template( { template => $checkout_template, code => $checkout_code, module => 'circulation' } ); - my $checkin_template = q| + my $checkin_template = q[ The following items have been checkin out: ---- -<> +<> was due on <> ---- Thank you for visiting <>. -|; +]; reset_template( { template => $checkin_template, code => $checkin_code, module => 'circulation' } ); C4::Circulation::AddIssue( $patron, $item1->{barcode} ); @@ -445,13 +445,13 @@ The following items have been checked out: Thank you for visiting [% branch.branchname %]. |; reset_template( { template => $checkout_template, code => $checkout_code, module => 'circulation' } ); - $checkin_template = q| + $checkin_template = q[ The following items have been checkin out: ---- -[% biblio.title %] +[% biblio.title %] was due on [% old_checkout.date_due | $KohaDates %] ---- Thank you for visiting [% branch.branchname %]. -|; +]; reset_template( { template => $checkin_template, code => $checkin_code, module => 'circulation' } ); C4::Circulation::AddIssue( $patron, $item1->{barcode} ); -- 2.1.4