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 66-74
if ( $op eq 'add_form' ) {
Link Here
|
66 |
}; |
67 |
}; |
67 |
} |
68 |
} |
68 |
|
69 |
|
|
|
70 |
my @additional_fields = Koha::AdditionalFields->search( { tablename => 'account_debit_types' } )->as_list; |
71 |
my @additional_field_values = $debit_type ? $debit_type->get_additional_field_values_for_template : (); |
72 |
|
69 |
$template->param( |
73 |
$template->param( |
70 |
debit_type => $debit_type, |
74 |
debit_type => $debit_type, |
71 |
branches_loop => \@branches_loop |
75 |
branches_loop => \@branches_loop, |
|
|
76 |
additional_fields => \@additional_fields, |
77 |
additional_field_values => @additional_field_values, |
72 |
); |
78 |
); |
73 |
} elsif ( $op eq 'cud-add_validate' ) { |
79 |
} elsif ( $op eq 'cud-add_validate' ) { |
74 |
my $description = $input->param('description'); |
80 |
my $description = $input->param('description'); |
Lines 90-95
if ( $op eq 'add_form' ) {
Link Here
|
90 |
try { |
96 |
try { |
91 |
$debit_type->store; |
97 |
$debit_type->store; |
92 |
$debit_type->replace_library_limits( \@branches ); |
98 |
$debit_type->replace_library_limits( \@branches ); |
|
|
99 |
|
100 |
my @additional_fields = $debit_type->prepare_cgi_additional_field_values( $input, 'account_debit_types' ); |
101 |
$debit_type->set_additional_fields( \@additional_fields ); |
102 |
|
93 |
push @messages, { type => 'message', code => 'success_on_saving' }; |
103 |
push @messages, { type => 'message', code => 'success_on_saving' }; |
94 |
} catch { |
104 |
} catch { |
95 |
push @messages, { type => 'error', code => 'error_on_saving' }; |
105 |
push @messages, { type => 'error', code => 'error_on_saving' }; |