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

(-)a/Koha/Account/Line.pm (+13 lines)
Lines 57-62 sub patron { Link Here
57
    return Koha::Patron->_new_from_dbic( $rs );
57
    return Koha::Patron->_new_from_dbic( $rs );
58
}
58
}
59
59
60
=head3 manager
61
62
Return the manager linked to this account line
63
64
=cut
65
66
sub manager {
67
    my ( $self ) = @_;
68
    my $rs = $self->_result->manager;
69
    return unless $rs;
70
    return Koha::Patron->_new_from_dbic( $rs );
71
}
72
60
=head3 item
73
=head3 item
61
74
62
Return the item linked to this account line if exists
75
Return the item linked to this account line if exists
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc (-14 lines)
Lines 56-72 Link Here
56
        [%- CASE              -%]
56
        [%- CASE              -%]
57
    [%- END -%]
57
    [%- END -%]
58
[%- END -%]
58
[%- END -%]
59
60
[%- BLOCK offset_type_description -%]
61
    [%- SWITCH account_offset.type -%]
62
        [%- CASE 'Credit Applied' -%]<span>Credit applied</span>
63
        [%- CASE 'Payment'        -%]<span>Payment</span>
64
        [%- CASE 'Manual Credit'  -%]<span>Manual credit</span>
65
        [%- CASE 'Manual Debit'   -%]<span>Manual invoice</span>
66
        [%- CASE 'Lost Item'      -%]<span>Lost item returned</span>
67
        [%- CASE 'Writeoff'       -%]<span>Writeoff</span>
68
        [%- CASE 'Void Payment'   -%]<span>Void payment</span>
69
        [%- CASE 'CANCELLATION'   -%]<span>Cancelled charge</span>
70
        [%- CASE                  -%][% account_offset.type | html %]
71
    [%- END -%]
72
[%- END -%]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/accountline-details.tt (-49 / +70 lines)
Lines 7-13 Link Here
7
[% SET footerjs = 1 %]
7
[% SET footerjs = 1 %]
8
[% PROCESS 'accounts.inc' %]
8
[% PROCESS 'accounts.inc' %]
9
[% INCLUDE 'doc-head-open.inc' %]
9
[% INCLUDE 'doc-head-open.inc' %]
10
<title>Details of fee &rsaquo; [% INCLUDE 'patron-title.inc' no_html = 1 %] &rsaquo; Patrons &rsaquo; Koha</title>
10
<title>Details of [% IF type == 'credit' %]credit[% ELSE %]debit[% END %] &rsaquo; [% INCLUDE 'patron-title.inc' no_html = 1 %] &rsaquo; Patrons &rsaquo; Koha</title>
11
[% INCLUDE 'doc-head-close.inc' %]
11
[% INCLUDE 'doc-head-close.inc' %]
12
</head>
12
</head>
13
13
Lines 24-47 Link Here
24
            <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
24
            <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
25
        </li>
25
        </li>
26
26
27
        [% IF type == 'credit' %]
27
28
        [% IF accountline %]
29
            [% IF accountline.credit_type_code %]
28
            <li>
30
            <li>
29
                <a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | uri %]">Account for [% INCLUDE 'patron-title.inc' %]</a>
31
                <a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | uri %]">Account for [% INCLUDE 'patron-title.inc' %]</a>
30
            </li>
32
            </li>
31
            <li>
33
            <li>
32
                <a href="#" aria-current="page">
34
                <a href="#" aria-current="page">
33
                    Details of payment
35
                    Details of credit ([% accountline.id | html %])
34
                </a>
36
                </a>
35
            </li>
37
            </li>
36
        [% ELSIF type == 'debit' %]
38
            [% ELSIF accountline.debit_type_code %]
37
            <li>
39
            <li>
38
                <a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | uri %]">Account for [% INCLUDE 'patron-title.inc' %]</a>
40
                <a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | uri %]">Account for [% INCLUDE 'patron-title.inc' %]</a>
39
            </li>
41
            </li>
40
            <li>
42
            <li>
41
                <a href="#" aria-current="page">
43
                <a href="#" aria-current="page">
42
                    Details of fee
44
                    Details of debit ([% accountline.id | html %])
43
                </a>
45
                </a>
44
            </li>
46
            </li>
47
            [% END %]
45
        [% ELSE %]
48
        [% ELSE %]
46
            <li>
49
            <li>
47
                <a href="#" aria-current="page">
50
                <a href="#" aria-current="page">
Lines 60-76 Link Here
60
            [% INCLUDE 'members-toolbar.inc' borrowernumber=patron.borrowernumber %]
63
            [% INCLUDE 'members-toolbar.inc' borrowernumber=patron.borrowernumber %]
61
64
62
            [% IF accountline %]
65
            [% IF accountline %]
63
                [% IF type == 'credit' %]
66
                [% IF accountline.credit_type_code %]
64
                    <h2>Details of payment</h2>
67
                    <h2>Details of credit</h2>
65
                [% ELSIF type == 'debit' %]
68
                [% ELSIF accountline.debit_type_code %]
