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

(-)a/Koha/Checkout.pm (-1 / +13 lines)
Lines 21-31 package Koha::Checkout; Link Here
21
use Modern::Perl;
21
use Modern::Perl;
22
22
23
use Carp;
23
use Carp;
24
use DateTime;
24
25
25
use Koha::Database;
26
use Koha::Database;
26
use DateTime;
27
use Koha::DateUtils;
27
use Koha::DateUtils;
28
use Koha::Items;
28
use Koha::Items;
29
use Koha::Libraries;
29
30
30
use base qw(Koha::Object);
31
use base qw(Koha::Object);
31
32
Lines 88-93 sub patron { Link Here
88
    return Koha::Patron->_new_from_dbic( $patron_rs );
89
    return Koha::Patron->_new_from_dbic( $patron_rs );
89
}
90
}
90
91
92
=head library
93
94
=cut
95
96
sub library {
97
    my ($self) = @_;
98
99
    my $library_rs = $self->_result->branch;
100
    return Koha::Library->_new_from_dbic( $library_rs );
101
}
102
91
=head3 type
103
=head3 type
92
104
93
=cut
105
=cut
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt (-3 / +7 lines)
Lines 46-51 Link Here
46
    <th class="NoSort">&nbsp;</th>
46
    <th class="NoSort">&nbsp;</th>
47
    <th class="NoSort">Actions</th>
47
    <th class="NoSort">Actions</th>
48
    <th>Account type</th>
48
    <th>Account type</th>
49
    <th class="checked-out-from">Checked out from</th>
49
    <th>Description</th>
50
    <th>Description</th>
50
    <th class="title-string">Date</th>
51
    <th class="title-string">Date</th>
51
    <th>Barcode</th>
52
    <th>Barcode</th>
Lines 83-88 Link Here
83
    <td>
84
    <td>
84
        [% PROCESS account_type_description account=line %]
85
        [% PROCESS account_type_description account=line %]
85
    </td>
86
    </td>
87
    <td class="checked-out-from">
88
        [% line.checkout.library.branchname %]
89
    </td>
86
    <td>
90
    <td>
87
        [%- IF line.description %][% line.description | html %][% END %]
91
        [%- IF line.description %][% line.description | html %][% END %]
88
        [% IF line.itemnumber %]([% line.item.biblio.title | html %])[% END %]
92
        [% IF line.itemnumber %]([% line.item.biblio.title | html %])[% END %]
Lines 118-135 Link Here
118
<tfoot>
122
<tfoot>
119
    [% IF outstanding_credits.total_outstanding < 0 %]
123
    [% IF outstanding_credits.total_outstanding < 0 %]
120
        <tr>
124
        <tr>
121
            <td class="total" colspan="10">Outstanding credits could be applied: </td>
125
            <td class="total" colspan="11">Outstanding credits could be applied: </td>
122
            <td class="credit" style="text-align: right;"><button type="submit" id="apply_credits" name="apply_credits" value="apply_credits" class="btn btn-default btn-sm">Apply <strong class="credit">[% outstanding_credits.total_outstanding | $Price %]</strong></button></td>
126
            <td class="credit" style="text-align: right;"><button type="submit" id="apply_credits" name="apply_credits" value="apply_credits" class="btn btn-default btn-sm">Apply <strong class="credit">[% outstanding_credits.total_outstanding | $Price %]</strong></button></td>
123
        </tr>
127
        </tr>
124
    [% END %]
128
    [% END %]
125
    [% IF ( account_grp.total ) %]
129
    [% IF ( account_grp.total ) %]
126
        <tr>
130
        <tr>
127
            <td class="total" colspan="10" style="text-align: right;">Sub total:</td>
131
            <td class="total" colspan="11" style="text-align: right;">Sub total:</td>
128
            <td style="text-align: right;">[% account_grp.total | $Price %]</td>
132
            <td style="text-align: right;">[% account_grp.total | $Price %]</td>
129
        </tr>
133
        </tr>
130
    [% END %]
134
    [% END %]
131
    <tr>
135
    <tr>
132
        <td class="total" colspan="10">Total due:</td>
136
        <td class="total" colspan="11">Total due:</td>
133
        [% IF outstanding_credits.total_outstanding < 0 %]
137
        [% IF outstanding_credits.total_outstanding < 0 %]
134
            <td style="text-align: right;">[% total + outstanding_credits.total_outstanding | $Price %]</td>
138
            <td style="text-align: right;">[% total + outstanding_credits.total_outstanding | $Price %]</td>
135
        [% ELSE %]
139
        [% ELSE %]
(-)a/members/pay.pl (+1 lines)
Lines 39-44 use C4::Stats; Link Here
39
use C4::Koha;
39
use C4::Koha;
40
use C4::Overdues;
40
use C4::Overdues;
41
use Koha::Patrons;
41
use Koha::Patrons;
42
use Koha::Checkouts;
42
43
43
use Koha::Patron::Categories;
44
use Koha::Patron::Categories;
44
use URI::Escape;
45
use URI::Escape;
(-)a/t/db_dependent/Koha/Checkouts.t (-2 / +5 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 7;
22
use Test::More tests => 9;
23
23
24
use C4::Circulation;
24
use C4::Circulation;
25
use Koha::Checkouts;
25
use Koha::Checkouts;
Lines 50-55 my $new_checkout_2 = Koha::Checkout->new( Link Here
50
    }
50
    }
51
)->store;
51
)->store;
52
52
53
is( $new_checkout_1->library->id, $library->{branchcode}, 'Got correct library for checkout1' );
54
is( $new_checkout_2->library->id, $library->{branchcode}, 'Got correct library for checkout2' );
55
53
like( $new_checkout_1->issue_id, qr|^\d+$|, 'Adding a new checkout should have set the issue_id' );
56
like( $new_checkout_1->issue_id, qr|^\d+$|, 'Adding a new checkout should have set the issue_id' );
54
is( Koha::Checkouts->search->count, $nb_of_checkouts + 2, 'The 2 checkouts should have been added' );
57
is( Koha::Checkouts->search->count, $nb_of_checkouts + 2, 'The 2 checkouts should have been added' );
55
58
Lines 125-129 subtest 'patron' => sub { Link Here
125
$retrieved_checkout_1->delete;
128
$retrieved_checkout_1->delete;
126
is( Koha::Checkouts->search->count, $nb_of_checkouts + 1, 'Delete should have deleted the checkout' );
129
is( Koha::Checkouts->search->count, $nb_of_checkouts + 1, 'Delete should have deleted the checkout' );
127
130
131
128
$schema->storage->txn_rollback;
132
$schema->storage->txn_rollback;
129
133
130
- 

Return to bug 15985