Bugzilla – Attachment 94140 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: Capitalise type passed to add_debit for `rent`
Bug-23049-Capitalise-type-passed-to-adddebit-for-r.patch (text/plain), 7.56 KB, created by
Martin Renvoize (ashimema)
on 2019-10-15 08:19:58 UTC
(
hide
)
Description:
Bug 23049: Capitalise type passed to add_debit for `rent`
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-10-15 08:19:58 UTC
Size:
7.56 KB
patch
obsolete
>From 35d59d732ad9733b0f10f09eb277347ae5c151a4 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 10 Oct 2019 16:17:48 +0100 >Subject: [PATCH] Bug 23049: Capitalise type passed to add_debit for `rent` >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> >--- > C4/Circulation.pm | 8 ++++---- > Koha/Account.pm | 24 ++++++++++++------------ > t/db_dependent/Accounts.t | 2 +- > t/db_dependent/Circulation/issue.t | 2 +- > t/db_dependent/Koha/Account.t | 12 ++++++------ > 5 files changed, 24 insertions(+), 24 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index befdc3e986..9533fd79d6 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1468,14 +1468,14 @@ sub AddIssue { > # If it costs to borrow this book, charge it to the patron's account. > my ( $charge, $itemtype ) = GetIssuingCharges( $item_object->itemnumber, $borrower->{'borrowernumber'} ); > if ( $charge > 0 ) { >- AddIssuingCharge( $issue, $charge, 'rent' ); >+ AddIssuingCharge( $issue, $charge, 'RENT' ); > } > > my $itemtype_object = Koha::ItemTypes->find( $item_object->effective_itemtype ); > if ( $itemtype_object ) { > my $accumulate_charge = $fees->accumulate_rentalcharge(); > if ( $accumulate_charge > 0 ) { >- AddIssuingCharge( $issue, $accumulate_charge, 'rent_daily' ) if $accumulate_charge > 0; >+ AddIssuingCharge( $issue, $accumulate_charge, 'RENT_DAILY' ) if $accumulate_charge > 0; > $charge += $accumulate_charge; > $item_unblessed->{charge} = $charge; > } >@@ -2908,7 +2908,7 @@ sub AddRenewal { > # Charge a new rental fee, if applicable > my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber ); > if ( $charge > 0 ) { >- AddIssuingCharge($issue, $charge, 'rent_renew'); >+ AddIssuingCharge($issue, $charge, 'RENT_RENEW'); > } > > # Charge a new accumulate rental fee, if applicable >@@ -2916,7 +2916,7 @@ sub AddRenewal { > if ( $itemtype_object ) { > my $accumulate_charge = $fees->accumulate_rentalcharge(); > if ( $accumulate_charge > 0 ) { >- AddIssuingCharge( $issue, $accumulate_charge, 'rent_daily_renew' ) >+ AddIssuingCharge( $issue, $accumulate_charge, 'RENT_DAILY_RENEW' ) > } > $charge += $accumulate_charge; > } >diff --git a/Koha/Account.pm b/Koha/Account.pm >index af05b51016..c6776c6e3f 100644 >--- a/Koha/Account.pm >+++ b/Koha/Account.pm >@@ -452,10 +452,10 @@ $debit_type can be any of: > - new_card > - overdue > - processing >- - rent >- - rent_daily >- - rent_renew >- - rent_daily_renew >+ - RENT >+ - RENT_DAILY >+ - RENT_RENEW >+ - RENT_DAILY_RENEW > - RESERVE > - manual_debit > >@@ -714,10 +714,10 @@ our $offset_type = { > 'RESERVE' => 'Reserve Fee', > 'processing' => 'Processing Fee', > 'lost_item' => 'Lost Item', >- 'rent' => 'Rental Fee', >- 'rent_daily' => 'Rental Fee', >- 'rent_renew' => 'Rental Fee', >- 'rent_daily_renew' => 'Rental Fee', >+ 'RENT' => 'Rental Fee', >+ 'RENT_DAILY' => 'Rental Fee', >+ 'RENT_RENEW' => 'Rental Fee', >+ 'RENT_DAILY_RENEW' => 'Rental Fee', > 'overdue' => 'OVERDUE', > 'manual_debit' => 'Manual Debit', > 'hold_expired' => 'Hold Expired' >@@ -748,10 +748,10 @@ our $account_type_debit = { > 'new_card' => 'N', > 'overdue' => 'OVERDUE', > 'processing' => 'PF', >- 'rent' => 'RENT', >- 'rent_daily' => 'RENT_DAILY', >- 'rent_renew' => 'RENT_RENEW', >- 'rent_daily_renew' => 'RENT_DAILY_RENEW', >+ 'RENT' => 'RENT', >+ 'RENT_DAILY' => 'RENT_DAILY', >+ 'RENT_RENEW' => 'RENT_RENEW', >+ 'RENT_DAILY_RENEW' => 'RENT_DAILY_RENEW', > 'RESERVE' => 'RESERVE', > 'manual_debit' => 'M' > }; >diff --git a/t/db_dependent/Accounts.t b/t/db_dependent/Accounts.t >index 6ae2171e7e..85b15512ea 100644 >--- a/t/db_dependent/Accounts.t >+++ b/t/db_dependent/Accounts.t >@@ -782,7 +782,7 @@ subtest "Koha::Account::non_issues_charges tests" => sub { > $account->add_debit( > { > description => 'a Rental fee', >- type => 'rent', >+ type => 'RENT', > amount => $rent, > interface => 'commandline' > } >diff --git a/t/db_dependent/Circulation/issue.t b/t/db_dependent/Circulation/issue.t >index 9abae4ac40..81d98bdd5f 100644 >--- a/t/db_dependent/Circulation/issue.t >+++ b/t/db_dependent/Circulation/issue.t >@@ -211,7 +211,7 @@ $sth->execute; > my $countaccount = $sth->fetchrow_array; > is ($countaccount,0,"0 accountline exists"); > my $checkout = Koha::Checkouts->find( $issue_id1 ); >-my $charge = C4::Circulation::AddIssuingCharge( $checkout, 10, 'rent' ); >+my $charge = C4::Circulation::AddIssuingCharge( $checkout, 10, 'RENT' ); > is( ref( $charge ), 'Koha::Account::Line', "An issuing charge has been added" ); > is( $charge->issue_id, $issue_id1, 'Issue id is set correctly for issuing charge' ); > my $offset = Koha::Account::Offsets->find( { debit_id => $charge->id } ); >diff --git a/t/db_dependent/Koha/Account.t b/t/db_dependent/Koha/Account.t >index dad70d445e..de949208a4 100755 >--- a/t/db_dependent/Koha/Account.t >+++ b/t/db_dependent/Koha/Account.t >@@ -290,7 +290,7 @@ subtest 'add_debit() tests' => sub { > description => 'amount validation failure', > library_id => $patron->branchcode, > note => 'this should fail anyway', >- type => 'rent', >+ type => 'RENT', > user_id => $patron->id, > interface => 'commandline' > } >@@ -316,7 +316,7 @@ subtest 'add_debit() tests' => sub { > description => 'Rental charge of 25', > library_id => $patron->branchcode, > note => 'not really important', >- type => 'rent', >+ type => 'RENT', > user_id => $patron->id > } > ); } 'Koha::Exceptions::MissingParameter', 'Exception thrown if interface parameter missing'; >@@ -330,7 +330,7 @@ subtest 'add_debit() tests' => sub { > description => 'Rental charge of 25', > library_id => $patron->branchcode, > note => 'not really important', >- type => 'rent', >+ type => 'RENT', > user_id => $patron->id, > interface => 'commandline' > } >@@ -344,7 +344,7 @@ subtest 'add_debit() tests' => sub { > ); > is( > $line_1->debit_type_code, >- $Koha::Account::account_type_debit->{'rent'}, >+ $Koha::Account::account_type_debit->{'RENT'}, > 'Account type is correctly set' > ); > >@@ -357,7 +357,7 @@ subtest 'add_debit() tests' => sub { > description => 'Rental charge of 37', > library_id => $patron->branchcode, > note => 'not really important', >- type => 'rent', >+ type => 'RENT', > user_id => $patron->id, > interface => 'commandline' > } >@@ -371,7 +371,7 @@ subtest 'add_debit() tests' => sub { > ); > is( > $line_2->debit_type_code, >- $Koha::Account::account_type_debit->{'rent'}, >+ $Koha::Account::account_type_debit->{'RENT'}, > 'Account type is correctly set' > ); > >-- >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