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

(-)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 (-40 / +44 lines)
Lines 60-68 Link Here
60
            [% INCLUDE 'members-toolbar.inc' borrowernumber=patron.borrowernumber %]
60
            [% INCLUDE 'members-toolbar.inc' borrowernumber=patron.borrowernumber %]
61
61
62
            [% IF accountline %]
62
            [% IF accountline %]
63
                [% IF type == 'credit' %]
63
                [% IF accountline.credit_type_code %]
64
                    <h2>Details of payment</h2>
64
                    <h2>Details of payment</h2>
65
                [% ELSIF type == 'debit' %]
65
                [% ELSIF accountline.debit_type_code %]
66
                    <h2>Details of fee</h2>
66
                    <h2>Details of fee</h2>
67
                [% END %]
67
                [% END %]
68
68
Lines 134-196 Link Here
134
                    </tbody>
134
                    </tbody>
135
                </table>
135
                </table>
136
136
137
137
                <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">
138
                <table class="accountline-offsets-table" id="accountline-debits-table">
145
                    <thead>
139
                    <thead>
146
                        <tr>
140
                        <tr>
147
                            <th>Date created</th>
141
                            <th>Date</th>
148
                            <th>Date updated</th>
142
                            <th>Change amount</th>
149
                            <th>Amount</th>
143
                            <th>Change type</th>
150
                            <th>Amount outstanding</th>
151
                            <th>Type</th>
152
                            <th>Note</th>
153
                            <th>Transacting librarian</th>
144
                            <th>Transacting librarian</th>
154
                            <th>Date/time of change</th>
145
                            <th>Note</th>
155
                            <th>Amount of change</th>
156
                            <th>Type of change</th>
157
                            <th>&nbsp;</th>
146
                            <th>&nbsp;</th>
158
                        </tr>
147
                        </tr>
159
                    </thead>
148
                    </thead>
160
149
161
                    <tbody>
150
                    <tbody>
162
                        [% FOREACH ao IN account_offsets %]
151
                        [% FOREACH ao IN account_offsets %]
163
                            [% IF type == 'credit' %]
152
                                [% IF ao.credit_id == accountline.accountlines_id %]
164
                                [% SET offset_accountline = ao.debit %]
153
                                    [% SET offset_accountline = ao.debit %]
165
                            [% ELSIF type == 'debit' %]
154
                                [% ELSIF ao.debit_id == accountline.accountlines_id %]
166
                                [% SET offset_accountline = ao.credit %]
155
                                    [% SET offset_accountline = ao.credit %]
167
                            [% END %]
156
                                [% END %]
157
158
                                [%- BLOCK ao_description -%]
159
                                    [%- SWITCH ao.type -%]
160
                                        [%- CASE 'Credit Applied' -%]<span>Credit applied</span>
161
                                        [%- CASE 'Payment'        -%]<span>Payment</span>
162
                                        [%- CASE 'Manual Credit'  -%]<span>Manual credit</span>
163
                                        [%- CASE 'Manual Debit'   -%]<span>Manual invoice</span>
164
                                        [%- CASE 'Lost Item'      -%]<span>Lost item returned</span>
165
                                        [%- CASE 'Writeoff'       -%]<span>Writeoff</span>
166
                                        [%- CASE 'Void Payment'   -%]<span>Void payment</span>
167
                                        [%- CASE 'CANCELLATION'   -%]<span>Cancelled charge</span>
168
                                        [%- CASE 'APPLY'   -%]<span>Applied</span>
169
                                        [%- CASE 'CREATE'   -%]<span>Created</span>
170
                                        [%- CASE                  -%][% ao.type | html %]
171
                                    [%- END -%]
172
                                [%- END -%]
168
173
169
                            [% IF offset_accountline %]
170
                                <tr>
174
                                <tr>
171
                                    <td>[% offset_accountline.date | $KohaDates %]</td>
175
                                    <td>[% ao.created_on | $KohaDates with_hours => 1%]</td>
172
                                    <td>[% offset_accountline.timestamp | $KohaDates  with_hours => 1 %]</td>
173
                                    <td>[% offset_accountline.amount | $Price %]</td>
174
                                    <td>[% offset_accountline.amountoutstanding | $Price %]</td>
175
                                    <td>[% PROCESS account_type_description account=offset_accountline %]</td>
176
                                    <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>
176
                                    <td>[% ao.amount | $Price %]</td>
180
                                    <td>[% PROCESS offset_type_description account_offset=ao %]</td>
177
                                    <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>
178
                                        [%- IF offset_accountline -%]
179
                                            [% PROCESS account_type_description account=offset_accountline %] ([% PROCESS ao_description ao=ao %])
180
                                        [%- ELSE -%]
181
                                            [% PROCESS ao_description ao=ao %]
182
                                        [%- END -%]
183
                                    </td>
184
                                    <td>[% IF offset_accountline.manager_id %]<a href="moremember.pl?borrowernumber=[% offset_accountline.manager_id | uri %]">[% offset_accountline.manager_id | html %]</a>[% END %]</td>
185
                                    <td>[% offset_accountline.note | html %]</td>
186
                                    <td>
187
                                        [%- IF offset_accountline -%]
188
                                        <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>
189
                                        [%- END -%]
190
                                    </td>
182
                                </tr>
191
                                </tr>
183
                            [% END %]
184
                        [% END %]
192
                        [% END %]
185
                    </tbody>
193
                    </tbody>
186
                </table>
194
                </table>
187
            [% ELSE %]
195
            [% ELSE %]
188
                <div class="dialog message">
196
                <div class="dialog message">
189
                    [% IF type == 'credit' %]
197
                    Account not found
190
                        Payment not found
191
                    [% ELSIF type == 'debit' %]
192
                        Fee not found
193
                    [% END %]
194
                </div>
198
                </div>
195
            [% END %]
199
            [% END %]
196
200
(-)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