Bugzilla – Attachment 94139 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: Update debit_type_code 'Res' to 'RESERVE'
Bug-23049-Update-debittypecode-Res-to-RESERVE.patch (text/plain), 8.58 KB, created by
Martin Renvoize (ashimema)
on 2019-10-15 08:19:53 UTC
(
hide
)
Description:
Bug 23049: Update debit_type_code 'Res' to 'RESERVE'
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-10-15 08:19:53 UTC
Size:
8.58 KB
patch
obsolete
>From 84543b223ad9fb05949edc1b3a9d999fb70b0466 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 10 Oct 2019 16:10:07 +0100 >Subject: [PATCH] Bug 23049: Update debit_type_code 'Res' to 'RESERVE' >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch updates all cases where debit_type_code was 'Res' to >'RESERVE' which is more informative and consistent with the new style >guidelines. > >The patch also ensure all calls to add_debit with a type or 'reserve' >now pass the capitalised code instead. > >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> > >Capitalise reserve >--- > C4/Reserves.pm | 2 +- > Koha/Account.pm | 8 ++++---- > installer/data/mysql/account_debit_types.sql | 2 +- > installer/data/mysql/atomicupdate/bug_23049_debit.perl | 9 ++++++++- > .../data/mysql/en/mandatory/account_debit_types.sql | 2 +- > koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc | 2 +- > .../opac-tmpl/bootstrap/en/includes/account-table.inc | 2 +- > opac/sco/sco-main.pl | 2 +- > t/db_dependent/Accounts.t | 2 +- > t/db_dependent/Reserves.t | 2 +- > 10 files changed, 20 insertions(+), 13 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 2a77c3dc5b..d573916fb6 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -578,7 +578,7 @@ sub ChargeReserveFee { > library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, > interface => C4::Context->interface, > invoice_type => undef, >- type => 'reserve', >+ type => 'RESERVE', > item_id => undef > } > ); >diff --git a/Koha/Account.pm b/Koha/Account.pm >index 61b08db92c..af05b51016 100644 >--- a/Koha/Account.pm >+++ b/Koha/Account.pm >@@ -456,7 +456,7 @@ $debit_type can be any of: > - rent_daily > - rent_renew > - rent_daily_renew >- - reserve >+ - RESERVE > - manual_debit > > =cut >@@ -632,7 +632,7 @@ sub non_issues_charges { > #NOTE: With bug 23049 these preferences could be moved to being attached > #to individual debit types to give more flexability and specificity. > my @not_fines; >- push @not_fines, 'Res' >+ push @not_fines, 'RESERVE' > unless C4::Context->preference('HoldsInNoissuesCharge'); > push @not_fines, ( 'RENT', 'RENT_DAILY', 'RENT_RENEW', 'RENT_DAILY_RENEW' ) > unless C4::Context->preference('RentalsInNoissuesCharge'); >@@ -711,7 +711,7 @@ our $offset_type = { > 'writeoff' => 'Writeoff', > 'account' => 'Account Fee', > 'account_renew' => 'Account Fee', >- 'reserve' => 'Reserve Fee', >+ 'RESERVE' => 'Reserve Fee', > 'processing' => 'Processing Fee', > 'lost_item' => 'Lost Item', > 'rent' => 'Rental Fee', >@@ -752,7 +752,7 @@ our $account_type_debit = { > 'rent_daily' => 'RENT_DAILY', > 'rent_renew' => 'RENT_RENEW', > 'rent_daily_renew' => 'RENT_DAILY_RENEW', >- 'reserve' => 'Res', >+ 'RESERVE' => 'RESERVE', > 'manual_debit' => 'M' > }; > >diff --git a/installer/data/mysql/account_debit_types.sql b/installer/data/mysql/account_debit_types.sql >index db769631cc..1737295293 100644 >--- a/installer/data/mysql/account_debit_types.sql >+++ b/installer/data/mysql/account_debit_types.sql >@@ -11,4 +11,4 @@ INSERT INTO account_debit_types ( code, description, can_be_added_manually, defa > ('RENT_DAILY', 'Daily rental fee', 0, NULL, 1), > ('RENT_RENEW', 'Renewal of rental item', 0, NULL, 1), > ('RENT_DAILY_RENEW', 'Rewewal of daily rental item', 0, NULL, 1), >-('Res', 'Hold fee', 0, NULL, 1); >+('RESERVE', 'Hold fee', 0, NULL, 1); >diff --git a/installer/data/mysql/atomicupdate/bug_23049_debit.perl b/installer/data/mysql/atomicupdate/bug_23049_debit.perl >index bc37c3e253..be063adf15 100644 >--- a/installer/data/mysql/atomicupdate/bug_23049_debit.perl >+++ b/installer/data/mysql/atomicupdate/bug_23049_debit.perl >@@ -50,7 +50,14 @@ if ( CheckVersion($DBversion) ) { > ('RENT_DAILY', 'Daily rental fee', 0, NULL, 1), > ('RENT_RENEW', 'Renewal of rental item', 0, NULL, 1), > ('RENT_DAILY_RENEW', 'Rewewal of daily rental item', 0, NULL, 1), >- ('Res', 'Hold fee', 0, NULL, 1) >+ ('RESERVE', 'Hold fee', 0, NULL, 1) >+ } >+ ); >+ >+ # Update accountype 'Res' to 'RESERVE' >+ $dbh->do( >+ qq{ >+ UPDATE accountlines SET accounttype = 'RESERVE' WHERE accounttype = 'Res' > } > ); > >diff --git a/installer/data/mysql/en/mandatory/account_debit_types.sql b/installer/data/mysql/en/mandatory/account_debit_types.sql >index db769631cc..1737295293 100644 >--- a/installer/data/mysql/en/mandatory/account_debit_types.sql >+++ b/installer/data/mysql/en/mandatory/account_debit_types.sql >@@ -11,4 +11,4 @@ INSERT INTO account_debit_types ( code, description, can_be_added_manually, defa > ('RENT_DAILY', 'Daily rental fee', 0, NULL, 1), > ('RENT_RENEW', 'Renewal of rental item', 0, NULL, 1), > ('RENT_DAILY_RENEW', 'Rewewal of daily rental item', 0, NULL, 1), >-('Res', 'Hold fee', 0, NULL, 1); >+('RESERVE', 'Hold fee', 0, NULL, 1); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc >index c863e98e22..1f0f6bd2a6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc >@@ -25,7 +25,7 @@ > [%- CASE 'RENT_DAILY' -%]Daily rental fee > [%- CASE 'RENT_RENEW' -%]Renewal of rental item > [%- CASE 'RENT_DAILY_RENEW' -%]Rewewal of daily rental item >- [%- CASE 'Res' -%]Hold fee >+ [%- CASE 'RESERVE' -%]Hold fee > [%- CASE -%][% account.debit_type.description | html %] > [%- END -%] > [%- END -%] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc >index 3e634215e6..2643dd30a9 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc >@@ -196,7 +196,7 @@ > [%- CASE 'RENT_DAILY' -%]Daily rental fee > [%- CASE 'RENT_RENEW' -%]Renewal of rental item > [%- CASE 'RENT_DAILY_RENEW' -%]Rewewal of daily rental item >- [%- CASE 'Res' -%]Hold fee >+ [%- CASE 'RESERVE' -%]Hold fee > [%- CASE -%][% account.debit_type.description | html %] > [%- END -%] > [%- END -%] >diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl >index cbf54ff693..66b347ed00 100755 >--- a/opac/sco/sco-main.pl >+++ b/opac/sco/sco-main.pl >@@ -241,7 +241,7 @@ elsif ( $patron && ( $op eq 'checkout' || $op eq 'renew' ) ) { > patron_has_hold_fee => Koha::Account::Lines->search( > { > borrowernumber => $borrower->{borrowernumber}, >- debit_type_code => 'Res', >+ debit_type_code => 'RESERVE', > description => $item->biblio->title, > date => $dtf->format_date(dt_from_string) > } >diff --git a/t/db_dependent/Accounts.t b/t/db_dependent/Accounts.t >index 8d91d22f85..6ae2171e7e 100644 >--- a/t/db_dependent/Accounts.t >+++ b/t/db_dependent/Accounts.t >@@ -774,7 +774,7 @@ subtest "Koha::Account::non_issues_charges tests" => sub { > $account->add_debit( > { > description => 'a Res fee', >- type => 'reserve', >+ type => 'RESERVE', > amount => $res, > interface => 'commandline' > } >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index 804d2c061b..43aff8bddf 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -739,7 +739,7 @@ subtest 'ChargeReserveFee tests' => sub { > > is( ref($line), 'Koha::Account::Line' , 'Returns a Koha::Account::Line object'); > ok( $line->is_debit, 'Generates a debit line' ); >- is( $line->debit_type_code, 'Res' , 'generates Res debit_type'); >+ is( $line->debit_type_code, 'RESERVE' , 'generates RESERVE debit_type'); > is( $line->borrowernumber, $patron->id , 'generated line belongs to the passed patron'); > is( $line->amount, $fee , 'amount set correctly'); > is( $line->amountoutstanding, $fee , 'amountoutstanding set correctly'); >-- >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