View | Details | Raw Unified | Return to bug 31713
Collapse All | Expand All

(-)a/Koha/Template/Plugin/KohaDates.pm (+4 lines)
Lines 47-50 sub tz { Link Here
47
    return C4::Context->tz->name;
47
    return C4::Context->tz->name;
48
}
48
}
49
49
50
sub now {
51
    return dt_from_string;
52
}
53
50
1;
54
1;
(-)a/installer/data/mysql/atomicupdate/bug_31713.pl (-2 / +3 lines)
Lines 8-15 return { Link Here
8
        my ($dbh, $out) = @$args{qw(dbh out)};
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
9
10
        my $slip_content = <<~'END_CONTENT';
10
        my $slip_content = <<~'END_CONTENT';
11
[% USE Koha %]
12
[% USE Branches %]
11
[% USE Branches %]
12
[% USE Koha %]
13
[% USE KohaDates %]
13
[% USE Price %]
14
[% USE Price %]
14
[% PROCESS 'accounts.inc' %]
15
[% PROCESS 'accounts.inc' %]
15
<table>
16
<table>
Lines 85-91 return { Link Here
85
86
86
  <tfoot>
87
  <tfoot>
87
    <tr>
88
    <tr>
88
      <td colspan='3'>Total outstanding dues as on date: </td>
89
      <td colspan='3'>Total outstanding dues as of [% KohaDates.output_preference( KohaDates.now ) %]: </td>
89
      [% IF ( borrower.account.balance <= 0 ) %]<td class='credit'>[% ELSE %]<td class='debit'>[% END %][% borrower.account.balance | $Price %]</td>
90
      [% IF ( borrower.account.balance <= 0 ) %]<td class='credit'>[% ELSE %]<td class='debit'>[% END %][% borrower.account.balance | $Price %]</td>
90
    </tr>
91
    </tr>
91
  </tfoot>
92
  </tfoot>
(-)a/installer/data/mysql/en/mandatory/sample_notices.yml (-2 / +3 lines)
Lines 1216-1223 tables: Link Here
1216
          message_transport_type: print
1216
          message_transport_type: print
1217
          lang: default
1217
          lang: default
1218
          content:
1218
          content:
1219
            - "[% USE Koha %]"
1220
            - "[% USE Branches %]"
1219
            - "[% USE Branches %]"
1220
            - "[% USE Koha %]"
1221
            - "[% USE KohaDates %]"
1221
            - "[% USE Price %]"
1222
            - "[% USE Price %]"
1222
            - "[% PROCESS 'accounts.inc' %]"
1223
            - "[% PROCESS 'accounts.inc' %]"
1223
            - "<table>"
1224
            - "<table>"
Lines 1293-1299 tables: Link Here
1293
            - ""
1294
            - ""
1294
            - "  <tfoot>"
1295
            - "  <tfoot>"
1295
            - "    <tr>"
1296
            - "    <tr>"
1296
            - "      <td colspan='3'>Total outstanding dues as on date: </td>"
1297
            - "      <td colspan='3'>Total outstanding dues as of [% KohaDates.output_preference( KohaDates.now ) %]: </td>"
1297
            - "      [% IF ( borrower.account.balance <= 0 ) %]<td class='credit'>[% ELSE %]<td class='debit'>[% END %][% borrower.account.balance | $Price %]</td>"
1298
            - "      [% IF ( borrower.account.balance <= 0 ) %]<td class='credit'>[% ELSE %]<td class='debit'>[% END %][% borrower.account.balance | $Price %]</td>"
1298
            - "    </tr>"
1299
            - "    </tr>"
1299
            - "  </tfoot>"
1300
            - "  </tfoot>"
(-)a/t/db_dependent/Template/Plugin/KohaDates.t (-2 / +3 lines)
Lines 6-12 use C4::Context; Link Here
6
use Koha::DateUtils qw( dt_from_string output_pref );
6
use Koha::DateUtils qw( dt_from_string output_pref );
7
7
8
use Test::MockModule;
8
use Test::MockModule;
9
use Test::More tests => 9;
9
use Test::More tests => 10;
10
use t::lib::Mocks;
10
use t::lib::Mocks;
11
11
12
BEGIN {
12
BEGIN {
Lines 64-66 $module_context->mock( Link Here
64
64
65
$filtered_date = $filter->filter('2014-03-30 02:00:00');
65
$filtered_date = $filter->filter('2014-03-30 02:00:00');
66
is( $filtered_date, '30/03/2014', 'us: dt_from_string should return a DateTime object if a DST is given' );
66
is( $filtered_date, '30/03/2014', 'us: dt_from_string should return a DateTime object if a DST is given' );
67
- 
67
68
is( $filter->now->iso8601, dt_from_string->iso8601, "Method 'now' matches current date and time" );

Return to bug 31713