return C4::Context->tz->name;
}
sub now {
return dt_from_string;
1;
my ($dbh, $out) = @$args{qw(dbh out)};
my $slip_content = <<~'END_CONTENT';
[% USE Koha %]
[% USE Branches %]
[% USE KohaDates %]
[% USE Price %]
[% PROCESS 'accounts.inc' %]
<table>
<tfoot>
<tr>
<td colspan='3'>Total outstanding dues as on date: </td>
<td colspan='3'>Total outstanding dues as of [% KohaDates.output_preference( KohaDates.now ) %]: </td>
[% IF ( borrower.account.balance <= 0 ) %]<td class='credit'>[% ELSE %]<td class='debit'>[% END %][% borrower.account.balance | $Price %]</td>
</tr>
</tfoot>
message_transport_type: print
lang: default
content:
- "[% USE Koha %]"
- "[% USE Branches %]"
- "[% USE KohaDates %]"
- "[% USE Price %]"
- "[% PROCESS 'accounts.inc' %]"
- "<table>"
- ""
- " <tfoot>"
- " <tr>"
- " <td colspan='3'>Total outstanding dues as on date: </td>"
- " <td colspan='3'>Total outstanding dues as of [% KohaDates.output_preference( KohaDates.now ) %]: </td>"
- " [% IF ( borrower.account.balance <= 0 ) %]<td class='credit'>[% ELSE %]<td class='debit'>[% END %][% borrower.account.balance | $Price %]</td>"
- " </tr>"
- " </tfoot>"
use Koha::DateUtils qw( dt_from_string output_pref );
use Test::MockModule;
use Test::More tests => 9;
use Test::More tests => 10;
use t::lib::Mocks;
BEGIN {
$filtered_date = $filter->filter('2014-03-30 02:00:00');
is( $filtered_date, '30/03/2014', 'us: dt_from_string should return a DateTime object if a DST is given' );
-
is( $filter->now->iso8601, dt_from_string->iso8601, "Method 'now' matches current date and time" );