66
                    <h2>Details of fee</h2>
69
                    <h2>Details of debit</h2>
67
                [% END %]
70
                [% END %]
68
71
69
                <table id="table_account_fines">
72
                <table id="table_account_fines">
70
                    <thead>
73
                    <thead>
71
                        <tr>
74
                        <tr>
72
                            <th>Date</th>
75
                            <th>Date</th>
73
                            <th>Description of charges</th>
76
                            <th>Description</th>
74
                            <th>Barcode</th>
77
                            <th>Barcode</th>
75
                            <th>Due date</th>
78
                            <th>Due date</th>
76
                            <th>Return date</th>
79
                            <th>Return date</th>
Lines 83-89 Link Here
83
                    <tbody>
86
                    <tbody>
84
                        <tr>
87
                        <tr>
85
                            <td>
88
                            <td>
86
                                [% accountline.date |$KohaDates %]
89
                                [% accountline.date | $KohaDates %]
87
                            </td>
90
                            </td>
88
                            <td>
91
                            <td>
89
                                [%- PROCESS account_type_description account=accountline -%]
92
                                [%- PROCESS account_type_description account=accountline -%]
Lines 134-196 Link Here
134
                    </tbody>
137
                    </tbody>
135
                </table>
138
                </table>
136
139
137
140
                <h3>History</h3>
138
                [% IF type == 'credit' %]
139
                    <h3>Fees paid</h3>
140
                [% ELSIF type == 'debit' %]
141
                    <h3>Payments</h3>
142
                [% END %]
143
144
                <table class="accountline-offsets-table" id="accountline-debits-table">
141
                <table class="accountline-offsets-table" id="accountline-debits-table">
145
                    <thead>
142
                    <thead>
146
                        <tr>
143
                        <tr>
147
                            <th>Date created</th>
144
                            <th rowspan="2">Date</th>
148
                            <th>Date updated</th>
145
                            <th colspan="2">Change</th>
149
                            <th>Amount</th>
146
                            <th rowspan="2">Action</th>
150
                            <th>Amount outstanding</th>
147
                            <th colspan="4">Related transaction</th>
148
                        </tr>
149
                        <tr>
150
                            <th>Increase</th>
151
                            <th>Decrease</th>
151
                            <th>Type</th>
152
                            <th>Type</th>
153
                            <th>Amount</th>
154
                            <th>Librarian</th>
152
                            <th>Note</th>
155
                            <th>Note</th>
153
                            <th>Transacting librarian</th>
154
                            <th>Date/time of change</th>
155
                            <th>Amount of change</th>
156
                            <th>Type of change</th>
157
                            <th>&nbsp;</th>
158
                        </tr>
156
                        </tr>
159
                    </thead>
157
                    </thead>
160
158
161
                    <tbody>
159
                    <tbody>
162
                        [% FOREACH ao IN account_offsets %]
160
                        [% FOREACH ao IN account_offsets %]
163
                            [% IF type == 'credit' %]
161
                                [% IF ao.credit_id == accountline.accountlines_id %]
164
                                [% SET offset_accountline = ao.debit %]
162
                                    [% SET offset_accountline = ao.debit %]
165
                            [% ELSIF type == 'debit' %]
163
                                [% ELSIF ao.debit_id == accountline.accountlines_id %]
166
                                [% SET offset_accountline = ao.credit %]
164
                                    [% SET offset_accountline = ao.credit %]
167
                            [% END %]
165
                                [% END %]
166
167
                                [%- BLOCK ao_description -%]
168
                                    [%- SWITCH ao.type -%]
169
                                        [%- CASE 'CREATE'           -%]<span>Created</span>
170
                                        [%- CASE 'OVERDUE_INCREASE' -%]<span>Increase</span>
171
                                        [%- CASE 'OVERDUE_DECREASE' -%]<span>Decrease</span>
172
                                        [%- CASE 'APPLY'            -%]<span>Applied</span>
173
                                        [%- CASE 'VOID'             -%]<span>Reversed</span>
174
                                    [%- END -%]
175
                                [%- END -%]
168
176
169
                            [% IF offset_accountline %]
170
                                <tr>
177
                                <tr>
171
                                    <td>[% offset_accountline.date | $KohaDates %]</td>
178
                                    <td>[% ao.created_on | $KohaDates with_hours => 1%]</td>
172
                                    <td>[% offset_accountline.timestamp | $KohaDates  with_hours => 1 %]</td>
179
                                    <td>[%- IF ao.amount > 0 -%][% ao.amount | $Price %][% END %]</td>
173
                                    <td>[% offset_accountline.amount | $Price %]</td>
180
                                    <td>[%- IF ao.amount < 0 -%][% ao.amount | $Price %][% END %]</td>
174
                                    <td>[% offset_accountline.amountoutstanding | $Price %]</td>
181
                                    <td>
175
                                    <td>[% PROCESS account_type_description account=offset_accountline %]</td>
182
                                        [% PROCESS ao_description ao=ao %]
183
                                    </td>
184
                                    [%- IF offset_accountline -%]
185
                                    <td>
