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

(-)a/Koha/Account/DebitTypes.pm (+1 lines)
Lines 45-50 sub delete { Link Here
45
    my @set = $self->as_list;
45
    my @set = $self->as_list;
46
    my $defaults = Koha::Account::DebitType::defaults;
46
    my $defaults = Koha::Account::DebitType::defaults;
47
    for my $type (@set) {
47
    for my $type (@set) {
48
48
        if ( any { $type->code eq $_ } @{$defaults} ) {
49
        if ( any { $type->code eq $_ } @{$defaults} ) {
49
            Koha::Exceptions::CannotDeleteDefault->throw;
50
            Koha::Exceptions::CannotDeleteDefault->throw;
50
        }
51
        }
(-)a/admin/debit_types.pl (-2 / +10 lines)
Lines 23-28 use C4::Context; Link Here
23
use C4::Auth;
23
use C4::Auth;
24
use C4::Output;
24
use C4::Output;
25
25
26
use Koha::Account::DebitType;
26
use Koha::Account::DebitTypes;
27
use Koha::Account::DebitTypes;
27
28
28
my $input = new CGI;
29
my $input = new CGI;
Lines 133-140 elsif ( $op eq 'delete_confirmed' ) { Link Here
133
}
134
}
134
135
135
if ( $op eq 'list' ) {
136
if ( $op eq 'list' ) {
136
    my $debit_types = Koha::Account::DebitTypes->search();
137
    my $defaults = Koha::Account::DebitType::defaults;
137
    $template->param( debit_types => $debit_types );
138
    my $system_types =
139
      Koha::Account::DebitTypes->search( { code => { 'in' => $defaults } } );
140
    my $debit_types = Koha::Account::DebitTypes->search(
141
        { code => { 'not_in' => $defaults } } );
142
    $template->param(
143
        debit_types  => $debit_types,
144
        system_types => $system_types
145
    );
138
}
146
}
139
147
140
$template->param(
148
$template->param(
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc (-5 / +5 lines)
Lines 13-30 Link Here
13
        [%- END -%]
13
        [%- END -%]
14
    [%- ELSIF account.debit_type -%]
14
    [%- ELSIF account.debit_type -%]
15
       [%- SWITCH account.debit_type -%]
15
       [%- SWITCH account.debit_type -%]
16
           [%- CASE 'N'                -%]New card
17
           [%- CASE 'OVERDUE'          -%]Fine
18
           [%- CASE 'ACCOUNT'          -%]Account creation fee
16
           [%- CASE 'ACCOUNT'          -%]Account creation fee
19
           [%- CASE 'ACCOUNT_RENEW'    -%]Account renewal fee
17
           [%- CASE 'ACCOUNT_RENEW'    -%]Account renewal fee
20
           [%- CASE 'M'                -%]Sundry
21
           [%- CASE 'LOST'             -%]Lost item
22
           [%- CASE 'HE'               -%]Hold waiting too long
18
           [%- CASE 'HE'               -%]Hold waiting too long
19
           [%- CASE 'LOST'             -%]Lost item
20
           [%- CASE 'M'                -%]Sundry
21
           [%- CASE 'N'                -%]New card
22
           [%- CASE 'OVERDUE'          -%]Fine
23
           [%- CASE 'PF'               -%]Lost item processing fee
23
           [%- CASE 'RENT'             -%]Rental fee
24
           [%- CASE 'RENT'             -%]Rental fee
24
           [%- CASE 'RENT_DAILY'       -%]Daily rental fee
25
           [%- CASE 'RENT_DAILY'       -%]Daily rental fee
25
           [%- CASE 'RENT_RENEW'       -%]Renewal of rental item
26
           [%- CASE 'RENT_RENEW'       -%]Renewal of rental item
26
           [%- CASE 'RENT_DAILY_RENEW' -%]Rewewal of daily rental item
27
           [%- CASE 'RENT_DAILY_RENEW' -%]Rewewal of daily rental item
27
           [%- CASE 'PF'               -%]Lost item processing fee
28
           [%- CASE 'Res'              -%]Hold fee
28
           [%- CASE 'Res'              -%]Hold fee
29
           [%- CASE                    -%][% account.debit_type.description | html %]
29
           [%- CASE                    -%][% account.debit_type.description | html %]
30
       [%- END -%]
30
       [%- END -%]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt (-1 / +29 lines)
Lines 152-157 Link Here
152
                    </div>
152
                    </div>
153
153
154
                    <h3>Account debit types</h3>
154
                    <h3>Account debit types</h3>
155
                    <h4>Custom types</h4>
155
                    [% IF debit_types.count %]
156
                    [% IF debit_types.count %]
156
                        <table id="table_debit_types">
157
                        <table id="table_debit_types">
157
                            <thead>
158
                            <thead>
Lines 204-209 Link Here
204
                            There are no account debit types defined. <a href="/cgi-bin/koha/admin/debit_types.pl?op=add_form&type=debit">Create new debit type</a>
205
                            There are no account debit types defined. <a href="/cgi-bin/koha/admin/debit_types.pl?op=add_form&type=debit">Create new debit type</a>
205
                        </div>
206
                        </div>
206
                    [% END %]
207
                    [% END %]
208
                    <h4>System types</h4>
209
                    <table id="table_system_types">
210
                        <thead>
211
                            <th>Account type code</th>
212
                            <th>Description</th>
213
                            <th>Default amount</th>
214
                            <th>Can be added manually</th>
215
                        </thead>
216
                        <tbody>
217
                            [% FOREACH system_type IN system_types %]
218
                            <tr>
219
                                <td>[% system_type.code | html %]</td>
220
                                <td>[% system_type.description | html %]</td>
221
                                <td>[% system_type.default_amount | $Price %]</td>
222
                                <td>[% IF system_type.can_be_added_manually %]Yes[% ELSE %]No[% END %]</td>
223
                            </tr>
224
                            [% END %]
225
                        </tbody>
226
                    </table>
207
                [% END %]
227
                [% END %]
208
            </main>
228
            </main>
209
        </div> <!-- /.col-sm-10.col-sm-push-2 -->
229
        </div> <!-- /.col-sm-10.col-sm-push-2 -->
Lines 229-234 Link Here
229
                "iDisplayLength": 10,
249
                "iDisplayLength": 10,
230
                "sPaginationType": "full_numbers"
250
                "sPaginationType": "full_numbers"
231
            }));
251
            }));
252
            
253
            $("#table_system_types").dataTable($.extend(true, {}, dataTablesDefaults, {
254
                "aoColumnDefs": [
255
                    { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
256
                ],
257
                "aaSorting": [[ 1, "asc" ]],
258
                "iDisplayLength": 10,
259
                "sPaginationType": "full_numbers"
260
            }));
232
        });
261
        });
233
    </script>
262
    </script>
234
[% END %]
263
[% END %]
235
- 

Return to bug 23049