From 15a7203d3dc5ad57b1ad7c120e7bee34de8e062f Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 28 Nov 2018 10:24:36 -0300 Subject: [PATCH] Bug 21896: (QA follow-up) normalize_balance -> reconcile_balance rename This was requested on the QA review and I agree. Signed-off-by: Tomas Cohen Arazi Signed-off-by: Mark Tompsett Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens (cherry picked from commit 5fc2ccd7332ca53dfe07bd079cc446d1df923496) Signed-off-by: Martin Renvoize --- Koha/Account.pm | 6 +++--- t/db_dependent/Koha/Account.t | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Koha/Account.pm b/Koha/Account.pm index 064489f65f..80e8353368 100644 --- a/Koha/Account.pm +++ b/Koha/Account.pm @@ -515,15 +515,15 @@ sub lines { ); } -=head3 normalize_balance +=head3 reconcile_balance -$account->normalize_balance(); +$account->reconcile_balance(); Find outstanding credits and use them to pay outstanding debits =cut -sub normalize_balance { +sub reconcile_balance { my ($self) = @_; my $outstanding_debits = $self->outstanding_debits; diff --git a/t/db_dependent/Koha/Account.t b/t/db_dependent/Koha/Account.t index ad9da10f64..39c0664f27 100755 --- a/t/db_dependent/Koha/Account.t +++ b/t/db_dependent/Koha/Account.t @@ -226,7 +226,7 @@ subtest 'lines() tests' => sub { $schema->storage->txn_rollback; }; -subtest 'normalize_balance' => sub { +subtest 'reconcile_balance' => sub { plan tests => 3; @@ -260,7 +260,7 @@ subtest 'normalize_balance' => sub { is( $account->outstanding_debits->total_outstanding, 10, 'Outstanding debits sum 10' ); is( $account->outstanding_credits->total_outstanding, -15, 'Outstanding credits sum -15' ); - $account->normalize_balance(); + $account->reconcile_balance(); is( $account->balance(), -5, "Account balance is -5" ); is( $account->outstanding_debits->total_outstanding, 0, 'No outstanding debits' ); @@ -298,7 +298,7 @@ subtest 'normalize_balance' => sub { is( $account->outstanding_debits->total_outstanding, 10, 'Outstanding debits sum 10' ); is( $account->outstanding_credits->total_outstanding, -10, 'Outstanding credits sum -10' ); - $account->normalize_balance(); + $account->reconcile_balance(); is( $account->balance(), 0, "Account balance is 0" ); is( $account->outstanding_debits->total_outstanding, 0, 'No outstanding debits' ); @@ -337,7 +337,7 @@ subtest 'normalize_balance' => sub { is( $account->outstanding_debits->total_outstanding, 15, 'Outstanding debits sum 15' ); is( $account->outstanding_credits->total_outstanding, -10, 'Outstanding credits sum -10' ); - $account->normalize_balance(); + $account->reconcile_balance(); is( $account->balance(), 5, "Account balance is 5" ); is( $account->outstanding_debits->total_outstanding, 5, 'Outstanding debits sum 5' ); -- 2.39.5