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

(-)a/Koha/Account/DebitType.pm (-1 / +1 lines)
Lines 22-28 use Modern::Perl; Link Here
22
use Koha::Database;
22
use Koha::Database;
23
use Koha::Exceptions;
23
use Koha::Exceptions;
24
24
25
use base qw(Koha::Object Koha::Object::Limit::Library);
25
use base qw(Koha::Object::Mixin::AdditionalFields Koha::Object Koha::Object::Limit::Library);
26
26
27
=head1 NAME
27
=head1 NAME
28
28
(-)a/Koha/Account/DebitTypes.pm (-1 / +1 lines)
Lines 22-28 use Modern::Perl; Link Here
22
use Koha::Database;
22
use Koha::Database;
23
use Koha::Account::DebitType;
23
use Koha::Account::DebitType;
24
24
25
use base qw(Koha::Objects Koha::Objects::Limit::Library);
25
use base qw(Koha::Objects::Mixin::AdditionalFields Koha::Objects Koha::Objects::Limit::Library);
26
26
27
=head1 NAME
27
=head1 NAME
28
28
(-)a/admin/debit_types.pl (-2 / +12 lines)
Lines 27-32 use C4::Output qw( output_html_with_http_headers ); Link Here
27
27
28
use Koha::Account::DebitType;
28
use Koha::Account::DebitType;
29
use Koha::Account::DebitTypes;
29
use Koha::Account::DebitTypes;
30
use Koha::AdditionalFields;
30
31
31
my $input = CGI->new;
32
my $input = CGI->new;
32
my $code  = $input->param('code');
33
my $code  = $input->param('code');
Lines 67-75 if ( $op eq 'add_form' ) { Link Here
67
          };
68
          };
68
    }
69
    }
69
70
71
    my @additional_fields       = Koha::AdditionalFields->search( { tablename => 'account_debit_types' } )->as_list;
72
    my @additional_field_values = $debit_type ? $debit_type->get_additional_field_values_for_template : ();
73
70
    $template->param(
74
    $template->param(
71
        debit_type    => $debit_type,
75
        debit_type              => $debit_type,
72
        branches_loop => \@branches_loop
76
        branches_loop           => \@branches_loop,
77
        additional_fields       => \@additional_fields,
78
        additional_field_values => @additional_field_values,
73
    );
79
    );
74
}
80
}
75
elsif ( $op eq 'cud-add_validate' ) {
81
elsif ( $op eq 'cud-add_validate' ) {
Lines 92-97 elsif ( $op eq 'cud-add_validate' ) { Link Here
92
    try {
98
    try {
93
        $debit_type->store;
99
        $debit_type->store;
94
        $debit_type->replace_library_limits( \@branches );
100
        $debit_type->replace_library_limits( \@branches );
101
102
        my @additional_fields = $debit_type->prepare_cgi_additional_field_values( $input, 'account_debit_types' );
103
        $debit_type->set_additional_fields( \@additional_fields );
104
95
        push @messages, { type => 'message', code => 'success_on_saving' };
105
        push @messages, { type => 'message', code => 'success_on_saving' };
96
    }
106
    }
97
    catch {
107
    catch {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/additional-fields.tt (-1 / +6 lines)
Lines 149-159 Link Here
149
                        [% WRAPPER table_option value="erm_packages" %]Packages[% END %]
149
                        [% WRAPPER table_option value="erm_packages" %]Packages[% END %]
150
                    </ul>
150
                    </ul>
151
                [% END %]
151
                [% END %]
152
                [% IF CAN_user_updatecharges_remaining_permissions %]
152
                [% IF CAN_user_updatecharges_remaining_permissions || CAN_user_parameters_manage_accounts %]
153
                    <h3>Members</h3>
153
                    <h3>Members</h3>
154
                    <ul>
154
                    <ul>
155
                        [% IF CAN_user_updatecharges_remaining_permissions %]
155
                        [% WRAPPER table_option value="accountlines:credit" %]Account lines (credit)[% END %]
156
                        [% WRAPPER table_option value="accountlines:credit" %]Account lines (credit)[% END %]
156
                        [% WRAPPER table_option value="accountlines:debit" %]Account lines (debit)[% END %]
157
                        [% WRAPPER table_option value="accountlines:debit" %]Account lines (debit)[% END %]
158
                        [% END %]
159
                        [% IF ( CAN_user_parameters_manage_accounts ) %]
160
                        [% WRAPPER table_option value="account_debit_types" %]Account debit types[% END %]
161
                        [% END %]
157
                    </ul>
162
                    </ul>
158
                [% END %]
163
                [% END %]
159
                [% IF CAN_user_serials_edit_subscription %]
164
                [% IF CAN_user_serials_edit_subscription %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt (-2 / +4 lines)
Lines 148-154 Link Here
148
                                </li>
148
                                </li>
149
                            </ol>
149
                            </ol>
150
                        </fieldset>
150
                        </fieldset>
151
151
                        [% IF additional_fields.size %]
152
                            [% INCLUDE 'additional-fields-entry.inc' available=additional_fields values=additional_field_values wrap_fieldset=1 %]
153
                        [% END %]
152
                        <fieldset class="action">
154
                        <fieldset class="action">
153
                            <button id="save_debit_type" class="btn btn-primary">Save</button>
155
                            <button id="save_debit_type" class="btn btn-primary">Save</button>
154
                            <a class="cancel" href="/cgi-bin/koha/admin/debit_types.pl">Cancel</a>
156
                            <a class="cancel" href="/cgi-bin/koha/admin/debit_types.pl">Cancel</a>
Lines 262-267 Link Here
262
264
263
[% MACRO jsinclude BLOCK %]
265
[% MACRO jsinclude BLOCK %]
264
    [% Asset.js("js/admin-menu.js") | $raw %]
266
    [% Asset.js("js/admin-menu.js") | $raw %]
267
    [% Asset.js("js/additional-fields-entry.js") | $raw %]
265
    [% INCLUDE 'datatables.inc' %]
268
    [% INCLUDE 'datatables.inc' %]
266
269
267
    <script>
270
    <script>
268
- 

Return to bug 38457