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 / +6 lines)
Lines 40-45 Link Here
40
<tr>
40
<tr>
41
    <th>&nbsp;</th>
41
    <th>&nbsp;</th>
42
    <th>Fines &amp; charges</th>
42
    <th>Fines &amp; charges</th>
43
    <th class="checked-out-from">Checked out from</th>
43
    <th>Description</th>
44
    <th>Description</th>
44
    <th>Payment note</th>
45
    <th>Payment note</th>
45
    <th>Account type</th>
46
    <th>Account type</th>
Lines 49-55 Link Here
49
</thead>
50
</thead>
50
<tfoot>
51
<tfoot>
51
<tr>
52
<tr>
52
    <td class="total" colspan="6">Total due:</td>
53
    <td class="total" colspan="7">Total due:</td>
53
    <td style="text-align: right;">[% total | $Price %]</td>
54
    <td style="text-align: right;">[% total | $Price %]</td>
54
</tr>
55
</tr>
55
</tfoot>
56
</tfoot>
Lines 74-79 Link Here
74
    <input type="hidden" name="amountoutstanding[% line.accountlines_id %]" value="[% line.amountoutstanding %]" />
75
    <input type="hidden" name="amountoutstanding[% line.accountlines_id %]" value="[% line.amountoutstanding %]" />
75
    <input type="hidden" name="borrowernumber[% line.accountlines_id %]" value="[% line.borrowernumber %]" />
76
    <input type="hidden" name="borrowernumber[% line.accountlines_id %]" value="[% line.borrowernumber %]" />
76
    </td>
77
    </td>
78
    <td class="checked-out-from">
79
        [% line.checkout.library.branchname %]
80
    </td>
77
    <td>
81
    <td>
78
        [% SWITCH line.accounttype %]
82
        [% SWITCH line.accounttype %]
79
          [% CASE 'Pay' %]Payment, thanks
83
          [% CASE 'Pay' %]Payment, thanks
Lines 109-116 Link Here
109
[% END %]
113
[% END %]
110
[% IF ( account_grp.total ) %]
114
[% IF ( account_grp.total ) %]
111
<tr>
115
<tr>
112
116
    <td class="total" colspan="9" style="text-align: right;">Sub total:</td>
113
    <td class="total" colspan="8" style="text-align: right;">Sub total:</td>
114
    <td style="text-align: right;">[% account_grp.total | $Price %]</td>
117
    <td style="text-align: right;">[% account_grp.total | $Price %]</td>
115
</tr>
118
</tr>
116
[% END %]
119
[% END %]
(-)a/members/pay.pl (+2 lines)
Lines 40-45 use C4::Koha; Link Here
40
use C4::Overdues;
40
use C4::Overdues;
41
use C4::Members::Attributes qw(GetBorrowerAttributes);
41
use C4::Members::Attributes qw(GetBorrowerAttributes);
42
use Koha::Patrons;
42
use Koha::Patrons;
43
use Koha::Checkouts;
43
44
44
use Koha::Patron::Categories;
45
use Koha::Patron::Categories;
45
use URI::Escape;
46
use URI::Escape;
Lines 135-140 sub add_accounts_to_template { Link Here
135
            my $biblio = $item->biblio;
136
            my $biblio = $item->biblio;
136
            $account_line->{biblionumber} = $biblio->biblionumber;
137
            $account_line->{biblionumber} = $biblio->biblionumber;
137
            $account_line->{title}        = $biblio->title;
138
            $account_line->{title}        = $biblio->title;
139
            $account_line->{checkout}     = Koha::Checkouts->find($accountline->{issue_id});
138
        }
140
        }
139
        push @accounts, $account_line;
141
        push @accounts, $account_line;
140
    }
142
    }
(-)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 Koha::Checkouts;
24
use Koha::Checkouts;
25
use Koha::Database;
25
use Koha::Database;
Lines 49-54 my $new_checkout_2 = Koha::Checkout->new( Link Here
49
    }
49
    }
50
)->store;
50
)->store;
51
51
52
is( $new_checkout_1->library->id, $library->{branchcode}, 'Got correct library for checkout1' );
53
is( $new_checkout_2->library->id, $library->{branchcode}, 'Got correct library for checkout2' );
54
52
like( $new_checkout_1->issue_id, qr|^\d+$|, 'Adding a new checkout should have set the issue_id' );
55
like( $new_checkout_1->issue_id, qr|^\d+$|, 'Adding a new checkout should have set the issue_id' );
53
is( Koha::Checkouts->search->count, $nb_of_checkouts + 2, 'The 2 checkouts should have been added' );
56
is( Koha::Checkouts->search->count, $nb_of_checkouts + 2, 'The 2 checkouts should have been added' );
54
57
Lines 103-107 subtest 'patron' => sub { Link Here
103
$retrieved_checkout_1->delete;
106
$retrieved_checkout_1->delete;
104
is( Koha::Checkouts->search->count, $nb_of_checkouts + 1, 'Delete should have deleted the checkout' );
107
is( Koha::Checkouts->search->count, $nb_of_checkouts + 1, 'Delete should have deleted the checkout' );
105
108
109
106
$schema->storage->txn_rollback;
110
$schema->storage->txn_rollback;
107
111
108
- 

Return to bug 15985