Bugzilla – Attachment 93999 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 `account`
Bug-23049-Capitalise-type-passed-to-adddebit-for-a.patch (text/plain), 5.93 KB, created by
Martin Renvoize (ashimema)
on 2019-10-11 11:43:33 UTC
(
hide
)
Description:
Bug 23049: Capitalise type passed to add_debit for `account`
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-10-11 11:43:33 UTC
Size:
5.93 KB
patch
obsolete
>From 3d4e4da4d73d38ebf0433f51834dc12a2499dfd2 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 10 Oct 2019 16:31:17 +0100 >Subject: [PATCH] Bug 23049: Capitalise type passed to add_debit for `account` >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> >--- > Koha/Account.pm | 12 ++++++------ > Koha/Patron.pm | 2 +- > t/db_dependent/Accounts.t | 16 ++++++++-------- > t/db_dependent/SIP/Transaction.t | 4 ++-- > 4 files changed, 17 insertions(+), 17 deletions(-) > >diff --git a/Koha/Account.pm b/Koha/Account.pm >index 8dfd3a4d4d..183928a152 100644 >--- a/Koha/Account.pm >+++ b/Koha/Account.pm >@@ -444,8 +444,8 @@ my $debit_line = Koha::Account->new({ patron_id => $patron_id })->add_debit( > ); > > $debit_type can be any of: >- - account >- - account_renew >+ - ACCOUNT >+ - ACCOUNT_RENEW > - hold_expired > - lost_item > - sundry >@@ -709,8 +709,8 @@ our $offset_type = { > 'lost_item_return' => 'Lost Item', > 'payment' => 'Payment', > 'writeoff' => 'Writeoff', >- 'account' => 'Account Fee', >- 'account_renew' => 'Account Fee', >+ 'ACCOUNT' => 'Account Fee', >+ 'ACCOUNT_RENEW' => 'Account Fee', > 'RESERVE' => 'Reserve Fee', > 'PROCESSING' => 'Processing Fee', > 'lost_item' => 'Lost Item', >@@ -740,8 +740,8 @@ our $account_type_credit = { > =cut > > our $account_type_debit = { >- 'account' => 'ACCOUNT', >- 'account_renew' => 'ACCOUNT_RENEW', >+ 'ACCOUNT' => 'ACCOUNT', >+ 'ACCOUNT_RENEW' => 'ACCOUNT_RENEW', > 'hold_expired' => 'HE', > 'lost_item' => 'LOST', > 'sundry' => 'M', >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index fca796ff28..d4dcec986e 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -887,7 +887,7 @@ sub add_enrolment_fee_if_needed { > my ($self, $renewal) = @_; > my $enrolment_fee = $self->category->enrolmentfee; > if ( $enrolment_fee && $enrolment_fee > 0 ) { >- my $type = $renewal ? 'account_renew' : 'account'; >+ my $type = $renewal ? 'ACCOUNT_RENEW' : 'ACCOUNT'; > $self->account->add_debit( > { > amount => $enrolment_fee, >diff --git a/t/db_dependent/Accounts.t b/t/db_dependent/Accounts.t >index a34c523341..4e93b9e85b 100644 >--- a/t/db_dependent/Accounts.t >+++ b/t/db_dependent/Accounts.t >@@ -183,8 +183,8 @@ subtest "Koha::Account::pay tests" => sub { > > my $account = Koha::Account->new({ patron_id => $borrower->id }); > >- my $line1 = $account->add_debit({ type => 'account', amount => 100, interface => 'commandline' }); >- my $line2 = $account->add_debit({ type => 'account', amount => 200, interface => 'commandline' }); >+ my $line1 = $account->add_debit({ type => 'ACCOUNT', amount => 100, interface => 'commandline' }); >+ my $line2 = $account->add_debit({ type => 'ACCOUNT', amount => 200, interface => 'commandline' }); > > $sth = $dbh->prepare("SELECT count(*) FROM accountlines"); > $sth->execute; >@@ -283,7 +283,7 @@ subtest "Koha::Account::pay tests" => sub { > $note = $sth->fetchrow_array; > is($note,'$200.00 payment note', '$200.00 payment note is registered'); > >- my $line3 = $account->add_debit({ type => 'account', amount => 42, interface => 'commandline' }); >+ my $line3 = $account->add_debit({ type => 'ACCOUNT', amount => 42, interface => 'commandline' }); > my $payment_id = $account->pay( { lines => [$line3], amount => 42 } ); > my $payment = Koha::Account::Lines->find( $payment_id ); > is( $payment->amount(), '-42.000000', "Payment paid the specified fine" ); >@@ -311,10 +311,10 @@ subtest "Koha::Account::pay particular line tests" => sub { > > my $account = Koha::Account->new({ patron_id => $borrower->id }); > >- my $line1 = $account->add_debit({ type => 'account', amount => 1, interface => 'commandline' }); >- my $line2 = $account->add_debit({ type => 'account', amount => 2, interface => 'commandline' }); >- my $line3 = $account->add_debit({ type => 'account', amount => 3, interface => 'commandline' }); >- my $line4 = $account->add_debit({ type => 'account', amount => 4, interface => 'commandline' }); >+ my $line1 = $account->add_debit({ type => 'ACCOUNT', amount => 1, interface => 'commandline' }); >+ my $line2 = $account->add_debit({ type => 'ACCOUNT', amount => 2, interface => 'commandline' }); >+ my $line3 = $account->add_debit({ type => 'ACCOUNT', amount => 3, interface => 'commandline' }); >+ my $line4 = $account->add_debit({ type => 'ACCOUNT', amount => 4, interface => 'commandline' }); > > is( $account->balance(), 10, "Account balance is 10" ); > >@@ -356,7 +356,7 @@ subtest "Koha::Account::pay writeoff tests" => sub { > > my $account = Koha::Account->new({ patron_id => $borrower->id }); > >- my $line = $account->add_debit({ type => 'account', amount => 42, interface => 'commandline' }); >+ my $line = $account->add_debit({ type => 'ACCOUNT', amount => 42, interface => 'commandline' }); > > is( $account->balance(), 42, "Account balance is 42" ); > >diff --git a/t/db_dependent/SIP/Transaction.t b/t/db_dependent/SIP/Transaction.t >index c630fadfde..53d59d8011 100755 >--- a/t/db_dependent/SIP/Transaction.t >+++ b/t/db_dependent/SIP/Transaction.t >@@ -106,9 +106,9 @@ subtest "FeePayment->pay tests" => sub { > my $account = > Koha::Account->new( { patron_id => $patron->{borrowernumber} } ); > my $debt1 = $account->add_debit( >- { type => 'account', amount => 100, interface => 'commandline' } ); >+ { type => 'ACCOUNT', amount => 100, interface => 'commandline' } ); > my $debt2 = $account->add_debit( >- { type => 'account', amount => 200, interface => 'commandline' } ); >+ { type => 'ACCOUNT', amount => 200, interface => 'commandline' } ); > > # Instantiate a new FeePayment transaction object > my $trans = C4::SIP::ILS::Transaction::FeePayment->new(); >-- >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