Bugzilla – Attachment 77310 Details for
Bug 20997
Add Koha::Account::Line::apply
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20997: (QA follow-up) POD fixes and offset type consistency
Bug-20997-QA-follow-up-POD-fixes-and-offset-type-c.patch (text/plain), 3.53 KB, created by
Tomás Cohen Arazi (tcohen)
on 2018-07-27 17:57:24 UTC
(
hide
)
Description:
Bug 20997: (QA follow-up) POD fixes and offset type consistency
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2018-07-27 17:57:24 UTC
Size:
3.53 KB
patch
obsolete
>From 1933e4f082f9cbe60a35ab3b176786fa0e7c2507 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 27 Jul 2018 14:55:14 -0300 >Subject: [PATCH] Bug 20997: (QA follow-up) POD fixes and offset type > consistency > >This patch addresses minor issues highlighted by QA. >- The POD is enhanced based on the proposal in bug 11983. >- The introduced offset type value is made consistent with the rest of >them. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Account/Line.pm | 17 +++++++++++++++-- > installer/data/mysql/account_offset_types.sql | 2 +- > .../data/mysql/atomicupdate/bug_20997.perl | 2 +- > t/db_dependent/Koha/Account/Lines.t | 2 +- > 4 files changed, 18 insertions(+), 5 deletions(-) > >diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm >index 491d55bab3..9cf8867bce 100644 >--- a/Koha/Account/Line.pm >+++ b/Koha/Account/Line.pm >@@ -129,7 +129,20 @@ sub void { > =head3 apply > > my $debits = $account->outstanding_debits; >- my $outstanding_amount = $credit->apply({ debits => $debits, [ offset_type => $offset_type ] }); >+ my $outstanding_amount = $credit->apply( { debits => $debits, [ offset_type => $offset_type ] } ); >+ >+Applies the credit to a given debits set. >+ >+=head4 arguments hashref >+ >+=over 4 >+ >+=item debits - Koha::Account::Lines object set of debits >+ >+=item offset_type (optional) - a string indicating the offset type (valid values are those from >+the 'account_offset_types' table) >+ >+=back > > =cut > >@@ -137,7 +150,7 @@ sub apply { > my ( $self, $params ) = @_; > > my $debits = $params->{debits}; >- my $offset_type = $params->{offset_type} // 'credit_applied'; >+ my $offset_type = $params->{offset_type} // 'Credit Applied'; > > unless ( $self->is_credit ) { > Koha::Exceptions::Account::IsNotCredit->throw( >diff --git a/installer/data/mysql/account_offset_types.sql b/installer/data/mysql/account_offset_types.sql >index baf3a26a6a..083e56ca21 100644 >--- a/installer/data/mysql/account_offset_types.sql >+++ b/installer/data/mysql/account_offset_types.sql >@@ -12,4 +12,4 @@ INSERT INTO account_offset_types ( type ) VALUES > ('Fine Update'), > ('Fine'), > ('Void Payment'), >-('credit_applied'); >+('Credit Applied'); >diff --git a/installer/data/mysql/atomicupdate/bug_20997.perl b/installer/data/mysql/atomicupdate/bug_20997.perl >index 159917aacb..49f22787c1 100644 >--- a/installer/data/mysql/atomicupdate/bug_20997.perl >+++ b/installer/data/mysql/atomicupdate/bug_20997.perl >@@ -3,7 +3,7 @@ if( CheckVersion( $DBversion ) ) { > > # Add 'credit_applied' offset type > $dbh->do(q{ >- INSERT IGNORE INTO `account_offset_types` (`type`) VALUES ('credit_applied'); >+ INSERT IGNORE INTO `account_offset_types` (`type`) VALUES ('Credit Applied'); > }); > > SetVersion( $DBversion ); >diff --git a/t/db_dependent/Koha/Account/Lines.t b/t/db_dependent/Koha/Account/Lines.t >index 506be99cff..20033e70b6 100755 >--- a/t/db_dependent/Koha/Account/Lines.t >+++ b/t/db_dependent/Koha/Account/Lines.t >@@ -217,7 +217,7 @@ subtest 'apply() tests' => sub { > is( $offsets->count, 1, 'Only one offset is generated' ); > $THE_offset = $offsets->next; > is( $THE_offset->amount * 1, 90, 'Amount was calculated correctly (less than the available credit)' ); >- is( $THE_offset->type, 'credit_applied', 'Defaults to credit_applied offset type' ); >+ is( $THE_offset->type, 'Credit Applied', 'Defaults to \'Credit Applied\' offset type' ); > > $debits = Koha::Account::Lines->search({ accountlines_id => $debit_1->id }); > throws_ok >-- >2.18.0
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 20997
:
76451
|
76452
|
76459
|
76460
|
76461
|
76462
|
76463
|
76464
|
76465
|
76549
|
76550
|
76551
|
76654
|
76655
|
77194
|
77195
|
77196
|
77197
|
77198
|
77199
|
77310
|
77349
|
77350
|
77351
|
77352
|
77353
|
77354
|
77355
|
77356