Bugzilla – Attachment 93522 Details for
Bug 23049
Replace MANUAL_INV authorised value with a dedicated table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23049: Split system and local types
Bug-23049-Split-system-and-local-types.patch (text/plain), 5.95 KB, created by
Martin Renvoize (ashimema)
on 2019-10-03 07:25:04 UTC
(
hide
)
Description:
Bug 23049: Split system and local types
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-10-03 07:25:04 UTC
Size:
5.95 KB
patch
obsolete
>From e5de9aab7f2fd27af703df30baf96808fb769b0a Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 3 Oct 2019 06:18:42 +0100 >Subject: [PATCH] Bug 23049: Split system and local types > >Test plan >1) Apply patches up to this point >2) View the new debit types management page and comment whether the > 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(-) > >diff --git a/Koha/Account/DebitTypes.pm b/Koha/Account/DebitTypes.pm >index a9fa462e7d..e7bf4c2e33 100644 >--- a/Koha/Account/DebitTypes.pm >+++ b/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; > } >diff --git a/admin/debit_types.pl b/admin/debit_types.pl >index a8336e69bb..3b1dc0fc18 100755 >--- a/admin/debit_types.pl >+++ b/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( >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc >index 75bd7f7243..c863e98e22 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc >+++ b/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 -%] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt >index 5f8d3ac0f1..8a90137e0c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt >@@ -152,6 +152,7 @@ > </div> > > <h3>Account debit types</h3> >+ <h4>Custom types</h4> > [% IF debit_types.count %] > <table id="table_debit_types"> > <thead> >@@ -204,6 +205,25 @@ > 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> > </div> > [% END %] >+ <h4>System types</h4> >+ <table id="table_system_types"> >+ <thead> >+ <th>Account type code</th> >+ <th>Description</th> >+ <th>Default amount</th> >+ <th>Can be added manually</th> >+ </thead> >+ <tbody> >+ [% FOREACH system_type IN system_types %] >+ <tr> >+ <td>[% system_type.code | html %]</td> >+ <td>[% system_type.description | html %]</td> >+ <td>[% system_type.default_amount | $Price %]</td> >+ <td>[% IF system_type.can_be_added_manually %]Yes[% ELSE %]No[% END %]</td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> > [% END %] > </main> > </div> <!-- /.col-sm-10.col-sm-push-2 --> >@@ -229,6 +249,15 @@ > "iDisplayLength": 10, > "sPaginationType": "full_numbers" > })); >+ >+ $("#table_system_types").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aoColumnDefs": [ >+ { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, >+ ], >+ "aaSorting": [[ 1, "asc" ]], >+ "iDisplayLength": 10, >+ "sPaginationType": "full_numbers" >+ })); > }); > </script> > [% END %] >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23049
:
93513
|
93514
|
93515
|
93516
|
93518
|
93519
|
93520
|
93521
|
93522
|
93523
|
93529
|
93557
|
93564
|
93565
|
93567
|
93568
|
93569
|
93570
|
93571
|
93572
|
93573
|
93574
|
93575
|
93576
|
93577
|
93578
|
93579
|
93960
|
93961
|
93962
|
93963
|
93964
|
93965
|
93966
|
93967
|
93968
|
93969
|
93970
|
93972
|
93973
|
93974
|
93975
|
93976
|
93977
|
93978
|
93979
|
93989
|
93990
|
93991
|
93992
|
93993
|
93994
|
93995
|
93996
|
93997
|
93998
|
93999
|
94000
|
94001
|
94002
|
94003
|
94004
|
94005
|
94006
|
94007
|
94008
|
94073
|
94074
|
94075
|
94076
|
94077
|
94078
|
94079
|
94080
|
94081
|
94082
|
94083
|
94084
|
94085
|
94086
|
94087
|
94088
|
94089
|
94090
|
94091
|
94092
|
94093
|
94111
|
94112
|
94113
|
94114
|
94115
|
94116
|
94117
|
94118
|
94119
|
94120
|
94121
|
94122
|
94123
|
94124
|
94125
|
94126
|
94127
|
94128
|
94129
|
94130
|
94131
|
94132
|
94133
|
94134
|
94135
|
94136
|
94137
|
94138
|
94139
|
94140
|
94141
|
94142
|
94143
|
94144
|
94145
|
94146
|
94147
|
94148
|
94149
|
94150
|
94151
|
94152
|
94165
|
94307
|
94308
|
94309
|
94310
|
94311
|
94312
|
94313
|
94314
|
94315
|
94316
|
94317
|
94318
|
94319
|
94320
|
94321
|
94323
|
94324
|
94325
|
94326
|
94327
|
94328
|
94329
|
94331
|
94332
|
94333
|
94334
|
94335
|
94336
|
94337
|
94338
|
94339
|
94340
|
94341
|
94342
|
94343
|
94344
|
94345
|
94346
|
94347
|
94348
|
94349
|
94350
|
94351
|
94352
|
94648