@@ -, +, @@
compatible
[% today | $KohaDates %]
[% today | $KohaDates with_hours => 1 %]
---
C4/Letters.pm | 2 +-
t/db_dependent/Letters/TemplateToolkit.t | 86 +++++++++++++++++++++++++++++++-
2 files changed, 85 insertions(+), 3 deletions(-)
--- a/C4/Letters.pm
+++ a/C4/Letters.pm
@@ -1627,7 +1627,7 @@ sub _get_tt_params {
}
}
- $params->{today} = dt_from_string();
+ $params->{today} = output_pref({ dt => dt_from_string, dateformat => 'iso' });
return $params;
}
--- a/t/db_dependent/Letters/TemplateToolkit.t
+++ a/t/db_dependent/Letters/TemplateToolkit.t
@@ -286,11 +286,11 @@ $prepared_letter = GetPreparedLetter(
is( $prepared_letter->{content}, $modification->id(), 'Patron modification object used correctly' );
subtest 'regression tests' => sub {
- plan tests => 4;
+ plan tests => 5;
my $library = $builder->build( { source => 'Branch' } );
my $patron = $builder->build( { source => 'Borrower' } );
- my $biblio1 = Koha::Biblio->new({title => 'Test Biblio 1'})->store->unblessed;
+ my $biblio1 = Koha::Biblio->new({title => 'Test Biblio 1', author => 'An author', })->store->unblessed;
my $biblioitem1 = Koha::Biblioitem->new({biblionumber => $biblio1->{biblionumber}})->store()->unblessed;
my $item1 = Koha::Item->new(
{
@@ -300,6 +300,7 @@ subtest 'regression tests' => sub {
homebranch => $library->{branchcode},
holdingbranch => $library->{branchcode},
itype => 'BK',
+ itemcallnumber => 'itemcallnumber1',
}
)->store->unblessed;
my $biblio2 = Koha::Biblio->new({title => 'Test Biblio 2'})->store->unblessed;
@@ -312,6 +313,7 @@ subtest 'regression tests' => sub {
homebranch => $library->{branchcode},
holdingbranch => $library->{branchcode},
itype => 'BK',
+ itemcallnumber => 'itemcallnumber2',
}
)->store->unblessed;
@@ -500,6 +502,86 @@ You have [% count %] items due
my $tt_letter = process_letter( { template => $tt_template, %$params });
is( $tt_letter->{content}, $letter->{content}, );
};
+
+ subtest 'HOLD_SLIP|dates|today' => sub {
+ plan tests => 2;
+
+ my $code = 'HOLD_SLIP';
+
+ C4::Reserves::AddReserve( $library->{branchcode}, $patron->{borrowernumber}, $biblio1->{biblionumber}, undef, undef, undef, undef, "a note", undef, $item1->{itemnumber}, 'W' );
+ C4::Reserves::AddReserve( $library->{branchcode}, $patron->{borrowernumber}, $biblio2->{biblionumber}, undef, undef, undef, undef, "another note", undef, $item2->{itemnumber} );
+
+ my $template = < Notes:
+ Transfer to/Hold in <
+
+<
+
+
+
+
+ <
+ <
+ITEM ON HOLD
+<
+<
+
+
+<
+
Notes: +
[% hold.reservenotes %]+ +EOF + + reset_template( { template => $tt_template, code => $code, module => 'circulation' } ); + my $tt_letter_for_item1 = C4::Reserves::ReserveSlip( $library->{branchcode}, $patron->{borrowernumber}, $biblio1->{biblionumber} ); + my $tt_letter_for_item2 = C4::Reserves::ReserveSlip( $library->{branchcode}, $patron->{borrowernumber}, $biblio2->{biblionumber} ); + + is( $tt_letter_for_item1->{content}, $letter_for_item1->{content}, ); + is( $tt_letter_for_item2->{content}, $letter_for_item2->{content}, ); + }; }; subtest 'loops' => sub { --