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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+1 lines)
Lines 550-555 OPAC: Link Here
550
                  checkouthistory: "on patron's checkout history page (the system preference <em>opacreadinghistory</em> must be enabled)"
550
                  checkouthistory: "on patron's checkout history page (the system preference <em>opacreadinghistory</em> must be enabled)"
551
                  summary: "in user summary box on OPAC homepage (the system preference <em>OPACUserSummary</em> must be enabled)"
551
                  summary: "in user summary box on OPAC homepage (the system preference <em>OPACUserSummary</em> must be enabled)"
552
                  user: "on patron's 'your summary' page"
552
                  user: "on patron's 'your summary' page"
553
            - ". Note that displayed savings may be inaccurate if checkout history is anonymized."
553
    OpenURL:
554
    OpenURL:
554
        -
555
        -
555
            - 'Complete URL of OpenURL resolver (starting with <code>http://</code> or <code>https://</code>):'
556
            - 'Complete URL of OpenURL resolver (starting with <code>http://</code> or <code>https://</code>):'
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt (-1 / +1 lines)
Lines 56-62 Link Here
56
                        <div id="opac-user-readingrec">
56
                        <div id="opac-user-readingrec">
57
57
58
                        [% IF savings %]
58
                        [% IF savings %]
59
                            <div class="alert alert-info">
59
                            <div class="alert alert-info" id="savings">
60
                                Congratulations, you have saved a total of [% savings | $Price with_symbol => 1 %] by using the library.
60
                                Congratulations, you have saved a total of [% savings | $Price with_symbol => 1 %] by using the library.
61
                            </div>
61
                            </div>
62
                        [% END %]
62
                        [% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (-1 / +1 lines)
Lines 163-169 Link Here
163
                    [% END # / IF patron_flagged %]
163
                    [% END # / IF patron_flagged %]
164
164
165
                    [% IF savings %]
165
                    [% IF savings %]
166
                        <div class="alert alert-info">
166
                        <div class="alert alert-info" id="savings">
167
                            Congratulations, you have saved a total of [% savings | $Price with_symbol => 1 %] by using the library.
167
                            Congratulations, you have saved a total of [% savings | $Price with_symbol => 1 %] by using the library.
168
                        </div>
168
                        </div>
169
                    [% END %]
169
                    [% END %]
(-)a/t/db_dependent/Koha/Patron.t (-2 / +30 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 18;
22
use Test::More tests => 19;
23
use Test::Exception;
23
use Test::Exception;
24
use Test::Warn;
24
use Test::Warn;
25
25
Lines 29-34 use Koha::DateUtils qw(dt_from_string); Link Here
29
use Koha::ArticleRequests;
29
use Koha::ArticleRequests;
30
use Koha::Patrons;
30
use Koha::Patrons;
31
use Koha::Patron::Relationships;
31
use Koha::Patron::Relationships;
32
use C4::Circulation qw( AddIssue AddReturn );
32
33
33
use t::lib::TestBuilder;
34
use t::lib::TestBuilder;
34
use t::lib::Mocks;
35
use t::lib::Mocks;
Lines 1292-1294 subtest 'encode_secret and decoded_secret' => sub { Link Here
1292
1293
1293
    $schema->storage->txn_rollback;
1294
    $schema->storage->txn_rollback;
1294
};
1295
};
1295
- 
1296
1297
subtest 'get_savings tests' => sub {
1298
    plan tests => 2;
1299
1300
    $schema->storage->txn_begin;
1301
1302
    my $library = $builder->build_object({ class => 'Koha::Libraries' });
1303
    my $patron = $builder->build_object({ class => 'Koha::Patrons' }, { value => { branchcode => $library->branchcode } });
1304
1305
    t::lib::Mocks::mock_userenv({ patron => $patron, branchcode => $library->branchcode });
1306
1307
    my $biblio1 = $builder->build_object({ class => 'Koha::Biblios' });
1308
    my $item1 = $builder->build_object({ class => 'Koha::Items' }, { value => { biblionumber => $biblio1->biblionumber, replacementprice => '5.00', holdingbranch => $library->branchcode, homebranch => $library->branchcode } });
1309
    my $item2 = $builder->build_object({ class => 'Koha::Items' }, { value => { biblionumber => $biblio1->biblionumber, replacementprice => '5.00', holdingbranch => $library->branchcode, homebranch => $library->branchcode } });
1310
1311
    AddIssue( $patron->unblessed, $item1->barcode );
1312
    AddIssue( $patron->unblessed, $item2->barcode );
1313
1314
    my $savings = $patron->get_savings;
1315
    is( $savings, $item1->replacementprice + $item2->replacementprice, "Savings correctly calculated from current issues" );
1316
1317
    AddReturn( $item2->barcode, $item2->homebranch );
1318
1319
    $savings = $patron->get_savings;
1320
    is( $savings, $item1->replacementprice + $item2->replacementprice, "Savings correctly calculated from current and old issues" );
1321
1322
    $schema->storage->txn_rollback;
1323
};

Return to bug 31051