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 <tomascohen@theke.io>

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Tomás Cohen Arazi 2018-11-28 10:24:36 -03:00 committed by Nick Clemens
parent 1176947b42
commit 5fc2ccd733
2 changed files with 7 additions and 7 deletions

View file

@ -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;

View file

@ -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' );