186
                                        [% PROCESS account_type_description account=offset_accountline %] (<a href="accountline-details.pl?accountlines_id=[% offset_accountline.id | uri %]">[% offset_accountline.id | html %]</a>)
187
                                    </td>
188
                                    <td>
189
                                        [% offset_accountline.amount | $Price %]
190
                                    </td>
191
                                    <td>
192
                                        [% IF offset_accountline.manager_id %]
193
                                        <a href="moremember.pl?borrowernumber=[% offset_accountline.manager_id | uri %]">
194
                                            [% IF offset_accountline.manager.firstname %]
195
                                                [% offset_accountline.manager.firstname | html %] [% offest_accountline.manager.surname | html %]
196
                                            [% ELSE %]
197
                                                [% offset_accountline.manager.surname | html %]
198
                                            [% END %]
199
                                        </a>
200
                                        [% END %]
201
                                    </td>
202
                                    [%- ELSE -%]
203
                                    <td></td>
204
                                    <td></td>
205
                                    <td></td>
206
                                    [%- END -%]
176
                                    <td>[% offset_accountline.note | html %]</td>
207
                                    <td>[% offset_accountline.note | html %]</td>
177
                                    <td>[% IF offset_accountline.manager_id %]<a href="moremember.pl?borrowernumber=[% offset_accountline.manager_id | uri %]">[% offset_accountline.manager_id | html %]</a>[% END %]</td>
178
                                    <td>[% ao.created_on | $KohaDates  with_hours => 1 %]</td>
179
                                    <td>[% ao.amount | $Price %]</td>
180
                                    <td>[% PROCESS offset_type_description account_offset=ao %]</td>
181
                                    <td><a href="accountline-details.pl?accountlines_id=[% offset_accountline.id | uri %]" class="btn btn-default btn-xs"><i class="fa fa-list"></i> Details</a></td>
182
                                </tr>
208
                                </tr>
183
                            [% END %]
184
                        [% END %]
209
                        [% END %]
185
                    </tbody>
210
                    </tbody>
186
                </table>
211
                </table>
187
            [% ELSE %]
212
            [% ELSE %]
188
                <div class="dialog message">
213
                <div class="dialog message">
189
                    [% IF type == 'credit' %]
214
                    Account not found
190
                        Payment not found
191
                    [% ELSIF type == 'debit' %]
192
                        Fee not found
193
                    [% END %]
194
                </div>
215
                </div>
195
            [% END %]
216
            [% END %]
196
217
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/accounts.inc (-14 lines)
Lines 56-72 Link Here
56
        [%- CASE              -%]
56
        [%- CASE              -%]
57
    [%- END -%]
57
    [%- END -%]
58
[%- END -%]
58
[%- END -%]
59
60
[%- BLOCK offset_type_description -%]
61
    [%- SWITCH account_offset.type -%]
62
        [%- CASE 'Credit Applied' -%]<span>Credit applied</span>
63
        [%- CASE 'Payment'        -%]<span>Payment</span>
64
        [%- CASE 'Manual Credit'  -%]<span>Manual credit</span>
65
        [%- CASE 'Manual Debit'   -%]<span>Manual invoice</span>
66
        [%- CASE 'Lost Item'      -%]<span>Lost item returned</span>
67
        [%- CASE 'Writeoff'       -%]<span>Writeoff</span>
68
        [%- CASE 'Void Payment'   -%]<span>Void payment</span>
69
        [%- CASE 'CANCELLATION'   -%]<span>Cancelled charge</span>
70
        [%- CASE                  -%][% account_offset.type | html %]
71
    [%- END -%]
72
[%- END -%]
(-)a/members/accountline-details.pl (-9 / +9 lines)
Lines 45-64 my $accountlines_id = $input->param('accountlines_id'); Link Here
45
my $accountline = Koha::Account::Lines->find($accountlines_id);
45
my $accountline = Koha::Account::Lines->find($accountlines_id);
46
46
47
if ($accountline) {
47
if ($accountline) {
48
    my $type = $accountline->amount < 0 ? 'credit' : 'debit';
49
    my $column = $type eq 'credit' ? 'credit_id' : 'debit_id';
50
51
    my $account_offsets = Koha::Account::Offsets->search(
48
    my $account_offsets = Koha::Account::Offsets->search(
52
        { $column  => $accountlines_id },
49
        [
53
        { order_by => 'created_on' },
50
            {
51
                credit_id => $accountline->accountlines_id
52
            },
53
            {
54
                debit_id => $accountline->accountlines_id
55
            }
56
        ],
57
        { order_by => 'created_on' }
54
    );
58
    );
55
59
56
    $template->param(
60
    $template->param(
57
        type            => $type,
58
        accountline     => $accountline,
61
        accountline     => $accountline,
59
        account_offsets => $account_offsets,
62
        account_offsets => $account_offsets,
60
61
        finesview => 1,
62
    );
63
    );
63
64
64
    my $patron = Koha::Patrons->find( $accountline->borrowernumber );
65
    my $patron = Koha::Patrons->find( $accountline->borrowernumber );
65
- 

Return to bug 22435