@@ -, +, @@ split table view is clearer/better. --- Koha/Account/DebitTypes.pm | 1 + admin/debit_types.pl | 12 ++++++-- .../prog/en/includes/accounts.inc | 10 +++---- .../prog/en/modules/admin/debit_types.tt | 29 +++++++++++++++++++ 4 files changed, 45 insertions(+), 7 deletions(-) --- a/Koha/Account/DebitTypes.pm +++ a/Koha/Account/DebitTypes.pm @@ -45,6 +45,7 @@ sub delete { my @set = $self->as_list; my $defaults = Koha::Account::DebitType::defaults; for my $type (@set) { + if ( any { $type->code eq $_ } @{$defaults} ) { Koha::Exceptions::CannotDeleteDefault->throw; } --- a/admin/debit_types.pl +++ a/admin/debit_types.pl @@ -23,6 +23,7 @@ use C4::Context; use C4::Auth; use C4::Output; +use Koha::Account::DebitType; use Koha::Account::DebitTypes; my $input = new CGI; @@ -133,8 +134,15 @@ elsif ( $op eq 'delete_confirmed' ) { } if ( $op eq 'list' ) { - my $debit_types = Koha::Account::DebitTypes->search(); - $template->param( debit_types => $debit_types ); + my $defaults = Koha::Account::DebitType::defaults; + my $system_types = + Koha::Account::DebitTypes->search( { code => { 'in' => $defaults } } ); + my $debit_types = Koha::Account::DebitTypes->search( + { code => { 'not_in' => $defaults } } ); + $template->param( + debit_types => $debit_types, + system_types => $system_types + ); } $template->param( --- a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc @@ -13,18 +13,18 @@ [%- END -%] [%- ELSIF account.debit_type -%] [%- SWITCH account.debit_type -%] - [%- CASE 'N' -%]New card - [%- CASE 'OVERDUE' -%]Fine [%- CASE 'ACCOUNT' -%]Account creation fee [%- CASE 'ACCOUNT_RENEW' -%]Account renewal fee - [%- CASE 'M' -%]Sundry - [%- CASE 'LOST' -%]Lost item [%- CASE 'HE' -%]Hold waiting too long + [%- CASE 'LOST' -%]Lost item + [%- CASE 'M' -%]Sundry + [%- CASE 'N' -%]New card + [%- CASE 'OVERDUE' -%]Fine + [%- CASE 'PF' -%]Lost item processing fee [%- CASE 'RENT' -%]Rental fee [%- CASE 'RENT_DAILY' -%]Daily rental fee [%- CASE 'RENT_RENEW' -%]Renewal of rental item [%- CASE 'RENT_DAILY_RENEW' -%]Rewewal of daily rental item - [%- CASE 'PF' -%]Lost item processing fee [%- CASE 'Res' -%]Hold fee [%- CASE -%][% account.debit_type.description | html %] [%- END -%] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt @@ -152,6 +152,7 @@
Account type code | +Description | +Default amount | +Can be added manually | + + + [% FOREACH system_type IN system_types %] +
---|---|---|---|
[% system_type.code | html %] | +[% system_type.description | html %] | +[% system_type.default_amount | $Price %] | +[% IF system_type.can_be_added_manually %]Yes[% ELSE %]No[% END %] | +